uikit 3.21.14-dev.60ed95dfb → 3.21.14-dev.8b3dfa6cd
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 +35 -0
- package/dist/css/uikit-core-rtl.css +233 -85
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +233 -85
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +237 -81
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +237 -81
- 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 +2 -11
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +425 -126
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +442 -131
- 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 +2 -2
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +2 -2
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +17 -27
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +2 -2
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +22 -33
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +9 -13
- 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 +212 -212
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +20 -17
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +631 -521
- package/dist/js/uikit.min.js +1 -1
- package/package.json +2 -2
- package/src/images/icons/arrow-down-arrow-up.svg +6 -0
- package/src/images/icons/arrow-down.svg +3 -3
- package/src/images/icons/arrow-left.svg +3 -3
- package/src/images/icons/arrow-right.svg +3 -3
- package/src/images/icons/arrow-up-right.svg +3 -3
- package/src/images/icons/arrow-up.svg +3 -3
- package/src/images/icons/close-circle.svg +5 -0
- package/src/images/icons/cloud-download.svg +4 -4
- package/src/images/icons/cloud-upload.svg +4 -4
- package/src/images/icons/download.svg +4 -4
- package/src/images/icons/expand.svg +5 -5
- package/src/images/icons/link-external.svg +4 -4
- package/src/images/icons/pull.svg +4 -4
- package/src/images/icons/push.svg +3 -3
- package/src/images/icons/shrink.svg +5 -5
- package/src/images/icons/sign-in.svg +4 -3
- package/src/images/icons/sign-out.svg +4 -3
- package/src/images/icons/sorting.svg +6 -0
- package/src/images/icons/upload.svg +4 -4
- package/src/js/api/instance.js +1 -1
- package/src/js/components/internal/lightbox-animations.js +2 -1
- package/src/js/components/internal/slideshow-animations.js +5 -5
- package/src/js/components/lightbox-panel.js +180 -45
- package/src/js/components/lightbox.js +59 -6
- package/src/js/components/slideshow.js +1 -2
- package/src/js/components/tooltip.js +1 -1
- package/src/js/core/grid.js +1 -1
- package/src/js/core/icon.js +2 -2
- package/src/js/core/img.js +3 -5
- package/src/js/core/navbar.js +6 -2
- package/src/js/core/scrollspy-nav.js +1 -1
- package/src/js/core/svg.js +8 -10
- package/src/js/core/toggle.js +1 -1
- package/src/js/core/video.js +4 -3
- package/src/js/mixin/internal/slideshow-animations.js +1 -6
- package/src/js/mixin/modal.js +1 -4
- package/src/js/mixin/slider-drag.js +5 -6
- package/src/js/mixin/slider-nav.js +1 -1
- package/src/js/mixin/slider.js +11 -13
- package/src/js/mixin/slideshow.js +1 -1
- package/src/js/mixin/togglable.js +7 -2
- package/src/js/util/dom.js +3 -1
- package/src/js/util/filter.js +3 -1
- package/src/js/util/player.js +0 -4
- package/src/less/components/background.less +1 -9
- package/src/less/components/breadcrumb.less +6 -2
- package/src/less/components/button.less +1 -1
- package/src/less/components/form-range.less +52 -0
- package/src/less/components/form.less +1 -1
- package/src/less/components/lightbox.less +57 -89
- package/src/less/components/margin.less +14 -0
- package/src/less/components/search.less +49 -23
- package/src/less/components/sticky.less +1 -10
- package/src/less/components/totop.less +1 -1
- package/src/less/components/transition.less +4 -4
- package/src/less/components/visibility.less +3 -2
- package/src/less/theme/form-range.less +12 -0
- package/src/less/theme/lightbox.less +2 -20
- package/src/less/theme/search.less +24 -10
- package/src/scss/components/background.scss +1 -9
- package/src/scss/components/breadcrumb.scss +6 -2
- package/src/scss/components/button.scss +1 -1
- package/src/scss/components/form-range.scss +12 -0
- package/src/scss/components/form.scss +1 -1
- package/src/scss/components/lightbox.scss +50 -77
- package/src/scss/components/margin.scss +13 -0
- package/src/scss/components/search.scss +30 -12
- package/src/scss/components/sticky.scss +1 -10
- package/src/scss/components/totop.scss +1 -1
- package/src/scss/components/transition.scss +4 -4
- package/src/scss/components/visibility.scss +3 -2
- package/src/scss/mixins-theme.scss +51 -12
- package/src/scss/mixins.scss +45 -6
- package/src/scss/theme/form-range.scss +10 -0
- package/src/scss/theme/lightbox.scss +2 -20
- package/src/scss/theme/search.scss +10 -6
- package/src/scss/variables-theme.scss +32 -20
- package/src/scss/variables.scss +29 -24
- package/tests/badge.html +2 -2
- package/tests/base.html +1 -1
- package/tests/breadcrumb.html +23 -5
- package/tests/card.html +24 -24
- package/tests/dropbar.html +15 -15
- package/tests/dropdown.html +6 -6
- package/tests/dropnav.html +100 -100
- package/tests/icon.html +8 -0
- package/tests/index.html +15 -15
- package/tests/lightbox.html +379 -28
- package/tests/margin.html +19 -0
- package/tests/nav.html +21 -21
- package/tests/navbar.html +292 -292
- package/tests/offcanvas.html +27 -27
- package/tests/placeholder.html +2 -2
- package/tests/slider.html +0 -1
- package/tests/slideshow.html +1 -1
- package/tests/sortable.html +5 -5
- package/tests/sticky-navbar.html +114 -114
- package/tests/transition.html +2 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "uikit",
|
|
3
3
|
"title": "UIkit",
|
|
4
4
|
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
|
|
5
|
-
"version": "3.21.14-dev.
|
|
5
|
+
"version": "3.21.14-dev.8b3dfa6cd",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"fs-extra": "^11.2.0",
|
|
36
36
|
"glob": "^11.0.0",
|
|
37
37
|
"globals": "^15.7.0",
|
|
38
|
-
"inquirer": "^
|
|
38
|
+
"inquirer": "^12.0.0",
|
|
39
39
|
"less": "^4.2.0",
|
|
40
40
|
"minimist": "^1.2.8",
|
|
41
41
|
"number-precision": "^1.6.0",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<line fill="none" stroke="#000" x1="7" y1="3.38" x2="7" y2="15.38" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="10.18 12.75 7 15.93 3.83 12.76" />
|
|
4
|
+
<line fill="none" stroke="#000" x1="13" y1="16.62" x2="13" y2="4.62" />
|
|
5
|
+
<polyline fill="none" stroke="#000" points="9.82 7.25 13 4.07 16.17 7.24" />
|
|
6
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
</svg>
|
|
2
|
+
<line fill="none" stroke="#000" x1="10" y1="3.48" x2="10" y2="15.48" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="6.16 12 10 15.84 13.84 12" />
|
|
4
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
</svg>
|
|
2
|
+
<line fill="none" stroke="#000" x1="16.53" y1="10" x2="4.53" y2="10" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="8 6.16 4.18 10 8 13.84" />
|
|
4
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
</svg>
|
|
2
|
+
<line fill="none" stroke="#000" x1="3.47" y1="10" x2="15.47" y2="10" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="11.98 13.84 15.82 10 11.98 6.16" />
|
|
4
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
</svg>
|
|
2
|
+
<line fill="none" stroke="#000" x1="4.5" y1="15.53" x2="16.5" y2="3.53" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="16.5 9 16.5 3.5 11 3.5" />
|
|
4
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
</svg>
|
|
2
|
+
<line fill="none" stroke="#000" x1="10" y1="16.53" x2="10" y2="4.53" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="13.84 8 10 4.17 6.16 8" />
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9" />
|
|
3
|
+
<line fill="none" stroke="#000" x1="13.18" y1="6.82" x2="6.82" y2="13.18" />
|
|
4
|
+
<line fill="none" stroke="#000" x1="6.82" y1="6.82" x2="13.18" y2="13.18" />
|
|
5
|
+
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill="none" stroke="#000" stroke-width="1.1" d="M6.5,
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
</svg>
|
|
2
|
+
<path fill="none" stroke="#000" stroke-width="1.1" d="M6.5,13.28h-2.75c-1.79,0-3.25-1.44-3.25-3.22,0-1.63,1.22-2.98,2.8-3.19.08-2.89,2.45-5.2,5.38-5.2,2.51,0,4.63,1.71,5.21,4.02.5-.22,1.04-.34,1.61-.34,2.21,0,4,1.77,4,3.96s-1.79,3.96-4,3.96h-3" />
|
|
3
|
+
<path fill="none" stroke="#000" d="M9.5,18.17v-10" />
|
|
4
|
+
<polyline fill="none" stroke="#000" points="12.67 15.66 9.5 18.83 6.33 15.66" />
|
|
5
|
+
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill="none" stroke="#000" stroke-width="1.1" d="M6.5,
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
</svg>
|
|
2
|
+
<path fill="none" stroke="#000" stroke-width="1.1" d="M6.5,13.77h-2.75c-1.79,0-3.25-1.44-3.25-3.22,0-1.63,1.22-2.98,2.81-3.19.07-2.89,2.44-5.2,5.37-5.2,2.51,0,4.63,1.71,5.21,4.02.5-.22,1.04-.34,1.61-.34,2.21,0,4,1.77,4,3.96s-1.79,3.96-4,3.96h-3" />
|
|
3
|
+
<path fill="none" stroke="#000" d="M9.51,9.34v9" />
|
|
4
|
+
<polyline fill="none" stroke="#000" points="6.34 11.85 9.51 8.68 12.68 11.85" />
|
|
5
|
+
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<line
|
|
5
|
-
</svg>
|
|
2
|
+
<line fill="none" stroke="#000" x1="10" y1="2.09" x2="10" y2="14.09" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="6.16 10.62 10 14.46 13.84 10.62" />
|
|
4
|
+
<line stroke="#000" x1="3.5" y1="17.5" x2="16.5" y2="17.5" />
|
|
5
|
+
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<path fill="none" stroke="#000" stroke-width="1.1" d="
|
|
5
|
-
<
|
|
6
|
-
</svg>
|
|
2
|
+
<path fill="none" stroke="#000" stroke-width="1.1" d="M2.48,17.52l6.52-6.52" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="6.97 17.52 2.48 17.52 2.48 13.03" />
|
|
4
|
+
<path fill="none" stroke="#000" stroke-width="1.1" d="M17.52,2.48l-6.52,6.52" />
|
|
5
|
+
<polyline fill="none" stroke="#000" points="13.03 2.48 17.52 2.48 17.52 6.97" />
|
|
6
|
+
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<polyline fill="none" stroke="#000" points="
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
</svg>
|
|
2
|
+
<polyline fill="none" stroke="#000" points="15 10.5 15 17 3 17 3 5 9.5 5" />
|
|
3
|
+
<line fill="none" stroke="#000" x1="8.22" y1="11.79" x2="17.01" y2="2.99" />
|
|
4
|
+
<polyline fill="none" stroke="#000" points="12.5 3 17 3 17 7.5" />
|
|
5
|
+
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<polyline fill="none" stroke="#000" points="
|
|
5
|
-
</svg>
|
|
2
|
+
<line fill="none" stroke="#000" x1="10" y1="11" x2="10" y2="2" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="6.5 5.5 4 5.5 4 18.5 16 18.5 16 5.5 13.5 5.5" />
|
|
4
|
+
<polyline fill="none" stroke="#000" points="13.18 8.2 10 11.38 6.83 8.21" />
|
|
5
|
+
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<polyline fill="none" stroke="#000" points="6
|
|
2
|
+
<line fill="none" stroke="#000" x1="10" y1="11" x2="10" y2="1" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="6.5 6.5 4 6.5 4 19.5 16 19.5 16 6.5 13.5 6.5" />
|
|
4
|
+
<polyline fill="none" stroke="#000" points="6.82 3.88 10 .71 13.17 3.88" />
|
|
5
5
|
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<path fill="none" stroke="#000" stroke-width="1.1" d="
|
|
5
|
-
<
|
|
6
|
-
</svg>
|
|
2
|
+
<path fill="none" stroke="#000" stroke-width="1.1" d="M2,18l6-6" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="4 11.5 8.49 11.5 8.49 15.99" />
|
|
4
|
+
<path fill="none" stroke="#000" stroke-width="1.1" d="M18,2l-6,6" />
|
|
5
|
+
<polyline fill="none" stroke="#000" points="15.99 8.49 11.5 8.49 11.5 4" />
|
|
6
|
+
</svg>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<polygon points="7 2 17 2 17 17 7 17 7 16 16 16 16 3 7 3" />
|
|
3
|
-
<
|
|
4
|
-
|
|
2
|
+
<polygon points="7 2 17 2 17 17 7 17 7 16 16 16 16 3 7 3 7 2" />
|
|
3
|
+
<line stroke="#000" x1="3" y1="9.5" x2="12" y2="9.5" />
|
|
4
|
+
<polyline fill="none" stroke="#000" points="9.2 6.33 12.37 9.5 9.2 12.67" />
|
|
5
|
+
</svg>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<polygon points="13
|
|
3
|
-
<
|
|
4
|
-
|
|
2
|
+
<polygon points="13 2 3 2 3 17 13 17 13 16 4 16 4 3 13 3 13 2" />
|
|
3
|
+
<line stroke="#000" x1="7.96" y1="9.49" x2="16.96" y2="9.49" />
|
|
4
|
+
<polyline fill="none" stroke="#000" points="14.17 6.31 17.35 9.48 14.17 12.66" />
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<line fill="none" stroke="#000" x1="7" y1="3.38" x2="7" y2="15.38" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="10.18 12.75 7 15.93 3.83 12.76" />
|
|
4
|
+
<line fill="none" stroke="#000" x1="13" y1="16.62" x2="13" y2="4.62" />
|
|
5
|
+
<polyline fill="none" stroke="#000" points="9.82 7.25 13 4.07 16.17 7.24" />
|
|
6
|
+
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<line fill="
|
|
5
|
-
</svg>
|
|
2
|
+
<line fill="none" stroke="#000" x1="10" y1="15.17" x2="10" y2="3.17" />
|
|
3
|
+
<polyline fill="none" stroke="#000" points="13.84 6.63 10 2.8 6.16 6.64" />
|
|
4
|
+
<line fill="#fff" stroke="#000" x1="3.5" y1="17.5" x2="16.5" y2="17.5" />
|
|
5
|
+
</svg>
|
package/src/js/api/instance.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { css } from 'uikit-util';
|
|
2
|
-
import Animations
|
|
2
|
+
import Animations from '../../mixin/internal/slideshow-animations';
|
|
3
|
+
import { scale3d } from './slideshow-animations';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
...Animations,
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { css } from 'uikit-util';
|
|
2
|
-
import Animations, {
|
|
3
|
-
scale3d,
|
|
4
|
-
translate,
|
|
5
|
-
translated,
|
|
6
|
-
} from '../../mixin/internal/slideshow-animations';
|
|
2
|
+
import Animations, { translate, translated } from '../../mixin/internal/slideshow-animations';
|
|
7
3
|
|
|
8
4
|
export default {
|
|
9
5
|
...Animations,
|
|
@@ -98,3 +94,7 @@ export default {
|
|
|
98
94
|
},
|
|
99
95
|
},
|
|
100
96
|
};
|
|
97
|
+
|
|
98
|
+
export function scale3d(value) {
|
|
99
|
+
return `scale3d(${value}, ${value}, 1)`;
|
|
100
|
+
}
|
|
@@ -1,64 +1,123 @@
|
|
|
1
1
|
import {
|
|
2
2
|
$,
|
|
3
|
+
$$,
|
|
4
|
+
Transition,
|
|
3
5
|
addClass,
|
|
4
6
|
append,
|
|
5
7
|
attr,
|
|
6
8
|
fragment,
|
|
7
9
|
getIndex,
|
|
8
10
|
html,
|
|
11
|
+
isTag,
|
|
12
|
+
matches,
|
|
9
13
|
on,
|
|
14
|
+
parent,
|
|
15
|
+
pick,
|
|
10
16
|
pointerDown,
|
|
11
17
|
pointerMove,
|
|
18
|
+
remove,
|
|
12
19
|
removeClass,
|
|
13
|
-
|
|
20
|
+
toggleClass,
|
|
14
21
|
trigger,
|
|
22
|
+
wrapAll,
|
|
15
23
|
} from 'uikit-util';
|
|
24
|
+
import { wrapInPicture } from '../core/img';
|
|
16
25
|
import Modal from '../mixin/modal';
|
|
17
26
|
import Slideshow from '../mixin/slideshow';
|
|
18
27
|
import { keyMap } from '../util/keys';
|
|
19
28
|
import Animations from './internal/lightbox-animations';
|
|
20
29
|
|
|
21
30
|
export default {
|
|
31
|
+
i18n: {
|
|
32
|
+
counter: '%s / %s',
|
|
33
|
+
},
|
|
34
|
+
|
|
22
35
|
mixins: [Modal, Slideshow],
|
|
23
36
|
|
|
24
37
|
functional: true,
|
|
25
38
|
|
|
26
39
|
props: {
|
|
27
|
-
|
|
40
|
+
counter: Boolean,
|
|
28
41
|
preload: Number,
|
|
42
|
+
nav: Boolean,
|
|
43
|
+
slidenav: Boolean,
|
|
44
|
+
delayControls: Number,
|
|
29
45
|
videoAutoplay: Boolean,
|
|
30
46
|
template: String,
|
|
31
47
|
},
|
|
32
48
|
|
|
33
49
|
data: () => ({
|
|
50
|
+
counter: false,
|
|
34
51
|
preload: 1,
|
|
35
|
-
|
|
52
|
+
nav: false,
|
|
53
|
+
slidenav: true,
|
|
36
54
|
delayControls: 3000,
|
|
55
|
+
videoAutoplay: false,
|
|
37
56
|
items: [],
|
|
38
57
|
cls: 'uk-open',
|
|
39
58
|
clsPage: 'uk-lightbox-page',
|
|
40
|
-
|
|
59
|
+
clsFit: 'uk-lightbox-items-fit',
|
|
60
|
+
clsZoom: 'uk-lightbox-zoom',
|
|
41
61
|
attrItem: 'uk-lightbox-item',
|
|
62
|
+
selList: '.uk-lightbox-items',
|
|
42
63
|
selClose: '.uk-close-large',
|
|
64
|
+
selNav: '.uk-lightbox-thumbnav, .uk-lightbox-dotnav',
|
|
43
65
|
selCaption: '.uk-lightbox-caption',
|
|
66
|
+
selCounter: '.uk-lightbox-counter',
|
|
44
67
|
pauseOnHover: false,
|
|
45
68
|
velocity: 2,
|
|
46
69
|
Animations,
|
|
47
70
|
template: `<div class="uk-lightbox uk-overflow-hidden">
|
|
48
71
|
<div class="uk-lightbox-items"></div>
|
|
49
|
-
<div class="uk-
|
|
50
|
-
<button class="uk-lightbox-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
72
|
+
<div class="uk-position-top-right uk-position-small uk-transition-fade" uk-inverse>
|
|
73
|
+
<button class="uk-lightbox-close uk-close-large" type="button" uk-close></button>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="uk-lightbox-slidenav uk-position-center-left uk-position-medium uk-transition-fade" uk-inverse>
|
|
76
|
+
<a href uk-slidenav-previous uk-lightbox-item="previous"></a>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="uk-lightbox-slidenav uk-position-center-right uk-position-medium uk-transition-fade" uk-inverse>
|
|
79
|
+
<a href uk-slidenav-next uk-lightbox-item="next"></a>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="uk-position-center-right uk-position-medium uk-transition-fade" uk-inverse style="max-height: 90vh; overflow: auto;">
|
|
82
|
+
<ul class="uk-lightbox-thumbnav uk-lightbox-thumbnav-vertical uk-thumbnav uk-thumbnav-vertical"></ul>
|
|
83
|
+
<ul class="uk-lightbox-dotnav uk-dotnav uk-dotnav-vertical"></ul>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="uk-lightbox-counter uk-text-large uk-position-top-left uk-position-small uk-transition-fade" uk-inverse></div>
|
|
86
|
+
<div class="uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div>
|
|
55
87
|
</div>`,
|
|
56
88
|
}),
|
|
57
89
|
|
|
58
90
|
created() {
|
|
59
|
-
|
|
91
|
+
let $el = $(this.template);
|
|
92
|
+
|
|
93
|
+
if (isTag($el, 'template')) {
|
|
94
|
+
$el = fragment(html($el));
|
|
95
|
+
}
|
|
96
|
+
|
|
60
97
|
const list = $(this.selList, $el);
|
|
61
|
-
|
|
98
|
+
const navType = this.$props.nav;
|
|
99
|
+
|
|
100
|
+
remove($$(this.selNav, $el).filter((el) => !matches(el, `.uk-${navType}`)));
|
|
101
|
+
|
|
102
|
+
for (const [i, item] of this.items.entries()) {
|
|
103
|
+
append(list, '<div>');
|
|
104
|
+
if (navType === 'thumbnav') {
|
|
105
|
+
wrapAll(
|
|
106
|
+
toThumbnavItem(item, this.videoAutoplay),
|
|
107
|
+
append($(this.selNav, $el), `<li uk-lightbox-item="${i}"><a href></a></li>`),
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (!this.slidenav) {
|
|
113
|
+
remove($$('.uk-lightbox-slidenav', $el));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!this.counter) {
|
|
117
|
+
remove($(this.selCounter, $el));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
addClass(list, this.clsFit);
|
|
62
121
|
|
|
63
122
|
const close = $('[uk-close]', $el);
|
|
64
123
|
const closeLabel = this.t('close');
|
|
@@ -71,10 +130,18 @@ export default {
|
|
|
71
130
|
|
|
72
131
|
events: [
|
|
73
132
|
{
|
|
74
|
-
name:
|
|
133
|
+
name: 'click',
|
|
75
134
|
|
|
76
|
-
|
|
77
|
-
|
|
135
|
+
self: true,
|
|
136
|
+
|
|
137
|
+
filter: ({ bgClose }) => bgClose,
|
|
138
|
+
|
|
139
|
+
delegate: ({ selList }) => `${selList} > *`,
|
|
140
|
+
|
|
141
|
+
handler(e) {
|
|
142
|
+
if (!e.defaultPrevented) {
|
|
143
|
+
this.hide();
|
|
144
|
+
}
|
|
78
145
|
},
|
|
79
146
|
},
|
|
80
147
|
|
|
@@ -83,15 +150,25 @@ export default {
|
|
|
83
150
|
|
|
84
151
|
self: true,
|
|
85
152
|
|
|
86
|
-
delegate: ({
|
|
153
|
+
delegate: ({ clsZoom }) => `.${clsZoom}`,
|
|
87
154
|
|
|
88
155
|
handler(e) {
|
|
89
156
|
if (!e.defaultPrevented) {
|
|
90
|
-
this.
|
|
157
|
+
toggleClass(this.list, this.clsFit);
|
|
91
158
|
}
|
|
92
159
|
},
|
|
93
160
|
},
|
|
94
161
|
|
|
162
|
+
{
|
|
163
|
+
name: `${pointerMove} ${pointerDown} keydown`,
|
|
164
|
+
|
|
165
|
+
filter: ({ delayControls }) => delayControls,
|
|
166
|
+
|
|
167
|
+
handler() {
|
|
168
|
+
this.showControls();
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
|
|
95
172
|
{
|
|
96
173
|
name: 'shown',
|
|
97
174
|
|
|
@@ -157,6 +234,16 @@ export default {
|
|
|
157
234
|
name: 'beforeitemshow',
|
|
158
235
|
|
|
159
236
|
handler(e) {
|
|
237
|
+
html($(this.selCaption, this.$el), this.getItem().caption || '');
|
|
238
|
+
html(
|
|
239
|
+
$(this.selCounter, this.$el),
|
|
240
|
+
this.t('counter', this.index + 1, this.slides.length),
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
for (let j = -this.preload; j <= this.preload; j++) {
|
|
244
|
+
this.loadItem(this.index + j);
|
|
245
|
+
}
|
|
246
|
+
|
|
160
247
|
if (this.isToggled()) {
|
|
161
248
|
return;
|
|
162
249
|
}
|
|
@@ -167,24 +254,12 @@ export default {
|
|
|
167
254
|
|
|
168
255
|
this.toggleElement(this.$el, true, false);
|
|
169
256
|
|
|
170
|
-
this.animation = Animations
|
|
257
|
+
this.animation = Animations.scale;
|
|
171
258
|
removeClass(e.target, this.clsActive);
|
|
172
259
|
this.stack.splice(1, 0, this.index);
|
|
173
260
|
},
|
|
174
261
|
},
|
|
175
262
|
|
|
176
|
-
{
|
|
177
|
-
name: 'itemshow',
|
|
178
|
-
|
|
179
|
-
handler() {
|
|
180
|
-
html($(this.selCaption, this.$el), this.getItem().caption || '');
|
|
181
|
-
|
|
182
|
-
for (let j = -this.preload; j <= this.preload; j++) {
|
|
183
|
-
this.loadItem(this.index + j);
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
|
|
188
263
|
{
|
|
189
264
|
name: 'itemshown',
|
|
190
265
|
|
|
@@ -197,9 +272,9 @@ export default {
|
|
|
197
272
|
name: 'itemload',
|
|
198
273
|
|
|
199
274
|
async handler(_, item) {
|
|
200
|
-
const { source: src, type,
|
|
275
|
+
const { source: src, type, attrs = {} } = item;
|
|
201
276
|
|
|
202
|
-
this.setItem(item, '<span uk-spinner></span>');
|
|
277
|
+
this.setItem(item, '<span uk-spinner uk-inverse></span>');
|
|
203
278
|
|
|
204
279
|
if (!src) {
|
|
205
280
|
return;
|
|
@@ -210,26 +285,32 @@ export default {
|
|
|
210
285
|
allowfullscreen: '',
|
|
211
286
|
style: 'max-width: 100%; box-sizing: border-box;',
|
|
212
287
|
'uk-responsive': '',
|
|
213
|
-
'uk-video': `${this.videoAutoplay}`,
|
|
288
|
+
'uk-video': `${Boolean(this.videoAutoplay)}`,
|
|
214
289
|
};
|
|
215
290
|
|
|
216
291
|
// Image
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
292
|
+
if (type === 'image' || isImage(src)) {
|
|
293
|
+
const img = createEl('img');
|
|
294
|
+
|
|
295
|
+
wrapInPicture(img, item.sources);
|
|
296
|
+
attr(img, {
|
|
297
|
+
src,
|
|
298
|
+
...pick(item, ['alt', 'srcset', 'sizes']),
|
|
299
|
+
...attrs,
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
on(img, 'load', () => this.setItem(item, parent(img) || img));
|
|
223
303
|
on(img, 'error', () => this.setError(item));
|
|
224
304
|
|
|
225
305
|
// Video
|
|
226
|
-
} else if (type === 'video' || src
|
|
306
|
+
} else if (type === 'video' || isVideo(src)) {
|
|
307
|
+
const inline = this.videoAutoplay === 'inline';
|
|
227
308
|
const video = createEl('video', {
|
|
228
309
|
src,
|
|
229
|
-
poster,
|
|
230
|
-
controls: '',
|
|
231
310
|
playsinline: '',
|
|
232
|
-
'
|
|
311
|
+
controls: inline ? null : '',
|
|
312
|
+
poster: this.videoAutoplay ? null : item.poster,
|
|
313
|
+
'uk-video': inline ? 'automute: true' : Boolean(this.videoAutoplay),
|
|
233
314
|
...attrs,
|
|
234
315
|
});
|
|
235
316
|
|
|
@@ -297,8 +378,33 @@ export default {
|
|
|
297
378
|
}
|
|
298
379
|
},
|
|
299
380
|
},
|
|
381
|
+
|
|
382
|
+
{
|
|
383
|
+
name: 'itemloaded',
|
|
384
|
+
handler() {
|
|
385
|
+
this.$emit('resize');
|
|
386
|
+
},
|
|
387
|
+
},
|
|
300
388
|
],
|
|
301
389
|
|
|
390
|
+
update: {
|
|
391
|
+
read() {
|
|
392
|
+
for (const media of $$(`${this.selList} :not([controls]):is(img,video)`, this.$el)) {
|
|
393
|
+
toggleClass(
|
|
394
|
+
media,
|
|
395
|
+
this.clsZoom,
|
|
396
|
+
(media.naturalHeight || media.videoHeight) - this.$el.offsetHeight >
|
|
397
|
+
Math.max(
|
|
398
|
+
0,
|
|
399
|
+
(media.naturalWidth || media.videoWidth) - this.$el.offsetWidth,
|
|
400
|
+
),
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
|
|
405
|
+
events: ['resize'],
|
|
406
|
+
},
|
|
407
|
+
|
|
302
408
|
methods: {
|
|
303
409
|
loadItem(index = this.index) {
|
|
304
410
|
const item = this.getItem(index);
|
|
@@ -321,12 +427,13 @@ export default {
|
|
|
321
427
|
},
|
|
322
428
|
|
|
323
429
|
setError(item) {
|
|
324
|
-
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2"></span>');
|
|
430
|
+
this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2" uk-inverse></span>');
|
|
325
431
|
},
|
|
326
432
|
|
|
327
433
|
showControls() {
|
|
328
434
|
clearTimeout(this.controlsTimer);
|
|
329
|
-
this.controlsTimer =
|
|
435
|
+
this.controlsTimer =
|
|
436
|
+
this.delayControls && setTimeout(this.hideControls, this.delayControls);
|
|
330
437
|
|
|
331
438
|
addClass(this.$el, 'uk-active', 'uk-transition-active');
|
|
332
439
|
},
|
|
@@ -342,3 +449,31 @@ function createEl(tag, attrs) {
|
|
|
342
449
|
attr(el, attrs);
|
|
343
450
|
return el;
|
|
344
451
|
}
|
|
452
|
+
|
|
453
|
+
function toThumbnavItem(item, videoAutoplay) {
|
|
454
|
+
const el =
|
|
455
|
+
item.poster || (item.thumb && (item.type === 'image' || isImage(item.thumb)))
|
|
456
|
+
? createEl('img', { src: item.poster || item.thumb, alt: '' })
|
|
457
|
+
: item.thumb && (item.type === 'video' || isVideo(item.thumb))
|
|
458
|
+
? createEl('video', {
|
|
459
|
+
src: item.thumb,
|
|
460
|
+
loop: '',
|
|
461
|
+
playsinline: '',
|
|
462
|
+
'uk-video': `autoplay: ${Boolean(videoAutoplay)}; automute: true`,
|
|
463
|
+
})
|
|
464
|
+
: createEl('canvas');
|
|
465
|
+
|
|
466
|
+
if (item.thumbRatio) {
|
|
467
|
+
el.style.aspectRatio = item.thumbRatio;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
return el;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function isImage(src) {
|
|
474
|
+
return src?.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function isVideo(src) {
|
|
478
|
+
return src?.match(/\.(mp4|webm|ogv)($|\?)/i);
|
|
479
|
+
}
|