소스 검색

Refactoring.

NaotoshiFujita 3 년 전
부모
커밋
dfec89deb7
47개의 변경된 파일228개의 추가작업 그리고 362개의 파일을 삭제
  1. 0 0
      dist/js/splide-renderer.min.js
  2. 46 64
      dist/js/splide.cjs.js
  3. 46 64
      dist/js/splide.esm.js
  4. 49 82
      dist/js/splide.js
  5. 0 0
      dist/js/splide.js.map
  6. 1 1
      dist/js/splide.min.js
  7. BIN
      dist/js/splide.min.js.gz
  8. 2 0
      dist/types/build/renderer.d.ts
  9. 1 0
      dist/types/build/renderer.d.ts.map
  10. 1 1
      dist/types/components/Direction/Direction.d.ts
  11. 1 1
      dist/types/components/Drag/Drag.d.ts.map
  12. 1 1
      dist/types/components/Keyboard/Keyboard.d.ts.map
  13. 1 1
      dist/types/components/Layout/Layout.d.ts.map
  14. 1 1
      dist/types/constructors/RequestInterval/RequestInterval.d.ts.map
  15. 1 1
      dist/types/core/Splide/Splide.d.ts.map
  16. 0 1
      dist/types/utils/arrayLike/index.d.ts
  17. 1 1
      dist/types/utils/arrayLike/index.d.ts.map
  18. 0 14
      dist/types/utils/arrayLike/splice/splice.d.ts
  19. 0 1
      dist/types/utils/arrayLike/splice/splice.d.ts.map
  20. 1 1
      dist/types/utils/dom/addClass/addClass.d.ts.map
  21. 1 1
      dist/types/utils/math/approximatelyEqual/approximatelyEqual.d.ts.map
  22. 1 1
      dist/types/utils/math/between/between.d.ts.map
  23. 1 1
      dist/types/utils/math/clamp/clamp.d.ts.map
  24. 1 1
      dist/types/utils/math/index.d.ts
  25. 1 1
      dist/types/utils/math/index.d.ts.map
  26. 1 1
      dist/types/utils/object/assign/assign.d.ts.map
  27. 1 1
      src/js/components/Direction/Direction.ts
  28. 18 20
      src/js/components/Drag/Drag.ts
  29. 1 1
      src/js/components/Elements/Elements.ts
  30. 7 19
      src/js/components/Keyboard/Keyboard.ts
  31. 3 10
      src/js/components/Layout/Layout.ts
  32. 1 1
      src/js/components/Layout/test/ltr.test.ts
  33. 3 3
      src/js/components/Layout/test/ttb.test.ts
  34. 1 2
      src/js/constructors/RequestInterval/RequestInterval.ts
  35. 5 3
      src/js/core/Splide/Splide.ts
  36. 4 0
      src/js/test/php/examples/default.php
  37. 0 1
      src/js/utils/arrayLike/index.ts
  38. 0 21
      src/js/utils/arrayLike/splice/splice.test.ts
  39. 0 18
      src/js/utils/arrayLike/splice/splice.ts
  40. 2 1
      src/js/utils/dom/addClass/addClass.ts
  41. 4 10
      src/js/utils/dom/create/create.ts
  42. 4 1
      src/js/utils/math/approximatelyEqual/approximatelyEqual.ts
  43. 6 3
      src/js/utils/math/between/between.ts
  44. 2 1
      src/js/utils/math/clamp/clamp.ts
  45. 1 1
      src/js/utils/math/index.ts
  46. 1 0
      src/js/utils/math/math/math.ts
  47. 5 4
      src/js/utils/object/assign/assign.ts

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/js/splide-renderer.min.js


+ 46 - 64
dist/js/splide.cjs.js

