arengibook 1.2.315-main → 1.2.316-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 +24 -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,23 @@ 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
|
+
if (event.last <= loadedOptionsRef.current.length || !hasMoreRef.current) {
|
|
41315
|
+
setTimeout(function () {
|
|
41316
|
+
return setLoading(false);
|
|
41317
|
+
}, 0);
|
|
41318
|
+
return;
|
|
41319
|
+
}
|
|
41320
|
+
|
|
41321
|
+
// Déjà en cours de chargement — le timeout existant s'en chargera
|
|
41322
|
+
if (isLoadingRef.current) return;
|
|
41323
|
+
isLoadingRef.current = true;
|
|
41312
41324
|
if (loadLazyTimeout.current) clearTimeout(loadLazyTimeout.current);
|
|
41313
41325
|
loadLazyTimeout.current = setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
41314
41326
|
var _result4, _result5;
|
|
@@ -41639,7 +41651,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41639
41651
|
return null;
|
|
41640
41652
|
}
|
|
41641
41653
|
if (isSelectMeta) {
|
|
41642
|
-
var _selectedOption2
|
|
41654
|
+
var _selectedOption2;
|
|
41643
41655
|
var _key = String(getKey(paramValue));
|
|
41644
41656
|
var _selectedOption = flatOptions.find(function (o) {
|
|
41645
41657
|
return String(o[optionValue]) === _key;
|
|
@@ -41662,9 +41674,10 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41662
41674
|
};
|
|
41663
41675
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
41664
41676
|
onClick: effectiveReadOnly ? undefined : _handleRemove,
|
|
41665
|
-
style: _objectSpread2({
|
|
41666
|
-
backgroundColor:
|
|
41667
|
-
color:
|
|
41677
|
+
style: _objectSpread2(_objectSpread2({}, (_selectedOption2 = _selectedOption) !== null && _selectedOption2 !== void 0 && _selectedOption2.color ? {
|
|
41678
|
+
backgroundColor: _selectedOption.color,
|
|
41679
|
+
color: inverseColor(_selectedOption.color)
|
|
41680
|
+
} : {}), {}, {
|
|
41668
41681
|
padding: '6px 12px',
|
|
41669
41682
|
fontSize: '14px',
|
|
41670
41683
|
borderRadius: '8px',
|