@gem-sdk/swiper 0.0.16-dev.1 → 0.0.18-dev.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Swiper 0.0.16-dev.1
2
+ * Swiper 0.0.18-dev.1
3
3
  * Gem SDK - Swiper, Customized of swiper
4
4
  * https://swiperjs.com
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: March 20, 2026
10
+ * Released on: March 25, 2026
11
11
  */
12
12
 
13
13
  import{S as Swiper}from"./shared/swiper-core.min.mjs";import Virtual from"./modules/virtual.min.mjs";import Keyboard from"./modules/keyboard.min.mjs";import Mousewheel from"./modules/mousewheel.min.mjs";import Navigation from"./modules/navigation.min.mjs";import Pagination from"./modules/pagination.min.mjs";import Scrollbar from"./modules/scrollbar.min.mjs";import Parallax from"./modules/parallax.min.mjs";import Zoom from"./modules/zoom.min.mjs";import Controller from"./modules/controller.min.mjs";import A11y from"./modules/a11y.min.mjs";import History from"./modules/history.min.mjs";import HashNavigation from"./modules/hash-navigation.min.mjs";import Autoplay from"./modules/autoplay.min.mjs";import Thumb from"./modules/thumbs.min.mjs";import freeMode from"./modules/free-mode.min.mjs";import Grid from"./modules/grid.min.mjs";import Manipulation from"./modules/manipulation.min.mjs";import EffectFade from"./modules/effect-fade.min.mjs";import EffectCube from"./modules/effect-cube.min.mjs";import EffectFlip from"./modules/effect-flip.min.mjs";import EffectCoverflow from"./modules/effect-coverflow.min.mjs";import EffectCreative from"./modules/effect-creative.min.mjs";import EffectCards from"./modules/effect-cards.min.mjs";const modules=[Virtual,Keyboard,Mousewheel,Navigation,Pagination,Scrollbar,Parallax,Zoom,Controller,A11y,History,HashNavigation,Autoplay,Thumb,freeMode,Grid,Manipulation,EffectFade,EffectCube,EffectFlip,EffectCoverflow,EffectCreative,EffectCards];Swiper.use(modules);export{Swiper,Swiper as default};
package/swiper-bundle.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Swiper 0.0.16-dev.1
2
+ * Swiper 0.0.18-dev.1
3
3
  * Gem SDK - Swiper, Customized of swiper
4
4
  * https://swiperjs.com
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: March 20, 2026
10
+ * Released on: March 25, 2026
11
11
  */
12
12
 
13
13
  import { S as Swiper } from './shared/swiper-core.mjs';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Swiper 0.0.16-dev.1
2
+ * Swiper 0.0.18-dev.1
3
3
  * Gem SDK - Swiper, Customized of swiper
4
4
  * https://swiperjs.com
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: March 20, 2026
10
+ * Released on: March 25, 2026
11
11
  */
12
12
 
13
13
  export{c as createShadow}from"./shared/create-shadow.min.mjs";export{e as effectInit}from"./shared/effect-init.min.mjs";export{e as effectTarget}from"./shared/effect-target.min.mjs";export{e as effectVirtualTransitionEnd}from"./shared/effect-virtual-transition-end.min.mjs";export{g as getSlideTransformEl}from"./shared/utils.min.mjs";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Swiper 0.0.16-dev.1
2
+ * Swiper 0.0.18-dev.1
3
3
  * Gem SDK - Swiper, Customized of swiper
4
4
  * https://swiperjs.com
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: March 20, 2026
10
+ * Released on: March 25, 2026
11
11
  */
12
12
 
13
13
  export { c as createShadow } from './shared/create-shadow.mjs';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Swiper Custom Element 0.0.16-dev.1
2
+ * Swiper Custom Element 0.0.18-dev.1
3
3
  * Gem SDK - Swiper, Customized of swiper
4
4
  * https://swiperjs.com
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: March 20, 2026
10
+ * Released on: March 25, 2026
11
11
  */
