hplx-react-elements-dev 1.1.4 → 1.1.5

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.
Files changed (2) hide show
  1. package/dist/esm/index.js +17 -1
  2. package/package.json +1 -1
package/dist/esm/index.js CHANGED
@@ -20530,17 +20530,24 @@ var ImageCarousel = function ImageCarousel(_a) {
20530
20530
  current = _h[0],
20531
20531
  setCurrent = _h[1];
20532
20532
 
20533
+ var _j = useState(autoPlay),
20534
+ isAutoPlay = _j[0],
20535
+ setIsAutoPlay = _j[1];
20536
+
20533
20537
  var length = imageList.length;
20534
20538
 
20535
20539
  var nextSlide = function nextSlide() {
20536
20540
  setCurrent(current === length - 1 ? 0 : current + 1);
20541
+ setIsAutoPlay(false);
20537
20542
  };
20538
20543
 
20539
20544
  var prevSlide = function prevSlide() {
20545
+ setIsAutoPlay(false);
20540
20546
  setCurrent(current === 0 ? length - 1 : current - 1);
20541
20547
  };
20542
20548
 
20543
20549
  var goToSlide = function goToSlide(slideNumber) {
20550
+ setIsAutoPlay(false);
20544
20551
  setCurrent(slideNumber);
20545
20552
  };
20546
20553
 
@@ -20557,9 +20564,18 @@ var ImageCarousel = function ImageCarousel(_a) {
20557
20564
  autoPlay = false;
20558
20565
  }
20559
20566
 
20560
- if (timeInterval > 0 && autoPlay) {
20567
+ if (timeInterval > 0 && isAutoPlay) {
20561
20568
  setTimeout(function () {
20562
20569
  nextSlide();
20570
+ setIsAutoPlay(autoPlay);
20571
+ }, timeInterval);
20572
+ }
20573
+
20574
+ if (timeInterval > 0 && isAutoPlay && !isAutoPlay) {
20575
+ setTimeout(function () {
20576
+ if (autoPlay) {
20577
+ setIsAutoPlay(autoPlay);
20578
+ }
20563
20579
  }, timeInterval);
20564
20580
  }
20565
20581
 
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "frontend",
10
10
  "healthplix"
11
11
  ],
12
- "version": "1.1.4",
12
+ "version": "1.1.5",
13
13
  "main": "dist/esm/index.js",
14
14
  "module": "dist/esm/index.js",
15
15
  "types": "dist/esm/index.d.ts",