浏览代码

Update dist files.

NaotoshiFujita 3 年之前
父节点
当前提交
78d03134bc

文件差异内容过多而无法显示
+ 0 - 0
dist/js/splide-renderer.min.js


+ 23 - 14
dist/js/splide.cjs.js

@@ -780,12 +780,14 @@ const ARIA_LABEL = "aria-label";
 const ARIA_HIDDEN = "aria-hidden";
 const TAB_INDEX = "tabindex";
 const DISABLED = "disabled";
+const ARIA_ORIENTATION = "aria-orientation";
 const ALL_ATTRIBUTES = [
   ROLE,
   ARIA_CONTROLS,
   ARIA_CURRENT,
   ARIA_LABEL,
   ARIA_HIDDEN,
+  ARIA_ORIENTATION,
   TAB_INDEX,
   DISABLED
 ];
@@ -818,14 +820,12 @@ function Slide$1(Splide2, index, slideIndex, slide) {
       slide.id = `${root.id}-slide${pad(index + 1)}`;
     }
     if (isNavigation) {
-      if (!isHTMLButtonElement(slide)) {
-        setAttribute(slide, ROLE, "button");
-      }
       const idx = isClone ? slideIndex : index;
       const label = format(options.i18n.slideX, idx + 1);
       const controls = Splide2.splides.map((splide) => splide.root.id).join(" ");
       setAttribute(slide, ARIA_LABEL, label);
       setAttribute(slide, ARIA_CONTROLS, controls);
+      setAttribute(slide, ROLE, "menuitem");
     }
   }
   function destroy() {
@@ -2097,6 +2097,7 @@ function Pagination(Splide2, Components2, options) {
 const TRIGGER_KEYS = [" ", "Enter", "Spacebar"];
 function Sync(Splide2, Components2, options) {
   const { splides } = Splide2;
+  const { list } = Components2.Elements;
   function mount() {
     if (options.isNavigation) {
       navigate();
@@ -2104,6 +2105,9 @@ function Sync(Splide2, Components2, options) {
       sync();
     }
   }
+  function destroy() {
+    removeAttribute(list, ALL_ATTRIBUTES);
+  }
   function sync() {
     const processed = [];
     splides.concat(Splide2).forEach((splide, index, instances) => {
@@ -2120,19 +2124,24 @@ function Sync(Splide2, Components2, options) {
   }
   function navigate() {
     const { on, emit } = EventInterface(Splide2);
-    on(EVENT_CLICK, (Slide) => {
-      Splide2.go(Slide.index);
-    });
-    on(EVENT_SLIDE_KEYDOWN, (Slide, e) => {
-      if (includes(TRIGGER_KEYS, e.key)) {
-        Splide2.go(Slide.index);
-        prevent(e);
-      }
-    });
+    on(EVENT_CLICK, onClick);
+    on(EVENT_SLIDE_KEYDOWN, onKeydown);
     emit(EVENT_NAVIGATION_MOUNTED, Splide2.splides);
+    setAttribute(list, ROLE, "menu");
+    setAttribute(list, ARIA_ORIENTATION, options.direction !== TTB ? "horizontal" : null);
+  }
+  function onClick(Slide) {
+    Splide2.go(Slide.index);
+  }
+  function onKeydown(Slide, e) {
+    if (includes(TRIGGER_KEYS, e.key)) {
+      onClick(Slide);
+      prevent(e);
+    }
   }
   return {
-    mount
+    mount,
+    destroy
   };
 }
 
@@ -2303,7 +2312,7 @@ const _Splide = class {
   }
   mount(Extensions, Transition) {
     const { state, Components: Components2 } = this;
-    assert(state.is([CREATED, DESTROYED]), "Already mounted.");
+    assert(state.is([CREATED, DESTROYED]), "Already mounted!");
     state.set(CREATED);
     this._Components = Components2;
     this._Transition = Transition || this._Transition || (this.is(FADE) ? Fade : Slide);

+ 23 - 14
dist/js/splide.esm.js

@@ -776,12 +776,14 @@ const ARIA_LABEL = "aria-label";
 const ARIA_HIDDEN = "aria-hidden";
 const TAB_INDEX = "tabindex";
 const DISABLED = "disabled";
+const ARIA_ORIENTATION = "aria-orientation";
 const ALL_ATTRIBUTES = [
   ROLE,
   ARIA_CONTROLS,
   ARIA_CURRENT,
   ARIA_LABEL,
   ARIA_HIDDEN,
+  ARIA_ORIENTATION,
   TAB_INDEX,
   DISABLED
 ];
@@ -814,14 +816,12 @@ function Slide$1(Splide2, index, slideIndex, slide) {
       slide.id = `${root.id}-slide${pad(index + 1)}`;
     }
     if (isNavigation) {
-      if (!isHTMLButtonElement(slide)) {
-        setAttribute(slide, ROLE, "button");
-      }
       const idx = isClone ? slideIndex : index;
       const label = format(options.i18n.slideX, idx + 1);
       const controls = Splide2.splides.map((splide) => splide.root.id).join(" ");
       setAttribute(slide, ARIA_LABEL, label);
       setAttribute(slide, ARIA_CONTROLS, controls);
+      setAttribute(slide, ROLE, "menuitem");
     }
   }
   function destroy() {
@@ -2093,6 +2093,7 @@ function Pagination(Splide2, Components2, options) {
 const TRIGGER_KEYS = [" ", "Enter", "Spacebar"];
 function Sync(Splide2, Components2, options) {
   const { splides } = Splide2;
+  const { list } = Components2.Elements;
   function mount() {
     if (options.isNavigation) {
       navigate();
@@ -2100,6 +2101,9 @@ function Sync(Splide2, Components2, options) {
       sync();
     }
   }
+  function destroy() {
+    removeAttribute(list, ALL_ATTRIBUTES);
+  }
   function sync() {
     const processed = [];
     splides.concat(Splide2).forEach((splide, index, instances) => {
@@ -2116,19 +2120,24 @@ function Sync(Splide2, Components2, options) {
   }
   function navigate() {
     const { on, emit } = EventInterface(Splide2);
-    on(EVENT_CLICK, (Slide) => {
-      Splide2.go(Slide.index);
-    });
-    on(EVENT_SLIDE_KEYDOWN, (Slide, e) => {
-      if (includes(TRIGGER_KEYS, e.key)) {
-        Splide2.go(Slide.index);
-        prevent(e);
-      }
-    });
+    on(EVENT_CLICK, onClick);
+    on(EVENT_SLIDE_KEYDOWN, onKeydown);
     emit(EVENT_NAVIGATION_MOUNTED, Splide2.splides);
+    setAttribute(list, ROLE, "menu");
+    setAttribute(list, ARIA_ORIENTATION, options.direction !== TTB ? "horizontal" : null);
+  }
+  function onClick(Slide) {
+    Splide2.go(Slide.index);
+  }
+  function onKeydown(Slide, e) {
+    if (includes(TRIGGER_KEYS, e.key)) {
+      onClick(Slide);
+      prevent(e);
+    }
   }
   return {
-    mount
+    mount,
+    destroy
   };
 }
 
@@ -2299,7 +2308,7 @@ const _Splide = class {
   }
   mount(Extensions, Transition) {
     const { state, Components: Components2 } = this;
-    assert(state.is([CREATED, DESTROYED]), "Already mounted.");
+    assert(state.is([CREATED, DESTROYED]), "Already mounted!");
     state.set(CREATED);
     this._Components = Components2;
     this._Transition = Transition || this._Transition || (this.is(FADE) ? Fade : Slide);

文件差异内容过多而无法显示
+ 0 - 0
dist/js/splide.js.map


文件差异内容过多而无法显示
+ 0 - 0
dist/js/splide.min.js


二进制
dist/js/splide.min.js.gz


+ 1 - 1
dist/types/components/Slides/Slide.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["Slide.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAmB5C;;;;GAIG;AACH,MAAM,WAAY,cAAe,SAAQ,aAAa;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAI,IAAI,CAAA;IAC1E,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAI,OAAO,CAAC;CACrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAI,cAAc,CA6M7G"}
+{"version":3,"file":"Slide.d.ts","sourceRoot":"","sources":["Slide.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAmB5C;;;;GAIG;AACH,MAAM,WAAY,cAAe,SAAQ,aAAa;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAI,IAAI,CAAA;IAC1E,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAI,OAAO,CAAC;CACrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAI,cAAc,CA0M7G"}

+ 1 - 1
dist/types/components/Sync/Sync.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"Sync.d.ts","sourceRoot":"","sources":["Sync.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAIjE;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,aAAa;CACnD;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,aAAa,CA0D9F"}
+{"version":3,"file":"Sync.d.ts","sourceRoot":"","sources":["Sync.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAKjE;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,aAAa;CACnD;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,aAAa,CAoF9F"}

+ 1 - 0
dist/types/constants/attributes.d.ts

@@ -5,6 +5,7 @@ export declare const ARIA_LABEL = "aria-label";
 export declare const ARIA_HIDDEN = "aria-hidden";
 export declare const TAB_INDEX = "tabindex";
 export declare const DISABLED = "disabled";
+export declare const ARIA_ORIENTATION = "aria-orientation";
 /**
  * The array with all attributes.
  *

+ 1 - 1
dist/types/constants/attributes.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["attributes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,SAAmB,CAAC;AACrC,eAAO,MAAM,aAAa,kBAAmB,CAAC;AAC9C,eAAO,MAAM,YAAY,iBAAmB,CAAC;AAC7C,eAAO,MAAM,UAAU,eAAmB,CAAC;AAC3C,eAAO,MAAM,WAAW,gBAAmB,CAAC;AAC5C,eAAO,MAAM,SAAS,aAAkB,CAAC;AACzC,eAAO,MAAM,QAAQ,aAAmB,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,cAAc,UAQ1B,CAAC"}
+{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["attributes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,SAAqB,CAAC;AACvC,eAAO,MAAM,aAAa,kBAAqB,CAAC;AAChD,eAAO,MAAM,YAAY,iBAAqB,CAAC;AAC/C,eAAO,MAAM,UAAU,eAAqB,CAAC;AAC7C,eAAO,MAAM,WAAW,gBAAqB,CAAC;AAC9C,eAAO,MAAM,SAAS,aAAoB,CAAC;AAC3C,eAAO,MAAM,QAAQ,aAAqB,CAAC;AAC3C,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,cAAc,UAS1B,CAAC"}

+ 4 - 3
src/js/test/php/examples/default.php

@@ -20,11 +20,12 @@ $settings = get_settings();
     document.addEventListener( 'DOMContentLoaded', function () {
       var splide = new Splide( '#splide01', {
         type   : 'loop',
-        perPage: 2,
+        perPage: 3,
+        perMove: 1,
         gap    : '1.5rem',
         height : 400,
-        focus  : 'center',
-        cover  : true,
+        // focus  : 'center',
+        // cover  : true,
         classes: {
           arrows: 'splide__arrows splide__test',
           clone : 'splide__clone splide__test',

部分文件因为文件数量过多而无法显示