pb-sxp-ui 1.0.81 → 1.0.82

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/dist/pb-ui.js CHANGED
@@ -3092,7 +3092,7 @@
3092
3092
  dragEl
3093
3093
  } = scrollbar;
3094
3094
  if (!isTouched) return;
3095
- if (e.preventDefault) e.preventDefault();else e.returnValue = false;
3095
+ if (e.preventDefault && e.cancelable) e.preventDefault();else e.returnValue = false;
3096
3096
  setDragPosition(e);
3097
3097
  wrapperEl.style.transitionDuration = '0ms';
3098
3098
  el.style.transitionDuration = '0ms';
@@ -3319,7 +3319,7 @@
3319
3319
  if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
3320
3320
  if (e.target !== swiper.wrapperEl) return;
3321
3321
  swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
3322
- if (pausedByPointerEnter) {
3322
+ if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) {
3323
3323
  return;
3324
3324
  }
3325
3325
  resume();
@@ -3490,8 +3490,10 @@
3490
3490
  }
3491
3491
  };
3492
3492
  const detachMouseEvents = () => {
3493
- swiper.el.removeEventListener('pointerenter', onPointerEnter);
3494
- swiper.el.removeEventListener('pointerleave', onPointerLeave);
3493
+ if (swiper.el && typeof swiper.el !== 'string') {
3494
+ swiper.el.removeEventListener('pointerenter', onPointerEnter);
3495
+ swiper.el.removeEventListener('pointerleave', onPointerLeave);
3496
+ }
3495
3497
  };
3496
3498
  const attachDocumentEvents = () => {
3497
3499
  const document = getDocument();
@@ -4413,8 +4415,9 @@
4413
4415
  allSlidesSize += slideSizeValue + (spaceBetween || 0);
4414
4416
  });
4415
4417
  allSlidesSize -= spaceBetween;
4416
- if (allSlidesSize < swiperSize) {
4417
- const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
4418
+ const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0);
4419
+ if (allSlidesSize + offsetSize < swiperSize) {
4420
+ const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
4418
4421
  snapGrid.forEach((snap, snapIndex) => {
4419
4422
  snapGrid[snapIndex] = snap - allSlidesOffset;
4420
4423
  });
@@ -4518,6 +4521,13 @@
4518
4521
  }
4519
4522
  }
4520
4523
 
4524
+ const toggleSlideClasses$1 = (slideEl, condition, className) => {
4525
+ if (condition && !slideEl.classList.contains(className)) {
4526
+ slideEl.classList.add(className);
4527
+ } else if (!condition && slideEl.classList.contains(className)) {
4528
+ slideEl.classList.remove(className);
4529
+ }
4530
+ };
4521
4531
  function updateSlidesProgress(translate) {
4522
4532
  if (translate === void 0) {
4523
4533
  translate = this && this.translate || 0;
@@ -4533,11 +4543,6 @@
4533
4543
  if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
4534
4544
  let offsetCenter = -translate;
4535
4545
  if (rtl) offsetCenter = translate;
4536
-
4537
- // Visible Slides
4538
- slides.forEach(slideEl => {
4539
- slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass);
4540
- });
4541
4546
  swiper.visibleSlidesIndexes = [];
4542
4547
  swiper.visibleSlides = [];
4543
4548
  let spaceBetween = params.spaceBetween;
@@ -4561,11 +4566,9 @@
4561
4566
  if (isVisible) {
4562
4567
  swiper.visibleSlides.push(slide);
4563
4568
  swiper.visibleSlidesIndexes.push(i);
4564
- slides[i].classList.add(params.slideVisibleClass);
4565
- }
4566
- if (isFullyVisible) {
4567
- slides[i].classList.add(params.slideFullyVisibleClass);
4568
4569
  }
4570
+ toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass);
4571
+ toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass);
4569
4572
  slide.progress = rtl ? -slideProgress : slideProgress;
4570
4573
  slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
4571
4574
  }
@@ -4634,6 +4637,13 @@
4634
4637
  swiper.emit('progress', progress);
4635
4638
  }
