arengibook 2.4.50 → 2.4.52
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 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35760,9 +35760,9 @@ var PopupPresets = {
|
|
|
35760
35760
|
|
|
35761
35761
|
var Dropdown = function Dropdown(_ref) {
|
|
35762
35762
|
var _ref$options = _ref.options,
|
|
35763
|
-
options = _ref$options === void 0 ? [] : _ref$options
|
|
35764
|
-
_ref.value
|
|
35765
|
-
|
|
35763
|
+
options = _ref$options === void 0 ? [] : _ref$options,
|
|
35764
|
+
value = _ref.value,
|
|
35765
|
+
_ref$placeholder = _ref.placeholder,
|
|
35766
35766
|
placeholder = _ref$placeholder === void 0 ? 'Sélectionnez une option' : _ref$placeholder,
|
|
35767
35767
|
_ref$disabled = _ref.disabled,
|
|
35768
35768
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
@@ -35775,19 +35775,32 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35775
35775
|
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
35776
35776
|
_ref$errorMessage = _ref.errorMessage,
|
|
35777
35777
|
errorMessage = _ref$errorMessage === void 0 ? '' : _ref$errorMessage;
|
|
35778
|
-
var _useState = useState(null),
|
|
35778
|
+
var _useState = useState(value !== null && value !== void 0 ? value : null),
|
|
35779
35779
|
_useState2 = _slicedToArray$8(_useState, 2),
|
|
35780
35780
|
optionSelected = _useState2[0],
|
|
35781
35781
|
setOptionSelected = _useState2[1];
|
|
35782
|
+
var resetDropdownFilter = function resetDropdownFilter() {
|
|
35783
|
+
var filterInput = document.querySelector('.p-dropdown-panel .p-dropdown-filter');
|
|
35784
|
+
if (filterInput) {
|
|
35785
|
+
filterInput.value = '';
|
|
35786
|
+
filterInput.dispatchEvent(new Event('input', {
|
|
35787
|
+
bubbles: true
|
|
35788
|
+
}));
|
|
35789
|
+
}
|
|
35790
|
+
};
|
|
35782
35791
|
var style = {
|
|
35783
35792
|
border: invalid ? '1px solid red' : '1px solid #ccc',
|
|
35784
|
-
width: '
|
|
35793
|
+
width: '100%'
|
|
35794
|
+
};
|
|
35795
|
+
var itemTemplate = function itemTemplate(option) {
|
|
35796
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
35797
|
+
style: {
|
|
35798
|
+
fontSize: '21px'
|
|
35799
|
+
}
|
|
35800
|
+
}, option.label);
|
|
35785
35801
|
};
|
|
35786
35802
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
35787
|
-
className: "flex flex-col gap-1"
|
|
35788
|
-
style: {
|
|
35789
|
-
width: '100%'
|
|
35790
|
-
}
|
|
35803
|
+
className: "flex flex-col gap-1"
|
|
35791
35804
|
}, /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
35792
35805
|
value: optionSelected,
|
|
35793
35806
|
options: options,
|
|
@@ -35798,7 +35811,12 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35798
35811
|
disabled: disabled,
|
|
35799
35812
|
filter: filter,
|
|
35800
35813
|
optionLabel: optionLabel,
|
|
35801
|
-
style: style
|
|
35814
|
+
style: style,
|
|
35815
|
+
panelStyle: {
|
|
35816
|
+
maxWidth: '100%'
|
|
35817
|
+
},
|
|
35818
|
+
itemTemplate: itemTemplate,
|
|
35819
|
+
onHide: resetDropdownFilter
|
|
35802
35820
|
}), invalid && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("small", {
|
|
35803
35821
|
style: {
|
|
35804
35822
|
color: 'red',
|