arengibook 2.4.643 → 2.4.645
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 +38 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39346,10 +39346,32 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39346
39346
|
style: styleLabel
|
|
39347
39347
|
}, option[optionLabel]));
|
|
39348
39348
|
};
|
|
39349
|
-
|
|
39350
|
-
|
|
39349
|
+
useEffect(function () {
|
|
39350
|
+
loadedOptions.find(function (opt) {
|
|
39351
39351
|
return opt[optionValue] === option;
|
|
39352
39352
|
});
|
|
39353
|
+
|
|
39354
|
+
// À l'extérieur de selectedItemTemplate (dans le corps du composant)
|
|
39355
|
+
useMemo(function () {
|
|
39356
|
+
return selectedOptions.map(function (option) {
|
|
39357
|
+
// 1. Cherche d'abord dans objValue (pour l'affichage immédiat)
|
|
39358
|
+
var selectedOption = objValue.find(function (opt) {
|
|
39359
|
+
return opt[optionValue] === option;
|
|
39360
|
+
});
|
|
39361
|
+
// 2. Si non trouvé, cherche dans loadedOptions (fallback)
|
|
39362
|
+
if (!selectedOption && loadedOptions.length > 0) {
|
|
39363
|
+
selectedOption = loadedOptions.find(function (opt) {
|
|
39364
|
+
return opt[optionValue] === option;
|
|
39365
|
+
});
|
|
39366
|
+
}
|
|
39367
|
+
return selectedOption;
|
|
39368
|
+
}).filter(Boolean); // Filtre les valeurs "undefined" si une option n'est pas trouvée
|
|
39369
|
+
}, [selectedOptions, objValue, loadedOptions, optionValue]);
|
|
39370
|
+
});
|
|
39371
|
+
var selectedItemTemplate = function selectedItemTemplate(option) {
|
|
39372
|
+
var _selectedOption, _selectedOption2, _selectedOption3, _selectedOption4;
|
|
39373
|
+
// const selectedOption = objValue.find(opt => opt[optionValue] === option);
|
|
39374
|
+
|
|
39353
39375
|
console.log("ecoute de selectedOption");
|
|
39354
39376
|
console.log(loadedOptions.find(function (opt) {
|
|
39355
39377
|
return opt[optionValue] === option;
|
|
@@ -39357,11 +39379,22 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39357
39379
|
console.log(loadedOptions.find(function (opt) {
|
|
39358
39380
|
return Number(opt[optionValue]) === Number(option);
|
|
39359
39381
|
}));
|
|
39360
|
-
console.log(selectedOption);
|
|
39361
39382
|
console.log(objValue);
|
|
39362
39383
|
console.log(selectedOptions);
|
|
39363
39384
|
console.log(loadedOptions);
|
|
39364
39385
|
console.log(option);
|
|
39386
|
+
|
|
39387
|
+
// 1. Cherche d'abord dans objValue (pour l'affichage immédiat)
|
|
39388
|
+
var selectedOption = objValue.find(function (opt) {
|
|
39389
|
+
return opt[optionValue] === option;
|
|
39390
|
+
});
|
|
39391
|
+
// 2. Si non trouvé, cherche dans loadedOptions (pour les cas où objValue est obsolète)
|
|
39392
|
+
if (!selectedOption && loadedOptions.length > 0) {
|
|
39393
|
+
selectedOption = loadedOptions.find(function (opt) {
|
|
39394
|
+
return opt[optionValue] === option;
|
|
39395
|
+
});
|
|
39396
|
+
}
|
|
39397
|
+
console.log(selectedOption);
|
|
39365
39398
|
if (!selectedOption) return null;
|
|
39366
39399
|
var handleRemove = function handleRemove(e) {
|
|
39367
39400
|
e.stopPropagation();
|
|
@@ -39374,8 +39407,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39374
39407
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
39375
39408
|
onClick: handleRemove,
|
|
39376
39409
|
style: _objectSpread2({
|
|
39377
|
-
backgroundColor: selectedOption !== null &&
|
|
39378
|
-
color: selectedOption !== null &&
|
|
39410
|
+
backgroundColor: (_selectedOption = selectedOption) !== null && _selectedOption !== void 0 && _selectedOption.color ? (_selectedOption2 = selectedOption) === null || _selectedOption2 === void 0 ? void 0 : _selectedOption2.color : '#f8e6ec',
|
|
39411
|
+
color: (_selectedOption3 = selectedOption) !== null && _selectedOption3 !== void 0 && _selectedOption3.color ? inverseColor((_selectedOption4 = selectedOption) === null || _selectedOption4 === void 0 ? void 0 : _selectedOption4.color) : '#333',
|
|
39379
39412
|
padding: '6px 12px',
|
|
39380
39413
|
fontSize: '14px',
|
|
39381
39414
|
borderRadius: '8px',
|