4636
4639
 
4640
+ const toggleSlideClasses = (slideEl, condition, className) => {
4641
+ if (condition && !slideEl.classList.contains(className)) {
4642
+ slideEl.classList.add(className);
4643
+ } else if (!condition && slideEl.classList.contains(className)) {
4644
+ slideEl.classList.remove(className);
4645
+ }
4646
+ };
4637
4647
  function updateSlidesClasses() {
4638
4648
  const swiper = this;
4639
4649
  const {
@@ -4647,9 +4657,6 @@
4647
4657
  const getFilteredSlide = selector => {
4648
4658
  return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
4649
4659
  };
4650
- slides.forEach(slideEl => {
4651
- slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
4652
- });
4653
4660
  let activeSlide;
4654
4661
  let prevSlide;
4655
4662
  let nextSlide;
@@ -4672,35 +4679,25 @@
4672
4679
  }
4673
4680
  }
4674
4681
  if (activeSlide) {
4675
- // Active classes
4676
- activeSlide.classList.add(params.slideActiveClass);
4677
- if (gridEnabled) {
4678
- if (nextSlide) {
4679
- nextSlide.classList.add(params.slideNextClass);
4680
- }
4681
- if (prevSlide) {
4682
- prevSlide.classList.add(params.slidePrevClass);
4683
- }
4684
- } else {
4682
+ if (!gridEnabled) {
4685
4683
  // Next Slide
4686
4684
  nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
4687
4685
  if (params.loop && !nextSlide) {
4688
4686
  nextSlide = slides[0];
4689
4687
  }
4690
- if (nextSlide) {
4691
- nextSlide.classList.add(params.slideNextClass);
4692
- }
4693
4688
 
4694
4689
  // Prev Slide
4695
4690
  prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
4696
4691
  if (params.loop && !prevSlide === 0) {
4697
4692
  prevSlide = slides[slides.length - 1];
4698
4693
  }
4699
- if (prevSlide) {
4700
- prevSlide.classList.add(params.slidePrevClass);
4701
- }
4702
4694
  }
4703
4695
  }
4696
+ slides.forEach(slideEl => {
4697
+ toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);
4698
+ toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);
4699
+ toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);
4700
+ });
4704
4701
  swiper.emitSlidesClasses();
4705
4702
  }
4706
4703
 
@@ -5078,6 +5075,7 @@
5078
5075
  swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
5079
5076
  swiper.onTranslateToWrapperTransitionEnd = null;
5080
5077
  delete swiper.onTranslateToWrapperTransitionEnd;
5078
+ swiper.animating = false;
5081
5079
  if (runCallbacks) {
5082
5080
  swiper.emit('transitionEnd');
5083
5081
  }
@@ -5185,9 +5183,6 @@
5185
5183
  if (index === void 0) {
5186
5184
  index = 0;
5187
5185
  }
5188
- if (speed === void 0) {
5189
- speed = this.params.speed;
5190
- }
5191
5186
  if (runCallbacks === void 0) {
5192
5187
  runCallbacks = true;
5193
5188
  }
@@ -5207,9 +5202,12 @@
5207
5202
  wrapperEl,
5208
5203
  enabled
5209
5204
  } = swiper;
5210
- if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial || swiper.destroyed) {
5205
+ if (!enabled && !internal && !initial || swiper.destroyed || swiper.animating && params.preventInteractionOnTransition) {
5211
5206
  return false;
5212
5207
  }
5208
+ if (typeof speed === 'undefined') {
5209
+ speed = swiper.params.speed;
5210
+ }
5213
5211
  const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
5214
5212
  let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
5215
5213
  if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
@@ -5336,9 +5334,6 @@
5336
5334
  if (index === void 0) {
5337
5335
  index = 0;
5338
5336
  }
5339
- if (speed === void 0) {
5340
- speed = this.params.speed;
5341
- }
5342
5337
  if (runCallbacks === void 0) {
5343
5338
  runCallbacks = true;
5344
5339
  }
@@ -5348,6 +5343,9 @@
5348
5343
  }
5349
5344
  const swiper = this;
