@tet/tet-components 1.3.60-staging → 1.3.61-staging
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tet-accordion.cjs.entry.js +1 -1
- package/dist/cjs/tet-carousel.cjs.entry.js +31 -3
- package/dist/cjs/tet-colors.cjs.entry.js +49 -5
- package/dist/cjs/tet-compare-card_4.cjs.entry.js +1 -1
- package/dist/cjs/tet-components.cjs.js +1 -1
- package/dist/cjs/tet-font-weight.cjs.entry.js +1 -1
- package/dist/cjs/tet-fonts.cjs.entry.js +1 -1
- package/dist/cjs/tet-grid.cjs.entry.js +1 -1
- package/dist/cjs/tet-layout.cjs.entry.js +1 -1
- package/dist/cjs/tet-link.cjs.entry.js +1 -1
- package/dist/cjs/tet-spacing.cjs.entry.js +1 -1
- package/dist/cjs/tet-text-list.cjs.entry.js +1 -1
- package/dist/cjs/tet-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/advanced/cards/tet-compare-card/tet-compare-card.css +2302 -444
- package/dist/collection/components/basic/carousel/tet-carousel/tet-carousel.js +31 -3
- package/dist/collection/components/simple/lists/tet-text-list/tet-text-list.css +2302 -444
- package/dist/collection/components/simple/structural/tet-accordion/tet-accordion.css +10 -2
- package/dist/collection/components/simple/text-blocks/tet-tooltip/tet-tooltip.css +2 -0
- package/dist/collection/docs/styling/colors/tet-colors.css +3343 -369
- package/dist/collection/docs/styling/colors/tet-colors.js +67 -5
- package/dist/collection/docs/styling/font-weight/tet-font-weight.js +1 -1
- package/dist/collection/docs/styling/fonts/tet-fonts.js +1 -1
- package/dist/collection/docs/styling/layout/tet-layout.js +1 -1
- package/dist/collection/docs/styling/link/tet-link.js +1 -1
- package/dist/collection/docs/styling/spacing/tet-spacing.js +1 -1
- package/dist/collection/docs/styling/tet-grid/tet-grid.js +1 -1
- package/dist/components/{p-58d6ee45.js → p-0ef2258c.js} +1 -1
- package/dist/components/{p-4b882f63.js → p-b0d11744.js} +1 -1
- package/dist/components/p-cae66197.js +684 -0
- package/dist/components/{p-b3833a5f.js → p-df261aa4.js} +1 -1
- package/dist/components/p-fa04538f.js +137 -0
- package/dist/components/tet-accordion.js +1 -1
- package/dist/components/tet-address-offers-view.js +2 -2
- package/dist/components/tet-address-offers.js +1 -1
- package/dist/components/tet-business-compare-card.js +1 -1
- package/dist/components/tet-carousel.js +31 -3
- package/dist/components/tet-colors.js +51 -6
- package/dist/components/tet-compare-card.js +1 -1
- package/dist/components/tet-compare-cards-tab.js +2 -2
- package/dist/components/tet-compare-cards.js +1 -1
- package/dist/components/tet-font-weight.js +1 -1
- package/dist/components/tet-fonts.js +1 -1
- package/dist/components/tet-grid.js +1 -1
- package/dist/components/tet-layout.js +1 -1
- package/dist/components/tet-link.js +1 -1
- package/dist/components/tet-referral.js +1 -1
- package/dist/components/tet-spacing.js +1 -1
- package/dist/components/tet-table.js +1 -1
- package/dist/components/tet-text-list.js +1 -1
- package/dist/components/tet-tooltip.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tet-accordion.entry.js +1 -1
- package/dist/esm/tet-carousel.entry.js +31 -3
- package/dist/esm/tet-colors.entry.js +49 -5
- package/dist/esm/tet-compare-card_4.entry.js +1 -1
- package/dist/esm/tet-components.js +1 -1
- package/dist/esm/tet-font-weight.entry.js +1 -1
- package/dist/esm/tet-fonts.entry.js +1 -1
- package/dist/esm/tet-grid.entry.js +1 -1
- package/dist/esm/tet-layout.entry.js +1 -1
- package/dist/esm/tet-link.entry.js +1 -1
- package/dist/esm/tet-spacing.entry.js +1 -1
- package/dist/esm/tet-text-list.entry.js +1 -1
- package/dist/esm/tet-tooltip.entry.js +1 -1
- package/dist/tet-components/p-0b0b4360.entry.js +1 -0
- package/dist/tet-components/{p-518dee7b.entry.js → p-0f6ba6c1.entry.js} +1 -1
- package/dist/tet-components/{p-3900e7d6.entry.js → p-54b5a319.entry.js} +1 -1
- package/dist/tet-components/{p-3e7960d4.entry.js → p-73215222.entry.js} +1 -1
- package/dist/tet-components/{p-40c6b11a.entry.js → p-82743de6.entry.js} +1 -1
- package/dist/tet-components/p-86db3c7a.entry.js +1 -0
- package/dist/tet-components/{p-a38bea92.entry.js → p-9c52f023.entry.js} +1 -1
- package/dist/tet-components/{p-3d4d4083.entry.js → p-a96ff929.entry.js} +1 -1
- package/dist/tet-components/p-db6ecf32.entry.js +1 -0
- package/dist/tet-components/p-eaf32e3e.entry.js +1 -0
- package/dist/tet-components/{p-b7b0d312.entry.js → p-ebf42125.entry.js} +1 -1
- package/dist/tet-components/{p-d196ce32.entry.js → p-fe10ce17.entry.js} +1 -1
- package/dist/tet-components/tet-components.css +2 -2
- package/dist/tet-components/tet-components.esm.js +1 -1
- package/dist/types/components/basic/carousel/tet-carousel/tet-carousel.d.ts +2 -0
- package/dist/types/components.d.ts +10 -2
- package/dist/types/docs/styling/colors/tet-colors.d.ts +8 -1
- package/package.json +1 -1
- package/dist/components/p-4ae2b483.js +0 -684
- package/dist/components/p-6b072042.js +0 -137
- package/dist/tet-components/p-16f62174.entry.js +0 -1
- package/dist/tet-components/p-26e82491.entry.js +0 -1
- package/dist/tet-components/p-31d0e24f.entry.js +0 -1
- package/dist/tet-components/p-3950ee21.entry.js +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
export class TetCarousel {
|
|
3
3
|
constructor() {
|
|
4
|
+
this.draggedAnchor = null;
|
|
5
|
+
this.dragMoved = false;
|
|
4
6
|
this.trackElement = null;
|
|
5
7
|
this.dragStartX = 0;
|
|
6
8
|
this.dragOffset = 0;
|
|
@@ -27,16 +29,30 @@ export class TetCarousel {
|
|
|
27
29
|
this.dragOffset = -(idx * window.innerWidth);
|
|
28
30
|
};
|
|
29
31
|
this.onPointerDown = (e) => {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
e.stopImmediatePropagation();
|
|
30
35
|
this.isDragging = true;
|
|
31
36
|
this.dragStartX = e.screenX;
|
|
37
|
+
this.dragMoved = false;
|
|
32
38
|
document.body.style.userSelect = 'none';
|
|
33
39
|
document.addEventListener('pointermove', this.onPointerMove);
|
|
34
40
|
document.addEventListener('pointerup', this.onPointerUp);
|
|
41
|
+
let el = e.target;
|
|
42
|
+
this.draggedAnchor = null;
|
|
43
|
+
while (el) {
|
|
44
|
+
if (el.tagName === 'A') {
|
|
45
|
+
this.draggedAnchor = el;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
el = el.parentElement;
|
|
49
|
+
}
|
|
35
50
|
};
|
|
36
51
|
this.onPointerMove = (e) => {
|
|
37
52
|
var _a, _b, _c;
|
|
38
53
|
if (!this.isDragging)
|
|
39
54
|
return;
|
|
55
|
+
this.dragMoved = true;
|
|
40
56
|
const delta = e.screenX - this.dragStartX;
|
|
41
57
|
let _dragOffset = this.dragOffset;
|
|
42
58
|
_dragOffset += delta;
|
|
@@ -57,13 +73,25 @@ export class TetCarousel {
|
|
|
57
73
|
this.trackElement.style.transform = `translateX(${this.dragOffset}px)`;
|
|
58
74
|
}
|
|
59
75
|
};
|
|
60
|
-
this.onPointerUp = () => {
|
|
76
|
+
this.onPointerUp = (e) => {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
e.stopPropagation();
|
|
79
|
+
e.stopImmediatePropagation();
|
|
61
80
|
if (!this.isDragging)
|
|
62
81
|
return;
|
|
63
82
|
this.isDragging = false;
|
|
64
83
|
document.body.style.userSelect = '';
|
|
65
84
|
document.removeEventListener('pointermove', this.onPointerMove);
|
|
66
85
|
document.removeEventListener('pointerup', this.onPointerUp);
|
|
86
|
+
if (this.draggedAnchor && this.dragMoved) {
|
|
87
|
+
const preventClick = (ev) => {
|
|
88
|
+
var _a;
|
|
89
|
+
ev.preventDefault();
|
|
90
|
+
ev.stopPropagation();
|
|
91
|
+
(_a = this.draggedAnchor) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', preventClick, true);
|
|
92
|
+
};
|
|
93
|
+
this.draggedAnchor.addEventListener('click', preventClick, true);
|
|
94
|
+
}
|
|
67
95
|
};
|
|
68
96
|
this.activeIndex = 0;
|
|
69
97
|
this.screenCount = 0;
|
|
@@ -110,10 +138,10 @@ export class TetCarousel {
|
|
|
110
138
|
window.removeEventListener('resize', this.getScreenCount.bind(this));
|
|
111
139
|
}
|
|
112
140
|
render() {
|
|
113
|
-
return (h(Host, { key: '
|
|
141
|
+
return (h(Host, { key: '82455d2dfb8240a27e0e1b11dd68faad64ddfce3' }, h("div", { key: '96c8f171564ba89c9ec4a1d27040bf76d0e8c839', class: { 'tet-carousel': true, [`${this.theme}`]: true }, ref: (el) => (this.container = el), part: "carousel" }, h("div", { key: '14306d6b91013f12d914493b2e134a883841e689', class: "tet-carousel__container" }, h("div", { key: '3b3ab56bf32a4b696db69d05ace95314068c908b', class: "tet-carousel__track", ref: (el) => (this.trackElement = el), style: {
|
|
114
142
|
transform: `translateX(${this.dragOffset}px)`,
|
|
115
143
|
transition: this.isDragging ? 'none' : `transform ${this.transitionDuration}ms ${this.transitionTiming}`
|
|
116
|
-
}, onPointerDown: this.onPointerDown, onMouseMove: this.onPointerMove, onPointerUp: this.onPointerUp, onMouseLeave: this.onPointerUp }, h("slot", { key: '
|
|
144
|
+
}, onPointerDown: this.onPointerDown, onMouseMove: this.onPointerMove, onPointerUp: this.onPointerUp, onMouseLeave: this.onPointerUp }, h("slot", { key: '783ef1e0e5c558d698dd8591516d0cc4d613d890' }))), h("div", { key: '1fec30c7e26abc29218753da2c774c1736747b6b', class: "tet-carousel__controls" }, this.showButtons && (h("div", { key: '5d0e4c0dd7190384f8c96ff3aaed94db90e7d663', class: "tet-carousel__buttons tet-carousel__buttons--mobile" }, h("tet-button", { key: '8a065ab58157140a87ba884254d7f3f5afe72c71', class: "tet-carousel__btn", theme: this.theme === 'light' ? 'dark' : 'light', "icon-name": this.buttonIconLeft, "icon-mode": true, onClick: this.handlePrev, "aria-label": "Previous", disabled: this.screenCount <= 1 || this.activeIndex === 0 }))), this.showDots && (h("div", { key: '9c6231e50f7c469254eeaba757a07fd4169d4dc2', class: "tet-carousel__dots" }, Array.from({ length: this.screenCount }).map((_, idx) => (h("span", { class: `tet-carousel__dot${idx === this.activeIndex ? ' active' : ''}`, key: idx, onClick: () => this.handleDotClick(idx) }))))), this.showButtons && (h("div", { key: 'aeb93d78f058d96f4e16253624b7cef6512ec167', class: "tet-carousel__buttons " }, h("tet-button", { key: '5bab8de73d3033df20101a810f89895d47f64fd5', class: "tet-carousel__buttons--desktop tet-carousel__btn ", theme: this.theme === 'light' ? 'dark' : 'light', "icon-name": this.buttonIconLeft, "icon-mode": true, onClick: this.handlePrev, "aria-label": "Previous", disabled: this.screenCount <= 1 || this.activeIndex === 0 }), h("tet-button", { key: 'f624005ca2aeda63dd730162d9a0b1538ceef561', class: "tet-carousel__btn", theme: this.theme === 'light' ? 'dark' : 'light', "icon-name": this.buttonIconRight, "icon-mode": true, onClick: this.handleNext, "aria-label": "Next", disabled: this.screenCount <= 1 || this.activeIndex === this.screenCount - 1 })))))));
|
|
117
145
|
}
|
|
118
146
|
static get is() { return "tet-carousel"; }
|
|
119
147
|
static get encapsulation() { return "shadow"; }
|