tee3apps-cms-sdk-react 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/PageComponents/Visual-Components/TabComponent.tsx +129 -19
package/package.json
CHANGED
|
@@ -642,6 +642,19 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
642
642
|
const displayImages = displayIndices.map(idx => images[idx]);
|
|
643
643
|
const needsCarousel = images.length > itemsPerView;
|
|
644
644
|
|
|
645
|
+
// Navigation handlers specific to this layout
|
|
646
|
+
const handleNextImage = () => {
|
|
647
|
+
if (carouselIndex < maxCarouselIndex) {
|
|
648
|
+
setCarouselIndex((prev) => Math.min(prev + 1, maxCarouselIndex));
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
const handlePrevImage = () => {
|
|
653
|
+
if (carouselIndex > 0) {
|
|
654
|
+
setCarouselIndex((prev) => Math.max(prev - 1, 0));
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
|
|
645
658
|
// Create dynamic content style for GROUPIMAGE
|
|
646
659
|
const groupImageContentStyle = {
|
|
647
660
|
display: 'grid',
|
|
@@ -653,7 +666,17 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
653
666
|
};
|
|
654
667
|
|
|
655
668
|
return (
|
|
656
|
-
<div
|
|
669
|
+
<div
|
|
670
|
+
style={{
|
|
671
|
+
position: 'relative',
|
|
672
|
+
width: '100%',
|
|
673
|
+
height: 'auto',
|
|
674
|
+
overflow: 'hidden',
|
|
675
|
+
display: 'flex',
|
|
676
|
+
alignItems: 'center',
|
|
677
|
+
justifyContent: 'center',
|
|
678
|
+
}}
|
|
679
|
+
>
|
|
657
680
|
<div style={groupImageContentStyle} className='media-box'>
|
|
658
681
|
{displayImages.map((image, displayIndex) => {
|
|
659
682
|
const originalIndex = displayIndices[displayIndex];
|
|
@@ -702,7 +725,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
702
725
|
<>
|
|
703
726
|
{/* Previous Button */}
|
|
704
727
|
<button
|
|
705
|
-
onClick={
|
|
728
|
+
onClick={handlePrevImage}
|
|
706
729
|
disabled={carouselIndex === 0}
|
|
707
730
|
style={{
|
|
708
731
|
position: 'absolute',
|
|
@@ -729,7 +752,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
729
752
|
|
|
730
753
|
{/* Next Button */}
|
|
731
754
|
<button
|
|
732
|
-
onClick={
|
|
755
|
+
onClick={handleNextImage}
|
|
733
756
|
disabled={carouselIndex >= maxCarouselIndex}
|
|
734
757
|
style={{
|
|
735
758
|
position: 'absolute',
|
|
@@ -964,6 +987,19 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
964
987
|
const displayVideos = displayIndices.map(idx => videos[idx]);
|
|
965
988
|
const needsCarousel = videos.length > itemsPerView;
|
|
966
989
|
|
|
990
|
+
// Navigation handlers specific to this layout
|
|
991
|
+
const handleNextVideo = () => {
|
|
992
|
+
if (carouselIndex < maxCarouselIndex) {
|
|
993
|
+
setCarouselIndex((prev) => Math.min(prev + 1, maxCarouselIndex));
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
const handlePrevVideo = () => {
|
|
998
|
+
if (carouselIndex > 0) {
|
|
999
|
+
setCarouselIndex((prev) => Math.max(prev - 1, 0));
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
|
|
967
1003
|
// Create dynamic content style for GROUPVIDEO
|
|
968
1004
|
const groupVideoContentStyle = {
|
|
969
1005
|
display: 'grid',
|
|
@@ -975,7 +1011,17 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
975
1011
|
};
|
|
976
1012
|
|
|
977
1013
|
return (
|
|
978
|
-
<div
|
|
1014
|
+
<div
|
|
1015
|
+
style={{
|
|
1016
|
+
position: 'relative',
|
|
1017
|
+
width: '100%',
|
|
1018
|
+
height: 'auto',
|
|
1019
|
+
overflow: 'hidden',
|
|
1020
|
+
display: 'flex',
|
|
1021
|
+
alignItems: 'center',
|
|
1022
|
+
justifyContent: 'center',
|
|
1023
|
+
}}
|
|
1024
|
+
>
|
|
979
1025
|
<div style={groupVideoContentStyle} className='media-box'>
|
|
980
1026
|
{displayVideos.map((video, displayIndex) => {
|
|
981
1027
|
const originalIndex = displayIndices[displayIndex];
|
|
@@ -1027,7 +1073,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1027
1073
|
<>
|
|
1028
1074
|
{/* Previous Button */}
|
|
1029
1075
|
<button
|
|
1030
|
-
onClick={
|
|
1076
|
+
onClick={handlePrevVideo}
|
|
1031
1077
|
disabled={carouselIndex === 0}
|
|
1032
1078
|
style={{
|
|
1033
1079
|
position: 'absolute',
|
|
@@ -1054,7 +1100,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1054
1100
|
|
|
1055
1101
|
{/* Next Button */}
|
|
1056
1102
|
<button
|
|
1057
|
-
onClick={
|
|
1103
|
+
onClick={handleNextVideo}
|
|
1058
1104
|
disabled={carouselIndex >= maxCarouselIndex}
|
|
1059
1105
|
style={{
|
|
1060
1106
|
position: 'absolute',
|
|
@@ -1254,6 +1300,40 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1254
1300
|
const displayProducts = displayIndices.map(idx => products[idx]);
|
|
1255
1301
|
const needsCarousel = products.length > itemsPerView;
|
|
1256
1302
|
|
|
1303
|
+
// Debug logging
|
|
1304
|
+
console.log('GROUPPRODUCT Grid Layout:', {
|
|
1305
|
+
layout,
|
|
1306
|
+
totalProducts: products.length,
|
|
1307
|
+
itemsPerView,
|
|
1308
|
+
carouselIndex,
|
|
1309
|
+
maxCarouselIndex,
|
|
1310
|
+
displayIndices,
|
|
1311
|
+
needsCarousel
|
|
1312
|
+
});
|
|
1313
|
+
|
|
1314
|
+
// Navigation handlers specific to this layout
|
|
1315
|
+
const handleNextProduct = () => {
|
|
1316
|
+
console.log('Next clicked, current:', carouselIndex, 'max:', maxCarouselIndex);
|
|
1317
|
+
if (carouselIndex < maxCarouselIndex) {
|
|
1318
|
+
setCarouselIndex((prev) => {
|
|
1319
|
+
const next = Math.min(prev + 1, maxCarouselIndex);
|
|
1320
|
+
console.log('Setting carousel index to:', next);
|
|
1321
|
+
return next;
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
};
|
|
1325
|
+
|
|
1326
|
+
const handlePrevProduct = () => {
|
|
1327
|
+
console.log('Prev clicked, current:', carouselIndex);
|
|
1328
|
+
if (carouselIndex > 0) {
|
|
1329
|
+
setCarouselIndex((prev) => {
|
|
1330
|
+
const next = Math.max(prev - 1, 0);
|
|
1331
|
+
console.log('Setting carousel index to:', next);
|
|
1332
|
+
return next;
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1257
1337
|
// Create dynamic content style for GROUPPRODUCT
|
|
1258
1338
|
const groupProductContentStyle = {
|
|
1259
1339
|
display: 'grid',
|
|
@@ -1267,7 +1347,17 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1267
1347
|
};
|
|
1268
1348
|
|
|
1269
1349
|
return (
|
|
1270
|
-
<div
|
|
1350
|
+
<div
|
|
1351
|
+
style={{
|
|
1352
|
+
position: 'relative',
|
|
1353
|
+
width: '100%',
|
|
1354
|
+
height: 'auto',
|
|
1355
|
+
overflow: 'hidden',
|
|
1356
|
+
display: 'flex',
|
|
1357
|
+
alignItems: 'center',
|
|
1358
|
+
justifyContent: 'center',
|
|
1359
|
+
}}
|
|
1360
|
+
>
|
|
1271
1361
|
<div style={groupProductContentStyle}>
|
|
1272
1362
|
{displayProducts.map((product, displayIndex) => {
|
|
1273
1363
|
const originalIndex = displayIndices[displayIndex];
|
|
@@ -1294,14 +1384,18 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1294
1384
|
<>
|
|
1295
1385
|
{/* Previous Button */}
|
|
1296
1386
|
<button
|
|
1297
|
-
onClick={
|
|
1387
|
+
onClick={(e) => {
|
|
1388
|
+
e.preventDefault();
|
|
1389
|
+
e.stopPropagation();
|
|
1390
|
+
handlePrevProduct();
|
|
1391
|
+
}}
|
|
1298
1392
|
disabled={carouselIndex === 0}
|
|
1299
1393
|
style={{
|
|
1300
1394
|
position: 'absolute',
|
|
1301
1395
|
left: '10px',
|
|
1302
1396
|
top: '50%',
|
|
1303
1397
|
transform: 'translateY(-50%)',
|
|
1304
|
-
background: 'rgba(0,0,0,0.
|
|
1398
|
+
background: carouselIndex === 0 ? 'rgba(0,0,0,0.3)' : 'rgba(0,0,0,0.7)',
|
|
1305
1399
|
color: 'white',
|
|
1306
1400
|
border: 'none',
|
|
1307
1401
|
borderRadius: '50%',
|
|
@@ -1312,8 +1406,11 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1312
1406
|
display: 'flex',
|
|
1313
1407
|
alignItems: 'center',
|
|
1314
1408
|
justifyContent: 'center',
|
|
1315
|
-
fontSize: '
|
|
1316
|
-
|
|
1409
|
+
fontSize: '24px',
|
|
1410
|
+
fontWeight: 'bold',
|
|
1411
|
+
zIndex: 100,
|
|
1412
|
+
pointerEvents: 'auto',
|
|
1413
|
+
transition: 'all 0.3s ease',
|
|
1317
1414
|
}}
|
|
1318
1415
|
>
|
|
1319
1416
|
‹
|
|
@@ -1321,14 +1418,18 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1321
1418
|
|
|
1322
1419
|
{/* Next Button */}
|
|
1323
1420
|
<button
|
|
1324
|
-
onClick={
|
|
1421
|
+
onClick={(e) => {
|
|
1422
|
+
e.preventDefault();
|
|
1423
|
+
e.stopPropagation();
|
|
1424
|
+
handleNextProduct();
|
|
1425
|
+
}}
|
|
1325
1426
|
disabled={carouselIndex >= maxCarouselIndex}
|
|
1326
1427
|
style={{
|
|
1327
1428
|
position: 'absolute',
|
|
1328
1429
|
right: '10px',
|
|
1329
1430
|
top: '50%',
|
|
1330
1431
|
transform: 'translateY(-50%)',
|
|
1331
|
-
background: 'rgba(0,0,0,0.
|
|
1432
|
+
background: carouselIndex >= maxCarouselIndex ? 'rgba(0,0,0,0.3)' : 'rgba(0,0,0,0.7)',
|
|
1332
1433
|
color: 'white',
|
|
1333
1434
|
border: 'none',
|
|
1334
1435
|
borderRadius: '50%',
|
|
@@ -1339,8 +1440,11 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1339
1440
|
display: 'flex',
|
|
1340
1441
|
alignItems: 'center',
|
|
1341
1442
|
justifyContent: 'center',
|
|
1342
|
-
fontSize: '
|
|
1343
|
-
|
|
1443
|
+
fontSize: '24px',
|
|
1444
|
+
fontWeight: 'bold',
|
|
1445
|
+
zIndex: 100,
|
|
1446
|
+
pointerEvents: 'auto',
|
|
1447
|
+
transition: 'all 0.3s ease',
|
|
1344
1448
|
}}
|
|
1345
1449
|
>
|
|
1346
1450
|
›
|
|
@@ -1355,21 +1459,27 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1355
1459
|
transform: 'translateX(-50%)',
|
|
1356
1460
|
display: 'flex',
|
|
1357
1461
|
gap: '8px',
|
|
1358
|
-
zIndex:
|
|
1462
|
+
zIndex: 100,
|
|
1463
|
+
pointerEvents: 'auto',
|
|
1359
1464
|
}}
|
|
1360
1465
|
>
|
|
1361
1466
|
{Array.from({ length: maxCarouselIndex + 1 }, (_, index) => (
|
|
1362
1467
|
<button
|
|
1363
1468
|
key={index}
|
|
1364
|
-
onClick={() =>
|
|
1469
|
+
onClick={(e) => {
|
|
1470
|
+
e.preventDefault();
|
|
1471
|
+
e.stopPropagation();
|
|
1472
|
+
goToCarouselItem(index);
|
|
1473
|
+
}}
|
|
1365
1474
|
style={{
|
|
1366
1475
|
width: index === carouselIndex ? '12px' : '8px',
|
|
1367
1476
|
height: index === carouselIndex ? '12px' : '8px',
|
|
1368
1477
|
borderRadius: '50%',
|
|
1369
|
-
border: '
|
|
1370
|
-
background: index === carouselIndex ? 'white' : 'rgba(255,255,255,0.
|
|
1478
|
+
border: '2px solid white',
|
|
1479
|
+
background: index === carouselIndex ? 'white' : 'rgba(255,255,255,0.6)',
|
|
1371
1480
|
cursor: 'pointer',
|
|
1372
1481
|
transition: 'all 0.3s ease',
|
|
1482
|
+
pointerEvents: 'auto',
|
|
1373
1483
|
}}
|
|
1374
1484
|
/>
|
|
1375
1485
|
))}
|