@creative-web-solution/front-library 7.1.45 → 7.1.47

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,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 7.1.47
4
+
5
+ * [Slider]: Fix bullet pager
6
+
7
+ ## 7.1.46
8
+
9
+ * [Slider]: Fix bullet pager
10
+
3
11
  ## 7.1.45
4
12
 
5
13
  * [Slider]: Fix type
@@ -116,6 +116,10 @@ export default class Slider {
116
116
  return this.#options.moveByPage ? this.#nbPages : this.#nbSlides;
117
117
  }
118
118
 
119
+ get options(): FLib.Slider.Options {
120
+ return this.#options;
121
+ }
122
+
119
123
 
120
124
  constructor( $slider: HTMLElement, userOptions: Partial<FLib.Slider.Options> = {} ) {
121
125
 
@@ -399,19 +399,23 @@ export default class SliderControls {
399
399
  }
400
400
 
401
401
 
402
- #updateBullets = ( targetSlide: Slide, currentSlide?: Slide ): void => {
402
+ #updateBullets = ( targetSlide: FLib.Slider.SlideProperties, currentSlide?: FLib.Slider.SlideProperties ): void => {
403
403
  if ( !this.#$bullets ) {
404
404
  return;
405
405
  }
406
406
 
407
- if ( currentSlide && this.#$bullets[ currentSlide.index ] ) {
408
- const $BULLET = this.#$bullets[ currentSlide.index ] as HTMLElement;
407
+ const currentSlideIndex = (this.#slider.options.moveByPage ? currentSlide?.pageIndex : currentSlide?.index) ?? 0;
408
+
409
+ if ( currentSlide && this.#$bullets[ currentSlideIndex ] ) {
410
+ const $BULLET = this.#$bullets[ currentSlideIndex ] as HTMLElement;
409
411
  $BULLET.setAttribute( 'aria-selected', 'false' );
410
412
  $BULLET.setAttribute( 'tabindex', '-1' );
411
413
  }
412
414
 
413
- if ( targetSlide && this.#$bullets[ targetSlide.index ] ) {
414
- const $BULLET = this.#$bullets[ targetSlide.index ] as HTMLElement;
415
+ const targetlideIndex = (this.#slider.options.moveByPage ? targetSlide?.pageIndex : targetSlide?.index) ?? 0;
416
+
417
+ if ( targetSlide && this.#$bullets[ targetlideIndex ] ) {
418
+ const $BULLET = this.#$bullets[ targetlideIndex ] as HTMLElement;
415
419
  $BULLET.setAttribute( 'aria-selected', 'true' );
416
420
  $BULLET.setAttribute( 'tabindex', '0' );
417
421
  }
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Front Library
2
2
 
3
- @version: 7.1.45
3
+ @version: 7.1.47
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.45",
5
+ "version": "7.1.47",
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": [],