arengibook 2.4.698 → 2.4.700

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.
Files changed (2) hide show
  1. package/dist/index.js +27 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39953,7 +39953,7 @@ var MultiSelect = function MultiSelect(props) {
39953
39953
  _useState4 = _slicedToArray$a(_useState3, 2);
39954
39954
  _useState4[0];
39955
39955
  var setHovered = _useState4[1];
39956
- var multiselectRef = useRef(null);
39956
+ useRef(null);
39957
39957
  var style = {
39958
39958
  border: invalid ? '1px solid red' : '1px solid #ccc',
39959
39959
  width: '100%'
@@ -39974,12 +39974,30 @@ var MultiSelect = function MultiSelect(props) {
39974
39974
  };
39975
39975
  }, []);
39976
39976
  useEffect(function () {
39977
- var _multiselectRef$curre;
39978
- var labelElement = (_multiselectRef$curre = multiselectRef.current) === null || _multiselectRef$curre === void 0 ? void 0 : _multiselectRef$curre.querySelector('.p-multiselect-label');
39979
- if (labelElement && labelElement.textContent === 'empty' && placeholder) {
39980
- labelElement.textContent = placeholder;
39981
- }
39982
- }, [selectedOptions, placeholder]);
39977
+ var observer = new MutationObserver(function () {
39978
+ var labelElement = document.querySelector('.p-multiselect-label');
39979
+ if (labelElement) {
39980
+ console.log('labelElement');
39981
+ console.log(labelElement);
39982
+ console.log(labelElement.textContent);
39983
+ console.log(placeholder);
39984
+ console.log("placeholder");
39985
+ } else {
39986
+ console.log(document.querySelector('.p-multiselect-label'));
39987
+ console.log("rien");
39988
+ }
39989
+ if (labelElement && labelElement.textContent === 'empty') {
39990
+ labelElement.textContent = 'Choisissez vos options';
39991
+ }
39992
+ });
39993
+ observer.observe(document.body, {
39994
+ childList: true,
39995
+ subtree: true
39996
+ });
39997
+ return function () {
39998
+ observer.disconnect();
39999
+ };
40000
+ }, [placeholder]);
39983
40001
  var optionTemplate = function optionTemplate(option) {
39984
40002
  if (!option) return null;
39985
40003
  if (isSelectMeta) {
@@ -40014,8 +40032,7 @@ var MultiSelect = function MultiSelect(props) {
40014
40032
  }, !useCheckbox && /*#__PURE__*/React__default.createElement("style", null, "\n .p-multiselect-items .p-multiselect-item .p-checkbox {\n display: none !important;\n }\n .p-multiselect-items .p-multiselect-item {\n padding-left: 1rem !important;\n align-items: center;\n }\n "), !filter && !showSelectAll && /*#__PURE__*/React__default.createElement("style", null, "\n .p-multiselect-header {\n display: none !important;\n }\n "), option[optionLabel]);
40015
40033
  }
40016
40034
  };
40017
- var selectedOptionsCount = selectedOptions ? selectedOptions.length : 0;
40018
- var selectedOptionsText = selectedOptionsCount > 0 ? "".concat(selectedOptionsCount, " option").concat(selectedOptionsCount > 1 ? 's' : '', " s\xE9lectionn\xE9e").concat(selectedOptionsCount > 1 ? 's' : '') : placeholder;
40035
+ selectedOptions ? selectedOptions.length : 0;
40019
40036
  var inverseColor = function inverseColor(hexColor) {
40020
40037
  var r = parseInt(hexColor.substr(1, 2), 16);
40021
40038
  var g = parseInt(hexColor.substr(3, 2), 16);
@@ -40252,7 +40269,7 @@ var MultiSelect = function MultiSelect(props) {
40252
40269
  optionGroupChildren: 'items'
40253
40270
  })), /*#__PURE__*/React__default.createElement("div", {
40254
40271
  className: "p-multiselect-label"
40255
- }, "ici ", selectedOptionsText), displayNbOption && selectedOptions.length > 0 && /*#__PURE__*/React__default.createElement(Badge, {
40272
+ }, placeholder ? placeholder : ''), displayNbOption && selectedOptions.length > 0 && /*#__PURE__*/React__default.createElement(Badge, {
40256
40273
  value: selectedOptions.length,
40257
40274
  className: "custom-badge",
40258
40275
  style: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.4.698",
4
+ "version": "2.4.700",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {