@creative-web-solution/front-library 7.1.44 → 7.1.46

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,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 7.1.46
4
+
5
+ * [Slider]: Fix bullet pager
6
+
7
+ ## 7.1.45
8
+
9
+ * [Slider]: Fix type
10
+ * [DragSlider]: The feature that make slide outside viewport inert is tied to an option
11
+
3
12
  ## 7.1.44
4
13
 
5
14
  * [SkinSelect]: Fix click handler on full skinned select
@@ -12,6 +12,7 @@ const defaultOptions = {
12
12
  swipeTresholdMin: 40,
13
13
  swipeTresholdSize: 0.5,
14
14
  lockedClass: "is-locked",
15
+ makeSlideOutideViewportInert: false,
15
16
  _animReset: function ($list) {
16
17
  // gsap.set( $list, {
17
18
  // "x": 0,
@@ -597,16 +598,20 @@ export default class DragSlider {
597
598
  this.#viewportInfo.width;
598
599
 
599
600
  if (hideElement1 || hideElement2) {
600
- item.$item.setAttribute("tabindex", "-1");
601
- item.$item.setAttribute("inert", "");
602
- item.$item.setAttribute("aria-hidden", "true");
601
+ if (this.#options.makeSlideOutideViewportInert) {
602
+ item.$item.setAttribute("tabindex", "-1");
603
+ item.$item.setAttribute("inert", "");
604
+ item.$item.setAttribute("aria-hidden", "true");
605
+ }
603
606
  this.#hiddenItems.push(item);
604
607
  return;
605
608
  }
606
609
 
607
- item.$item.removeAttribute("tabindex");
608
- item.$item.removeAttribute("inert");
609
- item.$item.setAttribute("aria-hidden", "false");
610
+ if (this.#options.makeSlideOutideViewportInert) {
611
+ item.$item.removeAttribute("tabindex");
612
+ item.$item.removeAttribute("inert");
613
+ item.$item.setAttribute("aria-hidden", "false");
614
+ }
610
615
  this.#visibleItems.push(item);
611
616
  });
612
617
  };
@@ -399,19 +399,19 @@ 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
+ if ( currentSlide && this.#$bullets[ currentSlide.pageIndex ] ) {
408
+ const $BULLET = this.#$bullets[ currentSlide.pageIndex ] as HTMLElement;
409
409
  $BULLET.setAttribute( 'aria-selected', 'false' );
410
410
  $BULLET.setAttribute( 'tabindex', '-1' );
411
411
  }
412
412
 
413
- if ( targetSlide && this.#$bullets[ targetSlide.index ] ) {
414
- const $BULLET = this.#$bullets[ targetSlide.index ] as HTMLElement;
413
+ if ( targetSlide && this.#$bullets[ targetSlide.pageIndex ] ) {
414
+ const $BULLET = this.#$bullets[ targetSlide.pageIndex ] as HTMLElement;
415
415
  $BULLET.setAttribute( 'aria-selected', 'true' );
416
416
  $BULLET.setAttribute( 'tabindex', '0' );
417
417
  }
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Front Library
2
2
 
3
- @version: 7.1.44
3
+ @version: 7.1.46
4
4
 
5
5
 
6
6
  ## Use
@@ -31,6 +31,7 @@ declare namespace FLib {
31
31
  viewportSelector: string;
32
32
  listSelector: string;
33
33
  itemSelector: string;
34
+ makeSlideOutideViewportInert: boolean;
34
35
  dragClass: string;
35
36
  /** @defaultValue is-locked */
36
37
  lockedClass: string;
package/Types/Slider.d.ts CHANGED
@@ -44,7 +44,7 @@ declare namespace FLib {
44
44
  $button?: HTMLElement
45
45
  }
46
46
  type Callback = ( data: CallbackParam ) => void;
47
- type InitCallback = ({ currentSlide: SlidePropertiesType }) => void;
47
+ type InitCallback = ({ currentSlide }: { currentSlide: SlideProperties }) => void;
48
48
 
49
49
  type Options = {
50
50
  /** @defaultValue 0 */
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.44",
5
+ "version": "7.1.46",
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": [],