@tet/tet-components 1.3.133-testing → 1.3.134-testing

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,4 +1,5 @@
1
- import { h, Host } from "@stencil/core";
1
+ import { h, Host, forceUpdate } from "@stencil/core";
2
+ import { processTranslations, t } from "../../../../services/translations/index";
2
3
  export class TetCarousel {
3
4
  constructor() {
4
5
  this.draggedAnchor = null;
@@ -12,37 +13,65 @@ export class TetCarousel {
12
13
  this.trackElement = null;
13
14
  this.dragStartX = 0;
14
15
  this.swipeStart = 0;
15
- this.handlePrev = () => {
16
+ this.handleMove = () => {
16
17
  var _a;
17
- if (this.activeIndex > 0) {
18
- this.activeIndex -= 1;
18
+ const slot = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector('slot');
19
+ if (!slot)
20
+ return 1;
21
+ const assigned = slot.assignedElements ? slot.assignedElements() : [];
22
+ const item = assigned[this.activeItem];
23
+ if (item) {
24
+ this.moveToItem(item);
25
+ }
26
+ };
27
+ this.handlePrev = () => {
28
+ if (this.activeItem > 0) {
29
+ this.activeItem -= 1;
19
30
  }
20
- const wrapperWidth = ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
21
- this.dragOffset = -(this.activeIndex * wrapperWidth);
31
+ this.handleMove();
22
32
  };
23
33
  this.handleNext = () => {
24
- var _a;
25
- if (this.activeIndex < this.screenCount - 1) {
26
- this.activeIndex += 1;
34
+ if (this.activeItem < this.totalItems) {
35
+ this.activeItem += 1;
27
36
  }
28
- const wrapperWidth = ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
29
- this.dragOffset = -(this.activeIndex * wrapperWidth);
30
- this.checkForLastScreen();
37
+ this.handleMove();
38
+ };
39
+ this.moveToLastScreen = () => {
40
+ const wrapperWidth = this.getViewportWidth();
41
+ const totalWidth = this.getSlotClientWidth();
42
+ this.dragOffset = -(totalWidth - wrapperWidth);
31
43
  };
32
- this.checkForLastScreen = () => {
33
- var _a, _b, _c;
34
- if (this.screenCount - 1 === this.activeIndex && !this.isDragging) {
35
- const wrapperWidth = ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
36
- const totalWidth = ((_c = (_b = this.trackElement) === null || _b === void 0 ? void 0 : _b.querySelector('slot')) === null || _c === void 0 ? void 0 : _c.offsetWidth) || window.innerWidth;
37
- this.dragOffset = -(totalWidth - wrapperWidth);
44
+ this.moveToTarget = (target) => {
45
+ var _a;
46
+ const slot = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector('slot');
47
+ if (!slot)
48
+ return 1;
49
+ const assigned = slot.assignedElements ? slot.assignedElements() : [];
50
+ for (const [index, item] of assigned.entries()) {
51
+ const rect = item.getBoundingClientRect();
52
+ const trackRect = this.trackElement.getBoundingClientRect();
53
+ let relativeLeft = rect.left - trackRect.left;
54
+ const gradientOffset = this.calculateGradient(item, relativeLeft);
55
+ if (relativeLeft >= target - this.swipeThreshold + gradientOffset) {
56
+ this.moveToItem(item, index);
57
+ return;
58
+ }
38
59
  }
60
+ this.moveToItem(assigned[0], 0);
61
+ return;
39
62
  };
40
63
  this.handleDotClick = (idx) => {
41
- var _a;
42
- this.activeIndex = idx;
43
- const wrapperWidth = ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
44
- this.dragOffset = -(idx * wrapperWidth);
45
- this.checkForLastScreen();
64
+ this.activeDotIndex = idx;
65
+ const totalWidth = this.getSlotClientWidth();
66
+ let targetDragOffset = 0;
67
+ if (this.dotCount - 1 === this.activeDotIndex && !this.isDragging) {
68
+ const viewPortWidth = this.getViewportWidth();
69
+ targetDragOffset = totalWidth - viewPortWidth;
70
+ }
71
+ else {
72
+ targetDragOffset = idx * this.getDotScreenLength();
73
+ }
74
+ this.moveToTarget(targetDragOffset);
46
75
  };
47
76
  this.onPointerDown = (e) => {
48
77
  e.preventDefault();
@@ -68,7 +97,6 @@ export class TetCarousel {
68
97
  }
69
98
  };
70
99
  this.onPointerMove = (e) => {
71
- var _a, _b, _c;
72
100
  if (!this.isDragging)
73
101
  return;
74
102
  // Only consider this a move (and prevent clicks) when movement exceeds a small threshold.
@@ -85,21 +113,20 @@ export class TetCarousel {
85
113
  let _dragOffset = this.dragOffset;
86
114
  _dragOffset += delta;
87
115
  this.dragStartX = e.screenX;
88
- const wrapperWidth = ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
89
- const totalWidth = ((_c = (_b = this.trackElement) === null || _b === void 0 ? void 0 : _b.querySelector('slot')) === null || _c === void 0 ? void 0 : _c.offsetWidth) || window.innerWidth;
116
+ const wrapperWidth = this.getViewportWidth();
117
+ const totalWidth = this.getSlotClientWidth();
90
118
  const totalScrollableWidth = -(totalWidth - wrapperWidth);
91
119
  if (totalScrollableWidth < _dragOffset && _dragOffset < 0) {
92
120
  this.dragOffset = _dragOffset;
93
121
  }
94
122
  };
95
123
  this.onPointerUp = (e) => {
96
- var _a, _b, _c;
97
124
  e.preventDefault();
98
125
  e.stopPropagation();
99
126
  e.stopImmediatePropagation();
100
127
  if (!this.isDragging)
101
128
  return;
102
- // Snap activeIndex when dragOffset passes threshold from last index position
129
+ // Snap activeDotIndex when dragOffset passes threshold from last index position
103
130
  this.isDragging = false;
104
131
  // Let the once:true capture handler auto-remove itself. Clear flag after a tick.
105
132
  if (this.clickPreventAdded) {
@@ -108,17 +135,7 @@ export class TetCarousel {
108
135
  }, 0);
109
136
  }
110
137
  if (Math.abs(this.dragOffset - this.swipeStart) > this.swipeThreshold) {
111
- const indexOffsett = this.dragOffset < this.swipeStart ? 1 : -1;
112
- let index = this.activeIndex + indexOffsett;
113
- index = Math.max(0, Math.min(index, this.screenCount - 1));
114
- this.activeIndex = index;
115
- const wrapperWidth = ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
116
- if (this.screenCount - 1 === this.activeIndex && !this.isDragging) {
117
- const totalWidth = ((_c = (_b = this.trackElement) === null || _b === void 0 ? void 0 : _b.querySelector('slot')) === null || _c === void 0 ? void 0 : _c.offsetWidth) || window.innerWidth;
118
- this.dragOffset = -(totalWidth - wrapperWidth);
119
- return;
120
- }
121
- this.dragOffset = -(index * wrapperWidth);
138
+ this.moveToTarget(-this.dragOffset);
122
139
  }
123
140
  document.body.style.userSelect = '';
124
141
  document.removeEventListener('pointermove', this.onPointerMove);
@@ -133,10 +150,10 @@ export class TetCarousel {
133
150
  this.draggedAnchor.addEventListener('click', preventClick, true);
134
151
  }
135
152
  };
136
- this.activeIndex = 0;
137
- this.screenCount = 0;
153
+ this.activeDotIndex = 0;
154
+ this.dotCount = 0;
138
155
  this.totalItems = 0;
139
- this.items = [];
156
+ this.activeItem = 0;
140
157
  this.theme = 'light';
141
158
  this.isDragging = false;
142
159
  this.dragOffset = 0;
@@ -148,17 +165,46 @@ export class TetCarousel {
148
165
  this.transitionTiming = 'cubic-bezier(0.77,0,0.175,1)';
149
166
  this.buttonIconLeft = 'arrow-left';
150
167
  this.buttonIconRight = 'arrow-right';
151
- this.containerClass = '';
152
- this.trackClass = '';
153
- this.buttonClass = '';
154
- this.dotClass = '';
168
+ this.maxDots = 8;
169
+ this.language = 'lv';
170
+ }
171
+ async onLanguageChange(language) {
172
+ processTranslations('tet-components', language).then(() => forceUpdate(this));
173
+ }
174
+ componentWillLoad() {
175
+ processTranslations('tet-components', this.language).then(() => forceUpdate(this));
176
+ }
177
+ getViewportWidth() {
178
+ var _a;
179
+ return ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
180
+ }
181
+ getSlotClientWidth() {
182
+ var _a, _b;
183
+ return ((_b = (_a = this.trackElement) === null || _a === void 0 ? void 0 : _a.querySelector('slot')) === null || _b === void 0 ? void 0 : _b.offsetWidth) || window.innerWidth;
184
+ }
185
+ getDotScreenLength() {
186
+ const totalWidth = this.getSlotClientWidth();
187
+ return (totalWidth / this.dotCount);
188
+ }
189
+ isLast(lastScreenBorder, position) {
190
+ const totalWidth = this.getSlotClientWidth();
191
+ const relativeLeftToEnd = totalWidth - position;
192
+ return relativeLeftToEnd <= lastScreenBorder;
193
+ }
194
+ isLastViewport(position) {
195
+ const viewportWidth = this.getViewportWidth();
196
+ return this.isLast(viewportWidth, position);
197
+ }
198
+ isLastDotScreen(position, dotScreenLength) {
199
+ const viewportWidth = this.getViewportWidth();
200
+ const lastScreenBorder = Math.max(dotScreenLength, viewportWidth);
201
+ return this.isLast(lastScreenBorder, position);
155
202
  }
156
203
  checkGradient() {
157
- var _a, _b, _c;
158
204
  if (this.showGradient) {
159
205
  const absOffset = Math.abs(this.dragOffset);
160
- const wrapperWidth = ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
161
- const totalWidth = ((_c = (_b = this.trackElement) === null || _b === void 0 ? void 0 : _b.querySelector('slot')) === null || _c === void 0 ? void 0 : _c.offsetWidth) || window.innerWidth;
206
+ const wrapperWidth = this.getViewportWidth();
207
+ const totalWidth = this.getSlotClientWidth();
162
208
  const rightEdgeDistance = totalWidth - absOffset - wrapperWidth;
163
209
  if (rightEdgeDistance >= 0) {
164
210
  const rightEdge = rightEdgeDistance < 16;
@@ -181,39 +227,43 @@ export class TetCarousel {
181
227
  this.rightGradientRef.style.opacity = "0";
182
228
  }
183
229
  }
184
- getScreenCount() {
185
- var _a, _b;
230
+ getDotCount() {
231
+ var _a;
186
232
  const slot = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector('slot');
187
233
  if (!slot)
188
234
  return 1;
189
235
  const assigned = slot.assignedElements ? slot.assignedElements() : [];
190
236
  if (assigned.length === 0)
191
237
  return 1;
192
- let totalWidth = 0;
193
- assigned.forEach((el, index) => {
194
- totalWidth += el.offsetWidth || 0;
195
- this.items.push({ id: index, width: el.offsetWidth || 0 });
196
- });
197
- if (totalWidth === 0) {
198
- totalWidth = assigned.length * window.innerWidth;
199
- }
200
- const screenWidth = ((_b = this.container) === null || _b === void 0 ? void 0 : _b.offsetWidth) || window.innerWidth;
201
238
  this.totalItems = assigned.length;
202
- this.screenCount = Math.ceil(totalWidth / screenWidth);
203
- }
204
- disableTabIndex() {
205
- const buttonComponents = this.container.querySelectorAll('tet-button');
206
- buttonComponents.forEach((btnComponent) => {
207
- const btn = btnComponent.shadowRoot.querySelector('button');
208
- btn.setAttribute('tabIndex', '-1');
239
+ const viewportWidth = this.getViewportWidth();
240
+ const totalWidth = this.getSlotClientWidth();
241
+ let count = 0;
242
+ assigned.forEach((el) => {
243
+ const rect = el.getBoundingClientRect();
244
+ const trackRect = this.trackElement.getBoundingClientRect();
245
+ let relativeLeft = rect.left - trackRect.left;
246
+ if (relativeLeft > totalWidth - viewportWidth) {
247
+ this.dotCount = Math.min(this === null || this === void 0 ? void 0 : this.maxDots, count + 1);
248
+ return;
249
+ }
250
+ count = Math.min(this === null || this === void 0 ? void 0 : this.maxDots, Math.ceil(relativeLeft / viewportWidth));
209
251
  });
210
252
  }
253
+ calculateGradient(item, relativeLeft) {
254
+ const totalWidth = this.getSlotClientWidth();
255
+ const offsetWidth = item.offsetWidth;
256
+ let relativeRight = totalWidth - relativeLeft - offsetWidth;
257
+ let gradientOffset = this.showGradient ? 160 : 0;
258
+ gradientOffset = relativeLeft < 160 ? relativeLeft : gradientOffset;
259
+ gradientOffset = relativeRight < 160 ? 0 : gradientOffset;
260
+ return gradientOffset;
261
+ }
211
262
  componentDidLoad() {
212
- this.getScreenCount();
213
- window.addEventListener('resize', this.getScreenCount.bind(this));
263
+ this.getDotCount();
264
+ window.addEventListener('resize', this.getDotCount.bind(this));
214
265
  this.addAnchorFocusListeners();
215
266
  this.checkGradient();
216
- this.disableTabIndex();
217
267
  }
218
268
  addAnchorFocusListeners() {
219
269
  if (!this.trackElement)
@@ -233,40 +283,57 @@ export class TetCarousel {
233
283
  }
234
284
  const tabIndexElements = Array.from(el.querySelectorAll('[tabindex="0"]'));
235
285
  anchors = anchors.concat(tabIndexElements);
286
+ if (el.shadowRoot) {
287
+ const deepTabIndexElements = Array.from(el.shadowRoot.querySelectorAll('[tabindex="0"]'));
288
+ anchors = anchors.concat(deepTabIndexElements);
289
+ }
236
290
  });
237
- anchors.forEach((a) => {
291
+ anchors.forEach((a, index) => {
238
292
  a.addEventListener('focus', () => {
239
- var _a, _b, _c;
240
- const screenWidth = ((_a = this.container) === null || _a === void 0 ? void 0 : _a.offsetWidth) || window.innerWidth;
241
- const rect = a.getBoundingClientRect();
242
- const trackRect = this.trackElement.getBoundingClientRect();
243
- let relativeLeft = rect.left - trackRect.left;
244
- const totalWidth = ((_c = (_b = this.trackElement) === null || _b === void 0 ? void 0 : _b.querySelector('slot')) === null || _c === void 0 ? void 0 : _c.offsetWidth) || window.innerWidth;
245
- let relativeRight = totalWidth - relativeLeft - a.offsetWidth;
246
- // calculations for active index/dots
247
- let index = Math.round(-this.dragOffset / screenWidth);
248
- index = Math.max(0, Math.min(index, this.screenCount - 1));
249
- let gradientOffset = this.showGradient ? 160 : 0;
250
- gradientOffset = relativeLeft < 160 ? relativeLeft : gradientOffset;
251
- gradientOffset = relativeRight < 160 ? 0 : gradientOffset;
252
- relativeLeft -= gradientOffset;
253
- const screenIdx = Math.floor((relativeLeft - gradientOffset) / screenWidth);
254
- this.activeIndex = Math.max(0, Math.min(screenIdx, this.screenCount - 1));
255
- if (totalWidth > screenWidth + relativeLeft) {
256
- this.dragOffset = -relativeLeft;
257
- }
258
- this.checkForLastScreen();
293
+ this.moveToItem(a, index);
259
294
  });
260
295
  });
261
296
  }
297
+ clampDotIndex(dotIndex) {
298
+ return Math.max(0, Math.min(dotIndex, this.dotCount - 1));
299
+ }
300
+ setDotIndex(position, gradientOffset) {
301
+ let dotIndex = 0;
302
+ const dotScreenLength = this.getDotScreenLength();
303
+ if (this.isLastDotScreen(position, dotScreenLength)) {
304
+ dotIndex = this.dotCount - 1;
305
+ }
306
+ else {
307
+ dotIndex = Math.floor((position + gradientOffset) / dotScreenLength);
308
+ }
309
+ this.activeDotIndex = this.clampDotIndex(dotIndex);
310
+ }
311
+ moveToItem(item, index) {
312
+ if (index || index === 0) {
313
+ this.activeItem = index;
314
+ }
315
+ const rect = item.getBoundingClientRect();
316
+ const trackRect = this.trackElement.getBoundingClientRect();
317
+ let relativeLeft = rect.left - trackRect.left;
318
+ const gradientOffset = this.calculateGradient(item, relativeLeft);
319
+ this.setDotIndex(relativeLeft, gradientOffset);
320
+ if (!this.isLastViewport(relativeLeft)) {
321
+ this.dragOffset = -relativeLeft;
322
+ }
323
+ else {
324
+ this.moveToLastScreen();
325
+ }
326
+ }
262
327
  disconnectedCallback() {
263
- window.removeEventListener('resize', this.getScreenCount.bind(this));
328
+ window.removeEventListener('resize', this.getDotCount.bind(this));
264
329
  }
265
330
  render() {
266
- return (h(Host, { key: '5992f1f40379e5324c9db3454ffb9d6664d2acaf' }, h("div", { key: 'a6abf4aadb39f6a65de46d740925f5824f256def', class: { 'tet-carousel': true, [`${this.theme}`]: true }, ref: (el) => (this.container = el), part: "carousel" }, h("div", { key: 'abfd06f3c4e8428551c2865814e008803bd588f3', class: "tet-carousel__container" }, h("div", { key: '00a9b8d59d49b7105b52cad50c1d7c37444e8e65', class: "tet-carousel__gradient-left", ref: (el) => { this.leftGradientRef = el; } }), h("div", { key: '238281755c985345ef7733621b39cd4807a276f7', class: "tet-carousel__gradient-right", ref: (el) => { this.rightGradientRef = el; } }), h("div", { key: '9351c5b0da6e5dc93d92f055826b0344b85da996', class: "tet-carousel__track", ref: (el) => (this.trackElement = el), style: {
331
+ return (h(Host, { key: 'd2a06bc0e502d130ad3642fcbda590a003e6f305' }, h("div", { key: '96ac837374a1ad150f925a44dc534547426a13e1', class: { 'tet-carousel': true, [`${this.theme}`]: true }, ref: (el) => (this.container = el), part: "carousel" }, h("div", { key: 'e8f8f9b22d1a2170bb4f3a7e5834d2832c18b853', class: "tet-carousel__container" }, h("div", { key: '63e2d90692e0d5a6b58e919016a3baf614c7bfb3', class: "tet-carousel__gradient-left", ref: (el) => { this.leftGradientRef = el; } }), h("div", { key: '29c271641073f62bade810d4f3f05666fbc48f78', class: "tet-carousel__gradient-right", ref: (el) => { this.rightGradientRef = el; } }), h("div", { key: 'c6ca2fe643e5fe9a1ab4fe9b383ac033939a268f', class: "tet-carousel__track", ref: (el) => (this.trackElement = el), style: {
267
332
  transform: `translateX(${this.dragOffset}px)`,
268
333
  transition: this.isDragging ? 'none' : `transform ${this.transitionDuration}ms ${this.transitionTiming}`
269
- }, onPointerDown: this.onPointerDown, onMouseMove: this.onPointerMove, onPointerUp: this.onPointerUp, onMouseLeave: this.onPointerUp }, h("slot", { key: 'f410268e9234ffe63d5c26568da7c07fe8126847' }))), h("div", { key: 'afc0d8a7dc118c855404b5e691f48b3bfe008c24', class: "tet-carousel__controls" }, this.showButtons && (h("div", { key: '70a6583e47543b1915d71cb44940211c17c1e99f', class: "tet-carousel__buttons tet-carousel__buttons--mobile" }, h("tet-button", { key: '28c31103f4fa7c062b1d7fa5e3e93320420e7760', 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: 'c0578a8db9faacef7770c3ee6a78ef6f5344f9c6', 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: '317982c0a2f35fd46f98c47c66641bb416ac4ab4', class: "tet-carousel__buttons " }, h("tet-button", { key: 'd7b06315e10b17295b25ea188d2d1a4817cb9aa7', 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: '17110d87b3b6855ac9f78f68fd6345d2ad7122df', 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 })))))));
334
+ }, onPointerDown: this.onPointerDown, onMouseMove: this.onPointerMove, onPointerUp: this.onPointerUp, onMouseLeave: this.onPointerUp }, h("slot", { key: '70203e9f192cdc419352b8c37b6525c46b947aac' }))), (this.showButtons || this.showDots) && (h("div", { key: '104db94f8bfe2d26c939fd906089bac09a190f39', class: "tet-carousel__controls" }, this.showButtons && (h("div", { key: 'a359503a813556b1ae04663b67bffc80fb6d3eba', class: "tet-carousel__buttons tet-carousel__buttons--mobile" }, h("tet-button", { key: 'b879d216ee1475385528534e1e7ba582cc6340fa', class: "tet-carousel__btn", theme: this.theme === 'light' ? 'dark' : 'light', "icon-name": this.buttonIconLeft, "icon-mode": true, onClick: this.handlePrev, "aria-label": t('components-carousel-previous'), disabled: this.dotCount <= 1 || this.activeItem === 0 }))), this.showDots && (h("div", { key: 'fe2fa44f42636e6d1a1d9a216db73ebff6063f51', class: "tet-carousel__dots" }, Array.from({ length: this.dotCount }).map((_, idx) => (h("button", { type: "button", class: `tet-carousel__dot${idx === this.activeDotIndex ? ' active' : ''}`, key: idx, onClick: () => this.handleDotClick(idx) }))))), this.showButtons && (h("div", { key: '6fef3b90e8646571d8947fd81785bf1dbffe636b', class: "tet-carousel__buttons " }, h("tet-button", { key: '8e51c2e7a3585c36ba144a6c8f6a57f4c1c3bd48', 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": t('components-carousel-previous'), disabled: this.dotCount <= 1 || this.activeItem === 0 }), h("tet-button", { key: 'affb86f1c2c3dd128389b1bea0179806512ea3d1', class: "tet-carousel__btn", theme: this.theme === 'light' ? 'dark' : 'light', "icon-name": this.buttonIconRight, "icon-mode": true, onClick: this.handleNext, "aria-label": t('components-carousel-next'), disabled: this.dotCount <= 1
335
+ || this.activeItem === this.totalItems - 1
336
+ || this.isLastViewport(-this.dragOffset) }))))))));
270
337
  }
271
338
  static get is() { return "tet-carousel"; }
272
339
  static get encapsulation() { return "shadow"; }
@@ -444,92 +511,65 @@ export class TetCarousel {
444
511
  "reflect": false,
445
512
  "defaultValue": "'arrow-right'"
446
513
  },
447
- "containerClass": {
448
- "type": "string",
449
- "mutable": false,
450
- "complexType": {
451
- "original": "string",
452
- "resolved": "string",
453
- "references": {}
454
- },
455
- "required": false,
456
- "optional": false,
457
- "docs": {
458
- "tags": [],
459
- "text": "Additional CSS class for the carousel container."
460
- },
461
- "attribute": "container-class",
462
- "reflect": false,
463
- "defaultValue": "''"
464
- },
465
- "trackClass": {
466
- "type": "string",
467
- "mutable": false,
468
- "complexType": {
469
- "original": "string",
470
- "resolved": "string",
471
- "references": {}
472
- },
473
- "required": false,
474
- "optional": false,
475
- "docs": {
476
- "tags": [],
477
- "text": "Additional CSS class for the carousel track."
478
- },
479
- "attribute": "track-class",
480
- "reflect": false,
481
- "defaultValue": "''"
482
- },
483
- "buttonClass": {
484
- "type": "string",
514
+ "maxDots": {
515
+ "type": "number",
485
516
  "mutable": false,
486
517
  "complexType": {
487
- "original": "string",
488
- "resolved": "string",
518
+ "original": "number",
519
+ "resolved": "number",
489
520
  "references": {}
490
521
  },
491
522
  "required": false,
492
523
  "optional": false,
493
524
  "docs": {
494
525
  "tags": [],
495
- "text": "Additional CSS class for the navigation buttons."
526
+ "text": "Maximum number of dots."
496
527
  },
497
- "attribute": "button-class",
528
+ "attribute": "max-dots",
498
529
  "reflect": false,
499
- "defaultValue": "''"
530
+ "defaultValue": "8"
500
531
  },
501
- "dotClass": {
532
+ "language": {
502
533
  "type": "string",
503
534
  "mutable": false,
504
535
  "complexType": {
505
- "original": "string",
506
- "resolved": "string",
507
- "references": {}
536
+ "original": "Language",
537
+ "resolved": "\"en\" | \"lv\" | \"ru\"",
538
+ "references": {
539
+ "Language": {
540
+ "location": "import",
541
+ "path": "@services/translations",
542
+ "id": "src/services/translations/index.ts::Language"
543
+ }
544
+ }
508
545
  },
509
546
  "required": false,
510
547
  "optional": false,
511
548
  "docs": {
512
549
  "tags": [],
513
- "text": "Additional CSS class for the navigation dots."
550
+ "text": "The translation language."
514
551
  },
515
- "attribute": "dot-class",
552
+ "attribute": "language",
516
553
  "reflect": false,
517
- "defaultValue": "''"
554
+ "defaultValue": "'lv'"
518
555
  }
519
556
  };
520
557
  }
521
558
  static get states() {
522
559
  return {
523
- "activeIndex": {},
524
- "screenCount": {},
560
+ "activeDotIndex": {},
561
+ "dotCount": {},
525
562
  "totalItems": {},
526
- "items": {},
563
+ "activeItem": {},
527
564
  "isDragging": {},
528
565
  "dragOffset": {}
529
566
  };
530
567
  }
531
568
  static get watchers() {
532
569
  return [{
570
+ "propName": "language",
571
+ "methodName": "onLanguageChange"
572
+ }, {
533
573
  "propName": "showGradient",
534
574
  "methodName": "checkGradient"
535
575
  }, {