astro-swiper 2.6.0 → 2.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-swiper",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Astro component for swiper, dedicated to slider / carousel / photo swiper / slide, including thumbnails",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -61,6 +61,6 @@
61
61
  "thumbnail"
62
62
  ],
63
63
  "dependencies": {
64
- "swiper": "^12.1.3"
64
+ "swiper": "^12.1.4"
65
65
  }
66
66
  }
@@ -81,10 +81,10 @@ if (options?.astro?.thumbSwiperUniqueSelector === undefined && Astro.props.linkT
81
81
  // Init swipers that have delayed initialization because the thumbnail swiper is not created yet
82
82
  // If this is now the case, then it is intialized, as well as its observer if needed
83
83
  function _initDelayedSwipers() {
84
- Object.keys(_useDelaySwiper).forEach((delayedSelector) => {
84
+ Object.keys(_useDelaySwiper).forEach((delayedSelector: string) => {
85
85
  // swiper of uniqueSelector "delayedSelector" is delayed because it needs the swiper of uniqueSelector
86
86
  // "delayedThumbSelector" to be created first
87
- const delayedThumbSelector = _useDelaySwiper[delayedSelector];
87
+ const delayedThumbSelector: selectorStringType = _useDelaySwiper[delayedSelector] as selectorStringType;
88
88
  const swiper = getSwiperFromUniqueSelector(
89
89
  delayedThumbSelector,
90
90
  getSwiperFromUniqueSelectorOptions,
@@ -99,7 +99,7 @@ if (options?.astro?.thumbSwiperUniqueSelector === undefined && Astro.props.linkT
99
99
  };
100
100
 
101
101
  _createSwiperAndObserver(
102
- delayedSelector,
102
+ delayedSelector as selectorStringType,
103
103
  delayedOptions,
104
104
  document.querySelector(delayedSelector) as AstroSwiper,
105
105
  );
@@ -192,7 +192,7 @@ if (options?.astro?.thumbSwiperUniqueSelector === undefined && Astro.props.linkT
192
192
  const options: AstroSwiperOptions = JSON.parse(this.dataset.options || '{}');
193
193
  // to have more than 1 swiper in a single page
194
194
  const uniqueSelector: selectorStringType = `.${this.dataset.uniqueclass}`;
195
- const thumbSwiperUniqueSelector = options.astro?.thumbSwiperUniqueSelector;
195
+ const thumbSwiperUniqueSelector: selectorStringType = options.astro?.thumbSwiperUniqueSelector as selectorStringType;
196
196
 
197
197
  // no thumbnail link, or link to thumbnail swiper already created,
198
198
  // the swiper can be created or not immediatly depending on the observer option
@@ -220,5 +220,5 @@ if (options?.astro?.thumbSwiperUniqueSelector === undefined && Astro.props.linkT
220
220
  }
221
221
  }
222
222
 
223
- customElements.define('astro-swiper', AstroSwiper);
223
+ customElements.get('astro-swiper') || customElements.define('astro-swiper', AstroSwiper);
224
224
  </script>