前端
@ -5,7 +5,7 @@ VUE_APP_TITLE = 若依管理系统
|
||||
ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
VUE_APP_BASE_API = 'http://localhost:8080/'
|
||||
VUE_APP_BASE_API = 'https://f382b38516.zicp.fun'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
@ -3,6 +3,7 @@ module.exports = {
|
||||
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
],
|
||||
|
||||
'env': {
|
||||
'development': {
|
||||
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
|
||||
|
@ -42,6 +42,7 @@
|
||||
"ckeditor5-custom-build": "^0.0.6",
|
||||
"clipboard": "2.0.8",
|
||||
"core-js": "3.37.1",
|
||||
"css-loader": "^7.1.2",
|
||||
"echarts": "5.4.0",
|
||||
"element-ui": "2.15.14",
|
||||
"file-saver": "2.0.5",
|
||||
@ -50,11 +51,15 @@
|
||||
"js-beautify": "1.13.0",
|
||||
"js-cookie": "3.0.1",
|
||||
"jsencrypt": "3.0.0-rc.1",
|
||||
"less": "^4.2.0",
|
||||
"less-loader": "^12.2.0",
|
||||
"nprogress": "0.2.0",
|
||||
"quill": "1.3.7",
|
||||
"screenfull": "5.0.2",
|
||||
"sortablejs": "1.10.2",
|
||||
"swiper": "^11.1.5",
|
||||
"vue": "2.6.12",
|
||||
"vue-awesome-swiper": "^4.1.1",
|
||||
"vue-count-to": "1.0.13",
|
||||
"vue-cropper": "0.5.5",
|
||||
"vue-meta": "2.4.0",
|
||||
|
10
ruoyi-ui/src/api/gw/home.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询菜单列表
|
||||
export function getTab(query) {
|
||||
return request({
|
||||
url: '/api/category/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
BIN
ruoyi-ui/src/assets/gw/Snipaste_2024-07-19_16-46-43.jpg
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
ruoyi-ui/src/assets/gw/address.png
Normal file
After Width: | Height: | Size: 953 B |
BIN
ruoyi-ui/src/assets/gw/anniu.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
ruoyi-ui/src/assets/gw/banner.png
Normal file
After Width: | Height: | Size: 2.5 MiB |
BIN
ruoyi-ui/src/assets/gw/email.png
Normal file
After Width: | Height: | Size: 825 B |
BIN
ruoyi-ui/src/assets/gw/left-top.png
Normal file
After Width: | Height: | Size: 1009 B |
BIN
ruoyi-ui/src/assets/gw/logo.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
ruoyi-ui/src/assets/gw/right-top.png
Normal file
After Width: | Height: | Size: 1013 B |
BIN
ruoyi-ui/src/assets/gw/sb.png
Normal file
After Width: | Height: | Size: 445 B |
BIN
ruoyi-ui/src/assets/gw/tel.png
Normal file
After Width: | Height: | Size: 901 B |
BIN
ruoyi-ui/src/assets/gw/top.png
Normal file
After Width: | Height: | Size: 901 B |
BIN
ruoyi-ui/src/assets/gw/tp.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
ruoyi-ui/src/assets/gw/tw.png
Normal file
After Width: | Height: | Size: 246 KiB |
BIN
ruoyi-ui/src/assets/gw/wx20240719161013.png
Normal file
After Width: | Height: | Size: 246 KiB |
20
ruoyi-ui/src/components/swiper/LICENSE
Normal file
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 Vladimir Kharlampidi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
11
ruoyi-ui/src/components/swiper/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
Swiper
|
||||
==========
|
||||
|
||||
Swiper - is the free and most modern mobile touch slider with hardware accelerated transitions and amazing native behavior. It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps.
|
||||
|
||||
Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps/platforms to bring the best experience and simplicity.
|
||||
|
||||
# Getting Started
|
||||
* [Getting Started Guide](https://swiperjs.com/get-started/)
|
||||
* [API](https://swiperjs.com/api/)
|
||||
* [Demos](https://swiperjs.com/demos/)
|
9
ruoyi-ui/src/components/swiper/components/a11y/a11y.less
Normal file
@ -0,0 +1,9 @@
|
||||
/* a11y */
|
||||
.swiper-container .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
9
ruoyi-ui/src/components/swiper/components/a11y/a11y.scss
Normal file
@ -0,0 +1,9 @@
|
||||
/* a11y */
|
||||
.swiper-container .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
111
ruoyi-ui/src/components/swiper/components/core/core.less
Normal file
@ -0,0 +1,111 @@
|
||||
:root {
|
||||
--swiper-theme-color: @themeColor;
|
||||
}
|
||||
.swiper-container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
/* Fix of Webkit flickering */
|
||||
z-index:1;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-wrapper {
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-wrapper {
|
||||
position:relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
transition-property:transform;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.swiper-container-android .swiper-slide, .swiper-wrapper {
|
||||
transform:translate3d(0px,0,0);
|
||||
}
|
||||
.swiper-container-multirow > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.swiper-container-multirow-column > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-container-free-mode > .swiper-wrapper {
|
||||
transition-timing-function: ease-out;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.swiper-slide {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
transition-property: transform;
|
||||
}
|
||||
.swiper-slide-invisible-blank {
|
||||
visibility: hidden;
|
||||
}
|
||||
/* Auto Height */
|
||||
.swiper-container-autoheight, .swiper-container-autoheight .swiper-slide {
|
||||
height: auto;
|
||||
}
|
||||
.swiper-container-autoheight .swiper-wrapper {
|
||||
align-items: flex-start;
|
||||
transition-property: transform, height;
|
||||
}
|
||||
|
||||
/* 3D Effects */
|
||||
.swiper-container-3d {
|
||||
perspective: 1200px;
|
||||
.swiper-wrapper, .swiper-slide, .swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-cube-shadow {
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
.swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
.swiper-slide-shadow-left {
|
||||
background-image: linear-gradient(to left, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-right {
|
||||
background-image: linear-gradient(to right, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-top {
|
||||
background-image: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-bottom {
|
||||
background-image: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
}
|
||||
|
||||
/* CSS Mode */
|
||||
.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
overflow: auto;
|
||||
scrollbar-width: none; /* For Firefox */
|
||||
-ms-overflow-style: none; /* For Internet Explorer and Edge */
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
> .swiper-wrapper > .swiper-slide {
|
||||
scroll-snap-align: start start;
|
||||
}
|
||||
}
|
||||
.swiper-container-horizontal.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
scroll-snap-type: x mandatory;
|
||||
}
|
||||
}
|
||||
.swiper-container-vertical.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
scroll-snap-type: y mandatory;
|
||||
}
|
||||
}
|
115
ruoyi-ui/src/components/swiper/components/core/core.scss
Normal file
@ -0,0 +1,115 @@
|
||||
:root {
|
||||
--swiper-theme-color: #{$themeColor};
|
||||
}
|
||||
.swiper-container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
/* Fix of Webkit flickering */
|
||||
z-index:1;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-wrapper {
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-wrapper {
|
||||
position:relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
transition-property:transform;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.swiper-container-android .swiper-slide,
|
||||
.swiper-wrapper {
|
||||
transform:translate3d(0px,0,0);
|
||||
}
|
||||
.swiper-container-multirow > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.swiper-container-multirow-column > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-container-free-mode > .swiper-wrapper {
|
||||
transition-timing-function: ease-out;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.swiper-slide {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
transition-property: transform;
|
||||
}
|
||||
.swiper-slide-invisible-blank {
|
||||
visibility: hidden;
|
||||
}
|
||||
/* Auto Height */
|
||||
.swiper-container-autoheight {
|
||||
&, .swiper-slide {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.swiper-wrapper {
|
||||
align-items: flex-start;
|
||||
transition-property: transform, height;
|
||||
}
|
||||
}
|
||||
|
||||
/* 3D Effects */
|
||||
.swiper-container-3d {
|
||||
perspective: 1200px;
|
||||
.swiper-wrapper, .swiper-slide, .swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-cube-shadow {
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
.swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
.swiper-slide-shadow-left {
|
||||
background-image: linear-gradient(to left, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-right {
|
||||
background-image: linear-gradient(to right, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-top {
|
||||
background-image: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-bottom {
|
||||
background-image: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
}
|
||||
|
||||
/* CSS Mode */
|
||||
.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
overflow: auto;
|
||||
scrollbar-width: none; /* For Firefox */
|
||||
-ms-overflow-style: none; /* For Internet Explorer and Edge */
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
> .swiper-wrapper > .swiper-slide {
|
||||
scroll-snap-align: start start;
|
||||
}
|
||||
}
|
||||
.swiper-container-horizontal.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
scroll-snap-type: x mandatory;
|
||||
}
|
||||
}
|
||||
.swiper-container-vertical.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
scroll-snap-type: y mandatory;
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
.swiper-container-coverflow {}
|
@ -0,0 +1 @@
|
||||
.swiper-container-coverflow {}
|
@ -0,0 +1,43 @@
|
||||
.swiper-container-cube {
|
||||
overflow: visible;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
backface-visibility: hidden;
|
||||
z-index: 1;
|
||||
visibility: hidden;
|
||||
transform-origin: 0 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
&.swiper-container-rtl .swiper-slide {
|
||||
transform-origin: 100% 0;
|
||||
}
|
||||
.swiper-slide-active {
|
||||
&, & .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
.swiper-slide-active, .swiper-slide-next, .swiper-slide-prev, .swiper-slide-next + .swiper-slide {
|
||||
pointer-events: auto;
|
||||
visibility: visible;
|
||||
}
|
||||
.swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left, .swiper-slide-shadow-right {
|
||||
z-index: 0;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
.swiper-cube-shadow {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #000;
|
||||
opacity: 0.6;
|
||||
-webkit-filter: blur(50px);
|
||||
filter: blur(50px);
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
.swiper-container-cube {
|
||||
overflow: visible;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
backface-visibility: hidden;
|
||||
z-index: 1;
|
||||
visibility: hidden;
|
||||
transform-origin: 0 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
&.swiper-container-rtl .swiper-slide {
|
||||
transform-origin: 100% 0;
|
||||
}
|
||||
.swiper-slide-active {
|
||||
&, & .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
.swiper-slide-active, .swiper-slide-next, .swiper-slide-prev, .swiper-slide-next + .swiper-slide {
|
||||
pointer-events: auto;
|
||||
visibility: visible;
|
||||
}
|
||||
.swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left, .swiper-slide-shadow-right {
|
||||
z-index: 0;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
.swiper-cube-shadow {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #000;
|
||||
opacity: 0.6;
|
||||
-webkit-filter: blur(50px);
|
||||
filter: blur(50px);
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
.swiper-container-fade {
|
||||
&.swiper-container-free-mode {
|
||||
.swiper-slide {
|
||||
transition-timing-function: ease-out;
|
||||
}
|
||||
}
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
transition-property: opacity;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
.swiper-slide-active {
|
||||
&, & .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
.swiper-container-fade {
|
||||
&.swiper-container-free-mode {
|
||||
.swiper-slide {
|
||||
transition-timing-function: ease-out;
|
||||
}
|
||||
}
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
transition-property: opacity;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
.swiper-slide-active {
|
||||
&, & .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
.swiper-container-flip {
|
||||
overflow: visible;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
backface-visibility: hidden;
|
||||
z-index: 1;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
.swiper-slide-active {
|
||||
&, & .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
.swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left, .swiper-slide-shadow-right {
|
||||
z-index: 0;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
.swiper-container-flip {
|
||||
overflow: visible;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
backface-visibility: hidden;
|
||||
z-index: 1;
|
||||
.swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
.swiper-slide-active {
|
||||
&, & .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
.swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left, .swiper-slide-shadow-right {
|
||||
z-index: 0;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
}
|
34
ruoyi-ui/src/components/swiper/components/lazy/lazy.less
Normal file
@ -0,0 +1,34 @@
|
||||
/* Preloader */
|
||||
:root {
|
||||
/*
|
||||
--swiper-preloader-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-lazy-preloader {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -21px;
|
||||
margin-top: -21px;
|
||||
z-index: 10;
|
||||
transform-origin: 50%;
|
||||
animation: swiper-preloader-spin 1s infinite linear;
|
||||
box-sizing: border-box;
|
||||
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
|
||||
border-radius: 50%;
|
||||
border-top-color: transparent;
|
||||
}
|
||||
|
||||
.swiper-lazy-preloader-white {
|
||||
--swiper-preloader-color: #fff;
|
||||
}
|
||||
.swiper-lazy-preloader-black {
|
||||
--swiper-preloader-color: #000;
|
||||
}
|
||||
@keyframes swiper-preloader-spin {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
34
ruoyi-ui/src/components/swiper/components/lazy/lazy.scss
Normal file
@ -0,0 +1,34 @@
|
||||
/* Preloader */
|
||||
:root {
|
||||
/*
|
||||
--swiper-preloader-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-lazy-preloader {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -21px;
|
||||
margin-top: -21px;
|
||||
z-index: 10;
|
||||
transform-origin: 50%;
|
||||
animation: swiper-preloader-spin 1s infinite linear;
|
||||
box-sizing: border-box;
|
||||
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
|
||||
border-radius: 50%;
|
||||
border-top-color: transparent;
|
||||
}
|
||||
|
||||
.swiper-lazy-preloader-white {
|
||||
--swiper-preloader-color: #fff;
|
||||
}
|
||||
.swiper-lazy-preloader-black {
|
||||
--swiper-preloader-color: #000;
|
||||
}
|
||||
@keyframes swiper-preloader-spin {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
:root {
|
||||
--swiper-navigation-size: 44px;
|
||||
/*
|
||||
--swiper-navigation-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-button-prev, .swiper-button-next {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: calc(var(--swiper-navigation-size) / 44 * 27);
|
||||
height: var(--swiper-navigation-size);
|
||||
margin-top: calc(-1 * var(--swiper-navigation-size) / 2);
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--swiper-navigation-color, var(--swiper-theme-color));
|
||||
&.swiper-button-disabled {
|
||||
opacity: 0.35;
|
||||
cursor: auto;
|
||||
pointer-events: none;
|
||||
}
|
||||
&:after {
|
||||
font-family: swiper-icons;
|
||||
font-size: var(--swiper-navigation-size);
|
||||
text-transform: none !important;
|
||||
letter-spacing: 0;
|
||||
text-transform: none;
|
||||
font-variant: initial;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
.swiper-button-prev,
|
||||
.swiper-container-rtl .swiper-button-next {
|
||||
&:after {
|
||||
content: 'prev';
|
||||
}
|
||||
left: 10px;
|
||||
right: auto;
|
||||
}
|
||||
.swiper-button-next,
|
||||
.swiper-container-rtl .swiper-button-prev {
|
||||
&:after {
|
||||
content: 'next';
|
||||
}
|
||||
right: 10px;
|
||||
left: auto;
|
||||
}
|
||||
.navigation-color-loop({
|
||||
.swiper-button-prev,
|
||||
.swiper-button-next {
|
||||
&.swiper-button-@{navColorName} {
|
||||
--swiper-navigation-color: @navColorValue;
|
||||
}
|
||||
}
|
||||
});
|
||||
.swiper-button-lock {
|
||||
display: none;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
:root {
|
||||
--swiper-navigation-size: 44px;
|
||||
/*
|
||||
--swiper-navigation-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-button-prev, .swiper-button-next {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: calc(var(--swiper-navigation-size) / 44 * 27);
|
||||
height: var(--swiper-navigation-size);
|
||||
margin-top: calc(-1 * var(--swiper-navigation-size) / 2);
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--swiper-navigation-color, var(--swiper-theme-color));
|
||||
&.swiper-button-disabled {
|
||||
opacity: 0.35;
|
||||
cursor: auto;
|
||||
pointer-events: none;
|
||||
}
|
||||
&:after {
|
||||
font-family: swiper-icons;
|
||||
font-size: var(--swiper-navigation-size);
|
||||
text-transform: none !important;
|
||||
letter-spacing: 0;
|
||||
text-transform: none;
|
||||
font-variant: initial;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
.swiper-button-prev,
|
||||
.swiper-container-rtl .swiper-button-next {
|
||||
&:after {
|
||||
content: 'prev';
|
||||
}
|
||||
left: 10px;
|
||||
right: auto;
|
||||
}
|
||||
.swiper-button-next,
|
||||
.swiper-container-rtl .swiper-button-prev {
|
||||
&:after {
|
||||
content: 'next';
|
||||
}
|
||||
right: 10px;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
@each $navColorName, $navColorValue in $colors {
|
||||
.swiper-button-prev,
|
||||
.swiper-button-next {
|
||||
&.swiper-button-#{$navColorName} {
|
||||
--swiper-navigation-color: #{$navColorValue};
|
||||
}
|
||||
}
|
||||
}
|
||||
.swiper-button-lock {
|
||||
display: none;
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
:root {
|
||||
/*
|
||||
--swiper-pagination-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-pagination {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
transition: 300ms opacity;
|
||||
transform: translate3d(0,0,0);
|
||||
z-index: 10;
|
||||
&.swiper-pagination-hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
/* Common Styles */
|
||||
.swiper-pagination-fraction, .swiper-pagination-custom, .swiper-container-horizontal > .swiper-pagination-bullets{
|
||||
bottom: 10px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
/* Bullets */
|
||||
.swiper-pagination-bullets-dynamic {
|
||||
overflow: hidden;
|
||||
font-size: 0;
|
||||
.swiper-pagination-bullet {
|
||||
transform: scale(0.33);
|
||||
position: relative;
|
||||
}
|
||||
.swiper-pagination-bullet-active {
|
||||
transform: scale(1);
|
||||
}
|
||||
.swiper-pagination-bullet-active-main {
|
||||
transform: scale(1);
|
||||
}
|
||||
.swiper-pagination-bullet-active-prev {
|
||||
transform: scale(0.66);
|
||||
}
|
||||
.swiper-pagination-bullet-active-prev-prev {
|
||||
transform: scale(0.33);
|
||||
}
|
||||
.swiper-pagination-bullet-active-next {
|
||||
transform: scale(0.66);
|
||||
}
|
||||
.swiper-pagination-bullet-active-next-next {
|
||||
transform: scale(0.33);
|
||||
}
|
||||
}
|
||||
.swiper-pagination-bullet {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
display: inline-block;
|
||||
border-radius: 100%;
|
||||
background: #000;
|
||||
opacity: 0.2;
|
||||
button& {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
appearance: none;
|
||||
}
|
||||
.swiper-pagination-clickable & {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.swiper-pagination-bullet-active {
|
||||
opacity: 1;
|
||||
background: var(--swiper-pagination-color, var(--swiper-theme-color));
|
||||
}
|
||||
|
||||
.swiper-container-vertical {
|
||||
> .swiper-pagination-bullets {
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform:translate3d(0px,-50%,0);
|
||||
.swiper-pagination-bullet {
|
||||
margin: 6px 0;
|
||||
display: block;
|
||||
}
|
||||
&.swiper-pagination-bullets-dynamic {
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 8px;
|
||||
.swiper-pagination-bullet {
|
||||
display: inline-block;
|
||||
transition: 200ms transform, 200ms top;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.swiper-container-horizontal {
|
||||
> .swiper-pagination-bullets {
|
||||
.swiper-pagination-bullet {
|
||||
margin: 0 4px;
|
||||
}
|
||||
&.swiper-pagination-bullets-dynamic {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
white-space: nowrap;
|
||||
.swiper-pagination-bullet {
|
||||
transition: 200ms transform, 200ms left;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.swiper-container-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
|
||||
transition: 200ms transform, 200ms right;
|
||||
}
|
||||
}
|
||||
/* Progress */
|
||||
.swiper-pagination-progressbar {
|
||||
background: rgba(0,0,0,0.25);
|
||||
position: absolute;
|
||||
.swiper-pagination-progressbar-fill {
|
||||
background: var(--swiper-pagination-color, var(--swiper-theme-color));
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform: scale(0);
|
||||
transform-origin: left top;
|
||||
}
|
||||
.swiper-container-rtl & .swiper-pagination-progressbar-fill {
|
||||
transform-origin: right top;
|
||||
}
|
||||
.swiper-container-horizontal > &,
|
||||
.swiper-container-vertical > &.swiper-pagination-progressbar-opposite {
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.swiper-container-vertical > &,
|
||||
.swiper-container-horizontal > &.swiper-pagination-progressbar-opposite {
|
||||
width: 4px;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
.pagination-color-loop({
|
||||
.swiper-pagination-@{paginationColorName} {
|
||||
--swiper-pagination-color: @paginationColorValue;
|
||||
}
|
||||
});
|
||||
.swiper-pagination-lock {
|
||||
display: none;
|
||||
}
|
@ -0,0 +1,149 @@
|
||||
:root {
|
||||
/*
|
||||
--swiper-pagination-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-pagination {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
transition: 300ms opacity;
|
||||
transform: translate3d(0,0,0);
|
||||
z-index: 10;
|
||||
&.swiper-pagination-hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
/* Common Styles */
|
||||
.swiper-pagination-fraction, .swiper-pagination-custom, .swiper-container-horizontal > .swiper-pagination-bullets{
|
||||
bottom: 10px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
/* Bullets */
|
||||
.swiper-pagination-bullets-dynamic {
|
||||
overflow: hidden;
|
||||
font-size: 0;
|
||||
.swiper-pagination-bullet {
|
||||
transform: scale(0.33);
|
||||
position: relative;
|
||||
}
|
||||
.swiper-pagination-bullet-active {
|
||||
transform: scale(1);
|
||||
}
|
||||
.swiper-pagination-bullet-active-main {
|
||||
transform: scale(1);
|
||||
}
|
||||
.swiper-pagination-bullet-active-prev {
|
||||
transform: scale(0.66);
|
||||
}
|
||||
.swiper-pagination-bullet-active-prev-prev {
|
||||
transform: scale(0.33);
|
||||
}
|
||||
.swiper-pagination-bullet-active-next {
|
||||
transform: scale(0.66);
|
||||
}
|
||||
.swiper-pagination-bullet-active-next-next {
|
||||
transform: scale(0.33);
|
||||
}
|
||||
}
|
||||
.swiper-pagination-bullet {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
display: inline-block;
|
||||
border-radius: 100%;
|
||||
background: #000;
|
||||
opacity: 0.2;
|
||||
@at-root button#{&} {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
appearance: none;
|
||||
}
|
||||
.swiper-pagination-clickable & {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.swiper-pagination-bullet-active {
|
||||
opacity: 1;
|
||||
background: var(--swiper-pagination-color, var(--swiper-theme-color));
|
||||
}
|
||||
|
||||
.swiper-container-vertical {
|
||||
> .swiper-pagination-bullets {
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform:translate3d(0px,-50%,0);
|
||||
.swiper-pagination-bullet {
|
||||
margin: 6px 0;
|
||||
display: block;
|
||||
}
|
||||
&.swiper-pagination-bullets-dynamic {
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 8px;
|
||||
.swiper-pagination-bullet {
|
||||
display: inline-block;
|
||||
transition: 200ms transform, 200ms top;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.swiper-container-horizontal {
|
||||
> .swiper-pagination-bullets {
|
||||
.swiper-pagination-bullet {
|
||||
margin: 0 4px;
|
||||
}
|
||||
&.swiper-pagination-bullets-dynamic {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
white-space: nowrap;
|
||||
.swiper-pagination-bullet {
|
||||
transition: 200ms transform, 200ms left;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.swiper-container-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
|
||||
transition: 200ms transform, 200ms right;
|
||||
}
|
||||
}
|
||||
/* Progress */
|
||||
.swiper-pagination-progressbar {
|
||||
background: rgba(0,0,0,0.25);
|
||||
position: absolute;
|
||||
.swiper-pagination-progressbar-fill {
|
||||
background: var(--swiper-pagination-color, var(--swiper-theme-color));
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform: scale(0);
|
||||
transform-origin: left top;
|
||||
}
|
||||
.swiper-container-rtl & .swiper-pagination-progressbar-fill {
|
||||
transform-origin: right top;
|
||||
}
|
||||
.swiper-container-horizontal > &,
|
||||
.swiper-container-vertical > &.swiper-pagination-progressbar-opposite {
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.swiper-container-vertical > &,
|
||||
.swiper-container-horizontal > &.swiper-pagination-progressbar-opposite {
|
||||
width: 4px;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
@each $paginationColorName, $paginationColorValue in $colors {
|
||||
.swiper-pagination-#{$paginationColorName} {
|
||||
--swiper-pagination-color: #{$paginationColorValue};
|
||||
}
|
||||
}
|
||||
.swiper-pagination-lock {
|
||||
display: none;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/* Scrollbar */
|
||||
.swiper-scrollbar {
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
-ms-touch-action: none;
|
||||
background: rgba(0,0,0,0.1);
|
||||
.swiper-container-horizontal > & {
|
||||
position: absolute;
|
||||
left: 1%;
|
||||
bottom: 3px;
|
||||
z-index: 50;
|
||||
height: 5px;
|
||||
width: 98%;
|
||||
}
|
||||
.swiper-container-vertical > & {
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 1%;
|
||||
z-index: 50;
|
||||
width: 5px;
|
||||
height: 98%;
|
||||
}
|
||||
}
|
||||
.swiper-scrollbar-drag {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
background: rgba(0,0,0,0.5);
|
||||
border-radius: 10px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.swiper-scrollbar-cursor-drag {
|
||||
cursor: move;
|
||||
}
|
||||
.swiper-scrollbar-lock {
|
||||
display: none;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/* Scrollbar */
|
||||
.swiper-scrollbar {
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
-ms-touch-action: none;
|
||||
background: rgba(0,0,0,0.1);
|
||||
.swiper-container-horizontal > & {
|
||||
position: absolute;
|
||||
left: 1%;
|
||||
bottom: 3px;
|
||||
z-index: 50;
|
||||
height: 5px;
|
||||
width: 98%;
|
||||
}
|
||||
.swiper-container-vertical > & {
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 1%;
|
||||
z-index: 50;
|
||||
width: 5px;
|
||||
height: 98%;
|
||||
}
|
||||
}
|
||||
.swiper-scrollbar-drag {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
background: rgba(0,0,0,0.5);
|
||||
border-radius: 10px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.swiper-scrollbar-cursor-drag {
|
||||
cursor: move;
|
||||
}
|
||||
.swiper-scrollbar-lock {
|
||||
display: none;
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
.swiper-container-thumbs {
|
||||
.swiper-slide-thumb-active {
|
||||
// Styles for active thumb slide
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
.swiper-container-thumbs {
|
||||
.swiper-slide-thumb-active {
|
||||
// Styles for active thumb slide
|
||||
}
|
||||
}
|
18
ruoyi-ui/src/components/swiper/components/zoom/zoom.less
Normal file
@ -0,0 +1,18 @@
|
||||
.swiper-zoom-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
|
||||
> img, > svg, > canvas {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-slide-zoomed {
|
||||
cursor: move;
|
||||
}
|
18
ruoyi-ui/src/components/swiper/components/zoom/zoom.scss
Normal file
@ -0,0 +1,18 @@
|
||||
.swiper-zoom-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
|
||||
> img, > svg, > canvas {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-slide-zoomed {
|
||||
cursor: move;
|
||||
}
|
532
ruoyi-ui/src/components/swiper/css/swiper.css
Normal file
@ -0,0 +1,532 @@
|
||||
/**
|
||||
* Swiper 5.4.5
|
||||
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
||||
* http://swiperjs.com
|
||||
*
|
||||
* Copyright 2014-2020 Vladimir Kharlampidi
|
||||
*
|
||||
* Released under the MIT License
|
||||
*
|
||||
* Released on: June 16, 2020
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: 'swiper-icons';
|
||||
src: url("data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA") format("woff");
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
:root {
|
||||
--swiper-theme-color: #007aff;
|
||||
}
|
||||
.swiper-container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
/* Fix of Webkit flickering */
|
||||
z-index: 1;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-wrapper {
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-wrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
transition-property: transform;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.swiper-container-android .swiper-slide,
|
||||
.swiper-wrapper {
|
||||
transform: translate3d(0px, 0, 0);
|
||||
}
|
||||
.swiper-container-multirow > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.swiper-container-multirow-column > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-container-free-mode > .swiper-wrapper {
|
||||
transition-timing-function: ease-out;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.swiper-slide {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
transition-property: transform;
|
||||
}
|
||||
.swiper-slide-invisible-blank {
|
||||
visibility: hidden;
|
||||
}
|
||||
/* Auto Height */
|
||||
.swiper-container-autoheight,
|
||||
.swiper-container-autoheight .swiper-slide {
|
||||
height: auto;
|
||||
}
|
||||
.swiper-container-autoheight .swiper-wrapper {
|
||||
align-items: flex-start;
|
||||
transition-property: transform, height;
|
||||
}
|
||||
/* 3D Effects */
|
||||
.swiper-container-3d {
|
||||
perspective: 1200px;
|
||||
}
|
||||
.swiper-container-3d .swiper-wrapper,
|
||||
.swiper-container-3d .swiper-slide,
|
||||
.swiper-container-3d .swiper-slide-shadow-left,
|
||||
.swiper-container-3d .swiper-slide-shadow-right,
|
||||
.swiper-container-3d .swiper-slide-shadow-top,
|
||||
.swiper-container-3d .swiper-slide-shadow-bottom,
|
||||
.swiper-container-3d .swiper-cube-shadow {
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
.swiper-container-3d .swiper-slide-shadow-left,
|
||||
.swiper-container-3d .swiper-slide-shadow-right,
|
||||
.swiper-container-3d .swiper-slide-shadow-top,
|
||||
.swiper-container-3d .swiper-slide-shadow-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
.swiper-container-3d .swiper-slide-shadow-left {
|
||||
background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
|
||||
}
|
||||
.swiper-container-3d .swiper-slide-shadow-right {
|
||||
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
|
||||
}
|
||||
.swiper-container-3d .swiper-slide-shadow-top {
|
||||
background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
|
||||
}
|
||||
.swiper-container-3d .swiper-slide-shadow-bottom {
|
||||
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
|
||||
}
|
||||
/* CSS Mode */
|
||||
.swiper-container-css-mode > .swiper-wrapper {
|
||||
overflow: auto;
|
||||
scrollbar-width: none;
|
||||
/* For Firefox */
|
||||
-ms-overflow-style: none;
|
||||
/* For Internet Explorer and Edge */
|
||||
}
|
||||
.swiper-container-css-mode > .swiper-wrapper::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.swiper-container-css-mode > .swiper-wrapper > .swiper-slide {
|
||||
scroll-snap-align: start start;
|
||||
}
|
||||
.swiper-container-horizontal.swiper-container-css-mode > .swiper-wrapper {
|
||||
scroll-snap-type: x mandatory;
|
||||
}
|
||||
.swiper-container-vertical.swiper-container-css-mode > .swiper-wrapper {
|
||||
scroll-snap-type: y mandatory;
|
||||
}
|
||||
:root {
|
||||
--swiper-navigation-size: 44px;
|
||||
/*
|
||||
--swiper-navigation-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-button-prev,
|
||||
.swiper-button-next {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: calc(var(--swiper-navigation-size) / 44 * 27);
|
||||
height: var(--swiper-navigation-size);
|
||||
margin-top: calc(-1 * var(--swiper-navigation-size) / 2);
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--swiper-navigation-color, var(--swiper-theme-color));
|
||||
}
|
||||
.swiper-button-prev.swiper-button-disabled,
|
||||
.swiper-button-next.swiper-button-disabled {
|
||||
opacity: 0.35;
|
||||
cursor: auto;
|
||||
pointer-events: none;
|
||||
}
|
||||
.swiper-button-prev:after,
|
||||
.swiper-button-next:after {
|
||||
font-family: swiper-icons;
|
||||
font-size: var(--swiper-navigation-size);
|
||||
text-transform: none !important;
|
||||
letter-spacing: 0;
|
||||
text-transform: none;
|
||||
font-variant: initial;
|
||||
line-height: 1;
|
||||
}
|
||||
.swiper-button-prev,
|
||||
.swiper-container-rtl .swiper-button-next {
|
||||
left: 10px;
|
||||
right: auto;
|
||||
}
|
||||
.swiper-button-prev:after,
|
||||
.swiper-container-rtl .swiper-button-next:after {
|
||||
content: 'prev';
|
||||
}
|
||||
.swiper-button-next,
|
||||
.swiper-container-rtl .swiper-button-prev {
|
||||
right: 10px;
|
||||
left: auto;
|
||||
}
|
||||
.swiper-button-next:after,
|
||||
.swiper-container-rtl .swiper-button-prev:after {
|
||||
content: 'next';
|
||||
}
|
||||
.swiper-button-prev.swiper-button-white,
|
||||
.swiper-button-next.swiper-button-white {
|
||||
--swiper-navigation-color: #ffffff;
|
||||
}
|
||||
.swiper-button-prev.swiper-button-black,
|
||||
.swiper-button-next.swiper-button-black {
|
||||
--swiper-navigation-color: #000000;
|
||||
}
|
||||
.swiper-button-lock {
|
||||
display: none;
|
||||
}
|
||||
:root {
|
||||
/*
|
||||
--swiper-pagination-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-pagination {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
transition: 300ms opacity;
|
||||
transform: translate3d(0, 0, 0);
|
||||
z-index: 10;
|
||||
}
|
||||
.swiper-pagination.swiper-pagination-hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
/* Common Styles */
|
||||
.swiper-pagination-fraction,
|
||||
.swiper-pagination-custom,
|
||||
.swiper-container-horizontal > .swiper-pagination-bullets {
|
||||
bottom: 10px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
/* Bullets */
|
||||
.swiper-pagination-bullets-dynamic {
|
||||
overflow: hidden;
|
||||
font-size: 0;
|
||||
}
|
||||
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
|
||||
transform: scale(0.33);
|
||||
position: relative;
|
||||
}
|
||||
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active {
|
||||
transform: scale(1);
|
||||
}
|
||||
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main {
|
||||
transform: scale(1);
|
||||
}
|
||||
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev {
|
||||
transform: scale(0.66);
|
||||
}
|
||||
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev {
|
||||
transform: scale(0.33);
|
||||
}
|
||||
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next {
|
||||
transform: scale(0.66);
|
||||
}
|
||||
.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next {
|
||||
transform: scale(0.33);
|
||||
}
|
||||
.swiper-pagination-bullet {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
display: inline-block;
|
||||
border-radius: 100%;
|
||||
background: #000;
|
||||
opacity: 0.2;
|
||||
}
|
||||
button.swiper-pagination-bullet {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
.swiper-pagination-clickable .swiper-pagination-bullet {
|
||||
cursor: pointer;
|
||||
}
|
||||
.swiper-pagination-bullet-active {
|
||||
opacity: 1;
|
||||
background: var(--swiper-pagination-color, var(--swiper-theme-color));
|
||||
}
|
||||
.swiper-container-vertical > .swiper-pagination-bullets {
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translate3d(0px, -50%, 0);
|
||||
}
|
||||
.swiper-container-vertical > .swiper-pagination-bullets .swiper-pagination-bullet {
|
||||
margin: 6px 0;
|
||||
display: block;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic {
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 8px;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
|
||||
display: inline-block;
|
||||
transition: 200ms transform, 200ms top;
|
||||
}
|
||||
.swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet {
|
||||
margin: 0 4px;
|
||||
}
|
||||
.swiper-container-horizontal > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.swiper-container-horizontal > .swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
|
||||
transition: 200ms transform, 200ms left;
|
||||
}
|
||||
.swiper-container-horizontal.swiper-container-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
|
||||
transition: 200ms transform, 200ms right;
|
||||
}
|
||||
/* Progress */
|
||||
.swiper-pagination-progressbar {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
position: absolute;
|
||||
}
|
||||
.swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
|
||||
background: var(--swiper-pagination-color, var(--swiper-theme-color));
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform: scale(0);
|
||||
transform-origin: left top;
|
||||
}
|
||||
.swiper-container-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
|
||||
transform-origin: right top;
|
||||
}
|
||||
.swiper-container-horizontal > .swiper-pagination-progressbar,
|
||||
.swiper-container-vertical > .swiper-pagination-progressbar.swiper-pagination-progressbar-opposite {
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-pagination-progressbar,
|
||||
.swiper-container-horizontal > .swiper-pagination-progressbar.swiper-pagination-progressbar-opposite {
|
||||
width: 4px;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.swiper-pagination-white {
|
||||
--swiper-pagination-color: #ffffff;
|
||||
}
|
||||
.swiper-pagination-black {
|
||||
--swiper-pagination-color: #000000;
|
||||
}
|
||||
.swiper-pagination-lock {
|
||||
display: none;
|
||||
}
|
||||
/* Scrollbar */
|
||||
.swiper-scrollbar {
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
-ms-touch-action: none;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.swiper-container-horizontal > .swiper-scrollbar {
|
||||
position: absolute;
|
||||
left: 1%;
|
||||
bottom: 3px;
|
||||
z-index: 50;
|
||||
height: 5px;
|
||||
width: 98%;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-scrollbar {
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 1%;
|
||||
z-index: 50;
|
||||
width: 5px;
|
||||
height: 98%;
|
||||
}
|
||||
.swiper-scrollbar-drag {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 10px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.swiper-scrollbar-cursor-drag {
|
||||
cursor: move;
|
||||
}
|
||||
.swiper-scrollbar-lock {
|
||||
display: none;
|
||||
}
|
||||
.swiper-zoom-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
.swiper-zoom-container > img,
|
||||
.swiper-zoom-container > svg,
|
||||
.swiper-zoom-container > canvas {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
.swiper-slide-zoomed {
|
||||
cursor: move;
|
||||
}
|
||||
/* Preloader */
|
||||
:root {
|
||||
/*
|
||||
--swiper-preloader-color: var(--swiper-theme-color);
|
||||
*/
|
||||
}
|
||||
.swiper-lazy-preloader {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -21px;
|
||||
margin-top: -21px;
|
||||
z-index: 10;
|
||||
transform-origin: 50%;
|
||||
animation: swiper-preloader-spin 1s infinite linear;
|
||||
box-sizing: border-box;
|
||||
border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));
|
||||
border-radius: 50%;
|
||||
border-top-color: transparent;
|
||||
}
|
||||
.swiper-lazy-preloader-white {
|
||||
--swiper-preloader-color: #fff;
|
||||
}
|
||||
.swiper-lazy-preloader-black {
|
||||
--swiper-preloader-color: #000;
|
||||
}
|
||||
@keyframes swiper-preloader-spin {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
/* a11y */
|
||||
.swiper-container .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
||||
.swiper-container-fade.swiper-container-free-mode .swiper-slide {
|
||||
transition-timing-function: ease-out;
|
||||
}
|
||||
.swiper-container-fade .swiper-slide {
|
||||
pointer-events: none;
|
||||
transition-property: opacity;
|
||||
}
|
||||
.swiper-container-fade .swiper-slide .swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
.swiper-container-fade .swiper-slide-active,
|
||||
.swiper-container-fade .swiper-slide-active .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
.swiper-container-cube {
|
||||
overflow: visible;
|
||||
}
|
||||
.swiper-container-cube .swiper-slide {
|
||||
pointer-events: none;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
z-index: 1;
|
||||
visibility: hidden;
|
||||
transform-origin: 0 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.swiper-container-cube .swiper-slide .swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
.swiper-container-cube.swiper-container-rtl .swiper-slide {
|
||||
transform-origin: 100% 0;
|
||||
}
|
||||
.swiper-container-cube .swiper-slide-active,
|
||||
.swiper-container-cube .swiper-slide-active .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
.swiper-container-cube .swiper-slide-active,
|
||||
.swiper-container-cube .swiper-slide-next,
|
||||
.swiper-container-cube .swiper-slide-prev,
|
||||
.swiper-container-cube .swiper-slide-next + .swiper-slide {
|
||||
pointer-events: auto;
|
||||
visibility: visible;
|
||||
}
|
||||
.swiper-container-cube .swiper-slide-shadow-top,
|
||||
.swiper-container-cube .swiper-slide-shadow-bottom,
|
||||
.swiper-container-cube .swiper-slide-shadow-left,
|
||||
.swiper-container-cube .swiper-slide-shadow-right {
|
||||
z-index: 0;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
.swiper-container-cube .swiper-cube-shadow {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #000;
|
||||
opacity: 0.6;
|
||||
-webkit-filter: blur(50px);
|
||||
filter: blur(50px);
|
||||
z-index: 0;
|
||||
}
|
||||
.swiper-container-flip {
|
||||
overflow: visible;
|
||||
}
|
||||
.swiper-container-flip .swiper-slide {
|
||||
pointer-events: none;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
z-index: 1;
|
||||
}
|
||||
.swiper-container-flip .swiper-slide .swiper-slide {
|
||||
pointer-events: none;
|
||||
}
|
||||
.swiper-container-flip .swiper-slide-active,
|
||||
.swiper-container-flip .swiper-slide-active .swiper-slide-active {
|
||||
pointer-events: auto;
|
||||
}
|
||||
.swiper-container-flip .swiper-slide-shadow-top,
|
||||
.swiper-container-flip .swiper-slide-shadow-bottom,
|
||||
.swiper-container-flip .swiper-slide-shadow-left,
|
||||
.swiper-container-flip .swiper-slide-shadow-right {
|
||||
z-index: 0;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
}
|
13
ruoyi-ui/src/components/swiper/css/swiper.min.css
vendored
Normal file
8590
ruoyi-ui/src/components/swiper/js/swiper.esm.browser.bundle.js
Normal file
14
ruoyi-ui/src/components/swiper/js/swiper.esm.browser.bundle.min.js
vendored
Normal file
7762
ruoyi-ui/src/components/swiper/js/swiper.esm.bundle.js
Normal file
7744
ruoyi-ui/src/components/swiper/js/swiper.esm.js
Normal file
1
ruoyi-ui/src/components/swiper/js/swiper.esm.js.map
Normal file
8802
ruoyi-ui/src/components/swiper/js/swiper.js
Normal file
1
ruoyi-ui/src/components/swiper/js/swiper.js.map
Normal file
14
ruoyi-ui/src/components/swiper/js/swiper.min.js
vendored
Normal file
1
ruoyi-ui/src/components/swiper/js/swiper.min.js.map
Normal file
24
ruoyi-ui/src/components/swiper/less/mixins.less
Normal file
@ -0,0 +1,24 @@
|
||||
@plugin './plugin.js';
|
||||
.navigation-color-loop(@ruleset) when (length( @colors ) >= 1) {
|
||||
@length: length( @colors ) ;
|
||||
.looper( 1 ) ;
|
||||
.looper( @index ) when ( @index <= @length ) and (length(extract( @colors, @index )) = 2) {
|
||||
@navPair: extract( @colors, @index );
|
||||
@navColorName: extract( @navPair, 1 ) ;
|
||||
@navColorValue: extract( @navPair, 2 ) ;
|
||||
@ruleset();
|
||||
.looper( @index + 1 ) ;
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-color-loop(@ruleset) when (length( @colors ) >= 1) {
|
||||
@length: length( @colors ) ;
|
||||
.looper( 1 ) ;
|
||||
.looper( @index ) when ( @index <= @length ) and (length(extract( @colors, @index )) = 2) {
|
||||
@paginationPair: extract( @colors, @index );
|
||||
@paginationColorName: extract( @paginationPair, 1 ) ;
|
||||
@paginationColorValue: extract( @paginationPair, 2 ) ;
|
||||
@ruleset();
|
||||
.looper( @index + 1 ) ;
|
||||
}
|
||||
}
|
56
ruoyi-ui/src/components/swiper/package.json
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "swiper",
|
||||
"version": "5.4.5",
|
||||
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
|
||||
"main": "js/swiper.js",
|
||||
"jsnext:main": "js/swiper.esm.bundle.js",
|
||||
"module": "js/swiper.esm.bundle.js",
|
||||
"scripts": {
|
||||
"postinstall": "echo \"\u001b[35m\u001b[1mLove Swiper? Support Vladimir's work by donating or pledging on patreon:\u001b[22m\u001b[39m\n > \u001b[32mhttps://patreon.com/vladimirkharlampidi\u001b[0m\n\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nolimits4web/Swiper.git"
|
||||
},
|
||||
"keywords": [
|
||||
"swiper",
|
||||
"swipe",
|
||||
"slider",
|
||||
"touch",
|
||||
"ios",
|
||||
"mobile",
|
||||
"cordova",
|
||||
"phonegap",
|
||||
"app",
|
||||
"framework",
|
||||
"framework7",
|
||||
"carousel",
|
||||
"gallery",
|
||||
"plugin"
|
||||
],
|
||||
"author": "Vladimir Kharlampidi",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nolimits4web/Swiper/issues"
|
||||
},
|
||||
"homepage": "https://swiperjs.com",
|
||||
"funding": {
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/vladimirkharlampidi"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4.7.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"Android >= 7",
|
||||
"IOS >= 11",
|
||||
"Safari >= 11",
|
||||
"Chrome >= 49",
|
||||
"Firefox >= 31",
|
||||
"Samsung >= 5"
|
||||
],
|
||||
"dependencies": {
|
||||
"dom7": "^2.1.5",
|
||||
"ssr-window": "^2.0.0"
|
||||
}
|
||||
}
|
60
ruoyi-ui/src/components/swiper/scss/functions.scss
Normal file
@ -0,0 +1,60 @@
|
||||
/// Urlencode the SVG string
|
||||
/// @param {String} $svg - SVG image to encode
|
||||
/// @return {String} - Encoded SVG data uri
|
||||
@function swiper-svg-uri($svg) {
|
||||
$encoded: '';
|
||||
$chunkSize: 2048;
|
||||
$index: 0;
|
||||
$loops: ceil(str-length($svg) / $chunkSize);
|
||||
|
||||
$map: (
|
||||
"%": "%25",
|
||||
"<": "%3C",
|
||||
">": "%3E",
|
||||
" ": "%20",
|
||||
"!": "%21",
|
||||
"*": "%2A",
|
||||
'"': "%22",
|
||||
";": "%3B",
|
||||
":": "%3A",
|
||||
"@": "%40",
|
||||
"&": "%26",
|
||||
"=": "%3D",
|
||||
"+": "%2B",
|
||||
"$": "%24",
|
||||
",": "%2C",
|
||||
"/": "%2F",
|
||||
"?": "%3F",
|
||||
"#": "%23",
|
||||
"[": "%5B",
|
||||
"]": "%5D"
|
||||
);
|
||||
|
||||
@for $i from 1 through $loops {
|
||||
$chunk: str-slice($svg, $index, $index + $chunkSize - 1);
|
||||
@each $search, $replace in $map {
|
||||
$chunk: swiper-str-replace($chunk, $search, $replace);
|
||||
}
|
||||
$encoded: #{$encoded}#{$chunk};
|
||||
$index: $index + $chunkSize;
|
||||
}
|
||||
|
||||
@return url("data:image/svg+xml;charset=utf-8,#{$encoded}");
|
||||
}
|
||||
|
||||
/// Replace `$search` with `$replace` in `$string`
|
||||
/// @author Hugo Giraudel
|
||||
/// @link http://sassmeister.com/gist/1b4f2da5527830088e4d
|
||||
/// @param {String} $string - Initial string
|
||||
/// @param {String} $search - Substring to replace
|
||||
/// @param {String} $replace ('') - New value
|
||||
/// @return {String} - Updated string
|
||||
@function swiper-str-replace($string, $search, $replace: '') {
|
||||
$index: str-index($string, $search);
|
||||
|
||||
@if $index {
|
||||
@return str-slice($string, 1, $index - 1) + $replace + swiper-str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
||||
}
|
||||
|
||||
@return $string;
|
||||
}
|
212
ruoyi-ui/src/components/swiper/src/components/a11y/a11y.js
Normal file
@ -0,0 +1,212 @@
|
||||
import $ from '../../utils/dom';
|
||||
import Utils from '../../utils/utils';
|
||||
|
||||
const a11y = {
|
||||
makeElFocusable($el) {
|
||||
$el.attr('tabIndex', '0');
|
||||
return $el;
|
||||
},
|
||||
makeElNotFocusable($el) {
|
||||
$el.attr('tabIndex', '-1');
|
||||
return $el;
|
||||
},
|
||||
addElRole($el, role) {
|
||||
$el.attr('role', role);
|
||||
return $el;
|
||||
},
|
||||
addElLabel($el, label) {
|
||||
$el.attr('aria-label', label);
|
||||
return $el;
|
||||
},
|
||||
disableEl($el) {
|
||||
$el.attr('aria-disabled', true);
|
||||
return $el;
|
||||
},
|
||||
enableEl($el) {
|
||||
$el.attr('aria-disabled', false);
|
||||
return $el;
|
||||
},
|
||||
onEnterKey(e) {
|
||||
const swiper = this;
|
||||
const params = swiper.params.a11y;
|
||||
if (e.keyCode !== 13) return;
|
||||
const $targetEl = $(e.target);
|
||||
if (swiper.navigation && swiper.navigation.$nextEl && $targetEl.is(swiper.navigation.$nextEl)) {
|
||||
if (!(swiper.isEnd && !swiper.params.loop)) {
|
||||
swiper.slideNext();
|
||||
}
|
||||
if (swiper.isEnd) {
|
||||
swiper.a11y.notify(params.lastSlideMessage);
|
||||
} else {
|
||||
swiper.a11y.notify(params.nextSlideMessage);
|
||||
}
|
||||
}
|
||||
if (swiper.navigation && swiper.navigation.$prevEl && $targetEl.is(swiper.navigation.$prevEl)) {
|
||||
if (!(swiper.isBeginning && !swiper.params.loop)) {
|
||||
swiper.slidePrev();
|
||||
}
|
||||
if (swiper.isBeginning) {
|
||||
swiper.a11y.notify(params.firstSlideMessage);
|
||||
} else {
|
||||
swiper.a11y.notify(params.prevSlideMessage);
|
||||
}
|
||||
}
|
||||
if (swiper.pagination && $targetEl.is(`.${swiper.params.pagination.bulletClass}`)) {
|
||||
$targetEl[0].click();
|
||||
}
|
||||
},
|
||||
notify(message) {
|
||||
const swiper = this;
|
||||
const notification = swiper.a11y.liveRegion;
|
||||
if (notification.length === 0) return;
|
||||
notification.html('');
|
||||
notification.html(message);
|
||||
},
|
||||
updateNavigation() {
|
||||
const swiper = this;
|
||||
|
||||
if (swiper.params.loop || !swiper.navigation) return;
|
||||
const { $nextEl, $prevEl } = swiper.navigation;
|
||||
|
||||
if ($prevEl && $prevEl.length > 0) {
|
||||
if (swiper.isBeginning) {
|
||||
swiper.a11y.disableEl($prevEl);
|
||||
swiper.a11y.makeElNotFocusable($prevEl);
|
||||
} else {
|
||||
swiper.a11y.enableEl($prevEl);
|
||||
swiper.a11y.makeElFocusable($prevEl);
|
||||
}
|
||||
}
|
||||
if ($nextEl && $nextEl.length > 0) {
|
||||
if (swiper.isEnd) {
|
||||
swiper.a11y.disableEl($nextEl);
|
||||
swiper.a11y.makeElNotFocusable($nextEl);
|
||||
} else {
|
||||
swiper.a11y.enableEl($nextEl);
|
||||
swiper.a11y.makeElFocusable($nextEl);
|
||||
}
|
||||
}
|
||||
},
|
||||
updatePagination() {
|
||||
const swiper = this;
|
||||
const params = swiper.params.a11y;
|
||||
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
|
||||
swiper.pagination.bullets.each((bulletIndex, bulletEl) => {
|
||||
const $bulletEl = $(bulletEl);
|
||||
swiper.a11y.makeElFocusable($bulletEl);
|
||||
swiper.a11y.addElRole($bulletEl, 'button');
|
||||
swiper.a11y.addElLabel($bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, $bulletEl.index() + 1));
|
||||
});
|
||||
}
|
||||
},
|
||||
init() {
|
||||
const swiper = this;
|
||||
|
||||
swiper.$el.append(swiper.a11y.liveRegion);
|
||||
|
||||
// Navigation
|
||||
const params = swiper.params.a11y;
|
||||
let $nextEl;
|
||||
let $prevEl;
|
||||
if (swiper.navigation && swiper.navigation.$nextEl) {
|
||||
$nextEl = swiper.navigation.$nextEl;
|
||||
}
|
||||
if (swiper.navigation && swiper.navigation.$prevEl) {
|
||||
$prevEl = swiper.navigation.$prevEl;
|
||||
}
|
||||
if ($nextEl) {
|
||||
swiper.a11y.makeElFocusable($nextEl);
|
||||
swiper.a11y.addElRole($nextEl, 'button');
|
||||
swiper.a11y.addElLabel($nextEl, params.nextSlideMessage);
|
||||
$nextEl.on('keydown', swiper.a11y.onEnterKey);
|
||||
}
|
||||
if ($prevEl) {
|
||||
swiper.a11y.makeElFocusable($prevEl);
|
||||
swiper.a11y.addElRole($prevEl, 'button');
|
||||
swiper.a11y.addElLabel($prevEl, params.prevSlideMessage);
|
||||
$prevEl.on('keydown', swiper.a11y.onEnterKey);
|
||||
}
|
||||
|
||||
// Pagination
|
||||
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
|
||||
swiper.pagination.$el.on('keydown', `.${swiper.params.pagination.bulletClass}`, swiper.a11y.onEnterKey);
|
||||
}
|
||||
},
|
||||
destroy() {
|
||||
const swiper = this;
|
||||
if (swiper.a11y.liveRegion && swiper.a11y.liveRegion.length > 0) swiper.a11y.liveRegion.remove();
|
||||
|
||||
let $nextEl;
|
||||
let $prevEl;
|
||||
if (swiper.navigation && swiper.navigation.$nextEl) {
|
||||
$nextEl = swiper.navigation.$nextEl;
|
||||
}
|
||||
if (swiper.navigation && swiper.navigation.$prevEl) {
|
||||
$prevEl = swiper.navigation.$prevEl;
|
||||
}
|
||||
if ($nextEl) {
|
||||
$nextEl.off('keydown', swiper.a11y.onEnterKey);
|
||||
}
|
||||
if ($prevEl) {
|
||||
$prevEl.off('keydown', swiper.a11y.onEnterKey);
|
||||
}
|
||||
|
||||
// Pagination
|
||||
if (swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length) {
|
||||
swiper.pagination.$el.off('keydown', `.${swiper.params.pagination.bulletClass}`, swiper.a11y.onEnterKey);
|
||||
}
|
||||
},
|
||||
};
|
||||
export default {
|
||||
name: 'a11y',
|
||||
params: {
|
||||
a11y: {
|
||||
enabled: true,
|
||||
notificationClass: 'swiper-notification',
|
||||
prevSlideMessage: 'Previous slide',
|
||||
nextSlideMessage: 'Next slide',
|
||||
firstSlideMessage: 'This is the first slide',
|
||||
lastSlideMessage: 'This is the last slide',
|
||||
paginationBulletMessage: 'Go to slide {{index}}',
|
||||
},
|
||||
},
|
||||
create() {
|
||||
const swiper = this;
|
||||
Utils.extend(swiper, {
|
||||
a11y: {
|
||||
liveRegion: $(`<span class="${swiper.params.a11y.notificationClass}" aria-live="assertive" aria-atomic="true"></span>`),
|
||||
},
|
||||
});
|
||||
Object.keys(a11y).forEach((methodName) => {
|
||||
swiper.a11y[methodName] = a11y[methodName].bind(swiper);
|
||||
});
|
||||
},
|
||||
on: {
|
||||
init() {
|
||||
const swiper = this;
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
swiper.a11y.init();
|
||||
swiper.a11y.updateNavigation();
|
||||
},
|
||||
toEdge() {
|
||||
const swiper = this;
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
swiper.a11y.updateNavigation();
|
||||
},
|
||||
fromEdge() {
|
||||
const swiper = this;
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
swiper.a11y.updateNavigation();
|
||||
},
|
||||
paginationUpdate() {
|
||||
const swiper = this;
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
swiper.a11y.updatePagination();
|
||||
},
|
||||
destroy() {
|
||||
const swiper = this;
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
swiper.a11y.destroy();
|
||||
},
|
||||
},
|
||||
};
|
@ -0,0 +1,9 @@
|
||||
/* a11y */
|
||||
.swiper-container .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
/* a11y */
|
||||
.swiper-container .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
/* eslint no-underscore-dangle: "off" */
|
||||
import Utils from '../../utils/utils';
|
||||
|
||||
const Autoplay = {
|
||||
run() {
|
||||
const swiper = this;
|
||||
const $activeSlideEl = swiper.slides.eq(swiper.activeIndex);
|
||||
let delay = swiper.params.autoplay.delay;
|
||||
if ($activeSlideEl.attr('data-swiper-autoplay')) {
|
||||
delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;
|
||||
}
|
||||
clearTimeout(swiper.autoplay.timeout);
|
||||
swiper.autoplay.timeout = Utils.nextTick(() => {
|
||||
if (swiper.params.autoplay.reverseDirection) {
|
||||
if (swiper.params.loop) {
|
||||
swiper.loopFix();
|
||||
swiper.slidePrev(swiper.params.speed, true, true);
|
||||
swiper.emit('autoplay');
|
||||
} else if (!swiper.isBeginning) {
|
||||
swiper.slidePrev(swiper.params.speed, true, true);
|
||||
swiper.emit('autoplay');
|
||||
} else if (!swiper.params.autoplay.stopOnLastSlide) {
|
||||
swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);
|
||||
swiper.emit('autoplay');
|
||||
} else {
|
||||
swiper.autoplay.stop();
|
||||
}
|
||||
} else if (swiper.params.loop) {
|
||||
swiper.loopFix();
|
||||
swiper.slideNext(swiper.params.speed, true, true);
|
||||
swiper.emit('autoplay');
|
||||
} else if (!swiper.isEnd) {
|
||||
swiper.slideNext(swiper.params.speed, true, true);
|
||||
swiper.emit('autoplay');
|
||||
} else if (!swiper.params.autoplay.stopOnLastSlide) {
|
||||
swiper.slideTo(0, swiper.params.speed, true, true);
|
||||
swiper.emit('autoplay');
|
||||
} else {
|
||||
swiper.autoplay.stop();
|
||||
}
|
||||
if (swiper.params.cssMode && swiper.autoplay.running) swiper.autoplay.run();
|
||||
}, delay);
|
||||
},
|
||||
start() {
|
||||
const swiper = this;
|
||||
if (typeof swiper.autoplay.timeout !== 'undefined') return false;
|
||||
if (swiper.autoplay.running) return false;
|
||||
swiper.autoplay.running = true;
|
||||
swiper.emit('autoplayStart');
|
||||
swiper.autoplay.run();
|
||||
return true;
|
||||
},
|
||||
stop() {
|
||||
const swiper = this;
|
||||
if (!swiper.autoplay.running) return false;
|
||||
if (typeof swiper.autoplay.timeout === 'undefined') return false;
|
||||
|
||||
if (swiper.autoplay.timeout) {
|
||||
clearTimeout(swiper.autoplay.timeout);
|
||||
swiper.autoplay.timeout = undefined;
|
||||
}
|
||||
swiper.autoplay.running = false;
|
||||
swiper.emit('autoplayStop');
|
||||
return true;
|
||||
},
|
||||
pause(speed) {
|
||||
const swiper = this;
|
||||
if (!swiper.autoplay.running) return;
|
||||
if (swiper.autoplay.paused) return;
|
||||
if (swiper.autoplay.timeout) clearTimeout(swiper.autoplay.timeout);
|
||||
swiper.autoplay.paused = true;
|
||||
if (speed === 0 || !swiper.params.autoplay.waitForTransition) {
|
||||
swiper.autoplay.paused = false;
|
||||
swiper.autoplay.run();
|
||||
} else {
|
||||
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.autoplay.onTransitionEnd);
|
||||
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'autoplay',
|
||||
params: {
|
||||
autoplay: {
|
||||
enabled: false,
|
||||
delay: 3000,
|
||||
waitForTransition: true,
|
||||
disableOnInteraction: true,
|
||||
stopOnLastSlide: false,
|
||||
reverseDirection: false,
|
||||
},
|
||||
},
|
||||
create() {
|
||||
const swiper = this;
|
||||
Utils.extend(swiper, {
|
||||
autoplay: {
|
||||
running: false,
|
||||
paused: false,
|
||||
run: Autoplay.run.bind(swiper),
|
||||
start: Autoplay.start.bind(swiper),
|
||||
stop: Autoplay.stop.bind(swiper),
|
||||
pause: Autoplay.pause.bind(swiper),
|
||||
onVisibilityChange() {
|
||||
if (document.visibilityState === 'hidden' && swiper.autoplay.running) {
|
||||
swiper.autoplay.pause();
|
||||
}
|
||||
if (document.visibilityState === 'visible' && swiper.autoplay.paused) {
|
||||
swiper.autoplay.run();
|
||||
swiper.autoplay.paused = false;
|
||||
}
|
||||
},
|
||||
onTransitionEnd(e) {
|
||||
if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return;
|
||||
if (e.target !== this) return;
|
||||
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.autoplay.onTransitionEnd);
|
||||
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);
|
||||
swiper.autoplay.paused = false;
|
||||
if (!swiper.autoplay.running) {
|
||||
swiper.autoplay.stop();
|
||||
} else {
|
||||
swiper.autoplay.run();
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
on: {
|
||||
init() {
|
||||
const swiper = this;
|
||||
if (swiper.params.autoplay.enabled) {
|
||||
swiper.autoplay.start();
|
||||
document.addEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);
|
||||
}
|
||||
},
|
||||
beforeTransitionStart(speed, internal) {
|
||||
const swiper = this;
|
||||
if (swiper.autoplay.running) {
|
||||
if (internal || !swiper.params.autoplay.disableOnInteraction) {
|
||||
swiper.autoplay.pause(speed);
|
||||
} else {
|
||||
swiper.autoplay.stop();
|
||||
}
|
||||
}
|
||||
},
|
||||
sliderFirstMove() {
|
||||
const swiper = this;
|
||||
if (swiper.autoplay.running) {
|
||||
if (swiper.params.autoplay.disableOnInteraction) {
|
||||
swiper.autoplay.stop();
|
||||
} else {
|
||||
swiper.autoplay.pause();
|
||||
}
|
||||
}
|
||||
},
|
||||
touchEnd() {
|
||||
const swiper = this;
|
||||
if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {
|
||||
swiper.autoplay.run();
|
||||
}
|
||||
},
|
||||
destroy() {
|
||||
const swiper = this;
|
||||
if (swiper.autoplay.running) {
|
||||
swiper.autoplay.stop();
|
||||
}
|
||||
document.removeEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);
|
||||
},
|
||||
},
|
||||
};
|
@ -0,0 +1,186 @@
|
||||
/* eslint no-bitwise: ["error", { "allow": [">>"] }] */
|
||||
import Swiper from '../core/core-class';
|
||||
import Utils from '../../utils/utils';
|
||||
|
||||
const Controller = {
|
||||
LinearSpline: function LinearSpline(x, y) {
|
||||
const binarySearch = (function search() {
|
||||
let maxIndex;
|
||||
let minIndex;
|
||||
let guess;
|
||||
return (array, val) => {
|
||||
minIndex = -1;
|
||||
maxIndex = array.length;
|
||||
while (maxIndex - minIndex > 1) {
|
||||
guess = maxIndex + minIndex >> 1;
|
||||
if (array[guess] <= val) {
|
||||
minIndex = guess;
|
||||
} else {
|
||||
maxIndex = guess;
|
||||
}
|
||||
}
|
||||
return maxIndex;
|
||||
};
|
||||
}());
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.lastIndex = x.length - 1;
|
||||
// Given an x value (x2), return the expected y2 value:
|
||||
// (x1,y1) is the known point before given value,
|
||||
// (x3,y3) is the known point after given value.
|
||||
let i1;
|
||||
let i3;
|
||||
|
||||
this.interpolate = function interpolate(x2) {
|
||||
if (!x2) return 0;
|
||||
|
||||
// Get the indexes of x1 and x3 (the array indexes before and after given x2):
|
||||
i3 = binarySearch(this.x, x2);
|
||||
i1 = i3 - 1;
|
||||
|
||||
// We have our indexes i1 & i3, so we can calculate already:
|
||||
// y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
|
||||
return (((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1])) + this.y[i1];
|
||||
};
|
||||
return this;
|
||||
},
|
||||
// xxx: for now i will just save one spline function to to
|
||||
getInterpolateFunction(c) {
|
||||
const swiper = this;
|
||||
if (!swiper.controller.spline) {
|
||||
swiper.controller.spline = swiper.params.loop
|
||||
? new Controller.LinearSpline(swiper.slidesGrid, c.slidesGrid)
|
||||
: new Controller.LinearSpline(swiper.snapGrid, c.snapGrid);
|
||||
}
|
||||
},
|
||||
setTranslate(setTranslate, byController) {
|
||||
const swiper = this;
|
||||
const controlled = swiper.controller.control;
|
||||
let multiplier;
|
||||
let controlledTranslate;
|
||||
function setControlledTranslate(c) {
|
||||
// this will create an Interpolate function based on the snapGrids
|
||||
// x is the Grid of the scrolled scroller and y will be the controlled scroller
|
||||
// it makes sense to create this only once and recall it for the interpolation
|
||||
// the function does a lot of value caching for performance
|
||||
const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;
|
||||
if (swiper.params.controller.by === 'slide') {
|
||||
swiper.controller.getInterpolateFunction(c);
|
||||
// i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
|
||||
// but it did not work out
|
||||
controlledTranslate = -swiper.controller.spline.interpolate(-translate);
|
||||
}
|
||||
|
||||
if (!controlledTranslate || swiper.params.controller.by === 'container') {
|
||||
multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());
|
||||
controlledTranslate = ((translate - swiper.minTranslate()) * multiplier) + c.minTranslate();
|
||||
}
|
||||
|
||||
if (swiper.params.controller.inverse) {
|
||||
controlledTranslate = c.maxTranslate() - controlledTranslate;
|
||||
}
|
||||
c.updateProgress(controlledTranslate);
|
||||
c.setTranslate(controlledTranslate, swiper);
|
||||
c.updateActiveIndex();
|
||||
c.updateSlidesClasses();
|
||||
}
|
||||
if (Array.isArray(controlled)) {
|
||||
for (let i = 0; i < controlled.length; i += 1) {
|
||||
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
||||
setControlledTranslate(controlled[i]);
|
||||
}
|
||||
}
|
||||
} else if (controlled instanceof Swiper && byController !== controlled) {
|
||||
setControlledTranslate(controlled);
|
||||
}
|
||||
},
|
||||
setTransition(duration, byController) {
|
||||
const swiper = this;
|
||||
const controlled = swiper.controller.control;
|
||||
let i;
|
||||
function setControlledTransition(c) {
|
||||
c.setTransition(duration, swiper);
|
||||
if (duration !== 0) {
|
||||
c.transitionStart();
|
||||
if (c.params.autoHeight) {
|
||||
Utils.nextTick(() => {
|
||||
c.updateAutoHeight();
|
||||
});
|
||||
}
|
||||
c.$wrapperEl.transitionEnd(() => {
|
||||
if (!controlled) return;
|
||||
if (c.params.loop && swiper.params.controller.by === 'slide') {
|
||||
c.loopFix();
|
||||
}
|
||||
c.transitionEnd();
|
||||
});
|
||||
}
|
||||
}
|
||||
if (Array.isArray(controlled)) {
|
||||
for (i = 0; i < controlled.length; i += 1) {
|
||||
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
||||
setControlledTransition(controlled[i]);
|
||||
}
|
||||
}
|
||||
} else if (controlled instanceof Swiper && byController !== controlled) {
|
||||
setControlledTransition(controlled);
|
||||
}
|
||||
},
|
||||
};
|
||||
export default {
|
||||
name: 'controller',
|
||||
params: {
|
||||
controller: {
|
||||
control: undefined,
|
||||
inverse: false,
|
||||
by: 'slide', // or 'container'
|
||||
},
|
||||
},
|
||||
create() {
|
||||
const swiper = this;
|
||||
Utils.extend(swiper, {
|
||||
controller: {
|
||||
control: swiper.params.controller.control,
|
||||
getInterpolateFunction: Controller.getInterpolateFunction.bind(swiper),
|
||||
setTranslate: Controller.setTranslate.bind(swiper),
|
||||
setTransition: Controller.setTransition.bind(swiper),
|
||||
},
|
||||
});
|
||||
},
|
||||
on: {
|
||||
update() {
|
||||
const swiper = this;
|
||||
if (!swiper.controller.control) return;
|
||||
if (swiper.controller.spline) {
|
||||
swiper.controller.spline = undefined;
|
||||
delete swiper.controller.spline;
|
||||
}
|
||||
},
|
||||
resize() {
|
||||
const swiper = this;
|
||||
if (!swiper.controller.control) return;
|
||||
if (swiper.controller.spline) {
|
||||
swiper.controller.spline = undefined;
|
||||
delete swiper.controller.spline;
|
||||
}
|
||||
},
|
||||
observerUpdate() {
|
||||
const swiper = this;
|
||||
if (!swiper.controller.control) return;
|
||||
if (swiper.controller.spline) {
|
||||
swiper.controller.spline = undefined;
|
||||
delete swiper.controller.spline;
|
||||
}
|
||||
},
|
||||
setTranslate(translate, byController) {
|
||||
const swiper = this;
|
||||
if (!swiper.controller.control) return;
|
||||
swiper.controller.setTranslate(translate, byController);
|
||||
},
|
||||
setTransition(duration, byController) {
|
||||
const swiper = this;
|
||||
if (!swiper.controller.control) return;
|
||||
swiper.controller.setTransition(duration, byController);
|
||||
},
|
||||
},
|
||||
};
|
@ -0,0 +1,25 @@
|
||||
import { window } from 'ssr-window';
|
||||
|
||||
export default function (breakpoints) {
|
||||
// Get breakpoint for window width
|
||||
if (!breakpoints) return undefined;
|
||||
let breakpoint = false;
|
||||
|
||||
const points = Object.keys(breakpoints).map((point) => {
|
||||
if (typeof point === 'string' && point.indexOf('@') === 0) {
|
||||
const minRatio = parseFloat(point.substr(1));
|
||||
const value = window.innerHeight * minRatio;
|
||||
return { value, point };
|
||||
}
|
||||
return { value: point, point };
|
||||
});
|
||||
|
||||
points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
|
||||
for (let i = 0; i < points.length; i += 1) {
|
||||
const { point, value } = points[i];
|
||||
if (value <= window.innerWidth) {
|
||||
breakpoint = point;
|
||||
}
|
||||
}
|
||||
return breakpoint || 'max';
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
import setBreakpoint from './setBreakpoint';
|
||||
import getBreakpoint from './getBreakpoint';
|
||||
|
||||
export default { setBreakpoint, getBreakpoint };
|
@ -0,0 +1,68 @@
|
||||
import Utils from '../../../utils/utils';
|
||||
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
const {
|
||||
activeIndex, initialized, loopedSlides = 0, params, $el,
|
||||
} = swiper;
|
||||
const breakpoints = params.breakpoints;
|
||||
if (!breakpoints || (breakpoints && Object.keys(breakpoints).length === 0)) return;
|
||||
|
||||
// Get breakpoint for window width and update parameters
|
||||
const breakpoint = swiper.getBreakpoint(breakpoints);
|
||||
|
||||
if (breakpoint && swiper.currentBreakpoint !== breakpoint) {
|
||||
const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
||||
if (breakpointOnlyParams) {
|
||||
['slidesPerView', 'spaceBetween', 'slidesPerGroup', 'slidesPerGroupSkip', 'slidesPerColumn'].forEach((param) => {
|
||||
const paramValue = breakpointOnlyParams[param];
|
||||
if (typeof paramValue === 'undefined') return;
|
||||
if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {
|
||||
breakpointOnlyParams[param] = 'auto';
|
||||
} else if (param === 'slidesPerView') {
|
||||
breakpointOnlyParams[param] = parseFloat(paramValue);
|
||||
} else {
|
||||
breakpointOnlyParams[param] = parseInt(paramValue, 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
||||
const wasMultiRow = params.slidesPerColumn > 1;
|
||||
const isMultiRow = breakpointParams.slidesPerColumn > 1;
|
||||
if (wasMultiRow && !isMultiRow) {
|
||||
$el.removeClass(`${params.containerModifierClass}multirow ${params.containerModifierClass}multirow-column`);
|
||||
} else if (!wasMultiRow && isMultiRow) {
|
||||
$el.addClass(`${params.containerModifierClass}multirow`);
|
||||
if (breakpointParams.slidesPerColumnFill === 'column') {
|
||||
$el.addClass(`${params.containerModifierClass}multirow-column`);
|
||||
}
|
||||
}
|
||||
|
||||
const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
|
||||
const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
|
||||
|
||||
if (directionChanged && initialized) {
|
||||
swiper.changeDirection();
|
||||
}
|
||||
|
||||
Utils.extend(swiper.params, breakpointParams);
|
||||
|
||||
Utils.extend(swiper, {
|
||||
allowTouchMove: swiper.params.allowTouchMove,
|
||||
allowSlideNext: swiper.params.allowSlideNext,
|
||||
allowSlidePrev: swiper.params.allowSlidePrev,
|
||||
});
|
||||
|
||||
swiper.currentBreakpoint = breakpoint;
|
||||
|
||||
if (needsReLoop && initialized) {
|
||||
swiper.loopDestroy();
|
||||
swiper.loopCreate();
|
||||
swiper.updateSlides();
|
||||
swiper.slideTo((activeIndex - loopedSlides) + swiper.loopedSlides, 0, false);
|
||||
}
|
||||
|
||||
swiper.emit('breakpoint', breakpointParams);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
|
||||
function checkOverflow() {
|
||||
const swiper = this;
|
||||
const params = swiper.params;
|
||||
const wasLocked = swiper.isLocked;
|
||||
const lastSlidePosition = swiper.slides.length > 0 && (params.slidesOffsetBefore + (params.spaceBetween * (swiper.slides.length - 1)) + ((swiper.slides[0]).offsetWidth) * swiper.slides.length);
|
||||
|
||||
if (params.slidesOffsetBefore && params.slidesOffsetAfter && lastSlidePosition) {
|
||||
swiper.isLocked = lastSlidePosition <= swiper.size;
|
||||
} else {
|
||||
swiper.isLocked = swiper.snapGrid.length === 1;
|
||||
}
|
||||
|
||||
swiper.allowSlideNext = !swiper.isLocked;
|
||||
swiper.allowSlidePrev = !swiper.isLocked;
|
||||
|
||||
// events
|
||||
if (wasLocked !== swiper.isLocked) swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
|
||||
|
||||
if (wasLocked && wasLocked !== swiper.isLocked) {
|
||||
swiper.isEnd = false;
|
||||
if (swiper.navigation) swiper.navigation.update();
|
||||
}
|
||||
}
|
||||
|
||||
export default { checkOverflow };
|
@ -0,0 +1,44 @@
|
||||
import Device from '../../../utils/device';
|
||||
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
const {
|
||||
classNames, params, rtl, $el,
|
||||
} = swiper;
|
||||
const suffixes = [];
|
||||
|
||||
suffixes.push('initialized');
|
||||
suffixes.push(params.direction);
|
||||
|
||||
if (params.freeMode) {
|
||||
suffixes.push('free-mode');
|
||||
}
|
||||
if (params.autoHeight) {
|
||||
suffixes.push('autoheight');
|
||||
}
|
||||
if (rtl) {
|
||||
suffixes.push('rtl');
|
||||
}
|
||||
if (params.slidesPerColumn > 1) {
|
||||
suffixes.push('multirow');
|
||||
if (params.slidesPerColumnFill === 'column') {
|
||||
suffixes.push('multirow-column');
|
||||
}
|
||||
}
|
||||
if (Device.android) {
|
||||
suffixes.push('android');
|
||||
}
|
||||
if (Device.ios) {
|
||||
suffixes.push('ios');
|
||||
}
|
||||
|
||||
if (params.cssMode) {
|
||||
suffixes.push('css-mode');
|
||||
}
|
||||
|
||||
suffixes.forEach((suffix) => {
|
||||
classNames.push(params.containerModifierClass + suffix);
|
||||
});
|
||||
|
||||
$el.addClass(classNames.join(' '));
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
import addClasses from './addClasses';
|
||||
import removeClasses from './removeClasses';
|
||||
|
||||
export default { addClasses, removeClasses };
|
@ -0,0 +1,6 @@
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
const { $el, classNames } = swiper;
|
||||
|
||||
$el.removeClass(classNames.join(' '));
|
||||
}
|
490
ruoyi-ui/src/components/swiper/src/components/core/core-class.js
Normal file
@ -0,0 +1,490 @@
|
||||
/* eslint no-param-reassign: "off" */
|
||||
import $ from '../../utils/dom';
|
||||
import Utils from '../../utils/utils';
|
||||
import Support from '../../utils/support';
|
||||
|
||||
import SwiperClass from '../../utils/class';
|
||||
|
||||
import update from './update/index';
|
||||
import translate from './translate/index';
|
||||
import transition from './transition/index';
|
||||
import slide from './slide/index';
|
||||
import loop from './loop/index';
|
||||
import grabCursor from './grab-cursor/index';
|
||||
import manipulation from './manipulation/index';
|
||||
import events from './events/index';
|
||||
import breakpoints from './breakpoints/index';
|
||||
import classes from './classes/index';
|
||||
import images from './images/index';
|
||||
import checkOverflow from './check-overflow/index';
|
||||
|
||||
import defaults from './defaults';
|
||||
|
||||
const prototypes = {
|
||||
update,
|
||||
translate,
|
||||
transition,
|
||||
slide,
|
||||
loop,
|
||||
grabCursor,
|
||||
manipulation,
|
||||
events,
|
||||
breakpoints,
|
||||
checkOverflow,
|
||||
classes,
|
||||
images,
|
||||
};
|
||||
|
||||
const extendedDefaults = {};
|
||||
|
||||
class Swiper extends SwiperClass {
|
||||
constructor(...args) {
|
||||
let el;
|
||||
let params;
|
||||
if (args.length === 1 && args[0].constructor && args[0].constructor === Object) {
|
||||
params = args[0];
|
||||
} else {
|
||||
[el, params] = args;
|
||||
}
|
||||
if (!params) params = {};
|
||||
|
||||
params = Utils.extend({}, params);
|
||||
if (el && !params.el) params.el = el;
|
||||
|
||||
super(params);
|
||||
|
||||
Object.keys(prototypes).forEach((prototypeGroup) => {
|
||||
Object.keys(prototypes[prototypeGroup]).forEach((protoMethod) => {
|
||||
if (!Swiper.prototype[protoMethod]) {
|
||||
Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Swiper Instance
|
||||
const swiper = this;
|
||||
if (typeof swiper.modules === 'undefined') {
|
||||
swiper.modules = {};
|
||||
}
|
||||
Object.keys(swiper.modules).forEach((moduleName) => {
|
||||
const module = swiper.modules[moduleName];
|
||||
if (module.params) {
|
||||
const moduleParamName = Object.keys(module.params)[0];
|
||||
const moduleParams = module.params[moduleParamName];
|
||||
if (typeof moduleParams !== 'object' || moduleParams === null) return;
|
||||
if (!(moduleParamName in params && 'enabled' in moduleParams)) return;
|
||||
if (params[moduleParamName] === true) {
|
||||
params[moduleParamName] = { enabled: true };
|
||||
}
|
||||
if (
|
||||
typeof params[moduleParamName] === 'object'
|
||||
&& !('enabled' in params[moduleParamName])
|
||||
) {
|
||||
params[moduleParamName].enabled = true;
|
||||
}
|
||||
if (!params[moduleParamName]) params[moduleParamName] = { enabled: false };
|
||||
}
|
||||
});
|
||||
|
||||
// Extend defaults with modules params
|
||||
const swiperParams = Utils.extend({}, defaults);
|
||||
swiper.useModulesParams(swiperParams);
|
||||
|
||||
// Extend defaults with passed params
|
||||
swiper.params = Utils.extend({}, swiperParams, extendedDefaults, params);
|
||||
swiper.originalParams = Utils.extend({}, swiper.params);
|
||||
swiper.passedParams = Utils.extend({}, params);
|
||||
|
||||
// Save Dom lib
|
||||
swiper.$ = $;
|
||||
|
||||
// Find el
|
||||
const $el = $(swiper.params.el);
|
||||
el = $el[0];
|
||||
|
||||
if (!el) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if ($el.length > 1) {
|
||||
const swipers = [];
|
||||
$el.each((index, containerEl) => {
|
||||
const newParams = Utils.extend({}, params, { el: containerEl });
|
||||
swipers.push(new Swiper(newParams));
|
||||
});
|
||||
return swipers;
|
||||
}
|
||||
|
||||
el.swiper = swiper;
|
||||
$el.data('swiper', swiper);
|
||||
|
||||
// Find Wrapper
|
||||
let $wrapperEl;
|
||||
if (el && el.shadowRoot && el.shadowRoot.querySelector) {
|
||||
$wrapperEl = $(el.shadowRoot.querySelector(`.${swiper.params.wrapperClass}`));
|
||||
// Children needs to return slot items
|
||||
$wrapperEl.children = (options) => $el.children(options);
|
||||
} else {
|
||||
$wrapperEl = $el.children(`.${swiper.params.wrapperClass}`);
|
||||
}
|
||||
// Extend Swiper
|
||||
Utils.extend(swiper, {
|
||||
$el,
|
||||
el,
|
||||
$wrapperEl,
|
||||
wrapperEl: $wrapperEl[0],
|
||||
|
||||
// Classes
|
||||
classNames: [],
|
||||
|
||||
// Slides
|
||||
slides: $(),
|
||||
slidesGrid: [],
|
||||
snapGrid: [],
|
||||
slidesSizesGrid: [],
|
||||
|
||||
// isDirection
|
||||
isHorizontal() {
|
||||
return swiper.params.direction === 'horizontal';
|
||||
},
|
||||
isVertical() {
|
||||
return swiper.params.direction === 'vertical';
|
||||
},
|
||||
// RTL
|
||||
rtl: (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
|
||||
rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
|
||||
wrongRTL: $wrapperEl.css('display') === '-webkit-box',
|
||||
|
||||
// Indexes
|
||||
activeIndex: 0,
|
||||
realIndex: 0,
|
||||
|
||||
//
|
||||
isBeginning: true,
|
||||
isEnd: false,
|
||||
|
||||
// Props
|
||||
translate: 0,
|
||||
previousTranslate: 0,
|
||||
progress: 0,
|
||||
velocity: 0,
|
||||
animating: false,
|
||||
|
||||
// Locks
|
||||
allowSlideNext: swiper.params.allowSlideNext,
|
||||
allowSlidePrev: swiper.params.allowSlidePrev,
|
||||
|
||||
// Touch Events
|
||||
touchEvents: (function touchEvents() {
|
||||
const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];
|
||||
let desktop = ['mousedown', 'mousemove', 'mouseup'];
|
||||
if (Support.pointerEvents) {
|
||||
desktop = ['pointerdown', 'pointermove', 'pointerup'];
|
||||
}
|
||||
swiper.touchEventsTouch = {
|
||||
start: touch[0],
|
||||
move: touch[1],
|
||||
end: touch[2],
|
||||
cancel: touch[3],
|
||||
};
|
||||
swiper.touchEventsDesktop = {
|
||||
start: desktop[0],
|
||||
move: desktop[1],
|
||||
end: desktop[2],
|
||||
};
|
||||
return Support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;
|
||||
}()),
|
||||
touchEventsData: {
|
||||
isTouched: undefined,
|
||||
isMoved: undefined,
|
||||
allowTouchCallbacks: undefined,
|
||||
touchStartTime: undefined,
|
||||
isScrolling: undefined,
|
||||
currentTranslate: undefined,
|
||||
startTranslate: undefined,
|
||||
allowThresholdMove: undefined,
|
||||
// Form elements to match
|
||||
formElements: 'input, select, option, textarea, button, video, label',
|
||||
// Last click time
|
||||
lastClickTime: Utils.now(),
|
||||
clickTimeout: undefined,
|
||||
// Velocities
|
||||
velocities: [],
|
||||
allowMomentumBounce: undefined,
|
||||
isTouchEvent: undefined,
|
||||
startMoving: undefined,
|
||||
},
|
||||
|
||||
// Clicks
|
||||
allowClick: true,
|
||||
|
||||
// Touches
|
||||
allowTouchMove: swiper.params.allowTouchMove,
|
||||
|
||||
touches: {
|
||||
startX: 0,
|
||||
startY: 0,
|
||||
currentX: 0,
|
||||
currentY: 0,
|
||||
diff: 0,
|
||||
},
|
||||
|
||||
// Images
|
||||
imagesToLoad: [],
|
||||
imagesLoaded: 0,
|
||||
|
||||
});
|
||||
|
||||
// Install Modules
|
||||
swiper.useModules();
|
||||
|
||||
// Init
|
||||
if (swiper.params.init) {
|
||||
swiper.init();
|
||||
}
|
||||
|
||||
// Return app instance
|
||||
return swiper;
|
||||
}
|
||||
|
||||
slidesPerViewDynamic() {
|
||||
const swiper = this;
|
||||
const {
|
||||
params, slides, slidesGrid, size: swiperSize, activeIndex,
|
||||
} = swiper;
|
||||
let spv = 1;
|
||||
if (params.centeredSlides) {
|
||||
let slideSize = slides[activeIndex].swiperSlideSize;
|
||||
let breakLoop;
|
||||
for (let i = activeIndex + 1; i < slides.length; i += 1) {
|
||||
if (slides[i] && !breakLoop) {
|
||||
slideSize += slides[i].swiperSlideSize;
|
||||
spv += 1;
|
||||
if (slideSize > swiperSize) breakLoop = true;
|
||||
}
|
||||
}
|
||||
for (let i = activeIndex - 1; i >= 0; i -= 1) {
|
||||
if (slides[i] && !breakLoop) {
|
||||
slideSize += slides[i].swiperSlideSize;
|
||||
spv += 1;
|
||||
if (slideSize > swiperSize) breakLoop = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = activeIndex + 1; i < slides.length; i += 1) {
|
||||
if (slidesGrid[i] - slidesGrid[activeIndex] < swiperSize) {
|
||||
spv += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return spv;
|
||||
}
|
||||
|
||||
update() {
|
||||
const swiper = this;
|
||||
if (!swiper || swiper.destroyed) return;
|
||||
const { snapGrid, params } = swiper;
|
||||
// Breakpoints
|
||||
if (params.breakpoints) {
|
||||
swiper.setBreakpoint();
|
||||
}
|
||||
swiper.updateSize();
|
||||
swiper.updateSlides();
|
||||
swiper.updateProgress();
|
||||
swiper.updateSlidesClasses();
|
||||
|
||||
function setTranslate() {
|
||||
const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
|
||||
const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
|
||||
swiper.setTranslate(newTranslate);
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
}
|
||||
let translated;
|
||||
if (swiper.params.freeMode) {
|
||||
setTranslate();
|
||||
if (swiper.params.autoHeight) {
|
||||
swiper.updateAutoHeight();
|
||||
}
|
||||
} else {
|
||||
if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
|
||||
translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);
|
||||
} else {
|
||||
translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
|
||||
}
|
||||
if (!translated) {
|
||||
setTranslate();
|
||||
}
|
||||
}
|
||||
if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
|
||||
swiper.checkOverflow();
|
||||
}
|
||||
swiper.emit('update');
|
||||
}
|
||||
|
||||
changeDirection(newDirection, needUpdate = true) {
|
||||
const swiper = this;
|
||||
const currentDirection = swiper.params.direction;
|
||||
if (!newDirection) {
|
||||
// eslint-disable-next-line
|
||||
newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
|
||||
}
|
||||
if ((newDirection === currentDirection) || (newDirection !== 'horizontal' && newDirection !== 'vertical')) {
|
||||
return swiper;
|
||||
}
|
||||
|
||||
swiper.$el
|
||||
.removeClass(`${swiper.params.containerModifierClass}${currentDirection}`)
|
||||
.addClass(`${swiper.params.containerModifierClass}${newDirection}`);
|
||||
|
||||
swiper.params.direction = newDirection;
|
||||
|
||||
swiper.slides.each((slideIndex, slideEl) => {
|
||||
if (newDirection === 'vertical') {
|
||||
slideEl.style.width = '';
|
||||
} else {
|
||||
slideEl.style.height = '';
|
||||
}
|
||||
});
|
||||
|
||||
swiper.emit('changeDirection');
|
||||
if (needUpdate) swiper.update();
|
||||
|
||||
return swiper;
|
||||
}
|
||||
|
||||
init() {
|
||||
const swiper = this;
|
||||
if (swiper.initialized) return;
|
||||
|
||||
swiper.emit('beforeInit');
|
||||
|
||||
// Set breakpoint
|
||||
if (swiper.params.breakpoints) {
|
||||
swiper.setBreakpoint();
|
||||
}
|
||||
|
||||
// Add Classes
|
||||
swiper.addClasses();
|
||||
|
||||
// Create loop
|
||||
if (swiper.params.loop) {
|
||||
swiper.loopCreate();
|
||||
}
|
||||
|
||||
// Update size
|
||||
swiper.updateSize();
|
||||
|
||||
// Update slides
|
||||
swiper.updateSlides();
|
||||
|
||||
if (swiper.params.watchOverflow) {
|
||||
swiper.checkOverflow();
|
||||
}
|
||||
|
||||
// Set Grab Cursor
|
||||
if (swiper.params.grabCursor) {
|
||||
swiper.setGrabCursor();
|
||||
}
|
||||
|
||||
if (swiper.params.preloadImages) {
|
||||
swiper.preloadImages();
|
||||
}
|
||||
|
||||
// Slide To Initial Slide
|
||||
if (swiper.params.loop) {
|
||||
swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit);
|
||||
} else {
|
||||
swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit);
|
||||
}
|
||||
|
||||
// Attach events
|
||||
swiper.attachEvents();
|
||||
|
||||
// Init Flag
|
||||
swiper.initialized = true;
|
||||
|
||||
// Emit
|
||||
swiper.emit('init');
|
||||
}
|
||||
|
||||
destroy(deleteInstance = true, cleanStyles = true) {
|
||||
const swiper = this;
|
||||
const {
|
||||
params, $el, $wrapperEl, slides,
|
||||
} = swiper;
|
||||
|
||||
if (typeof swiper.params === 'undefined' || swiper.destroyed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
swiper.emit('beforeDestroy');
|
||||
|
||||
// Init Flag
|
||||
swiper.initialized = false;
|
||||
|
||||
// Detach events
|
||||
swiper.detachEvents();
|
||||
|
||||
// Destroy loop
|
||||
if (params.loop) {
|
||||
swiper.loopDestroy();
|
||||
}
|
||||
|
||||
// Cleanup styles
|
||||
if (cleanStyles) {
|
||||
swiper.removeClasses();
|
||||
$el.removeAttr('style');
|
||||
$wrapperEl.removeAttr('style');
|
||||
if (slides && slides.length) {
|
||||
slides
|
||||
.removeClass([
|
||||
params.slideVisibleClass,
|
||||
params.slideActiveClass,
|
||||
params.slideNextClass,
|
||||
params.slidePrevClass,
|
||||
].join(' '))
|
||||
.removeAttr('style')
|
||||
.removeAttr('data-swiper-slide-index');
|
||||
}
|
||||
}
|
||||
|
||||
swiper.emit('destroy');
|
||||
|
||||
// Detach emitter events
|
||||
Object.keys(swiper.eventsListeners).forEach((eventName) => {
|
||||
swiper.off(eventName);
|
||||
});
|
||||
|
||||
if (deleteInstance !== false) {
|
||||
swiper.$el[0].swiper = null;
|
||||
swiper.$el.data('swiper', null);
|
||||
Utils.deleteProps(swiper);
|
||||
}
|
||||
swiper.destroyed = true;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static extendDefaults(newDefaults) {
|
||||
Utils.extend(extendedDefaults, newDefaults);
|
||||
}
|
||||
|
||||
static get extendedDefaults() {
|
||||
return extendedDefaults;
|
||||
}
|
||||
|
||||
static get defaults() {
|
||||
return defaults;
|
||||
}
|
||||
|
||||
static get Class() {
|
||||
return SwiperClass;
|
||||
}
|
||||
|
||||
static get $() {
|
||||
return $;
|
||||
}
|
||||
}
|
||||
|
||||
export default Swiper;
|
111
ruoyi-ui/src/components/swiper/src/components/core/core.less
Normal file
@ -0,0 +1,111 @@
|
||||
:root {
|
||||
--swiper-theme-color: @themeColor;
|
||||
}
|
||||
.swiper-container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
/* Fix of Webkit flickering */
|
||||
z-index:1;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-wrapper {
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-wrapper {
|
||||
position:relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
transition-property:transform;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.swiper-container-android .swiper-slide, .swiper-wrapper {
|
||||
transform:translate3d(0px,0,0);
|
||||
}
|
||||
.swiper-container-multirow > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.swiper-container-multirow-column > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-container-free-mode > .swiper-wrapper {
|
||||
transition-timing-function: ease-out;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.swiper-slide {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
transition-property: transform;
|
||||
}
|
||||
.swiper-slide-invisible-blank {
|
||||
visibility: hidden;
|
||||
}
|
||||
/* Auto Height */
|
||||
.swiper-container-autoheight, .swiper-container-autoheight .swiper-slide {
|
||||
height: auto;
|
||||
}
|
||||
.swiper-container-autoheight .swiper-wrapper {
|
||||
align-items: flex-start;
|
||||
transition-property: transform, height;
|
||||
}
|
||||
|
||||
/* 3D Effects */
|
||||
.swiper-container-3d {
|
||||
perspective: 1200px;
|
||||
.swiper-wrapper, .swiper-slide, .swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-cube-shadow {
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
.swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
.swiper-slide-shadow-left {
|
||||
background-image: linear-gradient(to left, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-right {
|
||||
background-image: linear-gradient(to right, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-top {
|
||||
background-image: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-bottom {
|
||||
background-image: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
}
|
||||
|
||||
/* CSS Mode */
|
||||
.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
overflow: auto;
|
||||
scrollbar-width: none; /* For Firefox */
|
||||
-ms-overflow-style: none; /* For Internet Explorer and Edge */
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
> .swiper-wrapper > .swiper-slide {
|
||||
scroll-snap-align: start start;
|
||||
}
|
||||
}
|
||||
.swiper-container-horizontal.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
scroll-snap-type: x mandatory;
|
||||
}
|
||||
}
|
||||
.swiper-container-vertical.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
scroll-snap-type: y mandatory;
|
||||
}
|
||||
}
|
115
ruoyi-ui/src/components/swiper/src/components/core/core.scss
Normal file
@ -0,0 +1,115 @@
|
||||
:root {
|
||||
--swiper-theme-color: #{$themeColor};
|
||||
}
|
||||
.swiper-container {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
/* Fix of Webkit flickering */
|
||||
z-index:1;
|
||||
}
|
||||
.swiper-container-vertical > .swiper-wrapper {
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-wrapper {
|
||||
position:relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
transition-property:transform;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.swiper-container-android .swiper-slide,
|
||||
.swiper-wrapper {
|
||||
transform:translate3d(0px,0,0);
|
||||
}
|
||||
.swiper-container-multirow > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.swiper-container-multirow-column > .swiper-wrapper {
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
}
|
||||
.swiper-container-free-mode > .swiper-wrapper {
|
||||
transition-timing-function: ease-out;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.swiper-slide {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
transition-property: transform;
|
||||
}
|
||||
.swiper-slide-invisible-blank {
|
||||
visibility: hidden;
|
||||
}
|
||||
/* Auto Height */
|
||||
.swiper-container-autoheight {
|
||||
&, .swiper-slide {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.swiper-wrapper {
|
||||
align-items: flex-start;
|
||||
transition-property: transform, height;
|
||||
}
|
||||
}
|
||||
|
||||
/* 3D Effects */
|
||||
.swiper-container-3d {
|
||||
perspective: 1200px;
|
||||
.swiper-wrapper, .swiper-slide, .swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-cube-shadow {
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
.swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
}
|
||||
.swiper-slide-shadow-left {
|
||||
background-image: linear-gradient(to left, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-right {
|
||||
background-image: linear-gradient(to right, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-top {
|
||||
background-image: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
.swiper-slide-shadow-bottom {
|
||||
background-image: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0));
|
||||
}
|
||||
}
|
||||
|
||||
/* CSS Mode */
|
||||
.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
overflow: auto;
|
||||
scrollbar-width: none; /* For Firefox */
|
||||
-ms-overflow-style: none; /* For Internet Explorer and Edge */
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
> .swiper-wrapper > .swiper-slide {
|
||||
scroll-snap-align: start start;
|
||||
}
|
||||
}
|
||||
.swiper-container-horizontal.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
scroll-snap-type: x mandatory;
|
||||
}
|
||||
}
|
||||
.swiper-container-vertical.swiper-container-css-mode {
|
||||
> .swiper-wrapper {
|
||||
scroll-snap-type: y mandatory;
|
||||
}
|
||||
}
|
133
ruoyi-ui/src/components/swiper/src/components/core/defaults.js
Normal file
@ -0,0 +1,133 @@
|
||||
export default {
|
||||
init: true,
|
||||
direction: 'horizontal',
|
||||
touchEventsTarget: 'container',
|
||||
initialSlide: 0,
|
||||
speed: 300,
|
||||
cssMode: false,
|
||||
updateOnWindowResize: true,
|
||||
//
|
||||
preventInteractionOnTransition: false,
|
||||
|
||||
// To support iOS's swipe-to-go-back gesture (when being used in-app).
|
||||
edgeSwipeDetection: false,
|
||||
edgeSwipeThreshold: 20,
|
||||
|
||||
// Free mode
|
||||
freeMode: false,
|
||||
freeModeMomentum: true,
|
||||
freeModeMomentumRatio: 1,
|
||||
freeModeMomentumBounce: true,
|
||||
freeModeMomentumBounceRatio: 1,
|
||||
freeModeMomentumVelocityRatio: 1,
|
||||
freeModeSticky: false,
|
||||
freeModeMinimumVelocity: 0.02,
|
||||
|
||||
// Autoheight
|
||||
autoHeight: false,
|
||||
|
||||
// Set wrapper width
|
||||
setWrapperSize: false,
|
||||
|
||||
// Virtual Translate
|
||||
virtualTranslate: false,
|
||||
|
||||
// Effects
|
||||
effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
|
||||
|
||||
// Breakpoints
|
||||
breakpoints: undefined,
|
||||
|
||||
// Slides grid
|
||||
spaceBetween: 0,
|
||||
slidesPerView: 1,
|
||||
slidesPerColumn: 1,
|
||||
slidesPerColumnFill: 'column',
|
||||
slidesPerGroup: 1,
|
||||
slidesPerGroupSkip: 0,
|
||||
centeredSlides: false,
|
||||
centeredSlidesBounds: false,
|
||||
slidesOffsetBefore: 0, // in px
|
||||
slidesOffsetAfter: 0, // in px
|
||||
normalizeSlideIndex: true,
|
||||
centerInsufficientSlides: false,
|
||||
|
||||
// Disable swiper and hide navigation when container not overflow
|
||||
watchOverflow: false,
|
||||
|
||||
// Round length
|
||||
roundLengths: false,
|
||||
|
||||
// Touches
|
||||
touchRatio: 1,
|
||||
touchAngle: 45,
|
||||
simulateTouch: true,
|
||||
shortSwipes: true,
|
||||
longSwipes: true,
|
||||
longSwipesRatio: 0.5,
|
||||
longSwipesMs: 300,
|
||||
followFinger: true,
|
||||
allowTouchMove: true,
|
||||
threshold: 0,
|
||||
touchMoveStopPropagation: false,
|
||||
touchStartPreventDefault: true,
|
||||
touchStartForcePreventDefault: false,
|
||||
touchReleaseOnEdges: false,
|
||||
|
||||
// Unique Navigation Elements
|
||||
uniqueNavElements: true,
|
||||
|
||||
// Resistance
|
||||
resistance: true,
|
||||
resistanceRatio: 0.85,
|
||||
|
||||
// Progress
|
||||
watchSlidesProgress: false,
|
||||
watchSlidesVisibility: false,
|
||||
|
||||
// Cursor
|
||||
grabCursor: false,
|
||||
|
||||
// Clicks
|
||||
preventClicks: true,
|
||||
preventClicksPropagation: true,
|
||||
slideToClickedSlide: false,
|
||||
|
||||
// Images
|
||||
preloadImages: true,
|
||||
updateOnImagesReady: true,
|
||||
|
||||
// loop
|
||||
loop: false,
|
||||
loopAdditionalSlides: 0,
|
||||
loopedSlides: null,
|
||||
loopFillGroupWithBlank: false,
|
||||
|
||||
// Swiping/no swiping
|
||||
allowSlidePrev: true,
|
||||
allowSlideNext: true,
|
||||
swipeHandler: null, // '.swipe-handler',
|
||||
noSwiping: true,
|
||||
noSwipingClass: 'swiper-no-swiping',
|
||||
noSwipingSelector: null,
|
||||
|
||||
// Passive Listeners
|
||||
passiveListeners: true,
|
||||
|
||||
// NS
|
||||
containerModifierClass: 'swiper-container-', // NEW
|
||||
slideClass: 'swiper-slide',
|
||||
slideBlankClass: 'swiper-slide-invisible-blank',
|
||||
slideActiveClass: 'swiper-slide-active',
|
||||
slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
|
||||
slideVisibleClass: 'swiper-slide-visible',
|
||||
slideDuplicateClass: 'swiper-slide-duplicate',
|
||||
slideNextClass: 'swiper-slide-next',
|
||||
slideDuplicateNextClass: 'swiper-slide-duplicate-next',
|
||||
slidePrevClass: 'swiper-slide-prev',
|
||||
slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
|
||||
wrapperClass: 'swiper-wrapper',
|
||||
|
||||
// Callbacks
|
||||
runCallbacksOnInit: true,
|
||||
};
|
@ -0,0 +1,119 @@
|
||||
import { document } from 'ssr-window';
|
||||
import Device from '../../../utils/device';
|
||||
import Support from '../../../utils/support';
|
||||
|
||||
import onTouchStart from './onTouchStart';
|
||||
import onTouchMove from './onTouchMove';
|
||||
import onTouchEnd from './onTouchEnd';
|
||||
import onResize from './onResize';
|
||||
import onClick from './onClick';
|
||||
import onScroll from './onScroll';
|
||||
|
||||
let dummyEventAttached = false;
|
||||
function dummyEventListener() {}
|
||||
|
||||
function attachEvents() {
|
||||
const swiper = this;
|
||||
const {
|
||||
params, touchEvents, el, wrapperEl,
|
||||
} = swiper;
|
||||
|
||||
swiper.onTouchStart = onTouchStart.bind(swiper);
|
||||
swiper.onTouchMove = onTouchMove.bind(swiper);
|
||||
swiper.onTouchEnd = onTouchEnd.bind(swiper);
|
||||
if (params.cssMode) {
|
||||
swiper.onScroll = onScroll.bind(swiper);
|
||||
}
|
||||
|
||||
swiper.onClick = onClick.bind(swiper);
|
||||
|
||||
const capture = !!params.nested;
|
||||
|
||||
// Touch Events
|
||||
if (!Support.touch && Support.pointerEvents) {
|
||||
el.addEventListener(touchEvents.start, swiper.onTouchStart, false);
|
||||
document.addEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
||||
document.addEventListener(touchEvents.end, swiper.onTouchEnd, false);
|
||||
} else {
|
||||
if (Support.touch) {
|
||||
const passiveListener = touchEvents.start === 'touchstart' && Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
||||
el.addEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
|
||||
el.addEventListener(touchEvents.move, swiper.onTouchMove, Support.passiveListener ? { passive: false, capture } : capture);
|
||||
el.addEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
|
||||
if (touchEvents.cancel) {
|
||||
el.addEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);
|
||||
}
|
||||
if (!dummyEventAttached) {
|
||||
document.addEventListener('touchstart', dummyEventListener);
|
||||
dummyEventAttached = true;
|
||||
}
|
||||
}
|
||||
if ((params.simulateTouch && !Device.ios && !Device.android) || (params.simulateTouch && !Support.touch && Device.ios)) {
|
||||
el.addEventListener('mousedown', swiper.onTouchStart, false);
|
||||
document.addEventListener('mousemove', swiper.onTouchMove, capture);
|
||||
document.addEventListener('mouseup', swiper.onTouchEnd, false);
|
||||
}
|
||||
}
|
||||
// Prevent Links Clicks
|
||||
if (params.preventClicks || params.preventClicksPropagation) {
|
||||
el.addEventListener('click', swiper.onClick, true);
|
||||
}
|
||||
if (params.cssMode) {
|
||||
wrapperEl.addEventListener('scroll', swiper.onScroll);
|
||||
}
|
||||
|
||||
// Resize handler
|
||||
if (params.updateOnWindowResize) {
|
||||
swiper.on((Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate'), onResize, true);
|
||||
} else {
|
||||
swiper.on('observerUpdate', onResize, true);
|
||||
}
|
||||
}
|
||||
|
||||
function detachEvents() {
|
||||
const swiper = this;
|
||||
|
||||
const {
|
||||
params, touchEvents, el, wrapperEl,
|
||||
} = swiper;
|
||||
|
||||
const capture = !!params.nested;
|
||||
|
||||
// Touch Events
|
||||
if (!Support.touch && Support.pointerEvents) {
|
||||
el.removeEventListener(touchEvents.start, swiper.onTouchStart, false);
|
||||
document.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
||||
document.removeEventListener(touchEvents.end, swiper.onTouchEnd, false);
|
||||
} else {
|
||||
if (Support.touch) {
|
||||
const passiveListener = touchEvents.start === 'onTouchStart' && Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
||||
el.removeEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
|
||||
el.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
||||
el.removeEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
|
||||
if (touchEvents.cancel) {
|
||||
el.removeEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);
|
||||
}
|
||||
}
|
||||
if ((params.simulateTouch && !Device.ios && !Device.android) || (params.simulateTouch && !Support.touch && Device.ios)) {
|
||||
el.removeEventListener('mousedown', swiper.onTouchStart, false);
|
||||
document.removeEventListener('mousemove', swiper.onTouchMove, capture);
|
||||
document.removeEventListener('mouseup', swiper.onTouchEnd, false);
|
||||
}
|
||||
}
|
||||
// Prevent Links Clicks
|
||||
if (params.preventClicks || params.preventClicksPropagation) {
|
||||
el.removeEventListener('click', swiper.onClick, true);
|
||||
}
|
||||
|
||||
if (params.cssMode) {
|
||||
wrapperEl.removeEventListener('scroll', swiper.onScroll);
|
||||
}
|
||||
|
||||
// Resize handler
|
||||
swiper.off((Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate'), onResize);
|
||||
}
|
||||
|
||||
export default {
|
||||
attachEvents,
|
||||
detachEvents,
|
||||
};
|
@ -0,0 +1,10 @@
|
||||
export default function (e) {
|
||||
const swiper = this;
|
||||
if (!swiper.allowClick) {
|
||||
if (swiper.params.preventClicks) e.preventDefault();
|
||||
if (swiper.params.preventClicksPropagation && swiper.animating) {
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
|
||||
const { params, el } = swiper;
|
||||
|
||||
if (el && el.offsetWidth === 0) return;
|
||||
|
||||
// Breakpoints
|
||||
if (params.breakpoints) {
|
||||
swiper.setBreakpoint();
|
||||
}
|
||||
|
||||
// Save locks
|
||||
const { allowSlideNext, allowSlidePrev, snapGrid } = swiper;
|
||||
|
||||
// Disable locks on resize
|
||||
swiper.allowSlideNext = true;
|
||||
swiper.allowSlidePrev = true;
|
||||
|
||||
swiper.updateSize();
|
||||
swiper.updateSlides();
|
||||
|
||||
swiper.updateSlidesClasses();
|
||||
if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) {
|
||||
swiper.slideTo(swiper.slides.length - 1, 0, false, true);
|
||||
} else {
|
||||
swiper.slideTo(swiper.activeIndex, 0, false, true);
|
||||
}
|
||||
|
||||
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
|
||||
swiper.autoplay.run();
|
||||
}
|
||||
// Return locks after resize
|
||||
swiper.allowSlidePrev = allowSlidePrev;
|
||||
swiper.allowSlideNext = allowSlideNext;
|
||||
|
||||
if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
|
||||
swiper.checkOverflow();
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
const { wrapperEl, rtlTranslate } = swiper;
|
||||
swiper.previousTranslate = swiper.translate;
|
||||
if (swiper.isHorizontal()) {
|
||||
if (rtlTranslate) {
|
||||
swiper.translate = ((wrapperEl.scrollWidth - wrapperEl.offsetWidth) - wrapperEl.scrollLeft);
|
||||
} else {
|
||||
swiper.translate = -wrapperEl.scrollLeft;
|
||||
}
|
||||
} else {
|
||||
swiper.translate = -wrapperEl.scrollTop;
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
if (swiper.translate === -0) swiper.translate = 0;
|
||||
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
|
||||
let newProgress;
|
||||
const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
|
||||
if (translatesDiff === 0) {
|
||||
newProgress = 0;
|
||||
} else {
|
||||
newProgress = (swiper.translate - swiper.minTranslate()) / (translatesDiff);
|
||||
}
|
||||
if (newProgress !== swiper.progress) {
|
||||
swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
|
||||
}
|
||||
|
||||
swiper.emit('setTranslate', swiper.translate, false);
|
||||
}
|
@ -0,0 +1,293 @@
|
||||
import Utils from '../../../utils/utils';
|
||||
|
||||
export default function (event) {
|
||||
const swiper = this;
|
||||
const data = swiper.touchEventsData;
|
||||
|
||||
const {
|
||||
params, touches, rtlTranslate: rtl, $wrapperEl, slidesGrid, snapGrid,
|
||||
} = swiper;
|
||||
let e = event;
|
||||
if (e.originalEvent) e = e.originalEvent;
|
||||
if (data.allowTouchCallbacks) {
|
||||
swiper.emit('touchEnd', e);
|
||||
}
|
||||
data.allowTouchCallbacks = false;
|
||||
if (!data.isTouched) {
|
||||
if (data.isMoved && params.grabCursor) {
|
||||
swiper.setGrabCursor(false);
|
||||
}
|
||||
data.isMoved = false;
|
||||
data.startMoving = false;
|
||||
return;
|
||||
}
|
||||
// Return Grab Cursor
|
||||
if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
||||
swiper.setGrabCursor(false);
|
||||
}
|
||||
|
||||
// Time diff
|
||||
const touchEndTime = Utils.now();
|
||||
const timeDiff = touchEndTime - data.touchStartTime;
|
||||
|
||||
// Tap, doubleTap, Click
|
||||
if (swiper.allowClick) {
|
||||
swiper.updateClickedSlide(e);
|
||||
swiper.emit('tap click', e);
|
||||
if (timeDiff < 300 && (touchEndTime - data.lastClickTime) < 300) {
|
||||
swiper.emit('doubleTap doubleClick', e);
|
||||
}
|
||||
}
|
||||
|
||||
data.lastClickTime = Utils.now();
|
||||
Utils.nextTick(() => {
|
||||
if (!swiper.destroyed) swiper.allowClick = true;
|
||||
});
|
||||
|
||||
if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
|
||||
data.isTouched = false;
|
||||
data.isMoved = false;
|
||||
data.startMoving = false;
|
||||
return;
|
||||
}
|
||||
data.isTouched = false;
|
||||
data.isMoved = false;
|
||||
data.startMoving = false;
|
||||
|
||||
let currentPos;
|
||||
if (params.followFinger) {
|
||||
currentPos = rtl ? swiper.translate : -swiper.translate;
|
||||
} else {
|
||||
currentPos = -data.currentTranslate;
|
||||
}
|
||||
|
||||
if (params.cssMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.freeMode) {
|
||||
if (currentPos < -swiper.minTranslate()) {
|
||||
swiper.slideTo(swiper.activeIndex);
|
||||
return;
|
||||
}
|
||||
if (currentPos > -swiper.maxTranslate()) {
|
||||
if (swiper.slides.length < snapGrid.length) {
|
||||
swiper.slideTo(snapGrid.length - 1);
|
||||
} else {
|
||||
swiper.slideTo(swiper.slides.length - 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.freeModeMomentum) {
|
||||
if (data.velocities.length > 1) {
|
||||
const lastMoveEvent = data.velocities.pop();
|
||||
const velocityEvent = data.velocities.pop();
|
||||
|
||||
const distance = lastMoveEvent.position - velocityEvent.position;
|
||||
const time = lastMoveEvent.time - velocityEvent.time;
|
||||
swiper.velocity = distance / time;
|
||||
swiper.velocity /= 2;
|
||||
if (Math.abs(swiper.velocity) < params.freeModeMinimumVelocity) {
|
||||
swiper.velocity = 0;
|
||||
}
|
||||
// this implies that the user stopped moving a finger then released.
|
||||
// There would be no events with distance zero, so the last event is stale.
|
||||
if (time > 150 || (Utils.now() - lastMoveEvent.time) > 300) {
|
||||
swiper.velocity = 0;
|
||||
}
|
||||
} else {
|
||||
swiper.velocity = 0;
|
||||
}
|
||||
swiper.velocity *= params.freeModeMomentumVelocityRatio;
|
||||
|
||||
data.velocities.length = 0;
|
||||
let momentumDuration = 1000 * params.freeModeMomentumRatio;
|
||||
const momentumDistance = swiper.velocity * momentumDuration;
|
||||
|
||||
let newPosition = swiper.translate + momentumDistance;
|
||||
if (rtl) newPosition = -newPosition;
|
||||
|
||||
let doBounce = false;
|
||||
let afterBouncePosition;
|
||||
const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeModeMomentumBounceRatio;
|
||||
let needsLoopFix;
|
||||
if (newPosition < swiper.maxTranslate()) {
|
||||
if (params.freeModeMomentumBounce) {
|
||||
if (newPosition + swiper.maxTranslate() < -bounceAmount) {
|
||||
newPosition = swiper.maxTranslate() - bounceAmount;
|
||||
}
|
||||
afterBouncePosition = swiper.maxTranslate();
|
||||
doBounce = true;
|
||||
data.allowMomentumBounce = true;
|
||||
} else {
|
||||
newPosition = swiper.maxTranslate();
|
||||
}
|
||||
if (params.loop && params.centeredSlides) needsLoopFix = true;
|
||||
} else if (newPosition > swiper.minTranslate()) {
|
||||
if (params.freeModeMomentumBounce) {
|
||||
if (newPosition - swiper.minTranslate() > bounceAmount) {
|
||||
newPosition = swiper.minTranslate() + bounceAmount;
|
||||
}
|
||||
afterBouncePosition = swiper.minTranslate();
|
||||
doBounce = true;
|
||||
data.allowMomentumBounce = true;
|
||||
} else {
|
||||
newPosition = swiper.minTranslate();
|
||||
}
|
||||
if (params.loop && params.centeredSlides) needsLoopFix = true;
|
||||
} else if (params.freeModeSticky) {
|
||||
let nextSlide;
|
||||
for (let j = 0; j < snapGrid.length; j += 1) {
|
||||
if (snapGrid[j] > -newPosition) {
|
||||
nextSlide = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
|
||||
newPosition = snapGrid[nextSlide];
|
||||
} else {
|
||||
newPosition = snapGrid[nextSlide - 1];
|
||||
}
|
||||
newPosition = -newPosition;
|
||||
}
|
||||
if (needsLoopFix) {
|
||||
swiper.once('transitionEnd', () => {
|
||||
swiper.loopFix();
|
||||
});
|
||||
}
|
||||
// Fix duration
|
||||
if (swiper.velocity !== 0) {
|
||||
if (rtl) {
|
||||
momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
|
||||
} else {
|
||||
momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
|
||||
}
|
||||
if (params.freeModeSticky) {
|
||||
// If freeModeSticky is active and the user ends a swipe with a slow-velocity
|
||||
// event, then durations can be 20+ seconds to slide one (or zero!) slides.
|
||||
// It's easy to see this when simulating touch with mouse events. To fix this,
|
||||
// limit single-slide swipes to the default slide duration. This also has the
|
||||
// nice side effect of matching slide speed if the user stopped moving before
|
||||
// lifting finger or mouse vs. moving slowly before lifting the finger/mouse.
|
||||
// For faster swipes, also apply limits (albeit higher ones).
|
||||
const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
|
||||
const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
|
||||
if (moveDistance < currentSlideSize) {
|
||||
momentumDuration = params.speed;
|
||||
} else if (moveDistance < 2 * currentSlideSize) {
|
||||
momentumDuration = params.speed * 1.5;
|
||||
} else {
|
||||
momentumDuration = params.speed * 2.5;
|
||||
}
|
||||
}
|
||||
} else if (params.freeModeSticky) {
|
||||
swiper.slideToClosest();
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.freeModeMomentumBounce && doBounce) {
|
||||
swiper.updateProgress(afterBouncePosition);
|
||||
swiper.setTransition(momentumDuration);
|
||||
swiper.setTranslate(newPosition);
|
||||
swiper.transitionStart(true, swiper.swipeDirection);
|
||||
swiper.animating = true;
|
||||
$wrapperEl.transitionEnd(() => {
|
||||
if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
|
||||
swiper.emit('momentumBounce');
|
||||
swiper.setTransition(params.speed);
|
||||
setTimeout(() => {
|
||||
swiper.setTranslate(afterBouncePosition);
|
||||
$wrapperEl.transitionEnd(() => {
|
||||
if (!swiper || swiper.destroyed) return;
|
||||
swiper.transitionEnd();
|
||||
});
|
||||
}, 0);
|
||||
});
|
||||
} else if (swiper.velocity) {
|
||||
swiper.updateProgress(newPosition);
|
||||
swiper.setTransition(momentumDuration);
|
||||
swiper.setTranslate(newPosition);
|
||||
swiper.transitionStart(true, swiper.swipeDirection);
|
||||
if (!swiper.animating) {
|
||||
swiper.animating = true;
|
||||
$wrapperEl.transitionEnd(() => {
|
||||
if (!swiper || swiper.destroyed) return;
|
||||
swiper.transitionEnd();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
swiper.updateProgress(newPosition);
|
||||
}
|
||||
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
} else if (params.freeModeSticky) {
|
||||
swiper.slideToClosest();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) {
|
||||
swiper.updateProgress();
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Find current slide
|
||||
let stopIndex = 0;
|
||||
let groupSize = swiper.slidesSizesGrid[0];
|
||||
for (let i = 0; i < slidesGrid.length; i += (i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup)) {
|
||||
const increment = (i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup);
|
||||
if (typeof slidesGrid[i + increment] !== 'undefined') {
|
||||
if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
|
||||
stopIndex = i;
|
||||
groupSize = slidesGrid[i + increment] - slidesGrid[i];
|
||||
}
|
||||
} else if (currentPos >= slidesGrid[i]) {
|
||||
stopIndex = i;
|
||||
groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
|
||||
}
|
||||
}
|
||||
|
||||
// Find current slide size
|
||||
const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
|
||||
const increment = (stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup);
|
||||
|
||||
if (timeDiff > params.longSwipesMs) {
|
||||
// Long touches
|
||||
if (!params.longSwipes) {
|
||||
swiper.slideTo(swiper.activeIndex);
|
||||
return;
|
||||
}
|
||||
if (swiper.swipeDirection === 'next') {
|
||||
if (ratio >= params.longSwipesRatio) swiper.slideTo(stopIndex + increment);
|
||||
else swiper.slideTo(stopIndex);
|
||||
}
|
||||
if (swiper.swipeDirection === 'prev') {
|
||||
if (ratio > (1 - params.longSwipesRatio)) swiper.slideTo(stopIndex + increment);
|
||||
else swiper.slideTo(stopIndex);
|
||||
}
|
||||
} else {
|
||||
// Short swipes
|
||||
if (!params.shortSwipes) {
|
||||
swiper.slideTo(swiper.activeIndex);
|
||||
return;
|
||||
}
|
||||
const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
|
||||
if (!isNavButtonTarget) {
|
||||
if (swiper.swipeDirection === 'next') {
|
||||
swiper.slideTo(stopIndex + increment);
|
||||
}
|
||||
if (swiper.swipeDirection === 'prev') {
|
||||
swiper.slideTo(stopIndex);
|
||||
}
|
||||
} else if (e.target === swiper.navigation.nextEl) {
|
||||
swiper.slideTo(stopIndex + increment);
|
||||
} else {
|
||||
swiper.slideTo(stopIndex);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
import { document } from 'ssr-window';
|
||||
import $ from '../../../utils/dom';
|
||||
import Utils from '../../../utils/utils';
|
||||
|
||||
export default function (event) {
|
||||
const swiper = this;
|
||||
const data = swiper.touchEventsData;
|
||||
const { params, touches, rtlTranslate: rtl } = swiper;
|
||||
let e = event;
|
||||
if (e.originalEvent) e = e.originalEvent;
|
||||
if (!data.isTouched) {
|
||||
if (data.startMoving && data.isScrolling) {
|
||||
swiper.emit('touchMoveOpposite', e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (data.isTouchEvent && e.type !== 'touchmove') return;
|
||||
const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);
|
||||
const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;
|
||||
const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;
|
||||
if (e.preventedByNestedSwiper) {
|
||||
touches.startX = pageX;
|
||||
touches.startY = pageY;
|
||||
return;
|
||||
}
|
||||
if (!swiper.allowTouchMove) {
|
||||
// isMoved = true;
|
||||
swiper.allowClick = false;
|
||||
if (data.isTouched) {
|
||||
Utils.extend(touches, {
|
||||
startX: pageX,
|
||||
startY: pageY,
|
||||
currentX: pageX,
|
||||
currentY: pageY,
|
||||
});
|
||||
data.touchStartTime = Utils.now();
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {
|
||||
if (swiper.isVertical()) {
|
||||
// Vertical
|
||||
if (
|
||||
(pageY < touches.startY && swiper.translate <= swiper.maxTranslate())
|
||||
|| (pageY > touches.startY && swiper.translate >= swiper.minTranslate())
|
||||
) {
|
||||
data.isTouched = false;
|
||||
data.isMoved = false;
|
||||
return;
|
||||
}
|
||||
} else if (
|
||||
(pageX < touches.startX && swiper.translate <= swiper.maxTranslate())
|
||||
|| (pageX > touches.startX && swiper.translate >= swiper.minTranslate())
|
||||
) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (data.isTouchEvent && document.activeElement) {
|
||||
if (e.target === document.activeElement && $(e.target).is(data.formElements)) {
|
||||
data.isMoved = true;
|
||||
swiper.allowClick = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (data.allowTouchCallbacks) {
|
||||
swiper.emit('touchMove', e);
|
||||
}
|
||||
if (e.targetTouches && e.targetTouches.length > 1) return;
|
||||
|
||||
touches.currentX = pageX;
|
||||
touches.currentY = pageY;
|
||||
|
||||
const diffX = touches.currentX - touches.startX;
|
||||
const diffY = touches.currentY - touches.startY;
|
||||
if (swiper.params.threshold && Math.sqrt((diffX ** 2) + (diffY ** 2)) < swiper.params.threshold) return;
|
||||
|
||||
if (typeof data.isScrolling === 'undefined') {
|
||||
let touchAngle;
|
||||
if ((swiper.isHorizontal() && touches.currentY === touches.startY) || (swiper.isVertical() && touches.currentX === touches.startX)) {
|
||||
data.isScrolling = false;
|
||||
} else {
|
||||
// eslint-disable-next-line
|
||||
if ((diffX * diffX) + (diffY * diffY) >= 25) {
|
||||
touchAngle = (Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180) / Math.PI;
|
||||
data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : (90 - touchAngle > params.touchAngle);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.isScrolling) {
|
||||
swiper.emit('touchMoveOpposite', e);
|
||||
}
|
||||
if (typeof data.startMoving === 'undefined') {
|
||||
if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
|
||||
data.startMoving = true;
|
||||
}
|
||||
}
|
||||
if (data.isScrolling) {
|
||||
data.isTouched = false;
|
||||
return;
|
||||
}
|
||||
if (!data.startMoving) {
|
||||
return;
|
||||
}
|
||||
swiper.allowClick = false;
|
||||
if (!params.cssMode && e.cancelable) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (params.touchMoveStopPropagation && !params.nested) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
if (!data.isMoved) {
|
||||
if (params.loop) {
|
||||
swiper.loopFix();
|
||||
}
|
||||
data.startTranslate = swiper.getTranslate();
|
||||
swiper.setTransition(0);
|
||||
if (swiper.animating) {
|
||||
swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');
|
||||
}
|
||||
data.allowMomentumBounce = false;
|
||||
// Grab Cursor
|
||||
if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
||||
swiper.setGrabCursor(true);
|
||||
}
|
||||
swiper.emit('sliderFirstMove', e);
|
||||
}
|
||||
swiper.emit('sliderMove', e);
|
||||
data.isMoved = true;
|
||||
|
||||
let diff = swiper.isHorizontal() ? diffX : diffY;
|
||||
touches.diff = diff;
|
||||
|
||||
diff *= params.touchRatio;
|
||||
if (rtl) diff = -diff;
|
||||
|
||||
swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
|
||||
data.currentTranslate = diff + data.startTranslate;
|
||||
|
||||
let disableParentSwiper = true;
|
||||
let resistanceRatio = params.resistanceRatio;
|
||||
if (params.touchReleaseOnEdges) {
|
||||
resistanceRatio = 0;
|
||||
}
|
||||
if ((diff > 0 && data.currentTranslate > swiper.minTranslate())) {
|
||||
disableParentSwiper = false;
|
||||
if (params.resistance) data.currentTranslate = (swiper.minTranslate() - 1) + ((-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio);
|
||||
} else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {
|
||||
disableParentSwiper = false;
|
||||
if (params.resistance) data.currentTranslate = (swiper.maxTranslate() + 1) - ((swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio);
|
||||
}
|
||||
|
||||
if (disableParentSwiper) {
|
||||
e.preventedByNestedSwiper = true;
|
||||
}
|
||||
|
||||
// Directions locks
|
||||
if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
|
||||
data.currentTranslate = data.startTranslate;
|
||||
}
|
||||
if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
|
||||
data.currentTranslate = data.startTranslate;
|
||||
}
|
||||
|
||||
|
||||
// Threshold
|
||||
if (params.threshold > 0) {
|
||||
if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
|
||||
if (!data.allowThresholdMove) {
|
||||
data.allowThresholdMove = true;
|
||||
touches.startX = touches.currentX;
|
||||
touches.startY = touches.currentY;
|
||||
data.currentTranslate = data.startTranslate;
|
||||
touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
data.currentTranslate = data.startTranslate;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!params.followFinger || params.cssMode) return;
|
||||
|
||||
// Update active index in free mode
|
||||
if (params.freeMode || params.watchSlidesProgress || params.watchSlidesVisibility) {
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
}
|
||||
if (params.freeMode) {
|
||||
// Velocity
|
||||
if (data.velocities.length === 0) {
|
||||
data.velocities.push({
|
||||
position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
|
||||
time: data.touchStartTime,
|
||||
});
|
||||
}
|
||||
data.velocities.push({
|
||||
position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
|
||||
time: Utils.now(),
|
||||
});
|
||||
}
|
||||
// Update progress
|
||||
swiper.updateProgress(data.currentTranslate);
|
||||
// Update translate
|
||||
swiper.setTranslate(data.currentTranslate);
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
import { window, document } from 'ssr-window';
|
||||
import $ from '../../../utils/dom';
|
||||
import Utils from '../../../utils/utils';
|
||||
|
||||
export default function (event) {
|
||||
const swiper = this;
|
||||
const data = swiper.touchEventsData;
|
||||
const { params, touches } = swiper;
|
||||
|
||||
if (swiper.animating && params.preventInteractionOnTransition) {
|
||||
return;
|
||||
}
|
||||
let e = event;
|
||||
if (e.originalEvent) e = e.originalEvent;
|
||||
const $targetEl = $(e.target);
|
||||
|
||||
if (params.touchEventsTarget === 'wrapper') {
|
||||
if (!$targetEl.closest(swiper.wrapperEl).length) return;
|
||||
}
|
||||
data.isTouchEvent = e.type === 'touchstart';
|
||||
if (!data.isTouchEvent && 'which' in e && e.which === 3) return;
|
||||
if (!data.isTouchEvent && 'button' in e && e.button > 0) return;
|
||||
if (data.isTouched && data.isMoved) return;
|
||||
if (params.noSwiping && $targetEl.closest(params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`)[0]) {
|
||||
swiper.allowClick = true;
|
||||
return;
|
||||
}
|
||||
if (params.swipeHandler) {
|
||||
if (!$targetEl.closest(params.swipeHandler)[0]) return;
|
||||
}
|
||||
|
||||
touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
||||
touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
||||
const startX = touches.currentX;
|
||||
const startY = touches.currentY;
|
||||
|
||||
// Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
|
||||
|
||||
const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
|
||||
const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
|
||||
if (
|
||||
edgeSwipeDetection
|
||||
&& ((startX <= edgeSwipeThreshold)
|
||||
|| (startX >= window.screen.width - edgeSwipeThreshold))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
Utils.extend(data, {
|
||||
isTouched: true,
|
||||
isMoved: false,
|
||||
allowTouchCallbacks: true,
|
||||
isScrolling: undefined,
|
||||
startMoving: undefined,
|
||||
});
|
||||
|
||||
touches.startX = startX;
|
||||
touches.startY = startY;
|
||||
data.touchStartTime = Utils.now();
|
||||
swiper.allowClick = true;
|
||||
swiper.updateSize();
|
||||
swiper.swipeDirection = undefined;
|
||||
if (params.threshold > 0) data.allowThresholdMove = false;
|
||||
if (e.type !== 'touchstart') {
|
||||
let preventDefault = true;
|
||||
if ($targetEl.is(data.formElements)) preventDefault = false;
|
||||
if (
|
||||
document.activeElement
|
||||
&& $(document.activeElement).is(data.formElements)
|
||||
&& document.activeElement !== $targetEl[0]
|
||||
) {
|
||||
document.activeElement.blur();
|
||||
}
|
||||
|
||||
const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
||||
if (params.touchStartForcePreventDefault || shouldPreventDefault) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
swiper.emit('touchStart', e);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import setGrabCursor from './setGrabCursor';
|
||||
import unsetGrabCursor from './unsetGrabCursor';
|
||||
|
||||
export default {
|
||||
setGrabCursor,
|
||||
unsetGrabCursor,
|
||||
};
|
@ -0,0 +1,11 @@
|
||||
import Support from '../../../utils/support';
|
||||
|
||||
export default function (moving) {
|
||||
const swiper = this;
|
||||
if (Support.touch || !swiper.params.simulateTouch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) return;
|
||||
const el = swiper.el;
|
||||
el.style.cursor = 'move';
|
||||
el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';
|
||||
el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';
|
||||
el.style.cursor = moving ? 'grabbing' : 'grab';
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import Support from '../../../utils/support';
|
||||
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
if (Support.touch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) return;
|
||||
swiper.el.style.cursor = '';
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import loadImage from './loadImage';
|
||||
import preloadImages from './preloadImages';
|
||||
|
||||
export default {
|
||||
loadImage,
|
||||
preloadImages,
|
||||
};
|
@ -0,0 +1,32 @@
|
||||
import { window } from 'ssr-window';
|
||||
import $ from '../../../utils/dom';
|
||||
|
||||
export default function (imageEl, src, srcset, sizes, checkForComplete, callback) {
|
||||
let image;
|
||||
function onReady() {
|
||||
if (callback) callback();
|
||||
}
|
||||
const isPicture = $(imageEl).parent('picture')[0];
|
||||
|
||||
if (!isPicture && (!imageEl.complete || !checkForComplete)) {
|
||||
if (src) {
|
||||
image = new window.Image();
|
||||
image.onload = onReady;
|
||||
image.onerror = onReady;
|
||||
if (sizes) {
|
||||
image.sizes = sizes;
|
||||
}
|
||||
if (srcset) {
|
||||
image.srcset = srcset;
|
||||
}
|
||||
if (src) {
|
||||
image.src = src;
|
||||
}
|
||||
} else {
|
||||
onReady();
|
||||
}
|
||||
} else {
|
||||
// image already loaded...
|
||||
onReady();
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
swiper.imagesToLoad = swiper.$el.find('img');
|
||||
function onReady() {
|
||||
if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;
|
||||
if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;
|
||||
if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
|
||||
if (swiper.params.updateOnImagesReady) swiper.update();
|
||||
swiper.emit('imagesReady');
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < swiper.imagesToLoad.length; i += 1) {
|
||||
const imageEl = swiper.imagesToLoad[i];
|
||||
swiper.loadImage(
|
||||
imageEl,
|
||||
imageEl.currentSrc || imageEl.getAttribute('src'),
|
||||
imageEl.srcset || imageEl.getAttribute('srcset'),
|
||||
imageEl.sizes || imageEl.getAttribute('sizes'),
|
||||
true,
|
||||
onReady
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
import loopCreate from './loopCreate';
|
||||
import loopFix from './loopFix';
|
||||
import loopDestroy from './loopDestroy';
|
||||
|
||||
export default {
|
||||
loopCreate,
|
||||
loopFix,
|
||||
loopDestroy,
|
||||
};
|
@ -0,0 +1,45 @@
|
||||
import { document } from 'ssr-window';
|
||||
import $ from '../../../utils/dom';
|
||||
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
const { params, $wrapperEl } = swiper;
|
||||
// Remove duplicated slides
|
||||
$wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove();
|
||||
|
||||
let slides = $wrapperEl.children(`.${params.slideClass}`);
|
||||
|
||||
if (params.loopFillGroupWithBlank) {
|
||||
const blankSlidesNum = params.slidesPerGroup - (slides.length % params.slidesPerGroup);
|
||||
if (blankSlidesNum !== params.slidesPerGroup) {
|
||||
for (let i = 0; i < blankSlidesNum; i += 1) {
|
||||
const blankNode = $(document.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`);
|
||||
$wrapperEl.append(blankNode);
|
||||
}
|
||||
slides = $wrapperEl.children(`.${params.slideClass}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;
|
||||
|
||||
swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));
|
||||
swiper.loopedSlides += params.loopAdditionalSlides;
|
||||
if (swiper.loopedSlides > slides.length) {
|
||||
swiper.loopedSlides = slides.length;
|
||||
}
|
||||
|
||||
const prependSlides = [];
|
||||
const appendSlides = [];
|
||||
slides.each((index, el) => {
|
||||
const slide = $(el);
|
||||
if (index < swiper.loopedSlides) appendSlides.push(el);
|
||||
if (index < slides.length && index >= slides.length - swiper.loopedSlides) prependSlides.push(el);
|
||||
slide.attr('data-swiper-slide-index', index);
|
||||
});
|
||||
for (let i = 0; i < appendSlides.length; i += 1) {
|
||||
$wrapperEl.append($(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
|
||||
}
|
||||
for (let i = prependSlides.length - 1; i >= 0; i -= 1) {
|
||||
$wrapperEl.prepend($(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
const { $wrapperEl, params, slides } = swiper;
|
||||
$wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove();
|
||||
slides.removeAttr('data-swiper-slide-index');
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
export default function () {
|
||||
const swiper = this;
|
||||
|
||||
swiper.emit('beforeLoopFix');
|
||||
|
||||
const {
|
||||
activeIndex, slides, loopedSlides, allowSlidePrev, allowSlideNext, snapGrid, rtlTranslate: rtl,
|
||||
} = swiper;
|
||||
let newIndex;
|
||||
swiper.allowSlidePrev = true;
|
||||
swiper.allowSlideNext = true;
|
||||
|
||||
const snapTranslate = -snapGrid[activeIndex];
|
||||
const diff = snapTranslate - swiper.getTranslate();
|
||||
|
||||
// Fix For Negative Oversliding
|
||||
if (activeIndex < loopedSlides) {
|
||||
newIndex = (slides.length - (loopedSlides * 3)) + activeIndex;
|
||||
newIndex += loopedSlides;
|
||||
const slideChanged = swiper.slideTo(newIndex, 0, false, true);
|
||||
if (slideChanged && diff !== 0) {
|
||||
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
|
||||
}
|
||||
} else if (activeIndex >= slides.length - loopedSlides) {
|
||||
// Fix For Positive Oversliding
|
||||
newIndex = -slides.length + activeIndex + loopedSlides;
|
||||
newIndex += loopedSlides;
|
||||
const slideChanged = swiper.slideTo(newIndex, 0, false, true);
|
||||
if (slideChanged && diff !== 0) {
|
||||
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
|
||||
}
|
||||
}
|
||||
swiper.allowSlidePrev = allowSlidePrev;
|
||||
swiper.allowSlideNext = allowSlideNext;
|
||||
|
||||
swiper.emit('loopFix');
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
import Support from '../../../utils/support';
|
||||
|
||||
export default function (index, slides) {
|
||||
const swiper = this;
|
||||
const { $wrapperEl, params, activeIndex } = swiper;
|
||||
let activeIndexBuffer = activeIndex;
|
||||
if (params.loop) {
|
||||
activeIndexBuffer -= swiper.loopedSlides;
|
||||
swiper.loopDestroy();
|
||||
swiper.slides = $wrapperEl.children(`.${params.slideClass}`);
|
||||
}
|
||||
const baseLength = swiper.slides.length;
|
||||
if (index <= 0) {
|
||||
swiper.prependSlide(slides);
|
||||
return;
|
||||
}
|
||||
if (index >= baseLength) {
|
||||
swiper.appendSlide(slides);
|
||||
return;
|
||||
}
|
||||
let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;
|
||||
|
||||
const slidesBuffer = [];
|
||||
for (let i = baseLength - 1; i >= index; i -= 1) {
|
||||
const currentSlide = swiper.slides.eq(i);
|
||||
currentSlide.remove();
|
||||
slidesBuffer.unshift(currentSlide);
|
||||
}
|
||||
|
||||
if (typeof slides === 'object' && 'length' in slides) {
|
||||
for (let i = 0; i < slides.length; i += 1) {
|
||||
if (slides[i]) $wrapperEl.append(slides[i]);
|
||||
}
|
||||
newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;
|
||||
} else {
|
||||
$wrapperEl.append(slides);
|
||||
}
|
||||
|
||||
for (let i = 0; i < slidesBuffer.length; i += 1) {
|
||||
$wrapperEl.append(slidesBuffer[i]);
|
||||
}
|
||||
|
||||
if (params.loop) {
|
||||
swiper.loopCreate();
|
||||
}
|
||||
if (!(params.observer && Support.observer)) {
|
||||
swiper.update();
|
||||
}
|
||||
if (params.loop) {
|
||||
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
|
||||
} else {
|
||||
swiper.slideTo(newActiveIndex, 0, false);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
import Support from '../../../utils/support';
|
||||
|
||||
export default function (slides) {
|
||||
const swiper = this;
|
||||
const { $wrapperEl, params } = swiper;
|
||||
if (params.loop) {
|
||||
swiper.loopDestroy();
|
||||
}
|
||||
if (typeof slides === 'object' && 'length' in slides) {
|
||||
for (let i = 0; i < slides.length; i += 1) {
|
||||
if (slides[i]) $wrapperEl.append(slides[i]);
|
||||
}
|
||||
} else {
|
||||
$wrapperEl.append(slides);
|
||||
}
|
||||
if (params.loop) {
|
||||
swiper.loopCreate();
|
||||
}
|
||||
if (!(params.observer && Support.observer)) {
|
||||
swiper.update();
|
||||
}
|
||||
}
|