@splidejs/splide-extension-grid
Advanced tools
Comparing version 0.3.15 to 0.3.16
/*! | ||
* @splidejs/splide-extension-grid | ||
* Version : 0.3.15 | ||
* Version : 0.3.16 | ||
* License : MIT | ||
@@ -439,5 +439,3 @@ * Copyright: 2021 Naotoshi Fujita | ||
if (shouldBuild()) { | ||
if (isActive()) { | ||
destroy(); | ||
} | ||
destroy(); | ||
push2(originalSlides, Elements2.slides); | ||
@@ -454,14 +452,16 @@ addClass2(Splide4.root, modifier); | ||
function destroy() { | ||
const { slides } = Elements2; | ||
Layout3.destroy(); | ||
originalSlides.forEach((slide) => { | ||
removeClass2(slide, CLASS_SLIDE_COL); | ||
append2(Elements2.list, slide); | ||
}); | ||
remove2(slides); | ||
removeClass2(Splide4.root, modifier); | ||
empty2(slides); | ||
push2(slides, originalSlides); | ||
empty2(originalSlides); | ||
off(EVENT_REFRESH); | ||
if (isActive()) { | ||
const { slides } = Elements2; | ||
Layout3.destroy(); | ||
originalSlides.forEach((slide) => { | ||
removeClass2(slide, CLASS_SLIDE_COL); | ||
append2(Elements2.list, slide); | ||
}); | ||
remove2(slides); | ||
removeClass2(Splide4.root, modifier); | ||
empty2(slides); | ||
push2(slides, originalSlides); | ||
empty2(originalSlides); | ||
off(EVENT_REFRESH); | ||
} | ||
} | ||
@@ -524,3 +524,3 @@ function refresh() { | ||
* Splide.js | ||
* Version : 3.5.8 | ||
* Version : 3.6.1 | ||
* License : MIT | ||
@@ -527,0 +527,0 @@ * Copyright: 2021 Naotoshi Fujita |
/*! | ||
* @splidejs/splide-extension-grid | ||
* Version : 0.3.15 | ||
* Version : 0.3.16 | ||
* License : MIT | ||
@@ -435,5 +435,3 @@ * Copyright: 2021 Naotoshi Fujita | ||
if (shouldBuild()) { | ||
if (isActive()) { | ||
destroy(); | ||
} | ||
destroy(); | ||
push2(originalSlides, Elements2.slides); | ||
@@ -450,14 +448,16 @@ addClass2(Splide4.root, modifier); | ||
function destroy() { | ||
const { slides } = Elements2; | ||
Layout3.destroy(); | ||
originalSlides.forEach((slide) => { | ||
removeClass2(slide, CLASS_SLIDE_COL); | ||
append2(Elements2.list, slide); | ||
}); | ||
remove2(slides); | ||
removeClass2(Splide4.root, modifier); | ||
empty2(slides); | ||
push2(slides, originalSlides); | ||
empty2(originalSlides); | ||
off(EVENT_REFRESH); | ||
if (isActive()) { | ||
const { slides } = Elements2; | ||
Layout3.destroy(); | ||
originalSlides.forEach((slide) => { | ||
removeClass2(slide, CLASS_SLIDE_COL); | ||
append2(Elements2.list, slide); | ||
}); | ||
remove2(slides); | ||
removeClass2(Splide4.root, modifier); | ||
empty2(slides); | ||
push2(slides, originalSlides); | ||
empty2(originalSlides); | ||
off(EVENT_REFRESH); | ||
} | ||
} | ||
@@ -520,3 +520,3 @@ function refresh() { | ||
* Splide.js | ||
* Version : 3.5.8 | ||
* Version : 3.6.1 | ||
* License : MIT | ||
@@ -523,0 +523,0 @@ * Copyright: 2021 Naotoshi Fujita |
/*! | ||
* @splidejs/splide-extension-grid | ||
* Version : 0.3.15 | ||
* Version : 0.3.16 | ||
* License : MIT | ||
@@ -485,6 +485,3 @@ * Copyright: 2021 Naotoshi Fujita | ||
if (shouldBuild()) { | ||
if (isActive()) { | ||
destroy(); | ||
} | ||
destroy(); | ||
push2(originalSlides, Elements2.slides); | ||
@@ -502,14 +499,16 @@ addClass2(Splide4.root, modifier); | ||
function destroy() { | ||
var slides = Elements2.slides; | ||
Layout3.destroy(); | ||
originalSlides.forEach(function (slide) { | ||
removeClass2(slide, CLASS_SLIDE_COL); | ||
append2(Elements2.list, slide); | ||
}); | ||
remove2(slides); | ||
removeClass2(Splide4.root, modifier); | ||
empty2(slides); | ||
push2(slides, originalSlides); | ||
empty2(originalSlides); | ||
off(EVENT_REFRESH); | ||
if (isActive()) { | ||
var slides = Elements2.slides; | ||
Layout3.destroy(); | ||
originalSlides.forEach(function (slide) { | ||
removeClass2(slide, CLASS_SLIDE_COL); | ||
append2(Elements2.list, slide); | ||
}); | ||
remove2(slides); | ||
removeClass2(Splide4.root, modifier); | ||
empty2(slides); | ||
push2(slides, originalSlides); | ||
empty2(originalSlides); | ||
off(EVENT_REFRESH); | ||
} | ||
} | ||
@@ -596,3 +595,3 @@ | ||
* Splide.js | ||
* Version : 3.5.8 | ||
* Version : 3.6.1 | ||
* License : MIT | ||
@@ -599,0 +598,0 @@ * Copyright: 2021 Naotoshi Fujita |
/*! | ||
* @splidejs/splide-extension-grid | ||
* Version : 0.3.15 | ||
* Version : 0.3.16 | ||
* License : MIT | ||
* Copyright: 2021 Naotoshi Fujita | ||
*/(function(b){typeof define=="function"&&define.amd?define(b):b()})(function(){"use strict";var b="splide";function un(n){return Array.isArray(n)}function cn(n){return un(n)?n:[n]}function an(n,t){cn(n).forEach(t)}var sn="visible",dn="hidden",J="refresh",ln="updated",vn="destroy";function $(n){var t=n.event,r={},i=[];function a(u,h,g){t.on(u,h,r,g)}function l(u){t.off(u,r)}function d(u,h,g,y){w(u,h,function(A,E){i.push([A,E,g,y]),A.addEventListener(E,g,y)})}function v(u,h,g){w(u,h,function(y,A){i=i.filter(function(E){return E[0]===y&&E[1]===A&&(!g||E[2]===g)?(y.removeEventListener(A,E[2],E[3]),!1):!0})})}function w(u,h,g){an(u,function(y){y&&h.split(" ").forEach(g.bind(null,y))})}function m(){i=i.filter(function(u){return v(u[0],u[1])}),t.offBy(r)}return t.on(vn,m,r),{on:a,off:l,emit:t.emit,bind:d,unbind:v,destroy:m}}var hn=b,T=b+"__slide",En=T+"__container";function z(n){n.length=0}function gn(n){return!M(n)&&typeof n=="object"}function x(n){return Array.isArray(n)}function S(n){return typeof n=="string"}function mn(n){return typeof n=="undefined"}function M(n){return n===null}function yn(n){return n instanceof HTMLElement}function W(n){return x(n)?n:[n]}function N(n,t){W(n).forEach(t)}function Y(n,t){return n.push.apply(n,W(t)),n}var pn=Array.prototype;function V(n,t,r){return pn.slice.call(n,t,r)}function K(n,t,r){n&&N(t,function(i){i&&n.classList[r?"add":"remove"](i)})}function H(n,t){K(n,S(t)?t.split(" "):t,!0)}function O(n,t){N(t,n.appendChild.bind(n))}function wn(n,t){return yn(n)&&(n.msMatchesSelector||n.matches).call(n,t)}function An(n,t){return n?V(n.children).filter(function(r){return wn(r,t)}):[]}function Q(n,t){return t?An(n,t)[0]:n.firstElementChild}function X(n,t,r){if(n){var i=Object.keys(n);i=r?i.reverse():i;for(var a=0;a<i.length;a++){var l=i[a];if(l!=="__proto__"&&t(n[l],l)===!1)break}}return n}function Z(n){return V(arguments,1).forEach(function(t){X(t,function(r,i){n[i]=t[i]})}),n}function B(n,t){n&&N(t,function(r){n.removeAttribute(r)})}function G(n,t,r){gn(t)?X(t,function(i,a){G(n,a,i)}):M(r)?B(n,t):n.setAttribute(t,String(r))}function j(n,t,r){var i=document.createElement(n);return t&&(S(t)?H(i,t):G(i,t)),r&&O(r,i),i}function _(n,t,r){if(mn(r))return getComputedStyle(n)[t];if(!M(r)){var i=n.style;r=""+r,i[t]!==r&&(i[t]=r)}}function _n(n,t){return n&&n.classList.contains(t)}function Cn(n){N(n,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function k(n,t){return V(n.querySelectorAll(t))}function nn(n,t){K(n,t,!1)}function R(n){return S(n)?n:n?n+"px":""}var Ln="splide";function bn(n,t){if(t===void 0&&(t=""),!n)throw new Error("["+Ln+"] "+t)}var Dn=Math.min,xn=Math.max,Sn=Math.floor,Mn=Math.ceil,Vn=Math.abs;function In(n){return n<10?"0"+n:""+n}var tn=T+"__row",P=T+"--col",rn={rows:1,cols:1,dimensions:[],gap:{}};function Tn(n){function t(){var a=n.rows,l=n.cols,d=n.dimensions;return x(d)&&d.length?d:[[a,l]]}function r(a){var l=t();return l[Dn(a,l.length-1)]}function i(a){for(var l=t(),d,v,w=0,m=0;m<l.length;m++){var u=l[m];if(d=u[0]||1,v=u[1]||1,w+=d*v,a<w)break}return bn(d&&v,"Invalid dimension"),[d,v]}return{get:r,getAt:i}}function Nn(n,t,r){var i=$(n),a=i.on,l=i.destroy,d=n.Components,v=n.options,w=d.Direction.resolve,m=d.Slides.forEach;function u(){g(),v.slideFocus&&(a(sn,F),a(dn,U))}function h(){m(function(o){var s=o.slide;I(s,!1),D(s).forEach(function(e){B(e,"style")}),L(s).forEach(function(e){E(e,!0),B(e,"style")})}),l()}function g(){m(function(o){var s=o.slide,e=r.get(o.isClone?o.slideIndex:o.index),f=e[0],c=e[1];y(f,s),A(c,s),L(o.slide).forEach(function(p,C){p.id=o.slide.id+"-col"+In(C+1),n.options.cover&&E(p)})})}function y(o,s){var e=t.gap.row,f="calc("+100/o+"%"+(e?" - "+R(e)+" * "+(o-1)/o:"")+")";D(s).forEach(function(c,p,C){_(c,"height",f),_(c,"display","flex"),_(c,"margin","0 0 "+R(e)+" 0"),_(c,"padding",0),p===C.length-1&&_(c,"marginBottom",0)})}function A(o,s){var e=t.gap.col,f="calc("+100/o+"%"+(e?" - "+R(e)+" * "+(o-1)/o:"")+")";L(s).forEach(function(c,p,C){_(c,"width",f),p!==C.length-1&&_(c,w("marginRight"),R(e))})}function E(o,s){var e=Q(o,"."+En),f=Q(e||o,"img");f&&f.src&&(_(e||o,"background",s?"":'center/cover no-repeat url("'+f.src+'")'),_(f,"display",s?"":"none"))}function D(o){return k(o,"."+tn)}function L(o){return k(o,"."+P)}function I(o,s){L(o).forEach(function(e){G(e,"tabindex",s?0:null)})}function F(o){I(o.slide,!0)}function U(o){I(o.slide,!1)}return{mount:u,destroy:h}}function On(n,t,r){var i=$(n),a=i.on,l=i.off,d=t.Elements,v={},w=Tn(v),m=Nn(n,v,w),u=hn+"--grid",h=[];function g(){r.grid=Z({},rn,r.grid||{})}function y(){A(),a(ln,A)}function A(){Z(v,r.grid||rn),o()?(s()&&E(),Y(h,d.slides),H(n.root,u),O(d.list,I()),a(J,L),D()):s()&&(E(),D())}function E(){var e=d.slides;m.destroy(),h.forEach(function(f){nn(f,P),O(d.list,f)}),Cn(e),nn(n.root,u),z(e),Y(e,h),z(h),l(J)}function D(){n.refresh()}function L(){s()&&m.mount()}function I(){var e=[],f=0,c=0,p,C;return h.forEach(function(q,Rn){var on=w.getAt(Rn),en=on[0],fn=on[1];c||(f||(p=j(q.tagName,T),e.push(p)),C=F(en,q,p)),U(fn,q,C),++c>=fn&&(c=0,f=++f>=en?0:f)}),e}function F(e,f,c){var p=f.tagName.toLowerCase()==="li"?"ul":"div";return j(p,tn,c)}function U(e,f,c){return H(f,P),O(c,f),f}function o(){if(r.grid){var e=v.rows,f=v.cols,c=v.dimensions;return e>1||f>1||x(c)&&c.length>0}return!1}function s(){return _n(n.root,u)}return{setup:g,mount:y,destroy:E}}typeof window!="undefined"&&(window.splide=window.splide||{},window.splide.Extensions=window.splide.Extensions||{},window.splide.Extensions.Grid=On);/*! | ||
*/(function(b){typeof define=="function"&&define.amd?define(b):b()})(function(){"use strict";var b="splide";function un(n){return Array.isArray(n)}function cn(n){return un(n)?n:[n]}function an(n,t){cn(n).forEach(t)}var sn="visible",dn="hidden",J="refresh",ln="updated",vn="destroy";function $(n){var t=n.event,r={},i=[];function a(u,h,g){t.on(u,h,r,g)}function l(u){t.off(u,r)}function d(u,h,g,y){w(u,h,function(A,E){i.push([A,E,g,y]),A.addEventListener(E,g,y)})}function v(u,h,g){w(u,h,function(y,A){i=i.filter(function(E){return E[0]===y&&E[1]===A&&(!g||E[2]===g)?(y.removeEventListener(A,E[2],E[3]),!1):!0})})}function w(u,h,g){an(u,function(y){y&&h.split(" ").forEach(g.bind(null,y))})}function m(){i=i.filter(function(u){return v(u[0],u[1])}),t.offBy(r)}return t.on(vn,m,r),{on:a,off:l,emit:t.emit,bind:d,unbind:v,destroy:m}}var hn=b,T=b+"__slide",En=T+"__container";function z(n){n.length=0}function gn(n){return!M(n)&&typeof n=="object"}function x(n){return Array.isArray(n)}function S(n){return typeof n=="string"}function mn(n){return typeof n=="undefined"}function M(n){return n===null}function yn(n){return n instanceof HTMLElement}function W(n){return x(n)?n:[n]}function N(n,t){W(n).forEach(t)}function Y(n,t){return n.push.apply(n,W(t)),n}var pn=Array.prototype;function V(n,t,r){return pn.slice.call(n,t,r)}function K(n,t,r){n&&N(t,function(i){i&&n.classList[r?"add":"remove"](i)})}function H(n,t){K(n,S(t)?t.split(" "):t,!0)}function O(n,t){N(t,n.appendChild.bind(n))}function wn(n,t){return yn(n)&&(n.msMatchesSelector||n.matches).call(n,t)}function An(n,t){return n?V(n.children).filter(function(r){return wn(r,t)}):[]}function Q(n,t){return t?An(n,t)[0]:n.firstElementChild}function X(n,t,r){if(n){var i=Object.keys(n);i=r?i.reverse():i;for(var a=0;a<i.length;a++){var l=i[a];if(l!=="__proto__"&&t(n[l],l)===!1)break}}return n}function Z(n){return V(arguments,1).forEach(function(t){X(t,function(r,i){n[i]=t[i]})}),n}function B(n,t){n&&N(t,function(r){n.removeAttribute(r)})}function G(n,t,r){gn(t)?X(t,function(i,a){G(n,a,i)}):M(r)?B(n,t):n.setAttribute(t,String(r))}function j(n,t,r){var i=document.createElement(n);return t&&(S(t)?H(i,t):G(i,t)),r&&O(r,i),i}function _(n,t,r){if(mn(r))return getComputedStyle(n)[t];if(!M(r)){var i=n.style;r=""+r,i[t]!==r&&(i[t]=r)}}function _n(n,t){return n&&n.classList.contains(t)}function Cn(n){N(n,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function k(n,t){return V(n.querySelectorAll(t))}function nn(n,t){K(n,t,!1)}function R(n){return S(n)?n:n?n+"px":""}var Ln="splide";function bn(n,t){if(t===void 0&&(t=""),!n)throw new Error("["+Ln+"] "+t)}var Dn=Math.min,xn=Math.max,Sn=Math.floor,Mn=Math.ceil,Vn=Math.abs;function In(n){return n<10?"0"+n:""+n}var tn=T+"__row",P=T+"--col",rn={rows:1,cols:1,dimensions:[],gap:{}};function Tn(n){function t(){var a=n.rows,l=n.cols,d=n.dimensions;return x(d)&&d.length?d:[[a,l]]}function r(a){var l=t();return l[Dn(a,l.length-1)]}function i(a){for(var l=t(),d,v,w=0,m=0;m<l.length;m++){var u=l[m];if(d=u[0]||1,v=u[1]||1,w+=d*v,a<w)break}return bn(d&&v,"Invalid dimension"),[d,v]}return{get:r,getAt:i}}function Nn(n,t,r){var i=$(n),a=i.on,l=i.destroy,d=n.Components,v=n.options,w=d.Direction.resolve,m=d.Slides.forEach;function u(){g(),v.slideFocus&&(a(sn,F),a(dn,U))}function h(){m(function(o){var s=o.slide;I(s,!1),D(s).forEach(function(e){B(e,"style")}),L(s).forEach(function(e){E(e,!0),B(e,"style")})}),l()}function g(){m(function(o){var s=o.slide,e=r.get(o.isClone?o.slideIndex:o.index),f=e[0],c=e[1];y(f,s),A(c,s),L(o.slide).forEach(function(p,C){p.id=o.slide.id+"-col"+In(C+1),n.options.cover&&E(p)})})}function y(o,s){var e=t.gap.row,f="calc("+100/o+"%"+(e?" - "+R(e)+" * "+(o-1)/o:"")+")";D(s).forEach(function(c,p,C){_(c,"height",f),_(c,"display","flex"),_(c,"margin","0 0 "+R(e)+" 0"),_(c,"padding",0),p===C.length-1&&_(c,"marginBottom",0)})}function A(o,s){var e=t.gap.col,f="calc("+100/o+"%"+(e?" - "+R(e)+" * "+(o-1)/o:"")+")";L(s).forEach(function(c,p,C){_(c,"width",f),p!==C.length-1&&_(c,w("marginRight"),R(e))})}function E(o,s){var e=Q(o,"."+En),f=Q(e||o,"img");f&&f.src&&(_(e||o,"background",s?"":'center/cover no-repeat url("'+f.src+'")'),_(f,"display",s?"":"none"))}function D(o){return k(o,"."+tn)}function L(o){return k(o,"."+P)}function I(o,s){L(o).forEach(function(e){G(e,"tabindex",s?0:null)})}function F(o){I(o.slide,!0)}function U(o){I(o.slide,!1)}return{mount:u,destroy:h}}function On(n,t,r){var i=$(n),a=i.on,l=i.off,d=t.Elements,v={},w=Tn(v),m=Nn(n,v,w),u=hn+"--grid",h=[];function g(){r.grid=Z({},rn,r.grid||{})}function y(){A(),a(ln,A)}function A(){Z(v,r.grid||rn),o()?(E(),Y(h,d.slides),H(n.root,u),O(d.list,I()),a(J,L),D()):s()&&(E(),D())}function E(){if(s()){var e=d.slides;m.destroy(),h.forEach(function(f){nn(f,P),O(d.list,f)}),Cn(e),nn(n.root,u),z(e),Y(e,h),z(h),l(J)}}function D(){n.refresh()}function L(){s()&&m.mount()}function I(){var e=[],f=0,c=0,p,C;return h.forEach(function(q,Rn){var on=w.getAt(Rn),en=on[0],fn=on[1];c||(f||(p=j(q.tagName,T),e.push(p)),C=F(en,q,p)),U(fn,q,C),++c>=fn&&(c=0,f=++f>=en?0:f)}),e}function F(e,f,c){var p=f.tagName.toLowerCase()==="li"?"ul":"div";return j(p,tn,c)}function U(e,f,c){return H(f,P),O(c,f),f}function o(){if(r.grid){var e=v.rows,f=v.cols,c=v.dimensions;return e>1||f>1||x(c)&&c.length>0}return!1}function s(){return _n(n.root,u)}return{setup:g,mount:y,destroy:E}}typeof window!="undefined"&&(window.splide=window.splide||{},window.splide.Extensions=window.splide.Extensions||{},window.splide.Extensions.Grid=On);/*! | ||
* Splide.js | ||
* Version : 3.5.8 | ||
* Version : 3.6.1 | ||
* License : MIT | ||
@@ -10,0 +10,0 @@ * Copyright: 2021 Naotoshi Fujita |
{ | ||
"name": "@splidejs/splide-extension-grid", | ||
"version": "0.3.15", | ||
"version": "0.3.16", | ||
"description": "The extension of Splide for creating grid inside slides.", | ||
@@ -34,3 +34,3 @@ "author": "Naotoshi Fujita", | ||
"@rollup/plugin-node-resolve": "^13.0.4", | ||
"@splidejs/splide": "^3.5.8", | ||
"@splidejs/splide": "^3.6.1", | ||
"@types/jest": "^27.0.1", | ||
@@ -37,0 +37,0 @@ "@typescript-eslint/eslint-plugin": "^4.31.0", |
@@ -113,6 +113,3 @@ import { | ||
if ( shouldBuild() ) { | ||
if ( isActive() ) { | ||
destroy(); | ||
} | ||
destroy(); | ||
push( originalSlides, Elements.slides ); | ||
@@ -134,18 +131,20 @@ addClass( Splide.root, modifier ); | ||
function destroy(): void { | ||
const { slides } = Elements; | ||
if ( isActive() ) { | ||
const { slides } = Elements; | ||
Layout.destroy(); | ||
Layout.destroy(); | ||
originalSlides.forEach( slide => { | ||
removeClass( slide, CLASS_SLIDE_COL ); | ||
append( Elements.list, slide ); | ||
} ); | ||
originalSlides.forEach( slide => { | ||
removeClass( slide, CLASS_SLIDE_COL ); | ||
append( Elements.list, slide ); | ||
} ); | ||
remove( slides ); | ||
removeClass( Splide.root, modifier ); | ||
empty( slides ); | ||
push( slides, originalSlides ); | ||
empty( originalSlides ); | ||
remove( slides ); | ||
removeClass( Splide.root, modifier ); | ||
empty( slides ); | ||
push( slides, originalSlides ); | ||
empty( originalSlides ); | ||
off( EVENT_REFRESH ); | ||
off( EVENT_REFRESH ); | ||
} | ||
} | ||
@@ -152,0 +151,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1214403