uikit 3.11.2-dev.ab82450f4 → 3.11.2-dev.e5a6313f1
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 +14 -2
- package/dist/css/uikit-core-rtl.css +1 -1
- 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 +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- 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 +37 -41
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +32 -25
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +3 -12
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +32 -25
- 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 +2 -3
- 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 +152 -81
- 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 +216 -159
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/state.js +4 -4
- package/src/js/components/parallax.js +5 -16
- package/src/js/components/slider.js +2 -11
- package/src/js/components/sortable.js +1 -2
- package/src/js/core/core.js +2 -2
- package/src/js/core/drop.js +1 -1
- package/src/js/core/height-viewport.js +2 -2
- package/src/js/core/navbar.js +6 -2
- package/src/js/core/sticky.js +82 -50
- package/src/js/mixin/parallax.js +32 -21
- package/src/js/util/dimensions.js +28 -12
- package/src/js/util/fastdom.js +2 -2
- package/src/js/util/viewport.js +7 -3
- package/tests/sticky-parallax.html +44 -41
- package/tests/sticky.html +56 -24
package/dist/js/uikit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.e5a6313f1 | 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() :
|
|
@@ -1587,7 +1587,7 @@
|
|
|
1587
1587
|
height: ['top', 'bottom']
|
|
1588
1588
|
};
|
|
1589
1589
|
|
|
1590
|
-
function dimensions(element) {
|
|
1590
|
+
function dimensions$1(element) {
|
|
1591
1591
|
|
|
1592
1592
|
var rect = isElement(element)
|
|
1593
1593
|
? toNode(element).getBoundingClientRect()
|
|
@@ -1605,7 +1605,7 @@
|
|
|
1605
1605
|
|
|
1606
1606
|
function offset(element, coordinates) {
|
|
1607
1607
|
|
|
1608
|
-
var currentOffset = dimensions(element);
|
|
1608
|
+
var currentOffset = dimensions$1(element);
|
|
1609
1609
|
|
|
1610
1610
|
if (element) {
|
|
1611
1611
|
var ref = toWindow(element);
|
|
@@ -1750,19 +1750,35 @@
|
|
|
1750
1750
|
if ( element === void 0 ) element = window;
|
|
1751
1751
|
if ( offsetDim === void 0 ) offsetDim = false;
|
|
1752
1752
|
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1753
|
+
|
|
1754
|
+
if (!isString(value)) {
|
|
1755
|
+
return toFloat(value);
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
return parseCalc(value).reduce(function (result, value) {
|
|
1759
|
+
var unit = parseUnit(value);
|
|
1760
|
+
if (unit) {
|
|
1761
|
+
value = percent(
|
|
1762
|
+
unit === 'vh'
|
|
1763
|
+
? height(toWindow(element))
|
|
1764
|
+
: unit === 'vw'
|
|
1765
|
+
? width(toWindow(element))
|
|
1766
|
+
: offsetDim
|
|
1767
|
+
? element[("offset" + (ucfirst(property)))]
|
|
1768
|
+
: dimensions$1(element)[property],
|
|
1769
|
+
value
|
|
1770
|
+
);
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
return result + toFloat(value);
|
|
1774
|
+
}, 0);
|
|
1764
1775
|
}
|
|
1765
1776
|
|
|
1777
|
+
var calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
|
|
1778
|
+
var parseCalc = memoize(function (calc) { return calc.toString().replace(/\s/g, '').match(calcRe) || []; });
|
|
1779
|
+
var unitRe = /(?:v[hw]|%)$/;
|
|
1780
|
+
var parseUnit = memoize(function (str) { return (str.match(unitRe) || [])[0]; });
|
|
1781
|
+
|
|
1766
1782
|
function percent(base, value) {
|
|
1767
1783
|
return base * toFloat(value) / 100;
|
|
1768
1784
|
}
|
|
@@ -1800,8 +1816,6 @@
|
|
|
1800
1816
|
};
|
|
1801
1817
|
|
|
1802
1818
|
function flush(recursion) {
|
|
1803
|
-
if ( recursion === void 0 ) recursion = 1;
|
|
1804
|
-
|
|
1805
1819
|
runTasks(fastdom.reads);
|
|
1806
1820
|
runTasks(fastdom.writes.splice(0));
|
|
1807
1821
|
|
|
@@ -1823,7 +1837,7 @@
|
|
|
1823
1837
|
if (recursion && recursion < RECURSION_LIMIT) {
|
|
1824
1838
|
Promise$1.resolve().then(function () { return flush(recursion); });
|
|
1825
1839
|
} else {
|
|
1826
|
-
requestAnimationFrame(function () { return flush(); });
|
|
1840
|
+
requestAnimationFrame(function () { return flush(1); });
|
|
1827
1841
|
}
|
|
1828
1842
|
|
|
1829
1843
|
}
|
|
@@ -2241,7 +2255,11 @@
|
|
|
2241
2255
|
element = toNode(element);
|
|
2242
2256
|
}
|
|
2243
2257
|
|
|
2244
|
-
|
|
2258
|
+
if (isUndefined(top)) {
|
|
2259
|
+
return element.scrollTop;
|
|
2260
|
+
} else {
|
|
2261
|
+
element.scrollTop = top;
|
|
2262
|
+
}
|
|
2245
2263
|
}
|
|
2246
2264
|
|
|
2247
2265
|
function scrollIntoView(element, ref) {
|
|
@@ -2548,7 +2566,7 @@
|
|
|
2548
2566
|
replaceClass: replaceClass,
|
|
2549
2567
|
hasClass: hasClass,
|
|
2550
2568
|
toggleClass: toggleClass,
|
|
2551
|
-
dimensions: dimensions,
|
|
2569
|
+
dimensions: dimensions$1,
|
|
2552
2570
|
offset: offset,
|
|
2553
2571
|
position: position,
|
|
2554
2572
|
offsetPosition: offsetPosition,
|
|
@@ -2673,7 +2691,8 @@
|
|
|
2673
2691
|
scrolledOver: scrolledOver,
|
|
2674
2692
|
scrollParents: scrollParents,
|
|
2675
2693
|
getViewport: getViewport$1,
|
|
2676
|
-
getViewportClientHeight: getViewportClientHeight
|
|
2694
|
+
getViewportClientHeight: getViewportClientHeight,
|
|
2695
|
+
getScrollingElement: getScrollingElement
|
|
2677
2696
|
});
|
|
2678
2697
|
|
|
2679
2698
|
function globalAPI (UIkit) {
|
|
@@ -3137,11 +3156,11 @@
|
|
|
3137
3156
|
on(
|
|
3138
3157
|
el,
|
|
3139
3158
|
name,
|
|
3140
|
-
|
|
3141
|
-
?
|
|
3142
|
-
: isString(delegate)
|
|
3159
|
+
delegate
|
|
3160
|
+
? isString(delegate)
|
|
3143
3161
|
? delegate
|
|
3144
|
-
: delegate.call(component)
|
|
3162
|
+
: delegate.call(component)
|
|
3163
|
+
: null,
|
|
3145
3164
|
isString(handler) ? component[handler] : handler.bind(component),
|
|
3146
3165
|
{passive: passive, capture: capture, self: self}
|
|
3147
3166
|
)
|
|
@@ -3462,7 +3481,7 @@
|
|
|
3462
3481
|
UIkit.data = '__uikit__';
|
|
3463
3482
|
UIkit.prefix = 'uk-';
|
|
3464
3483
|
UIkit.options = {};
|
|
3465
|
-
UIkit.version = '3.11.2-dev.
|
|
3484
|
+
UIkit.version = '3.11.2-dev.e5a6313f1';
|
|
3466
3485
|
|
|
3467
3486
|
globalAPI(UIkit);
|
|
3468
3487
|
hooksAPI(UIkit);
|
|
@@ -3483,7 +3502,7 @@
|
|
|
3483
3502
|
return;
|
|
3484
3503
|
}
|
|
3485
3504
|
pendingResize = true;
|
|
3486
|
-
fastdom.
|
|
3505
|
+
fastdom.read(function () { return pendingResize = false; });
|
|
3487
3506
|
UIkit.update(null, 'resize');
|
|
3488
3507
|
};
|
|
3489
3508
|
|
|
@@ -3502,7 +3521,7 @@
|
|
|
3502
3521
|
return;
|
|
3503
3522
|
}
|
|
3504
3523
|
pending = true;
|
|
3505
|
-
fastdom.
|
|
3524
|
+
fastdom.read(function () { return pending = false; });
|
|
3506
3525
|
|
|
3507
3526
|
UIkit.update(null, e.type);
|
|
3508
3527
|
|
|
@@ -4588,7 +4607,7 @@
|
|
|
4588
4607
|
if (active$1) {
|
|
4589
4608
|
|
|
4590
4609
|
if (delay && active$1.isDelaying) {
|
|
4591
|
-
this.showTimer = setTimeout(this.show, 10);
|
|
4610
|
+
this.showTimer = setTimeout(function () { return matches(target, ':hover') && this$1$1.show(); }, 10);
|
|
4592
4611
|
return;
|
|
4593
4612
|
}
|
|
4594
4613
|
|
|
@@ -5222,7 +5241,7 @@
|
|
|
5222
5241
|
css(element, 'display', 'block', 'important');
|
|
5223
5242
|
}
|
|
5224
5243
|
|
|
5225
|
-
var height = dimensions(element).height - boxModelAdjust(element, 'height', 'content-box');
|
|
5244
|
+
var height = dimensions$1(element).height - boxModelAdjust(element, 'height', 'content-box');
|
|
5226
5245
|
|
|
5227
5246
|
if (style !== false) {
|
|
5228
5247
|
css(element, 'display', style);
|
|
@@ -5264,7 +5283,7 @@
|
|
|
5264
5283
|
|
|
5265
5284
|
if (this.expand) {
|
|
5266
5285
|
|
|
5267
|
-
minHeight = height(window) - (dimensions(document.documentElement).height - dimensions(this.$el).height) - box || '';
|
|
5286
|
+
minHeight = height(window) - (dimensions$1(document.documentElement).height - dimensions$1(this.$el).height) - box || '';
|
|
5268
5287
|
|
|
5269
5288
|
} else {
|
|
5270
5289
|
|
|
@@ -5281,7 +5300,7 @@
|
|
|
5281
5300
|
|
|
5282
5301
|
if (this.offsetBottom === true) {
|
|
5283
5302
|
|
|
5284
|
-
minHeight += " - " + (dimensions(this.$el.nextElementSibling).height) + "px";
|
|
5303
|
+
minHeight += " - " + (dimensions$1(this.$el.nextElementSibling).height) + "px";
|
|
5285
5304
|
|
|
5286
5305
|
} else if (isNumeric(this.offsetBottom)) {
|
|
5287
5306
|
|
|
@@ -5293,7 +5312,7 @@
|
|
|
5293
5312
|
|
|
5294
5313
|
} else if (isString(this.offsetBottom)) {
|
|
5295
5314
|
|
|
5296
|
-
minHeight += " - " + (dimensions(query(this.offsetBottom, this.$el)).height) + "px";
|
|
5315
|
+
minHeight += " - " + (dimensions$1(query(this.offsetBottom, this.$el)).height) + "px";
|
|
5297
5316
|
|
|
5298
5317
|
}
|
|
5299
5318
|
|
|
@@ -5312,7 +5331,7 @@
|
|
|
5312
5331
|
css(this.$el, {minHeight: minHeight});
|
|
5313
5332
|
|
|
5314
5333
|
if (minHeight !== prev) {
|
|
5315
|
-
|
|
5334
|
+
trigger(this.$el, 'resize');
|
|
5316
5335
|
}
|
|
5317
5336
|
|
|
5318
5337
|
if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
|
|
@@ -6720,7 +6739,7 @@
|
|
|
6720
6739
|
var current = ref.current;
|
|
6721
6740
|
|
|
6722
6741
|
var active = this.getActive();
|
|
6723
|
-
if (active && includes(active.mode, 'hover') && active.target && !within(active.target, current) && !active.
|
|
6742
|
+
if (active && includes(active.mode, 'hover') && active.target && !within(active.target, current) && !active.isDelaying) {
|
|
6724
6743
|
active.hide(false);
|
|
6725
6744
|
}
|
|
6726
6745
|
}
|
|
@@ -6895,7 +6914,11 @@
|
|
|
6895
6914
|
|
|
6896
6915
|
var active = this.getActive();
|
|
6897
6916
|
|
|
6898
|
-
if (matches(this.dropbar, ':hover')
|
|
6917
|
+
if (matches(this.dropbar, ':hover')
|
|
6918
|
+
&& active
|
|
6919
|
+
&& active.$el === $el
|
|
6920
|
+
&& !this.toggles.some(function (el) { return active.target !== el && matches(el, ':focus'); })
|
|
6921
|
+
) {
|
|
6899
6922
|
e.preventDefault();
|
|
6900
6923
|
}
|
|
6901
6924
|
}
|
|
@@ -7325,7 +7348,7 @@
|
|
|
7325
7348
|
|
|
7326
7349
|
return {
|
|
7327
7350
|
current: toFloat(css(this.$el, 'maxHeight')),
|
|
7328
|
-
max: Math.max(this.minHeight, height(this.container) - (dimensions(this.content).height - height(this.$el)))
|
|
7351
|
+
max: Math.max(this.minHeight, height(this.container) - (dimensions$1(this.content).height - height(this.$el)))
|
|
7329
7352
|
};
|
|
7330
7353
|
},
|
|
7331
7354
|
|
|
@@ -7687,6 +7710,7 @@
|
|
|
7687
7710
|
mixins: [Class, Media],
|
|
7688
7711
|
|
|
7689
7712
|
props: {
|
|
7713
|
+
position: String,
|
|
7690
7714
|
top: null,
|
|
7691
7715
|
bottom: Boolean,
|
|
7692
7716
|
offset: String,
|
|
@@ -7702,6 +7726,7 @@
|
|
|
7702
7726
|
},
|
|
7703
7727
|
|
|
7704
7728
|
data: {
|
|
7729
|
+
position: 'top',
|
|
7705
7730
|
top: 0,
|
|
7706
7731
|
bottom: false,
|
|
7707
7732
|
offset: 0,
|
|
@@ -7718,10 +7743,23 @@
|
|
|
7718
7743
|
|
|
7719
7744
|
computed: {
|
|
7720
7745
|
|
|
7721
|
-
|
|
7746
|
+
position: function(ref, $el) {
|
|
7747
|
+
var position = ref.position;
|
|
7748
|
+
|
|
7749
|
+
return position === 'auto'
|
|
7750
|
+
? (this.isFixed ? this.placeholder : $el).offsetHeight > height(window)
|
|
7751
|
+
? 'bottom'
|
|
7752
|
+
: 'top'
|
|
7753
|
+
: position;
|
|
7754
|
+
},
|
|
7755
|
+
|
|
7756
|
+
offset: function(ref, $el) {
|
|
7722
7757
|
var offset = ref.offset;
|
|
7723
7758
|
|
|
7724
|
-
|
|
7759
|
+
if (this.position === 'bottom') {
|
|
7760
|
+
offset += '+100vh-100%';
|
|
7761
|
+
}
|
|
7762
|
+
return toPx(offset, 'height', $el);
|
|
7725
7763
|
},
|
|
7726
7764
|
|
|
7727
7765
|
selTarget: function(ref, $el) {
|
|
@@ -7788,7 +7826,7 @@
|
|
|
7788
7826
|
var this$1$1 = this;
|
|
7789
7827
|
|
|
7790
7828
|
|
|
7791
|
-
if (!(this.targetOffset !== false && location.hash && window
|
|
7829
|
+
if (!(this.targetOffset !== false && location.hash && scrollTop(window) > 0)) {
|
|
7792
7830
|
return;
|
|
7793
7831
|
}
|
|
7794
7832
|
|
|
@@ -7821,6 +7859,7 @@
|
|
|
7821
7859
|
|
|
7822
7860
|
read: function(ref, types) {
|
|
7823
7861
|
var height$1 = ref.height;
|
|
7862
|
+
var margin = ref.margin;
|
|
7824
7863
|
|
|
7825
7864
|
|
|
7826
7865
|
this.inactive = !this.matchMedia || !isVisible(this.$el);
|
|
@@ -7829,46 +7868,56 @@
|
|
|
7829
7868
|
return false;
|
|
7830
7869
|
}
|
|
7831
7870
|
|
|
7832
|
-
|
|
7871
|
+
var hide = this.isActive && types.has('resize');
|
|
7872
|
+
if (hide) {
|
|
7833
7873
|
this.hide();
|
|
7834
|
-
height$1 = this.$el.offsetHeight;
|
|
7835
|
-
this.show();
|
|
7836
7874
|
}
|
|
7837
7875
|
|
|
7838
|
-
|
|
7876
|
+
if (!this.isActive) {
|
|
7877
|
+
height$1 = this.$el.offsetHeight;
|
|
7878
|
+
margin = css(this.$el, 'margin');
|
|
7879
|
+
}
|
|
7839
7880
|
|
|
7840
|
-
if (
|
|
7841
|
-
this.
|
|
7842
|
-
return false;
|
|
7881
|
+
if (hide) {
|
|
7882
|
+
this.show();
|
|
7843
7883
|
}
|
|
7844
7884
|
|
|
7885
|
+
var overflow = Math.max(0, height$1 + this.offset - height(window));
|
|
7886
|
+
|
|
7845
7887
|
var referenceElement = this.isFixed ? this.placeholder : this.$el;
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
this.offsetParentTop = offset(referenceElement.offsetParent).top;
|
|
7888
|
+
var topOffset = offset(referenceElement).top;
|
|
7889
|
+
var offsetParentTop = offset(referenceElement.offsetParent).top;
|
|
7849
7890
|
|
|
7850
|
-
var
|
|
7891
|
+
var top = parseProp(this.top, this.$el, topOffset);
|
|
7892
|
+
var bottom = parseProp(this.bottom, this.$el, topOffset + height$1);
|
|
7851
7893
|
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7894
|
+
var start = Math.max(top, topOffset) - this.offset;
|
|
7895
|
+
var end = bottom
|
|
7896
|
+
? bottom - this.$el.offsetHeight + overflow - this.offset
|
|
7897
|
+
: getScrollingElement(this.$el).scrollHeight - height(window);
|
|
7855
7898
|
|
|
7856
7899
|
return {
|
|
7900
|
+
start: start,
|
|
7901
|
+
end: end,
|
|
7902
|
+
overflow: overflow,
|
|
7903
|
+
topOffset: topOffset,
|
|
7904
|
+
offsetParentTop: offsetParentTop,
|
|
7857
7905
|
height: height$1,
|
|
7858
|
-
|
|
7859
|
-
|
|
7906
|
+
margin: margin,
|
|
7907
|
+
width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).width,
|
|
7908
|
+
top: offsetPosition(this.placeholder)[0]
|
|
7860
7909
|
};
|
|
7861
7910
|
},
|
|
7862
7911
|
|
|
7863
7912
|
write: function(ref) {
|
|
7864
7913
|
var height = ref.height;
|
|
7865
|
-
var
|
|
7914
|
+
var margin = ref.margin;
|
|
7866
7915
|
|
|
7867
7916
|
|
|
7868
7917
|
var ref$1 = this;
|
|
7869
7918
|
var placeholder = ref$1.placeholder;
|
|
7870
7919
|
|
|
7871
|
-
css(placeholder,
|
|
7920
|
+
css(placeholder, {height: height, margin: margin});
|
|
7872
7921
|
|
|
7873
7922
|
if (!within(placeholder, document)) {
|
|
7874
7923
|
after(this.$el, placeholder);
|
|
@@ -7886,14 +7935,29 @@
|
|
|
7886
7935
|
{
|
|
7887
7936
|
|
|
7888
7937
|
read: function(ref) {
|
|
7889
|
-
var
|
|
7938
|
+
var prevScroll = ref.scroll; if ( prevScroll === void 0 ) prevScroll = 0;
|
|
7939
|
+
var prevDir = ref.dir; if ( prevDir === void 0 ) prevDir = 'down';
|
|
7940
|
+
var overflow = ref.overflow;
|
|
7941
|
+
var overflowScroll = ref.overflowScroll; if ( overflowScroll === void 0 ) overflowScroll = 0;
|
|
7942
|
+
var start = ref.start;
|
|
7943
|
+
var end = ref.end;
|
|
7890
7944
|
|
|
7891
7945
|
|
|
7892
|
-
|
|
7946
|
+
var scroll = scrollTop(window);
|
|
7947
|
+
var dir = prevScroll <= scroll ? 'down' : 'up';
|
|
7893
7948
|
|
|
7894
7949
|
return {
|
|
7895
|
-
dir:
|
|
7896
|
-
|
|
7950
|
+
dir: dir,
|
|
7951
|
+
prevDir: prevDir,
|
|
7952
|
+
scroll: scroll,
|
|
7953
|
+
prevScroll: prevScroll,
|
|
7954
|
+
overflowScroll: clamp(
|
|
7955
|
+
overflowScroll
|
|
7956
|
+
+ clamp(scroll, start, end)
|
|
7957
|
+
- clamp(prevScroll, start, end),
|
|
7958
|
+
0,
|
|
7959
|
+
overflow
|
|
7960
|
+
)
|
|
7897
7961
|
};
|
|
7898
7962
|
},
|
|
7899
7963
|
|
|
@@ -7901,35 +7965,34 @@
|
|
|
7901
7965
|
var this$1$1 = this;
|
|
7902
7966
|
|
|
7903
7967
|
|
|
7904
|
-
var now = Date.now();
|
|
7905
7968
|
var isScrollUpdate = types.has('scroll');
|
|
7906
7969
|
var initTimestamp = data.initTimestamp; if ( initTimestamp === void 0 ) initTimestamp = 0;
|
|
7907
7970
|
var dir = data.dir;
|
|
7908
|
-
var
|
|
7909
|
-
var lastScroll = data.lastScroll;
|
|
7971
|
+
var prevDir = data.prevDir;
|
|
7910
7972
|
var scroll = data.scroll;
|
|
7973
|
+
var prevScroll = data.prevScroll; if ( prevScroll === void 0 ) prevScroll = 0;
|
|
7911
7974
|
var top = data.top;
|
|
7975
|
+
var start = data.start;
|
|
7976
|
+
var topOffset = data.topOffset;
|
|
7977
|
+
var height = data.height;
|
|
7912
7978
|
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
if (scroll < 0 || scroll === lastScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
|
|
7979
|
+
if (scroll < 0 || scroll === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
|
|
7916
7980
|
return;
|
|
7917
7981
|
}
|
|
7918
7982
|
|
|
7919
|
-
|
|
7983
|
+
var now = Date.now();
|
|
7984
|
+
if (now - initTimestamp > 300 || dir !== prevDir) {
|
|
7920
7985
|
data.initScroll = scroll;
|
|
7921
7986
|
data.initTimestamp = now;
|
|
7922
7987
|
}
|
|
7923
7988
|
|
|
7924
|
-
data.
|
|
7925
|
-
|
|
7926
|
-
if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(lastScroll - scroll) <= 10) {
|
|
7989
|
+
if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(prevScroll - scroll) <= 10) {
|
|
7927
7990
|
return;
|
|
7928
7991
|
}
|
|
7929
7992
|
|
|
7930
7993
|
if (this.inactive
|
|
7931
|
-
|| scroll <
|
|
7932
|
-
|| this.showOnUp && (scroll <=
|
|
7994
|
+
|| scroll < start
|
|
7995
|
+
|| this.showOnUp && (scroll <= start || dir === 'down' && isScrollUpdate || dir === 'up' && !this.isFixed && scroll <= topOffset + height)
|
|
7933
7996
|
) {
|
|
7934
7997
|
|
|
7935
7998
|
if (!this.isFixed) {
|
|
@@ -7944,7 +8007,7 @@
|
|
|
7944
8007
|
|
|
7945
8008
|
this.isFixed = false;
|
|
7946
8009
|
|
|
7947
|
-
if (this.animation && scroll >
|
|
8010
|
+
if (this.animation && scroll > topOffset) {
|
|
7948
8011
|
Animation.cancel(this.$el);
|
|
7949
8012
|
Animation.out(this.$el, this.animation).then(function () { return this$1$1.hide(); }, noop);
|
|
7950
8013
|
} else {
|
|
@@ -7994,23 +8057,37 @@
|
|
|
7994
8057
|
|
|
7995
8058
|
update: function() {
|
|
7996
8059
|
|
|
7997
|
-
var
|
|
7998
|
-
var
|
|
8060
|
+
var ref = this._data;
|
|
8061
|
+
var width = ref.width;
|
|
8062
|
+
var scroll = ref.scroll; if ( scroll === void 0 ) scroll = 0;
|
|
8063
|
+
var overflow = ref.overflow;
|
|
8064
|
+
var overflowScroll = ref.overflowScroll; if ( overflowScroll === void 0 ) overflowScroll = 0;
|
|
8065
|
+
var start = ref.start;
|
|
8066
|
+
var end = ref.end;
|
|
8067
|
+
var topOffset = ref.topOffset;
|
|
8068
|
+
var height = ref.height;
|
|
8069
|
+
var offsetParentTop = ref.offsetParentTop;
|
|
8070
|
+
var active = start !== 0 || scroll > start;
|
|
8071
|
+
var top = this.offset;
|
|
7999
8072
|
var position = 'fixed';
|
|
8000
8073
|
|
|
8001
|
-
if (
|
|
8002
|
-
top = this.
|
|
8074
|
+
if (scroll > end) {
|
|
8075
|
+
top = end + this.offset - offsetParentTop;
|
|
8003
8076
|
position = 'absolute';
|
|
8004
8077
|
}
|
|
8005
8078
|
|
|
8079
|
+
if (overflow) {
|
|
8080
|
+
top -= overflowScroll;
|
|
8081
|
+
}
|
|
8082
|
+
|
|
8006
8083
|
css(this.$el, {
|
|
8007
8084
|
position: position,
|
|
8008
8085
|
top: (top + "px"),
|
|
8009
|
-
width:
|
|
8086
|
+
width: width
|
|
8010
8087
|
});
|
|
8011
8088
|
|
|
8012
8089
|
this.isActive = active;
|
|
8013
|
-
toggleClass(this.$el, this.clsBelow,
|
|
8090
|
+
toggleClass(this.$el, this.clsBelow, scroll > topOffset + height);
|
|
8014
8091
|
addClass(this.$el, this.clsFixed);
|
|
8015
8092
|
|
|
8016
8093
|
}
|
|
@@ -8019,16 +8096,10 @@
|
|
|
8019
8096
|
|
|
8020
8097
|
};
|
|
8021
8098
|
|
|
8022
|
-
function parseProp(
|
|
8023
|
-
var $props = ref.$props;
|
|
8024
|
-
var $el = ref.$el;
|
|
8025
|
-
var propOffset = ref[(prop + "Offset")];
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
var value = $props[prop];
|
|
8099
|
+
function parseProp(value, el, propOffset) {
|
|
8029
8100
|
|
|
8030
8101
|
if (!value) {
|
|
8031
|
-
return;
|
|
8102
|
+
return 0;
|
|
8032
8103
|
}
|
|
8033
8104
|
|
|
8034
8105
|
if (isString(value) && value.match(/^-?\d/)) {
|
|
@@ -8037,7 +8108,7 @@
|
|
|
8037
8108
|
|
|
8038
8109
|
} else {
|
|
8039
8110
|
|
|
8040
|
-
return offset(value === true ? parent(
|
|
8111
|
+
return offset(value === true ? parent(el) : query(value, el)).bottom;
|
|
8041
8112
|
|
|
8042
8113
|
}
|
|
8043
8114
|
}
|
|
@@ -10734,11 +10805,9 @@
|
|
|
10734
10805
|
computed: {
|
|
10735
10806
|
|
|
10736
10807
|
props: function(properties, $el) {
|
|
10737
|
-
var this$1$1 = this;
|
|
10738
|
-
|
|
10739
10808
|
return keys(props).reduce(function (result, prop) {
|
|
10740
10809
|
if (!isUndefined(properties[prop])) {
|
|
10741
|
-
result[prop] = props[prop]
|
|
10810
|
+
result[prop] = props[prop](prop, $el, properties[prop].slice());
|
|
10742
10811
|
}
|
|
10743
10812
|
return result;
|
|
10744
10813
|
}, {});
|
|
@@ -10746,6 +10815,12 @@
|
|
|
10746
10815
|
|
|
10747
10816
|
},
|
|
10748
10817
|
|
|
10818
|
+
events: {
|
|
10819
|
+
bgimageload: function() {
|
|
10820
|
+
this.$emit();
|
|
10821
|
+
}
|
|
10822
|
+
},
|
|
10823
|
+
|
|
10749
10824
|
methods: {
|
|
10750
10825
|
|
|
10751
10826
|
reset: function() {
|
|
@@ -10893,15 +10968,15 @@
|
|
|
10893
10968
|
var bgPos = css(el, 'backgroundPosition').split(' ')[prop === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
|
|
10894
10969
|
|
|
10895
10970
|
return getCssValue(el, 'backgroundSize', '') === 'cover'
|
|
10896
|
-
? backgroundCoverFn
|
|
10971
|
+
? backgroundCoverFn(prop, el, steps, bgPos, attr)
|
|
10897
10972
|
: setBackgroundPosFn(prop, steps, bgPos);
|
|
10898
10973
|
}
|
|
10899
10974
|
|
|
10900
10975
|
function backgroundCoverFn(prop, el, steps, bgPos, attr) {
|
|
10901
10976
|
|
|
10902
|
-
var
|
|
10977
|
+
var dimImage = getBackgroundImageDimensions(el);
|
|
10903
10978
|
|
|
10904
|
-
if (!
|
|
10979
|
+
if (!dimImage.width) {
|
|
10905
10980
|
return noop;
|
|
10906
10981
|
}
|
|
10907
10982
|
|
|
@@ -10917,11 +10992,6 @@
|
|
|
10917
10992
|
height: el.offsetHeight
|
|
10918
10993
|
};
|
|
10919
10994
|
|
|
10920
|
-
var dimImage = {
|
|
10921
|
-
width: image.naturalWidth,
|
|
10922
|
-
height: image.naturalHeight
|
|
10923
|
-
};
|
|
10924
|
-
|
|
10925
10995
|
var baseDim = Dimensions.cover(dimImage, dimEl);
|
|
10926
10996
|
var span = baseDim[attr] - dimEl[attr];
|
|
10927
10997
|
|
|
@@ -10952,26 +11022,34 @@
|
|
|
10952
11022
|
};
|
|
10953
11023
|
}
|
|
10954
11024
|
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
11025
|
+
var dimensions = {};
|
|
11026
|
+
function getBackgroundImageDimensions(el) {
|
|
10958
11027
|
var src = css(el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
|
|
10959
11028
|
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
if (data[src]) {
|
|
10963
|
-
return data[src];
|
|
11029
|
+
if (dimensions[src]) {
|
|
11030
|
+
return dimensions[src];
|
|
10964
11031
|
}
|
|
10965
11032
|
|
|
11033
|
+
var image = new Image();
|
|
10966
11034
|
if (src) {
|
|
10967
|
-
|
|
10968
|
-
img.src = src;
|
|
10969
|
-
if (!img.naturalWidth) {
|
|
10970
|
-
img.onload = function () { return this$1$1.$update(); };
|
|
10971
|
-
}
|
|
11035
|
+
image.src = src;
|
|
10972
11036
|
|
|
10973
|
-
|
|
11037
|
+
if (!image.naturalWidth) {
|
|
11038
|
+
image.onload = function () {
|
|
11039
|
+
dimensions[src] = toDimensions(image);
|
|
11040
|
+
trigger(el, 'bgimageload');
|
|
11041
|
+
};
|
|
11042
|
+
}
|
|
10974
11043
|
}
|
|
11044
|
+
|
|
11045
|
+
return dimensions[src] = toDimensions(image);
|
|
11046
|
+
}
|
|
11047
|
+
|
|
11048
|
+
function toDimensions(image) {
|
|
11049
|
+
return {
|
|
11050
|
+
width: image.naturalWidth,
|
|
11051
|
+
height: image.naturalHeight
|
|
11052
|
+
};
|
|
10975
11053
|
}
|
|
10976
11054
|
|
|
10977
11055
|
function getStep(steps, percent) {
|
|
@@ -11042,16 +11120,18 @@
|
|
|
11042
11120
|
start: function(ref) {
|
|
11043
11121
|
var start = ref.start;
|
|
11044
11122
|
|
|
11045
|
-
return
|
|
11123
|
+
return toPx(start, 'height', this.target, true);
|
|
11046
11124
|
},
|
|
11047
11125
|
|
|
11048
11126
|
end: function(ref) {
|
|
11049
11127
|
var end = ref.end;
|
|
11050
11128
|
var viewport = ref.viewport;
|
|
11051
11129
|
|
|
11052
|
-
return
|
|
11130
|
+
return toPx(
|
|
11053
11131
|
end || (viewport = (1 - viewport) * 100) && (viewport + "vh+" + viewport + "%"),
|
|
11054
|
-
|
|
11132
|
+
'height',
|
|
11133
|
+
this.target,
|
|
11134
|
+
true
|
|
11055
11135
|
);
|
|
11056
11136
|
}
|
|
11057
11137
|
|
|
@@ -11098,19 +11178,6 @@
|
|
|
11098
11178
|
|
|
11099
11179
|
};
|
|
11100
11180
|
|
|
11101
|
-
var calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
|
|
11102
|
-
function parseCalc(calc, el) {
|
|
11103
|
-
var match;
|
|
11104
|
-
var result = 0;
|
|
11105
|
-
calc = calc.toString().replace(/\s/g, '');
|
|
11106
|
-
calcRe.lastIndex = 0;
|
|
11107
|
-
while ((match = calcRe.exec(calc)) !== null) {
|
|
11108
|
-
result += toPx(match[0], 'height', el, true);
|
|
11109
|
-
}
|
|
11110
|
-
|
|
11111
|
-
return result;
|
|
11112
|
-
}
|
|
11113
|
-
|
|
11114
11181
|
function ease(percent, easing) {
|
|
11115
11182
|
return easing >= 0
|
|
11116
11183
|
? Math.pow(percent, easing + 1)
|
|
@@ -11160,10 +11227,10 @@
|
|
|
11160
11227
|
|
|
11161
11228
|
var from = prev
|
|
11162
11229
|
? getLeft(prev, list, center)
|
|
11163
|
-
: getLeft(next, list, center) + dimensions(next).width * dir;
|
|
11230
|
+
: getLeft(next, list, center) + dimensions$1(next).width * dir;
|
|
11164
11231
|
var to = next
|
|
11165
11232
|
? getLeft(next, list, center)
|
|
11166
|
-
: from + dimensions(prev).width * dir * (isRtl ? -1 : 1);
|
|
11233
|
+
: from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);
|
|
11167
11234
|
|
|
11168
11235
|
return {
|
|
11169
11236
|
|
|
@@ -11212,7 +11279,7 @@
|
|
|
11212
11279
|
css(list, 'transform', translate(clamp(
|
|
11213
11280
|
-to + (distance - distance * percent),
|
|
11214
11281
|
-getWidth(list),
|
|
11215
|
-
dimensions(list).width
|
|
11282
|
+
dimensions$1(list).width
|
|
11216
11283
|
) * (isRtl ? -1 : 1), 'px'));
|
|
11217
11284
|
|
|
11218
11285
|
var actives = this.getActives();
|
|
@@ -11285,30 +11352,30 @@
|
|
|
11285
11352
|
}
|
|
11286
11353
|
|
|
11287
11354
|
function getMax(list) {
|
|
11288
|
-
return Math.max(0, getWidth(list) - dimensions(list).width);
|
|
11355
|
+
return Math.max(0, getWidth(list) - dimensions$1(list).width);
|
|
11289
11356
|
}
|
|
11290
11357
|
|
|
11291
11358
|
function getWidth(list) {
|
|
11292
|
-
return children(list).reduce(function (right, el) { return dimensions(el).width + right; }, 0);
|
|
11359
|
+
return children(list).reduce(function (right, el) { return dimensions$1(el).width + right; }, 0);
|
|
11293
11360
|
}
|
|
11294
11361
|
|
|
11295
11362
|
function centerEl(el, list) {
|
|
11296
|
-
return dimensions(list).width / 2 - dimensions(el).width / 2;
|
|
11363
|
+
return dimensions$1(list).width / 2 - dimensions$1(el).width / 2;
|
|
11297
11364
|
}
|
|
11298
11365
|
|
|
11299
11366
|
function getElLeft(el, list) {
|
|
11300
|
-
return el && (position(el).left + (isRtl ? dimensions(el).width - dimensions(list).width : 0)) * (isRtl ? -1 : 1) || 0;
|
|
11367
|
+
return el && (position(el).left + (isRtl ? dimensions$1(el).width - dimensions$1(list).width : 0)) * (isRtl ? -1 : 1) || 0;
|
|
11301
11368
|
}
|
|
11302
11369
|
|
|
11303
11370
|
function inView(list, listLeft) {
|
|
11304
11371
|
|
|
11305
11372
|
listLeft -= 1;
|
|
11306
|
-
var listWidth = dimensions(list).width;
|
|
11373
|
+
var listWidth = dimensions$1(list).width;
|
|
11307
11374
|
var listRight = listLeft + listWidth + 2;
|
|
11308
11375
|
|
|
11309
11376
|
return children(list).filter(function (slide) {
|
|
11310
11377
|
var slideLeft = getElLeft(slide, list);
|
|
11311
|
-
var slideRight = slideLeft + Math.min(dimensions(slide).width, listWidth);
|
|
11378
|
+
var slideRight = slideLeft + Math.min(dimensions$1(slide).width, listWidth);
|
|
11312
11379
|
|
|
11313
11380
|
return slideLeft >= listLeft && slideRight <= listRight;
|
|
11314
11381
|
});
|
|
@@ -11346,16 +11413,7 @@
|
|
|
11346
11413
|
finite: function(ref) {
|
|
11347
11414
|
var finite = ref.finite;
|
|
11348
11415
|
|
|
11349
|
-
|
|
11350
|
-
console.log(
|
|
11351
|
-
Math.ceil(getWidth(this.list)) < dimensions(this.list).width + getMaxElWidth(this.list),
|
|
11352
|
-
getWidth(this.list),
|
|
11353
|
-
dimensions(this.list).width + getMaxElWidth(this.list),
|
|
11354
|
-
dimensions(this.list).width,
|
|
11355
|
-
getMaxElWidth(this.list)
|
|
11356
|
-
);
|
|
11357
|
-
|
|
11358
|
-
return finite || Math.ceil(getWidth(this.list)) < Math.floor(dimensions(this.list).width + getMaxElWidth(this.list));
|
|
11416
|
+
return finite || Math.ceil(getWidth(this.list)) < Math.floor(dimensions$1(this.list).width + getMaxElWidth(this.list) + this.center);
|
|
11359
11417
|
},
|
|
11360
11418
|
|
|
11361
11419
|
maxIndex: function() {
|
|
@@ -11376,7 +11434,7 @@
|
|
|
11376
11434
|
return true;
|
|
11377
11435
|
}
|
|
11378
11436
|
|
|
11379
|
-
lft += dimensions(el).width;
|
|
11437
|
+
lft += dimensions$1(el).width;
|
|
11380
11438
|
|
|
11381
11439
|
});
|
|
11382
11440
|
|
|
@@ -11392,7 +11450,7 @@
|
|
|
11392
11450
|
return;
|
|
11393
11451
|
}
|
|
11394
11452
|
|
|
11395
|
-
var width = dimensions(this.list).width / (this.center ? 2 : 1);
|
|
11453
|
+
var width = dimensions$1(this.list).width / (this.center ? 2 : 1);
|
|
11396
11454
|
|
|
11397
11455
|
var left = 0;
|
|
11398
11456
|
var leftCenter = width;
|
|
@@ -11400,7 +11458,7 @@
|
|
|
11400
11458
|
|
|
11401
11459
|
sets = sortBy$1(this.slides, 'offsetLeft').reduce(function (sets, slide, i) {
|
|
11402
11460
|
|
|
11403
|
-
var slideWidth = dimensions(slide).width;
|
|
11461
|
+
var slideWidth = dimensions$1(slide).width;
|
|
11404
11462
|
var slideRight = slideLeft + slideWidth;
|
|
11405
11463
|
|
|
11406
11464
|
if (slideRight > left) {
|
|
@@ -11412,7 +11470,7 @@
|
|
|
11412
11470
|
if (!includes(sets, i)) {
|
|
11413
11471
|
|
|
11414
11472
|
var cmp = this$1$1.slides[i + 1];
|
|
11415
|
-
if (this$1$1.center && cmp && slideWidth < leftCenter - dimensions(cmp).width / 2) {
|
|
11473
|
+
if (this$1$1.center && cmp && slideWidth < leftCenter - dimensions$1(cmp).width / 2) {
|
|
11416
11474
|
leftCenter -= slideWidth;
|
|
11417
11475
|
} else {
|
|
11418
11476
|
leftCenter = width;
|
|
@@ -11500,7 +11558,7 @@
|
|
|
11500
11558
|
}
|
|
11501
11559
|
|
|
11502
11560
|
var index = this.dir < 0 || !this.slides[this.prevIndex] ? this.index : this.prevIndex;
|
|
11503
|
-
this.duration = speedUp(this.avgWidth / this.velocity) * (dimensions(this.slides[index]).width / this.avgWidth);
|
|
11561
|
+
this.duration = speedUp(this.avgWidth / this.velocity) * (dimensions$1(this.slides[index]).width / this.avgWidth);
|
|
11504
11562
|
|
|
11505
11563
|
this.reorder();
|
|
11506
11564
|
|
|
@@ -11540,15 +11598,15 @@
|
|
|
11540
11598
|
}
|
|
11541
11599
|
|
|
11542
11600
|
var next = this.slides[index];
|
|
11543
|
-
var width = dimensions(this.list).width / 2 - dimensions(next).width / 2;
|
|
11601
|
+
var width = dimensions$1(this.list).width / 2 - dimensions$1(next).width / 2;
|
|
11544
11602
|
var j = 0;
|
|
11545
11603
|
|
|
11546
|
-
while (
|
|
11604
|
+
while (width > 0) {
|
|
11547
11605
|
var slideIndex = this.getIndex(--j + index, index);
|
|
11548
11606
|
var slide = this.slides[slideIndex];
|
|
11549
11607
|
|
|
11550
11608
|
css(slide, 'order', slideIndex > index ? -2 : -1);
|
|
11551
|
-
width -= dimensions(slide).width;
|
|
11609
|
+
width -= dimensions$1(slide).width;
|
|
11552
11610
|
}
|
|
11553
11611
|
|
|
11554
11612
|
},
|
|
@@ -11585,7 +11643,7 @@
|
|
|
11585
11643
|
};
|
|
11586
11644
|
|
|
11587
11645
|
function getMaxElWidth(list) {
|
|
11588
|
-
return Math.max.apply(Math, [ 0 ].concat( children(list).map(function (el) { return dimensions(el).width; }) ));
|
|
11646
|
+
return Math.max.apply(Math, [ 0 ].concat( children(list).map(function (el) { return dimensions$1(el).width; }) ));
|
|
11589
11647
|
}
|
|
11590
11648
|
|
|
11591
11649
|
var sliderParallax = {
|
|
@@ -12099,7 +12157,6 @@
|
|
|
12099
12157
|
|
|
12100
12158
|
off(document, pointerMove, this.move);
|
|
12101
12159
|
off(document, pointerUp, this.end);
|
|
12102
|
-
off(window, 'scroll', this.scroll);
|
|
12103
12160
|
|
|
12104
12161
|
if (!this.drag) {
|
|
12105
12162
|
return;
|
|
@@ -12182,7 +12239,7 @@
|
|
|
12182
12239
|
|
|
12183
12240
|
var x = pos.x;
|
|
12184
12241
|
var y = pos.y;
|
|
12185
|
-
y += window
|
|
12242
|
+
y += scrollTop(window);
|
|
12186
12243
|
|
|
12187
12244
|
var dist = (Date.now() - last) * .3;
|
|
12188
12245
|
last = Date.now();
|