@@ -94,7 +94,7 @@ function toggleClass(elm, classes, add) {
 }
 
 function addClass(elm, classes) {
-  toggleClass(elm, classes, true);
+  toggleClass(elm, isString(classes) ? classes.split(" ") : classes, true);
 }
 
 function append(parent, children) {
@@ -137,8 +137,8 @@ function forOwn(object, iteratee) {
   return object;
 }
 
-function assign(object, ...sources) {
-  sources.forEach((source) => {
+function assign(object) {
+  slice(arguments, 1).forEach((source) => {
     forOwn(source, (value, key) => {
       object[key] = source[key];
     });
@@ -180,15 +180,9 @@ function setAttribute(elm, attrs, value) {
 function create(tag, attrs, parent) {
   const elm = document.createElement(tag);
   if (attrs) {
-    if (isString(attrs) || isArray(attrs)) {
-      addClass(elm, attrs);
-    } else {
-      setAttribute(elm, attrs);
-    }
-  }
-  if (parent) {
-    append(parent, elm);
+    isString(attrs) ? addClass(elm, attrs) : setAttribute(elm, attrs);
   }
+  parent && append(parent, elm);
   return elm;
 }
 
@@ -281,29 +275,28 @@ function raf(func) {
   return requestAnimationFrame(func);
 }
 
+const { min, max, floor, ceil, abs } = Math;
+
 function approximatelyEqual(x, y, epsilon) {
-  return Math.abs(x - y) < epsilon;
+  return abs(x - y) < epsilon;
 }
 
 function between(number, minOrMax, maxOrMin, exclusive) {
-  const min = Math.min(minOrMax, maxOrMin);
-  const max = Math.max(minOrMax, maxOrMin);
-  return exclusive ? min < number && number < max : min <= number && number <= max;
+  const minimum = min(minOrMax, maxOrMin);
+  const maximum = max(minOrMax, maxOrMin);
+  return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum;
 }
 
-const { max: max$1, min: min$1 } = Math;
 function clamp(number, x, y) {
-  const minimum = min$1(x, y);
-  const maximum = max$1(x, y);
-  return min$1(max$1(minimum, number), maximum);
+  const minimum = min(x, y);
+  const maximum = max(x, y);
+  return min(max(minimum, number), maximum);
 }
 
 function sign(x) {
   return +(x > 0) - +(x < 0);
 }
 
-const { min, max, floor, ceil, abs, round } = Math;
-
 function camelToKebab(string) {
   return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
 }
@@ -475,8 +468,7 @@ function RequestInterval(interval, onInterval, onUpdate, limit) {
       if (rate === 1) {
         onInterval();
         if (limit && ++count >= limit) {
-          pause();
-          return;
+          return pause();
         }
       }
       raf(update);
@@ -602,11 +594,11 @@ const TTB = "ttb";
 
 const ORIENTATION_MAP = {
   marginRight: ["marginBottom", "marginLeft"],
-  width: ["height"],
   autoWidth: ["autoHeight"],
   fixedWidth: ["fixedHeight"],
   paddingLeft: ["paddingTop", "paddingRight"],
   paddingRight: ["paddingBottom", "paddingLeft"],
+  width: ["height"],
   left: ["top", "right"],
   right: ["bottom", "left"],
   x: ["y"],
@@ -702,7 +694,7 @@ function Elements(Splide2, Components2, options) {
     slider = child(root, `.${CLASS_SLIDER}`);
     track = query(root, `.${CLASS_TRACK}`);
     list = child(track, `.${CLASS_LIST}`);
-    assert(track && list, "Missing a track/list element.");
+    assert(track && list, "A track/list element is missing.");
     push(slides, children(list, `.${CLASS_SLIDE}:not(.${CLASS_CLONE})`));
     const autoplay = find(`.${CLASS_AUTOPLAY}`);
     const arrows = find(`.${CLASS_ARROWS}`);
@@ -1124,19 +1116,14 @@ function Layout(Splide2, Components2, options) {
   function cssPadding(right) {
     const { padding } = options;
     const prop = resolve(right ? "right" : "left", true);
-    return padding ? unit(padding[prop] || (isObject(padding) ? "0" : padding)) : "";
+    return padding && unit(padding[prop] || (isObject(padding) ? 0 : padding)) || "0px";
   }
   function cssTrackHeight() {
     let height = "";
     if (vertical) {
       height = cssHeight();
-      assert(height, '"height" or "heightRatio" is missing.');
-      const paddingTop = cssPadding(false);
-      const paddingBottom = cssPadding(true);
-      if (paddingTop || paddingBottom) {
-        height = `calc(${height}`;
-        height += `${paddingTop ? ` - ${paddingTop}` : ""}${paddingBottom ? ` - ${paddingBottom}` : ""})`;
-      }
+      assert(height, "height or heightRatio is missing.");
+      height = `calc(${height} - ${cssPadding(false)} - ${cssPadding(true)})`;
     }
     return height;
   }
@@ -1797,25 +1784,24 @@ function Drag(Splide2, Components2, options) {
       emit(EVENT_DRAG);
     }
     lastEvent = e;
-    if (!e.cancelable) {
-      return;
-    }
-    if (isDragging) {
-      const expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
-      const exceeded = hasExceeded !== (hasExceeded = exceededLimit());
-      if (expired || exceeded) {
-        save(e);
-      }
-      if (!isFade) {
-        Move.translate(basePosition + constrain(coordOf(e) - coordOf(baseEvent)));
-      }
-      emit(EVENT_DRAGGING);
-      prevent(e);
-    } else {
-      const threshold = options.dragMinThreshold || 15;
-      isDragging = isMouse || abs(coordOf(e) - coordOf(baseEvent)) > threshold;
-      if (isSliderDirection()) {
+    if (e.cancelable) {
+      if (isDragging) {
+        const expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
+        const exceeded = hasExceeded !== (hasExceeded = exceededLimit());
+        if (expired || exceeded) {
+          save(e);
+        }
+        if (!isFade) {
+          Move.translate(basePosition + constrain(coordOf(e) - coordOf(baseEvent)));
+        }
+        emit(EVENT_DRAGGING);
         prevent(e);
+      } else {
+        const threshold = options.dragMinThreshold || 15;
+        isDragging = isMouse || abs(coordOf(e) - coordOf(baseEvent)) > threshold;
+        if (isSliderDirection()) {
+          prevent(e);
+        }
       }
     }
   }
@@ -1917,24 +1903,20 @@ function Keyboard(Splide2, Components2, options) {
     }
   }
   function destroy() {
-    if (target) {
-      unbind(target, "keydown");
-      if (isHTMLElement(target)) {
-        removeAttribute(target, TAB_INDEX);
-      }
+    unbind(target, "keydown");
+    if (isHTMLElement(target)) {
+      removeAttribute(target, TAB_INDEX);
     }
   }
   function onKeydown(e) {
-    const key = normalize(e.key);
-    if (key === resolve("ArrowLeft")) {
+    const { key } = e;
+    const normalizedKey = includes(IE_ARROW_KEYS, key) ? `Arrow${key}` : key;
+    if (normalizedKey === resolve("ArrowLeft")) {
       Splide2.go("<");
-    } else if (key === resolve("ArrowRight")) {
+    } else if (normalizedKey === resolve("ArrowRight")) {
       Splide2.go(">");
     }
   }
-  function normalize(key) {
-    return includes(IE_ARROW_KEYS, key) ? `Arrow${key}` : key;
-  }
   return {
     mount,
     destroy
@@ -2351,8 +2333,8 @@ const _Splide = class {
     this.event.off(events);
     return this;
   }
-  emit(event, ...args) {
-    this.event.emit(event, ...args);
+  emit(event) {
+    this.event.emit(event, ...slice(arguments, 1));
     return this;
   }
   add(slides, index) {

+ 46 - 64
dist/js/splide.esm.js

@@ -90,7 +90,7 @@ function toggleClass(elm, classes, add) {
 }
 
 function addClass(elm, classes) {
-  toggleClass(elm, classes, true);
+  toggleClass(elm, isString(classes) ? classes.split(" ") : classes, true);
 }
 
 function append(parent, children) {
@@ -133,8 +133,8 @@ function forOwn(object, iteratee) {
   return object;
 }
 
-function assign(object, ...sources) {
-  sources.forEach((source) => {
+function assign(object) {
+  slice(arguments, 1).forEach((source) => {
     forOwn(source, (value, key) => {
       object[key] = source[key];
     });
@@ -176,15 +176,9 @@ function setAttribute(elm, attrs, value) {
 function create(tag, attrs, parent) {
   const elm = document.createElement(tag);
   if (attrs) {
-    if (isString(attrs) || isArray(attrs)) {
-      addClass(elm, attrs);
-    } else {
-      setAttribute(elm, attrs);
-    }
-  }
-  if (parent) {
-    append(parent, elm);
+    isString(attrs) ? addClass(elm, attrs) : setAttribute(elm, attrs);
   }
+  parent && append(parent, elm);
   return elm;
 }
 
@@ -277,29 +271,28 @@ function raf(func) {
   return requestAnimationFrame(func);
 }
 
+const { min, max, floor, ceil, abs } = Math;
+
 function approximatelyEqual(x, y, epsilon) {
-  return Math.abs(x - y) < epsilon;
+  return abs(x - y) < epsilon;
 }
 
 function between(number, minOrMax, maxOrMin, exclusive) {
-  const min = Math.min(minOrMax, maxOrMin);
-  const max = Math.max(minOrMax, maxOrMin);
-  return exclusive ? min < number && number < max : min <= number && number <= max;
+  const minimum = min(minOrMax, maxOrMin);
+  const maximum = max(minOrMax, maxOrMin);
+  return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum;
 }
 
-const { max: max$1, min: min$1 } = Math;
 function clamp(number, x, y) {
-  const minimum = min$1(x, y);
-  const maximum = max$1(x, y);
-  return min$1(max$1(minimum, number), maximum);
+  const minimum = min(x, y);
+  const maximum = max(x, y);
+  return min(max(minimum, number), maximum);
 }
 
 function sign(x) {
   return +(x > 0) - +(x < 0);
 }
 
-const { min, max, floor, ceil, abs, round } = Math;
-
 function camelToKebab(string) {
   return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
 }
@@ -471,8 +464,7 @@ function RequestInterval(interval, onInterval, onUpdate, limit) {
       if (rate === 1) {
         onInterval();
         if (limit && ++count >= limit) {
-          pause();
-          return;
+          return pause();
         }
       }
       raf(update);
@@ -598,11 +590,11 @@ const TTB = "ttb";
 
 const ORIENTATION_MAP = {
   marginRight: ["marginBottom", "marginLeft"],
-  width: ["height"],
   autoWidth: ["autoHeight"],
   fixedWidth: ["fixedHeight"],
   paddingLeft: ["paddingTop", "paddingRight"],
   paddingRight: ["paddingBottom", "paddingLeft"],
+  width: ["height"],
   left: ["top", "right"],
   right: ["bottom", "left"],
   x: ["y"],
@@ -698,7 +690,7 @@ function Elements(Splide2, Components2, options) {
     slider = child(root, `.${CLASS_SLIDER}`);
     track = query(root, `.${CLASS_TRACK}`);
     list = child(track, `.${CLASS_LIST}`);
-    assert(track && list, "Missing a track/list element.");
+    assert(track && list, "A track/list element is missing.");
     push(slides, children(list, `.${CLASS_SLIDE}:not(.${CLASS_CLONE})`));
     const autoplay = find(`.${CLASS_AUTOPLAY}`);
     const arrows = find(`.${CLASS_ARROWS}`);
@@ -1120,19 +1112,14 @@ function Layout(Splide2, Components2, options) {
   function cssPadding(right) {
     const { padding } = options;
     const prop = resolve(right ? "right" : "left", true);
-    return padding ? unit(padding[prop] || (isObject(padding) ? "0" : padding)) : "";
+    return padding && unit(padding[prop] || (isObject(padding) ? 0 : padding)) || "0px";
   }
   function cssTrackHeight() {
     let height = "";
     if (vertical) {
       height = cssHeight();
-      assert(height, '"height" or "heightRatio" is missing.');
-      const paddingTop = cssPadding(false);
-      const paddingBottom = cssPadding(true);
-      if (paddingTop || paddingBottom) {
-        height = `calc(${height}`;
-        height += `${paddingTop ? ` - ${paddingTop}` : ""}${paddingBottom ? ` - ${paddingBottom}` : ""})`;
-      }
+      assert(height, "height or heightRatio is missing.");
+      height = `calc(${height} - ${cssPadding(false)} - ${cssPadding(true)})`;
     }
     return height;
   }
@@ -1793,25 +1780,24 @@ function Drag(Splide2, Components2, options) {
       emit(EVENT_DRAG);
     }
     lastEvent = e;
-    if (!e.cancelable) {
-      return;
-    }
-    if (isDragging) {
-      const expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
-      const exceeded = hasExceeded !== (hasExceeded = exceededLimit());
-      if (expired || exceeded) {
-        save(e);
-      }
-      if (!isFade) {
-        Move.translate(basePosition + constrain(coordOf(e) - coordOf(baseEvent)));
-      }
-      emit(EVENT_DRAGGING);
-      prevent(e);
-    } else {
-      const threshold = options.dragMinThreshold || 15;
-      isDragging = isMouse || abs(coordOf(e) - coordOf(baseEvent)) > threshold;
-      if (isSliderDirection()) {
+    if (e.cancelable) {
+      if (isDragging) {
+        const expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
+        const exceeded = hasExceeded !== (hasExceeded = exceededLimit());
+        if (expired || exceeded) {
+          save(e);
+        }
+        if (!isFade) {
+          Move.translate(basePosition + constrain(coordOf(e) - coordOf(baseEvent)));
+        }
+        emit(EVENT_DRAGGING);
         prevent(e);
+      } else {
+        const threshold = options.dragMinThreshold || 15;
+        isDragging = isMouse || abs(coordOf(e) - coordOf(baseEvent)) > threshold;
+        if (isSliderDirection()) {
+          prevent(e);
+        }
       }
     }
   }
@@ -1913,24 +1899,20 @@ function Keyboard(Splide2, Components2, options) {
     }
   }
   function destroy() {
-    if (target) {
-      unbind(target, "keydown");
-      if (isHTMLElement(target)) {
-        removeAttribute(target, TAB_INDEX);
-      }
+    unbind(target, "keydown");
+    if (isHTMLElement(target)) {
+      removeAttribute(target, TAB_INDEX);
     }
   }
   function onKeydown(e) {
-    const key = normalize(e.key);
-    if (key === resolve("ArrowLeft")) {
+    const { key } = e;
+    const normalizedKey = includes(IE_ARROW_KEYS, key) ? `Arrow${key}` : key;
+    if (normalizedKey === resolve("ArrowLeft")) {
       Splide2.go("<");
-    } else if (key === resolve("ArrowRight")) {
+    } else if (normalizedKey === resolve("ArrowRight")) {
       Splide2.go(">");
     }
   }
-  function normalize(key) {
-    return includes(IE_ARROW_KEYS, key) ? `Arrow${key}` : key;
-  }
   return {
     mount,
     destroy
@@ -2347,8 +2329,8 @@ const _Splide = class {
     this.event.off(events);
     return this;
   }
-  emit(event, ...args) {
-    this.event.emit(event, ...args);
+  emit(event) {
+    this.event.emit(event, ...slice(arguments, 1));
     return this;
   }
   add(slides, index) {

+ 49 - 82
dist/js/splide.js

@@ -104,7 +104,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
   }
 
   function addClass(elm, classes) {
-    toggleClass(elm, classes, true);
+    toggleClass(elm, isString(classes) ? classes.split(" ") : classes, true);
   }
 
   function append(parent, children) {
@@ -154,11 +154,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
   }
 
   function assign(object) {
-    for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
-      sources[_key - 1] = arguments[_key];
-    }
-
-    sources.forEach(function (source) {
+    slice(arguments, 1).forEach(function (source) {
       forOwn(source, function (value, key) {
         object[key] = source[key];
       });
@@ -201,17 +197,10 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     var elm = document.createElement(tag);
 
     if (attrs) {
-      if (isString(attrs) || isArray(attrs)) {
-        addClass(elm, attrs);
-      } else {
-        setAttribute(elm, attrs);
-      }
-    }
-
-    if (parent) {
-      append(parent, elm);
+      isString(attrs) ? addClass(elm, attrs) : setAttribute(elm, attrs);
     }
 
+    parent && append(parent, elm);
     return elm;
   }
 
@@ -314,36 +303,32 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     return requestAnimationFrame(func);
   }
 
+  var min = Math.min,
+      max = Math.max,
+      floor = Math.floor,
+      ceil = Math.ceil,
+      abs = Math.abs;
+
   function approximatelyEqual(x, y, epsilon) {
-    return Math.abs(x - y) < epsilon;
+    return abs(x - y) < epsilon;
   }
 
   function between(number, minOrMax, maxOrMin, exclusive) {
-    var min = Math.min(minOrMax, maxOrMin);
-    var max = Math.max(minOrMax, maxOrMin);
-    return exclusive ? min < number && number < max : min <= number && number <= max;
+    var minimum = min(minOrMax, maxOrMin);
+    var maximum = max(minOrMax, maxOrMin);
+    return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum;
   }
 
-  var max$1 = Math.max,
-      min$1 = Math.min;
-
   function clamp(number, x, y) {
-    var minimum = min$1(x, y);
-    var maximum = max$1(x, y);
-    return min$1(max$1(minimum, number), maximum);
+    var minimum = min(x, y);
+    var maximum = max(x, y);
+    return min(max(minimum, number), maximum);
   }
 
   function sign(x) {
     return +(x > 0) - +(x < 0);
   }
 
-  var min = Math.min,
-      max = Math.max,
-      floor = Math.floor,
-      ceil = Math.ceil,
-      abs = Math.abs,
-      round = Math.round;
-
   function format(string, replacements) {
     forEach(replacements, function (replacement) {
       string = string.replace("%s", "" + replacement);
@@ -541,8 +526,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
           onInterval();
 
           if (limit && ++count >= limit) {
-            pause();
-            return;
+            return pause();
           }
         }
 
@@ -700,11 +684,11 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
   var TTB = "ttb";
   var ORIENTATION_MAP = {
     marginRight: ["marginBottom", "marginLeft"],
-    width: ["height"],
     autoWidth: ["autoHeight"],
     fixedWidth: ["fixedHeight"],
     paddingLeft: ["paddingTop", "paddingRight"],
     paddingRight: ["paddingBottom", "paddingLeft"],
+    width: ["height"],
     left: ["top", "right"],
     right: ["bottom", "left"],
     x: ["y"],
@@ -811,7 +795,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
       slider = child(root, "." + CLASS_SLIDER);
       track = query(root, "." + CLASS_TRACK);
       list = child(track, "." + CLASS_LIST);
-      assert(track && list, "Missing a track/list element.");
+      assert(track && list, "A track/list element is missing.");
       push(slides, children(list, "." + CLASS_SLIDE + ":not(." + CLASS_CLONE + ")"));
       var autoplay = find("." + CLASS_AUTOPLAY);
       var arrows = find("." + CLASS_ARROWS);
@@ -1329,7 +1313,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     function cssPadding(right) {
       var padding = options.padding;
       var prop = resolve(right ? "right" : "left", true);
-      return padding ? unit(padding[prop] || (isObject(padding) ? "0" : padding)) : "";
+      return padding && unit(padding[prop] || (isObject(padding) ? 0 : padding)) || "0px";
     }
 
     function cssTrackHeight() {
@@ -1337,14 +1321,8 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
 
       if (vertical) {
         height = cssHeight();
-        assert(height, '"height" or "heightRatio" is missing.');
-        var paddingTop = cssPadding(false);
-        var paddingBottom = cssPadding(true);
-
-        if (paddingTop || paddingBottom) {
-          height = "calc(" + height;
-          height += "" + (paddingTop ? " - " + paddingTop : "") + (paddingBottom ? " - " + paddingBottom : "") + ")";
-        }
+        assert(height, "height or heightRatio is missing.");
+        height = "calc(" + height + " - " + cssPadding(false) + " - " + cssPadding(true) + ")";
       }
 
       return height;
@@ -2180,30 +2158,28 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
 
       lastEvent = e;
 
-      if (!e.cancelable) {
-        return;
-      }
-
-      if (isDragging) {
-        var expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
-        var exceeded = hasExceeded !== (hasExceeded = exceededLimit());
-
-        if (expired || exceeded) {
-          save(e);
-        }
+      if (e.cancelable) {
+        if (isDragging) {
+          var expired = timeOf(e) - timeOf(baseEvent) > LOG_INTERVAL;
+          var exceeded = hasExceeded !== (hasExceeded = exceededLimit());
 
-        if (!isFade) {
-          Move.translate(basePosition + constrain(coordOf(e) - coordOf(baseEvent)));
-        }
+          if (expired || exceeded) {
+            save(e);
+          }
 
-        emit(EVENT_DRAGGING);
-        prevent(e);
-      } else {
-        var threshold = options.dragMinThreshold || 15;
-        isDragging = isMouse || abs(coordOf(e) - coordOf(baseEvent)) > threshold;
+          if (!isFade) {
+            Move.translate(basePosition + constrain(coordOf(e) - coordOf(baseEvent)));
+          }
 
-        if (isSliderDirection()) {
+          emit(EVENT_DRAGGING);
           prevent(e);
+        } else {
+          var threshold = options.dragMinThreshold || 15;
+          isDragging = isMouse || abs(coordOf(e) - coordOf(baseEvent)) > threshold;
+
+          if (isSliderDirection()) {
+            prevent(e);
+          }
         }
       }
     }
@@ -2335,29 +2311,24 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     }
 
     function destroy() {
-      if (target) {
-        unbind(target, "keydown");
+      unbind(target, "keydown");
 
-        if (isHTMLElement(target)) {
-          removeAttribute(target, TAB_INDEX);
-        }
+      if (isHTMLElement(target)) {
+        removeAttribute(target, TAB_INDEX);
       }
     }
 
     function onKeydown(e) {
-      var key = normalize(e.key);
+      var key = e.key;
+      var normalizedKey = includes(IE_ARROW_KEYS, key) ? "Arrow" + key : key;
 
-      if (key === resolve("ArrowLeft")) {
+      if (normalizedKey === resolve("ArrowLeft")) {
         Splide2.go("<");
-      } else if (key === resolve("ArrowRight")) {
+      } else if (normalizedKey === resolve("ArrowRight")) {
         Splide2.go(">");
       }
     }
 
-    function normalize(key) {
-      return includes(IE_ARROW_KEYS, key) ? "Arrow" + key : key;
-    }
-
     return {
       mount: mount,
       destroy: destroy
@@ -2888,11 +2859,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
     _proto.emit = function emit(event) {
       var _this$event;
 
-      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
-        args[_key2 - 1] = arguments[_key2];
-      }
-
-      (_this$event = this.event).emit.apply(_this$event, [event].concat(args));
+      (_this$event = this.event).emit.apply(_this$event, [event].concat(slice(arguments, 1)));
 
       return this;
     };

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/js/splide.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
dist/js/splide.min.js


BIN
dist/js/splide.min.js.gz


+ 2 - 0
dist/types/build/renderer.d.ts

@@ -0,0 +1,2 @@
+export { SplideRenderer as default } from '../renderer/SplideRenderer/SplideRenderer';
+//# sourceMappingURL=../../../src/js/build/renderer.d.ts.map

+ 1 - 0
dist/types/build/renderer.d.ts.map

@@ -0,0 +1 @@
+{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,MAAM,2CAA2C,CAAC"}

+ 1 - 1
dist/types/components/Direction/Direction.d.ts

@@ -16,11 +16,11 @@ export interface DirectionComponent extends BaseComponent {
  */
 export declare const ORIENTATION_MAP: {
     marginRight: string[];
-    width: string[];
     autoWidth: string[];
     fixedWidth: string[];
     paddingLeft: string[];
     paddingRight: string[];
+    width: string[];
     left: string[];
     right: string[];
     x: string[];

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

@@ -1 +1 @@
-{"version":3,"file":"Drag.d.ts","sourceRoot":"","sources":["Drag.ts"],"names":[],"mappings":"AAGA,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;IAClD,OAAO,CAAE,QAAQ,EAAE,OAAO,GAAI,IAAI,CAAA;CACnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,aAAa,CA8T9F"}
+{"version":3,"file":"Drag.d.ts","sourceRoot":"","sources":["Drag.ts"],"names":[],"mappings":"AAGA,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;IAClD,OAAO,CAAE,QAAQ,EAAE,OAAO,GAAI,IAAI,CAAA;CACnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,aAAa,CA4T9F"}

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

@@ -1 +1 @@
-{"version":3,"file":"Keyboard.d.ts","sourceRoot":"","sources":["Keyboard.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,iBAAkB,SAAQ,aAAa;CACvD;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,iBAAiB,CAmFtG"}
+{"version":3,"file":"Keyboard.d.ts","sourceRoot":"","sources":["Keyboard.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,iBAAkB,SAAQ,aAAa;CACvD;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,iBAAiB,CAuEtG"}

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

@@ -1 +1 @@
-{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["Layout.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,eAAgB,SAAQ,aAAa;IACpD,QAAQ,IAAI,MAAM,CAAC;IACnB,SAAS,CAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAI,MAAM,CAAC;IACzD,UAAU,IAAI,MAAM,CAAC;IACrB,SAAS,CAAE,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAI,MAAM,CAAC;IAC1D,UAAU,CAAE,KAAK,EAAE,OAAO,GAAI,MAAM,CAAC;CACtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,eAAe,CAoNlG"}
+{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["Layout.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,eAAgB,SAAQ,aAAa;IACpD,QAAQ,IAAI,MAAM,CAAC;IACnB,SAAS,CAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAI,MAAM,CAAC;IACzD,UAAU,IAAI,MAAM,CAAC;IACrB,SAAS,CAAE,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAI,MAAM,CAAC;IAC1D,UAAU,CAAE,KAAK,EAAE,OAAO,GAAI,MAAM,CAAC;CACtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,eAAe,CA6MlG"}

+ 1 - 1
dist/types/constructors/RequestInterval/RequestInterval.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"RequestInterval.d.ts","sourceRoot":"","sources":["RequestInterval.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAE,MAAM,CAAC,EAAE,OAAO,GAAI,IAAI,CAAC;IAChC,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,IAAI,CAAC;IACf,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,IAAI,EACtB,QAAQ,CAAC,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,EACnC,KAAK,CAAC,EAAE,MAAM,GACb,wBAAwB,CAoH1B"}
+{"version":3,"file":"RequestInterval.d.ts","sourceRoot":"","sources":["RequestInterval.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAE,MAAM,CAAC,EAAE,OAAO,GAAI,IAAI,CAAC;IAChC,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IACf,MAAM,IAAI,IAAI,CAAC;IACf,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,IAAI,EACtB,QAAQ,CAAC,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,EACnC,KAAK,CAAC,EAAE,MAAM,GACb,wBAAwB,CAmH1B"}

+ 1 - 1
dist/types/core/Splide/Splide.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"Splide.d.ts","sourceRoot":"","sources":["Splide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAO9D,OAAO,EAAY,gBAAgB,EAAE,cAAc,EAAS,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEpG,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAIxE;;;;GAIG;AACH,qBAAa,MAAM;IACjB;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAM;IAE9B;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM;;;;;;MAAU;IAEhC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,cAAc,CAA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AAO,CAAE,UAAU,CAAC,EAAE,OAAO,GAAI,IAAI;IAoBrC;;;;OAIG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;OAIG;IACH,IAAI,OAAO,CAAE,OAAO,EAAE,OAAO,EAO5B;IAED;;;;OAIG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;CACF"}

+ 0 - 1
dist/types/utils/arrayLike/index.d.ts

@@ -1,4 +1,3 @@
 export { slice } from './slice/slice';
-export { splice } from './splice/splice';
 export { find } from './find/find';
 //# sourceMappingURL=../../../../src/js/utils/arrayLike/index.d.ts.map

+ 1 - 1
dist/types/utils/arrayLike/index.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAO,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAQ,aAAa,CAAC"}
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAO,eAAe,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAQ,aAAa,CAAC"}

+ 0 - 14
dist/types/utils/arrayLike/splice/splice.d.ts

@@ -1,14 +0,0 @@
-/**
- * The splice method for an array-like object.
- *
- * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
- *
- * @param arrayLike   - An array-like object.
- * @param start       - A start index.
- * @param deleteCount - Optional. A number of elements to remove from the `start` index.
- * @param args        - Optional. Any number of items to add.
- *
- * @return An array with deleted items.
- */
-export declare function splice<T>(arrayLike: ArrayLike<T>, start: number, deleteCount?: number, ...args: T[]): T[];
-//# sourceMappingURL=../../../../../src/js/utils/arrayLike/splice/splice.d.ts.map

+ 0 - 1
dist/types/utils/arrayLike/splice/splice.d.ts.map

@@ -1 +0,0 @@
-{"version":3,"file":"splice.d.ts","sourceRoot":"","sources":["splice.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAG,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,GAAI,CAAC,EAAE,CAE3G"}

+ 1 - 1
dist/types/utils/dom/addClass/addClass.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"addClass.d.ts","sourceRoot":"","sources":["addClass.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAI,IAAI,CAEzE"}
+{"version":3,"file":"addClass.d.ts","sourceRoot":"","sources":["addClass.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAI,IAAI,CAEzE"}

+ 1 - 1
dist/types/utils/math/approximatelyEqual/approximatelyEqual.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"approximatelyEqual.d.ts","sourceRoot":"","sources":["approximatelyEqual.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAI,OAAO,CAEnF"}
+{"version":3,"file":"approximatelyEqual.d.ts","sourceRoot":"","sources":["approximatelyEqual.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAI,OAAO,CAEnF"}

+ 1 - 1
dist/types/utils/math/between/between.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"between.d.ts","sourceRoot":"","sources":["between.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAI,OAAO,CAI1G"}
+{"version":3,"file":"between.d.ts","sourceRoot":"","sources":["between.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAI,OAAO,CAI1G"}

+ 1 - 1
dist/types/utils/math/clamp/clamp.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["clamp.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAI,MAAM,CAIpE"}
+{"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["clamp.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAI,MAAM,CAIpE"}

+ 1 - 1
dist/types/utils/math/index.d.ts

@@ -2,5 +2,5 @@ export { approximatelyEqual } from './approximatelyEqual/approximatelyEqual';
 export { between } from './between/between';
 export { clamp } from './clamp/clamp';
 export { sign } from './sign/sign';
-export declare const min: (...values: number[]) => number, max: (...values: number[]) => number, floor: (x: number) => number, ceil: (x: number) => number, abs: (x: number) => number, round: (x: number) => number;
+export * from './math/math';
 //# sourceMappingURL=../../../../src/js/utils/math/index.d.ts.map

+ 1 - 1
dist/types/utils/math/index.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAiB,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAmB,eAAe,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAoB,aAAa,CAAC;AAEjD,eAAO,MAAQ,GAAG,mCAAE,GAAG,mCAAE,KAAK,yBAAE,IAAI,yBAAE,GAAG,yBAAE,KAAK,uBAAS,CAAC"}
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAiB,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAmB,eAAe,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAoB,aAAa,CAAC;AAEjD,cAAc,aAAa,CAAC"}

+ 1 - 1
dist/types/utils/object/assign/assign.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"assign.d.ts","sourceRoot":"","sources":["assign.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,oBAAY,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAEhD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAG,MAAM,EAAE,CAAC,GAAI,CAAC,CAAC;AAGzD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAAG,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEjG,wBAAgB,MAAM,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CAAC;AAE7B,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,MAAM,EAC9F,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,GAC/C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC"}

+ 1 - 1
src/js/components/Direction/Direction.ts

@@ -20,11 +20,11 @@ export interface DirectionComponent extends BaseComponent {
  */
 export const ORIENTATION_MAP = {
   marginRight : [ 'marginBottom', 'marginLeft' ],
-  width       : [ 'height' ],
   autoWidth   : [ 'autoHeight' ],
   fixedWidth  : [ 'fixedHeight' ],
   paddingLeft : [ 'paddingTop', 'paddingRight' ],
   paddingRight: [ 'paddingBottom', 'paddingLeft' ],
+  width       : [ 'height' ],
   left        : [ 'top', 'right' ],
   right       : [ 'bottom', 'left' ],
   x           : [ 'y' ],

+ 18 - 20
src/js/components/Drag/Drag.ts

@@ -153,30 +153,28 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
 
     lastEvent = e;
 
-    if ( ! e.cancelable ) {
-      return;
-    }
-
-    if ( isDragging ) {
-      const expired  = timeOf( e ) - timeOf( baseEvent ) > LOG_INTERVAL;
-      const exceeded = hasExceeded !== ( hasExceeded = exceededLimit() );
+    if ( e.cancelable ) {
+      if ( isDragging ) {
+        const expired  = timeOf( e ) - timeOf( baseEvent ) > LOG_INTERVAL;
+        const exceeded = hasExceeded !== ( hasExceeded = exceededLimit() );
 
-      if ( expired || exceeded ) {
-        save( e );
-      }
-
-      if ( ! isFade ) {
-        Move.translate( basePosition + constrain( coordOf( e ) - coordOf( baseEvent ) ) );
-      }
+        if ( expired || exceeded ) {
+          save( e );
+        }
 
-      emit( EVENT_DRAGGING );
-      prevent( e );
-    } else {
-      const threshold = options.dragMinThreshold || 15;
-      isDragging = isMouse || abs( coordOf( e ) - coordOf( baseEvent ) ) > threshold;
+        if ( ! isFade ) {
+          Move.translate( basePosition + constrain( coordOf( e ) - coordOf( baseEvent ) ) );
+        }
 
-      if ( isSliderDirection() ) {
+        emit( EVENT_DRAGGING );
         prevent( e );
+      } else {
+        const threshold = options.dragMinThreshold || 15;
+        isDragging = isMouse || abs( coordOf( e ) - coordOf( baseEvent ) ) > threshold;
+
+        if ( isSliderDirection() ) {
+          prevent( e );
+        }
       }
     }
   }

+ 1 - 1
src/js/components/Elements/Elements.ts

@@ -140,7 +140,7 @@ export function Elements( Splide: Splide, Components: Components, options: Optio
     track  = query( root, `.${ CLASS_TRACK }` );
     list   = child( track, `.${ CLASS_LIST }` );
 
-    assert( track && list, 'Missing a track/list element.' );
+    assert( track && list, 'A track/list element is missing.' );
 
     push( slides, children( list, `.${ CLASS_SLIDE }:not(.${ CLASS_CLONE })` ) );
 

+ 7 - 19
src/js/components/Keyboard/Keyboard.ts

@@ -76,12 +76,10 @@ export function Keyboard( Splide: Splide, Components: Components, options: Optio
    * Destroys the component.
    */
   function destroy() {
-    if ( target ) {
-      unbind( target, 'keydown' );
+    unbind( target, 'keydown' );
 
-      if ( isHTMLElement( target ) ) {
-        removeAttribute( target, TAB_INDEX );
-      }
+    if ( isHTMLElement( target ) ) {
+      removeAttribute( target, TAB_INDEX );
     }
   }
 
@@ -91,26 +89,16 @@ export function Keyboard( Splide: Splide, Components: Components, options: Optio
    * @param e - A KeyboardEvent object.
    */
   function onKeydown( e: KeyboardEvent ): void {
-    const key = normalize( e.key );
+    const { key } = e;
+    const normalizedKey = includes( IE_ARROW_KEYS, key ) ? `Arrow${ key }` : key;
 
-    if ( key === resolve( 'ArrowLeft' ) ) {
+    if ( normalizedKey === resolve( 'ArrowLeft' ) ) {
       Splide.go( '<' );
-    } else if ( key === resolve( 'ArrowRight' ) ) {
+    } else if ( normalizedKey === resolve( 'ArrowRight' ) ) {
       Splide.go( '>' );
     }
   }
 
-  /**
-   * Absorbs the difference of key names among browsers.
-   *
-   * @param key - A key to normalize.
-   *
-   * @return A normalized key.
-   */
-  function normalize( key: string ): string {
-    return includes( IE_ARROW_KEYS, key ) ? `Arrow${ key }` : key;
-  }
-
   return {
     mount,
     destroy,

+ 3 - 10
src/js/components/Layout/Layout.ts

@@ -93,7 +93,7 @@ export function Layout( Splide: Splide, Components: Components, options: Options
   function cssPadding( right: boolean ): string {
     const { padding } = options;
     const prop = resolve( right ? 'right' : 'left', true );
-    return padding ? unit( padding[ prop ] || ( isObject( padding ) ? '0' : padding ) ) : '';
+    return padding && unit( padding[ prop ] || ( isObject( padding ) ? 0 : padding ) ) || '0px';
   }
 
   /**
@@ -106,15 +106,8 @@ export function Layout( Splide: Splide, Components: Components, options: Options
 
     if ( vertical ) {
       height = cssHeight();
-      assert( height, '"height" or "heightRatio" is missing.' );
-
-      const paddingTop    = cssPadding( false );
-      const paddingBottom = cssPadding( true );
-
-      if ( paddingTop || paddingBottom ) {
-        height = `calc(${ height }`;
-        height += `${ paddingTop ? ` - ${ paddingTop }` : '' }${ paddingBottom ? ` - ${ paddingBottom }` : '' })`;
-      }
+      assert( height, 'height or heightRatio is missing.' );
+      height = `calc(${ height } - ${ cssPadding( false ) } - ${ cssPadding( true ) })`;
     }
 
     return height;

+ 1 - 1
src/js/components/Layout/test/ltr.test.ts

@@ -22,7 +22,7 @@ describe( 'Layout in the LTR mode', () => {
     const rule3   = findRuleBy( splide3.Components.Elements.track );
 
     expect( rule3.style.paddingLeft ).toBe( '4%' );
-    expect( rule3.style.paddingRight ).toBe( '0' );
+    expect( rule3.style.paddingRight ).toBe( '0px' );
     splide3.destroy();
   } );
 

+ 3 - 3
src/js/components/Layout/test/ttb.test.ts

@@ -22,7 +22,7 @@ describe( 'Layout in the TTB mode', () => {
     const rule3   = findRuleBy( splide3.Components.Elements.track );
 
     expect( rule3.style.paddingTop ).toBe( '4%' );
-    expect( rule3.style.paddingBottom ).toBe( '0' );
+    expect( rule3.style.paddingBottom ).toBe( '0px' );
     splide3.destroy();
   } );
 
@@ -40,7 +40,7 @@ describe( 'Layout in the TTB mode', () => {
     const splide = init( { height: 100, direction: TTB } );
     const rule   = findRuleBy( splide.Components.Elements.track );
 
-    expect( rule.style.height ).toBe( '100px' );
+    expect( rule.style.height ).toBe( 'calc(100px - 0px - 0px)' );
     splide.destroy();
   } );
 
@@ -56,7 +56,7 @@ describe( 'Layout in the TTB mode', () => {
     const splide = init( { width: 500, heightRatio: 0.5, direction: TTB } );
     const rule   = findRuleBy( splide.Components.Elements.track );
 
-    expect( rule.style.height ).toBe( '250px' );
+    expect( rule.style.height ).toBe( 'calc(250px - 0px - 0px)' );
     splide.destroy();
   } );
 

+ 1 - 2
src/js/constructors/RequestInterval/RequestInterval.ts

@@ -79,8 +79,7 @@ export function RequestInterval(
         onInterval();
 
         if ( limit && ++count >= limit ) {
-          pause();
-          return;
+          return pause();
         }
       }
 

+ 5 - 3
src/js/core/Splide/Splide.ts

@@ -9,7 +9,7 @@ import { FADE } from '../../constants/types';
 import { EventBus, EventBusCallback, EventBusObject, State, StateObject } from '../../constructors';
 import { Fade, Slide } from '../../transitions';
 import { ComponentConstructor, Components, Options } from '../../types';
-import { addClass, assert, assign, empty, forOwn, isString, merge, query } from '../../utils';
+import { addClass, assert, assign, empty, forOwn, isString, merge, query, slice } from '../../utils';
 
 
 /**
@@ -253,8 +253,10 @@ export class Splide {
    *
    * @return `this`
    */
-  emit( event: string, ...args: any[] ): this {
-    this.event.emit( event, ...args );
+  emit( event: string, ...args: any[] ): this;
+  emit( event: string ): this {
+    // eslint-disable-next-line prefer-rest-params, prefer-spread
+    this.event.emit( event, ...slice( arguments, 1 ) );
     return this;
   }
 

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

@@ -24,6 +24,10 @@ $settings = get_settings();
         gap    : '1.5rem',
         height : 200,
         focus  : 'center',
+        classes: {
+          arrows: 'splide__arrows splide__test',
+          clone : 'splide__clone splide__test',
+        }
       } );
 
       splide.on( 'moved', () => {

+ 0 - 1
src/js/utils/arrayLike/index.ts

@@ -1,3 +1,2 @@
 export { slice }  from './slice/slice';
-export { splice } from './splice/splice';
 export { find }   from './find/find';

+ 0 - 21
src/js/utils/arrayLike/splice/splice.test.ts

@@ -1,21 +0,0 @@
-import { splice } from './splice';
-import ArrayLike = jasmine.ArrayLike;
-
-
-describe( 'splice', () => {
-  let arrayLike: ArrayLike<string>;
-
-  beforeEach( () => {
-    arrayLike = { length: 3, 0: '1', 1: '2', 2: '3' };
-  } );
-
-  test( 'can delete an item from an array-like object.', () => {
-    splice( arrayLike, 1, 1 );
-    expect( arrayLike ).toStrictEqual( { length: 2, 0: '1', 1: '3' } );
-  } );
-
-  test( 'can add item at the specified position.', () => {
-    splice( arrayLike, 1, 0, 'a' );
-    expect( arrayLike ).toStrictEqual( { length: 4, 0: '1', 1: 'a', 2: '2', 3: '3' } );
-  } );
-} );

+ 0 - 18
src/js/utils/arrayLike/splice/splice.ts

@@ -1,18 +0,0 @@
-import { arrayProto } from '../../array';
-
-
-/**
- * The splice method for an array-like object.
- *
- * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
- *
- * @param arrayLike   - An array-like object.
- * @param start       - A start index.
- * @param deleteCount - Optional. A number of elements to remove from the `start` index.
- * @param args        - Optional. Any number of items to add.
- *
- * @return An array with deleted items.
- */
-export function splice<T>( arrayLike: ArrayLike<T>, start: number, deleteCount?: number, ...args: T[] ): T[] {
-  return arrayProto.splice.call( arrayLike, start, deleteCount, ...args );
-}

+ 2 - 1
src/js/utils/dom/addClass/addClass.ts

@@ -1,3 +1,4 @@
+import { isString } from '../../type/type';
 import { toggleClass } from '../toggleClass/toggleClass';
 
 
@@ -8,5 +9,5 @@ import { toggleClass } from '../toggleClass/toggleClass';
  * @param classes - Classes to add.
  */
 export function addClass( elm: Element, classes: string | string[] ): void {
-  toggleClass( elm, classes, true );
+  toggleClass( elm, isString( classes ) ? classes.split( ' ' ) : classes, true );
 }

+ 4 - 10
src/js/utils/dom/create/create.ts

@@ -1,4 +1,4 @@
-import { isArray, isString } from '../../type/type';
+import { isString } from '../../type/type';
 import { addClass } from '../addClass/addClass';
 import { append } from '../append/append';
 import { setAttribute } from '../setAttribute/setAttribute';
@@ -25,22 +25,16 @@ export function create(
  */
 export function create<K extends keyof HTMLElementTagNameMap>(
   tag: K,
-  attrs?: Record<string, string | number | boolean> | string | string[],
+  attrs?: Record<string, string | number | boolean> | string,
   parent?: HTMLElement
 ): HTMLElementTagNameMap[ K ] {
   const elm = document.createElement( tag );
 
   if ( attrs ) {
-    if ( isString( attrs ) || isArray( attrs ) ) {
-      addClass( elm, attrs );
-    } else {
-      setAttribute( elm, attrs );
-    }
+    isString( attrs ) ? addClass( elm, attrs ) : setAttribute( elm, attrs );
   }
 
-  if ( parent ) {
-    append( parent, elm );
-  }
+  parent && append( parent, elm );
 
   return elm;
 }

+ 4 - 1
src/js/utils/math/approximatelyEqual/approximatelyEqual.ts

@@ -1,3 +1,6 @@
+import { abs } from '../math/math';
+
+
 /**
  * Checks if the provided 2 numbers are approximately equal or not.
  *
@@ -8,5 +11,5 @@
  * @return `true` if 2 numbers are considered to be equal, or otherwise `false`.
  */
 export function approximatelyEqual( x: number, y: number, epsilon: number ): boolean {
-  return Math.abs( x - y ) < epsilon;
+  return abs( x - y ) < epsilon;
 }

+ 6 - 3
src/js/utils/math/between/between.ts

@@ -1,3 +1,6 @@
+import { max, min } from '../math/math';
+
+
 /**
  * Checks if the subject number is between `minOrMax` and `maxOrMin`.
  *
@@ -7,7 +10,7 @@
  * @param exclusive - Optional. Whether to exclude `x` or `y`.
  */
 export function between( number: number, minOrMax: number, maxOrMin: number, exclusive?: boolean ): boolean {
-  const min = Math.min( minOrMax, maxOrMin );
-  const max = Math.max( minOrMax, maxOrMin );
-  return exclusive ? min < number && number < max : min <= number && number <= max;
+  const minimum = min( minOrMax, maxOrMin );
+  const maximum = max( minOrMax, maxOrMin );
+  return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum;
 }

+ 2 - 1
src/js/utils/math/clamp/clamp.ts

@@ -1,4 +1,5 @@
-const { max, min } = Math;
+import { max, min } from '../math/math';
+
 
 /**
  * Clamps a number.

+ 1 - 1
src/js/utils/math/index.ts

@@ -3,4 +3,4 @@ export { between }            from './between/between';
 export { clamp }              from './clamp/clamp';
 export { sign }               from './sign/sign';
 
-export const { min, max, floor, ceil, abs, round } = Math;
+export * from './math/math';

+ 1 - 0
src/js/utils/math/math/math.ts

@@ -0,0 +1 @@
+export const { min, max, floor, ceil, abs } = Math;

+ 5 - 4
src/js/utils/object/assign/assign.ts

@@ -1,3 +1,4 @@
+import { slice } from '../../arrayLike';
 import { forOwn } from '../forOwn/forOwn';
 
 
@@ -28,13 +29,13 @@ export function assign<T extends object, U1 extends object, U2 extends object, U
  * Assigns all own enumerable properties of all source objects to the provided object.
  * `undefined` in source objects will be skipped.
  *
- * @param object  - An object to assign properties to.
- * @param sources - Objects to assign properties from.
+ * @param object - An object to assign properties to.
  *
  * @return An object assigned properties of the sources to.
  */
-export function assign<T extends object, U extends object>( object: T, ...sources: U[] ): any {
-  sources.forEach( source => {
+export function assign<T extends object>( object: T ): any {
+  // eslint-disable-next-line prefer-rest-params, prefer-spread
+  slice( arguments, 1 ).forEach( source => {
     forOwn( source, ( value, key ) => {
       object[ key ] = source[ key ];
     } );

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.