arengibook 2.4.583 → 2.4.585
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 +28 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35819,7 +35819,10 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35819
35819
|
_ref$errorMessage = _ref.errorMessage,
|
|
35820
35820
|
errorMessage = _ref$errorMessage === void 0 ? '' : _ref$errorMessage,
|
|
35821
35821
|
_ref$valueStyle = _ref.valueStyle,
|
|
35822
|
-
valueStyle = _ref$valueStyle === void 0 ? {
|
|
35822
|
+
valueStyle = _ref$valueStyle === void 0 ? {
|
|
35823
|
+
paddingTop: '1rem',
|
|
35824
|
+
paddingBottom: '1rem'
|
|
35825
|
+
} : _ref$valueStyle,
|
|
35823
35826
|
_ref$optionStyle = _ref.optionStyle,
|
|
35824
35827
|
optionStyle = _ref$optionStyle === void 0 ? {} : _ref$optionStyle,
|
|
35825
35828
|
name = _ref.name,
|
|
@@ -35843,6 +35846,28 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35843
35846
|
useEffect(function () {
|
|
35844
35847
|
setOptionSelected(value !== null && value !== void 0 ? value : null);
|
|
35845
35848
|
}, [value]);
|
|
35849
|
+
useEffect(function () {
|
|
35850
|
+
var handleScroll = function handleScroll(e) {
|
|
35851
|
+
var target = e.target;
|
|
35852
|
+
|
|
35853
|
+
// Si on scroll dans la liste elle-même (aucun effet de suppression de liste)
|
|
35854
|
+
if (target.closest && target.closest('.p-dropdown-panel')) {
|
|
35855
|
+
return;
|
|
35856
|
+
}
|
|
35857
|
+
|
|
35858
|
+
// Sinon, le zone de liste est fermée
|
|
35859
|
+
var dropdownPanels = document.querySelectorAll('.p-dropdown-panel');
|
|
35860
|
+
dropdownPanels.forEach(function (panel) {
|
|
35861
|
+
if (panel && panel.style.display !== 'none') {
|
|
35862
|
+
document.body.click(); // Déclenche un "click outside"
|
|
35863
|
+
}
|
|
35864
|
+
});
|
|
35865
|
+
};
|
|
35866
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
35867
|
+
return function () {
|
|
35868
|
+
window.removeEventListener('scroll', handleScroll, true);
|
|
35869
|
+
};
|
|
35870
|
+
}, []);
|
|
35846
35871
|
var resetDropdownFilter = function resetDropdownFilter() {
|
|
35847
35872
|
setTimeout(function () {
|
|
35848
35873
|
var dropdownPanels = document.querySelectorAll('.p-dropdown-panel');
|
|
@@ -35901,13 +35926,13 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35901
35926
|
fontSize: '15px',
|
|
35902
35927
|
fontWeight: 'bold'
|
|
35903
35928
|
}, labelStyle)
|
|
35904
|
-
}, generalIcon && /*#__PURE__*/React__default.createElement(
|
|
35929
|
+
}, generalIcon && /*#__PURE__*/React__default.createElement("i", {
|
|
35905
35930
|
style: _objectSpread2({
|
|
35906
35931
|
fontSize: '15px',
|
|
35907
35932
|
fontWeight: 'bold'
|
|
35908
35933
|
}, labelStyle),
|
|
35909
35934
|
className: generalIcon
|
|
35910
|
-
})
|
|
35935
|
+
}), generalImage && /*#__PURE__*/React__default.createElement("img", {
|
|
35911
35936
|
alt: "General",
|
|
35912
35937
|
src: generalImage,
|
|
35913
35938
|
style: imageStyle || {
|