@creative-web-solution/front-library 7.1.29 → 7.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 7.1.31
4
+
5
+ * [DragSlider]: Fix the move range when using api
6
+
7
+
8
+ ## 7.1.30
9
+
10
+ * [DragSlider]: Fix link cancellation
11
+
12
+
3
13
  ## 7.1.29
4
14
 
5
15
  * [DragSlider]: Fix callback issue
@@ -140,13 +140,11 @@ export default class DragSlider {
140
140
  }
141
141
 
142
142
  #cancelLinkClick = (): void => {
143
- aClass(this.#$slider, this.#options.dragClass);
143
+ wait().then(() => aClass(this.#$slider, this.#options.dragClass));
144
144
  };
145
145
 
146
146
  #activeLinkClick = (): void => {
147
- wait().then(() => {
148
- rClass(this.#$slider, this.#options.dragClass);
149
- });
147
+ wait().then(() => rClass(this.#$slider, this.#options.dragClass));
150
148
  };
151
149
 
152
150
  #onResize = (): void => {
@@ -455,8 +453,6 @@ export default class DragSlider {
455
453
  $target: HTMLElement,
456
454
  coords: FLib.Events.Gesture.Coords
457
455
  ): void => {
458
- this.#cancelLinkClick();
459
-
460
456
  this.#deltaMove.deltaX =
461
457
  coords.pageX -
462
458
  (this.#startDragCoords as FLib.Events.Gesture.Coords).pageX;
@@ -468,6 +464,8 @@ export default class DragSlider {
468
464
  return;
469
465
  }
470
466
 
467
+ this.#cancelLinkClick();
468
+
471
469
  this.#deltaMove.newX = this.#deltaMove.deltaX + this.#deltaMove.x;
472
470
  this.#deltaMove.newX = Math.max(
473
471
  Math.min(this.#minXPos, this.#deltaMove.newX),
@@ -572,12 +570,18 @@ export default class DragSlider {
572
570
 
573
571
  this.#currentSnapItem = ITEM;
574
572
 
575
- const xPos = -1 * ITEM.info.left + this.#siteOffsetLeft;
573
+ const finalX = Math.max(
574
+ Math.min(
575
+ this.#minXPos,
576
+ -1 * ITEM.info.left + this.#siteOffsetLeft
577
+ ),
578
+ this.#maxXPos
579
+ );
576
580
 
577
- this.#options.onSnap?.(this.#getCallbackOptions(xPos, ITEM));
581
+ this.#options.onSnap?.(this.#getCallbackOptions(finalX, ITEM));
578
582
 
579
583
  return this.#options
580
- ._animMoveItem(this.#$list, xPos, (x) => {
584
+ ._animMoveItem(this.#$list, finalX, (x) => {
581
585
  this.#deltaMove.x = x;
582
586
 
583
587
  this.#options.onSnapUpdate?.(
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Front Library
2
2
 
3
- @version: 7.1.29
3
+ @version: 7.1.31
4
4
 
5
5
 
6
6
  ## Use
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@creative-web-solution/front-library",
3
3
  "title": "Frontend library",
4
4
  "description": "Frontend functions and modules",
5
- "version": "7.1.29",
5
+ "version": "7.1.31",
6
6
  "homepage": "https://github.com/creative-web-solution/front-library",
7
7
  "author": "Creative Web Solution <contact@cws-studio.com> (https://www.cws-studio.com)",
8
8
  "keywords": [],