@getflip/swirl-components 0.300.4 → 0.300.5
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/components.json +1 -1
- package/dist/cjs/swirl-carousel.cjs.entry.js +7 -2
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-carousel/swirl-carousel.js +7 -2
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-carousel.js +7 -2
- package/dist/esm/swirl-carousel.entry.js +7 -2
- package/dist/swirl-components/p-2ef3b639.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/swirl-components/p-8b36503d.entry.js +0 -1
package/components.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1a9a1551.js');
|
|
6
|
-
const utils = require('./utils-1a1dd8d3.js');
|
|
7
6
|
const index$1 = require('./index-9f94303c.js');
|
|
7
|
+
const utils = require('./utils-1a1dd8d3.js');
|
|
8
8
|
|
|
9
9
|
const swirlCarouselCss = ":host{--swirl-carousel-spacing:var(--s-space-16);position:relative;display:block;overflow:hidden;width:100%}:host(:hover) .carousel__previous-slide-button,:host(:hover) .carousel__next-slide-button{pointer-events:auto}:host *{box-sizing:border-box}.carousel{position:relative;overflow:hidden;width:100%}.carousel:before,.carousel:after{position:absolute;z-index:1;top:0;width:var(--s-space-32);height:100%;content:\"\";transition:opacity 0.2s;pointer-events:none;opacity:0}.carousel:before{left:0;background:linear-gradient(\n 90deg,\n var(--s-background-default) 0%,\n transparent 100%\n )}.carousel:after{right:0;background:linear-gradient(\n 270deg,\n var(--s-background-default) 0%,\n transparent 100%\n )}.carousel--fade:before,.carousel--fade:after{opacity:1}.carousel--is-at-start:before,.carousel--is-at-end:after{opacity:0}.carousel__slides{position:relative;display:flex;overflow-x:auto;overflow-y:hidden;width:100%;scrollbar-width:none;scroll-snap-type:x mandatory;scroll-behavior:smooth}.carousel__slides::-webkit-scrollbar{display:none}.carousel__slides ::slotted(*:not(:first-of-type)){margin-left:var(--swirl-carousel-spacing)}.carousel__slides ::slotted(*){flex-grow:0;flex-shrink:0;scroll-snap-align:start}.carousel__previous-slide-button,.carousel__next-slide-button{position:absolute;z-index:2;top:50%;transform:translateY(-50%) scale(0.72);pointer-events:none}.carousel__previous-slide-button{left:var(--s-space-4)}.carousel__next-slide-button{right:var(--s-space-4)}";
|
|
10
10
|
const SwirlCarouselStyle0 = swirlCarouselCss;
|
|
@@ -31,6 +31,8 @@ const SwirlCarousel = class {
|
|
|
31
31
|
this.onSlotChange = () => {
|
|
32
32
|
// restore scroll position to active slide when slides are removed or added after first render
|
|
33
33
|
this.activeSlides[0]?.scrollIntoView({ block: "nearest", inline: "start" });
|
|
34
|
+
this.checkScrollStatus();
|
|
35
|
+
this.checkScrollPosition();
|
|
34
36
|
};
|
|
35
37
|
this.onScroll = () => {
|
|
36
38
|
this.updateActiveSlideReferences();
|
|
@@ -56,6 +58,9 @@ const SwirlCarousel = class {
|
|
|
56
58
|
}
|
|
57
59
|
componentDidLoad() {
|
|
58
60
|
queueMicrotask(() => {
|
|
61
|
+
if (!this.el.isConnected) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
59
64
|
this.checkScrollStatus();
|
|
60
65
|
this.checkScrollPosition();
|
|
61
66
|
});
|
|
@@ -147,7 +152,7 @@ const SwirlCarousel = class {
|
|
|
147
152
|
"carousel--is-at-start": this.isAtStart,
|
|
148
153
|
"carousel--is-at-end": this.isAtEnd,
|
|
149
154
|
});
|
|
150
|
-
return (index.h(index.Host, { key: '
|
|
155
|
+
return (index.h(index.Host, { key: '47aaf48b6caa091c30f11815fdaaafd74f1d680f', "aria-label": this.label, "aria-roledescription": "carousel", role: "group" }, index.h("div", { key: 'dd2411e2a9c5eaf75ec3be8993c84e33ea24b58b', class: className }, this.isScrollable && !this.isAtStart && (index.h("swirl-button", { key: '5e0b1d6a87bb64083e6af150e915f40c0d876c1f', class: "carousel__previous-slide-button", hideLabel: true, icon: "<swirl-icon-arrow-back></swirl-icon-arrow-back>", label: this.previousSlideButtonLabel, onClick: this.onPreviousSlideButtonClick, pill: true, variant: "floating" })), this.isScrollable && !this.isAtEnd && (index.h("swirl-button", { key: '7f2a5cd69204b7c225c7c3bdf6379ddad1086070', class: "carousel__next-slide-button", hideLabel: true, icon: "<swirl-icon-arrow-forward></swirl-icon-arrow-forward>", label: this.nextSlideButtonLabel, onClick: this.onNextSlideButtonClick, pill: true, variant: "floating" })), index.h("div", { key: '2ac74f8d435e2ab59ce1d8e9f89a8c2e3348bfd4', "aria-live": "polite", class: "carousel__slides", style: slidesStyles, onScroll: this.onScroll, ref: (el) => (this.slidesContainer = el) }, index.h("slot", { key: '461cce12da0c3773bfa1b10c3c32105c801a68c4', onSlotchange: this.onSlotChange })))));
|
|
151
156
|
}
|
|
152
157
|
get el() { return index.getElement(this); }
|
|
153
158
|
};
|