12
12
 
13
13
  (function () {
@@ -497,13 +497,45 @@
497
497
  el.innerHTML = html;
498
498
  }
499
499
  }
500
- function computeAutoSlideSize(slideEl, getDirectionPropValue) {
501
- const styles = getComputedStyle(slideEl);
502
- const width = getDirectionPropValue(styles, 'width');
503
- const paddingLeft = getDirectionPropValue(styles, 'padding-left');
504
- const paddingRight = getDirectionPropValue(styles, 'padding-right');
505
- const marginLeft = getDirectionPropValue(styles, 'margin-left');
506
- const marginRight = getDirectionPropValue(styles, 'margin-right');
500
+ function getComputedStyleValue(params) {
501
+ const {
502
+ styles,
503
+ swiper,
504
+ property
505
+ } = params ?? {};
506
+ return parseFloat(styles.getPropertyValue(swiper.getDirectionLabel(property))) || 0;
507
+ }
508
+ function computeAutoSlideSize(params) {
509
+ const {
510
+ el,
511
+ swiper
512
+ } = params ?? {};
513
+ const styles = getComputedStyle(el);
514
+ const width = getComputedStyleValue({
515
+ styles,
516
+ swiper,
517
+ property: 'width'
518
+ });
519
+ const paddingLeft = getComputedStyleValue({
520
+ styles,
521
+ swiper,
522
+ property: 'padding-left'
523
+ });
524
+ const paddingRight = getComputedStyleValue({
525
+ styles,
526
+ swiper,
527
+ property: 'padding-right'
528
+ });
529
+ const marginLeft = getComputedStyleValue({
530
+ styles,
531
+ swiper,
532
+ property: 'margin-left'
533
+ });
534
+ const marginRight = getComputedStyleValue({
535
+ styles,
536
+ swiper,
537
+ property: 'margin-right'
538
+ });
507
539
  const boxSizing = styles.getPropertyValue('box-sizing');
508
540
  if (boxSizing && boxSizing === 'border-box') {
509
541
  return width + marginLeft + marginRight;
@@ -511,7 +543,7 @@
511
543
  const {
512
544
  clientWidth,
513
545
  offsetWidth
514
- } = slideEl;
546
+ } = el;
515
547
  return width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);
516
548
  }
517
549
 
@@ -953,17 +985,13 @@
953
985
  // Calc slides
954
986
  let slideSize;
955
987
  const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => typeof params.breakpoints[key].slidesPerView !== 'undefined').length > 0;
956
- const isAutoSlides = params.slidesPerView === 'auto';
988
+ const isAutoSlidesPerView = params.slidesPerView === 'auto';
957
989
 
958
990
  // --- Phase 1: Batch DOM writes (grid updates, width/transform resets) ---
959
991
  // Moving all style writes before any reads prevents per-slide forced reflows
960
- if (gridEnabled) {
961
- for (let i = 0; i < slidesLength; i += 1) {
962
- if (slides[i]) swiper.grid.updateSlide(i, slides[i], slides);
963
- }
964
- }
992
+
965
993
  const savedTransforms = [];
