uikit 3.11.2-dev.44c622843 → 3.11.2-dev.45194f70c
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 +40 -19
- package/dist/css/uikit-core-rtl.css +86 -185
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +86 -185
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +88 -191
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +88 -191
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +3 -3
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +6 -8
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +29 -68
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +30 -70
- 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 +115 -78
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +115 -78
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +79 -58
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +115 -78
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +35 -29
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +5 -7
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +2 -2
- 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 +394 -327
- 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 +632 -529
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/component.js +2 -11
- package/src/js/api/hooks.js +3 -3
- package/src/js/api/state.js +34 -1
- package/src/js/components/countdown.js +2 -2
- package/src/js/components/filter.js +2 -3
- package/src/js/components/internal/lightbox-animations.js +4 -3
- package/src/js/components/internal/slider-preload.js +18 -0
- package/src/js/components/internal/slideshow-animations.js +4 -3
- package/src/js/components/lightbox-panel.js +34 -58
- package/src/js/components/lightbox.js +1 -2
- package/src/js/components/slider.js +60 -43
- package/src/js/components/slideshow.js +8 -1
- package/src/js/components/sortable.js +1 -1
- package/src/js/core/accordion.js +6 -1
- package/src/js/core/alert.js +1 -2
- package/src/js/core/core.js +2 -21
- package/src/js/core/cover.js +5 -1
- package/src/js/core/drop.js +3 -1
- package/src/js/core/form-custom.js +2 -2
- package/src/js/core/height-viewport.js +3 -0
- package/src/js/core/icon.js +13 -6
- package/src/js/core/img.js +131 -122
- package/src/js/core/modal.js +1 -2
- package/src/js/core/navbar.js +3 -3
- package/src/js/core/sticky.js +51 -57
- package/src/js/core/svg.js +10 -6
- package/src/js/core/switcher.js +6 -1
- package/src/js/core/toggle.js +5 -2
- package/src/js/core/video.js +13 -1
- package/src/js/mixin/internal/animate-slide.js +9 -12
- package/src/js/mixin/lazyload.js +16 -0
- package/src/js/mixin/parallax.js +116 -79
- package/src/js/mixin/slider.js +8 -22
- package/src/js/mixin/slideshow.js +2 -6
- package/src/js/mixin/togglable.js +1 -2
- package/src/js/util/ajax.js +15 -14
- package/src/js/util/animation.js +7 -12
- package/src/js/util/dimensions.js +4 -4
- package/src/js/util/dom.js +23 -32
- package/src/js/util/index.js +1 -0
- package/src/js/util/lang.js +7 -6
- package/src/js/util/observer.js +36 -0
- package/src/js/util/options.js +2 -11
- package/src/js/util/player.js +5 -4
- package/src/js/util/selector.js +12 -18
- package/src/js/util/style.js +4 -4
- package/src/less/components/base.less +10 -33
- package/src/less/components/form-range.less +48 -95
- package/src/less/components/form.less +0 -1
- package/src/less/components/height.less +3 -0
- package/src/less/components/leader.less +0 -1
- package/src/less/components/lightbox.less +0 -1
- package/src/less/components/modal.less +3 -7
- package/src/less/components/progress.less +14 -36
- package/src/less/components/slider.less +0 -3
- package/src/less/components/slideshow.less +0 -3
- package/src/less/components/text.less +16 -32
- package/src/scss/components/base.scss +10 -33
- package/src/scss/components/form-range.scss +48 -95
- package/src/scss/components/form.scss +0 -1
- package/src/scss/components/height.scss +3 -0
- package/src/scss/components/leader.scss +0 -1
- package/src/scss/components/lightbox.scss +0 -1
- package/src/scss/components/modal.scss +3 -7
- package/src/scss/components/progress.scss +14 -36
- package/src/scss/components/slider.scss +0 -3
- package/src/scss/components/slideshow.scss +0 -3
- package/src/scss/components/text.scss +16 -32
- package/src/scss/mixins-theme.scss +1 -1
- package/src/scss/mixins.scss +1 -1
- package/src/scss/variables-theme.scss +3 -3
- package/src/scss/variables.scss +3 -3
- package/tests/align.html +10 -10
- package/tests/animation.html +2 -2
- package/tests/article.html +2 -2
- package/tests/base.html +3 -3
- package/tests/card.html +10 -10
- package/tests/column.html +3 -3
- package/tests/comment.html +9 -9
- package/tests/dotnav.html +3 -3
- package/tests/image.html +296 -64
- package/tests/images/image-type.avif +0 -0
- package/tests/images/image-type.jpeg +0 -0
- package/tests/images/image-type.webp +0 -0
- package/tests/index.html +8 -8
- package/tests/lightbox.html +10 -10
- package/tests/marker.html +2 -2
- package/tests/modal.html +8 -9
- package/tests/navbar.html +2 -2
- package/tests/overlay.html +7 -7
- package/tests/parallax.html +16 -7
- package/tests/position.html +12 -12
- package/tests/slidenav.html +12 -12
- package/tests/slider.html +20 -20
- package/tests/sortable.html +1 -1
- package/tests/sticky-parallax.html +56 -71
- package/tests/svg.html +6 -6
- package/tests/table.html +11 -11
- package/tests/thumbnav.html +12 -12
- package/tests/transition.html +30 -30
- package/tests/utility.html +50 -33
- package/tests/video.html +1 -1
- package/tests/width.html +1 -1
- package/src/js/util/promise.js +0 -0
- package/tests/images/animated.gif +0 -0
package/dist/js/uikit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.45194f70c | 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() :
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function startsWith(str, search) {
|
|
32
|
-
return str.startsWith(search);
|
|
32
|
+
return str == null ? void 0 : str.startsWith == null ? void 0 : str.startsWith(search);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function endsWith(str, search) {
|
|
36
|
-
return str.endsWith(search);
|
|
36
|
+
return str == null ? void 0 : str.endsWith == null ? void 0 : str.endsWith(search);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function includes(obj, search) {
|
|
40
|
-
return obj
|
|
40
|
+
return obj == null ? void 0 : obj.includes == null ? void 0 : obj.includes(search);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function findIndex(array, predicate) {
|
|
44
|
-
return array.findIndex(predicate);
|
|
44
|
+
return array == null ? void 0 : array.findIndex == null ? void 0 : array.findIndex(predicate);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const { isArray, from: toArray } = Array;
|
|
@@ -130,14 +130,15 @@
|
|
|
130
130
|
return element && (isNode(element) ? [element] : Array.from(element).filter(isNode)) || [];
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
function toWindow(element) {
|
|
133
|
+
function toWindow(element) {var _element;
|
|
134
134
|
if (isWindow(element)) {
|
|
135
135
|
return element;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
element = toNode(element);
|
|
139
|
+
const document = isDocument(element) ? element : (_element = element) == null ? void 0 : _element.ownerDocument;
|
|
139
140
|
|
|
140
|
-
return
|
|
141
|
+
return (document == null ? void 0 : document.defaultView) || window;
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
function toMs(time) {
|
|
@@ -224,7 +225,7 @@
|
|
|
224
225
|
},
|
|
225
226
|
|
|
226
227
|
contain(dimensions, maxDimensions) {
|
|
227
|
-
dimensions =
|
|
228
|
+
dimensions = { ...dimensions };
|
|
228
229
|
|
|
229
230
|
each(
|
|
230
231
|
dimensions,
|
|
@@ -339,19 +340,6 @@
|
|
|
339
340
|
}
|
|
340
341
|
}
|
|
341
342
|
|
|
342
|
-
const inBrowser = typeof window !== 'undefined';
|
|
343
|
-
const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
|
|
344
|
-
|
|
345
|
-
const hasTouch = inBrowser && 'ontouchstart' in window;
|
|
346
|
-
const hasPointerEvents = inBrowser && window.PointerEvent;
|
|
347
|
-
|
|
348
|
-
const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
|
|
349
|
-
const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
|
|
350
|
-
const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
|
|
351
|
-
const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
|
|
352
|
-
const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
|
|
353
|
-
const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
|
|
354
|
-
|
|
355
343
|
const voidElements = {
|
|
356
344
|
area: true,
|
|
357
345
|
base: true,
|
|
@@ -451,12 +439,6 @@
|
|
|
451
439
|
return findAll(selector, getContext(selector, context));
|
|
452
440
|
}
|
|
453
441
|
|
|
454
|
-
function getContext(selector, context) {if (context === void 0) {context = document;}
|
|
455
|
-
return isString(selector) && isContextSelector(selector) || isDocument(context) ?
|
|
456
|
-
context :
|
|
457
|
-
context.ownerDocument;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
442
|
function find(selector, context) {
|
|
461
443
|
return toNode(_query(selector, context, 'querySelector'));
|
|
462
444
|
}
|
|
@@ -465,6 +447,17 @@
|
|
|
465
447
|
return toNodes(_query(selector, context, 'querySelectorAll'));
|
|
466
448
|
}
|
|
467
449
|
|
|
450
|
+
const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
|
|
451
|
+
const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
|
|
452
|
+
|
|
453
|
+
function getContext(selector, context) {if (context === void 0) {context = document;}
|
|
454
|
+
return isString(selector) && isContextSelector(selector) || isDocument(context) ?
|
|
455
|
+
context :
|
|
456
|
+
context.ownerDocument;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
|
|
460
|
+
|
|
468
461
|
function _query(selector, context, queryFn) {if (context === void 0) {context = document;}
|
|
469
462
|
if (!selector || !isString(selector)) {
|
|
470
463
|
return selector;
|
|
@@ -509,11 +502,6 @@
|
|
|
509
502
|
}
|
|
510
503
|
}
|
|
511
504
|
|
|
512
|
-
const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
|
|
513
|
-
const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
|
|
514
|
-
|
|
515
|
-
const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
|
|
516
|
-
|
|
517
505
|
const selectorRe = /.*?[^\\](?:,|$)/g;
|
|
518
506
|
|
|
519
507
|
const splitSelector = memoize((selector) =>
|
|
@@ -539,13 +527,8 @@
|
|
|
539
527
|
return names.join(' > ');
|
|
540
528
|
}
|
|
541
529
|
|
|
542
|
-
const escapeFn =
|
|
543
|
-
inBrowser && window.CSS && CSS.escape ||
|
|
544
|
-
function (css) {
|
|
545
|
-
return css.replace(/([^\x7f-\uFFFF\w-])/g, (match) => "\\" + match);
|
|
546
|
-
};
|
|
547
530
|
function escape(css) {
|
|
548
|
-
return isString(css) ?
|
|
531
|
+
return isString(css) ? CSS.escape(css) : '';
|
|
549
532
|
}
|
|
550
533
|
|
|
551
534
|
function on() {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}
|
|
@@ -688,17 +671,14 @@
|
|
|
688
671
|
}
|
|
689
672
|
|
|
690
673
|
function ajax(url, options) {
|
|
691
|
-
const env =
|
|
692
|
-
{
|
|
674
|
+
const env = {
|
|
693
675
|
data: null,
|
|
694
676
|
method: 'GET',
|
|
695
677
|
headers: {},
|
|
696
678
|
xhr: new XMLHttpRequest(),
|
|
697
679
|
beforeSend: noop,
|
|
698
|
-
responseType: ''
|
|
699
|
-
|
|
700
|
-
options);
|
|
701
|
-
|
|
680
|
+
responseType: '',
|
|
681
|
+
...options };
|
|
702
682
|
|
|
703
683
|
return Promise.resolve().
|
|
704
684
|
then(() => env.beforeSend(env)).
|
|
@@ -749,8 +729,12 @@
|
|
|
749
729
|
return new Promise((resolve, reject) => {
|
|
750
730
|
const img = new Image();
|
|
751
731
|
|
|
752
|
-
img.onerror = (e) =>
|
|
753
|
-
|
|
732
|
+
img.onerror = (e) => {
|
|
733
|
+
reject(e);
|
|
734
|
+
};
|
|
735
|
+
img.onload = () => {
|
|
736
|
+
resolve(img);
|
|
737
|
+
};
|
|
754
738
|
|
|
755
739
|
sizes && (img.sizes = sizes);
|
|
756
740
|
srcset && (img.srcset = srcset);
|
|
@@ -777,7 +761,8 @@
|
|
|
777
761
|
|
|
778
762
|
|
|
779
763
|
function css(element, property, value, priority) {if (priority === void 0) {priority = '';}
|
|
780
|
-
|
|
764
|
+
const elements = toNodes(element);
|
|
765
|
+
for (const element of elements) {
|
|
781
766
|
if (isString(property)) {
|
|
782
767
|
property = propName(property);
|
|
783
768
|
|
|
@@ -803,9 +788,8 @@
|
|
|
803
788
|
priority = value;
|
|
804
789
|
each(property, (value, property) => css(element, property, value, priority));
|
|
805
790
|
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
})[0];
|
|
791
|
+
}
|
|
792
|
+
return elements[0];
|
|
809
793
|
}
|
|
810
794
|
|
|
811
795
|
function getStyles(element, pseudoElt) {
|
|
@@ -932,16 +916,11 @@
|
|
|
932
916
|
|
|
933
917
|
|
|
934
918
|
addClass(element, 'uk-transition');
|
|
935
|
-
css(
|
|
936
|
-
element,
|
|
937
|
-
assign(
|
|
938
|
-
{
|
|
919
|
+
css(element, {
|
|
939
920
|
transitionProperty: Object.keys(props).map(propName).join(','),
|
|
940
921
|
transitionDuration: duration + "ms",
|
|
941
|
-
transitionTimingFunction: timing
|
|
942
|
-
|
|
943
|
-
props));
|
|
944
|
-
|
|
922
|
+
transitionTimingFunction: timing,
|
|
923
|
+
...props });
|
|
945
924
|
|
|
946
925
|
})));
|
|
947
926
|
|
|
@@ -1041,8 +1020,8 @@
|
|
|
1041
1020
|
const currentOffset = dimensions$1(element);
|
|
1042
1021
|
|
|
1043
1022
|
if (element) {
|
|
1044
|
-
const {
|
|
1045
|
-
const offsetBy = { height:
|
|
1023
|
+
const { scrollY, scrollX } = toWindow(element);
|
|
1024
|
+
const offsetBy = { height: scrollY, width: scrollX };
|
|
1046
1025
|
|
|
1047
1026
|
for (const dir in dirs$1) {
|
|
1048
1027
|
for (const i in dirs$1[dir]) {
|
|
@@ -1108,8 +1087,8 @@
|
|
|
1108
1087
|
|
|
1109
1088
|
if (css(element, 'position') === 'fixed') {
|
|
1110
1089
|
const win = toWindow(element);
|
|
1111
|
-
offset[0] += win.
|
|
1112
|
-
offset[1] += win.
|
|
1090
|
+
offset[0] += win.scrollY;
|
|
1091
|
+
offset[1] += win.scrollX;
|
|
1113
1092
|
return offset;
|
|
1114
1093
|
}
|
|
1115
1094
|
} while (element = element.offsetParent);
|
|
@@ -1200,8 +1179,8 @@
|
|
|
1200
1179
|
|
|
1201
1180
|
const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
|
|
1202
1181
|
const parseCalc = memoize((calc) => calc.toString().replace(/\s/g, '').match(calcRe) || []);
|
|
1203
|
-
const unitRe = /(?:v[hw]|%)$/;
|
|
1204
|
-
const parseUnit = memoize((str) => (str.match(unitRe) || [])[0]);
|
|
1182
|
+
const unitRe$1 = /(?:v[hw]|%)$/;
|
|
1183
|
+
const parseUnit = memoize((str) => (str.match(unitRe$1) || [])[0]);
|
|
1205
1184
|
|
|
1206
1185
|
function percent(base, value) {
|
|
1207
1186
|
return base * toFloat(value) / 100;
|
|
@@ -1216,6 +1195,10 @@
|
|
|
1216
1195
|
once(document, 'DOMContentLoaded', fn);
|
|
1217
1196
|
}
|
|
1218
1197
|
|
|
1198
|
+
function isTag(element, tagName) {var _element$tagName;
|
|
1199
|
+
return (element == null ? void 0 : (_element$tagName = element.tagName) == null ? void 0 : _element$tagName.toLowerCase()) === tagName.toLowerCase();
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1219
1202
|
function empty(element) {
|
|
1220
1203
|
return replaceChildren(element, '');
|
|
1221
1204
|
}
|
|
@@ -1224,34 +1207,20 @@
|
|
|
1224
1207
|
return isUndefined(html) ? $(parent).innerHTML : replaceChildren(parent, html);
|
|
1225
1208
|
}
|
|
1226
1209
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
function prepend(parent, element) {
|
|
1234
|
-
const nodes = $$(element);
|
|
1235
|
-
$(parent).prepend(...nodes);
|
|
1236
|
-
return nodes;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
function append(parent, element) {
|
|
1240
|
-
const nodes = $$(element);
|
|
1241
|
-
$(parent).append(...nodes);
|
|
1242
|
-
return nodes;
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
function before(ref, element) {
|
|
1246
|
-
const nodes = $$(element);
|
|
1247
|
-
$(ref).before(...nodes);
|
|
1248
|
-
return nodes;
|
|
1249
|
-
}
|
|
1210
|
+
const replaceChildren = applyFn('replaceChildren');
|
|
1211
|
+
const prepend = applyFn('prepend');
|
|
1212
|
+
const append = applyFn('append');
|
|
1213
|
+
const before = applyFn('before');
|
|
1214
|
+
const after = applyFn('after');
|
|
1250
1215
|
|
|
1251
|
-
function
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1216
|
+
function applyFn(fn) {
|
|
1217
|
+
return function (ref, element) {
|
|
1218
|
+
const nodes = toNodes(isString(element) ? fragment(element) : element);
|
|
1219
|
+
if (nodes.length) {
|
|
1220
|
+
$(ref)[fn](...nodes);
|
|
1221
|
+
}
|
|
1222
|
+
return unwrapSingle(nodes);
|
|
1223
|
+
};
|
|
1255
1224
|
}
|
|
1256
1225
|
|
|
1257
1226
|
function remove$1(element) {
|
|
@@ -1284,10 +1253,7 @@
|
|
|
1284
1253
|
toNodes(element).
|
|
1285
1254
|
map(parent).
|
|
1286
1255
|
filter((value, index, self) => self.indexOf(value) === index).
|
|
1287
|
-
forEach((parent) =>
|
|
1288
|
-
before(parent, parent.childNodes);
|
|
1289
|
-
remove$1(parent);
|
|
1290
|
-
});
|
|
1256
|
+
forEach((parent) => parent.replaceWith(...parent.childNodes));
|
|
1291
1257
|
}
|
|
1292
1258
|
|
|
1293
1259
|
const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
|
|
@@ -1306,7 +1272,11 @@
|
|
|
1306
1272
|
container.textContent = html;
|
|
1307
1273
|
}
|
|
1308
1274
|
|
|
1309
|
-
return
|
|
1275
|
+
return unwrapSingle(container.childNodes);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
function unwrapSingle(nodes) {
|
|
1279
|
+
return nodes.length > 1 ? nodes : nodes[0];
|
|
1310
1280
|
}
|
|
1311
1281
|
|
|
1312
1282
|
function apply(node, fn) {
|
|
@@ -1335,6 +1305,19 @@
|
|
|
1335
1305
|
return isString(str) && startsWith(str.trim(), '<');
|
|
1336
1306
|
}
|
|
1337
1307
|
|
|
1308
|
+
const inBrowser = typeof window !== 'undefined';
|
|
1309
|
+
const isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
|
|
1310
|
+
|
|
1311
|
+
const hasTouch = inBrowser && 'ontouchstart' in window;
|
|
1312
|
+
const hasPointerEvents = inBrowser && window.PointerEvent;
|
|
1313
|
+
|
|
1314
|
+
const pointerDown = hasPointerEvents ? 'pointerdown' : hasTouch ? 'touchstart' : 'mousedown';
|
|
1315
|
+
const pointerMove = hasPointerEvents ? 'pointermove' : hasTouch ? 'touchmove' : 'mousemove';
|
|
1316
|
+
const pointerUp = hasPointerEvents ? 'pointerup' : hasTouch ? 'touchend' : 'mouseup';
|
|
1317
|
+
const pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouch ? '' : 'mouseenter';
|
|
1318
|
+
const pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouch ? '' : 'mouseleave';
|
|
1319
|
+
const pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
|
|
1320
|
+
|
|
1338
1321
|
/*
|
|
1339
1322
|
Based on:
|
|
1340
1323
|
Copyright (c) 2016 Wilson Page wilsonpage@me.com
|
|
@@ -1487,6 +1470,41 @@
|
|
|
1487
1470
|
return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };
|
|
1488
1471
|
}
|
|
1489
1472
|
|
|
1473
|
+
// Old chromium based browsers (UC Browser) did not implement `isIntersecting`
|
|
1474
|
+
const hasIntersectionObserver =
|
|
1475
|
+
window.IntersectionObserver && 'isIntersecting' in IntersectionObserverEntry.prototype;
|
|
1476
|
+
function observeIntersection(targets, cb, options, intersecting) {if (intersecting === void 0) {intersecting = true;}
|
|
1477
|
+
if (!hasIntersectionObserver) {
|
|
1478
|
+
return;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
const observer = new IntersectionObserver((entries, observer) => {
|
|
1482
|
+
if (!intersecting || entries.some((entry) => entry.isIntersecting)) {
|
|
1483
|
+
cb(entries, observer);
|
|
1484
|
+
}
|
|
1485
|
+
}, options);
|
|
1486
|
+
for (const el of isArray(targets) ? targets : [targets]) {
|
|
1487
|
+
observer.observe(el);
|
|
1488
|
+
}
|
|
1489
|
+
return observer;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
const hasResizeObserver = window.ResizeObserver;
|
|
1493
|
+
function observeResize(targets, cb, options) {if (options === void 0) {options = { box: 'border-box' };}
|
|
1494
|
+
if (!hasResizeObserver) {
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
const observer = new ResizeObserver((entries, observer) => {
|
|
1499
|
+
cb(entries, observer);
|
|
1500
|
+
});
|
|
1501
|
+
for (const el of isArray(targets) ? targets : [targets]) {
|
|
1502
|
+
observer.observe(el, options);
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
return observer;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1490
1508
|
const strats = {};
|
|
1491
1509
|
|
|
1492
1510
|
strats.events =
|
|
@@ -1526,7 +1544,7 @@
|
|
|
1526
1544
|
|
|
1527
1545
|
// extend strategy
|
|
1528
1546
|
strats.computed = strats.methods = function (parentVal, childVal) {
|
|
1529
|
-
return childVal ? parentVal ?
|
|
1547
|
+
return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
|
|
1530
1548
|
};
|
|
1531
1549
|
|
|
1532
1550
|
// data strategy
|
|
@@ -1666,11 +1684,11 @@
|
|
|
1666
1684
|
}
|
|
1667
1685
|
|
|
1668
1686
|
function isHTML5(el) {
|
|
1669
|
-
return (el
|
|
1687
|
+
return isTag(el, 'video');
|
|
1670
1688
|
}
|
|
1671
1689
|
|
|
1672
1690
|
function isIFrame(el) {
|
|
1673
|
-
return (el
|
|
1691
|
+
return isTag(el, 'iframe') && (isYoutube(el) || isVimeo(el));
|
|
1674
1692
|
}
|
|
1675
1693
|
|
|
1676
1694
|
function isYoutube(el) {
|
|
@@ -1690,7 +1708,7 @@
|
|
|
1690
1708
|
|
|
1691
1709
|
function post(el, cmd) {
|
|
1692
1710
|
try {
|
|
1693
|
-
el.contentWindow.postMessage(JSON.stringify(
|
|
1711
|
+
el.contentWindow.postMessage(JSON.stringify({ event: 'command', ...cmd }), '*');
|
|
1694
1712
|
} catch (e) {
|
|
1695
1713
|
// noop
|
|
1696
1714
|
}
|
|
@@ -2070,6 +2088,7 @@
|
|
|
2070
2088
|
flipPosition: flipPosition,
|
|
2071
2089
|
toPx: toPx,
|
|
2072
2090
|
ready: ready,
|
|
2091
|
+
isTag: isTag,
|
|
2073
2092
|
empty: empty,
|
|
2074
2093
|
html: html,
|
|
2075
2094
|
replaceChildren: replaceChildren,
|
|
@@ -2163,6 +2182,9 @@
|
|
|
2163
2182
|
memoize: memoize,
|
|
2164
2183
|
Deferred: Deferred,
|
|
2165
2184
|
MouseTracker: MouseTracker,
|
|
2185
|
+
hasIntersectionObserver: hasIntersectionObserver,
|
|
2186
|
+
observeIntersection: observeIntersection,
|
|
2187
|
+
observeResize: observeResize,
|
|
2166
2188
|
mergeOptions: mergeOptions,
|
|
2167
2189
|
parseOptions: parseOptions,
|
|
2168
2190
|
play: play,
|
|
@@ -2340,8 +2362,8 @@
|
|
|
2340
2362
|
};
|
|
2341
2363
|
|
|
2342
2364
|
function runUpdates(types) {
|
|
2343
|
-
for (const { read, write, events } of this.$options.update) {
|
|
2344
|
-
if (!types.has('update') &&
|
|
2365
|
+
for (const { read, write, events = [] } of this.$options.update) {
|
|
2366
|
+
if (!types.has('update') && !events.some((type) => types.has(type))) {
|
|
2345
2367
|
continue;
|
|
2346
2368
|
}
|
|
2347
2369
|
|
|
@@ -2364,7 +2386,7 @@
|
|
|
2364
2386
|
const {
|
|
2365
2387
|
$options: { computed } } =
|
|
2366
2388
|
this;
|
|
2367
|
-
const values =
|
|
2389
|
+
const values = { ...this._computeds };
|
|
2368
2390
|
this._computeds = {};
|
|
2369
2391
|
|
|
2370
2392
|
for (const key in computed) {
|
|
@@ -2462,17 +2484,28 @@
|
|
|
2462
2484
|
}
|
|
2463
2485
|
}
|
|
2464
2486
|
}
|
|
2487
|
+
for (const { events = [] } of this.$options.update || []) {
|
|
2488
|
+
if (includes(events, 'scroll')) {
|
|
2489
|
+
registerScrollListener(this._uid, () => this.$emit('scroll'));
|
|
2490
|
+
break;
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2465
2493
|
};
|
|
2466
2494
|
|
|
2467
2495
|
UIkit.prototype._unbindEvents = function () {
|
|
2468
2496
|
this._events.forEach((unbind) => unbind());
|
|
2469
2497
|
delete this._events;
|
|
2498
|
+
unregisterScrollListener(this._uid);
|
|
2470
2499
|
};
|
|
2471
2500
|
|
|
2472
2501
|
UIkit.prototype._initObservers = function () {
|
|
2473
2502
|
this._observers = [initChildListObserver(this), initPropsObserver(this)];
|
|
2474
2503
|
};
|
|
2475
2504
|
|
|
2505
|
+
UIkit.prototype.registerObserver = function (observer) {
|
|
2506
|
+
this._observers.push(observer);
|
|
2507
|
+
};
|
|
2508
|
+
|
|
2476
2509
|
UIkit.prototype._disconnectObservers = function () {
|
|
2477
2510
|
this._observers.forEach((observer) => observer == null ? void 0 : observer.disconnect());
|
|
2478
2511
|
};
|
|
@@ -2549,7 +2582,7 @@
|
|
|
2549
2582
|
el = isFunction(el) ? el.call(component) : el || component.$el;
|
|
2550
2583
|
|
|
2551
2584
|
if (isArray(el)) {
|
|
2552
|
-
el.forEach((el) => registerEvent(component,
|
|
2585
|
+
el.forEach((el) => registerEvent(component, { ...event, el }, key));
|
|
2553
2586
|
return;
|
|
2554
2587
|
}
|
|
2555
2588
|
|
|
@@ -2661,6 +2694,27 @@
|
|
|
2661
2694
|
|
|
2662
2695
|
return observer;
|
|
2663
2696
|
}
|
|
2697
|
+
|
|
2698
|
+
const scrollListeners = new Map();
|
|
2699
|
+
let unbindScrollListener;
|
|
2700
|
+
function registerScrollListener(id, listener) {
|
|
2701
|
+
unbindScrollListener =
|
|
2702
|
+
unbindScrollListener ||
|
|
2703
|
+
on(window, 'scroll', () => scrollListeners.forEach((listener) => listener()), {
|
|
2704
|
+
passive: true,
|
|
2705
|
+
capture: true });
|
|
2706
|
+
|
|
2707
|
+
|
|
2708
|
+
scrollListeners.set(id, listener);
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
function unregisterScrollListener(id) {
|
|
2712
|
+
scrollListeners.delete(id);
|
|
2713
|
+
if (unbindScrollListener && !scrollListeners.size) {
|
|
2714
|
+
unbindScrollListener();
|
|
2715
|
+
unbindScrollListener = null;
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2664
2718
|
}
|
|
2665
2719
|
|
|
2666
2720
|
function instanceAPI (UIkit) {
|
|
@@ -2783,7 +2837,7 @@
|
|
|
2783
2837
|
}
|
|
2784
2838
|
};
|
|
2785
2839
|
|
|
2786
|
-
const opt = isPlainObject(options) ?
|
|
2840
|
+
const opt = isPlainObject(options) ? { ...options } : options.options;
|
|
2787
2841
|
|
|
2788
2842
|
opt.name = name;
|
|
2789
2843
|
|
|
@@ -2836,7 +2890,7 @@
|
|
|
2836
2890
|
UIkit.data = '__uikit__';
|
|
2837
2891
|
UIkit.prefix = 'uk-';
|
|
2838
2892
|
UIkit.options = {};
|
|
2839
|
-
UIkit.version = '3.11.2-dev.
|
|
2893
|
+
UIkit.version = '3.11.2-dev.45194f70c';
|
|
2840
2894
|
|
|
2841
2895
|
globalAPI(UIkit);
|
|
2842
2896
|
hooksAPI(UIkit);
|
|
@@ -2861,28 +2915,8 @@
|
|
|
2861
2915
|
};
|
|
2862
2916
|
|
|
2863
2917
|
on(window, 'load resize', handleResize);
|
|
2864
|
-
on(document, 'loadedmetadata load', handleResize, true);
|
|
2865
|
-
|
|
2866
|
-
if ('ResizeObserver' in window) {
|
|
2867
|
-
new ResizeObserver(handleResize).observe(document.documentElement);
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
|
-
// throttle `scroll` event (Safari triggers multiple `scroll` events per frame)
|
|
2871
|
-
let pending;
|
|
2872
|
-
on(
|
|
2873
|
-
window,
|
|
2874
|
-
'scroll',
|
|
2875
|
-
(e) => {
|
|
2876
|
-
if (pending) {
|
|
2877
|
-
return;
|
|
2878
|
-
}
|
|
2879
|
-
pending = true;
|
|
2880
|
-
fastdom.read(() => pending = false);
|
|
2881
|
-
|
|
2882
|
-
UIkit.update(null, e.type);
|
|
2883
|
-
},
|
|
2884
|
-
{ passive: true, capture: true });
|
|
2885
2918
|
|
|
2919
|
+
observeResize(document.documentElement, handleResize);
|
|
2886
2920
|
|
|
2887
2921
|
let started = 0;
|
|
2888
2922
|
on(
|
|
@@ -3004,6 +3038,19 @@
|
|
|
3004
3038
|
!hasClass(this.$el, this.$name) && addClass(this.$el, this.$name);
|
|
3005
3039
|
} };
|
|
3006
3040
|
|
|
3041
|
+
var Lazyload = {
|
|
3042
|
+
methods: {
|
|
3043
|
+
lazyload(observeTargets, targets) {if (observeTargets === void 0) {observeTargets = this.$el;}if (targets === void 0) {targets = this.$el;}
|
|
3044
|
+
this.registerObserver(
|
|
3045
|
+
observeIntersection(observeTargets, (entries, observer) => {
|
|
3046
|
+
for (const el of isArray(targets) ? targets : [targets]) {
|
|
3047
|
+
$$('img[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
|
|
3048
|
+
}
|
|
3049
|
+
observer.disconnect();
|
|
3050
|
+
}));
|
|
3051
|
+
|
|
3052
|
+
} } };
|
|
3053
|
+
|
|
3007
3054
|
var Togglable = {
|
|
3008
3055
|
props: {
|
|
3009
3056
|
cls: Boolean,
|
|
@@ -3159,7 +3206,7 @@
|
|
|
3159
3206
|
show ?
|
|
3160
3207
|
Transition.start(
|
|
3161
3208
|
el,
|
|
3162
|
-
|
|
3209
|
+
{ ...initProps, overflow: 'hidden', height: endHeight },
|
|
3163
3210
|
Math.round(duration * (1 - currentHeight / endHeight)),
|
|
3164
3211
|
transition) :
|
|
3165
3212
|
|
|
@@ -3191,7 +3238,7 @@
|
|
|
3191
3238
|
}
|
|
3192
3239
|
|
|
3193
3240
|
var Accordion = {
|
|
3194
|
-
mixins: [Class, Togglable],
|
|
3241
|
+
mixins: [Class, Lazyload, Togglable],
|
|
3195
3242
|
|
|
3196
3243
|
props: {
|
|
3197
3244
|
targets: String,
|
|
@@ -3247,6 +3294,10 @@
|
|
|
3247
3294
|
} },
|
|
3248
3295
|
|
|
3249
3296
|
|
|
3297
|
+
connected() {
|
|
3298
|
+
this.lazyload();
|
|
3299
|
+
},
|
|
3300
|
+
|
|
3250
3301
|
events: [
|
|
3251
3302
|
{
|
|
3252
3303
|
name: 'click',
|
|
@@ -3331,7 +3382,7 @@
|
|
|
3331
3382
|
animation: [true],
|
|
3332
3383
|
selClose: '.uk-alert-close',
|
|
3333
3384
|
duration: 150,
|
|
3334
|
-
hideProps:
|
|
3385
|
+
hideProps: { opacity: 0, ...Togglable.data.hideProps } },
|
|
3335
3386
|
|
|
3336
3387
|
|
|
3337
3388
|
events: [
|
|
@@ -3382,6 +3433,8 @@
|
|
|
3382
3433
|
if (this.automute) {
|
|
3383
3434
|
mute(this.$el);
|
|
3384
3435
|
}
|
|
3436
|
+
|
|
3437
|
+
this.registerObserver(observeIntersection(this.$el, () => this.$emit('resize')));
|
|
3385
3438
|
},
|
|
3386
3439
|
|
|
3387
3440
|
update: {
|
|
@@ -3418,6 +3471,10 @@
|
|
|
3418
3471
|
automute: true },
|
|
3419
3472
|
|
|
3420
3473
|
|
|
3474
|
+
connected() {
|
|
3475
|
+
this.registerObserver(observeResize(this.$el, () => this.$emit('resize')));
|
|
3476
|
+
},
|
|
3477
|
+
|
|
3421
3478
|
update: {
|
|
3422
3479
|
read() {
|
|
3423
3480
|
const el = this.$el;
|
|
@@ -3543,7 +3600,7 @@
|
|
|
3543
3600
|
let active$1;
|
|
3544
3601
|
|
|
3545
3602
|
var drop = {
|
|
3546
|
-
mixins: [Container, Position, Togglable],
|
|
3603
|
+
mixins: [Container, Lazyload, Position, Togglable],
|
|
3547
3604
|
|
|
3548
3605
|
args: 'pos',
|
|
3549
3606
|
|
|
@@ -3597,6 +3654,7 @@
|
|
|
3597
3654
|
mode: this.mode }).
|
|
3598
3655
|
$el;
|
|
3599
3656
|
attr(this.target, 'aria-haspopup', true);
|
|
3657
|
+
this.lazyload(this.target);
|
|
3600
3658
|
}
|
|
3601
3659
|
},
|
|
3602
3660
|
|
|
@@ -3972,7 +4030,7 @@
|
|
|
3972
4030
|
name: 'change',
|
|
3973
4031
|
|
|
3974
4032
|
handler() {
|
|
3975
|
-
this.$
|
|
4033
|
+
this.$emit();
|
|
3976
4034
|
} },
|
|
3977
4035
|
|
|
3978
4036
|
|
|
@@ -3984,7 +4042,7 @@
|
|
|
3984
4042
|
},
|
|
3985
4043
|
|
|
3986
4044
|
handler() {
|
|
3987
|
-
this.$
|
|
4045
|
+
this.$emit();
|
|
3988
4046
|
} }] };
|
|
3989
4047
|
|
|
3990
4048
|
// Deprecated
|
|
@@ -4341,6 +4399,8 @@
|
|
|
4341
4399
|
}
|
|
4342
4400
|
|
|
4343
4401
|
var heightViewport = {
|
|
4402
|
+
mixins: [Class],
|
|
4403
|
+
|
|
4344
4404
|
props: {
|
|
4345
4405
|
expand: Boolean,
|
|
4346
4406
|
offsetTop: Boolean,
|
|
@@ -4488,6 +4548,12 @@
|
|
|
4488
4548
|
|
|
4489
4549
|
methods: {
|
|
4490
4550
|
async getSvg() {
|
|
4551
|
+
if (isTag(this.$el, 'img') && !this.$el.complete && this.$el.loading === 'lazy') {
|
|
4552
|
+
return new Promise((resolve) =>
|
|
4553
|
+
once(this.$el, 'load', () => resolve(this.getSvg())));
|
|
4554
|
+
|
|
4555
|
+
}
|
|
4556
|
+
|
|
4491
4557
|
return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject('SVG not found.');
|
|
4492
4558
|
},
|
|
4493
4559
|
|
|
@@ -4587,7 +4653,7 @@
|
|
|
4587
4653
|
}
|
|
4588
4654
|
|
|
4589
4655
|
function insertSVG(el, root) {
|
|
4590
|
-
if (isVoidElement(root) || root
|
|
4656
|
+
if (isVoidElement(root) || isTag(root, 'canvas')) {
|
|
4591
4657
|
root.hidden = true;
|
|
4592
4658
|
|
|
4593
4659
|
const next = root.nextElementSibling;
|
|
@@ -4599,11 +4665,7 @@
|
|
|
4599
4665
|
}
|
|
4600
4666
|
|
|
4601
4667
|
function equals(el, other) {
|
|
4602
|
-
return
|
|
4603
|
-
}
|
|
4604
|
-
|
|
4605
|
-
function isSVG(el) {
|
|
4606
|
-
return (el == null ? void 0 : el.tagName) === 'svg';
|
|
4668
|
+
return isTag(el, 'svg') && isTag(other, 'svg') && innerHTML(el) === innerHTML(other);
|
|
4607
4669
|
}
|
|
4608
4670
|
|
|
4609
4671
|
function innerHTML(el) {
|
|
@@ -4684,14 +4746,14 @@
|
|
|
4684
4746
|
},
|
|
4685
4747
|
|
|
4686
4748
|
methods: {
|
|
4687
|
-
getSvg() {
|
|
4749
|
+
async getSvg() {
|
|
4688
4750
|
const icon = getIcon(this.icon);
|
|
4689
4751
|
|
|
4690
4752
|
if (!icon) {
|
|
4691
|
-
|
|
4753
|
+
throw 'Icon not found.';
|
|
4692
4754
|
}
|
|
4693
4755
|
|
|
4694
|
-
return
|
|
4756
|
+
return icon;
|
|
4695
4757
|
} } };
|
|
4696
4758
|
|
|
4697
4759
|
const IconComponent = {
|
|
@@ -4749,10 +4811,17 @@
|
|
|
4749
4811
|
const Spinner = {
|
|
4750
4812
|
extends: IconComponent,
|
|
4751
4813
|
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4814
|
+
methods: {
|
|
4815
|
+
async getSvg() {
|
|
4816
|
+
const icon = await Icon.methods.getSvg.call(this);
|
|
4817
|
+
|
|
4818
|
+
if (this.ratio !== 1) {
|
|
4819
|
+
css($('circle', icon), 'strokeWidth', 1 / this.ratio);
|
|
4820
|
+
}
|
|
4821
|
+
|
|
4822
|
+
return icon;
|
|
4823
|
+
} } };
|
|
4824
|
+
|
|
4756
4825
|
|
|
4757
4826
|
|
|
4758
4827
|
const parsed = {};
|
|
@@ -4790,120 +4859,93 @@
|
|
|
4790
4859
|
return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
|
|
4791
4860
|
}
|
|
4792
4861
|
|
|
4862
|
+
const nativeLazyLoad = ('loading' in HTMLImageElement.prototype);
|
|
4863
|
+
|
|
4793
4864
|
var img = {
|
|
4794
4865
|
args: 'dataSrc',
|
|
4795
4866
|
|
|
4796
4867
|
props: {
|
|
4797
4868
|
dataSrc: String,
|
|
4798
|
-
|
|
4799
|
-
sizes: String,
|
|
4800
|
-
width: Number,
|
|
4801
|
-
height: Number,
|
|
4869
|
+
sources: String,
|
|
4802
4870
|
offsetTop: String,
|
|
4803
4871
|
offsetLeft: String,
|
|
4804
|
-
target: String
|
|
4872
|
+
target: String,
|
|
4873
|
+
loading: String },
|
|
4805
4874
|
|
|
4806
4875
|
|
|
4807
4876
|
data: {
|
|
4808
4877
|
dataSrc: '',
|
|
4809
|
-
|
|
4810
|
-
sizes: false,
|
|
4811
|
-
width: false,
|
|
4812
|
-
height: false,
|
|
4878
|
+
sources: false,
|
|
4813
4879
|
offsetTop: '50vh',
|
|
4814
4880
|
offsetLeft: '50vw',
|
|
4815
|
-
target: false
|
|
4881
|
+
target: false,
|
|
4882
|
+
loading: 'lazy' },
|
|
4816
4883
|
|
|
4817
4884
|
|
|
4818
4885
|
computed: {
|
|
4819
|
-
cacheKey(_ref) {let { dataSrc } = _ref;
|
|
4820
|
-
return this.$name + "." + dataSrc;
|
|
4821
|
-
},
|
|
4822
|
-
|
|
4823
|
-
width(_ref2) {let { width, dataWidth } = _ref2;
|
|
4824
|
-
return width || dataWidth;
|
|
4825
|
-
},
|
|
4826
|
-
|
|
4827
|
-
height(_ref3) {let { height, dataHeight } = _ref3;
|
|
4828
|
-
return height || dataHeight;
|
|
4829
|
-
},
|
|
4830
|
-
|
|
4831
|
-
sizes(_ref4) {let { sizes, dataSizes } = _ref4;
|
|
4832
|
-
return sizes || dataSizes;
|
|
4833
|
-
},
|
|
4834
|
-
|
|
4835
|
-
isImg(_, $el) {
|
|
4836
|
-
return isImg($el);
|
|
4837
|
-
},
|
|
4838
|
-
|
|
4839
4886
|
target: {
|
|
4840
|
-
get(
|
|
4887
|
+
get(_ref) {let { target } = _ref;
|
|
4841
4888
|
return [this.$el, ...queryAll(target, this.$el)];
|
|
4842
4889
|
},
|
|
4843
4890
|
|
|
4844
4891
|
watch() {
|
|
4845
|
-
this
|
|
4846
|
-
} },
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
offsetTop(_ref6) {let { offsetTop } = _ref6;
|
|
4850
|
-
return toPx(offsetTop, 'height');
|
|
4851
|
-
},
|
|
4892
|
+
this.$reset();
|
|
4893
|
+
} } },
|
|
4852
4894
|
|
|
4853
|
-
offsetLeft(_ref7) {let { offsetLeft } = _ref7;
|
|
4854
|
-
return toPx(offsetLeft, 'width');
|
|
4855
|
-
} },
|
|
4856
4895
|
|
|
4857
4896
|
|
|
4858
4897
|
connected() {
|
|
4859
|
-
if (!
|
|
4860
|
-
|
|
4898
|
+
if (this.loading !== 'lazy' || !hasIntersectionObserver) {
|
|
4899
|
+
this.load();
|
|
4861
4900
|
return;
|
|
4862
4901
|
}
|
|
4863
4902
|
|
|
4864
|
-
if (
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4903
|
+
if (nativeLazyLoad && isImg(this.$el)) {
|
|
4904
|
+
this.$el.loading = 'lazy';
|
|
4905
|
+
setSrcAttrs(this.$el);
|
|
4906
|
+
|
|
4907
|
+
if (this.target.length === 1) {
|
|
4908
|
+
return;
|
|
4909
|
+
}
|
|
4868
4910
|
}
|
|
4869
4911
|
|
|
4870
|
-
|
|
4871
|
-
|
|
4912
|
+
ensureSrcAttribute(this.$el);
|
|
4913
|
+
|
|
4914
|
+
this.registerObserver(
|
|
4915
|
+
observeIntersection(
|
|
4916
|
+
this.target,
|
|
4917
|
+
(entries, observer) => {
|
|
4918
|
+
this.load();
|
|
4919
|
+
observer.disconnect();
|
|
4920
|
+
},
|
|
4921
|
+
{
|
|
4922
|
+
rootMargin: toPx(this.offsetTop, 'height') + "px " + toPx(
|
|
4923
|
+
this.offsetLeft,
|
|
4924
|
+
'width') + "px" }));
|
|
4925
|
+
|
|
4926
|
+
|
|
4872
4927
|
|
|
4873
4928
|
|
|
4874
|
-
requestAnimationFrame(this.observe);
|
|
4875
4929
|
},
|
|
4876
4930
|
|
|
4877
4931
|
disconnected() {
|
|
4878
|
-
|
|
4932
|
+
if (this._data.image) {
|
|
4933
|
+
this._data.image.onload = '';
|
|
4934
|
+
}
|
|
4879
4935
|
},
|
|
4880
4936
|
|
|
4881
4937
|
update: {
|
|
4882
|
-
|
|
4883
|
-
if (!this.observer) {
|
|
4884
|
-
return false;
|
|
4885
|
-
}
|
|
4886
|
-
|
|
4887
|
-
if (!image && document.readyState === 'complete') {
|
|
4888
|
-
this.load(this.observer.takeRecords());
|
|
4889
|
-
}
|
|
4890
|
-
|
|
4891
|
-
if (this.isImg) {
|
|
4938
|
+
write(store) {
|
|
4939
|
+
if (!this.observer || isImg(this.$el)) {
|
|
4892
4940
|
return false;
|
|
4893
4941
|
}
|
|
4894
4942
|
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
(img) => img && img.currentSrc !== '' && setSrcAttrs(this.$el, currentSrc(img)));
|
|
4898
|
-
|
|
4899
|
-
},
|
|
4900
|
-
|
|
4901
|
-
write(data) {
|
|
4902
|
-
if (this.dataSrcset && window.devicePixelRatio !== 1) {
|
|
4943
|
+
const srcset = data(this.$el, 'data-srcset');
|
|
4944
|
+
if (srcset && window.devicePixelRatio !== 1) {
|
|
4903
4945
|
const bgSize = css(this.$el, 'backgroundSize');
|
|
4904
|
-
if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) ===
|
|
4905
|
-
|
|
4906
|
-
css(this.$el, 'backgroundSize',
|
|
4946
|
+
if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === store.bgSize) {
|
|
4947
|
+
store.bgSize = getSourceSize(srcset, data(this.$el, 'sizes'));
|
|
4948
|
+
css(this.$el, 'backgroundSize', store.bgSize + "px");
|
|
4907
4949
|
}
|
|
4908
4950
|
}
|
|
4909
4951
|
},
|
|
@@ -4912,42 +4954,27 @@
|
|
|
4912
4954
|
|
|
4913
4955
|
|
|
4914
4956
|
methods: {
|
|
4915
|
-
load(
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
!entries.some((entry) => isUndefined(entry.isIntersecting) || entry.isIntersecting))
|
|
4919
|
-
{
|
|
4920
|
-
return;
|
|
4957
|
+
load() {
|
|
4958
|
+
if (this._data.image) {
|
|
4959
|
+
return this._data.image;
|
|
4921
4960
|
}
|
|
4922
4961
|
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
storage[this.cacheKey] = currentSrc(img);
|
|
4927
|
-
return img;
|
|
4928
|
-
},
|
|
4929
|
-
(e) => trigger(this.$el, new e.constructor(e.type, e)));
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
this.observer.disconnect();
|
|
4933
|
-
},
|
|
4962
|
+
const image = isImg(this.$el) ?
|
|
4963
|
+
this.$el :
|
|
4964
|
+
getImageFromElement(this.$el, this.dataSrc, this.sources);
|
|
4934
4965
|
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
this.observer.observe(el);
|
|
4939
|
-
}
|
|
4940
|
-
}
|
|
4966
|
+
removeAttr(image, 'loading');
|
|
4967
|
+
setSrcAttrs(this.$el, image.currentSrc);
|
|
4968
|
+
return this._data.image = image;
|
|
4941
4969
|
} } };
|
|
4942
4970
|
|
|
4943
4971
|
|
|
4944
4972
|
|
|
4945
|
-
function setSrcAttrs(el, src
|
|
4973
|
+
function setSrcAttrs(el, src) {
|
|
4946
4974
|
if (isImg(el)) {
|
|
4947
|
-
const
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
set('src', src);
|
|
4975
|
+
const parentNode = parent(el);
|
|
4976
|
+
const elements = isPicture(parentNode) ? children(parentNode) : [el];
|
|
4977
|
+
elements.forEach((el) => setSourceProps(el, el));
|
|
4951
4978
|
} else if (src) {
|
|
4952
4979
|
const change = !includes(el.style.backgroundImage, src);
|
|
4953
4980
|
if (change) {
|
|
@@ -4957,16 +4984,62 @@
|
|
|
4957
4984
|
}
|
|
4958
4985
|
}
|
|
4959
4986
|
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4987
|
+
const srcProps = ['data-src', 'data-srcset', 'sizes'];
|
|
4988
|
+
function setSourceProps(sourceEl, targetEl) {
|
|
4989
|
+
srcProps.forEach((prop) => {
|
|
4990
|
+
const value = data(sourceEl, prop);
|
|
4991
|
+
if (value) {
|
|
4992
|
+
attr(targetEl, prop.replace(/^(data-)+/, ''), value);
|
|
4993
|
+
}
|
|
4994
|
+
});
|
|
4995
|
+
}
|
|
4996
|
+
|
|
4997
|
+
function getImageFromElement(el, src, sources) {
|
|
4998
|
+
const img = new Image();
|
|
4999
|
+
|
|
5000
|
+
wrapInPicture(img, sources);
|
|
5001
|
+
setSourceProps(el, img);
|
|
5002
|
+
img.onload = () => {
|
|
5003
|
+
setSrcAttrs(el, img.currentSrc);
|
|
5004
|
+
};
|
|
5005
|
+
attr(img, 'src', src);
|
|
5006
|
+
return img;
|
|
5007
|
+
}
|
|
5008
|
+
|
|
5009
|
+
function wrapInPicture(img, sources) {
|
|
5010
|
+
sources = parseSources(sources);
|
|
5011
|
+
|
|
5012
|
+
if (sources.length) {
|
|
5013
|
+
const picture = fragment('<picture>');
|
|
5014
|
+
for (const attrs of sources) {
|
|
5015
|
+
const source = fragment('<source>');
|
|
5016
|
+
attr(source, attrs);
|
|
5017
|
+
append(picture, source);
|
|
5018
|
+
}
|
|
5019
|
+
append(picture, img);
|
|
5020
|
+
}
|
|
5021
|
+
}
|
|
5022
|
+
|
|
5023
|
+
function parseSources(sources) {
|
|
5024
|
+
if (!sources) {
|
|
5025
|
+
return [];
|
|
5026
|
+
}
|
|
5027
|
+
|
|
5028
|
+
if (startsWith(sources, '[')) {
|
|
5029
|
+
try {
|
|
5030
|
+
sources = JSON.parse(sources);
|
|
5031
|
+
} catch (e) {
|
|
5032
|
+
sources = [];
|
|
5033
|
+
}
|
|
5034
|
+
} else {
|
|
5035
|
+
sources = parseOptions(sources);
|
|
5036
|
+
}
|
|
4966
5037
|
|
|
5038
|
+
if (!isArray(sources)) {
|
|
5039
|
+
sources = [sources];
|
|
4967
5040
|
}
|
|
4968
5041
|
|
|
4969
|
-
return
|
|
5042
|
+
return sources.filter((source) => !isEmpty(source));
|
|
4970
5043
|
}
|
|
4971
5044
|
|
|
4972
5045
|
const sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
|
|
@@ -5006,24 +5079,18 @@
|
|
|
5006
5079
|
return descriptors.filter((size) => size >= srcSize)[0] || descriptors.pop() || '';
|
|
5007
5080
|
}
|
|
5008
5081
|
|
|
5009
|
-
function
|
|
5010
|
-
|
|
5082
|
+
function ensureSrcAttribute(el) {
|
|
5083
|
+
if (isImg(el) && !hasAttr(el, 'src')) {
|
|
5084
|
+
attr(el, 'src', 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"></svg>');
|
|
5085
|
+
}
|
|
5011
5086
|
}
|
|
5012
5087
|
|
|
5013
|
-
function
|
|
5014
|
-
return el
|
|
5088
|
+
function isPicture(el) {
|
|
5089
|
+
return isTag(el, 'picture');
|
|
5015
5090
|
}
|
|
5016
5091
|
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
// workaround for Safari's private browsing mode and accessing sessionStorage in Blink
|
|
5021
|
-
try {
|
|
5022
|
-
storage = window.sessionStorage || {};
|
|
5023
|
-
storage[key] = 1;
|
|
5024
|
-
delete storage[key];
|
|
5025
|
-
} catch (e) {
|
|
5026
|
-
storage = {};
|
|
5092
|
+
function isImg(el) {
|
|
5093
|
+
return isTag(el, 'img');
|
|
5027
5094
|
}
|
|
5028
5095
|
|
|
5029
5096
|
var Media = {
|
|
@@ -5479,7 +5546,7 @@
|
|
|
5479
5546
|
|
|
5480
5547
|
|
|
5481
5548
|
function openDialog(tmpl, options, hideFn, submitFn) {
|
|
5482
|
-
options =
|
|
5549
|
+
options = { bgClose: false, escClose: true, labels: modal.labels, ...options };
|
|
5483
5550
|
|
|
5484
5551
|
const dialog = modal.dialog(tmpl(options), options);
|
|
5485
5552
|
const deferred = new Deferred();
|
|
@@ -5608,10 +5675,11 @@
|
|
|
5608
5675
|
this.$create(
|
|
5609
5676
|
'drop',
|
|
5610
5677
|
dropdowns.filter((el) => !this.getDropdown(el)),
|
|
5611
|
-
|
|
5678
|
+
{
|
|
5679
|
+
...this.$props,
|
|
5612
5680
|
boundary: this.boundary,
|
|
5613
5681
|
pos: this.pos,
|
|
5614
|
-
offset: this.dropbar || this.offset })
|
|
5682
|
+
offset: this.dropbar || this.offset });
|
|
5615
5683
|
|
|
5616
5684
|
|
|
5617
5685
|
},
|
|
@@ -6503,26 +6571,11 @@
|
|
|
6503
6571
|
|
|
6504
6572
|
|
|
6505
6573
|
computed: {
|
|
6506
|
-
|
|
6507
|
-
return position === 'auto' ?
|
|
6508
|
-
(this.isFixed ? this.placeholder : $el).offsetHeight > height(window) ?
|
|
6509
|
-
'bottom' :
|
|
6510
|
-
'top' :
|
|
6511
|
-
position;
|
|
6512
|
-
},
|
|
6513
|
-
|
|
6514
|
-
offset(_ref2, $el) {let { offset } = _ref2;
|
|
6515
|
-
if (this.position === 'bottom') {
|
|
6516
|
-
offset += '+100vh-100%';
|
|
6517
|
-
}
|
|
6518
|
-
return toPx(offset, 'height', $el);
|
|
6519
|
-
},
|
|
6520
|
-
|
|
6521
|
-
selTarget(_ref3, $el) {let { selTarget } = _ref3;
|
|
6574
|
+
selTarget(_ref, $el) {let { selTarget } = _ref;
|
|
6522
6575
|
return selTarget && $(selTarget, $el) || $el;
|
|
6523
6576
|
},
|
|
6524
6577
|
|
|
6525
|
-
widthElement(
|
|
6578
|
+
widthElement(_ref2, $el) {let { widthElement } = _ref2;
|
|
6526
6579
|
return query(widthElement, $el) || this.placeholder;
|
|
6527
6580
|
},
|
|
6528
6581
|
|
|
@@ -6570,41 +6623,36 @@
|
|
|
6570
6623
|
return window;
|
|
6571
6624
|
},
|
|
6572
6625
|
|
|
6626
|
+
filter() {
|
|
6627
|
+
return this.targetOffset !== false;
|
|
6628
|
+
},
|
|
6629
|
+
|
|
6573
6630
|
handler() {
|
|
6574
|
-
if (!
|
|
6631
|
+
if (!location.hash || scrollTop(window) === 0) {
|
|
6575
6632
|
return;
|
|
6576
6633
|
}
|
|
6577
6634
|
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
fastdom.read(() => {
|
|
6582
|
-
const { top } = offset(target);
|
|
6583
|
-
const elTop = offset(this.$el).top;
|
|
6584
|
-
const elHeight = this.$el.offsetHeight;
|
|
6635
|
+
fastdom.read(() => {
|
|
6636
|
+
const targetOffset = offset($(location.hash));
|
|
6637
|
+
const elOffset = offset(this.$el);
|
|
6585
6638
|
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
top -
|
|
6594
|
-
elHeight - (
|
|
6595
|
-
isNumeric(this.targetOffset) ? this.targetOffset : 0) -
|
|
6596
|
-
this.offset);
|
|
6639
|
+
if (this.isFixed && intersectRect(targetOffset, elOffset)) {
|
|
6640
|
+
scrollTop(
|
|
6641
|
+
window,
|
|
6642
|
+
targetOffset.top -
|
|
6643
|
+
elOffset.height -
|
|
6644
|
+
toPx(this.targetOffset, 'height') -
|
|
6645
|
+
toPx(this.offset, 'height'));
|
|
6597
6646
|
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
}
|
|
6647
|
+
}
|
|
6648
|
+
});
|
|
6601
6649
|
} }],
|
|
6602
6650
|
|
|
6603
6651
|
|
|
6604
6652
|
|
|
6605
6653
|
update: [
|
|
6606
6654
|
{
|
|
6607
|
-
read(
|
|
6655
|
+
read(_ref3, types) {let { height: height$1, margin } = _ref3;
|
|
6608
6656
|
this.inactive = !this.matchMedia || !isVisible(this.$el);
|
|
6609
6657
|
|
|
6610
6658
|
if (this.inactive) {
|
|
@@ -6613,35 +6661,49 @@
|
|
|
6613
6661
|
|
|
6614
6662
|
const hide = this.isActive && types.has('resize');
|
|
6615
6663
|
if (hide) {
|
|
6664
|
+
css(this.selTarget, 'transition', '0s');
|
|
6616
6665
|
this.hide();
|
|
6617
6666
|
}
|
|
6618
6667
|
|
|
6619
6668
|
if (!this.isActive) {
|
|
6620
|
-
height$1 = this.$el.
|
|
6669
|
+
height$1 = offset(this.$el).height;
|
|
6621
6670
|
margin = css(this.$el, 'margin');
|
|
6622
6671
|
}
|
|
6623
6672
|
|
|
6624
6673
|
if (hide) {
|
|
6625
6674
|
this.show();
|
|
6675
|
+
fastdom.write(() => css(this.selTarget, 'transition', ''));
|
|
6626
6676
|
}
|
|
6627
6677
|
|
|
6628
|
-
const overflow = Math.max(0, height$1 + this.offset - height(window));
|
|
6629
|
-
|
|
6630
6678
|
const referenceElement = this.isFixed ? this.placeholder : this.$el;
|
|
6679
|
+
const windowHeight = height(window);
|
|
6680
|
+
|
|
6681
|
+
let position = this.position;
|
|
6682
|
+
if (position === 'auto' && height$1 > windowHeight) {
|
|
6683
|
+
position = 'bottom';
|
|
6684
|
+
}
|
|
6685
|
+
|
|
6686
|
+
let offset$1 = toPx(this.offset, 'height', referenceElement);
|
|
6687
|
+
if (position === 'bottom') {
|
|
6688
|
+
offset$1 += windowHeight - height$1;
|
|
6689
|
+
}
|
|
6690
|
+
|
|
6691
|
+
const overflow = Math.max(0, height$1 + offset$1 - windowHeight);
|
|
6631
6692
|
const topOffset = offset(referenceElement).top;
|
|
6632
6693
|
const offsetParentTop = offset(referenceElement.offsetParent).top;
|
|
6633
6694
|
|
|
6634
6695
|
const top = parseProp(this.top, this.$el, topOffset);
|
|
6635
6696
|
const bottom = parseProp(this.bottom, this.$el, topOffset + height$1, true);
|
|
6636
6697
|
|
|
6637
|
-
const start = Math.max(top, topOffset) -
|
|
6698
|
+
const start = Math.max(top, topOffset) - offset$1;
|
|
6638
6699
|
const end = bottom ?
|
|
6639
|
-
bottom - this.$el.
|
|
6640
|
-
getScrollingElement(this.$el).scrollHeight -
|
|
6700
|
+
bottom - offset(this.$el).height + overflow - offset$1 :
|
|
6701
|
+
getScrollingElement(this.$el).scrollHeight - windowHeight;
|
|
6641
6702
|
|
|
6642
6703
|
return {
|
|
6643
6704
|
start,
|
|
6644
6705
|
end,
|
|
6706
|
+
offset: offset$1,
|
|
6645
6707
|
overflow,
|
|
6646
6708
|
topOffset,
|
|
6647
6709
|
offsetParentTop,
|
|
@@ -6649,11 +6711,11 @@
|
|
|
6649
6711
|
margin,
|
|
6650
6712
|
width: dimensions$1(isVisible(this.widthElement) ? this.widthElement : this.$el).
|
|
6651
6713
|
width,
|
|
6652
|
-
top: offsetPosition(
|
|
6714
|
+
top: offsetPosition(referenceElement)[0] };
|
|
6653
6715
|
|
|
6654
6716
|
},
|
|
6655
6717
|
|
|
6656
|
-
write(
|
|
6718
|
+
write(_ref4) {let { height, margin } = _ref4;
|
|
6657
6719
|
const { placeholder } = this;
|
|
6658
6720
|
|
|
6659
6721
|
css(placeholder, { height, margin });
|
|
@@ -6670,14 +6732,14 @@
|
|
|
6670
6732
|
|
|
6671
6733
|
|
|
6672
6734
|
{
|
|
6673
|
-
read(
|
|
6735
|
+
read(_ref5)
|
|
6674
6736
|
|
|
6675
6737
|
|
|
6676
6738
|
|
|
6677
6739
|
|
|
6678
6740
|
|
|
6679
6741
|
|
|
6680
|
-
{let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } =
|
|
6742
|
+
{let { scroll: prevScroll = 0, dir: prevDir = 'down', overflow, overflowScroll = 0, start, end } = _ref5;
|
|
6681
6743
|
const scroll = scrollTop(window);
|
|
6682
6744
|
const dir = prevScroll <= scroll ? 'down' : 'up';
|
|
6683
6745
|
|
|
@@ -6758,7 +6820,7 @@
|
|
|
6758
6820
|
}
|
|
6759
6821
|
} else if (this.isFixed) {
|
|
6760
6822
|
this.update();
|
|
6761
|
-
} else if (this.animation) {
|
|
6823
|
+
} else if (this.animation && scroll > topOffset) {
|
|
6762
6824
|
Animation.cancel(this.$el);
|
|
6763
6825
|
this.show();
|
|
6764
6826
|
Animation.in(this.$el, this.animation).catch(noop);
|
|
@@ -6786,33 +6848,33 @@
|
|
|
6786
6848
|
},
|
|
6787
6849
|
|
|
6788
6850
|
update() {
|
|
6789
|
-
|
|
6851
|
+
let {
|
|
6790
6852
|
width,
|
|
6791
6853
|
scroll = 0,
|
|
6792
6854
|
overflow,
|
|
6793
6855
|
overflowScroll = 0,
|
|
6794
6856
|
start,
|
|
6795
6857
|
end,
|
|
6858
|
+
offset,
|
|
6796
6859
|
topOffset,
|
|
6797
6860
|
height,
|
|
6798
6861
|
offsetParentTop } =
|
|
6799
6862
|
this._data;
|
|
6800
6863
|
const active = start !== 0 || scroll > start;
|
|
6801
|
-
let top = this.offset;
|
|
6802
6864
|
let position = 'fixed';
|
|
6803
6865
|
|
|
6804
6866
|
if (scroll > end) {
|
|
6805
|
-
|
|
6867
|
+
offset += end - offsetParentTop;
|
|
6806
6868
|
position = 'absolute';
|
|
6807
6869
|
}
|
|
6808
6870
|
|
|
6809
6871
|
if (overflow) {
|
|
6810
|
-
|
|
6872
|
+
offset -= overflowScroll;
|
|
6811
6873
|
}
|
|
6812
6874
|
|
|
6813
6875
|
css(this.$el, {
|
|
6814
6876
|
position,
|
|
6815
|
-
top:
|
|
6877
|
+
top: offset + "px",
|
|
6816
6878
|
width });
|
|
6817
6879
|
|
|
6818
6880
|
|
|
@@ -6842,7 +6904,7 @@
|
|
|
6842
6904
|
}
|
|
6843
6905
|
|
|
6844
6906
|
var Switcher = {
|
|
6845
|
-
mixins: [Togglable],
|
|
6907
|
+
mixins: [Lazyload, Togglable],
|
|
6846
6908
|
|
|
6847
6909
|
args: 'connect',
|
|
6848
6910
|
|
|
@@ -6906,6 +6968,10 @@
|
|
|
6906
6968
|
} },
|
|
6907
6969
|
|
|
6908
6970
|
|
|
6971
|
+
connected() {
|
|
6972
|
+
this.lazyload(this.$el, this.connects);
|
|
6973
|
+
},
|
|
6974
|
+
|
|
6909
6975
|
events: [
|
|
6910
6976
|
{
|
|
6911
6977
|
name: 'click',
|
|
@@ -7014,7 +7080,7 @@
|
|
|
7014
7080
|
const KEY_SPACE = 32;
|
|
7015
7081
|
|
|
7016
7082
|
var toggle = {
|
|
7017
|
-
mixins: [Media, Togglable],
|
|
7083
|
+
mixins: [Lazyload, Media, Togglable],
|
|
7018
7084
|
|
|
7019
7085
|
args: 'target',
|
|
7020
7086
|
|
|
@@ -7036,6 +7102,7 @@
|
|
|
7036
7102
|
if (!includes(this.mode, 'media') && !isFocusable(this.$el)) {
|
|
7037
7103
|
attr(this.$el, 'tabindex', '0');
|
|
7038
7104
|
}
|
|
7105
|
+
this.lazyload(this.$el, this.target);
|
|
7039
7106
|
},
|
|
7040
7107
|
|
|
7041
7108
|
computed: {
|
|
@@ -7127,7 +7194,7 @@
|
|
|
7127
7194
|
name: 'keydown',
|
|
7128
7195
|
|
|
7129
7196
|
filter() {
|
|
7130
|
-
return includes(this.mode, 'click') && this.$el
|
|
7197
|
+
return includes(this.mode, 'click') && !isTag(this.$el, 'input');
|
|
7131
7198
|
},
|
|
7132
7199
|
|
|
7133
7200
|
handler(e) {
|
|
@@ -7388,8 +7455,8 @@
|
|
|
7388
7455
|
this.stop();
|
|
7389
7456
|
|
|
7390
7457
|
if (this.date && this.units.length) {
|
|
7391
|
-
this.$
|
|
7392
|
-
this.timer = setInterval(this.$
|
|
7458
|
+
this.$emit();
|
|
7459
|
+
this.timer = setInterval(() => this.$emit(), 1000);
|
|
7393
7460
|
}
|
|
7394
7461
|
},
|
|
7395
7462
|
|
|
@@ -7571,7 +7638,7 @@
|
|
|
7571
7638
|
|
|
7572
7639
|
// Reset to previous state
|
|
7573
7640
|
nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));
|
|
7574
|
-
css(target,
|
|
7641
|
+
css(target, { display: 'block', ...targetProps });
|
|
7575
7642
|
|
|
7576
7643
|
// Start transitions on next frame
|
|
7577
7644
|
requestAnimationFrame(() => {
|
|
@@ -7603,15 +7670,13 @@
|
|
|
7603
7670
|
const zIndex = css(el, 'zIndex');
|
|
7604
7671
|
|
|
7605
7672
|
return isVisible(el) ?
|
|
7606
|
-
assign(
|
|
7607
7673
|
{
|
|
7608
7674
|
display: '',
|
|
7609
7675
|
opacity: opacity ? css(el, 'opacity') : '0',
|
|
7610
7676
|
pointerEvents: 'none',
|
|
7611
7677
|
position: 'absolute',
|
|
7612
|
-
zIndex: zIndex === 'auto' ? index(el) : zIndex
|
|
7613
|
-
|
|
7614
|
-
getPositionWithMargin(el)) :
|
|
7678
|
+
zIndex: zIndex === 'auto' ? index(el) : zIndex,
|
|
7679
|
+
...getPositionWithMargin(el) } :
|
|
7615
7680
|
|
|
7616
7681
|
false;
|
|
7617
7682
|
}
|
|
@@ -7795,7 +7860,7 @@
|
|
|
7795
7860
|
},
|
|
7796
7861
|
|
|
7797
7862
|
setState(state, animate) {if (animate === void 0) {animate = true;}
|
|
7798
|
-
state =
|
|
7863
|
+
state = { filter: { '': '' }, sort: [], ...state };
|
|
7799
7864
|
|
|
7800
7865
|
trigger(this.$el, 'beforeFilter', [this, state]);
|
|
7801
7866
|
|
|
@@ -7895,7 +7960,7 @@
|
|
|
7895
7960
|
}
|
|
7896
7961
|
|
|
7897
7962
|
function sortItems(nodes, sort, order) {
|
|
7898
|
-
return
|
|
7963
|
+
return [...nodes].sort(
|
|
7899
7964
|
(a, b) =>
|
|
7900
7965
|
data(a, sort).localeCompare(data(b, sort), undefined, { numeric: true }) * (
|
|
7901
7966
|
order === 'asc' || -1));
|
|
@@ -7934,7 +7999,8 @@
|
|
|
7934
7999
|
return "scale3d(" + value + ", " + value + ", 1)";
|
|
7935
8000
|
}
|
|
7936
8001
|
|
|
7937
|
-
var Animations$1 =
|
|
8002
|
+
var Animations$1 = {
|
|
8003
|
+
...Animations$2,
|
|
7938
8004
|
fade: {
|
|
7939
8005
|
show() {
|
|
7940
8006
|
return [{ opacity: 0 }, { opacity: 1 }];
|
|
@@ -7966,7 +8032,7 @@
|
|
|
7966
8032
|
{ opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },
|
|
7967
8033
|
{ opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }];
|
|
7968
8034
|
|
|
7969
|
-
} } }
|
|
8035
|
+
} } };
|
|
7970
8036
|
|
|
7971
8037
|
function Transitioner$1(prev, next, dir, _ref) {let { animation, easing } = _ref;
|
|
7972
8038
|
const { percent, translate, show = noop } = animation;
|
|
@@ -8440,12 +8506,6 @@
|
|
|
8440
8506
|
} },
|
|
8441
8507
|
|
|
8442
8508
|
|
|
8443
|
-
events: {
|
|
8444
|
-
itemshown() {
|
|
8445
|
-
this.$update(this.list);
|
|
8446
|
-
} },
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
8509
|
methods: {
|
|
8450
8510
|
show(index, force) {if (force === void 0) {force = false;}
|
|
8451
8511
|
if (this.dragging || !this.length) {
|
|
@@ -8527,20 +8587,13 @@
|
|
|
8527
8587
|
},
|
|
8528
8588
|
|
|
8529
8589
|
_show(prev, next, force) {
|
|
8530
|
-
this._transitioner = this._getTransitioner(
|
|
8531
|
-
prev,
|
|
8532
|
-
next,
|
|
8533
|
-
this.dir,
|
|
8534
|
-
assign(
|
|
8535
|
-
{
|
|
8590
|
+
this._transitioner = this._getTransitioner(prev, next, this.dir, {
|
|
8536
8591
|
easing: force ?
|
|
8537
8592
|
next.offsetWidth < 600 ?
|
|
8538
8593
|
'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
|
|
8539
8594
|
'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
|
|
8540
|
-
this.easing
|
|
8541
|
-
|
|
8542
|
-
this.transitionOptions));
|
|
8543
|
-
|
|
8595
|
+
this.easing,
|
|
8596
|
+
...this.transitionOptions });
|
|
8544
8597
|
|
|
8545
8598
|
|
|
8546
8599
|
if (!force && !prev) {
|
|
@@ -8605,7 +8658,7 @@
|
|
|
8605
8658
|
|
|
8606
8659
|
computed: {
|
|
8607
8660
|
animation(_ref) {let { animation, Animations } = _ref;
|
|
8608
|
-
return
|
|
8661
|
+
return { ...(Animations[animation] || Animations.slide), name: animation };
|
|
8609
8662
|
},
|
|
8610
8663
|
|
|
8611
8664
|
transitionOptions() {
|
|
@@ -8614,19 +8667,15 @@
|
|
|
8614
8667
|
|
|
8615
8668
|
|
|
8616
8669
|
events: {
|
|
8617
|
-
|
|
8618
|
-
this.$update(target);
|
|
8619
|
-
},
|
|
8620
|
-
|
|
8621
|
-
beforeitemshow(_ref3) {let { target } = _ref3;
|
|
8670
|
+
beforeitemshow(_ref2) {let { target } = _ref2;
|
|
8622
8671
|
addClass(target, this.clsActive);
|
|
8623
8672
|
},
|
|
8624
8673
|
|
|
8625
|
-
itemshown(
|
|
8674
|
+
itemshown(_ref3) {let { target } = _ref3;
|
|
8626
8675
|
addClass(target, this.clsActivated);
|
|
8627
8676
|
},
|
|
8628
8677
|
|
|
8629
|
-
itemhidden(
|
|
8678
|
+
itemhidden(_ref4) {let { target } = _ref4;
|
|
8630
8679
|
removeClass(target, this.clsActive, this.clsActivated);
|
|
8631
8680
|
} } };
|
|
8632
8681
|
|
|
@@ -8828,28 +8877,20 @@
|
|
|
8828
8877
|
if (type === 'image' || src.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i)) {
|
|
8829
8878
|
try {
|
|
8830
8879
|
const { width, height } = await getImage(src, attrs.srcset, attrs.size);
|
|
8831
|
-
this.setItem(
|
|
8832
|
-
item,
|
|
8833
|
-
createEl('img', assign({ src, width, height, alt }, attrs)));
|
|
8834
|
-
|
|
8880
|
+
this.setItem(item, createEl('img', { src, width, height, alt, ...attrs }));
|
|
8835
8881
|
} catch (e) {
|
|
8836
8882
|
this.setError(item);
|
|
8837
8883
|
}
|
|
8838
8884
|
|
|
8839
8885
|
// Video
|
|
8840
8886
|
} else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
|
|
8841
|
-
const video = createEl(
|
|
8842
|
-
'video',
|
|
8843
|
-
assign(
|
|
8844
|
-
{
|
|
8887
|
+
const video = createEl('video', {
|
|
8845
8888
|
src,
|
|
8846
8889
|
poster,
|
|
8847
8890
|
controls: '',
|
|
8848
8891
|
playsinline: '',
|
|
8849
|
-
'uk-video': "" + this.videoAutoplay
|
|
8850
|
-
|
|
8851
|
-
attrs));
|
|
8852
|
-
|
|
8892
|
+
'uk-video': "" + this.videoAutoplay,
|
|
8893
|
+
...attrs });
|
|
8853
8894
|
|
|
8854
8895
|
|
|
8855
8896
|
on(video, 'loadedmetadata', () => {
|
|
@@ -8862,17 +8903,12 @@
|
|
|
8862
8903
|
} else if (type === 'iframe' || src.match(/\.(html|php)($|\?)/i)) {
|
|
8863
8904
|
this.setItem(
|
|
8864
8905
|
item,
|
|
8865
|
-
createEl(
|
|
8866
|
-
'iframe',
|
|
8867
|
-
assign(
|
|
8868
|
-
{
|
|
8906
|
+
createEl('iframe', {
|
|
8869
8907
|
src,
|
|
8870
8908
|
frameborder: '0',
|
|
8871
8909
|
allowfullscreen: '',
|
|
8872
|
-
class: 'uk-lightbox-iframe'
|
|
8873
|
-
|
|
8874
|
-
attrs)));
|
|
8875
|
-
|
|
8910
|
+
class: 'uk-lightbox-iframe',
|
|
8911
|
+
...attrs }));
|
|
8876
8912
|
|
|
8877
8913
|
|
|
8878
8914
|
|
|
@@ -8884,19 +8920,14 @@
|
|
|
8884
8920
|
{
|
|
8885
8921
|
this.setItem(
|
|
8886
8922
|
item,
|
|
8887
|
-
createEl(
|
|
8888
|
-
|
|
8889
|
-
assign(
|
|
8890
|
-
{
|
|
8891
|
-
src: "https://www.youtube" + (matches[1] || '') + ".com/embed/" +
|
|
8892
|
-
matches[2] + (
|
|
8923
|
+
createEl('iframe', {
|
|
8924
|
+
src: "https://www.youtube" + (matches[1] || '') + ".com/embed/" + matches[2] + (
|
|
8893
8925
|
matches[3] ? "?" + matches[3] : ''),
|
|
8894
|
-
width: 1920,
|
|
8895
|
-
height: 1080 },
|
|
8896
|
-
|
|
8897
|
-
iframeAttrs,
|
|
8898
|
-
attrs)));
|
|
8899
8926
|
|
|
8927
|
+
width: 1920,
|
|
8928
|
+
height: 1080,
|
|
8929
|
+
...iframeAttrs,
|
|
8930
|
+
...attrs }));
|
|
8900
8931
|
|
|
8901
8932
|
|
|
8902
8933
|
|
|
@@ -8916,19 +8947,14 @@
|
|
|
8916
8947
|
|
|
8917
8948
|
this.setItem(
|
|
8918
8949
|
item,
|
|
8919
|
-
createEl(
|
|
8920
|
-
'iframe',
|
|
8921
|
-
assign(
|
|
8922
|
-
{
|
|
8950
|
+
createEl('iframe', {
|
|
8923
8951
|
src: "https://player.vimeo.com/video/" + matches[1] + (
|
|
8924
8952
|
matches[2] ? "?" + matches[2] : ''),
|
|
8925
8953
|
|
|
8926
8954
|
width,
|
|
8927
|
-
height
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
attrs)));
|
|
8931
|
-
|
|
8955
|
+
height,
|
|
8956
|
+
...iframeAttrs,
|
|
8957
|
+
...attrs }));
|
|
8932
8958
|
|
|
8933
8959
|
|
|
8934
8960
|
} catch (e) {
|
|
@@ -9030,8 +9056,7 @@
|
|
|
9030
9056
|
index = findIndex(items, (_ref2) => {let { source: src } = _ref2;return source === src;});
|
|
9031
9057
|
}
|
|
9032
9058
|
|
|
9033
|
-
this.panel =
|
|
9034
|
-
this.panel || this.$create('lightboxPanel', assign({}, this.$props, { items }));
|
|
9059
|
+
this.panel = this.panel || this.$create('lightboxPanel', { ...this.$props, items });
|
|
9035
9060
|
|
|
9036
9061
|
on(this.panel.$el, 'hidden', () => this.panel = false);
|
|
9037
9062
|
|
|
@@ -9236,50 +9261,44 @@
|
|
|
9236
9261
|
},
|
|
9237
9262
|
|
|
9238
9263
|
getCss(percent) {
|
|
9239
|
-
|
|
9240
|
-
(
|
|
9264
|
+
const css = { transform: '', filter: '' };
|
|
9265
|
+
for (const prop in this.props) {
|
|
9241
9266
|
this.props[prop](css, percent);
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
{ transform: '', filter: '' });
|
|
9245
|
-
|
|
9267
|
+
}
|
|
9268
|
+
return css;
|
|
9246
9269
|
} } };
|
|
9247
9270
|
|
|
9248
9271
|
|
|
9249
9272
|
|
|
9250
|
-
function transformFn(prop, el,
|
|
9251
|
-
const unit = getUnit(
|
|
9273
|
+
function transformFn(prop, el, stops) {
|
|
9274
|
+
const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
9275
|
+
let transformFn;
|
|
9252
9276
|
|
|
9253
9277
|
if (prop === 'x' || prop === 'y') {
|
|
9254
9278
|
prop = "translate" + ucfirst(prop);
|
|
9279
|
+
transformFn = (stop) => toFloat(toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
|
|
9255
9280
|
}
|
|
9256
9281
|
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
if (steps.length === 1) {
|
|
9260
|
-
steps.unshift(prop === 'scale' ? 1 : 0);
|
|
9282
|
+
if (stops.length === 1) {
|
|
9283
|
+
stops.unshift(prop === 'scale' ? 1 : 0);
|
|
9261
9284
|
}
|
|
9262
9285
|
|
|
9263
|
-
|
|
9264
|
-
let value = getValue(steps, percent);
|
|
9265
|
-
|
|
9266
|
-
if (startsWith(prop, 'translate')) {
|
|
9267
|
-
value = toFloat(value).toFixed(unit === 'px' ? 0 : 6);
|
|
9268
|
-
}
|
|
9286
|
+
stops = parseStops(stops, transformFn);
|
|
9269
9287
|
|
|
9270
|
-
|
|
9288
|
+
return (css, percent) => {
|
|
9289
|
+
css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
|
|
9271
9290
|
};
|
|
9272
9291
|
}
|
|
9273
9292
|
|
|
9274
|
-
function colorFn(prop, el,
|
|
9275
|
-
if (
|
|
9276
|
-
|
|
9293
|
+
function colorFn(prop, el, stops) {
|
|
9294
|
+
if (stops.length === 1) {
|
|
9295
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
9277
9296
|
}
|
|
9278
9297
|
|
|
9279
|
-
|
|
9298
|
+
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
9280
9299
|
|
|
9281
9300
|
return (css, percent) => {
|
|
9282
|
-
const [start, end, p] =
|
|
9301
|
+
const [start, end, p] = getStop(stops, percent);
|
|
9283
9302
|
const value = start.
|
|
9284
9303
|
map((value, i) => {
|
|
9285
9304
|
value += p * (end[i] - value);
|
|
@@ -9299,85 +9318,83 @@
|
|
|
9299
9318
|
map(toFloat);
|
|
9300
9319
|
}
|
|
9301
9320
|
|
|
9302
|
-
function filterFn(prop, el,
|
|
9303
|
-
if (
|
|
9304
|
-
|
|
9321
|
+
function filterFn(prop, el, stops) {
|
|
9322
|
+
if (stops.length === 1) {
|
|
9323
|
+
stops.unshift(0);
|
|
9305
9324
|
}
|
|
9306
9325
|
|
|
9307
|
-
const unit = getUnit(
|
|
9326
|
+
const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
9308
9327
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
9309
|
-
|
|
9328
|
+
stops = parseStops(stops);
|
|
9310
9329
|
|
|
9311
9330
|
return (css, percent) => {
|
|
9312
|
-
const value = getValue(
|
|
9331
|
+
const value = getValue(stops, percent);
|
|
9313
9332
|
css.filter += " " + prop + "(" + (value + unit) + ")";
|
|
9314
9333
|
};
|
|
9315
9334
|
}
|
|
9316
9335
|
|
|
9317
|
-
function cssPropFn(prop, el,
|
|
9318
|
-
if (
|
|
9319
|
-
|
|
9336
|
+
function cssPropFn(prop, el, stops) {
|
|
9337
|
+
if (stops.length === 1) {
|
|
9338
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
9320
9339
|
}
|
|
9321
9340
|
|
|
9322
|
-
|
|
9341
|
+
stops = parseStops(stops);
|
|
9323
9342
|
|
|
9324
9343
|
return (css, percent) => {
|
|
9325
|
-
css[prop] = getValue(
|
|
9344
|
+
css[prop] = getValue(stops, percent);
|
|
9326
9345
|
};
|
|
9327
9346
|
}
|
|
9328
9347
|
|
|
9329
|
-
function strokeFn(prop, el,
|
|
9330
|
-
if (
|
|
9331
|
-
|
|
9348
|
+
function strokeFn(prop, el, stops) {
|
|
9349
|
+
if (stops.length === 1) {
|
|
9350
|
+
stops.unshift(0);
|
|
9332
9351
|
}
|
|
9333
9352
|
|
|
9334
|
-
const unit = getUnit(
|
|
9335
|
-
|
|
9353
|
+
const unit = getUnit(stops);
|
|
9354
|
+
const length = getMaxPathLength(el);
|
|
9355
|
+
stops = parseStops(stops.reverse(), (stop) => {
|
|
9356
|
+
stop = toFloat(stop);
|
|
9357
|
+
return unit === '%' ? stop * length / 100 : stop;
|
|
9358
|
+
});
|
|
9336
9359
|
|
|
9337
|
-
if (!
|
|
9360
|
+
if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
|
|
9338
9361
|
return noop;
|
|
9339
9362
|
}
|
|
9340
9363
|
|
|
9341
|
-
const length = getMaxPathLength(el);
|
|
9342
9364
|
css(el, 'strokeDasharray', length);
|
|
9343
9365
|
|
|
9344
|
-
if (unit === '%') {
|
|
9345
|
-
steps = steps.map((step) => step * length / 100);
|
|
9346
|
-
}
|
|
9347
|
-
|
|
9348
|
-
steps = steps.reverse();
|
|
9349
|
-
|
|
9350
9366
|
return (css, percent) => {
|
|
9351
|
-
css.strokeDashoffset = getValue(
|
|
9367
|
+
css.strokeDashoffset = getValue(stops, percent);
|
|
9352
9368
|
};
|
|
9353
9369
|
}
|
|
9354
9370
|
|
|
9355
|
-
function backgroundFn(prop, el,
|
|
9356
|
-
if (
|
|
9357
|
-
|
|
9371
|
+
function backgroundFn(prop, el, stops) {
|
|
9372
|
+
if (stops.length === 1) {
|
|
9373
|
+
stops.unshift(0);
|
|
9358
9374
|
}
|
|
9359
9375
|
|
|
9360
9376
|
prop = prop.substr(-1);
|
|
9361
9377
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
9362
|
-
|
|
9378
|
+
stops = parseStops(stops, (stop) => toPx(stop, attr, el));
|
|
9363
9379
|
|
|
9364
9380
|
const bgPos = getCssValue(el, "background-position-" + prop, '');
|
|
9365
9381
|
|
|
9366
9382
|
return getCssValue(el, 'backgroundSize', '') === 'cover' ?
|
|
9367
|
-
backgroundCoverFn(prop, el,
|
|
9368
|
-
setBackgroundPosFn(prop,
|
|
9383
|
+
backgroundCoverFn(prop, el, stops, bgPos, attr) :
|
|
9384
|
+
setBackgroundPosFn(prop, stops, bgPos);
|
|
9369
9385
|
}
|
|
9370
9386
|
|
|
9371
|
-
function backgroundCoverFn(prop, el,
|
|
9387
|
+
function backgroundCoverFn(prop, el, stops, bgPos, attr) {
|
|
9372
9388
|
const dimImage = getBackgroundImageDimensions(el);
|
|
9373
9389
|
|
|
9374
9390
|
if (!dimImage.width) {
|
|
9375
9391
|
return noop;
|
|
9376
9392
|
}
|
|
9377
9393
|
|
|
9378
|
-
const
|
|
9379
|
-
const
|
|
9380
|
-
const
|
|
9394
|
+
const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
|
|
9395
|
+
const min = Math.min(...values);
|
|
9396
|
+
const max = Math.max(...values);
|
|
9397
|
+
const down = values.indexOf(min) < values.indexOf(max);
|
|
9381
9398
|
|
|
9382
9399
|
const diff = max - min;
|
|
9383
9400
|
let pos = (down ? -diff : 0) - (down ? min : max);
|
|
@@ -9402,7 +9419,7 @@
|
|
|
9402
9419
|
|
|
9403
9420
|
const dim = Dimensions.cover(dimImage, dimEl);
|
|
9404
9421
|
|
|
9405
|
-
const fn = setBackgroundPosFn(prop,
|
|
9422
|
+
const fn = setBackgroundPosFn(prop, stops, pos + "px");
|
|
9406
9423
|
return (css, percent) => {
|
|
9407
9424
|
fn(css, percent);
|
|
9408
9425
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -9410,9 +9427,9 @@
|
|
|
9410
9427
|
};
|
|
9411
9428
|
}
|
|
9412
9429
|
|
|
9413
|
-
function setBackgroundPosFn(prop,
|
|
9430
|
+
function setBackgroundPosFn(prop, stops, pos) {
|
|
9414
9431
|
return function (css, percent) {
|
|
9415
|
-
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(
|
|
9432
|
+
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
|
|
9416
9433
|
};
|
|
9417
9434
|
}
|
|
9418
9435
|
|
|
@@ -9433,6 +9450,7 @@
|
|
|
9433
9450
|
dimensions[src] = toDimensions(image);
|
|
9434
9451
|
trigger(el, 'bgimageload');
|
|
9435
9452
|
};
|
|
9453
|
+
return toDimensions(image);
|
|
9436
9454
|
}
|
|
9437
9455
|
}
|
|
9438
9456
|
|
|
@@ -9446,27 +9464,71 @@
|
|
|
9446
9464
|
|
|
9447
9465
|
}
|
|
9448
9466
|
|
|
9449
|
-
function
|
|
9450
|
-
const
|
|
9451
|
-
const
|
|
9467
|
+
function parseStops(stops, fn) {if (fn === void 0) {fn = toFloat;}
|
|
9468
|
+
const result = [];
|
|
9469
|
+
const { length } = stops;
|
|
9470
|
+
let nullIndex = 0;
|
|
9471
|
+
for (let i = 0; i < length; i++) {
|
|
9472
|
+
let [value, percent] = isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
|
|
9473
|
+
value = fn(value);
|
|
9474
|
+
percent = percent ? toFloat(percent) / 100 : null;
|
|
9475
|
+
|
|
9476
|
+
if (i === 0) {
|
|
9477
|
+
if (percent === null) {
|
|
9478
|
+
percent = 0;
|
|
9479
|
+
} else if (percent) {
|
|
9480
|
+
result.push([value, 0]);
|
|
9481
|
+
}
|
|
9482
|
+
} else if (i === length - 1) {
|
|
9483
|
+
if (percent === null) {
|
|
9484
|
+
percent = 1;
|
|
9485
|
+
} else if (percent !== 1) {
|
|
9486
|
+
result.push([value, percent]);
|
|
9487
|
+
percent = 1;
|
|
9488
|
+
}
|
|
9489
|
+
}
|
|
9490
|
+
|
|
9491
|
+
result.push([value, percent]);
|
|
9492
|
+
|
|
9493
|
+
if (percent === null) {
|
|
9494
|
+
nullIndex++;
|
|
9495
|
+
} else if (nullIndex) {
|
|
9496
|
+
const leftPercent = result[i - nullIndex - 1][1];
|
|
9497
|
+
const p = (percent - leftPercent) / (nullIndex + 1);
|
|
9498
|
+
for (let j = nullIndex; j > 0; j--) {
|
|
9499
|
+
result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
|
|
9500
|
+
}
|
|
9501
|
+
|
|
9502
|
+
nullIndex = 0;
|
|
9503
|
+
}
|
|
9504
|
+
}
|
|
9505
|
+
|
|
9506
|
+
return result;
|
|
9507
|
+
}
|
|
9508
|
+
|
|
9509
|
+
function getStop(stops, percent) {
|
|
9510
|
+
const index = findIndex(stops.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
|
|
9511
|
+
return [
|
|
9512
|
+
stops[index - 1][0],
|
|
9513
|
+
stops[index][0],
|
|
9514
|
+
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
|
|
9452
9515
|
|
|
9453
|
-
return steps.
|
|
9454
|
-
slice(index, index + 2).
|
|
9455
|
-
concat(percent === 1 ? 1 : percent % (1 / count) * count);
|
|
9456
9516
|
}
|
|
9457
9517
|
|
|
9458
|
-
function getValue(
|
|
9459
|
-
const [start, end, p] =
|
|
9518
|
+
function getValue(stops, percent) {
|
|
9519
|
+
const [start, end, p] = getStop(stops, percent);
|
|
9460
9520
|
return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
9461
9521
|
}
|
|
9462
9522
|
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9523
|
+
const unitRe = /^-?\d+([^\s]*)/;
|
|
9524
|
+
function getUnit(stops, defaultUnit) {
|
|
9525
|
+
for (const stop of stops) {
|
|
9526
|
+
const match = stop.match == null ? void 0 : stop.match(unitRe);
|
|
9527
|
+
if (match) {
|
|
9528
|
+
return match[1];
|
|
9529
|
+
}
|
|
9530
|
+
}
|
|
9531
|
+
return defaultUnit;
|
|
9470
9532
|
}
|
|
9471
9533
|
|
|
9472
9534
|
function getCssValue(el, prop, value) {
|
|
@@ -9578,6 +9640,22 @@
|
|
|
9578
9640
|
|
|
9579
9641
|
events: ['resize'] } };
|
|
9580
9642
|
|
|
9643
|
+
var SliderPreload = {
|
|
9644
|
+
connected() {
|
|
9645
|
+
this.registerObserver(
|
|
9646
|
+
observeIntersection(
|
|
9647
|
+
this.slides.concat(this.$el),
|
|
9648
|
+
(entries, observer) => {
|
|
9649
|
+
for (const el of this.getAdjacentSlides()) {
|
|
9650
|
+
$$('img[loading="lazy"]', el).forEach((el) => removeAttr(el, 'loading'));
|
|
9651
|
+
observer.unobserve(el);
|
|
9652
|
+
}
|
|
9653
|
+
},
|
|
9654
|
+
{ rootMargin: '50% 50%' }));
|
|
9655
|
+
|
|
9656
|
+
|
|
9657
|
+
} };
|
|
9658
|
+
|
|
9581
9659
|
function Transitioner (prev, next, dir, _ref) {let { center, easing, list } = _ref;
|
|
9582
9660
|
const deferred = new Deferred();
|
|
9583
9661
|
|
|
@@ -9744,7 +9822,7 @@
|
|
|
9744
9822
|
}
|
|
9745
9823
|
|
|
9746
9824
|
var slider = {
|
|
9747
|
-
mixins: [Class, Slider, SliderReactive],
|
|
9825
|
+
mixins: [Class, Slider, SliderReactive, SliderPreload],
|
|
9748
9826
|
|
|
9749
9827
|
props: {
|
|
9750
9828
|
center: Boolean,
|
|
@@ -9796,48 +9874,39 @@
|
|
|
9796
9874
|
return ~index ? index : this.length - 1;
|
|
9797
9875
|
},
|
|
9798
9876
|
|
|
9799
|
-
sets(_ref2) {let { sets } = _ref2;
|
|
9800
|
-
if (!
|
|
9877
|
+
sets(_ref2) {let { sets: enabled } = _ref2;
|
|
9878
|
+
if (!enabled) {
|
|
9801
9879
|
return;
|
|
9802
9880
|
}
|
|
9803
9881
|
|
|
9804
|
-
const width = dimensions$1(this.list).width / (this.center ? 2 : 1);
|
|
9805
|
-
|
|
9806
9882
|
let left = 0;
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
const slideWidth = dimensions$1(slide).width;
|
|
9812
|
-
const slideRight = slideLeft + slideWidth;
|
|
9883
|
+
const sets = [];
|
|
9884
|
+
const width = dimensions$1(this.list).width;
|
|
9885
|
+
for (let i in this.slides) {
|
|
9886
|
+
const slideWidth = dimensions$1(this.slides[i]).width;
|
|
9813
9887
|
|
|
9814
|
-
if (
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
}
|
|
9888
|
+
if (left + slideWidth > width) {
|
|
9889
|
+
left = 0;
|
|
9890
|
+
}
|
|
9818
9891
|
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
leftCenter -= slideWidth;
|
|
9827
|
-
} else {
|
|
9828
|
-
leftCenter = width;
|
|
9829
|
-
sets.push(i);
|
|
9830
|
-
left = slideLeft + width + (this.center ? slideWidth / 2 : 0);
|
|
9831
|
-
}
|
|
9892
|
+
if (this.center) {
|
|
9893
|
+
if (
|
|
9894
|
+
left < width / 2 &&
|
|
9895
|
+
left + slideWidth + dimensions$1(this.slides[+i + 1]).width / 2 > width / 2)
|
|
9896
|
+
{
|
|
9897
|
+
sets.push(+i);
|
|
9898
|
+
left = width / 2 - slideWidth / 2;
|
|
9832
9899
|
}
|
|
9900
|
+
} else if (left === 0) {
|
|
9901
|
+
sets.push(Math.min(+i, this.maxIndex));
|
|
9833
9902
|
}
|
|
9834
9903
|
|
|
9835
|
-
|
|
9904
|
+
left += slideWidth;
|
|
9905
|
+
}
|
|
9836
9906
|
|
|
9907
|
+
if (sets.length) {
|
|
9837
9908
|
return sets;
|
|
9838
|
-
}
|
|
9839
|
-
|
|
9840
|
-
return !isEmpty(sets) && sets;
|
|
9909
|
+
}
|
|
9841
9910
|
},
|
|
9842
9911
|
|
|
9843
9912
|
transitionOptions() {
|
|
@@ -9869,15 +9938,7 @@
|
|
|
9869
9938
|
this._translate(1);
|
|
9870
9939
|
}
|
|
9871
9940
|
|
|
9872
|
-
|
|
9873
|
-
const activeClasses = [
|
|
9874
|
-
this.clsActive,
|
|
9875
|
-
(!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
|
|
9876
|
-
''];
|
|
9877
|
-
|
|
9878
|
-
for (const slide of this.slides) {
|
|
9879
|
-
toggleClass(slide, activeClasses, includes(actives, slide));
|
|
9880
|
-
}
|
|
9941
|
+
this.updateActiveClasses();
|
|
9881
9942
|
},
|
|
9882
9943
|
|
|
9883
9944
|
events: ['resize'] },
|
|
@@ -9925,6 +9986,10 @@
|
|
|
9925
9986
|
if (~this.prevIndex) {
|
|
9926
9987
|
addClass(this._getTransitioner().getItemIn(), this.clsActive);
|
|
9927
9988
|
}
|
|
9989
|
+
},
|
|
9990
|
+
|
|
9991
|
+
itemshown() {
|
|
9992
|
+
this.updateActiveClasses();
|
|
9928
9993
|
} },
|
|
9929
9994
|
|
|
9930
9995
|
|
|
@@ -9962,6 +10027,18 @@
|
|
|
9962
10027
|
}
|
|
9963
10028
|
},
|
|
9964
10029
|
|
|
10030
|
+
updateActiveClasses() {
|
|
10031
|
+
const actives = this._getTransitioner(this.index).getActives();
|
|
10032
|
+
const activeClasses = [
|
|
10033
|
+
this.clsActive,
|
|
10034
|
+
(!this.sets || includes(this.sets, toFloat(this.index))) && this.clsActivated ||
|
|
10035
|
+
''];
|
|
10036
|
+
|
|
10037
|
+
for (const slide of this.slides) {
|
|
10038
|
+
toggleClass(slide, activeClasses, includes(actives, slide));
|
|
10039
|
+
}
|
|
10040
|
+
},
|
|
10041
|
+
|
|
9965
10042
|
getValidIndex(index, prevIndex) {if (index === void 0) {index = this.index;}if (prevIndex === void 0) {prevIndex = this.prevIndex;}
|
|
9966
10043
|
index = this.getIndex(index, prevIndex);
|
|
9967
10044
|
|
|
@@ -9981,6 +10058,25 @@
|
|
|
9981
10058
|
} while (index !== prev);
|
|
9982
10059
|
|
|
9983
10060
|
return index;
|
|
10061
|
+
},
|
|
10062
|
+
|
|
10063
|
+
getAdjacentSlides() {
|
|
10064
|
+
const { width } = dimensions$1(this.list);
|
|
10065
|
+
const left = -width;
|
|
10066
|
+
const right = width * 2;
|
|
10067
|
+
const slideWidth = dimensions$1(this.slides[this.index]).width;
|
|
10068
|
+
const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
|
|
10069
|
+
const slides = new Set();
|
|
10070
|
+
for (const i of [-1, 1]) {
|
|
10071
|
+
let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
|
|
10072
|
+
let j = 0;
|
|
10073
|
+
do {
|
|
10074
|
+
const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
|
|
10075
|
+
currentLeft += dimensions$1(slide).width * i;
|
|
10076
|
+
slides.add(slide);
|
|
10077
|
+
} while (this.slides.length > j && currentLeft > left && currentLeft < right);
|
|
10078
|
+
}
|
|
10079
|
+
return Array.from(slides);
|
|
9984
10080
|
} } };
|
|
9985
10081
|
|
|
9986
10082
|
|
|
@@ -10067,7 +10163,8 @@
|
|
|
10067
10163
|
return isIn(type) ^ dir < 0 ? percent : 1 - percent;
|
|
10068
10164
|
}
|
|
10069
10165
|
|
|
10070
|
-
var Animations =
|
|
10166
|
+
var Animations = {
|
|
10167
|
+
...Animations$2,
|
|
10071
10168
|
fade: {
|
|
10072
10169
|
show() {
|
|
10073
10170
|
return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
|
|
@@ -10156,10 +10253,10 @@
|
|
|
10156
10253
|
{ transform: translate(-30 * percent), zIndex: -1 },
|
|
10157
10254
|
{ transform: translate(100 * (1 - percent)), zIndex: 0 }];
|
|
10158
10255
|
|
|
10159
|
-
} } }
|
|
10256
|
+
} } };
|
|
10160
10257
|
|
|
10161
10258
|
var slideshow = {
|
|
10162
|
-
mixins: [Class, Slideshow, SliderReactive],
|
|
10259
|
+
mixins: [Class, Slideshow, SliderReactive, SliderPreload],
|
|
10163
10260
|
|
|
10164
10261
|
props: {
|
|
10165
10262
|
ratio: String,
|
|
@@ -10202,7 +10299,13 @@
|
|
|
10202
10299
|
height > 0 && css(this.list, 'minHeight', height);
|
|
10203
10300
|
},
|
|
10204
10301
|
|
|
10205
|
-
events: ['resize'] }
|
|
10302
|
+
events: ['resize'] },
|
|
10303
|
+
|
|
10304
|
+
|
|
10305
|
+
methods: {
|
|
10306
|
+
getAdjacentSlides() {
|
|
10307
|
+
return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
|
|
10308
|
+
} } };
|
|
10206
10309
|
|
|
10207
10310
|
var sortable = {
|
|
10208
10311
|
mixins: [Class, Animate],
|
|
@@ -10375,7 +10478,7 @@
|
|
|
10375
10478
|
|
|
10376
10479
|
this.touched = new Set([this]);
|
|
10377
10480
|
this.placeholder = placeholder;
|
|
10378
|
-
this.origin =
|
|
10481
|
+
this.origin = { target, index: index(placeholder), ...this.pos };
|
|
10379
10482
|
|
|
10380
10483
|
on(document, pointerMove, this.move);
|
|
10381
10484
|
on(document, pointerUp, this.end);
|