arengibook 1.2.315-main → 1.2.317-main
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 +25 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41151,10 +41151,11 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41151
41151
|
responseJSON = _context.v;
|
|
41152
41152
|
dataAjax = responseJSON.data || [];
|
|
41153
41153
|
mappedOptions = dataAjax.map(function (opt) {
|
|
41154
|
-
if (
|
|
41155
|
-
opt.color =
|
|
41154
|
+
if (opt.hasOwnProperty('color') && opt.color !== null && opt.color.length > 0) {
|
|
41155
|
+
opt.color = opt.color.toLowerCase();
|
|
41156
|
+
} else {
|
|
41157
|
+
delete opt.color;
|
|
41156
41158
|
}
|
|
41157
|
-
opt.color = opt.color.toLowerCase();
|
|
41158
41159
|
opt.label = opt.nom !== undefined && opt.nom !== null ? opt.nom : opt.label;
|
|
41159
41160
|
opt.value = opt.id;
|
|
41160
41161
|
return opt;
|
|
@@ -41303,12 +41304,24 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41303
41304
|
});
|
|
41304
41305
|
}, [loadedOptions, enableItemTooltip]);
|
|
41305
41306
|
var onLazyLoad = function onLazyLoad(event) {
|
|
41306
|
-
if (isOptionsArray
|
|
41307
|
+
if (isOptionsArray) return;
|
|
41307
41308
|
|
|
41308
|
-
//
|
|
41309
|
-
|
|
41310
|
-
isLoadingRef.current = true;
|
|
41309
|
+
// Toujours acquitter le scroll pour que VirtualScroller puisse réinitialiser
|
|
41310
|
+
// son loadingState interne (il attend un changement de props.loading)
|
|
41311
41311
|
setLoading(true);
|
|
41312
|
+
|
|
41313
|
+
// Items déjà chargés (scroll vers le haut ou re-fire) — reset immédiat
|
|
41314
|
+
// On utilise -1 pour déclencher le chargement quand on atteint le dernier item chargé
|
|
41315
|
+
if (event.last < loadedOptionsRef.current.length - 1 || !hasMoreRef.current) {
|
|
41316
|
+
setTimeout(function () {
|
|
41317
|
+
return setLoading(false);
|
|
41318
|
+
}, 0);
|
|
41319
|
+
return;
|
|
41320
|
+
}
|
|
41321
|
+
|
|
41322
|
+
// Déjà en cours de chargement — le timeout existant s'en chargera
|
|
41323
|
+
if (isLoadingRef.current) return;
|
|
41324
|
+
isLoadingRef.current = true;
|
|
41312
41325
|
if (loadLazyTimeout.current) clearTimeout(loadLazyTimeout.current);
|
|
41313
41326
|
loadLazyTimeout.current = setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
41314
41327
|
var _result4, _result5;
|
|
@@ -41639,7 +41652,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41639
41652
|
return null;
|
|
41640
41653
|
}
|
|
41641
41654
|
if (isSelectMeta) {
|
|
41642
|
-
var _selectedOption2
|
|
41655
|
+
var _selectedOption2;
|
|
41643
41656
|
var _key = String(getKey(paramValue));
|
|
41644
41657
|
var _selectedOption = flatOptions.find(function (o) {
|
|
41645
41658
|
return String(o[optionValue]) === _key;
|
|
@@ -41662,9 +41675,10 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41662
41675
|
};
|
|
41663
41676
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
41664
41677
|
onClick: effectiveReadOnly ? undefined : _handleRemove,
|
|
41665
|
-
style: _objectSpread2({
|
|
41666
|
-
backgroundColor:
|
|
41667
|
-
color:
|
|
41678
|
+
style: _objectSpread2(_objectSpread2({}, (_selectedOption2 = _selectedOption) !== null && _selectedOption2 !== void 0 && _selectedOption2.color ? {
|
|
41679
|
+
backgroundColor: _selectedOption.color,
|
|
41680
|
+
color: inverseColor(_selectedOption.color)
|
|
41681
|
+
} : {}), {}, {
|
|
41668
41682
|
padding: '6px 12px',
|
|
41669
41683
|
fontSize: '14px',
|
|
41670
41684
|
borderRadius: '8px',
|