@elxjs/ui 0.0.204 → 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/assets/icons/Check_Tick_Filled.svg +3 -0
- package/assets/icons/Warning_Filled.svg +3 -0
- package/esm2022/lib/components/card-benefit/card-benefit.component.mjs +6 -3
- package/esm2022/lib/components/carousel/carousel.component.mjs +127 -127
- package/esm2022/lib/components/carousel-bleed/carousel-bleed.component.mjs +93 -128
- package/fesm2022/elxjs-ui.mjs +223 -255
- 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 +29 -17
- package/lib/components/carousel-bleed/carousel-bleed.component.d.ts +22 -16
- package/package.json +1 -1
package/fesm2022/elxjs-ui.mjs
CHANGED
|
@@ -1332,11 +1332,11 @@ class EluxCarouselComponent {
|
|
|
1332
1332
|
constructor(renderer) {
|
|
1333
1333
|
this.renderer = renderer;
|
|
1334
1334
|
this.itemsPerSlide = 4;
|
|
1335
|
+
this.gap = 16;
|
|
1335
1336
|
this.title = '';
|
|
1336
1337
|
this.previousClickEventEmitter = new EventEmitter();
|
|
1337
1338
|
this.nextClickEventEmitter = new EventEmitter();
|
|
1338
1339
|
this.dotClickEventEmitter = new EventEmitter();
|
|
1339
|
-
this.currentIndex = 0;
|
|
1340
1340
|
this.currentStepIndex = 0;
|
|
1341
1341
|
this.offset = 0;
|
|
1342
1342
|
this.isDragging = false;
|
|
@@ -1345,61 +1345,77 @@ class EluxCarouselComponent {
|
|
|
1345
1345
|
this.initialOffset = 0;
|
|
1346
1346
|
this.dragOffset = 0;
|
|
1347
1347
|
this.containerWidth = 0;
|
|
1348
|
-
this.itemWidth = 0;
|
|
1349
1348
|
this.maxOffset = 0;
|
|
1350
1349
|
this.minOffset = 0;
|
|
1351
|
-
this.animationId = null;
|
|
1352
1350
|
this.velocity = 0;
|
|
1353
1351
|
this.lastMoveTime = 0;
|
|
1354
1352
|
this.lastMoveX = 0;
|
|
1355
|
-
this.
|
|
1356
|
-
this.
|
|
1357
|
-
this.
|
|
1353
|
+
this.pointerStartTime = 0;
|
|
1354
|
+
this.pointerStartX = 0;
|
|
1355
|
+
this.pointerStartY = 0;
|
|
1356
|
+
this.pointerDownType = 'mouse';
|
|
1357
|
+
this.activePointerId = null;
|
|
1358
1358
|
this.isVerticalScroll = false;
|
|
1359
|
-
this.wasDragging = false;
|
|
1360
1359
|
this.clicksDisabled = false;
|
|
1361
1360
|
this.clickListeners = [];
|
|
1362
|
-
this.
|
|
1363
|
-
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;
|
|
1364
1374
|
}
|
|
1365
1375
|
ngAfterContentInit() {
|
|
1366
|
-
this.
|
|
1367
|
-
this.setItemWidths();
|
|
1368
|
-
this.updateLimits();
|
|
1376
|
+
this.refreshLayout();
|
|
1369
1377
|
this.setupClickPrevention();
|
|
1370
|
-
this.items.changes.subscribe(() => {
|
|
1371
|
-
this.
|
|
1372
|
-
this.setItemWidths();
|
|
1373
|
-
this.updateLimits();
|
|
1378
|
+
this.itemsChangesSubscription = this.items.changes.subscribe(() => {
|
|
1379
|
+
this.refreshLayout();
|
|
1374
1380
|
this.goToFirstSlide();
|
|
1375
1381
|
this.setupClickPrevention();
|
|
1376
1382
|
});
|
|
1377
1383
|
// Listen for window resize to recalculate dimensions
|
|
1378
|
-
window.addEventListener('resize',
|
|
1384
|
+
window.addEventListener('resize', this.resizeHandler);
|
|
1379
1385
|
}
|
|
1380
1386
|
ngOnDestroy() {
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
}
|
|
1387
|
+
this.itemsChangesSubscription?.unsubscribe();
|
|
1388
|
+
this.itemsChangesSubscription = null;
|
|
1384
1389
|
// Clean up click listeners
|
|
1385
1390
|
this.clickListeners.forEach(unlisten => unlisten());
|
|
1386
1391
|
this.clickListeners = [];
|
|
1387
|
-
window.removeEventListener('resize',
|
|
1392
|
+
window.removeEventListener('resize', this.resizeHandler);
|
|
1393
|
+
}
|
|
1394
|
+
refreshLayout() {
|
|
1395
|
+
this.calculateDimensions();
|
|
1396
|
+
this.setItemWidths();
|
|
1397
|
+
this.updateLimits();
|
|
1388
1398
|
}
|
|
1389
1399
|
calculateDimensions() {
|
|
1390
1400
|
if (this.slidesContainer) {
|
|
1391
1401
|
this.containerWidth = this.slidesContainer.nativeElement.offsetWidth;
|
|
1392
|
-
this.itemWidth = this.containerWidth / this.itemsPerSlide;
|
|
1393
1402
|
}
|
|
1394
1403
|
}
|
|
1395
1404
|
updateLimits() {
|
|
1396
|
-
const totalSteps = Math.ceil(this.items.length / this.itemsPerSlide);
|
|
1397
1405
|
this.maxOffset = 0;
|
|
1398
|
-
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);
|
|
1399
1416
|
}
|
|
1400
1417
|
canGoNext() {
|
|
1401
|
-
|
|
1402
|
-
return this.currentStepIndex < totalSteps - 1;
|
|
1418
|
+
return this.currentStepIndex < this.getTotalSteps() - 1;
|
|
1403
1419
|
}
|
|
1404
1420
|
canGoPrevious() {
|
|
1405
1421
|
return this.currentStepIndex > 0;
|
|
@@ -1409,93 +1425,82 @@ class EluxCarouselComponent {
|
|
|
1409
1425
|
this.updateOffset();
|
|
1410
1426
|
}
|
|
1411
1427
|
setItemWidths() {
|
|
1428
|
+
const totalGap = Math.max(0, this.itemsPerSlide - 1) * this.gap;
|
|
1412
1429
|
this.items.forEach((item) => {
|
|
1413
|
-
|
|
1414
|
-
|
|
1430
|
+
this.renderer.setStyle(item.nativeElement, 'box-sizing', 'border-box');
|
|
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}`);
|
|
1415
1434
|
});
|
|
1416
1435
|
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
this.
|
|
1421
|
-
this.
|
|
1422
|
-
this.
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
if (this.isDragging) {
|
|
1426
|
-
event.preventDefault();
|
|
1427
|
-
// Mark that we've started dragging if we've moved more than 5px
|
|
1428
|
-
const dragDistance = Math.abs(this.currentX - this.startX);
|
|
1429
|
-
if (dragDistance > 5 && !this.dragStarted) {
|
|
1430
|
-
this.dragStarted = true;
|
|
1431
|
-
this.wasDragging = true;
|
|
1432
|
-
}
|
|
1433
|
-
this.updateDrag(event.clientX);
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
onMouseUp(event) {
|
|
1437
|
-
if (this.isDragging) {
|
|
1438
|
-
const mouseUpTime = Date.now();
|
|
1439
|
-
const holdDuration = mouseUpTime - this.mouseDownTime;
|
|
1440
|
-
const mouseDistance = Math.abs(this.currentX - this.startX);
|
|
1441
|
-
// Consider it a drag if:
|
|
1442
|
-
// 1. We moved more than 5px, OR
|
|
1443
|
-
// 2. We held the mouse down for more than 200ms and moved at all
|
|
1444
|
-
if (mouseDistance > 5 || (holdDuration > 200 && mouseDistance > 0)) {
|
|
1445
|
-
this.wasDragging = true;
|
|
1446
|
-
}
|
|
1447
|
-
this.endDrag();
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
onMouseLeave(event) {
|
|
1451
|
-
if (this.isDragging) {
|
|
1452
|
-
// If mouse leaves while dragging, definitely consider it a drag
|
|
1453
|
-
this.wasDragging = true;
|
|
1454
|
-
this.endDrag();
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1457
|
-
// Touch events
|
|
1458
|
-
onTouchStart(event) {
|
|
1459
|
-
this.touchStartTime = Date.now();
|
|
1460
|
-
this.touchStartX = event.touches[0].clientX;
|
|
1461
|
-
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;
|
|
1462
1444
|
this.isVerticalScroll = false;
|
|
1463
|
-
this.
|
|
1445
|
+
if (this.slidesContainer?.nativeElement?.setPointerCapture) {
|
|
1446
|
+
this.slidesContainer.nativeElement.setPointerCapture(event.pointerId);
|
|
1447
|
+
}
|
|
1448
|
+
this.startDrag(event.clientX);
|
|
1464
1449
|
}
|
|
1465
|
-
|
|
1466
|
-
if (!this.isDragging)
|
|
1450
|
+
onPointerMove(event) {
|
|
1451
|
+
if (!this.isDragging || this.activePointerId !== event.pointerId)
|
|
1467
1452
|
return;
|
|
1468
|
-
const
|
|
1469
|
-
const
|
|
1470
|
-
const
|
|
1471
|
-
|
|
1472
|
-
// Check if this is a vertical scroll
|
|
1473
|
-
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) {
|
|
1474
1457
|
this.isVerticalScroll = true;
|
|
1475
1458
|
this.isDragging = false;
|
|
1476
|
-
this.
|
|
1459
|
+
this.setSlidesTransition(true);
|
|
1477
1460
|
return;
|
|
1478
1461
|
}
|
|
1479
|
-
|
|
1480
|
-
if (deltaX > 10) {
|
|
1462
|
+
if (this.pointerDownType === 'mouse' || deltaX > this.touchDragThresholdPx) {
|
|
1481
1463
|
event.preventDefault();
|
|
1482
|
-
this.updateDrag(event.
|
|
1464
|
+
this.updateDrag(event.clientX);
|
|
1483
1465
|
}
|
|
1484
1466
|
}
|
|
1485
|
-
|
|
1467
|
+
onPointerUp(event) {
|
|
1468
|
+
if (this.activePointerId !== event.pointerId)
|
|
1469
|
+
return;
|
|
1486
1470
|
if (this.isVerticalScroll) {
|
|
1487
|
-
this.
|
|
1471
|
+
this.resetPointerState(event.pointerId);
|
|
1488
1472
|
return;
|
|
1489
1473
|
}
|
|
1490
|
-
const
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
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;
|
|
1495
1483
|
}
|
|
1496
1484
|
if (this.isDragging) {
|
|
1497
1485
|
this.endDrag();
|
|
1498
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;
|
|
1499
1504
|
}
|
|
1500
1505
|
setupClickPrevention() {
|
|
1501
1506
|
// Clean up existing listeners
|
|
@@ -1504,7 +1509,7 @@ class EluxCarouselComponent {
|
|
|
1504
1509
|
this.items.forEach((item) => {
|
|
1505
1510
|
// Only prevent click events, not mouseup which is needed for drag functionality
|
|
1506
1511
|
const eventHandler = (event) => {
|
|
1507
|
-
if (event.type === 'click' && (this.
|
|
1512
|
+
if (event.type === 'click' && (this.hasDragged || this.clicksDisabled)) {
|
|
1508
1513
|
event.preventDefault();
|
|
1509
1514
|
event.stopPropagation();
|
|
1510
1515
|
event.stopImmediatePropagation();
|
|
@@ -1513,16 +1518,13 @@ class EluxCarouselComponent {
|
|
|
1513
1518
|
return true;
|
|
1514
1519
|
};
|
|
1515
1520
|
// Only listen to click events to avoid interfering with drag functionality
|
|
1516
|
-
item.nativeElement
|
|
1517
|
-
this.clickListeners.push(
|
|
1518
|
-
item.nativeElement.removeEventListener('click', eventHandler, true);
|
|
1519
|
-
});
|
|
1521
|
+
const unlisten = this.renderer.listen(item.nativeElement, 'click', eventHandler);
|
|
1522
|
+
this.clickListeners.push(unlisten);
|
|
1520
1523
|
});
|
|
1521
1524
|
}
|
|
1522
1525
|
startDrag(clientX) {
|
|
1523
1526
|
this.isDragging = true;
|
|
1524
|
-
this.
|
|
1525
|
-
this.dragStarted = false;
|
|
1527
|
+
this.hasDragged = false;
|
|
1526
1528
|
this.clicksDisabled = false;
|
|
1527
1529
|
this.startX = clientX;
|
|
1528
1530
|
this.currentX = clientX;
|
|
@@ -1533,7 +1535,7 @@ class EluxCarouselComponent {
|
|
|
1533
1535
|
this.lastMoveX = clientX;
|
|
1534
1536
|
this.calculateDimensions();
|
|
1535
1537
|
// Disable CSS transitions during drag
|
|
1536
|
-
this.
|
|
1538
|
+
this.setSlidesTransition(false);
|
|
1537
1539
|
}
|
|
1538
1540
|
updateDrag(clientX) {
|
|
1539
1541
|
if (!this.isDragging)
|
|
@@ -1541,9 +1543,8 @@ class EluxCarouselComponent {
|
|
|
1541
1543
|
this.currentX = clientX;
|
|
1542
1544
|
const totalDeltaX = this.currentX - this.startX;
|
|
1543
1545
|
// Mark as dragging if movement is significant
|
|
1544
|
-
if (Math.abs(totalDeltaX) >
|
|
1545
|
-
this.
|
|
1546
|
-
this.dragStarted = true;
|
|
1546
|
+
if (Math.abs(totalDeltaX) > this.dragThresholdPx) {
|
|
1547
|
+
this.hasDragged = true;
|
|
1547
1548
|
}
|
|
1548
1549
|
// Calculate velocity for momentum
|
|
1549
1550
|
const now = Date.now();
|
|
@@ -1565,11 +1566,11 @@ class EluxCarouselComponent {
|
|
|
1565
1566
|
const potentialOffset = this.initialOffset + dragPercentage;
|
|
1566
1567
|
if (potentialOffset > this.maxOffset) {
|
|
1567
1568
|
const overDrag = potentialOffset - this.maxOffset;
|
|
1568
|
-
resistedDragPercentage = dragPercentage - (overDrag *
|
|
1569
|
+
resistedDragPercentage = dragPercentage - (overDrag * this.edgeResistance);
|
|
1569
1570
|
}
|
|
1570
1571
|
else if (potentialOffset < this.minOffset) {
|
|
1571
1572
|
const overDrag = this.minOffset - potentialOffset;
|
|
1572
|
-
resistedDragPercentage = dragPercentage + (overDrag *
|
|
1573
|
+
resistedDragPercentage = dragPercentage + (overDrag * this.edgeResistance);
|
|
1573
1574
|
}
|
|
1574
1575
|
this.dragOffset = resistedDragPercentage;
|
|
1575
1576
|
this.updateDragPosition();
|
|
@@ -1583,29 +1584,26 @@ class EluxCarouselComponent {
|
|
|
1583
1584
|
return;
|
|
1584
1585
|
this.isDragging = false;
|
|
1585
1586
|
// Disable clicks temporarily after any drag
|
|
1586
|
-
if (this.
|
|
1587
|
+
if (this.hasDragged) {
|
|
1587
1588
|
this.clicksDisabled = true;
|
|
1588
1589
|
setTimeout(() => {
|
|
1589
1590
|
this.clicksDisabled = false;
|
|
1590
|
-
},
|
|
1591
|
+
}, this.clickDisableDelayMs);
|
|
1591
1592
|
}
|
|
1592
|
-
// Clear the
|
|
1593
|
+
// Clear the drag flag after a shorter delay
|
|
1593
1594
|
setTimeout(() => {
|
|
1594
|
-
this.
|
|
1595
|
-
|
|
1596
|
-
}, 250);
|
|
1595
|
+
this.hasDragged = false;
|
|
1596
|
+
}, this.clearDraggedDelayMs);
|
|
1597
1597
|
// Re-enable CSS transitions
|
|
1598
|
-
this.
|
|
1599
|
-
const threshold = 40;
|
|
1598
|
+
this.setSlidesTransition(true);
|
|
1600
1599
|
const dragDistance = Math.abs(this.currentX - this.startX);
|
|
1601
1600
|
// Check for momentum (velocity-based slide change)
|
|
1602
|
-
const
|
|
1603
|
-
const hasSignificantVelocity = Math.abs(this.velocity) > momentumThreshold;
|
|
1601
|
+
const hasSignificantVelocity = Math.abs(this.velocity) > this.momentumThreshold;
|
|
1604
1602
|
if ((this.currentStepIndex === 0 && (this.dragOffset > 0 || this.velocity > 0)) ||
|
|
1605
1603
|
(!this.canGoNext() && (this.dragOffset < 0 || this.velocity < 0))) {
|
|
1606
1604
|
this.updateOffset();
|
|
1607
1605
|
}
|
|
1608
|
-
else if (dragDistance >
|
|
1606
|
+
else if (dragDistance > this.slideChangeThresholdPx || hasSignificantVelocity) {
|
|
1609
1607
|
if (this.dragOffset > 0 || (hasSignificantVelocity && this.velocity > 0)) {
|
|
1610
1608
|
// Dragged right or has positive velocity - go to previous slide
|
|
1611
1609
|
this.prevSlide();
|
|
@@ -1627,22 +1625,24 @@ class EluxCarouselComponent {
|
|
|
1627
1625
|
this.dragOffset = 0;
|
|
1628
1626
|
this.velocity = 0;
|
|
1629
1627
|
}
|
|
1628
|
+
setSlidesTransition(enabled) {
|
|
1629
|
+
if (!this.slidesContainer)
|
|
1630
|
+
return;
|
|
1631
|
+
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', enabled ? this.transitionDuration : 'none');
|
|
1632
|
+
}
|
|
1630
1633
|
getStepIndexCount() {
|
|
1631
|
-
|
|
1632
|
-
return Array.from({ length: totalSteps }, (_, i) => i);
|
|
1634
|
+
return Array.from({ length: this.getTotalSteps() }, (_, i) => i);
|
|
1633
1635
|
}
|
|
1634
1636
|
getCurrentStepIndex() {
|
|
1635
1637
|
return this.currentStepIndex;
|
|
1636
1638
|
}
|
|
1637
1639
|
goToFirstSlide() {
|
|
1638
|
-
this.currentIndex = 0;
|
|
1639
1640
|
this.currentStepIndex = 0;
|
|
1640
1641
|
this.updateOffset();
|
|
1641
1642
|
this.scrollActiveDotIntoView(0);
|
|
1642
1643
|
}
|
|
1643
1644
|
goToSlide(index) {
|
|
1644
1645
|
this.currentStepIndex = index;
|
|
1645
|
-
this.currentIndex = Math.min(index * this.itemsPerSlide, this.items.length - this.itemsPerSlide);
|
|
1646
1646
|
this.updateOffset();
|
|
1647
1647
|
this.scrollActiveDotIntoView(index);
|
|
1648
1648
|
this.dotClickEventEmitter.emit();
|
|
@@ -1651,7 +1651,6 @@ class EluxCarouselComponent {
|
|
|
1651
1651
|
if (!this.canGoPrevious())
|
|
1652
1652
|
return;
|
|
1653
1653
|
this.currentStepIndex--;
|
|
1654
|
-
this.currentIndex = this.currentStepIndex * this.itemsPerSlide;
|
|
1655
1654
|
this.updateOffset();
|
|
1656
1655
|
this.scrollActiveDotIntoView(this.currentStepIndex);
|
|
1657
1656
|
this.previousClickEventEmitter.emit();
|
|
@@ -1660,13 +1659,12 @@ class EluxCarouselComponent {
|
|
|
1660
1659
|
if (!this.canGoNext())
|
|
1661
1660
|
return;
|
|
1662
1661
|
this.currentStepIndex++;
|
|
1663
|
-
this.currentIndex = Math.min(this.currentStepIndex * this.itemsPerSlide, this.items.length - this.itemsPerSlide);
|
|
1664
1662
|
this.updateOffset();
|
|
1665
1663
|
this.scrollActiveDotIntoView(this.currentStepIndex);
|
|
1666
1664
|
this.nextClickEventEmitter.emit();
|
|
1667
1665
|
}
|
|
1668
1666
|
updateOffset() {
|
|
1669
|
-
this.offset = -
|
|
1667
|
+
this.offset = -(this.currentStepIndex * this.getPageWidthPercent());
|
|
1670
1668
|
if (!this.isDragging && this.slidesContainer) {
|
|
1671
1669
|
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transform', `translateX(${this.offset}%)`);
|
|
1672
1670
|
}
|
|
@@ -1690,11 +1688,11 @@ class EluxCarouselComponent {
|
|
|
1690
1688
|
});
|
|
1691
1689
|
}
|
|
1692
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 }); }
|
|
1693
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: EluxCarouselComponent, isStandalone: true, selector: "lib-elux-carousel", inputs: { itemsPerSlide: "itemsPerSlide", 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"] }] }); }
|
|
1694
1692
|
}
|
|
1695
1693
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCarouselComponent, decorators: [{
|
|
1696
1694
|
type: Component,
|
|
1697
|
-
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"] }]
|
|
1698
1696
|
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { items: [{
|
|
1699
1697
|
type: ContentChildren,
|
|
1700
1698
|
args: ['carouselItem', { read: ElementRef }]
|
|
@@ -1706,6 +1704,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
1706
1704
|
args: ['slidesContainer']
|
|
1707
1705
|
}], itemsPerSlide: [{
|
|
1708
1706
|
type: Input
|
|
1707
|
+
}], gap: [{
|
|
1708
|
+
type: Input
|
|
1709
1709
|
}], title: [{
|
|
1710
1710
|
type: Input
|
|
1711
1711
|
}], previousClickEventEmitter: [{
|
|
@@ -2440,6 +2440,7 @@ class EluxCardBenefit {
|
|
|
2440
2440
|
this.sanitizer = sanitizer;
|
|
2441
2441
|
this.icon = '';
|
|
2442
2442
|
this.description = '';
|
|
2443
|
+
this.link = '';
|
|
2443
2444
|
this.routerLink = '';
|
|
2444
2445
|
this.buttonText = '';
|
|
2445
2446
|
this.BREAK_VALUE = 55;
|
|
@@ -2461,11 +2462,11 @@ class EluxCardBenefit {
|
|
|
2461
2462
|
return this.sanitizer.bypassSecurityTrustHtml(this.description || '');
|
|
2462
2463
|
}
|
|
2463
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 }); }
|
|
2464
|
-
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"] }] }); }
|
|
2465
2466
|
}
|
|
2466
2467
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCardBenefit, decorators: [{
|
|
2467
2468
|
type: Component,
|
|
2468
|
-
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"] }]
|
|
2469
2470
|
}], ctorParameters: () => [{ type: i1$2.DomSanitizer }], propDecorators: { title: [{
|
|
2470
2471
|
type: Input
|
|
2471
2472
|
}], image: [{
|
|
@@ -2476,6 +2477,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2476
2477
|
type: Input
|
|
2477
2478
|
}], description: [{
|
|
2478
2479
|
type: Input
|
|
2480
|
+
}], link: [{
|
|
2481
|
+
type: Input
|
|
2479
2482
|
}], routerLink: [{
|
|
2480
2483
|
type: Input
|
|
2481
2484
|
}], buttonText: [{
|
|
@@ -2639,7 +2642,6 @@ class EluxCarouselBleedComponent {
|
|
|
2639
2642
|
this.currentIndex = 0;
|
|
2640
2643
|
this.translateX = 0;
|
|
2641
2644
|
this.isDragging = false;
|
|
2642
|
-
this.isMouseDown = false;
|
|
2643
2645
|
this.startX = 0;
|
|
2644
2646
|
this.currentX = 0;
|
|
2645
2647
|
this.initialTranslateX = 0;
|
|
@@ -2650,18 +2652,25 @@ class EluxCarouselBleedComponent {
|
|
|
2650
2652
|
this.velocity = 0;
|
|
2651
2653
|
this.lastMoveTime = 0;
|
|
2652
2654
|
this.lastMoveX = 0;
|
|
2653
|
-
this.
|
|
2654
|
-
this.
|
|
2655
|
-
this.
|
|
2655
|
+
this.pointerStartTime = 0;
|
|
2656
|
+
this.pointerStartX = 0;
|
|
2657
|
+
this.pointerStartY = 0;
|
|
2658
|
+
this.pointerDownType = 'mouse';
|
|
2659
|
+
this.activePointerId = null;
|
|
2656
2660
|
this.isVerticalScroll = false;
|
|
2657
|
-
this.
|
|
2661
|
+
this.hasDragged = false;
|
|
2658
2662
|
this.clicksDisabled = false;
|
|
2659
2663
|
this.clickListeners = [];
|
|
2660
|
-
this.dragStarted = false;
|
|
2661
|
-
this.mouseDownTime = 0;
|
|
2662
2664
|
this.resizeRafId = null;
|
|
2663
2665
|
this.lastLeftOffset = 0;
|
|
2664
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;
|
|
2665
2674
|
this.calculateBleedOffsets = () => {
|
|
2666
2675
|
if (!this.bleedShell)
|
|
2667
2676
|
return;
|
|
@@ -2781,134 +2790,76 @@ class EluxCarouselBleedComponent {
|
|
|
2781
2790
|
return false;
|
|
2782
2791
|
return !!element.closest('.c-carousel-fixed-item');
|
|
2783
2792
|
}
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
if (!this.isDragStartAllowed(event.target))
|
|
2787
|
-
return;
|
|
2788
|
-
event.preventDefault();
|
|
2789
|
-
this.mouseDownTime = Date.now();
|
|
2790
|
-
this.dragStarted = false;
|
|
2791
|
-
this.isMouseDown = true;
|
|
2792
|
-
this.wasDragging = false;
|
|
2793
|
-
this.clicksDisabled = false;
|
|
2794
|
-
this.startX = event.clientX;
|
|
2795
|
-
this.currentX = event.clientX;
|
|
2796
|
-
this.initialTranslateX = this.translateX;
|
|
2797
|
-
this.dragOffset = 0;
|
|
2798
|
-
this.velocity = 0;
|
|
2799
|
-
this.lastMoveTime = Date.now();
|
|
2800
|
-
this.lastMoveX = event.clientX;
|
|
2801
|
-
this.calculateDimensions();
|
|
2802
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'none');
|
|
2803
|
-
}
|
|
2804
|
-
onMouseMove(event) {
|
|
2805
|
-
if (!this.isMouseDown)
|
|
2806
|
-
return;
|
|
2807
|
-
event.preventDefault();
|
|
2808
|
-
const dragDistance = Math.abs(event.clientX - this.startX);
|
|
2809
|
-
// Only start dragging if moved more than 5px
|
|
2810
|
-
if (dragDistance > 5 && !this.isDragging) {
|
|
2811
|
-
this.isDragging = true;
|
|
2812
|
-
this.dragStarted = true;
|
|
2813
|
-
this.wasDragging = true;
|
|
2814
|
-
}
|
|
2815
|
-
if (this.isDragging) {
|
|
2816
|
-
this.updateDrag(event.clientX);
|
|
2817
|
-
}
|
|
2818
|
-
}
|
|
2819
|
-
onMouseUp(event) {
|
|
2820
|
-
if (!this.isMouseDown)
|
|
2793
|
+
onPointerDown(event) {
|
|
2794
|
+
if (event.pointerType === 'mouse' && event.button !== 0)
|
|
2821
2795
|
return;
|
|
2822
|
-
this.isMouseDown = false;
|
|
2823
|
-
if (this.isDragging) {
|
|
2824
|
-
const mouseUpTime = Date.now();
|
|
2825
|
-
const holdDuration = mouseUpTime - this.mouseDownTime;
|
|
2826
|
-
const mouseDistance = Math.abs(this.currentX - this.startX);
|
|
2827
|
-
if (mouseDistance > 5 || (holdDuration > 200 && mouseDistance > 0)) {
|
|
2828
|
-
this.wasDragging = true;
|
|
2829
|
-
}
|
|
2830
|
-
this.endDrag();
|
|
2831
|
-
}
|
|
2832
|
-
else {
|
|
2833
|
-
// Reset transition if it was just a click
|
|
2834
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'transform 0.3s ease-out');
|
|
2835
|
-
}
|
|
2836
|
-
}
|
|
2837
|
-
onMouseLeave(event) {
|
|
2838
|
-
if (this.isDragging) {
|
|
2839
|
-
this.wasDragging = true;
|
|
2840
|
-
this.endDrag();
|
|
2841
|
-
}
|
|
2842
|
-
this.isMouseDown = false;
|
|
2843
|
-
}
|
|
2844
|
-
// Touch events
|
|
2845
|
-
onTouchStart(event) {
|
|
2846
2796
|
if (!this.isDragStartAllowed(event.target))
|
|
2847
2797
|
return;
|
|
2848
|
-
this.
|
|
2849
|
-
this.
|
|
2850
|
-
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;
|
|
2851
2803
|
this.isVerticalScroll = false;
|
|
2852
|
-
this.
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
this.
|
|
2856
|
-
this.startX = event.touches[0].clientX;
|
|
2857
|
-
this.currentX = event.touches[0].clientX;
|
|
2858
|
-
this.initialTranslateX = this.translateX;
|
|
2859
|
-
this.dragOffset = 0;
|
|
2860
|
-
this.velocity = 0;
|
|
2861
|
-
this.lastMoveTime = Date.now();
|
|
2862
|
-
this.lastMoveX = event.touches[0].clientX;
|
|
2863
|
-
this.calculateDimensions();
|
|
2864
|
-
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);
|
|
2865
2808
|
}
|
|
2866
|
-
|
|
2867
|
-
if (!this.
|
|
2809
|
+
onPointerMove(event) {
|
|
2810
|
+
if (!this.isDragging || this.activePointerId !== event.pointerId)
|
|
2868
2811
|
return;
|
|
2869
|
-
const
|
|
2870
|
-
const
|
|
2871
|
-
const
|
|
2872
|
-
|
|
2873
|
-
// Check if this is a vertical scroll
|
|
2874
|
-
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) {
|
|
2875
2816
|
this.isVerticalScroll = true;
|
|
2876
2817
|
this.isDragging = false;
|
|
2877
|
-
this.
|
|
2878
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'transform 0.3s ease-out');
|
|
2818
|
+
this.setSlidesTransition(true);
|
|
2879
2819
|
return;
|
|
2880
2820
|
}
|
|
2881
|
-
|
|
2882
|
-
if (deltaX > 10 && !this.isDragging) {
|
|
2883
|
-
this.isDragging = true;
|
|
2884
|
-
this.dragStarted = true;
|
|
2885
|
-
this.wasDragging = true;
|
|
2886
|
-
}
|
|
2887
|
-
if (this.isDragging && deltaX > 10) {
|
|
2821
|
+
if (this.pointerDownType === 'mouse' || deltaX > this.touchDragThresholdPx) {
|
|
2888
2822
|
event.preventDefault();
|
|
2889
|
-
this.updateDrag(
|
|
2823
|
+
this.updateDrag(event.clientX);
|
|
2890
2824
|
}
|
|
2891
2825
|
}
|
|
2892
|
-
|
|
2826
|
+
onPointerUp(event) {
|
|
2827
|
+
if (this.activePointerId !== event.pointerId)
|
|
2828
|
+
return;
|
|
2893
2829
|
if (this.isVerticalScroll) {
|
|
2894
|
-
this.
|
|
2895
|
-
this.isMouseDown = false;
|
|
2830
|
+
this.resetPointerState(event.pointerId);
|
|
2896
2831
|
return;
|
|
2897
2832
|
}
|
|
2898
|
-
|
|
2899
|
-
const
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
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;
|
|
2904
2842
|
}
|
|
2905
2843
|
if (this.isDragging) {
|
|
2906
2844
|
this.endDrag();
|
|
2907
2845
|
}
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
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();
|
|
2911
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;
|
|
2912
2863
|
}
|
|
2913
2864
|
setupClickPrevention() {
|
|
2914
2865
|
// Clean up existing listeners
|
|
@@ -2917,7 +2868,7 @@ class EluxCarouselBleedComponent {
|
|
|
2917
2868
|
this.items.forEach((item) => {
|
|
2918
2869
|
// Only prevent click events, not mouseup which is needed for drag functionality
|
|
2919
2870
|
const eventHandler = (event) => {
|
|
2920
|
-
if (event.type === 'click' && (this.
|
|
2871
|
+
if (event.type === 'click' && (this.hasDragged || this.clicksDisabled)) {
|
|
2921
2872
|
event.preventDefault();
|
|
2922
2873
|
event.stopPropagation();
|
|
2923
2874
|
event.stopImmediatePropagation();
|
|
@@ -2932,15 +2883,28 @@ class EluxCarouselBleedComponent {
|
|
|
2932
2883
|
});
|
|
2933
2884
|
});
|
|
2934
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
|
+
}
|
|
2935
2900
|
updateDrag(clientX) {
|
|
2936
2901
|
if (!this.isDragging)
|
|
2937
2902
|
return;
|
|
2938
2903
|
this.currentX = clientX;
|
|
2939
2904
|
const totalDeltaX = this.currentX - this.startX;
|
|
2940
2905
|
// Mark as dragging if movement is significant
|
|
2941
|
-
if (Math.abs(totalDeltaX) >
|
|
2942
|
-
this.
|
|
2943
|
-
this.dragStarted = true;
|
|
2906
|
+
if (Math.abs(totalDeltaX) > this.dragThresholdPx) {
|
|
2907
|
+
this.hasDragged = true;
|
|
2944
2908
|
}
|
|
2945
2909
|
const now = Date.now();
|
|
2946
2910
|
const timeDelta = now - this.lastMoveTime;
|
|
@@ -2972,23 +2936,27 @@ class EluxCarouselBleedComponent {
|
|
|
2972
2936
|
return;
|
|
2973
2937
|
this.isDragging = false;
|
|
2974
2938
|
// Disable clicks temporarily after any drag
|
|
2975
|
-
if (this.
|
|
2939
|
+
if (this.hasDragged) {
|
|
2976
2940
|
this.clicksDisabled = true;
|
|
2977
2941
|
setTimeout(() => {
|
|
2978
2942
|
this.clicksDisabled = false;
|
|
2979
|
-
},
|
|
2943
|
+
}, this.clickDisableDelayMs);
|
|
2980
2944
|
}
|
|
2981
|
-
// Clear the
|
|
2945
|
+
// Clear the drag flag after a shorter delay
|
|
2982
2946
|
setTimeout(() => {
|
|
2983
|
-
this.
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', 'transform 0.3s ease-out');
|
|
2947
|
+
this.hasDragged = false;
|
|
2948
|
+
}, this.clearDraggedDelayMs);
|
|
2949
|
+
this.setSlidesTransition(true);
|
|
2987
2950
|
// Snap sempre para o início da página mais próxima
|
|
2988
2951
|
this.snapToNearestItem();
|
|
2989
2952
|
this.dragOffset = 0;
|
|
2990
2953
|
this.velocity = 0;
|
|
2991
2954
|
}
|
|
2955
|
+
setSlidesTransition(enabled) {
|
|
2956
|
+
if (!this.slidesContainer)
|
|
2957
|
+
return;
|
|
2958
|
+
this.renderer.setStyle(this.slidesContainer.nativeElement, 'transition', enabled ? this.transitionDuration : 'none');
|
|
2959
|
+
}
|
|
2992
2960
|
getMaxIndex() {
|
|
2993
2961
|
// Permite avançar até que o último item esteja alinhado ao lado direito do shell
|
|
2994
2962
|
if (!this.items || this.items.length === 0)
|
|
@@ -3130,11 +3098,11 @@ class EluxCarouselBleedComponent {
|
|
|
3130
3098
|
this.updateTransform();
|
|
3131
3099
|
}
|
|
3132
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 }); }
|
|
3133
|
-
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"] }] }); }
|
|
3134
3102
|
}
|
|
3135
3103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EluxCarouselBleedComponent, decorators: [{
|
|
3136
3104
|
type: Component,
|
|
3137
|
-
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"] }]
|
|
3138
3106
|
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { items: [{
|
|
3139
3107
|
type: ContentChildren,
|
|
3140
3108
|
args: ['carouselItem', { read: ElementRef }]
|