@bebranded/bb-contents 1.0.133 → 1.0.135
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/bb-contents.js +21 -37
- package/package.json +1 -1
package/bb-contents.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BeBranded Contents
|
|
3
3
|
* Contenus additionnels français pour Webflow
|
|
4
|
-
* @version 1.0.
|
|
4
|
+
* @version 1.0.135
|
|
5
5
|
* @author BeBranded
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @website https://www.bebranded.xyz
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
window._bbContentsInitialized = true;
|
|
33
33
|
|
|
34
34
|
// Log de démarrage simple (une seule fois)
|
|
35
|
-
console.log('bb-contents | v1.0.
|
|
35
|
+
console.log('bb-contents | v1.0.135');
|
|
36
36
|
|
|
37
37
|
// Configuration
|
|
38
38
|
const config = {
|
|
39
|
-
version: '1.0.
|
|
39
|
+
version: '1.0.135',
|
|
40
40
|
debug: false, // Debug désactivé pour rendu propre
|
|
41
41
|
prefix: 'bb-', // utilisé pour générer les sélecteurs (data-bb-*)
|
|
42
42
|
youtubeEndpoint: null, // URL du worker YouTube (à définir par l'utilisateur)
|
|
@@ -1443,19 +1443,10 @@
|
|
|
1443
1443
|
popover.className = 'bb-country-select-popover';
|
|
1444
1444
|
popover.setAttribute('role', 'listbox');
|
|
1445
1445
|
let popoverStyle = 'position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; max-height: 300px; overflow: hidden; display: none; z-index: 50;';
|
|
1446
|
-
//
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
popoverStyle += ' background-color: white;';
|
|
1451
|
-
}
|
|
1452
|
-
if (selectBorder && selectBorder !== 'none' && selectBorder !== '0px none rgb(0, 0, 0)') {
|
|
1453
|
-
popoverStyle += ' border: ' + selectBorder + ';';
|
|
1454
|
-
} else if (selectBorderColor && selectBorderColor !== 'rgba(0, 0, 0, 0)') {
|
|
1455
|
-
popoverStyle += ' border: 1px solid ' + selectBorderColor + ';';
|
|
1456
|
-
} else {
|
|
1457
|
-
popoverStyle += ' border: 1px solid #e5e7eb;';
|
|
1458
|
-
}
|
|
1446
|
+
// Garder les couleurs par défaut pour le dropdown
|
|
1447
|
+
popoverStyle += ' background-color: white;';
|
|
1448
|
+
popoverStyle += ' border: 1px solid #e5e7eb;';
|
|
1449
|
+
// Appliquer uniquement le border-radius du select natif
|
|
1459
1450
|
if (selectBorderRadius && selectBorderRadius !== '0px') {
|
|
1460
1451
|
popoverStyle += ' border-radius: ' + selectBorderRadius + ';';
|
|
1461
1452
|
} else {
|
|
@@ -1467,18 +1458,7 @@
|
|
|
1467
1458
|
// Barre de recherche
|
|
1468
1459
|
const searchWrapper = document.createElement('div');
|
|
1469
1460
|
searchWrapper.className = 'bb-country-search';
|
|
1470
|
-
|
|
1471
|
-
if (selectBgColor && selectBgColor !== 'rgba(0, 0, 0, 0)' && selectBgColor !== 'transparent') {
|
|
1472
|
-
searchWrapperStyle += ' background-color: ' + selectBgColor + ';';
|
|
1473
|
-
} else {
|
|
1474
|
-
searchWrapperStyle += ' background-color: white;';
|
|
1475
|
-
}
|
|
1476
|
-
if (selectBorderColor && selectBorderColor !== 'rgba(0, 0, 0, 0)') {
|
|
1477
|
-
searchWrapperStyle += ' border-bottom: 1px solid ' + selectBorderColor + ';';
|
|
1478
|
-
} else {
|
|
1479
|
-
searchWrapperStyle += ' border-bottom: 1px solid #e5e7eb;';
|
|
1480
|
-
}
|
|
1481
|
-
searchWrapper.style.cssText = searchWrapperStyle;
|
|
1461
|
+
searchWrapper.style.cssText = 'position: sticky; top: 0; padding: 8px; background-color: white; border-bottom: 1px solid #e5e7eb; z-index: 1;';
|
|
1482
1462
|
|
|
1483
1463
|
const searchInput = document.createElement('input');
|
|
1484
1464
|
searchInput.type = 'text';
|
|
@@ -1492,14 +1472,7 @@
|
|
|
1492
1472
|
if (selectFontFamily) {
|
|
1493
1473
|
searchInputStyle += ' font-family: ' + selectFontFamily + ';';
|
|
1494
1474
|
}
|
|
1495
|
-
|
|
1496
|
-
searchInputStyle += ' color: ' + selectColor + ';';
|
|
1497
|
-
}
|
|
1498
|
-
if (selectBorderColor && selectBorderColor !== 'rgba(0, 0, 0, 0)') {
|
|
1499
|
-
searchInputStyle += ' border: 1px solid ' + selectBorderColor + ';';
|
|
1500
|
-
} else {
|
|
1501
|
-
searchInputStyle += ' border: 1px solid #e5e7eb;';
|
|
1502
|
-
}
|
|
1475
|
+
searchInputStyle += ' border: 1px solid #e5e7eb;';
|
|
1503
1476
|
if (selectBorderRadius && selectBorderRadius !== '0px') {
|
|
1504
1477
|
const borderRadiusValue = parseFloat(selectBorderRadius);
|
|
1505
1478
|
if (!isNaN(borderRadiusValue)) {
|
|
@@ -1530,7 +1503,18 @@
|
|
|
1530
1503
|
|
|
1531
1504
|
list.innerHTML = countries.map(function(country) {
|
|
1532
1505
|
const isSelected = currentSelectedCountry && currentSelectedCountry.alpha2 === country.alpha2;
|
|
1533
|
-
|
|
1506
|
+
let itemStyle = 'display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; transition: background-color 0.15s; min-height: 36px; box-sizing: border-box;';
|
|
1507
|
+
// Appliquer uniquement font-size et font-family du select natif (pas la couleur)
|
|
1508
|
+
if (selectFontSize) {
|
|
1509
|
+
itemStyle += ' font-size: ' + selectFontSize + ';';
|
|
1510
|
+
}
|
|
1511
|
+
if (selectFontFamily) {
|
|
1512
|
+
itemStyle += ' font-family: ' + selectFontFamily + ';';
|
|
1513
|
+
}
|
|
1514
|
+
if (isSelected) {
|
|
1515
|
+
itemStyle += ' background-color: #f3f4f6;';
|
|
1516
|
+
}
|
|
1517
|
+
return '<div class="bb-country-item" data-country="' + country.alpha2 + '" role="option" aria-selected="' + (isSelected ? 'true' : 'false') + '" style="' + itemStyle + '"><img src="https://hatscripts.github.io/circle-flags/flags/' + country.alpha2.toLowerCase() + '.svg" alt="' + bbContents.utils.sanitize(country.name[language]) + '" style="width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0;"><span style="line-height: 1.2;">' + bbContents.utils.sanitize(country.name[language]) + '</span></div>';
|
|
1534
1518
|
}).join('');
|
|
1535
1519
|
|
|
1536
1520
|
// Ajouter hover effect
|