5350
5345
  if (swiper.destroyed) return;
5346
+ if (typeof speed === 'undefined') {
5347
+ speed = swiper.params.speed;
5348
+ }
5351
5349
  const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
5352
5350
  let newIndex = index;
5353
5351
  if (swiper.params.loop) {
@@ -5379,6 +5377,9 @@
5379
5377
  if (centeredSlides) {
5380
5378
  needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
5381
5379
  }
5380
+ if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
5381
+ needLoopFix = false;
5382
+ }
5382
5383
  if (needLoopFix) {
5383
5384
  const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
5384
5385
  swiper.loopFix({
@@ -5404,9 +5405,6 @@
5404
5405
 
5405
5406
  /* eslint no-unused-vars: "off" */
5406
5407
  function slideNext(speed, runCallbacks, internal) {
5407
- if (speed === void 0) {
5408
- speed = this.params.speed;
5409
- }
5410
5408
  if (runCallbacks === void 0) {
5411
5409
  runCallbacks = true;
5412
5410
  }
@@ -5417,6 +5415,9 @@
5417
5415
  animating
5418
5416
  } = swiper;
5419
5417
  if (!enabled || swiper.destroyed) return swiper;
5418
+ if (typeof speed === 'undefined') {
5419
+ speed = swiper.params.speed;
5420
+ }
5420
5421
  let perGroup = params.slidesPerGroup;
5421
5422
  if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
5422
5423
  perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
@@ -5445,9 +5446,6 @@
5445
5446
 
5446
5447
  /* eslint no-unused-vars: "off" */
5447
5448
  function slidePrev(speed, runCallbacks, internal) {
5448
- if (speed === void 0) {
5449
- speed = this.params.speed;
5450
- }
5451
5449
  if (runCallbacks === void 0) {
5452
5450
  runCallbacks = true;
5453
5451
  }
@@ -5461,6 +5459,9 @@
5461
5459
  animating
5462
5460
  } = swiper;
5463
5461
  if (!enabled || swiper.destroyed) return swiper;
5462
+ if (typeof speed === 'undefined') {
5463
+ speed = swiper.params.speed;
5464
+ }
5464
5465
  const isVirtual = swiper.virtual && params.virtual.enabled;
5465
5466
  if (params.loop) {
5466
5467
  if (animating && !isVirtual && params.loopPreventsSliding) return false;
@@ -5513,22 +5514,19 @@
5513
5514
 
5514
5515
  /* eslint no-unused-vars: "off" */
5515
5516
  function slideReset(speed, runCallbacks, internal) {
5516
- if (speed === void 0) {
5517
- speed = this.params.speed;
5518
- }
5519
5517
  if (runCallbacks === void 0) {
5520
5518
  runCallbacks = true;
5521
5519
  }
5522
5520
  const swiper = this;
5523
5521
  if (swiper.destroyed) return;
5522
+ if (typeof speed === 'undefined') {
5523
+ speed = swiper.params.speed;
5524
+ }
5524
5525
  return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
5525
5526
  }
5526
5527
 
5527
5528
  /* eslint no-unused-vars: "off" */
5528
5529
  function slideToClosest(speed, runCallbacks, internal, threshold) {
5529
- if (speed === void 0) {
5530
- speed = this.params.speed;
5531
- }
5532
5530
  if (runCallbacks === void 0) {
5533
5531
  runCallbacks = true;
5534
5532
  }
@@ -5537,6 +5535,9 @@
5537
5535
  }
5538
5536
  const swiper = this;
5539
5537
  if (swiper.destroyed) return;
5538
+ if (typeof speed === 'undefined') {
5539
+ speed = swiper.params.speed;
5540
+ }
5540
5541
  let index = swiper.activeIndex;
5541
5542
  const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
5542
5543
  const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
@@ -6171,7 +6172,7 @@
6171
6172
  data.startMoving = true;
6172
6173
  }
6173
6174
  }
6174
- if (data.isScrolling) {
6175
+ if (data.isScrolling || e.type === 'touchmove' && data.preventTouchMoveFromPointerMove) {
6175
6176
  data.isTouched = false;
6176
6177
  return;
6177
6178
  }
@@ -6213,7 +6214,10 @@
6213
6214
  if (swiper.animating) {
6214
6215
  const evt = new window.CustomEvent('transitionend', {
6215
6216
  bubbles: true,
6216
- cancelable: true
6217
+ cancelable: true,
6218
+ detail: {
6219
+ bySwiperTouchMove: true
6220
+ }
6217
6221
  });
6218
6222
  swiper.wrapperEl.dispatchEvent(evt);
6219
6223
  }
@@ -6607,6 +6611,7 @@
6607
6611
  const capture = !!params.nested;
6608
6612
  const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
6609
6613
  const swiperMethod = method;
6614
+ if (!el || typeof el === 'string') return;
6610
6615
 
6611
6616
  // Touch Events
6612
6617
  document[domMethod]('touchstart', swiper.onDocumentTouchStart, {
@@ -6715,6 +6720,8 @@
6715
6720
  const breakpointParams = breakpointOnlyParams || swiper.originalParams;
6716
6721
  const wasMultiRow = isGridEnabled(swiper, params);
6717
6722
  const isMultiRow = isGridEnabled(swiper, breakpointParams);
6723
+ const wasGrabCursor = swiper.params.grabCursor;
6724
+ const isGrabCursor = breakpointParams.grabCursor;
6718
6725
  const wasEnabled = params.enabled;
6719
6726
  if (wasMultiRow && !isMultiRow) {
6720
6727
  el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
@@ -6726,6 +6733,11 @@
6726
6733
  }
6727
6734
  swiper.emitContainerClasses();
6728
6735
  }
6736
+ if (wasGrabCursor && !isGrabCursor) {
6737
+ swiper.unsetGrabCursor();
6738
+ } else if (!wasGrabCursor && isGrabCursor) {
6739
+ swiper.setGrabCursor();
6740
+ }
6729
6741
 
6730
6742
  // Toggle navigation, pagination, scrollbar
6731
6743
  ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
@@ -6876,6 +6888,7 @@
6876
6888
  el,
6877
6889
  classNames
6878
6890
  } = swiper;
6891
+ if (!el || typeof el === 'string') return;
6879
6892
  el.classList.remove(...classNames);
6880
6893
  swiper.emitContainerClasses();
6881
6894
  }
@@ -7640,8 +7653,12 @@
7640
7653
  // Cleanup styles
7641
7654
  if (cleanStyles) {
7642
7655
  swiper.removeClasses();
7643
- el.removeAttribute('style');
7644
- wrapperEl.removeAttribute('style');
7656
+ if (el && typeof el !== 'string') {
7657
+ el.removeAttribute('style');
7658
+ }
7659
+ if (wrapperEl) {
7660
+ wrapperEl.removeAttribute('style');
7661
+ }
7645
7662
  if (slides && slides.length) {
7646
7663
  slides.forEach(slideEl => {
7647
7664
  slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
@@ -7657,7 +7674,9 @@
7657
7674
  swiper.off(eventName);
7658
7675
  });
7659
7676
  if (deleteInstance !== false) {
7660
- swiper.el.swiper = null;
7677
+ if (swiper.el && typeof swiper.el !== 'string') {
7678
+ swiper.el.swiper = null;
7679
+ }
7661
7680
  deleteProps(swiper);
7662
7681
  }
7663
7682
  swiper.destroyed = true;
@@ -8051,7 +8070,7 @@
8051
8070
  };
8052
8071
 
8053
8072
  /**
8054
- * Swiper React 11.0.7
8073
+ * Swiper React 11.1.4
8055
8074
  * Most modern mobile touch slider and framework with hardware accelerated transitions
8056
8075
  * https://swiperjs.com
8057
8076
  *
@@ -8059,7 +8078,7 @@
8059
8078
  *
8060
8079
  * Released under the MIT License
8061
8080
  *
8062
- * Released on: February 27, 2024
8081
+ * Released on: May 30, 2024
8063
8082
  */
8064
8083
 
8065
8084