From a3657c7b63aa851ea163bde5774e3e776f504f4e Mon Sep 17 00:00:00 2001 From: Naotoshi Fujita Date: Fri, 30 Sep 2022 12:36:30 +0900 Subject: [PATCH] Update the Splide version. --- dist/css/splide-core.min.css | 2 +- dist/css/splide.min.css | 2 +- dist/css/themes/splide-default.min.css | 2 +- dist/css/themes/splide-sea-green.min.css | 2 +- dist/css/themes/splide-skyblue.min.css | 2 +- dist/js/vue-splide.cjs.js | 279 ++++++++++++----------- dist/js/vue-splide.esm.js | 279 ++++++++++++----------- package-lock.json | 18 +- package.json | 4 +- 9 files changed, 316 insertions(+), 274 deletions(-) diff --git a/dist/css/splide-core.min.css b/dist/css/splide-core.min.css index 84f1113..089c72e 100644 --- a/dist/css/splide-core.min.css +++ b/dist/css/splide-core.min.css @@ -1 +1 @@ -@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list{display:block}.splide__track--fade>.splide__list>.splide__slide{left:0;opacity:0;position:absolute;top:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;position:relative;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0} \ No newline at end of file +@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0} \ No newline at end of file diff --git a/dist/css/splide.min.css b/dist/css/splide.min.css index 92f0de7..7e014b4 100644 --- a/dist/css/splide.min.css +++ b/dist/css/splide.min.css @@ -1 +1 @@ -.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list{display:block}.splide__track--fade>.splide__list>.splide__slide{left:0;opacity:0;position:absolute;top:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;position:relative;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0} \ No newline at end of file +.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0} \ No newline at end of file diff --git a/dist/css/themes/splide-default.min.css b/dist/css/themes/splide-default.min.css index 92f0de7..7e014b4 100644 --- a/dist/css/themes/splide-default.min.css +++ b/dist/css/themes/splide-default.min.css @@ -1 +1 @@ -.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list{display:block}.splide__track--fade>.splide__list>.splide__slide{left:0;opacity:0;position:absolute;top:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;position:relative;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0} \ No newline at end of file +.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0} \ No newline at end of file diff --git a/dist/css/themes/splide-sea-green.min.css b/dist/css/themes/splide-sea-green.min.css index f44d520..5d29b64 100644 --- a/dist/css/themes/splide-sea-green.min.css +++ b/dist/css/themes/splide-sea-green.min.css @@ -1 +1 @@ -.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;border-radius:4px;cursor:pointer;opacity:.7}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #20b2aa;opacity:1}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:1em;top:0}.splide__pagination--ttb .splide__pagination__page{height:20px;width:5px}.splide__arrow{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:0;cursor:pointer;display:-ms-flexbox;display:flex;height:2.5em;-ms-flex-pack:center;justify-content:center;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2.5em;z-index:1}.splide__arrow svg{fill:#20b2aa;height:2.5em;transition:fill .2s linear;width:2.5em}.splide__arrow:hover:not(:disabled) svg{fill:#57e1d9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #20b2aa;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #20b2aa;outline-offset:3px}.splide__pagination{bottom:1em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:2.5px;display:inline-block;height:5px;margin:3px;padding:0;position:relative;transition:background-color .2s linear;width:20px}.splide__pagination__page.is-active{background:#20b2aa;z-index:1}.splide__pagination__page:hover{background:#57e1d9;cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #20b2aa;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #20b2aa;outline-offset:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:4px}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #20b2aa;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #20b2aa}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #20b2aa;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #20b2aa}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#20b2aa}}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #20b2aa;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list{display:block}.splide__track--fade>.splide__list>.splide__slide{left:0;opacity:0;position:absolute;top:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;position:relative;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__progress__bar{background:#ccc;height:3px}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #20b2aa;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #20b2aa;outline-offset:3px}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__slider>.splide__arrows .splide__arrow--prev{left:-2.5em}.splide__slider>.splide__arrows .splide__arrow--next{right:-2.5em}.splide{padding:3em} \ No newline at end of file +.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;border-radius:4px;cursor:pointer;opacity:.7}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #20b2aa;opacity:1}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:1em;top:0}.splide__pagination--ttb .splide__pagination__page{height:20px;width:5px}.splide__arrow{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:0;cursor:pointer;display:-ms-flexbox;display:flex;height:2.5em;-ms-flex-pack:center;justify-content:center;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2.5em;z-index:1}.splide__arrow svg{fill:#20b2aa;height:2.5em;transition:fill .2s linear;width:2.5em}.splide__arrow:hover:not(:disabled) svg{fill:#57e1d9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #20b2aa;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #20b2aa;outline-offset:3px}.splide__pagination{bottom:1em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:2.5px;display:inline-block;height:5px;margin:3px;padding:0;position:relative;transition:background-color .2s linear;width:20px}.splide__pagination__page.is-active{background:#20b2aa;z-index:1}.splide__pagination__page:hover{background:#57e1d9;cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #20b2aa;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #20b2aa;outline-offset:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:4px}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #20b2aa;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #20b2aa}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #20b2aa;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #20b2aa}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#20b2aa}}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #20b2aa;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__progress__bar{background:#ccc;height:3px}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #20b2aa;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #20b2aa;outline-offset:3px}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__slider>.splide__arrows .splide__arrow--prev{left:-2.5em}.splide__slider>.splide__arrows .splide__arrow--next{right:-2.5em}.splide{padding:3em} \ No newline at end of file diff --git a/dist/css/themes/splide-skyblue.min.css b/dist/css/themes/splide-skyblue.min.css index f9c5384..f3a4e75 100644 --- a/dist/css/themes/splide-skyblue.min.css +++ b/dist/css/themes/splide-skyblue.min.css @@ -1 +1 @@ -.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer;opacity:.7}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #00bfff;opacity:1}.splide__arrow{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:0;cursor:pointer;display:-ms-flexbox;display:flex;height:2.5em;-ms-flex-pack:center;justify-content:center;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2.5em;z-index:1}.splide__arrow svg{fill:#00bfff;height:2.5em;transition:fill .2s linear;width:2.5em}.splide__arrow:hover:not(:disabled) svg{fill:#66d9ff}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #00bfff;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #00bfff;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:10px;margin:3px;padding:0;position:relative;transition:background-color .2s linear,transform .2s linear;width:10px}.splide__pagination__page.is-active{background:#00bfff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{background:#66d9ff;cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #00bfff;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #00bfff;outline-offset:3px}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #00bfff;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list{display:block}.splide__track--fade>.splide__list>.splide__slide{left:0;opacity:0;position:absolute;top:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;position:relative;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #00bfff;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #00bfff}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #00bfff;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #00bfff}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#00bfff}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #00bfff;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #00bfff;outline-offset:3px}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0} \ No newline at end of file +.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer;opacity:.7}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #00bfff;opacity:1}.splide__arrow{-ms-flex-align:center;align-items:center;background:transparent;border:0;border-radius:0;cursor:pointer;display:-ms-flexbox;display:flex;height:2.5em;-ms-flex-pack:center;justify-content:center;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2.5em;z-index:1}.splide__arrow svg{fill:#00bfff;height:2.5em;transition:fill .2s linear;width:2.5em}.splide__arrow:hover:not(:disabled) svg{fill:#66d9ff}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #00bfff;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #00bfff;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:10px;margin:3px;padding:0;position:relative;transition:background-color .2s linear,transform .2s linear;width:10px}.splide__pagination__page.is-active{background:#00bfff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{background:#66d9ff;cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #00bfff;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #00bfff;outline-offset:3px}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #00bfff;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #00bfff;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #00bfff}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #00bfff;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #00bfff}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#00bfff}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #00bfff;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #00bfff;outline-offset:3px}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0} \ No newline at end of file diff --git a/dist/js/vue-splide.cjs.js b/dist/js/vue-splide.cjs.js index 34285ef..78ca348 100644 --- a/dist/js/vue-splide.cjs.js +++ b/dist/js/vue-splide.cjs.js @@ -21,7 +21,7 @@ function _createClass(Constructor, protoProps, staticProps) { } /*! * Splide.js - * Version : 4.0.17 + * Version : 4.1.3 * License : MIT * Copyright: 2022 Naotoshi Fujita */ @@ -71,7 +71,11 @@ function isNull(subject) { return subject === null; } function isHTMLElement(subject) { - return subject instanceof HTMLElement; + try { + return subject instanceof (subject.ownerDocument.defaultView || window).HTMLElement; + } catch (e) { + return false; + } } function toArray(value) { return isArray(value) ? value : [value]; @@ -124,16 +128,9 @@ function child(parent, selector) { var ownKeys = Object.keys; function forOwn$1(object, iteratee, right) { if (object) { - var keys = ownKeys(object); - keys = right ? keys.reverse() : keys; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key !== "__proto__") { - if (iteratee(object[key], key) === false) { - break; - } - } - } + (right ? ownKeys(object).reverse() : ownKeys(object)).forEach(function(key) { + key !== "__proto__" && iteratee(object[key], key); + }); } return object; } @@ -160,7 +157,7 @@ function merge$1(object) { return object; } function omit(object, keys) { - toArray(keys || ownKeys(object)).forEach(function(key) { + forEach(keys || ownKeys(object), function(key) { delete object[key]; }); } @@ -258,9 +255,9 @@ var min = Math.min, max = Math.max, floor = Math.floor, ceil = Math.ceil, abs = function approximatelyEqual(x, y, epsilon) { return abs(x - y) < epsilon; } -function between(number, minOrMax, maxOrMin, exclusive) { - var minimum = min(minOrMax, maxOrMin); - var maximum = max(minOrMax, maxOrMin); +function between(number, x, y, exclusive) { + var minimum = min(x, y); + var maximum = max(x, y); return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum; } function clamp(number, x, y) { @@ -347,13 +344,11 @@ var EVENT_MOUNTED = "mounted"; var EVENT_READY = "ready"; var EVENT_MOVE = "move"; var EVENT_MOVED = "moved"; -var EVENT_SHIFTED = "shifted"; var EVENT_CLICK = "click"; var EVENT_ACTIVE = "active"; var EVENT_INACTIVE = "inactive"; var EVENT_VISIBLE = "visible"; var EVENT_HIDDEN = "hidden"; -var EVENT_SLIDE_KEYDOWN = "slide:keydown"; var EVENT_REFRESH = "refresh"; var EVENT_UPDATED = "updated"; var EVENT_RESIZE = "resize"; @@ -363,6 +358,7 @@ var EVENT_DRAGGING = "dragging"; var EVENT_DRAGGED = "dragged"; var EVENT_SCROLL = "scroll"; var EVENT_SCROLLED = "scrolled"; +var EVENT_OVERFLOW = "overflow"; var EVENT_DESTROY = "destroy"; var EVENT_ARROWS_MOUNTED = "arrows:mounted"; var EVENT_ARROWS_UPDATED = "arrows:updated"; @@ -373,6 +369,9 @@ var EVENT_AUTOPLAY_PLAY = "autoplay:play"; var EVENT_AUTOPLAY_PLAYING = "autoplay:playing"; var EVENT_AUTOPLAY_PAUSE = "autoplay:pause"; var EVENT_LAZYLOAD_LOADED = "lazyload:loaded"; +var EVENT_SLIDE_KEYDOWN = "sk"; +var EVENT_SHIFTED = "sh"; +var EVENT_END_INDEX_CHANGED = "ei"; function EventInterface(Splide2) { var bus = Splide2 ? Splide2.event.bus : document.createDocumentFragment(); var binder = EventBinder(); @@ -412,14 +411,14 @@ function RequestInterval(interval, onInterval, onUpdate, limit) { return pause(); } } - raf(update); + id = raf(update); } } function start(resume) { - !resume && cancel(); + resume || cancel(); startTime = now() - (resume ? rate * interval : 0); paused = false; - raf(update); + id = raf(update); } function pause() { paused = true; @@ -466,17 +465,10 @@ function State(initialState) { }; } function Throttle(func, duration) { - var interval; - function throttled() { - if (!interval) { - interval = RequestInterval(duration || 0, function() { - func(); - interval = null; - }, null, 1); - interval.start(); - } - } - return throttled; + var interval = RequestInterval(duration || 0, func, null, 1); + return function() { + interval.isPaused() && interval.start(); + }; } function Media(Splide2, Components2, options) { var state = Splide2.state; @@ -526,10 +518,10 @@ function Media(Splide2, Components2, options) { enable ? merge$1(options, reducedMotion) : omit(options, ownKeys(reducedMotion)); } } - function set(opts, user) { + function set(opts, base, notify) { merge$1(options, opts); - user && merge$1(Object.getPrototypeOf(options), opts); - if (!state.is(CREATED)) { + base && merge$1(Object.getPrototypeOf(options), opts); + if (notify || !state.is(CREATED)) { Splide2.emit(EVENT_UPDATED, options); } } @@ -590,31 +582,34 @@ var ARIA_LIVE = ARIA_PREFIX + "live"; var ARIA_BUSY = ARIA_PREFIX + "busy"; var ARIA_ATOMIC = ARIA_PREFIX + "atomic"; var ALL_ATTRIBUTES = [ROLE, TAB_INDEX, DISABLED, ARIA_CONTROLS, ARIA_CURRENT, ARIA_LABEL, ARIA_LABELLEDBY, ARIA_HIDDEN, ARIA_ORIENTATION, ARIA_ROLEDESCRIPTION]; +var CLASS_PREFIX = PROJECT_CODE + "__"; +var STATUS_CLASS_PREFIX = "is-"; var CLASS_ROOT = PROJECT_CODE; -var CLASS_TRACK = PROJECT_CODE + "__track"; -var CLASS_LIST = PROJECT_CODE + "__list"; -var CLASS_SLIDE = PROJECT_CODE + "__slide"; +var CLASS_TRACK = CLASS_PREFIX + "track"; +var CLASS_LIST = CLASS_PREFIX + "list"; +var CLASS_SLIDE = CLASS_PREFIX + "slide"; var CLASS_CLONE = CLASS_SLIDE + "--clone"; var CLASS_CONTAINER = CLASS_SLIDE + "__container"; -var CLASS_ARROWS = PROJECT_CODE + "__arrows"; -var CLASS_ARROW = PROJECT_CODE + "__arrow"; +var CLASS_ARROWS = CLASS_PREFIX + "arrows"; +var CLASS_ARROW = CLASS_PREFIX + "arrow"; var CLASS_ARROW_PREV = CLASS_ARROW + "--prev"; var CLASS_ARROW_NEXT = CLASS_ARROW + "--next"; -var CLASS_PAGINATION = PROJECT_CODE + "__pagination"; +var CLASS_PAGINATION = CLASS_PREFIX + "pagination"; var CLASS_PAGINATION_PAGE = CLASS_PAGINATION + "__page"; -var CLASS_PROGRESS = PROJECT_CODE + "__progress"; +var CLASS_PROGRESS = CLASS_PREFIX + "progress"; var CLASS_PROGRESS_BAR = CLASS_PROGRESS + "__bar"; -var CLASS_TOGGLE = PROJECT_CODE + "__toggle"; -var CLASS_SPINNER = PROJECT_CODE + "__spinner"; -var CLASS_SR = PROJECT_CODE + "__sr"; -var CLASS_INITIALIZED = "is-initialized"; -var CLASS_ACTIVE = "is-active"; -var CLASS_PREV = "is-prev"; -var CLASS_NEXT = "is-next"; -var CLASS_VISIBLE = "is-visible"; -var CLASS_LOADING = "is-loading"; -var CLASS_FOCUS_IN = "is-focus-in"; -var STATUS_CLASSES = [CLASS_ACTIVE, CLASS_VISIBLE, CLASS_PREV, CLASS_NEXT, CLASS_LOADING, CLASS_FOCUS_IN]; +var CLASS_TOGGLE = CLASS_PREFIX + "toggle"; +var CLASS_SPINNER = CLASS_PREFIX + "spinner"; +var CLASS_SR = CLASS_PREFIX + "sr"; +var CLASS_INITIALIZED = STATUS_CLASS_PREFIX + "initialized"; +var CLASS_ACTIVE = STATUS_CLASS_PREFIX + "active"; +var CLASS_PREV = STATUS_CLASS_PREFIX + "prev"; +var CLASS_NEXT = STATUS_CLASS_PREFIX + "next"; +var CLASS_VISIBLE = STATUS_CLASS_PREFIX + "visible"; +var CLASS_LOADING = STATUS_CLASS_PREFIX + "loading"; +var CLASS_FOCUS_IN = STATUS_CLASS_PREFIX + "focus-in"; +var CLASS_OVERFLOW = STATUS_CLASS_PREFIX + "overflow"; +var STATUS_CLASSES = [CLASS_ACTIVE, CLASS_VISIBLE, CLASS_PREV, CLASS_NEXT, CLASS_LOADING, CLASS_FOCUS_IN, CLASS_OVERFLOW]; var CLASSES = { slide: CLASS_SLIDE, clone: CLASS_CLONE, @@ -995,6 +990,7 @@ function Layout(Splide2, Components2, options) { var getAt = Slides2.getAt, styleSlides = Slides2.style; var vertical; var rootRect; + var overflow; function mount() { init(); bind(window, "resize load", Throttle(apply(emit, EVENT_RESIZE))); @@ -1002,22 +998,25 @@ function Layout(Splide2, Components2, options) { on(EVENT_RESIZE, resize); } function init() { - rootRect = null; vertical = options.direction === TTB; style(root, "maxWidth", unit(options.width)); style(track, resolve("paddingLeft"), cssPadding(false)); style(track, resolve("paddingRight"), cssPadding(true)); - resize(); + resize(true); } - function resize() { + function resize(force) { var newRect = rect(root); - if (!rootRect || rootRect.width !== newRect.width || rootRect.height !== newRect.height) { + if (force || rootRect.width !== newRect.width || rootRect.height !== newRect.height) { style(track, "height", cssTrackHeight()); styleSlides(resolve("marginRight"), unit(options.gap)); styleSlides("width", cssSlideWidth()); styleSlides("height", cssSlideHeight(), true); rootRect = newRect; emit(EVENT_RESIZED); + if (overflow !== (overflow = isOverflow())) { + toggleClass(root, CLASS_OVERFLOW, overflow); + emit(EVENT_OVERFLOW, overflow); + } } } function cssPadding(right) { @@ -1063,8 +1062,8 @@ function Layout(Splide2, Components2, options) { } return 0; } - function sliderSize() { - return totalSize(Splide2.length - 1, true) - totalSize(-1, true); + function sliderSize(withoutGap) { + return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap); } function getGap() { var Slide2 = getAt(0); @@ -1073,41 +1072,51 @@ function Layout(Splide2, Components2, options) { function getPadding(right) { return parseFloat(style(track, resolve("padding" + (right ? "Right" : "Left")))) || 0; } + function isOverflow() { + return Splide2.is(FADE) || sliderSize(true) > listSize(); + } return { mount, + resize, listSize, slideSize, sliderSize, totalSize, - getPadding + getPadding, + isOverflow }; } var MULTIPLIER = 2; function Clones(Splide2, Components2, options) { - var _EventInterface4 = EventInterface(Splide2), on = _EventInterface4.on, emit = _EventInterface4.emit; + var event = EventInterface(Splide2); + var on = event.on; var Elements2 = Components2.Elements, Slides2 = Components2.Slides; var resolve = Components2.Direction.resolve; var clones = []; var cloneCount; function mount() { - init(); - on(EVENT_REFRESH, destroy); - on(EVENT_REFRESH, init); + on(EVENT_REFRESH, remount); on([EVENT_UPDATED, EVENT_RESIZE], observe); - } - function init() { if (cloneCount = computeCloneCount()) { generate(cloneCount); - emit(EVENT_RESIZE); + Components2.Layout.resize(true); } } + function remount() { + destroy(); + mount(); + } function destroy() { remove(clones); empty(clones); + event.destroy(); } function observe() { - if (cloneCount < computeCloneCount()) { - emit(EVENT_REFRESH); + var count = computeCloneCount(); + if (cloneCount !== count) { + if (cloneCount < count || !count) { + event.emit(EVENT_REFRESH); + } } } function generate(count) { @@ -1136,7 +1145,7 @@ function Clones(Splide2, Components2, options) { var clones2 = options.clones; if (!Splide2.is(LOOP)) { clones2 = 0; - } else if (!clones2) { + } else if (isUndefined(clones2)) { var fixedSize = options[resolve("fixedWidth")] && Components2.Layout.slideSize(0); var fixedCount = fixedSize && ceil(rect(Elements2.track)[resolve("width")] / fixedSize); clones2 = fixedCount || options[resolve("autoWidth")] && Splide2.length || options.perPage * MULTIPLIER; @@ -1149,7 +1158,7 @@ function Clones(Splide2, Components2, options) { }; } function Move(Splide2, Components2, options) { - var _EventInterface5 = EventInterface(Splide2), on = _EventInterface5.on, emit = _EventInterface5.emit; + var _EventInterface4 = EventInterface(Splide2), on = _EventInterface4.on, emit = _EventInterface4.emit; var set = Splide2.state.set; var _Components2$Layout = Components2.Layout, slideSize = _Components2$Layout.slideSize, getPadding = _Components2$Layout.getPadding, totalSize = _Components2$Layout.totalSize, listSize = _Components2$Layout.listSize, sliderSize = _Components2$Layout.sliderSize; var _Components2$Directio = Components2.Direction, resolve = _Components2$Directio.resolve, orient = _Components2$Directio.orient; @@ -1207,7 +1216,7 @@ function Move(Splide2, Components2, options) { return position; } function cancel() { - translate(getPosition()); + translate(getPosition(), true); Transition.cancel(); } function toIndex(position) { @@ -1236,7 +1245,7 @@ function Move(Splide2, Components2, options) { } function trim(position) { if (options.trimSpace && Splide2.is(SLIDE)) { - position = clamp(position, 0, orient(sliderSize() - listSize())); + position = clamp(position, 0, orient(sliderSize(true) - listSize())); } return position; } @@ -1273,33 +1282,42 @@ function Move(Splide2, Components2, options) { }; } function Controller(Splide2, Components2, options) { - var _EventInterface6 = EventInterface(Splide2), on = _EventInterface6.on; + var _EventInterface5 = EventInterface(Splide2), on = _EventInterface5.on, emit = _EventInterface5.emit; var Move2 = Components2.Move; var getPosition = Move2.getPosition, getLimit = Move2.getLimit, toPosition = Move2.toPosition; var _Components2$Slides = Components2.Slides, isEnough = _Components2$Slides.isEnough, getLength = _Components2$Slides.getLength; + var omitEnd = options.omitEnd; var isLoop = Splide2.is(LOOP); var isSlide = Splide2.is(SLIDE); var getNext = apply(getAdjacent, false); var getPrev = apply(getAdjacent, true); var currIndex = options.start || 0; + var endIndex; var prevIndex = currIndex; var slideCount; var perMove; var perPage; function mount() { init(); - on([EVENT_UPDATED, EVENT_REFRESH], init); + on([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], init); + on(EVENT_RESIZED, onResized); } function init() { slideCount = getLength(true); perMove = options.perMove; perPage = options.perPage; - var index = clamp(currIndex, 0, slideCount - 1); + endIndex = getEnd(); + var index = clamp(currIndex, 0, omitEnd ? endIndex : slideCount - 1); if (index !== currIndex) { currIndex = index; Move2.reposition(); } } + function onResized() { + if (endIndex !== getEnd()) { + emit(EVENT_END_INDEX_CHANGED); + } + } function go(control, allowSameIndex, callback) { if (!isBusy()) { var dest = parse(control); @@ -1312,7 +1330,8 @@ function Controller(Splide2, Components2, options) { } function scroll(destination, duration, snap, callback) { Components2.Scroll.scroll(destination, duration, snap, function() { - setIndex(loop(Move2.toIndex(getPosition()))); + var index = loop(Move2.toIndex(getPosition())); + setIndex(omitEnd ? min(index, endIndex) : index); callback && callback(); }); } @@ -1328,7 +1347,7 @@ function Controller(Splide2, Components2, options) { index = getPrev(true); } } else { - index = isLoop ? control : clamp(control, 0, getEnd()); + index = isLoop ? control : clamp(control, 0, endIndex); } return index; } @@ -1337,28 +1356,27 @@ function Controller(Splide2, Components2, options) { var dest = computeDestIndex(currIndex + number * (prev ? -1 : 1), currIndex, !(perMove || hasFocus())); if (dest === -1 && isSlide) { if (!approximatelyEqual(getPosition(), getLimit(!prev), 1)) { - return prev ? 0 : getEnd(); + return prev ? 0 : endIndex; } } return destination ? dest : loop(dest); } function computeDestIndex(dest, from, snapPage) { if (isEnough() || hasFocus()) { - var end = getEnd(); var index = computeMovableDestIndex(dest); if (index !== dest) { from = dest; dest = index; snapPage = false; } - if (dest < 0 || dest > end) { - if (!perMove && (between(0, dest, from, true) || between(end, from, dest, true))) { + if (dest < 0 || dest > endIndex) { + if (!perMove && (between(0, dest, from, true) || between(endIndex, from, dest, true))) { dest = toIndex(toPage(dest)); } else { if (isLoop) { dest = snapPage ? dest < 0 ? -(slideCount % perPage || perPage) : slideCount : dest; } else if (options.rewind) { - dest = dest < 0 ? end : 0; + dest = dest < 0 ? endIndex : 0; } else { dest = -1; } @@ -1386,17 +1404,24 @@ function Controller(Splide2, Components2, options) { return isLoop ? (index + slideCount) % slideCount || 0 : index; } function getEnd() { - return max(slideCount - (hasFocus() || isLoop && perMove ? 1 : perPage), 0); + var end = slideCount - (hasFocus() || isLoop && perMove ? 1 : perPage); + while (omitEnd && end-- > 0) { + if (toPosition(slideCount - 1, true) !== toPosition(end, true)) { + end++; + break; + } + } + return clamp(end, 0, slideCount - 1); } function toIndex(page) { - return clamp(hasFocus() ? page : perPage * page, 0, getEnd()); + return clamp(hasFocus() ? page : perPage * page, 0, endIndex); } function toPage(index) { - return hasFocus() ? index : floor((index >= getEnd() ? slideCount - 1 : index) / perPage); + return hasFocus() ? min(index, endIndex) : floor((index >= endIndex ? slideCount - 1 : index) / perPage); } function toDest(destination) { var closest2 = Move2.toIndex(destination); - return isSlide ? clamp(closest2, 0, getEnd()) : closest2; + return isSlide ? clamp(closest2, 0, endIndex) : closest2; } function setIndex(index) { if (index !== currIndex) { @@ -1484,7 +1509,7 @@ function Arrows(Splide2, Components2, options) { } } function listen() { - on([EVENT_MOVED, EVENT_REFRESH, EVENT_SCROLLED], update); + on([EVENT_MOUNTED, EVENT_MOVED, EVENT_REFRESH, EVENT_SCROLLED, EVENT_END_INDEX_CHANGED], update); bind(next, "click", apply(go, ">")); bind(prev, "click", apply(go, "<")); } @@ -1504,16 +1529,18 @@ function Arrows(Splide2, Components2, options) { return parseHtml(arrow); } function update() { - var index = Splide2.index; - var prevIndex = Controller2.getPrev(); - var nextIndex = Controller2.getNext(); - var prevLabel = prevIndex > -1 && index < prevIndex ? i18n.last : i18n.prev; - var nextLabel = nextIndex > -1 && index > nextIndex ? i18n.first : i18n.next; - prev.disabled = prevIndex < 0; - next.disabled = nextIndex < 0; - setAttribute(prev, ARIA_LABEL, prevLabel); - setAttribute(next, ARIA_LABEL, nextLabel); - emit(EVENT_ARROWS_UPDATED, prev, next, prevIndex, nextIndex); + if (prev && next) { + var index = Splide2.index; + var prevIndex = Controller2.getPrev(); + var nextIndex = Controller2.getNext(); + var prevLabel = prevIndex > -1 && index < prevIndex ? i18n.last : i18n.prev; + var nextLabel = nextIndex > -1 && index > nextIndex ? i18n.first : i18n.next; + prev.disabled = prevIndex < 0; + next.disabled = nextIndex < 0; + setAttribute(prev, ARIA_LABEL, prevLabel); + setAttribute(next, ARIA_LABEL, nextLabel); + emit(EVENT_ARROWS_UPDATED, prev, next, prevIndex, nextIndex); + } } return { arrows, @@ -1524,7 +1551,7 @@ function Arrows(Splide2, Components2, options) { } var INTERVAL_DATA_ATTRIBUTE = DATA_ATTRIBUTE + "-interval"; function Autoplay(Splide2, Components2, options) { - var _EventInterface7 = EventInterface(Splide2), on = _EventInterface7.on, bind = _EventInterface7.bind, emit = _EventInterface7.emit; + var _EventInterface6 = EventInterface(Splide2), on = _EventInterface6.on, bind = _EventInterface6.bind, emit = _EventInterface6.emit; var interval = RequestInterval(options.interval, Splide2.go.bind(Splide2, ">"), onAnimationFrame); var isPaused = interval.isPaused; var Elements2 = Components2.Elements, _Components2$Elements4 = Components2.Elements, root = _Components2$Elements4.root, toggle = _Components2$Elements4.toggle; @@ -1609,7 +1636,7 @@ function Autoplay(Splide2, Components2, options) { }; } function Cover(Splide2, Components2, options) { - var _EventInterface8 = EventInterface(Splide2), on = _EventInterface8.on; + var _EventInterface7 = EventInterface(Splide2), on = _EventInterface7.on; function mount() { if (options.cover) { on(EVENT_LAZYLOAD_LOADED, apply(toggle, true)); @@ -1639,7 +1666,7 @@ var FRICTION_FACTOR = 0.6; var BASE_VELOCITY = 1.5; var MIN_DURATION = 800; function Scroll(Splide2, Components2, options) { - var _EventInterface9 = EventInterface(Splide2), on = _EventInterface9.on, emit = _EventInterface9.emit; + var _EventInterface8 = EventInterface(Splide2), on = _EventInterface8.on, emit = _EventInterface8.emit; var set = Splide2.state.set; var Move2 = Components2.Move; var getPosition = Move2.getPosition, getLimit = Move2.getLimit, exceededLimit = Move2.exceededLimit, translate = Move2.translate; @@ -1712,7 +1739,7 @@ var SCROLL_LISTENER_OPTIONS = { capture: true }; function Drag(Splide2, Components2, options) { - var _EventInterface10 = EventInterface(Splide2), on = _EventInterface10.on, emit = _EventInterface10.emit, bind = _EventInterface10.bind, unbind = _EventInterface10.unbind; + var _EventInterface9 = EventInterface(Splide2), on = _EventInterface9.on, emit = _EventInterface9.emit, bind = _EventInterface9.bind, unbind = _EventInterface9.unbind; var state = Splide2.state; var Move2 = Components2.Move, Scroll2 = Components2.Scroll, Controller2 = Components2.Controller, track = Components2.Elements.track, reduce = Components2.Media.reduce; var _Components2$Directio2 = Components2.Direction, resolve = _Components2$Directio2.resolve, orient = _Components2$Directio2.orient; @@ -1891,7 +1918,7 @@ function normalizeKey(key) { } var KEYBOARD_EVENT = "keydown"; function Keyboard(Splide2, Components2, options) { - var _EventInterface11 = EventInterface(Splide2), on = _EventInterface11.on, bind = _EventInterface11.bind, unbind = _EventInterface11.unbind; + var _EventInterface10 = EventInterface(Splide2), on = _EventInterface10.on, bind = _EventInterface10.bind, unbind = _EventInterface10.unbind; var root = Splide2.root; var resolve = Components2.Direction.resolve; var target; @@ -1942,7 +1969,7 @@ var SRC_DATA_ATTRIBUTE = DATA_ATTRIBUTE + "-lazy"; var SRCSET_DATA_ATTRIBUTE = SRC_DATA_ATTRIBUTE + "-srcset"; var IMAGE_SELECTOR = "[" + SRC_DATA_ATTRIBUTE + "], [" + SRCSET_DATA_ATTRIBUTE + "]"; function LazyLoad(Splide2, Components2, options) { - var _EventInterface12 = EventInterface(Splide2), on = _EventInterface12.on, off = _EventInterface12.off, bind = _EventInterface12.bind, emit = _EventInterface12.emit; + var _EventInterface11 = EventInterface(Splide2), on = _EventInterface11.on, off = _EventInterface11.off, bind = _EventInterface11.bind, emit = _EventInterface11.emit; var isSequential = options.lazyLoad === "sequential"; var events = [EVENT_MOVED, EVENT_SCROLLED]; var entries = []; @@ -2026,8 +2053,8 @@ function Pagination(Splide2, Components2, options) { var paginationClasses; function mount() { destroy(); - on([EVENT_UPDATED, EVENT_REFRESH], mount); - var enabled = options.pagination && Slides2.isEnough(); + on([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], mount); + var enabled = options.pagination; placeholder && display(placeholder, enabled ? "" : "none"); if (enabled) { on([EVENT_MOVE, EVENT_SCROLL, EVENT_SCROLLED], update); @@ -2051,7 +2078,7 @@ function Pagination(Splide2, Components2, options) { function createPagination() { var length = Splide2.length; var classes = options.classes, i18n = options.i18n, perPage = options.perPage; - var max2 = hasFocus() ? length : ceil(length / perPage); + var max2 = hasFocus() ? Controller2.getEnd() + 1 : ceil(length / perPage); list = placeholder || create("ul", classes.pagination, Elements2.track.parentElement); addClass(list, paginationClasses = CLASS_PAGINATION + "--" + getDirection()); setAttribute(list, ROLE, "tablist"); @@ -2145,11 +2172,6 @@ var TRIGGER_KEYS = [" ", "Enter"]; function Sync(Splide2, Components2, options) { var isNavigation = options.isNavigation, slideFocus = options.slideFocus; var events = []; - function setup() { - Splide2.options = { - slideFocus: isUndefined(slideFocus) ? isNavigation : slideFocus - }; - } function mount() { Splide2.splides.forEach(function(target) { if (!target.isParent) { @@ -2200,14 +2222,16 @@ function Sync(Splide2, Components2, options) { } } return { - setup, + setup: apply(Components2.Media.set, { + slideFocus: isUndefined(slideFocus) ? isNavigation : slideFocus + }, true), mount, destroy, remount }; } function Wheel(Splide2, Components2, options) { - var _EventInterface13 = EventInterface(Splide2), bind = _EventInterface13.bind; + var _EventInterface12 = EventInterface(Splide2), bind = _EventInterface12.bind; var lastTime = 0; function mount() { if (options.wheel) { @@ -2237,7 +2261,7 @@ function Wheel(Splide2, Components2, options) { } var SR_REMOVAL_DELAY = 90; function Live(Splide2, Components2, options) { - var _EventInterface14 = EventInterface(Splide2), on = _EventInterface14.on; + var _EventInterface13 = EventInterface(Splide2), on = _EventInterface13.on; var track = Components2.Elements.track; var enabled = options.live && !options.isNavigation; var sr = create("span", CLASS_SR); @@ -2259,6 +2283,7 @@ function Live(Splide2, Components2, options) { interval.start(); } else { remove(sr); + interval.cancel(); } } function destroy() { @@ -2340,21 +2365,18 @@ var DEFAULTS = { } }; function Fade(Splide2, Components2, options) { - var _EventInterface15 = EventInterface(Splide2), on = _EventInterface15.on; + var Slides2 = Components2.Slides; function mount() { - on([EVENT_MOUNTED, EVENT_REFRESH], function() { - nextTick(function() { - Components2.Slides.style("transition", "opacity " + options.speed + "ms " + options.easing); - }); + EventInterface(Splide2).on([EVENT_MOUNTED, EVENT_REFRESH], init); + } + function init() { + Slides2.forEach(function(Slide2) { + Slide2.style("transform", "translateX(-" + 100 * Slide2.index + "%)"); }); } function start(index, done) { - var track = Components2.Elements.track; - style(track, "height", unit(rect(track).height)); - nextTick(function() { - done(); - style(track, "height", ""); - }); + Slides2.style("transition", "opacity " + options.speed + "ms " + options.easing); + nextTick(done); } return { mount, @@ -2363,13 +2385,12 @@ function Fade(Splide2, Components2, options) { }; } function Slide(Splide2, Components2, options) { - var _EventInterface16 = EventInterface(Splide2), bind = _EventInterface16.bind; var Move2 = Components2.Move, Controller2 = Components2.Controller, Scroll2 = Components2.Scroll; var list = Components2.Elements.list; var transition = apply(style, list, "transition"); var endCallback; function mount() { - bind(list, "transitionend", function(e) { + EventInterface(Splide2).bind(list, "transitionend", function(e) { if (e.target === list && endCallback) { cancel(); endCallback(); @@ -2532,7 +2553,7 @@ var _Splide = /* @__PURE__ */ function() { return this._o; }, set: function set(options) { - this._C.Media.set(options, true); + this._C.Media.set(options, true, true); } }, { key: "length", diff --git a/dist/js/vue-splide.esm.js b/dist/js/vue-splide.esm.js index d6a83b8..72c24de 100644 --- a/dist/js/vue-splide.esm.js +++ b/dist/js/vue-splide.esm.js @@ -19,7 +19,7 @@ function _createClass(Constructor, protoProps, staticProps) { } /*! * Splide.js - * Version : 4.0.17 + * Version : 4.1.3 * License : MIT * Copyright: 2022 Naotoshi Fujita */ @@ -69,7 +69,11 @@ function isNull(subject) { return subject === null; } function isHTMLElement(subject) { - return subject instanceof HTMLElement; + try { + return subject instanceof (subject.ownerDocument.defaultView || window).HTMLElement; + } catch (e) { + return false; + } } function toArray(value) { return isArray(value) ? value : [value]; @@ -122,16 +126,9 @@ function child(parent, selector) { var ownKeys = Object.keys; function forOwn$1(object, iteratee, right) { if (object) { - var keys = ownKeys(object); - keys = right ? keys.reverse() : keys; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key !== "__proto__") { - if (iteratee(object[key], key) === false) { - break; - } - } - } + (right ? ownKeys(object).reverse() : ownKeys(object)).forEach(function(key) { + key !== "__proto__" && iteratee(object[key], key); + }); } return object; } @@ -158,7 +155,7 @@ function merge$1(object) { return object; } function omit(object, keys) { - toArray(keys || ownKeys(object)).forEach(function(key) { + forEach(keys || ownKeys(object), function(key) { delete object[key]; }); } @@ -256,9 +253,9 @@ var min = Math.min, max = Math.max, floor = Math.floor, ceil = Math.ceil, abs = function approximatelyEqual(x, y, epsilon) { return abs(x - y) < epsilon; } -function between(number, minOrMax, maxOrMin, exclusive) { - var minimum = min(minOrMax, maxOrMin); - var maximum = max(minOrMax, maxOrMin); +function between(number, x, y, exclusive) { + var minimum = min(x, y); + var maximum = max(x, y); return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum; } function clamp(number, x, y) { @@ -345,13 +342,11 @@ var EVENT_MOUNTED = "mounted"; var EVENT_READY = "ready"; var EVENT_MOVE = "move"; var EVENT_MOVED = "moved"; -var EVENT_SHIFTED = "shifted"; var EVENT_CLICK = "click"; var EVENT_ACTIVE = "active"; var EVENT_INACTIVE = "inactive"; var EVENT_VISIBLE = "visible"; var EVENT_HIDDEN = "hidden"; -var EVENT_SLIDE_KEYDOWN = "slide:keydown"; var EVENT_REFRESH = "refresh"; var EVENT_UPDATED = "updated"; var EVENT_RESIZE = "resize"; @@ -361,6 +356,7 @@ var EVENT_DRAGGING = "dragging"; var EVENT_DRAGGED = "dragged"; var EVENT_SCROLL = "scroll"; var EVENT_SCROLLED = "scrolled"; +var EVENT_OVERFLOW = "overflow"; var EVENT_DESTROY = "destroy"; var EVENT_ARROWS_MOUNTED = "arrows:mounted"; var EVENT_ARROWS_UPDATED = "arrows:updated"; @@ -371,6 +367,9 @@ var EVENT_AUTOPLAY_PLAY = "autoplay:play"; var EVENT_AUTOPLAY_PLAYING = "autoplay:playing"; var EVENT_AUTOPLAY_PAUSE = "autoplay:pause"; var EVENT_LAZYLOAD_LOADED = "lazyload:loaded"; +var EVENT_SLIDE_KEYDOWN = "sk"; +var EVENT_SHIFTED = "sh"; +var EVENT_END_INDEX_CHANGED = "ei"; function EventInterface(Splide2) { var bus = Splide2 ? Splide2.event.bus : document.createDocumentFragment(); var binder = EventBinder(); @@ -410,14 +409,14 @@ function RequestInterval(interval, onInterval, onUpdate, limit) { return pause(); } } - raf(update); + id = raf(update); } } function start(resume) { - !resume && cancel(); + resume || cancel(); startTime = now() - (resume ? rate * interval : 0); paused = false; - raf(update); + id = raf(update); } function pause() { paused = true; @@ -464,17 +463,10 @@ function State(initialState) { }; } function Throttle(func, duration) { - var interval; - function throttled() { - if (!interval) { - interval = RequestInterval(duration || 0, function() { - func(); - interval = null; - }, null, 1); - interval.start(); - } - } - return throttled; + var interval = RequestInterval(duration || 0, func, null, 1); + return function() { + interval.isPaused() && interval.start(); + }; } function Media(Splide2, Components2, options) { var state = Splide2.state; @@ -524,10 +516,10 @@ function Media(Splide2, Components2, options) { enable ? merge$1(options, reducedMotion) : omit(options, ownKeys(reducedMotion)); } } - function set(opts, user) { + function set(opts, base, notify) { merge$1(options, opts); - user && merge$1(Object.getPrototypeOf(options), opts); - if (!state.is(CREATED)) { + base && merge$1(Object.getPrototypeOf(options), opts); + if (notify || !state.is(CREATED)) { Splide2.emit(EVENT_UPDATED, options); } } @@ -588,31 +580,34 @@ var ARIA_LIVE = ARIA_PREFIX + "live"; var ARIA_BUSY = ARIA_PREFIX + "busy"; var ARIA_ATOMIC = ARIA_PREFIX + "atomic"; var ALL_ATTRIBUTES = [ROLE, TAB_INDEX, DISABLED, ARIA_CONTROLS, ARIA_CURRENT, ARIA_LABEL, ARIA_LABELLEDBY, ARIA_HIDDEN, ARIA_ORIENTATION, ARIA_ROLEDESCRIPTION]; +var CLASS_PREFIX = PROJECT_CODE + "__"; +var STATUS_CLASS_PREFIX = "is-"; var CLASS_ROOT = PROJECT_CODE; -var CLASS_TRACK = PROJECT_CODE + "__track"; -var CLASS_LIST = PROJECT_CODE + "__list"; -var CLASS_SLIDE = PROJECT_CODE + "__slide"; +var CLASS_TRACK = CLASS_PREFIX + "track"; +var CLASS_LIST = CLASS_PREFIX + "list"; +var CLASS_SLIDE = CLASS_PREFIX + "slide"; var CLASS_CLONE = CLASS_SLIDE + "--clone"; var CLASS_CONTAINER = CLASS_SLIDE + "__container"; -var CLASS_ARROWS = PROJECT_CODE + "__arrows"; -var CLASS_ARROW = PROJECT_CODE + "__arrow"; +var CLASS_ARROWS = CLASS_PREFIX + "arrows"; +var CLASS_ARROW = CLASS_PREFIX + "arrow"; var CLASS_ARROW_PREV = CLASS_ARROW + "--prev"; var CLASS_ARROW_NEXT = CLASS_ARROW + "--next"; -var CLASS_PAGINATION = PROJECT_CODE + "__pagination"; +var CLASS_PAGINATION = CLASS_PREFIX + "pagination"; var CLASS_PAGINATION_PAGE = CLASS_PAGINATION + "__page"; -var CLASS_PROGRESS = PROJECT_CODE + "__progress"; +var CLASS_PROGRESS = CLASS_PREFIX + "progress"; var CLASS_PROGRESS_BAR = CLASS_PROGRESS + "__bar"; -var CLASS_TOGGLE = PROJECT_CODE + "__toggle"; -var CLASS_SPINNER = PROJECT_CODE + "__spinner"; -var CLASS_SR = PROJECT_CODE + "__sr"; -var CLASS_INITIALIZED = "is-initialized"; -var CLASS_ACTIVE = "is-active"; -var CLASS_PREV = "is-prev"; -var CLASS_NEXT = "is-next"; -var CLASS_VISIBLE = "is-visible"; -var CLASS_LOADING = "is-loading"; -var CLASS_FOCUS_IN = "is-focus-in"; -var STATUS_CLASSES = [CLASS_ACTIVE, CLASS_VISIBLE, CLASS_PREV, CLASS_NEXT, CLASS_LOADING, CLASS_FOCUS_IN]; +var CLASS_TOGGLE = CLASS_PREFIX + "toggle"; +var CLASS_SPINNER = CLASS_PREFIX + "spinner"; +var CLASS_SR = CLASS_PREFIX + "sr"; +var CLASS_INITIALIZED = STATUS_CLASS_PREFIX + "initialized"; +var CLASS_ACTIVE = STATUS_CLASS_PREFIX + "active"; +var CLASS_PREV = STATUS_CLASS_PREFIX + "prev"; +var CLASS_NEXT = STATUS_CLASS_PREFIX + "next"; +var CLASS_VISIBLE = STATUS_CLASS_PREFIX + "visible"; +var CLASS_LOADING = STATUS_CLASS_PREFIX + "loading"; +var CLASS_FOCUS_IN = STATUS_CLASS_PREFIX + "focus-in"; +var CLASS_OVERFLOW = STATUS_CLASS_PREFIX + "overflow"; +var STATUS_CLASSES = [CLASS_ACTIVE, CLASS_VISIBLE, CLASS_PREV, CLASS_NEXT, CLASS_LOADING, CLASS_FOCUS_IN, CLASS_OVERFLOW]; var CLASSES = { slide: CLASS_SLIDE, clone: CLASS_CLONE, @@ -993,6 +988,7 @@ function Layout(Splide2, Components2, options) { var getAt = Slides2.getAt, styleSlides = Slides2.style; var vertical; var rootRect; + var overflow; function mount() { init(); bind(window, "resize load", Throttle(apply(emit, EVENT_RESIZE))); @@ -1000,22 +996,25 @@ function Layout(Splide2, Components2, options) { on(EVENT_RESIZE, resize); } function init() { - rootRect = null; vertical = options.direction === TTB; style(root, "maxWidth", unit(options.width)); style(track, resolve("paddingLeft"), cssPadding(false)); style(track, resolve("paddingRight"), cssPadding(true)); - resize(); + resize(true); } - function resize() { + function resize(force) { var newRect = rect(root); - if (!rootRect || rootRect.width !== newRect.width || rootRect.height !== newRect.height) { + if (force || rootRect.width !== newRect.width || rootRect.height !== newRect.height) { style(track, "height", cssTrackHeight()); styleSlides(resolve("marginRight"), unit(options.gap)); styleSlides("width", cssSlideWidth()); styleSlides("height", cssSlideHeight(), true); rootRect = newRect; emit(EVENT_RESIZED); + if (overflow !== (overflow = isOverflow())) { + toggleClass(root, CLASS_OVERFLOW, overflow); + emit(EVENT_OVERFLOW, overflow); + } } } function cssPadding(right) { @@ -1061,8 +1060,8 @@ function Layout(Splide2, Components2, options) { } return 0; } - function sliderSize() { - return totalSize(Splide2.length - 1, true) - totalSize(-1, true); + function sliderSize(withoutGap) { + return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap); } function getGap() { var Slide2 = getAt(0); @@ -1071,41 +1070,51 @@ function Layout(Splide2, Components2, options) { function getPadding(right) { return parseFloat(style(track, resolve("padding" + (right ? "Right" : "Left")))) || 0; } + function isOverflow() { + return Splide2.is(FADE) || sliderSize(true) > listSize(); + } return { mount, + resize, listSize, slideSize, sliderSize, totalSize, - getPadding + getPadding, + isOverflow }; } var MULTIPLIER = 2; function Clones(Splide2, Components2, options) { - var _EventInterface4 = EventInterface(Splide2), on = _EventInterface4.on, emit = _EventInterface4.emit; + var event = EventInterface(Splide2); + var on = event.on; var Elements2 = Components2.Elements, Slides2 = Components2.Slides; var resolve = Components2.Direction.resolve; var clones = []; var cloneCount; function mount() { - init(); - on(EVENT_REFRESH, destroy); - on(EVENT_REFRESH, init); + on(EVENT_REFRESH, remount); on([EVENT_UPDATED, EVENT_RESIZE], observe); - } - function init() { if (cloneCount = computeCloneCount()) { generate(cloneCount); - emit(EVENT_RESIZE); + Components2.Layout.resize(true); } } + function remount() { + destroy(); + mount(); + } function destroy() { remove(clones); empty(clones); + event.destroy(); } function observe() { - if (cloneCount < computeCloneCount()) { - emit(EVENT_REFRESH); + var count = computeCloneCount(); + if (cloneCount !== count) { + if (cloneCount < count || !count) { + event.emit(EVENT_REFRESH); + } } } function generate(count) { @@ -1134,7 +1143,7 @@ function Clones(Splide2, Components2, options) { var clones2 = options.clones; if (!Splide2.is(LOOP)) { clones2 = 0; - } else if (!clones2) { + } else if (isUndefined(clones2)) { var fixedSize = options[resolve("fixedWidth")] && Components2.Layout.slideSize(0); var fixedCount = fixedSize && ceil(rect(Elements2.track)[resolve("width")] / fixedSize); clones2 = fixedCount || options[resolve("autoWidth")] && Splide2.length || options.perPage * MULTIPLIER; @@ -1147,7 +1156,7 @@ function Clones(Splide2, Components2, options) { }; } function Move(Splide2, Components2, options) { - var _EventInterface5 = EventInterface(Splide2), on = _EventInterface5.on, emit = _EventInterface5.emit; + var _EventInterface4 = EventInterface(Splide2), on = _EventInterface4.on, emit = _EventInterface4.emit; var set = Splide2.state.set; var _Components2$Layout = Components2.Layout, slideSize = _Components2$Layout.slideSize, getPadding = _Components2$Layout.getPadding, totalSize = _Components2$Layout.totalSize, listSize = _Components2$Layout.listSize, sliderSize = _Components2$Layout.sliderSize; var _Components2$Directio = Components2.Direction, resolve = _Components2$Directio.resolve, orient = _Components2$Directio.orient; @@ -1205,7 +1214,7 @@ function Move(Splide2, Components2, options) { return position; } function cancel() { - translate(getPosition()); + translate(getPosition(), true); Transition.cancel(); } function toIndex(position) { @@ -1234,7 +1243,7 @@ function Move(Splide2, Components2, options) { } function trim(position) { if (options.trimSpace && Splide2.is(SLIDE)) { - position = clamp(position, 0, orient(sliderSize() - listSize())); + position = clamp(position, 0, orient(sliderSize(true) - listSize())); } return position; } @@ -1271,33 +1280,42 @@ function Move(Splide2, Components2, options) { }; } function Controller(Splide2, Components2, options) { - var _EventInterface6 = EventInterface(Splide2), on = _EventInterface6.on; + var _EventInterface5 = EventInterface(Splide2), on = _EventInterface5.on, emit = _EventInterface5.emit; var Move2 = Components2.Move; var getPosition = Move2.getPosition, getLimit = Move2.getLimit, toPosition = Move2.toPosition; var _Components2$Slides = Components2.Slides, isEnough = _Components2$Slides.isEnough, getLength = _Components2$Slides.getLength; + var omitEnd = options.omitEnd; var isLoop = Splide2.is(LOOP); var isSlide = Splide2.is(SLIDE); var getNext = apply(getAdjacent, false); var getPrev = apply(getAdjacent, true); var currIndex = options.start || 0; + var endIndex; var prevIndex = currIndex; var slideCount; var perMove; var perPage; function mount() { init(); - on([EVENT_UPDATED, EVENT_REFRESH], init); + on([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], init); + on(EVENT_RESIZED, onResized); } function init() { slideCount = getLength(true); perMove = options.perMove; perPage = options.perPage; - var index = clamp(currIndex, 0, slideCount - 1); + endIndex = getEnd(); + var index = clamp(currIndex, 0, omitEnd ? endIndex : slideCount - 1); if (index !== currIndex) { currIndex = index; Move2.reposition(); } } + function onResized() { + if (endIndex !== getEnd()) { + emit(EVENT_END_INDEX_CHANGED); + } + } function go(control, allowSameIndex, callback) { if (!isBusy()) { var dest = parse(control); @@ -1310,7 +1328,8 @@ function Controller(Splide2, Components2, options) { } function scroll(destination, duration, snap, callback) { Components2.Scroll.scroll(destination, duration, snap, function() { - setIndex(loop(Move2.toIndex(getPosition()))); + var index = loop(Move2.toIndex(getPosition())); + setIndex(omitEnd ? min(index, endIndex) : index); callback && callback(); }); } @@ -1326,7 +1345,7 @@ function Controller(Splide2, Components2, options) { index = getPrev(true); } } else { - index = isLoop ? control : clamp(control, 0, getEnd()); + index = isLoop ? control : clamp(control, 0, endIndex); } return index; } @@ -1335,28 +1354,27 @@ function Controller(Splide2, Components2, options) { var dest = computeDestIndex(currIndex + number * (prev ? -1 : 1), currIndex, !(perMove || hasFocus())); if (dest === -1 && isSlide) { if (!approximatelyEqual(getPosition(), getLimit(!prev), 1)) { - return prev ? 0 : getEnd(); + return prev ? 0 : endIndex; } } return destination ? dest : loop(dest); } function computeDestIndex(dest, from, snapPage) { if (isEnough() || hasFocus()) { - var end = getEnd(); var index = computeMovableDestIndex(dest); if (index !== dest) { from = dest; dest = index; snapPage = false; } - if (dest < 0 || dest > end) { - if (!perMove && (between(0, dest, from, true) || between(end, from, dest, true))) { + if (dest < 0 || dest > endIndex) { + if (!perMove && (between(0, dest, from, true) || between(endIndex, from, dest, true))) { dest = toIndex(toPage(dest)); } else { if (isLoop) { dest = snapPage ? dest < 0 ? -(slideCount % perPage || perPage) : slideCount : dest; } else if (options.rewind) { - dest = dest < 0 ? end : 0; + dest = dest < 0 ? endIndex : 0; } else { dest = -1; } @@ -1384,17 +1402,24 @@ function Controller(Splide2, Components2, options) { return isLoop ? (index + slideCount) % slideCount || 0 : index; } function getEnd() { - return max(slideCount - (hasFocus() || isLoop && perMove ? 1 : perPage), 0); + var end = slideCount - (hasFocus() || isLoop && perMove ? 1 : perPage); + while (omitEnd && end-- > 0) { + if (toPosition(slideCount - 1, true) !== toPosition(end, true)) { + end++; + break; + } + } + return clamp(end, 0, slideCount - 1); } function toIndex(page) { - return clamp(hasFocus() ? page : perPage * page, 0, getEnd()); + return clamp(hasFocus() ? page : perPage * page, 0, endIndex); } function toPage(index) { - return hasFocus() ? index : floor((index >= getEnd() ? slideCount - 1 : index) / perPage); + return hasFocus() ? min(index, endIndex) : floor((index >= endIndex ? slideCount - 1 : index) / perPage); } function toDest(destination) { var closest2 = Move2.toIndex(destination); - return isSlide ? clamp(closest2, 0, getEnd()) : closest2; + return isSlide ? clamp(closest2, 0, endIndex) : closest2; } function setIndex(index) { if (index !== currIndex) { @@ -1482,7 +1507,7 @@ function Arrows(Splide2, Components2, options) { } } function listen() { - on([EVENT_MOVED, EVENT_REFRESH, EVENT_SCROLLED], update); + on([EVENT_MOUNTED, EVENT_MOVED, EVENT_REFRESH, EVENT_SCROLLED, EVENT_END_INDEX_CHANGED], update); bind(next, "click", apply(go, ">")); bind(prev, "click", apply(go, "<")); } @@ -1502,16 +1527,18 @@ function Arrows(Splide2, Components2, options) { return parseHtml(arrow); } function update() { - var index = Splide2.index; - var prevIndex = Controller2.getPrev(); - var nextIndex = Controller2.getNext(); - var prevLabel = prevIndex > -1 && index < prevIndex ? i18n.last : i18n.prev; - var nextLabel = nextIndex > -1 && index > nextIndex ? i18n.first : i18n.next; - prev.disabled = prevIndex < 0; - next.disabled = nextIndex < 0; - setAttribute(prev, ARIA_LABEL, prevLabel); - setAttribute(next, ARIA_LABEL, nextLabel); - emit(EVENT_ARROWS_UPDATED, prev, next, prevIndex, nextIndex); + if (prev && next) { + var index = Splide2.index; + var prevIndex = Controller2.getPrev(); + var nextIndex = Controller2.getNext(); + var prevLabel = prevIndex > -1 && index < prevIndex ? i18n.last : i18n.prev; + var nextLabel = nextIndex > -1 && index > nextIndex ? i18n.first : i18n.next; + prev.disabled = prevIndex < 0; + next.disabled = nextIndex < 0; + setAttribute(prev, ARIA_LABEL, prevLabel); + setAttribute(next, ARIA_LABEL, nextLabel); + emit(EVENT_ARROWS_UPDATED, prev, next, prevIndex, nextIndex); + } } return { arrows, @@ -1522,7 +1549,7 @@ function Arrows(Splide2, Components2, options) { } var INTERVAL_DATA_ATTRIBUTE = DATA_ATTRIBUTE + "-interval"; function Autoplay(Splide2, Components2, options) { - var _EventInterface7 = EventInterface(Splide2), on = _EventInterface7.on, bind = _EventInterface7.bind, emit = _EventInterface7.emit; + var _EventInterface6 = EventInterface(Splide2), on = _EventInterface6.on, bind = _EventInterface6.bind, emit = _EventInterface6.emit; var interval = RequestInterval(options.interval, Splide2.go.bind(Splide2, ">"), onAnimationFrame); var isPaused = interval.isPaused; var Elements2 = Components2.Elements, _Components2$Elements4 = Components2.Elements, root = _Components2$Elements4.root, toggle = _Components2$Elements4.toggle; @@ -1607,7 +1634,7 @@ function Autoplay(Splide2, Components2, options) { }; } function Cover(Splide2, Components2, options) { - var _EventInterface8 = EventInterface(Splide2), on = _EventInterface8.on; + var _EventInterface7 = EventInterface(Splide2), on = _EventInterface7.on; function mount() { if (options.cover) { on(EVENT_LAZYLOAD_LOADED, apply(toggle, true)); @@ -1637,7 +1664,7 @@ var FRICTION_FACTOR = 0.6; var BASE_VELOCITY = 1.5; var MIN_DURATION = 800; function Scroll(Splide2, Components2, options) { - var _EventInterface9 = EventInterface(Splide2), on = _EventInterface9.on, emit = _EventInterface9.emit; + var _EventInterface8 = EventInterface(Splide2), on = _EventInterface8.on, emit = _EventInterface8.emit; var set = Splide2.state.set; var Move2 = Components2.Move; var getPosition = Move2.getPosition, getLimit = Move2.getLimit, exceededLimit = Move2.exceededLimit, translate = Move2.translate; @@ -1710,7 +1737,7 @@ var SCROLL_LISTENER_OPTIONS = { capture: true }; function Drag(Splide2, Components2, options) { - var _EventInterface10 = EventInterface(Splide2), on = _EventInterface10.on, emit = _EventInterface10.emit, bind = _EventInterface10.bind, unbind = _EventInterface10.unbind; + var _EventInterface9 = EventInterface(Splide2), on = _EventInterface9.on, emit = _EventInterface9.emit, bind = _EventInterface9.bind, unbind = _EventInterface9.unbind; var state = Splide2.state; var Move2 = Components2.Move, Scroll2 = Components2.Scroll, Controller2 = Components2.Controller, track = Components2.Elements.track, reduce = Components2.Media.reduce; var _Components2$Directio2 = Components2.Direction, resolve = _Components2$Directio2.resolve, orient = _Components2$Directio2.orient; @@ -1889,7 +1916,7 @@ function normalizeKey(key) { } var KEYBOARD_EVENT = "keydown"; function Keyboard(Splide2, Components2, options) { - var _EventInterface11 = EventInterface(Splide2), on = _EventInterface11.on, bind = _EventInterface11.bind, unbind = _EventInterface11.unbind; + var _EventInterface10 = EventInterface(Splide2), on = _EventInterface10.on, bind = _EventInterface10.bind, unbind = _EventInterface10.unbind; var root = Splide2.root; var resolve = Components2.Direction.resolve; var target; @@ -1940,7 +1967,7 @@ var SRC_DATA_ATTRIBUTE = DATA_ATTRIBUTE + "-lazy"; var SRCSET_DATA_ATTRIBUTE = SRC_DATA_ATTRIBUTE + "-srcset"; var IMAGE_SELECTOR = "[" + SRC_DATA_ATTRIBUTE + "], [" + SRCSET_DATA_ATTRIBUTE + "]"; function LazyLoad(Splide2, Components2, options) { - var _EventInterface12 = EventInterface(Splide2), on = _EventInterface12.on, off = _EventInterface12.off, bind = _EventInterface12.bind, emit = _EventInterface12.emit; + var _EventInterface11 = EventInterface(Splide2), on = _EventInterface11.on, off = _EventInterface11.off, bind = _EventInterface11.bind, emit = _EventInterface11.emit; var isSequential = options.lazyLoad === "sequential"; var events = [EVENT_MOVED, EVENT_SCROLLED]; var entries = []; @@ -2024,8 +2051,8 @@ function Pagination(Splide2, Components2, options) { var paginationClasses; function mount() { destroy(); - on([EVENT_UPDATED, EVENT_REFRESH], mount); - var enabled = options.pagination && Slides2.isEnough(); + on([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], mount); + var enabled = options.pagination; placeholder && display(placeholder, enabled ? "" : "none"); if (enabled) { on([EVENT_MOVE, EVENT_SCROLL, EVENT_SCROLLED], update); @@ -2049,7 +2076,7 @@ function Pagination(Splide2, Components2, options) { function createPagination() { var length = Splide2.length; var classes = options.classes, i18n = options.i18n, perPage = options.perPage; - var max2 = hasFocus() ? length : ceil(length / perPage); + var max2 = hasFocus() ? Controller2.getEnd() + 1 : ceil(length / perPage); list = placeholder || create("ul", classes.pagination, Elements2.track.parentElement); addClass(list, paginationClasses = CLASS_PAGINATION + "--" + getDirection()); setAttribute(list, ROLE, "tablist"); @@ -2143,11 +2170,6 @@ var TRIGGER_KEYS = [" ", "Enter"]; function Sync(Splide2, Components2, options) { var isNavigation = options.isNavigation, slideFocus = options.slideFocus; var events = []; - function setup() { - Splide2.options = { - slideFocus: isUndefined(slideFocus) ? isNavigation : slideFocus - }; - } function mount() { Splide2.splides.forEach(function(target) { if (!target.isParent) { @@ -2198,14 +2220,16 @@ function Sync(Splide2, Components2, options) { } } return { - setup, + setup: apply(Components2.Media.set, { + slideFocus: isUndefined(slideFocus) ? isNavigation : slideFocus + }, true), mount, destroy, remount }; } function Wheel(Splide2, Components2, options) { - var _EventInterface13 = EventInterface(Splide2), bind = _EventInterface13.bind; + var _EventInterface12 = EventInterface(Splide2), bind = _EventInterface12.bind; var lastTime = 0; function mount() { if (options.wheel) { @@ -2235,7 +2259,7 @@ function Wheel(Splide2, Components2, options) { } var SR_REMOVAL_DELAY = 90; function Live(Splide2, Components2, options) { - var _EventInterface14 = EventInterface(Splide2), on = _EventInterface14.on; + var _EventInterface13 = EventInterface(Splide2), on = _EventInterface13.on; var track = Components2.Elements.track; var enabled = options.live && !options.isNavigation; var sr = create("span", CLASS_SR); @@ -2257,6 +2281,7 @@ function Live(Splide2, Components2, options) { interval.start(); } else { remove(sr); + interval.cancel(); } } function destroy() { @@ -2338,21 +2363,18 @@ var DEFAULTS = { } }; function Fade(Splide2, Components2, options) { - var _EventInterface15 = EventInterface(Splide2), on = _EventInterface15.on; + var Slides2 = Components2.Slides; function mount() { - on([EVENT_MOUNTED, EVENT_REFRESH], function() { - nextTick(function() { - Components2.Slides.style("transition", "opacity " + options.speed + "ms " + options.easing); - }); + EventInterface(Splide2).on([EVENT_MOUNTED, EVENT_REFRESH], init); + } + function init() { + Slides2.forEach(function(Slide2) { + Slide2.style("transform", "translateX(-" + 100 * Slide2.index + "%)"); }); } function start(index, done) { - var track = Components2.Elements.track; - style(track, "height", unit(rect(track).height)); - nextTick(function() { - done(); - style(track, "height", ""); - }); + Slides2.style("transition", "opacity " + options.speed + "ms " + options.easing); + nextTick(done); } return { mount, @@ -2361,13 +2383,12 @@ function Fade(Splide2, Components2, options) { }; } function Slide(Splide2, Components2, options) { - var _EventInterface16 = EventInterface(Splide2), bind = _EventInterface16.bind; var Move2 = Components2.Move, Controller2 = Components2.Controller, Scroll2 = Components2.Scroll; var list = Components2.Elements.list; var transition = apply(style, list, "transition"); var endCallback; function mount() { - bind(list, "transitionend", function(e) { + EventInterface(Splide2).bind(list, "transitionend", function(e) { if (e.target === list && endCallback) { cancel(); endCallback(); @@ -2530,7 +2551,7 @@ var _Splide = /* @__PURE__ */ function() { return this._o; }, set: function set(options) { - this._C.Media.set(options, true); + this._C.Media.set(options, true, true); } }, { key: "length", diff --git a/package-lock.json b/package-lock.json index 43cad17..1b5aa7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splidejs/vue-splide", - "version": "0.6.10", + "version": "0.6.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splidejs/vue-splide", - "version": "0.6.10", + "version": "0.6.12", "license": "MIT", "dependencies": { - "@splidejs/splide": "^4.0.17" + "@splidejs/splide": "^4.1.3" }, "devDependencies": { "@types/jest": "^29.0.0", @@ -1357,9 +1357,9 @@ } }, "node_modules/@splidejs/splide": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@splidejs/splide/-/splide-4.0.17.tgz", - "integrity": "sha512-k67vDY0+hl7Qi+I+juOF+DO1KuRw+4RfV5x5SlIVrK60DmMzQvp2j9CqDzixUw3jDDoEaPTGY4BKy5SZSiFf1Q==" + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@splidejs/splide/-/splide-4.1.3.tgz", + "integrity": "sha512-nmexLBzGy2vLR25uDSnFMk54dFMkSalmIdKY7fNkJZY8MO/x0n8PS9SW6VajiNTTV8Yo1IXsNCBczc2uj7kzBA==" }, "node_modules/@types/babel__core": { "version": "7.1.19", @@ -7468,9 +7468,9 @@ } }, "@splidejs/splide": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/@splidejs/splide/-/splide-4.0.17.tgz", - "integrity": "sha512-k67vDY0+hl7Qi+I+juOF+DO1KuRw+4RfV5x5SlIVrK60DmMzQvp2j9CqDzixUw3jDDoEaPTGY4BKy5SZSiFf1Q==" + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@splidejs/splide/-/splide-4.1.3.tgz", + "integrity": "sha512-nmexLBzGy2vLR25uDSnFMk54dFMkSalmIdKY7fNkJZY8MO/x0n8PS9SW6VajiNTTV8Yo1IXsNCBczc2uj7kzBA==" }, "@types/babel__core": { "version": "7.1.19", diff --git a/package.json b/package.json index e1e8445..236d3e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splidejs/vue-splide", - "version": "0.6.10", + "version": "0.6.12", "description": "The Splide component for Vue.", "author": "Naotoshi Fujita", "license": "MIT", @@ -60,6 +60,6 @@ "./css/*": "./dist/css/themes/splide-*.min.css" }, "dependencies": { - "@splidejs/splide": "^4.0.17" + "@splidejs/splide": "^4.1.3" } }