@nanoporetech-digital/components 5.5.0 → 5.5.2

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/nano-slides.cjs.entry.js +19 -15
  3. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  4. package/dist/cjs/{nano-table-6abb323d.js → nano-table-265e86b3.js} +2 -2
  5. package/dist/cjs/{nano-table-6abb323d.js.map → nano-table-265e86b3.js.map} +1 -1
  6. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  7. package/dist/cjs/{table.worker-20dc920c.js → table.worker-4ba19693.js} +2 -2
  8. package/dist/cjs/table.worker-4ba19693.js.map +1 -0
  9. package/dist/collection/components/slides/lib/js/prev-next-button.js +5 -0
  10. package/dist/collection/components/slides/slides.js +14 -15
  11. package/dist/collection/components/slides/slides.js.map +1 -1
  12. package/dist/components/nano-slides.js +19 -15
  13. package/dist/components/nano-slides.js.map +1 -1
  14. package/dist/esm/nano-slides.entry.js +19 -15
  15. package/dist/esm/nano-slides.entry.js.map +1 -1
  16. package/dist/esm/{nano-table-f234ca94.js → nano-table-2ac76509.js} +2 -2
  17. package/dist/esm/{nano-table-f234ca94.js.map → nano-table-2ac76509.js.map} +1 -1
  18. package/dist/esm/nano-table.entry.js +1 -1
  19. package/dist/esm/{table.worker-cb4d4ab8.js → table.worker-28470fb1.js} +2 -2
  20. package/dist/esm/table.worker-28470fb1.js.map +1 -0
  21. package/dist/nano-components/nano-components.esm.js +1 -1
  22. package/dist/nano-components/p-37cb3003.js +5 -0
  23. package/dist/nano-components/p-4e9125ec.entry.js +23 -0
  24. package/dist/nano-components/p-4e9125ec.entry.js.map +1 -0
  25. package/dist/nano-components/{p-47b7a81d.entry.js → p-b7f2b048.entry.js} +2 -2
  26. package/dist/nano-components/{p-c6ee778e.js → p-e2e07791.js} +2 -2
  27. package/dist/types/components/slides/slides.d.ts +1 -3
  28. package/docs-json.json +1 -1
  29. package/hydrate/index.js +19 -15
  30. package/package.json +2 -2
  31. package/dist/cjs/table.worker-20dc920c.js.map +0 -1
  32. package/dist/esm/table.worker-cb4d4ab8.js.map +0 -1
  33. package/dist/nano-components/p-0b03cb52.entry.js +0 -23
  34. package/dist/nano-components/p-0b03cb52.entry.js.map +0 -1
  35. package/dist/nano-components/p-5c493505.js +0 -5
  36. /package/dist/nano-components/{p-47b7a81d.entry.js.map → p-37cb3003.js.map} +0 -0
  37. /package/dist/nano-components/{p-5c493505.js.map → p-b7f2b048.entry.js.map} +0 -0
  38. /package/dist/nano-components/{p-c6ee778e.js.map → p-e2e07791.js.map} +0 -0
@@ -2758,6 +2758,11 @@ PrevNextButton.prototype._create = function () {
2758
2758
  const slot = document.createElement('slot');
2759
2759
  slot.name = this.isPrevious ? 'previous-icon' : 'next-icon';
2760
2760
  button.appendChild(slot);
2761
+ slot.addEventListener('slotchange', () => {
2762
+ slot.assignedElements({ flatten: true }).forEach((ele) => {
2763
+ ele.removeAttribute('hidden');
2764
+ });
2765
+ });
2761
2766
 
2762
2767
  // create arrow
2763
2768
  var svg = this.createSVG();
@@ -3865,9 +3870,8 @@ const Slides = class {
3865
3870
  });
3866
3871
  this.parallax = async () => {
3867
3872
  const flkty = await this.flickity;
3868
- flkty.cells.forEach((el, i) => {
3869
- const cell = el;
3870
- const shiftedPos = cell.x + flkty.slideableWidth * cell.shift;
3873
+ const cells = flkty.cells;
3874
+ cells.forEach((cell, i) => {
3871
3875
  const ele = this.childrenEles[i];
3872
3876
  let flkX = flkty.x;
3873
3877
  if (flkty.options.wrapAround && flkty.cells.length > 1) {
@@ -3876,13 +3880,12 @@ const Slides = class {
3876
3880
  }
3877
3881
  let x = ((cell.target + flkX) * -1) / 3;
3878
3882
  if (cell.shift < 0) {
3879
- x = x + Math.abs(shiftedPos);
3883
+ x = ((cell.target - flkty.slideableWidth + flkX) * -1) / 3;
3880
3884
  }
3881
3885
  else if (cell.shift > 0) {
3882
- x = ((cell.target + (flkX + shiftedPos)) * -1) / 3;
3886
+ x = ((cell.target + (flkX + flkty.slideableWidth)) * -1) / 3;
3883
3887
  }
3884
3888
  ele.style.transform = 'translate3d(' + x + 'px, 0, 0)';
3885
- // 'translateX(' + x + 'px)';
3886
3889
  });
3887
3890
  };
3888
3891
  this.handleFullscreen = (isFullScreen) => {
@@ -3956,7 +3959,7 @@ const Slides = class {
3956
3959
  this.options = { fade: true, percentPosition: true };
3957
3960
  break;
3958
3961
  case 'parallax':
3959
- this.options = { fade: false, percentPosition: false };
3962
+ this.options = { fade: false, percentPosition: true };
3960
3963
  flkty.on('scroll', this.parallax);
3961
3964
  break;
3962
3965
  default:
@@ -4065,9 +4068,7 @@ const Slides = class {
4065
4068
  this.options = { autoPlay: time };
4066
4069
  setTimeout(() => flickity.playPlayer());
4067
4070
  }
4068
- /**
4069
- * Stop auto play.
4070
- */
4071
+ /** Stop auto play. */
4071
4072
  async stopAutoplay() {
4072
4073
  const flickity = await this.getflickity();
4073
4074
  flickity.stopPlayer();
@@ -4125,14 +4126,16 @@ const Slides = class {
4125
4126
  const finalOptions = this.normalizeOptions();
4126
4127
  // init flickity core
4127
4128
  await waitForSlides(this.host);
4128
- this.flickityEl.style.height =
4129
- this.flickityEl.getBoundingClientRect().height + 'px';
4130
- this.slidesReady = true;
4131
4129
  this.flickityEl =
4132
4130
  this.flickityEl || this._getRoot().querySelector('.flickity-container');
4133
- if (this.flickityEl &&
4134
- this.flickityEl.classList.contains('flickity-enabled'))
4131
+ if (!this.flickityEl)
4132
+ return;
4133
+ this.slidesReady = true;
4134
+ if (this.flickityEl.classList.contains('flickity-enabled')) {
4135
4135
  this.destroyflickity();
4136
+ }
4137
+ this.flickityEl.style.height =
4138
+ this.flickityEl.getBoundingClientRect().height + 'px';
4136
4139
  setTimeout(() => {
4137
4140
  this.flickityEl.style.height = '';
4138
4141
  const flick = new flickity(this.flickityEl, finalOptions);
@@ -4270,6 +4273,7 @@ const waitForSlides = (host) => {
4270
4273
  if (!toLoadSlides.length) {
4271
4274
  resolve(allSlides);
4272
4275
  host.removeEventListener('nanoSlideReady', slideResolver);
4276
+ host.removeEventListener('nano-slide-ready', slideResolver);
4273
4277
  }
4274
4278
  };
4275
4279
  host.addEventListener('nanoSlideReady', slideResolver);