arengibook 2.4.614 → 2.4.615
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 +13 -57
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39122,8 +39122,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39122
39122
|
setLoadedOptions = _useState4[1];
|
|
39123
39123
|
var _useState5 = useState(''),
|
|
39124
39124
|
_useState6 = _slicedToArray$9(_useState5, 2),
|
|
39125
|
-
inputValue = _useState6[0]
|
|
39126
|
-
|
|
39125
|
+
inputValue = _useState6[0];
|
|
39126
|
+
_useState6[1];
|
|
39127
39127
|
var multiSelectRef = useRef(null);
|
|
39128
39128
|
var _useState7 = useState(false),
|
|
39129
39129
|
_useState8 = _slicedToArray$9(_useState7, 2),
|
|
@@ -39168,49 +39168,6 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39168
39168
|
if (onChange) onChange(e.value);
|
|
39169
39169
|
};
|
|
39170
39170
|
|
|
39171
|
-
// Filtre des options lors de la saisie
|
|
39172
|
-
var handleInputChange = /*#__PURE__*/function () {
|
|
39173
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(e) {
|
|
39174
|
-
var search, result, _result$options, _result, filteredOptions;
|
|
39175
|
-
return _regenerator().w(function (_context2) {
|
|
39176
|
-
while (1) switch (_context2.n) {
|
|
39177
|
-
case 0:
|
|
39178
|
-
search = e.target.value;
|
|
39179
|
-
setInputValue(search);
|
|
39180
|
-
if (search) {
|
|
39181
|
-
_context2.n = 2;
|
|
39182
|
-
break;
|
|
39183
|
-
}
|
|
39184
|
-
_context2.n = 1;
|
|
39185
|
-
return options('', [], {
|
|
39186
|
-
page: 1
|
|
39187
|
-
});
|
|
39188
|
-
case 1:
|
|
39189
|
-
result = _context2.v;
|
|
39190
|
-
setLoadedOptions((result === null || result === void 0 ? void 0 : result.options) || []);
|
|
39191
|
-
_context2.n = 4;
|
|
39192
|
-
break;
|
|
39193
|
-
case 2:
|
|
39194
|
-
_context2.n = 3;
|
|
39195
|
-
return options(search, [], {
|
|
39196
|
-
page: 1
|
|
39197
|
-
});
|
|
39198
|
-
case 3:
|
|
39199
|
-
_result = _context2.v;
|
|
39200
|
-
filteredOptions = (_result === null || _result === void 0 || (_result$options = _result.options) === null || _result$options === void 0 ? void 0 : _result$options.filter(function (opt) {
|
|
39201
|
-
return opt[optionLabel].toLowerCase().includes(search.toLowerCase());
|
|
39202
|
-
})) || [];
|
|
39203
|
-
setLoadedOptions(filteredOptions);
|
|
39204
|
-
case 4:
|
|
39205
|
-
return _context2.a(2);
|
|
39206
|
-
}
|
|
39207
|
-
}, _callee2);
|
|
39208
|
-
}));
|
|
39209
|
-
return function handleInputChange(_x) {
|
|
39210
|
-
return _ref3.apply(this, arguments);
|
|
39211
|
-
};
|
|
39212
|
-
}();
|
|
39213
|
-
|
|
39214
39171
|
// Inversion de couleur pour le texte des badges
|
|
39215
39172
|
var inverseColor = function inverseColor(hexColor) {
|
|
39216
39173
|
var r = parseInt(hexColor.substr(1, 2), 16);
|
|
@@ -39225,9 +39182,9 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39225
39182
|
};
|
|
39226
39183
|
var optionTemplate = function optionTemplate(option) {
|
|
39227
39184
|
if (!option) return null;
|
|
39228
|
-
var
|
|
39229
|
-
|
|
39230
|
-
var generalIcon =
|
|
39185
|
+
var _ref3 = selectMetaConfig || {};
|
|
39186
|
+
_ref3.labelStyle;
|
|
39187
|
+
var generalIcon = _ref3.generalIcon;
|
|
39231
39188
|
var styleLabel = {
|
|
39232
39189
|
marginLeft: '10px'
|
|
39233
39190
|
};
|
|
@@ -39291,19 +39248,19 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39291
39248
|
if (loadLazyTimeout.current) {
|
|
39292
39249
|
clearTimeout(loadLazyTimeout.current);
|
|
39293
39250
|
}
|
|
39294
|
-
loadLazyTimeout.current = setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
39251
|
+
loadLazyTimeout.current = setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
39295
39252
|
var first, last, _items, result, newOptions, i, virtualscroll;
|
|
39296
|
-
return _regenerator().w(function (
|
|
39297
|
-
while (1) switch (
|
|
39253
|
+
return _regenerator().w(function (_context2) {
|
|
39254
|
+
while (1) switch (_context2.n) {
|
|
39298
39255
|
case 0:
|
|
39299
39256
|
first = event.first, last = event.last;
|
|
39300
39257
|
_items = _toConsumableArray$7(loadedOptions);
|
|
39301
|
-
|
|
39258
|
+
_context2.n = 1;
|
|
39302
39259
|
return options(inputValue, [], {
|
|
39303
39260
|
page: currentPageRef.current + 1
|
|
39304
39261
|
});
|
|
39305
39262
|
case 1:
|
|
39306
|
-
result =
|
|
39263
|
+
result = _context2.v;
|
|
39307
39264
|
newOptions = (result === null || result === void 0 ? void 0 : result.options) || [];
|
|
39308
39265
|
for (i = first; i < last; i++) {
|
|
39309
39266
|
if (!_items[i] && newOptions[i - first]) {
|
|
@@ -39320,9 +39277,9 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39320
39277
|
virtualscroll.style.height = "auto";
|
|
39321
39278
|
}
|
|
39322
39279
|
case 2:
|
|
39323
|
-
return
|
|
39280
|
+
return _context2.a(2);
|
|
39324
39281
|
}
|
|
39325
|
-
},
|
|
39282
|
+
}, _callee2);
|
|
39326
39283
|
})), 500);
|
|
39327
39284
|
};
|
|
39328
39285
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -39338,13 +39295,12 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39338
39295
|
style: style,
|
|
39339
39296
|
showSelectAll: showSelectAll,
|
|
39340
39297
|
disabled: disabled,
|
|
39341
|
-
filter:
|
|
39298
|
+
filter: true,
|
|
39342
39299
|
placeholder: placeholder,
|
|
39343
39300
|
optionLabel: optionLabel,
|
|
39344
39301
|
optionValue: optionValue,
|
|
39345
39302
|
showClear: showClear,
|
|
39346
39303
|
value: selectedOptions,
|
|
39347
|
-
onFilterChange: handleInputChange,
|
|
39348
39304
|
itemTemplate: optionTemplate,
|
|
39349
39305
|
selectedItemTemplate: selectedItemTemplate,
|
|
39350
39306
|
className: "w-full md:w-14rem",
|