@elxjs/ui 0.0.205 → 0.0.206
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/esm2022/lib/components/card-benefit/card-benefit.component.mjs +6 -3
- package/esm2022/lib/components/carousel/carousel.component.mjs +123 -131
- package/esm2022/lib/components/carousel-bleed/carousel-bleed.component.mjs +93 -128
- package/fesm2022/elxjs-ui.mjs +219 -259
- package/fesm2022/elxjs-ui.mjs.map +1 -1
- package/lib/components/card-benefit/card-benefit.component.d.ts +2 -1
- package/lib/components/carousel/carousel.component.d.ts +27 -16
- package/lib/components/carousel-bleed/carousel-bleed.component.d.ts +22 -16
- package/package.json +1 -1
package/fesm2022/elxjs-ui.mjs
CHANGED
|
@@ -1337,7 +1337,6 @@ class EluxCarouselComponent {
|
|
|
1337
1337
|
this.previousClickEventEmitter = new EventEmitter();
|
|
1338
1338
|
this.nextClickEventEmitter = new EventEmitter();
|
|
1339
1339
|
this.dotClickEventEmitter = new EventEmitter();
|
|
1340
|
-
this.currentIndex = 0;
|
|
1341
1340
|
this.currentStepIndex = 0;
|
|
1342
1341
|
this.offset = 0;
|
|
1343
1342
|
this.isDragging = false;
|
|
@@ -1346,62 +1345,77 @@ class EluxCarouselComponent {
|
|
|
1346
1345
|
this.initialOffset = 0;
|
|
1347
1346
|
this.dragOffset = 0;
|
|
1348
1347
|
this.containerWidth = 0;
|
|
1349
|
-
this.itemWidth = 0;
|
|
1350
1348
|
this.maxOffset = 0;
|
|
1351
1349
|
this.minOffset = 0;
|
|
1352
|
-
this.animationId = null;
|
|
1353
1350
|
this.velocity = 0;
|
|
1354
1351
|
this.lastMoveTime = 0;
|
|
1355
1352
|
this.lastMoveX = 0;
|
|
1356
|
-
this.
|
|
1357
|
-
this.
|
|
1358
|
-
this.
|
|
1353
|
+
this.pointerStartTime = 0;
|
|
1354
|
+
this.pointerStartX = 0;
|
|
1355
|
+
this.pointerStartY = 0;
|
|
1356
|
+
this.pointerDownType = 'mouse';
|
|
1357
|
+
this.activePointerId = null;
|
|
1359
1358
|
this.isVerticalScroll = false;
|
|
1360
|
-
this.wasDragging = false;
|
|
1361
1359
|
this.clicksDisabled = false;
|
|
1362
1360
|
this.clickListeners = [];
|
|
1363
|
-
this.
|
|
1364
|
-
this.
|
|
1361
|
+
this.itemsChangesSubscription = null;
|
|
1362
|
+
this.hasDragged = false;
|
|
1363
|
+
this.resizeHandler = () => this.onResize();
|
|
1364
|
+
this.transitionDuration = 'transform 0.4s ease-out';
|
|
1365
|
+
this.dragThresholdPx = 5;
|
|
1366
|
+
this.touchDragThresholdPx = 10;
|
|
1367
|
+
this.holdToDragThresholdMs = 200;
|
|
1368
|
+
this.touchDurationThresholdMs = 300;
|
|
1369
|
+
this.clickDisableDelayMs = 200;
|
|
1370
|
+
this.clearDraggedDelayMs = 250;
|
|
1371
|
+
this.slideChangeThresholdPx = 40;
|
|
1372
|
+
this.momentumThreshold = 0.3;
|
|
1373
|
+
this.edgeResistance = 0.3;
|
|
1365
1374
|
}
|
|
1366
1375
|
ngAfterContentInit() {
|
|
1367
|
-
this.
|
|
1368
|
-
this.setItemWidths();
|
|
1369
|
-
this.updateLimits();
|
|
1376
|
+
this.refreshLayout();
|
|
1370
1377
|
this.setupClickPrevention();
|
|
1371
|
-
this.items.changes.subscribe(() => {
|
|
1372
|
-
this.
|
|
1373
|
-
this.setItemWidths();
|
|
1374
|
-
this.updateLimits();
|
|
1378
|
+
this.itemsChangesSubscription = this.items.changes.subscribe(() => {
|
|
1379
|
+
this.refreshLayout();
|
|
1375
1380
|
this.goToFirstSlide();
|
|
1376
1381
|
this.setupClickPrevention();
|
|
1377
1382
|
});
|
|
1378
1383
|
// Listen for window resize to recalculate dimensions
|
|
1379
|
-
window.addEventListener('resize',
|
|
1384
|
+
window.addEventListener('resize', this.resizeHandler);
|
|
1380
1385
|
}
|
|
1381
1386
|
ngOnDestroy() {
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
}
|
|
1387
|
+
this.itemsChangesSubscription?.unsubscribe();
|
|
1388
|
+
this.itemsChangesSubscription = null;
|
|
1385
1389
|
// Clean up click listeners
|
|
1386
1390
|
this.clickListeners.forEach(unlisten => unlisten());
|
|
1387
1391
|
this.clickListeners = [];
|
|
1388
|
-
window.removeEventListener('resize',
|
|
1392
|
+
window.removeEventListener('resize', this.resizeHandler);
|
|
1393
|
+
}
|
|
1394
|
+
refreshLayout() {
|
|
1395
|
+
this.calculateDimensions();
|
|
1396
|
+
this.setItemWidths();
|
|
1397
|
+
this.updateLimits();
|
|
1389
1398
|
}
|
|
1390
1399
|
calculateDimensions() {
|
|
1391
1400
|
if (this.slidesContainer) {
|
|
1392
1401
|
this.containerWidth = this.slidesContainer.nativeElement.offsetWidth;
|
|
1393
|
-
const totalGap = Math.max(0, this.itemsPerSlide - 1) * this.gap;
|
|
1394
|
-
this.itemWidth = (this.containerWidth - totalGap) / this.itemsPerSlide;
|
|
1395
1402
|
}
|
|
1396
1403
|
}
|
|
1397
1404
|
updateLimits() {
|
|
1398
|
-
const totalSteps = Math.ceil(this.items.length / this.itemsPerSlide);
|
|
1399
1405
|
this.maxOffset = 0;
|
|
1400
|
-
this.minOffset = -((
|
|
1406
|
+
this.minOffset = -((this.getTotalSteps() - 1) * this.getPageWidthPercent());
|
|
1407
|
+
}
|
|
1408
|
+
getPageWidthPercent() {
|
|
1409
|
+
if (!this.containerWidth)
|
|
1410
|
+
return 100;
|
|
1411
|
+
const gapPercent = (this.gap / this.containerWidth) * 100;
|
|
1412
|
+
return 100 + gapPercent;
|
|
1413
|
+
}
|
|
1414
|
+
getTotalSteps() {
|
|
1415
|
+
return Math.ceil(this.items.length / this.itemsPerSlide);
|
|
1401
1416
|
}
|
|
1402
1417
|
canGoNext() {
|
|
1403
|
-
|
|
1404
|
-
return this.currentStepIndex < totalSteps - 1;
|
|
1418
|
+
return this.currentStepIndex < this.getTotalSteps() - 1;
|
|
1405
1419
|
}
|
|
1406
1420
|
canGoPrevious() {
|
|
1407
1421
|
return this.currentStepIndex > 0;
|
|
@@ -1411,97 +1425,82 @@ class EluxCarouselComponent {
|
|
|
1411
1425
|
this.updateOffset();
|
|
1412
1426
|
}
|
|
1413
1427
|
setItemWidths() {
|
|
1428
|
+
const totalGap = Math.max(0, this.itemsPerSlide - 1) * this.gap;
|
|
1414
1429
|
this.items.forEach((item) => {
|
|
1415
1430
|
this.renderer.setStyle(item.nativeElement, 'box-sizing', 'border-box');
|
|
1416
|
-
const
|
|
1417
|
-
this.renderer.setStyle(item.nativeElement, 'minWidth',
|
|
1431
|
+
const basis = `calc((100% - ${totalGap}px) / ${this.itemsPerSlide})`;
|
|
1432
|
+
this.renderer.setStyle(item.nativeElement, 'minWidth', basis);
|
|
1433
|
+
this.renderer.setStyle(item.nativeElement, 'flex', `0 0 ${basis}`);
|
|
1418
1434
|
});
|
|
1419
|
-
if (this.slidesContainer) {
|
|
1420
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'gap', `${this.gap}px`);
|
|
1421
|
-
}
|
|
1422
1435
|
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
this.
|
|
1427
|
-
this.
|
|
1428
|
-
this.
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
if (this.isDragging) {
|
|
1432
|
-
event.preventDefault();
|
|
1433
|
-
// Mark that we've started dragging if we've moved more than 5px
|
|
1434
|
-
const dragDistance = Math.abs(this.currentX - this.startX);
|
|
1435
|
-
if (dragDistance > 5 && !this.dragStarted) {
|
|
1436
|
-
this.dragStarted = true;
|
|
1437
|
-
this.wasDragging = true;
|
|
1438
|
-
}
|
|
1439
|
-
this.updateDrag(event.clientX);
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
onMouseUp(event) {
|
|
1443
|
-
if (this.isDragging) {
|
|
1444
|
-
const mouseUpTime = Date.now();
|
|
1445
|
-
const holdDuration = mouseUpTime - this.mouseDownTime;
|
|
1446
|
-
const mouseDistance = Math.abs(this.currentX - this.startX);
|
|
1447
|
-
// Consider it a drag if:
|
|
1448
|
-
// 1. We moved more than 5px, OR
|
|
1449
|
-
// 2. We held the mouse down for more than 200ms and moved at all
|
|
1450
|
-
if (mouseDistance > 5 || (holdDuration > 200 && mouseDistance > 0)) {
|
|
1451
|
-
this.wasDragging = true;
|
|
1452
|
-
}
|
|
1453
|
-
this.endDrag();
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
onMouseLeave(event) {
|
|
1457
|
-
if (this.isDragging) {
|
|
1458
|
-
// If mouse leaves while dragging, definitely consider it a drag
|
|
1459
|
-
this.wasDragging = true;
|
|
1460
|
-
this.endDrag();
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
// Touch events
|
|
1464
|
-
onTouchStart(event) {
|
|
1465
|
-
this.touchStartTime = Date.now();
|
|
1466
|
-
this.touchStartX = event.touches[0].clientX;
|
|
1467
|
-
this.touchStartY = event.touches[0].clientY;
|
|
1436
|
+
onPointerDown(event) {
|
|
1437
|
+
if (event.pointerType === 'mouse' && event.button !== 0)
|
|
1438
|
+
return;
|
|
1439
|
+
this.activePointerId = event.pointerId;
|
|
1440
|
+
this.pointerDownType = event.pointerType;
|
|
1441
|
+
this.pointerStartTime = Date.now();
|
|
1442
|
+
this.pointerStartX = event.clientX;
|
|
1443
|
+
this.pointerStartY = event.clientY;
|
|
1468
1444
|
this.isVerticalScroll = false;
|
|
1469
|
-
this.
|
|
1445
|
+
if (this.slidesContainer?.nativeElement?.setPointerCapture) {
|
|
1446
|
+
this.slidesContainer.nativeElement.setPointerCapture(event.pointerId);
|
|
1447
|
+
}
|
|
1448
|
+
this.startDrag(event.clientX);
|
|
1470
1449
|
}
|
|
1471
|
-
|
|
1472
|
-
if (!this.isDragging)
|
|
1450
|
+
onPointerMove(event) {
|
|
1451
|
+
if (!this.isDragging || this.activePointerId !== event.pointerId)
|
|
1473
1452
|
return;
|
|
1474
|
-
const
|
|
1475
|
-
const
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1478
|
-
// Check if this is a vertical scroll
|
|
1479
|
-
if (deltaY > deltaX && deltaY > 10) {
|
|
1453
|
+
const deltaX = Math.abs(event.clientX - this.pointerStartX);
|
|
1454
|
+
const deltaY = Math.abs(event.clientY - this.pointerStartY);
|
|
1455
|
+
const isTouchLikePointer = this.pointerDownType !== 'mouse';
|
|
1456
|
+
if (isTouchLikePointer && deltaY > deltaX && deltaY > this.touchDragThresholdPx) {
|
|
1480
1457
|
this.isVerticalScroll = true;
|
|
1481
1458
|
this.isDragging = false;
|
|
1482
|
-
this.
|
|
1459
|
+
this.setSlidesTransition(true);
|
|
1483
1460
|
return;
|
|
1484
1461
|
}
|
|
1485
|
-
|
|
1486
|
-
if (deltaX > 10) {
|
|
1462
|
+
if (this.pointerDownType === 'mouse' || deltaX > this.touchDragThresholdPx) {
|
|
1487
1463
|
event.preventDefault();
|
|
1488
|
-
this.updateDrag(event.
|
|
1464
|
+
this.updateDrag(event.clientX);
|
|
1489
1465
|
}
|
|
1490
1466
|
}
|
|
1491
|
-
|
|
1467
|
+
onPointerUp(event) {
|
|
1468
|
+
if (this.activePointerId !== event.pointerId)
|
|
1469
|
+
return;
|
|
1492
1470
|
if (this.isVerticalScroll) {
|
|
1493
|
-
this.
|
|
1471
|
+
this.resetPointerState(event.pointerId);
|
|
1494
1472
|
return;
|
|
1495
1473
|
}
|
|
1496
|
-
const
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1474
|
+
const pressDuration = Date.now() - this.pointerStartTime;
|
|
1475
|
+
const pointerDistance = Math.abs(this.currentX - this.startX);
|
|
1476
|
+
if (this.pointerDownType === 'mouse') {
|
|
1477
|
+
if (pointerDistance > this.dragThresholdPx || (pressDuration > this.holdToDragThresholdMs && pointerDistance > 0)) {
|
|
1478
|
+
this.hasDragged = true;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
else if (pointerDistance > this.touchDragThresholdPx || pressDuration > this.touchDurationThresholdMs) {
|
|
1482
|
+
this.hasDragged = true;
|
|
1501
1483
|
}
|
|
1502
1484
|
if (this.isDragging) {
|
|
1503
1485
|
this.endDrag();
|
|
1504
1486
|
}
|
|
1487
|
+
this.resetPointerState(event.pointerId);
|
|
1488
|
+
}
|
|
1489
|
+
onPointerCancel(event) {
|
|
1490
|
+
if (this.activePointerId !== event.pointerId)
|
|
1491
|
+
return;
|
|
1492
|
+
if (this.isDragging) {
|
|
1493
|
+
this.hasDragged = true;
|
|
1494
|
+
this.endDrag();
|
|
1495
|
+
}
|
|
1496
|
+
this.resetPointerState(event.pointerId);
|
|
1497
|
+
}
|
|
1498
|
+
resetPointerState(pointerId) {
|
|
1499
|
+
if (this.slidesContainer?.nativeElement?.releasePointerCapture) {
|
|
1500
|
+
this.slidesContainer.nativeElement.releasePointerCapture(pointerId);
|
|
1501
|
+
}
|
|
1502
|
+
this.activePointerId = null;
|
|
1503
|
+
this.isVerticalScroll = false;
|
|
1505
1504
|
}
|
|
1506
1505
|
setupClickPrevention() {
|
|
1507
1506
|
// Clean up existing listeners
|
|
@@ -1510,7 +1509,7 @@ class EluxCarouselComponent {
|
|
|
1510
1509
|
this.items.forEach((item) => {
|
|
1511
1510
|
// Only prevent click events, not mouseup which is needed for drag functionality
|
|
1512
1511
|
const eventHandler = (event) => {
|
|
1513
|
-
if (event.type === 'click' && (this.
|
|
1512
|
+
if (event.type === 'click' && (this.hasDragged || this.clicksDisabled)) {
|
|
1514
1513
|
event.preventDefault();
|
|
1515
1514
|
event.stopPropagation();
|
|
1516
1515
|
event.stopImmediatePropagation();
|
|
@@ -1519,16 +1518,13 @@ class EluxCarouselComponent {
|
|
|
1519
1518
|
return true;
|
|
1520
1519
|
};
|
|
1521
1520
|
// Only listen to click events to avoid interfering with drag functionality
|
|
1522
|
-
item.nativeElement
|
|
1523
|
-
this.clickListeners.push(
|
|
1524
|
-
item.nativeElement.removeEventListener('click', eventHandler, true);
|
|
1525
|
-
});
|
|
1521
|
+
const unlisten = this.renderer.listen(item.nativeElement, 'click', eventHandler);
|
|
1522
|
+
this.clickListeners.push(unlisten);
|
|
1526
1523
|
});
|
|
1527
1524
|
}
|
|
1528
1525
|
startDrag(clientX) {
|
|
1529
1526
|
this.isDragging = true;
|
|
1530
|
-
this.
|
|
1531
|
-
this.dragStarted = false;
|
|
1527
|
+
this.hasDragged = false;
|
|
1532
1528
|
this.clicksDisabled = false;
|
|
1533
1529
|
this.startX = clientX;
|
|
1534
1530
|
this.currentX = clientX;
|
|
@@ -1539,7 +1535,7 @@ class EluxCarouselComponent {
|
|
|
1539
1535
|
this.lastMoveX = clientX;
|
|
1540
1536
|
this.calculateDimensions();
|
|
1541
1537
|
// Disable CSS transitions during drag
|
|
1542
|
-
this.
|
|
1538
|
+
this.setSlidesTransition(false);
|
|
1543
1539
|
}
|
|
1544
1540
|
updateDrag(clientX) {
|
|
1545
1541
|
if (!this.isDragging)
|
|
@@ -1547,9 +1543,8 @@ class EluxCarouselComponent {
|
|
|
1547
1543
|
this.currentX = clientX;
|
|
1548
1544
|
const totalDeltaX = this.currentX - this.startX;
|
|
1549
1545
|
// Mark as dragging if movement is significant
|
|
1550
|
-
if (Math.abs(totalDeltaX) >
|
|
1551
|
-
this.
|
|
1552
|
-
this.dragStarted = true;
|
|
1546
|
+
if (Math.abs(totalDeltaX) > this.dragThresholdPx) {
|
|
1547
|
+
this.hasDragged = true;
|
|
1553
1548
|
}
|
|
1554
1549
|
// Calculate velocity for momentum
|
|
1555
1550
|
const now = Date.now();
|
|
@@ -1571,11 +1566,11 @@ class EluxCarouselComponent {
|
|
|
1571
1566
|
const potentialOffset = this.initialOffset + dragPercentage;
|
|
1572
1567
|
if (potentialOffset > this.maxOffset) {
|
|
1573
1568
|
const overDrag = potentialOffset - this.maxOffset;
|
|
1574
|
-
resistedDragPercentage = dragPercentage - (overDrag *
|
|
1569
|
+
resistedDragPercentage = dragPercentage - (overDrag * this.edgeResistance);
|
|
1575
1570
|
}
|
|
1576
1571
|
else if (potentialOffset < this.minOffset) {
|
|
1577
1572
|
const overDrag = this.minOffset - potentialOffset;
|
|
1578
|
-
resistedDragPercentage = dragPercentage + (overDrag *
|
|
1573
|
+
resistedDragPercentage = dragPercentage + (overDrag * this.edgeResistance);
|
|
1579
1574
|
}
|
|
1580
1575
|
this.dragOffset = resistedDragPercentage;
|
|
1581
1576
|
this.updateDragPosition();
|
|
@@ -1589,29 +1584,26 @@ class EluxCarouselComponent {
|
|
|
1589
1584
|
return;
|
|
1590
1585
|
this.isDragging = false;
|
|
1591
1586
|
// Disable clicks temporarily after any drag
|
|
1592
|
-
if (this.
|
|
1587
|
+
if (this.hasDragged) {
|
|
1593
1588
|
this.clicksDisabled = true;
|
|
1594
1589
|
setTimeout(() => {
|
|
1595
1590
|
this.clicksDisabled = false;
|
|
1596
|
-
},
|
|
1591
|
+
}, this.clickDisableDelayMs);
|
|
1597
1592
|
}
|
|
1598
|
-
// Clear the
|
|
1593
|
+
// Clear the drag flag after a shorter delay
|
|
1599
1594
|
setTimeout(() => {
|
|
1600
|
-
this.
|
|
1601
|
-
|
|
1602
|
-
}, 250);
|
|
1595
|
+
this.hasDragged = false;
|
|
1596
|
+
}, this.clearDraggedDelayMs);
|
|
1603
1597
|
// Re-enable CSS transitions
|
|
1604
|
-
this.
|
|
1605
|
-
const threshold = 40;
|
|
1598
|
+
this.setSlidesTransition(true);
|
|
1606
1599
|
const dragDistance = Math.abs(this.currentX - this.startX);
|
|
1607
1600
|
// Check for momentum (velocity-based slide change)
|
|
1608
|
-
const
|
|
1609
|
-
const hasSignificantVelocity = Math.abs(this.velocity) > momentumThreshold;
|
|
1601
|
+
const hasSignificantVelocity = Math.abs(this.velocity) > this.momentumThreshold;
|
|
1610
1602
|
if ((this.currentStepIndex === 0 && (this.dragOffset > 0 || this.velocity > 0)) ||
|
|
1611
1603
|
(!this.canGoNext() && (this.dragOffset < 0 || this.velocity < 0))) {
|
|
1612
1604
|
this.updateOffset();
|
|
1613
1605
|
}
|
|
1614
|
-
else if (dragDistance >
|
|
1606
|
+
else if (dragDistance > this.slideChangeThresholdPx || hasSignificantVelocity) {
|
|
1615
1607
|
if (this.dragOffset > 0 || (hasSignificantVelocity && this.velocity > 0)) {
|
|
1616
1608
|
// Dragged right or has positive velocity - go to previous slide
|
|
1617
1609
|
this.prevSlide();
|
|
@@ -1633,22 +1625,24 @@ class EluxCarouselComponent {
|
|
|
1633
1625
|
this.dragOffset = 0;
|
|
1634
1626
|
this.velocity = 0;
|
|
1635
1627
|
}
|
|
1628
|
+
setSlidesTransition(enabled) {
|
|
1629
|
+
if (!this.slidesContainer)
|
|
1630
|
+
return;
|
|
1631
|
+
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', enabled ? this.transitionDuration : 'none');
|
|
1632
|
+
}
|
|
1636
1633
|
getStepIndexCount() {
|
|
1637
|
-
|
|
1638
|
-
return Array.from({ length: totalSteps }, (_, i) => i);
|
|
1634
|
+
return Array.from({ length: this.getTotalSteps() }, (_, i) => i);
|
|
1639
1635
|
}
|
|
1640
1636
|
getCurrentStepIndex() {
|
|
1641
1637
|
return this.currentStepIndex;
|
|
1642
1638
|
}
|
|
1643
1639
|
goToFirstSlide() {
|
|
1644
|
-
this.currentIndex = 0;
|
|
1645
1640
|
this.currentStepIndex = 0;
|
|
1646
1641
|
this.updateOffset();
|
|
1647
1642
|
this.scrollActiveDotIntoView(0);
|
|
1648
1643
|
}
|
|
1649
1644
|
goToSlide(index) {
|
|
1650
1645
|
this.currentStepIndex = index;
|
|
1651
|
-
this.currentIndex = Math.min(index * this.itemsPerSlide, this.items.length - this.itemsPerSlide);
|
|
1652
1646
|
this.updateOffset();
|
|
1653
1647
|
this.scrollActiveDotIntoView(index);
|
|
1654
1648
|
this.dotClickEventEmitter.emit();
|
|
@@ -1657,7 +1651,6 @@ class EluxCarouselComponent {
|
|
|
1657
1651
|
if (!this.canGoPrevious())
|
|
1658
1652
|
return;
|
|
1659
1653
|
this.currentStepIndex--;
|
|
1660
|
-
this.currentIndex = this.currentStepIndex * this.itemsPerSlide;
|
|
1661
1654
|
this.updateOffset();
|
|
1662
1655
|
this.scrollActiveDotIntoView(this.currentStepIndex);
|
|
1663
1656
|
this.previousClickEventEmitter.emit();
|
|
@@ -1666,13 +1659,12 @@ class EluxCarouselComponent {
|
|
|
1666
1659
|
if (!this.canGoNext())
|
|
1667
1660
|
return;
|
|
1668
1661
|
this.currentStepIndex++;
|
|
1669
|
-
this.currentIndex = Math.min(this.currentStepIndex * this.itemsPerSlide, this.items.length - this.itemsPerSlide);
|
|
1670
1662
|
this.updateOffset();
|
|
1671
1663
|
this.scrollActiveDotIntoView(this.currentStepIndex);
|
|
1672
1664
|
this.nextClickEventEmitter.emit();
|
|
1673
1665
|
}
|
|
1674
1666
|
updateOffset() {
|
|
1675
|
-
this.offset = -
|
|
1667
|
+
this.offset = -(this.currentStepIndex * this.getPageWidthPercent());
|
|
1676
1668
|
if (!this.isDragging && this.slidesContainer) {
|
|
1677
1669
|
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transform', `translateX(${this.offset}%)`);
|
|
1678
1670
|
}
|
|
@@ -1696,11 +1688,11 @@ class EluxCarouselComponent {
|
|
|
1696
1688
|
});
|
|
1697
1689
|
}
|
|
1698
1690
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCarouselComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1699
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EluxCarouselComponent, isStandalone: true, selector: "lib-elux-carousel", inputs: { itemsPerSlide: "itemsPerSlide", gap: "gap", title: "title" }, outputs: { previousClickEventEmitter: "previousClickEventEmitter", nextClickEventEmitter: "nextClickEventEmitter", dotClickEventEmitter: "dotClickEventEmitter" }, queries: [{ propertyName: "items", predicate: ["carouselItem"], read: ElementRef }], viewQueries: [{ propertyName: "dotsContainer", first: true, predicate: ["dotsContainer"], descendants: true }, { propertyName: "slidesContainer", first: true, predicate: ["slidesContainer"], descendants: true }], ngImport: i0, template: "<div class=\"c-carousel-container\">\n <
|
|
1691
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EluxCarouselComponent, isStandalone: true, selector: "lib-elux-carousel", inputs: { itemsPerSlide: "itemsPerSlide", gap: "gap", title: "title" }, outputs: { previousClickEventEmitter: "previousClickEventEmitter", nextClickEventEmitter: "nextClickEventEmitter", dotClickEventEmitter: "dotClickEventEmitter" }, queries: [{ propertyName: "items", predicate: ["carouselItem"], read: ElementRef }], viewQueries: [{ propertyName: "dotsContainer", first: true, predicate: ["dotsContainer"], descendants: true }, { propertyName: "slidesContainer", first: true, predicate: ["slidesContainer"], descendants: true }], ngImport: i0, template: "<div class=\"c-carousel-container\">\n <ng-template #prevNav>\n <button\n class=\"c-carousel-nav\"\n [class.prev]=\"true\"\n [disabled]=\"!canGoPrevious()\"\n title=\"Slide anterior\"\n aria-label=\"Slide anterior\"\n (click)=\"prevSlide()\"\n >\n <lib-elux-icon\n [icon]=\"'Chevron_Left.svg'\"\n [size]=\"'16'\"\n [sizeType]=\"'px'\"\n [color]=\"'#020F2E'\"\n ></lib-elux-icon>\n </button>\n </ng-template>\n\n <ng-template #nextNav>\n <button\n class=\"c-carousel-nav\"\n [class.next]=\"true\"\n [disabled]=\"!canGoNext()\"\n title=\"Pr\u00F3ximo slide\"\n aria-label=\"Pr\u00F3ximo slide\"\n (click)=\"nextSlide()\"\n >\n <lib-elux-icon\n [icon]=\"'Chevron_Right.svg'\"\n [size]=\"'16'\"\n [sizeType]=\"'px'\"\n [color]=\"'#020F2E'\"\n ></lib-elux-icon>\n </button>\n </ng-template>\n\n <div *ngIf=\"title\" class=\"c-carousel-header\">\n <div class=\"c-carousel-header-inner\">\n <div class=\"c-carousel-title\">{{ title }}</div>\n <div class=\"c-carousel-controls\" *ngIf=\"getStepIndexCount().length > 1\">\n <ng-container\n *ngTemplateOutlet=\"prevNav\"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"nextNav\"\n ></ng-container>\n </div>\n </div>\n </div>\n <div \n class=\"c-carousel-slides\" \n #slidesContainer\n [style.transform]=\"'translateX(' + offset + '%)'\" \n [style.gap.px]=\"gap\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerCancel($event)\">\n <ng-content></ng-content>\n </div>\n\n <div class=\"c-carousel-footer\" *ngIf=\"getStepIndexCount().length > 1\">\n <ng-container *ngIf=\"!title\">\n <ng-container\n *ngTemplateOutlet=\"prevNav\"\n ></ng-container>\n </ng-container>\n\n <div class=\"c-carousel-dots\" #dotsContainer>\n <span\n role=\"button\"\n class=\"dot\"\n *ngFor=\"let index of getStepIndexCount()\"\n (click)=\"goToSlide(index)\"\n (keyup)=\"goToSlide(index)\"\n [class.active]=\"index === getCurrentStepIndex()\"\n [attr.aria-disabled]=\"true\"\n [attr.aria-label]=\"'pagina' + (index + 1)\"\n >\n </span>\n </div>\n\n <ng-container *ngIf=\"!title\">\n <ng-container\n *ngTemplateOutlet=\"nextNav\"\n ></ng-container>\n </ng-container>\n </div>\n</div>\n", styles: [".display{font-family:Electrolux Sans;font-size:48px;font-weight:700;line-height:56px}.heading-1{font-family:Electrolux Sans;font-size:34px;font-weight:700;line-height:40px}.heading-2{font-family:Electrolux Sans;font-size:28px;font-weight:600;line-height:32px}.heading-3{font-family:Electrolux Sans;font-size:20px;font-weight:600;line-height:24px}.subtitle-1{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:20px}.body{font-family:Electrolux Sans;font-size:16px;font-weight:400;line-height:21px}.caption{font-family:Electrolux Sans;font-size:14px;font-weight:400;line-height:normal}.links{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:normal;text-decoration-line:underline}@media screen and (max-width: 768px){.display{font-family:Electrolux Sans;font-size:40px;font-weight:700;line-height:46px}.heading-1{font-family:Electrolux Sans;font-size:28px;font-weight:600;line-height:32px}.heading-2{font-family:Electrolux Sans;font-size:24px;font-weight:600;line-height:28px}.heading-3{font-family:Electrolux Sans;font-size:20px;font-weight:600;line-height:24px}.subtitle-1{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:20px}.body{font-family:Electrolux Sans;font-size:16px;font-weight:400;line-height:21px}.caption{font-family:Electrolux Sans;font-size:14px;font-weight:400;line-height:normal}.links{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:normal;text-decoration-line:underline}}.c-carousel-container{position:relative;width:100%}.c-carousel-controls{display:flex;align-items:center;gap:12px}.c-carousel-nav{background:none;border:none;cursor:pointer;width:24px;height:24px;padding:0;border-radius:50%;background-color:#e9ebed;transition:all ease-in-out .2s;z-index:2;display:inline-flex;align-items:center;justify-content:center}.c-carousel-nav:hover:not(:disabled){transform:scale(1.2)}.c-carousel-nav:disabled{opacity:.2;cursor:not-allowed}.c-carousel-nav:disabled:hover{transform:none}.c-carousel-nav ::ng-deep span{display:block}.c-carousel-header{margin-bottom:32px}@media (min-width: 992px){.c-carousel-header{margin-bottom:40px}}.c-carousel-header .c-carousel-header-inner{display:flex;align-items:center;justify-content:space-between;gap:16px}.c-carousel-header .c-carousel-header-inner .c-carousel-title{font-size:20px;font-weight:600;line-height:24px;color:#011e41}@media (min-width: 992px){.c-carousel-header .c-carousel-header-inner .c-carousel-title{font-size:32px;line-height:35px}}.c-carousel-slides{display:flex;transition:transform .4s ease-out;touch-action:pan-y;cursor:grab;-webkit-user-select:none;user-select:none;will-change:transform}.c-carousel-slides:active{cursor:grabbing}.c-carousel-item{display:flex;flex-direction:column;text-align:center;align-items:center;justify-content:center;gap:16px;height:150px;margin:6px;border:1px solid #dee7ea;border-radius:2px;cursor:pointer;pointer-events:auto}.c-carousel-item .c-span{font-weight:400;font-size:18px;color:#011e41}.c-carousel-footer{width:min-content;margin:32px auto;display:flex;align-items:center;justify-content:space-between;padding:0}@media (min-width: 992px){.c-carousel-footer{margin:40px auto}}.c-carousel-footer .c-carousel-dots{padding:6px;display:flex;text-align:center;border-radius:16px;margin:0 16px;max-width:120px;overflow:hidden;position:relative}@media (max-width: 768px){.c-carousel-footer .c-carousel-dots{margin:0 12px;max-width:100px}}.c-carousel-footer .dot{height:10px;width:10px;margin:0 5px;background-color:#dfe7ea;border-radius:50%;display:inline-block;cursor:pointer;transition:all ease-in-out .2s;flex-shrink:0}.c-carousel-footer .dot:hover{background-color:#011e41}.c-carousel-footer .dot.active{background-color:#3d5275}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: EluxIcon, selector: "lib-elux-icon", inputs: ["color", "useSubscription", "icon", "description", "size", "height", "width", "sizeType"] }] }); }
|
|
1700
1692
|
}
|
|
1701
1693
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCarouselComponent, decorators: [{
|
|
1702
1694
|
type: Component,
|
|
1703
|
-
args: [{ standalone: true, selector: 'lib-elux-carousel', imports: [CommonModule, EluxIcon], template: "<div class=\"c-carousel-container\">\n <
|
|
1695
|
+
args: [{ standalone: true, selector: 'lib-elux-carousel', imports: [CommonModule, EluxIcon], template: "<div class=\"c-carousel-container\">\n <ng-template #prevNav>\n <button\n class=\"c-carousel-nav\"\n [class.prev]=\"true\"\n [disabled]=\"!canGoPrevious()\"\n title=\"Slide anterior\"\n aria-label=\"Slide anterior\"\n (click)=\"prevSlide()\"\n >\n <lib-elux-icon\n [icon]=\"'Chevron_Left.svg'\"\n [size]=\"'16'\"\n [sizeType]=\"'px'\"\n [color]=\"'#020F2E'\"\n ></lib-elux-icon>\n </button>\n </ng-template>\n\n <ng-template #nextNav>\n <button\n class=\"c-carousel-nav\"\n [class.next]=\"true\"\n [disabled]=\"!canGoNext()\"\n title=\"Pr\u00F3ximo slide\"\n aria-label=\"Pr\u00F3ximo slide\"\n (click)=\"nextSlide()\"\n >\n <lib-elux-icon\n [icon]=\"'Chevron_Right.svg'\"\n [size]=\"'16'\"\n [sizeType]=\"'px'\"\n [color]=\"'#020F2E'\"\n ></lib-elux-icon>\n </button>\n </ng-template>\n\n <div *ngIf=\"title\" class=\"c-carousel-header\">\n <div class=\"c-carousel-header-inner\">\n <div class=\"c-carousel-title\">{{ title }}</div>\n <div class=\"c-carousel-controls\" *ngIf=\"getStepIndexCount().length > 1\">\n <ng-container\n *ngTemplateOutlet=\"prevNav\"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"nextNav\"\n ></ng-container>\n </div>\n </div>\n </div>\n <div \n class=\"c-carousel-slides\" \n #slidesContainer\n [style.transform]=\"'translateX(' + offset + '%)'\" \n [style.gap.px]=\"gap\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerCancel($event)\">\n <ng-content></ng-content>\n </div>\n\n <div class=\"c-carousel-footer\" *ngIf=\"getStepIndexCount().length > 1\">\n <ng-container *ngIf=\"!title\">\n <ng-container\n *ngTemplateOutlet=\"prevNav\"\n ></ng-container>\n </ng-container>\n\n <div class=\"c-carousel-dots\" #dotsContainer>\n <span\n role=\"button\"\n class=\"dot\"\n *ngFor=\"let index of getStepIndexCount()\"\n (click)=\"goToSlide(index)\"\n (keyup)=\"goToSlide(index)\"\n [class.active]=\"index === getCurrentStepIndex()\"\n [attr.aria-disabled]=\"true\"\n [attr.aria-label]=\"'pagina' + (index + 1)\"\n >\n </span>\n </div>\n\n <ng-container *ngIf=\"!title\">\n <ng-container\n *ngTemplateOutlet=\"nextNav\"\n ></ng-container>\n </ng-container>\n </div>\n</div>\n", styles: [".display{font-family:Electrolux Sans;font-size:48px;font-weight:700;line-height:56px}.heading-1{font-family:Electrolux Sans;font-size:34px;font-weight:700;line-height:40px}.heading-2{font-family:Electrolux Sans;font-size:28px;font-weight:600;line-height:32px}.heading-3{font-family:Electrolux Sans;font-size:20px;font-weight:600;line-height:24px}.subtitle-1{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:20px}.body{font-family:Electrolux Sans;font-size:16px;font-weight:400;line-height:21px}.caption{font-family:Electrolux Sans;font-size:14px;font-weight:400;line-height:normal}.links{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:normal;text-decoration-line:underline}@media screen and (max-width: 768px){.display{font-family:Electrolux Sans;font-size:40px;font-weight:700;line-height:46px}.heading-1{font-family:Electrolux Sans;font-size:28px;font-weight:600;line-height:32px}.heading-2{font-family:Electrolux Sans;font-size:24px;font-weight:600;line-height:28px}.heading-3{font-family:Electrolux Sans;font-size:20px;font-weight:600;line-height:24px}.subtitle-1{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:20px}.body{font-family:Electrolux Sans;font-size:16px;font-weight:400;line-height:21px}.caption{font-family:Electrolux Sans;font-size:14px;font-weight:400;line-height:normal}.links{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:normal;text-decoration-line:underline}}.c-carousel-container{position:relative;width:100%}.c-carousel-controls{display:flex;align-items:center;gap:12px}.c-carousel-nav{background:none;border:none;cursor:pointer;width:24px;height:24px;padding:0;border-radius:50%;background-color:#e9ebed;transition:all ease-in-out .2s;z-index:2;display:inline-flex;align-items:center;justify-content:center}.c-carousel-nav:hover:not(:disabled){transform:scale(1.2)}.c-carousel-nav:disabled{opacity:.2;cursor:not-allowed}.c-carousel-nav:disabled:hover{transform:none}.c-carousel-nav ::ng-deep span{display:block}.c-carousel-header{margin-bottom:32px}@media (min-width: 992px){.c-carousel-header{margin-bottom:40px}}.c-carousel-header .c-carousel-header-inner{display:flex;align-items:center;justify-content:space-between;gap:16px}.c-carousel-header .c-carousel-header-inner .c-carousel-title{font-size:20px;font-weight:600;line-height:24px;color:#011e41}@media (min-width: 992px){.c-carousel-header .c-carousel-header-inner .c-carousel-title{font-size:32px;line-height:35px}}.c-carousel-slides{display:flex;transition:transform .4s ease-out;touch-action:pan-y;cursor:grab;-webkit-user-select:none;user-select:none;will-change:transform}.c-carousel-slides:active{cursor:grabbing}.c-carousel-item{display:flex;flex-direction:column;text-align:center;align-items:center;justify-content:center;gap:16px;height:150px;margin:6px;border:1px solid #dee7ea;border-radius:2px;cursor:pointer;pointer-events:auto}.c-carousel-item .c-span{font-weight:400;font-size:18px;color:#011e41}.c-carousel-footer{width:min-content;margin:32px auto;display:flex;align-items:center;justify-content:space-between;padding:0}@media (min-width: 992px){.c-carousel-footer{margin:40px auto}}.c-carousel-footer .c-carousel-dots{padding:6px;display:flex;text-align:center;border-radius:16px;margin:0 16px;max-width:120px;overflow:hidden;position:relative}@media (max-width: 768px){.c-carousel-footer .c-carousel-dots{margin:0 12px;max-width:100px}}.c-carousel-footer .dot{height:10px;width:10px;margin:0 5px;background-color:#dfe7ea;border-radius:50%;display:inline-block;cursor:pointer;transition:all ease-in-out .2s;flex-shrink:0}.c-carousel-footer .dot:hover{background-color:#011e41}.c-carousel-footer .dot.active{background-color:#3d5275}\n"] }]
|
|
1704
1696
|
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { items: [{
|
|
1705
1697
|
type: ContentChildren,
|
|
1706
1698
|
args: ['carouselItem', { read: ElementRef }]
|
|
@@ -2448,6 +2440,7 @@ class EluxCardBenefit {
|
|
|
2448
2440
|
this.sanitizer = sanitizer;
|
|
2449
2441
|
this.icon = '';
|
|
2450
2442
|
this.description = '';
|
|
2443
|
+
this.link = '';
|
|
2451
2444
|
this.routerLink = '';
|
|
2452
2445
|
this.buttonText = '';
|
|
2453
2446
|
this.BREAK_VALUE = 55;
|
|
@@ -2469,11 +2462,11 @@ class EluxCardBenefit {
|
|
|
2469
2462
|
return this.sanitizer.bypassSecurityTrustHtml(this.description || '');
|
|
2470
2463
|
}
|
|
2471
2464
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCardBenefit, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2472
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EluxCardBenefit, isStandalone: true, selector: "lib-elux-card-benefit", inputs: { title: "title", image: "image", imageAlt: "imageAlt", icon: "icon", description: "description", routerLink: "routerLink", buttonText: "buttonText" }, ngImport: i0, template: "<a
|
|
2465
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EluxCardBenefit, isStandalone: true, selector: "lib-elux-card-benefit", inputs: { title: "title", image: "image", imageAlt: "imageAlt", icon: "icon", description: "description", link: "link", routerLink: "routerLink", buttonText: "buttonText" }, ngImport: i0, template: "<a\n class=\"card-benefit\"\n [routerLink]=\"routerLink || null\"\n [attr.href]=\"routerLink ? null : link\"\n [attr.target]=\"routerLink ? null : '_blank'\"\n [attr.rel]=\"routerLink ? null : 'noopener noreferrer'\"\n>\n <div class=\"card-benefit__image-wrapper\">\n <img [src]=\"image\" [alt]=\"imageAlt\" class=\"card-benefit__image\" />\n </div>\n <div class=\"card-benefit__content\">\n <div class=\"d-flex flex-column\">\n <img\n *ngIf=\"icon\"\n [src]=\"icon\"\n loading=\"lazy\"\n width=\"24px\"\n height=\"24px\"\n class=\"card-benefit__icon\"\n />\n <span class=\"card-benefit__title\">{{ truncateTitle(title) }}</span>\n </div>\n <div class=\"card-benefit__description\" [innerHTML]=\"descriptionHtml\"></div>\n <lib-elux-button\n *ngIf=\"buttonText\"\n class=\"card-bebenfit__button\"\n [content]=\"buttonText\"\n [type]=\"'basic-dark'\"\n />\n </div>\n</a>\n", styles: [".display{font-family:Electrolux Sans;font-size:48px;font-weight:700;line-height:56px}.heading-1{font-family:Electrolux Sans;font-size:34px;font-weight:700;line-height:40px}.heading-2{font-family:Electrolux Sans;font-size:28px;font-weight:600;line-height:32px}.heading-3{font-family:Electrolux Sans;font-size:20px;font-weight:600;line-height:24px}.subtitle-1{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:20px}.body{font-family:Electrolux Sans;font-size:16px;font-weight:400;line-height:21px}.caption{font-family:Electrolux Sans;font-size:14px;font-weight:400;line-height:normal}.links{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:normal;text-decoration-line:underline}@media screen and (max-width: 768px){.display{font-family:Electrolux Sans;font-size:40px;font-weight:700;line-height:46px}.heading-1{font-family:Electrolux Sans;font-size:28px;font-weight:600;line-height:32px}.heading-2{font-family:Electrolux Sans;font-size:24px;font-weight:600;line-height:28px}.heading-3{font-family:Electrolux Sans;font-size:20px;font-weight:600;line-height:24px}.subtitle-1{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:20px}.body{font-family:Electrolux Sans;font-size:16px;font-weight:400;line-height:21px}.caption{font-family:Electrolux Sans;font-size:14px;font-weight:400;line-height:normal}.links{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:normal;text-decoration-line:underline}}.card-benefit{display:flex;flex-direction:column;justify-content:space-between;background-color:#312e3c;overflow:hidden;text-decoration:none;transition:transform .3s ease,box-shadow .3s ease;padding:16px;height:100%;width:100%;min-width:300px;max-width:370px}.card-benefit:hover{transform:translateY(-4px);box-shadow:0 4px 12px #0000001a}.card-benefit__image-wrapper{width:100%;height:200px;overflow:hidden;margin-bottom:24px}.card-benefit__image{width:100%;height:100%;object-fit:cover;display:block}.card-benefit__content{min-height:150px;display:flex;flex-direction:column;justify-content:space-between;gap:16px}.card-benefit__icon{align-self:flex-start;margin-bottom:8px}.card-benefit__title{color:#fff;font-size:18px;font-weight:600;line-height:22px}.card-benefit__description{color:#fff;font-size:14px;font-weight:400;line-height:21px}.card-benefit__button,.card-benefit .card-bebenfit__button{align-self:flex-start}.card-benefit__link{display:inline-flex;align-items:center;gap:6px;color:#2b3227;font-size:14px;font-weight:500;text-decoration:underline;cursor:pointer}@media (min-width: 992px){.card-benefit{width:100%;min-width:300px;max-width:370px}.card-benefit__image-wrapper{width:100%;height:250px;overflow:hidden}}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ElectroluxDesignSystemModule }, { kind: "component", type: EluxButton, selector: "lib-elux-button", inputs: ["disabled", "type", "typeButton", "content", "done", "routerLink", "link", "size", "icon", "iconAlign", "externalLink", "loading", "onlyfirstLetterUpper", "rounded"], outputs: ["onClick"] }] }); }
|
|
2473
2466
|
}
|
|
2474
2467
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCardBenefit, decorators: [{
|
|
2475
2468
|
type: Component,
|
|
2476
|
-
args: [{ standalone: true, imports: [RouterModule, CommonModule, EluxIcon, ElectroluxDesignSystemModule], selector: 'lib-elux-card-benefit', template: "<a
|
|
2469
|
+
args: [{ standalone: true, imports: [RouterModule, CommonModule, EluxIcon, ElectroluxDesignSystemModule], selector: 'lib-elux-card-benefit', template: "<a\n class=\"card-benefit\"\n [routerLink]=\"routerLink || null\"\n [attr.href]=\"routerLink ? null : link\"\n [attr.target]=\"routerLink ? null : '_blank'\"\n [attr.rel]=\"routerLink ? null : 'noopener noreferrer'\"\n>\n <div class=\"card-benefit__image-wrapper\">\n <img [src]=\"image\" [alt]=\"imageAlt\" class=\"card-benefit__image\" />\n </div>\n <div class=\"card-benefit__content\">\n <div class=\"d-flex flex-column\">\n <img\n *ngIf=\"icon\"\n [src]=\"icon\"\n loading=\"lazy\"\n width=\"24px\"\n height=\"24px\"\n class=\"card-benefit__icon\"\n />\n <span class=\"card-benefit__title\">{{ truncateTitle(title) }}</span>\n </div>\n <div class=\"card-benefit__description\" [innerHTML]=\"descriptionHtml\"></div>\n <lib-elux-button\n *ngIf=\"buttonText\"\n class=\"card-bebenfit__button\"\n [content]=\"buttonText\"\n [type]=\"'basic-dark'\"\n />\n </div>\n</a>\n", styles: [".display{font-family:Electrolux Sans;font-size:48px;font-weight:700;line-height:56px}.heading-1{font-family:Electrolux Sans;font-size:34px;font-weight:700;line-height:40px}.heading-2{font-family:Electrolux Sans;font-size:28px;font-weight:600;line-height:32px}.heading-3{font-family:Electrolux Sans;font-size:20px;font-weight:600;line-height:24px}.subtitle-1{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:20px}.body{font-family:Electrolux Sans;font-size:16px;font-weight:400;line-height:21px}.caption{font-family:Electrolux Sans;font-size:14px;font-weight:400;line-height:normal}.links{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:normal;text-decoration-line:underline}@media screen and (max-width: 768px){.display{font-family:Electrolux Sans;font-size:40px;font-weight:700;line-height:46px}.heading-1{font-family:Electrolux Sans;font-size:28px;font-weight:600;line-height:32px}.heading-2{font-family:Electrolux Sans;font-size:24px;font-weight:600;line-height:28px}.heading-3{font-family:Electrolux Sans;font-size:20px;font-weight:600;line-height:24px}.subtitle-1{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:20px}.body{font-family:Electrolux Sans;font-size:16px;font-weight:400;line-height:21px}.caption{font-family:Electrolux Sans;font-size:14px;font-weight:400;line-height:normal}.links{font-family:Electrolux Sans;font-size:16px;font-weight:600;line-height:normal;text-decoration-line:underline}}.card-benefit{display:flex;flex-direction:column;justify-content:space-between;background-color:#312e3c;overflow:hidden;text-decoration:none;transition:transform .3s ease,box-shadow .3s ease;padding:16px;height:100%;width:100%;min-width:300px;max-width:370px}.card-benefit:hover{transform:translateY(-4px);box-shadow:0 4px 12px #0000001a}.card-benefit__image-wrapper{width:100%;height:200px;overflow:hidden;margin-bottom:24px}.card-benefit__image{width:100%;height:100%;object-fit:cover;display:block}.card-benefit__content{min-height:150px;display:flex;flex-direction:column;justify-content:space-between;gap:16px}.card-benefit__icon{align-self:flex-start;margin-bottom:8px}.card-benefit__title{color:#fff;font-size:18px;font-weight:600;line-height:22px}.card-benefit__description{color:#fff;font-size:14px;font-weight:400;line-height:21px}.card-benefit__button,.card-benefit .card-bebenfit__button{align-self:flex-start}.card-benefit__link{display:inline-flex;align-items:center;gap:6px;color:#2b3227;font-size:14px;font-weight:500;text-decoration:underline;cursor:pointer}@media (min-width: 992px){.card-benefit{width:100%;min-width:300px;max-width:370px}.card-benefit__image-wrapper{width:100%;height:250px;overflow:hidden}}\n"] }]
|
|
2477
2470
|
}], ctorParameters: () => [{ type: i1$2.DomSanitizer }], propDecorators: { title: [{
|
|
2478
2471
|
type: Input
|
|
2479
2472
|
}], image: [{
|
|
@@ -2484,6 +2477,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2484
2477
|
type: Input
|
|
2485
2478
|
}], description: [{
|
|
2486
2479
|
type: Input
|
|
2480
|
+
}], link: [{
|
|
2481
|
+
type: Input
|
|
2487
2482
|
}], routerLink: [{
|
|
2488
2483
|
type: Input
|
|
2489
2484
|
}], buttonText: [{
|
|
@@ -2647,7 +2642,6 @@ class EluxCarouselBleedComponent {
|
|
|
2647
2642
|
this.currentIndex = 0;
|
|
2648
2643
|
this.translateX = 0;
|
|
2649
2644
|
this.isDragging = false;
|
|
2650
|
-
this.isMouseDown = false;
|
|
2651
2645
|
this.startX = 0;
|
|
2652
2646
|
this.currentX = 0;
|
|
2653
2647
|
this.initialTranslateX = 0;
|
|
@@ -2658,18 +2652,25 @@ class EluxCarouselBleedComponent {
|
|
|
2658
2652
|
this.velocity = 0;
|
|
2659
2653
|
this.lastMoveTime = 0;
|
|
2660
2654
|
this.lastMoveX = 0;
|
|
2661
|
-
this.
|
|
2662
|
-
this.
|
|
2663
|
-
this.
|
|
2655
|
+
this.pointerStartTime = 0;
|
|
2656
|
+
this.pointerStartX = 0;
|
|
2657
|
+
this.pointerStartY = 0;
|
|
2658
|
+
this.pointerDownType = 'mouse';
|
|
2659
|
+
this.activePointerId = null;
|
|
2664
2660
|
this.isVerticalScroll = false;
|
|
2665
|
-
this.
|
|
2661
|
+
this.hasDragged = false;
|
|
2666
2662
|
this.clicksDisabled = false;
|
|
2667
2663
|
this.clickListeners = [];
|
|
2668
|
-
this.dragStarted = false;
|
|
2669
|
-
this.mouseDownTime = 0;
|
|
2670
2664
|
this.resizeRafId = null;
|
|
2671
2665
|
this.lastLeftOffset = 0;
|
|
2672
2666
|
this.lastScrollbarWidth = 0;
|
|
2667
|
+
this.transitionDuration = 'transform 0.3s ease-out';
|
|
2668
|
+
this.dragThresholdPx = 5;
|
|
2669
|
+
this.touchDragThresholdPx = 10;
|
|
2670
|
+
this.holdToDragThresholdMs = 200;
|
|
2671
|
+
this.touchDurationThresholdMs = 300;
|
|
2672
|
+
this.clickDisableDelayMs = 200;
|
|
2673
|
+
this.clearDraggedDelayMs = 250;
|
|
2673
2674
|
this.calculateBleedOffsets = () => {
|
|
2674
2675
|
if (!this.bleedShell)
|
|
2675
2676
|
return;
|
|
@@ -2789,134 +2790,76 @@ class EluxCarouselBleedComponent {
|
|
|
2789
2790
|
return false;
|
|
2790
2791
|
return !!element.closest('.c-carousel-fixed-item');
|
|
2791
2792
|
}
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
if (!this.isDragStartAllowed(event.target))
|
|
2793
|
+
onPointerDown(event) {
|
|
2794
|
+
if (event.pointerType === 'mouse' && event.button !== 0)
|
|
2795
2795
|
return;
|
|
2796
|
-
event.preventDefault();
|
|
2797
|
-
this.mouseDownTime = Date.now();
|
|
2798
|
-
this.dragStarted = false;
|
|
2799
|
-
this.isMouseDown = true;
|
|
2800
|
-
this.wasDragging = false;
|
|
2801
|
-
this.clicksDisabled = false;
|
|
2802
|
-
this.startX = event.clientX;
|
|
2803
|
-
this.currentX = event.clientX;
|
|
2804
|
-
this.initialTranslateX = this.translateX;
|
|
2805
|
-
this.dragOffset = 0;
|
|
2806
|
-
this.velocity = 0;
|
|
2807
|
-
this.lastMoveTime = Date.now();
|
|
2808
|
-
this.lastMoveX = event.clientX;
|
|
2809
|
-
this.calculateDimensions();
|
|
2810
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'none');
|
|
2811
|
-
}
|
|
2812
|
-
onMouseMove(event) {
|
|
2813
|
-
if (!this.isMouseDown)
|
|
2814
|
-
return;
|
|
2815
|
-
event.preventDefault();
|
|
2816
|
-
const dragDistance = Math.abs(event.clientX - this.startX);
|
|
2817
|
-
// Only start dragging if moved more than 5px
|
|
2818
|
-
if (dragDistance > 5 && !this.isDragging) {
|
|
2819
|
-
this.isDragging = true;
|
|
2820
|
-
this.dragStarted = true;
|
|
2821
|
-
this.wasDragging = true;
|
|
2822
|
-
}
|
|
2823
|
-
if (this.isDragging) {
|
|
2824
|
-
this.updateDrag(event.clientX);
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
onMouseUp(event) {
|
|
2828
|
-
if (!this.isMouseDown)
|
|
2829
|
-
return;
|
|
2830
|
-
this.isMouseDown = false;
|
|
2831
|
-
if (this.isDragging) {
|
|
2832
|
-
const mouseUpTime = Date.now();
|
|
2833
|
-
const holdDuration = mouseUpTime - this.mouseDownTime;
|
|
2834
|
-
const mouseDistance = Math.abs(this.currentX - this.startX);
|
|
2835
|
-
if (mouseDistance > 5 || (holdDuration > 200 && mouseDistance > 0)) {
|
|
2836
|
-
this.wasDragging = true;
|
|
2837
|
-
}
|
|
2838
|
-
this.endDrag();
|
|
2839
|
-
}
|
|
2840
|
-
else {
|
|
2841
|
-
// Reset transition if it was just a click
|
|
2842
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'transform 0.3s ease-out');
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
onMouseLeave(event) {
|
|
2846
|
-
if (this.isDragging) {
|
|
2847
|
-
this.wasDragging = true;
|
|
2848
|
-
this.endDrag();
|
|
2849
|
-
}
|
|
2850
|
-
this.isMouseDown = false;
|
|
2851
|
-
}
|
|
2852
|
-
// Touch events
|
|
2853
|
-
onTouchStart(event) {
|
|
2854
2796
|
if (!this.isDragStartAllowed(event.target))
|
|
2855
2797
|
return;
|
|
2856
|
-
this.
|
|
2857
|
-
this.
|
|
2858
|
-
this.
|
|
2798
|
+
this.activePointerId = event.pointerId;
|
|
2799
|
+
this.pointerDownType = event.pointerType;
|
|
2800
|
+
this.pointerStartTime = Date.now();
|
|
2801
|
+
this.pointerStartX = event.clientX;
|
|
2802
|
+
this.pointerStartY = event.clientY;
|
|
2859
2803
|
this.isVerticalScroll = false;
|
|
2860
|
-
this.
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
this.
|
|
2864
|
-
this.startX = event.touches[0].clientX;
|
|
2865
|
-
this.currentX = event.touches[0].clientX;
|
|
2866
|
-
this.initialTranslateX = this.translateX;
|
|
2867
|
-
this.dragOffset = 0;
|
|
2868
|
-
this.velocity = 0;
|
|
2869
|
-
this.lastMoveTime = Date.now();
|
|
2870
|
-
this.lastMoveX = event.touches[0].clientX;
|
|
2871
|
-
this.calculateDimensions();
|
|
2872
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'none');
|
|
2804
|
+
if (this.slidesContainer?.nativeElement?.setPointerCapture) {
|
|
2805
|
+
this.slidesContainer.nativeElement.setPointerCapture(event.pointerId);
|
|
2806
|
+
}
|
|
2807
|
+
this.startDrag(event.clientX);
|
|
2873
2808
|
}
|
|
2874
|
-
|
|
2875
|
-
if (!this.
|
|
2809
|
+
onPointerMove(event) {
|
|
2810
|
+
if (!this.isDragging || this.activePointerId !== event.pointerId)
|
|
2876
2811
|
return;
|
|
2877
|
-
const
|
|
2878
|
-
const
|
|
2879
|
-
const
|
|
2880
|
-
|
|
2881
|
-
// Check if this is a vertical scroll
|
|
2882
|
-
if (deltaY > deltaX && deltaY > 10) {
|
|
2812
|
+
const deltaX = Math.abs(event.clientX - this.pointerStartX);
|
|
2813
|
+
const deltaY = Math.abs(event.clientY - this.pointerStartY);
|
|
2814
|
+
const isTouchLikePointer = this.pointerDownType !== 'mouse';
|
|
2815
|
+
if (isTouchLikePointer && deltaY > deltaX && deltaY > this.touchDragThresholdPx) {
|
|
2883
2816
|
this.isVerticalScroll = true;
|
|
2884
2817
|
this.isDragging = false;
|
|
2885
|
-
this.
|
|
2886
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'transform 0.3s ease-out');
|
|
2818
|
+
this.setSlidesTransition(true);
|
|
2887
2819
|
return;
|
|
2888
2820
|
}
|
|
2889
|
-
|
|
2890
|
-
if (deltaX > 10 && !this.isDragging) {
|
|
2891
|
-
this.isDragging = true;
|
|
2892
|
-
this.dragStarted = true;
|
|
2893
|
-
this.wasDragging = true;
|
|
2894
|
-
}
|
|
2895
|
-
if (this.isDragging && deltaX > 10) {
|
|
2821
|
+
if (this.pointerDownType === 'mouse' || deltaX > this.touchDragThresholdPx) {
|
|
2896
2822
|
event.preventDefault();
|
|
2897
|
-
this.updateDrag(
|
|
2823
|
+
this.updateDrag(event.clientX);
|
|
2898
2824
|
}
|
|
2899
2825
|
}
|
|
2900
|
-
|
|
2826
|
+
onPointerUp(event) {
|
|
2827
|
+
if (this.activePointerId !== event.pointerId)
|
|
2828
|
+
return;
|
|
2901
2829
|
if (this.isVerticalScroll) {
|
|
2902
|
-
this.
|
|
2903
|
-
this.isMouseDown = false;
|
|
2830
|
+
this.resetPointerState(event.pointerId);
|
|
2904
2831
|
return;
|
|
2905
2832
|
}
|
|
2906
|
-
|
|
2907
|
-
const
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2833
|
+
const pressDuration = Date.now() - this.pointerStartTime;
|
|
2834
|
+
const pointerDistance = Math.abs(this.currentX - this.startX);
|
|
2835
|
+
if (this.pointerDownType === 'mouse') {
|
|
2836
|
+
if (pointerDistance > this.dragThresholdPx || (pressDuration > this.holdToDragThresholdMs && pointerDistance > 0)) {
|
|
2837
|
+
this.hasDragged = true;
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
else if (pointerDistance > this.touchDragThresholdPx || pressDuration > this.touchDurationThresholdMs) {
|
|
2841
|
+
this.hasDragged = true;
|
|
2912
2842
|
}
|
|
2913
2843
|
if (this.isDragging) {
|
|
2914
2844
|
this.endDrag();
|
|
2915
2845
|
}
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2846
|
+
this.resetPointerState(event.pointerId);
|
|
2847
|
+
}
|
|
2848
|
+
onPointerCancel(event) {
|
|
2849
|
+
if (this.activePointerId !== event.pointerId)
|
|
2850
|
+
return;
|
|
2851
|
+
if (this.isDragging) {
|
|
2852
|
+
this.hasDragged = true;
|
|
2853
|
+
this.endDrag();
|
|
2919
2854
|
}
|
|
2855
|
+
this.resetPointerState(event.pointerId);
|
|
2856
|
+
}
|
|
2857
|
+
resetPointerState(pointerId) {
|
|
2858
|
+
if (this.slidesContainer?.nativeElement?.releasePointerCapture) {
|
|
2859
|
+
this.slidesContainer.nativeElement.releasePointerCapture(pointerId);
|
|
2860
|
+
}
|
|
2861
|
+
this.activePointerId = null;
|
|
2862
|
+
this.isVerticalScroll = false;
|
|
2920
2863
|
}
|
|
2921
2864
|
setupClickPrevention() {
|
|
2922
2865
|
// Clean up existing listeners
|
|
@@ -2925,7 +2868,7 @@ class EluxCarouselBleedComponent {
|
|
|
2925
2868
|
this.items.forEach((item) => {
|
|
2926
2869
|
// Only prevent click events, not mouseup which is needed for drag functionality
|
|
2927
2870
|
const eventHandler = (event) => {
|
|
2928
|
-
if (event.type === 'click' && (this.
|
|
2871
|
+
if (event.type === 'click' && (this.hasDragged || this.clicksDisabled)) {
|
|
2929
2872
|
event.preventDefault();
|
|
2930
2873
|
event.stopPropagation();
|
|
2931
2874
|
event.stopImmediatePropagation();
|
|
@@ -2940,15 +2883,28 @@ class EluxCarouselBleedComponent {
|
|
|
2940
2883
|
});
|
|
2941
2884
|
});
|
|
2942
2885
|
}
|
|
2886
|
+
startDrag(clientX) {
|
|
2887
|
+
this.isDragging = true;
|
|
2888
|
+
this.hasDragged = false;
|
|
2889
|
+
this.clicksDisabled = false;
|
|
2890
|
+
this.startX = clientX;
|
|
2891
|
+
this.currentX = clientX;
|
|
2892
|
+
this.initialTranslateX = this.translateX;
|
|
2893
|
+
this.dragOffset = 0;
|
|
2894
|
+
this.velocity = 0;
|
|
2895
|
+
this.lastMoveTime = Date.now();
|
|
2896
|
+
this.lastMoveX = clientX;
|
|
2897
|
+
this.calculateDimensions();
|
|
2898
|
+
this.setSlidesTransition(false);
|
|
2899
|
+
}
|
|
2943
2900
|
updateDrag(clientX) {
|
|
2944
2901
|
if (!this.isDragging)
|
|
2945
2902
|
return;
|
|
2946
2903
|
this.currentX = clientX;
|
|
2947
2904
|
const totalDeltaX = this.currentX - this.startX;
|
|
2948
2905
|
// Mark as dragging if movement is significant
|
|
2949
|
-
if (Math.abs(totalDeltaX) >
|
|
2950
|
-
this.
|
|
2951
|
-
this.dragStarted = true;
|
|
2906
|
+
if (Math.abs(totalDeltaX) > this.dragThresholdPx) {
|
|
2907
|
+
this.hasDragged = true;
|
|
2952
2908
|
}
|
|
2953
2909
|
const now = Date.now();
|
|
2954
2910
|
const timeDelta = now - this.lastMoveTime;
|
|
@@ -2980,23 +2936,27 @@ class EluxCarouselBleedComponent {
|
|
|
2980
2936
|
return;
|
|
2981
2937
|
this.isDragging = false;
|
|
2982
2938
|
// Disable clicks temporarily after any drag
|
|
2983
|
-
if (this.
|
|
2939
|
+
if (this.hasDragged) {
|
|
2984
2940
|
this.clicksDisabled = true;
|
|
2985
2941
|
setTimeout(() => {
|
|
2986
2942
|
this.clicksDisabled = false;
|
|
2987
|
-
},
|
|
2943
|
+
}, this.clickDisableDelayMs);
|
|
2988
2944
|
}
|
|
2989
|
-
// Clear the
|
|
2945
|
+
// Clear the drag flag after a shorter delay
|
|
2990
2946
|
setTimeout(() => {
|
|
2991
|
-
this.
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'transform 0.3s ease-out');
|
|
2947
|
+
this.hasDragged = false;
|
|
2948
|
+
}, this.clearDraggedDelayMs);
|
|
2949
|
+
this.setSlidesTransition(true);
|
|
2995
2950
|
// Snap sempre para o início da página mais próxima
|
|
2996
2951
|
this.snapToNearestItem();
|
|
2997
2952
|
this.dragOffset = 0;
|
|
2998
2953
|
this.velocity = 0;
|
|
2999
2954
|
}
|
|
2955
|
+
setSlidesTransition(enabled) {
|
|
2956
|
+
if (!this.slidesContainer)
|
|
2957
|
+
return;
|
|
2958
|
+
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', enabled ? this.transitionDuration : 'none');
|
|
2959
|
+
}
|
|
3000
2960
|
getMaxIndex() {
|
|
3001
2961
|
// Permite avançar até que o último item esteja alinhado ao lado direito do shell
|
|
3002
2962
|
if (!this.items || this.items.length === 0)
|
|
@@ -3138,11 +3098,11 @@ class EluxCarouselBleedComponent {
|
|
|
3138
3098
|
this.updateTransform();
|
|
3139
3099
|
}
|
|
3140
3100
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCarouselBleedComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3141
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EluxCarouselBleedComponent, isStandalone: true, selector: "lib-elux-carousel-bleed", inputs: { itemWidth: "itemWidth", gap: "gap", title: "title" }, outputs: { previousClickEventEmitter: "previousClickEventEmitter", nextClickEventEmitter: "nextClickEventEmitter", dotClickEventEmitter: "dotClickEventEmitter" }, queries: [{ propertyName: "items", predicate: ["carouselItem"], read: ElementRef }], viewQueries: [{ propertyName: "slidesContainer", first: true, predicate: ["slidesContainer"], descendants: true }, { propertyName: "bleedShell", first: true, predicate: ["bleedShell"], descendants: true }], ngImport: i0, template: "<div class=\"c-carousel-fixed-shell\" #bleedShell>\n <
|
|
3101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EluxCarouselBleedComponent, isStandalone: true, selector: "lib-elux-carousel-bleed", inputs: { itemWidth: "itemWidth", gap: "gap", title: "title" }, outputs: { previousClickEventEmitter: "previousClickEventEmitter", nextClickEventEmitter: "nextClickEventEmitter", dotClickEventEmitter: "dotClickEventEmitter" }, queries: [{ propertyName: "items", predicate: ["carouselItem"], read: ElementRef }], viewQueries: [{ propertyName: "slidesContainer", first: true, predicate: ["slidesContainer"], descendants: true }, { propertyName: "bleedShell", first: true, predicate: ["bleedShell"], descendants: true }], ngImport: i0, template: "<div class=\"c-carousel-fixed-shell\" #bleedShell>\n <ng-template #prevNav>\n <button\n class=\"c-carousel-fixed-nav\"\n [class.prev]=\"true\"\n [disabled]=\"!canGoPrevious()\"\n title=\"P\u00E1gina anterior\"\n aria-label=\"P\u00E1gina anterior\"\n (click)=\"prevPage()\"\n >\n <lib-elux-icon\n [icon]=\"'Chevron_Left.svg'\"\n [size]=\"'16'\"\n [sizeType]=\"'px'\"\n [color]=\"'#020F2E'\"\n ></lib-elux-icon>\n </button>\n </ng-template>\n\n <ng-template #nextNav>\n <button\n class=\"c-carousel-fixed-nav\"\n [class.next]=\"true\"\n [disabled]=\"!canGoNext()\"\n title=\"Pr\u00F3xima p\u00E1gina\"\n aria-label=\"Pr\u00F3xima p\u00E1gina\"\n (click)=\"nextPage()\"\n >\n <lib-elux-icon\n [icon]=\"'Chevron_Right.svg'\"\n [size]=\"'16'\"\n [sizeType]=\"'px'\"\n [color]=\"'#020F2E'\"\n ></lib-elux-icon>\n </button>\n </ng-template>\n\n <div *ngIf=\"title\" class=\"c-carousel-fixed-header\">\n <div class=\"c-carousel-fixed-header-inner\">\n <div class=\"c-carousel-fixed-title\">\n {{ title }}\n </div>\n <div class=\"c-carousel-fixed-controls\" *ngIf=\"getDotsArray().length > 1\">\n <ng-container\n *ngTemplateOutlet=\"prevNav\"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"nextNav\"\n ></ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"c-carousel-fixed-container\">\n <div\n class=\"c-carousel-fixed-slides\"\n #slidesContainer\n [style.transform]=\"'translateX(' + translateX + 'px)'\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerCancel($event)\"\n >\n <ng-content></ng-content>\n </div>\n </div>\n\n <div class=\"c-carousel-fixed-footer\" *ngIf=\"getDotsArray().length > 1\">\n <div class=\"c-carousel-fixed-controls\">\n <ng-container *ngIf=\"title == ''\">\n <ng-container\n *ngTemplateOutlet=\"prevNav\"\n ></ng-container>\n </ng-container>\n\n <div class=\"c-carousel-fixed-dots\">\n <ng-container *ngFor=\"let dot of getDotsArray(); let idx = index\">\n <span\n class=\"c-carousel-fixed-dot\"\n [class.active]=\"idx === getCurrentDotIndex()\"\n (click)=\"goToDot(idx)\"\n >\n </span>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"title == ''\">\n <ng-container\n *ngTemplateOutlet=\"nextNav\"\n ></ng-container>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: [".c-carousel-fixed-shell{position:relative}.c-carousel-fixed-controls{display:flex;align-items:center;gap:12px}.c-carousel-fixed-nav{background:none;border:none;cursor:pointer;width:24px;height:24px;padding:0;border-radius:50%;background-color:#e9ebed;transition:all ease-in-out .2s;z-index:2;display:inline-flex;align-items:center;justify-content:center}.c-carousel-fixed-nav:hover:not(:disabled){transform:scale(1.2)}.c-carousel-fixed-nav:disabled{opacity:.2;cursor:not-allowed}.c-carousel-fixed-nav:disabled:hover{transform:none}.c-carousel-fixed-nav :host ::ng-deep span{display:block}.c-carousel-fixed-header{margin-bottom:32px}@media (min-width: 992px){.c-carousel-fixed-header{margin-bottom:40px}}.c-carousel-fixed-header .c-carousel-fixed-header-inner{display:flex;align-items:center;justify-content:space-between;gap:16px}.c-carousel-fixed-header .c-carousel-fixed-header-inner .c-carousel-fixed-title{font-size:20px;font-weight:600;line-height:24px;color:#011e41}@media (min-width: 992px){.c-carousel-fixed-header .c-carousel-fixed-header-inner .c-carousel-fixed-title{font-size:32px;line-height:35px}}.c-carousel-fixed-container{overflow-x:hidden;width:calc(100vw - var(--scrollbar-width, 0px));margin-left:calc(-1 * var(--left-offset, 0px));padding-left:var(--left-offset, 0px)}.c-carousel-fixed-slides{display:flex;transition:transform .5s ease-out;touch-action:pan-y;cursor:default;will-change:transform}:host ::ng-deep .c-carousel-fixed-item{cursor:grab}:host ::ng-deep .c-carousel-fixed-item:active{cursor:grabbing}.c-carousel-fixed-footer{display:flex;justify-content:center;margin-top:32px;margin-bottom:32px}@media (min-width: 992px){.c-carousel-fixed-footer{margin-top:40px;margin-bottom:40px}}.c-carousel-fixed-footer .c-carousel-fixed-dots{display:flex;align-items:center;gap:8px;margin:0 8px}.c-carousel-fixed-footer .c-carousel-fixed-dots .c-carousel-fixed-dot{width:10px;height:10px;border-radius:50%;background:#dfe7ea;transition:background .3s;cursor:pointer;display:inline-block}.c-carousel-fixed-footer .c-carousel-fixed-dots .c-carousel-fixed-dot.active{background:#3d5275}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: EluxIcon, selector: "lib-elux-icon", inputs: ["color", "useSubscription", "icon", "description", "size", "height", "width", "sizeType"] }] }); }
|
|
3142
3102
|
}
|
|
3143
3103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCarouselBleedComponent, decorators: [{
|
|
3144
3104
|
type: Component,
|
|
3145
|
-
args: [{ standalone: true, selector: 'lib-elux-carousel-bleed', imports: [CommonModule, EluxIcon], template: "<div class=\"c-carousel-fixed-shell\" #bleedShell>\n <
|
|
3105
|
+
args: [{ standalone: true, selector: 'lib-elux-carousel-bleed', imports: [CommonModule, EluxIcon], template: "<div class=\"c-carousel-fixed-shell\" #bleedShell>\n <ng-template #prevNav>\n <button\n class=\"c-carousel-fixed-nav\"\n [class.prev]=\"true\"\n [disabled]=\"!canGoPrevious()\"\n title=\"P\u00E1gina anterior\"\n aria-label=\"P\u00E1gina anterior\"\n (click)=\"prevPage()\"\n >\n <lib-elux-icon\n [icon]=\"'Chevron_Left.svg'\"\n [size]=\"'16'\"\n [sizeType]=\"'px'\"\n [color]=\"'#020F2E'\"\n ></lib-elux-icon>\n </button>\n </ng-template>\n\n <ng-template #nextNav>\n <button\n class=\"c-carousel-fixed-nav\"\n [class.next]=\"true\"\n [disabled]=\"!canGoNext()\"\n title=\"Pr\u00F3xima p\u00E1gina\"\n aria-label=\"Pr\u00F3xima p\u00E1gina\"\n (click)=\"nextPage()\"\n >\n <lib-elux-icon\n [icon]=\"'Chevron_Right.svg'\"\n [size]=\"'16'\"\n [sizeType]=\"'px'\"\n [color]=\"'#020F2E'\"\n ></lib-elux-icon>\n </button>\n </ng-template>\n\n <div *ngIf=\"title\" class=\"c-carousel-fixed-header\">\n <div class=\"c-carousel-fixed-header-inner\">\n <div class=\"c-carousel-fixed-title\">\n {{ title }}\n </div>\n <div class=\"c-carousel-fixed-controls\" *ngIf=\"getDotsArray().length > 1\">\n <ng-container\n *ngTemplateOutlet=\"prevNav\"\n ></ng-container>\n\n <ng-container\n *ngTemplateOutlet=\"nextNav\"\n ></ng-container>\n </div>\n </div>\n </div>\n\n <div class=\"c-carousel-fixed-container\">\n <div\n class=\"c-carousel-fixed-slides\"\n #slidesContainer\n [style.transform]=\"'translateX(' + translateX + 'px)'\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerCancel($event)\"\n >\n <ng-content></ng-content>\n </div>\n </div>\n\n <div class=\"c-carousel-fixed-footer\" *ngIf=\"getDotsArray().length > 1\">\n <div class=\"c-carousel-fixed-controls\">\n <ng-container *ngIf=\"title == ''\">\n <ng-container\n *ngTemplateOutlet=\"prevNav\"\n ></ng-container>\n </ng-container>\n\n <div class=\"c-carousel-fixed-dots\">\n <ng-container *ngFor=\"let dot of getDotsArray(); let idx = index\">\n <span\n class=\"c-carousel-fixed-dot\"\n [class.active]=\"idx === getCurrentDotIndex()\"\n (click)=\"goToDot(idx)\"\n >\n </span>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"title == ''\">\n <ng-container\n *ngTemplateOutlet=\"nextNav\"\n ></ng-container>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: [".c-carousel-fixed-shell{position:relative}.c-carousel-fixed-controls{display:flex;align-items:center;gap:12px}.c-carousel-fixed-nav{background:none;border:none;cursor:pointer;width:24px;height:24px;padding:0;border-radius:50%;background-color:#e9ebed;transition:all ease-in-out .2s;z-index:2;display:inline-flex;align-items:center;justify-content:center}.c-carousel-fixed-nav:hover:not(:disabled){transform:scale(1.2)}.c-carousel-fixed-nav:disabled{opacity:.2;cursor:not-allowed}.c-carousel-fixed-nav:disabled:hover{transform:none}.c-carousel-fixed-nav :host ::ng-deep span{display:block}.c-carousel-fixed-header{margin-bottom:32px}@media (min-width: 992px){.c-carousel-fixed-header{margin-bottom:40px}}.c-carousel-fixed-header .c-carousel-fixed-header-inner{display:flex;align-items:center;justify-content:space-between;gap:16px}.c-carousel-fixed-header .c-carousel-fixed-header-inner .c-carousel-fixed-title{font-size:20px;font-weight:600;line-height:24px;color:#011e41}@media (min-width: 992px){.c-carousel-fixed-header .c-carousel-fixed-header-inner .c-carousel-fixed-title{font-size:32px;line-height:35px}}.c-carousel-fixed-container{overflow-x:hidden;width:calc(100vw - var(--scrollbar-width, 0px));margin-left:calc(-1 * var(--left-offset, 0px));padding-left:var(--left-offset, 0px)}.c-carousel-fixed-slides{display:flex;transition:transform .5s ease-out;touch-action:pan-y;cursor:default;will-change:transform}:host ::ng-deep .c-carousel-fixed-item{cursor:grab}:host ::ng-deep .c-carousel-fixed-item:active{cursor:grabbing}.c-carousel-fixed-footer{display:flex;justify-content:center;margin-top:32px;margin-bottom:32px}@media (min-width: 992px){.c-carousel-fixed-footer{margin-top:40px;margin-bottom:40px}}.c-carousel-fixed-footer .c-carousel-fixed-dots{display:flex;align-items:center;gap:8px;margin:0 8px}.c-carousel-fixed-footer .c-carousel-fixed-dots .c-carousel-fixed-dot{width:10px;height:10px;border-radius:50%;background:#dfe7ea;transition:background .3s;cursor:pointer;display:inline-block}.c-carousel-fixed-footer .c-carousel-fixed-dots .c-carousel-fixed-dot.active{background:#3d5275}\n"] }]
|
|
3146
3106
|
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { items: [{
|
|
3147
3107
|
type: ContentChildren,
|
|
3148
3108
|
args: ['carouselItem', { read: ElementRef }]
|