966
- if (isAutoSlides) {
994
+ if (isAutoSlidesPerView) {
967
995
  for (let i = 0; i < slidesLength; i += 1) {
968
996
  if (!slides[i]) continue;
969
997
  if (shouldResetSlideSize) {
@@ -1004,18 +1032,21 @@
1004
1032
  if (params.autoHeight) {
1005
1033
  slides[i].swiperSlideHeight = slides[i]['offsetHeight'];
1006
1034
  }
1007
- if (isAutoSlides) {
1035
+ if (isAutoSlidesPerView) {
1008
1036
  if (params.roundLengths) {
1009
1037
  slideSizes[i] = swiper.isHorizontal() ? elementOuterSize(slides[i], 'width', true) : elementOuterSize(slides[i], 'height', true);
1010
1038
  } else {
1011
- slideSizes[i] = computeAutoSlideSize(slides[i], getDirectionPropertyValue);
1039
+ slideSizes[i] = computeAutoSlideSize({
1040
+ el: slides[i],
1041
+ swiper
1042
+ });
1012
1043
  }
1013
1044
  if (params.roundLengths) slideSizes[i] = Math.floor(slideSizes[i]);
1014
1045
  }
1015
1046
  }
1016
1047
 
1017
1048
  // --- Phase 3: Restore transforms (batch write) ---
1018
- if (isAutoSlides) {
1049
+ if (isAutoSlidesPerView) {
1019
1050
  for (let i = 0; i < slidesLength; i += 1) {
1020
1051
  if (!savedTransforms[i]) continue;
1021
1052
  if (savedTransforms[i].transform) {
@@ -1032,7 +1063,7 @@
1032
1063
  for (let i = 0; i < slidesLength; i += 1) {
1033
1064
  slideSize = 0;
1034
1065
  if (!slideVisible[i]) continue;
1035
- if (isAutoSlides) {
1066
+ if (isAutoSlidesPerView) {
1036
1067
  slideSize = slideSizes[i] || 0;
1037
1068
  } else {
1038
1069
  slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
@@ -1066,7 +1097,7 @@
1066
1097
  if (slides[i]) {
1067
1098
  slides[i].swiperSlideOffset = slidesGrid[slidesGrid.length - 1] - cssOverflowAdj - wrapperOffset;
1068
1099
  }
1069
- swiper.virtualSize += slideSize + spaceBetween;
1100
+ swiper.slidesTotalSize += slideSize + spaceBetween;
1070
1101
  prevSlideSize = slideSize;
1071
1102
  index += 1;
1072
1103
  }
@@ -1150,7 +1181,7 @@
1150
1181
  }
1151
1182
 
1152
1183
  // Emit changes
1153
- if (slidesLength !== (previousSlidesGridLength ? slides.length : slides.length)) {
1184
+ if (slidesLength !== slides.length) {
1154
1185
  swiper.emit('slidesLengthChange');
1155
1186
  }
1156
1187
  if (snapGrid.length !== previousSnapGridLength) {
@@ -1162,7 +1193,7 @@
1162
1193
  }
1163
1194
  if (params.watchSlidesProgress) {
1164
1195
  swiper.updateSlidesOffset({
1165
- isCalculatedFromUpdateSlides: false
1196
+ isCalculatedFromUpdateSlides: true
1166
1197
  });
1167
1198
  }
1168
1199
  swiper.emit('slidesUpdated');
@@ -9905,7 +9936,7 @@
9905
9936
  }
9906
9937
 
9907
9938
  /**
9908
- * Swiper 0.0.16-dev.1
9939
+ * Swiper 0.0.18-dev.1
9909
9940
  * Gem SDK - Swiper, Customized of swiper
9910
9941
  * https://swiperjs.com
9911
9942
  *
@@ -9913,7 +9944,7 @@
9913
9944
  *
9914
9945
  * Released under the MIT License
9915
9946
  *
9916
- * Released on: March 20, 2026
9947
+ * Released on: March 25, 2026
9917
9948
  */
9918
9949
 
9919
9950
 
@@ -10247,7 +10278,7 @@
10247
10278
  }
10248
10279
 
10249
10280
  /**
10250
- * Swiper Custom Element 0.0.16-dev.1
10281
+ * Swiper Custom Element 0.0.18-dev.1
10251
10282
  * Gem SDK - Swiper, Customized of swiper
10252
10283
  * https://swiperjs.com
10253
10284
  *
@@ -10255,7 +10286,7 @@
10255
10286
  *
10256
10287
  * Released under the MIT License
10257
10288
  *
10258
- * Released on: March 20, 2026
10289
+ * Released on: March 25, 2026
10259
10290
  */
10260
10291
 
10261
10292