arengibook 2.4.614 → 2.4.617

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 +36 -86
  2. 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
- setInputValue = _useState6[1];
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),
@@ -39131,35 +39131,30 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39131
39131
  setLoading = _useState8[1];
39132
39132
  var loadLazyTimeout = useRef();
39133
39133
  var currentPageRef = useRef(1);
39134
- var isOptionsArray = Array.isArray(options);
39135
39134
  useEffect(function () {
39136
- if (isOptionsArray) {
39137
- setLoadedOptions(options);
39138
- } else {
39139
- var loadInitialOptions = /*#__PURE__*/function () {
39140
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
39141
- var result;
39142
- return _regenerator().w(function (_context) {
39143
- while (1) switch (_context.n) {
39144
- case 0:
39145
- _context.n = 1;
39146
- return options('', [], {
39147
- page: 1
39148
- });
39149
- case 1:
39150
- result = _context.v;
39151
- setLoadedOptions((result === null || result === void 0 ? void 0 : result.options) || []);
39152
- case 2:
39153
- return _context.a(2);
39154
- }
39155
- }, _callee);
39156
- }));
39157
- return function loadInitialOptions() {
39158
- return _ref2.apply(this, arguments);
39159
- };
39160
- }();
39161
- loadInitialOptions();
39162
- }
39135
+ var loadInitialOptions = /*#__PURE__*/function () {
39136
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
39137
+ var result;
39138
+ return _regenerator().w(function (_context) {
39139
+ while (1) switch (_context.n) {
39140
+ case 0:
39141
+ _context.n = 1;
39142
+ return options('', [], {
39143
+ page: 1
39144
+ });
39145
+ case 1:
39146
+ result = _context.v;
39147
+ setLoadedOptions((result === null || result === void 0 ? void 0 : result.options) || []);
39148
+ case 2:
39149
+ return _context.a(2);
39150
+ }
39151
+ }, _callee);
39152
+ }));
39153
+ return function loadInitialOptions() {
39154
+ return _ref2.apply(this, arguments);
39155
+ };
39156
+ }();
39157
+ loadInitialOptions();
39163
39158
  }, [options]);
39164
39159
 
39165
39160
  // Gestion du changement de sélection
@@ -39168,49 +39163,6 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39168
39163
  if (onChange) onChange(e.value);
39169
39164
  };
39170
39165
 
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
39166
  // Inversion de couleur pour le texte des badges
39215
39167
  var inverseColor = function inverseColor(hexColor) {
39216
39168
  var r = parseInt(hexColor.substr(1, 2), 16);
@@ -39225,9 +39177,9 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39225
39177
  };
39226
39178
  var optionTemplate = function optionTemplate(option) {
39227
39179
  if (!option) return null;
39228
- var _ref4 = selectMetaConfig || {};
39229
- _ref4.labelStyle;
39230
- var generalIcon = _ref4.generalIcon;
39180
+ var _ref3 = selectMetaConfig || {};
39181
+ _ref3.labelStyle;
39182
+ var generalIcon = _ref3.generalIcon;
39231
39183
  var styleLabel = {
39232
39184
  marginLeft: '10px'
39233
39185
  };
@@ -39286,24 +39238,23 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39286
39238
 
39287
39239
  // Fonction de lazy loading
39288
39240
  var onLazyLoad = function onLazyLoad(event) {
39289
- if (isOptionsArray) return;
39290
39241
  setLoading(true);
39291
39242
  if (loadLazyTimeout.current) {
39292
39243
  clearTimeout(loadLazyTimeout.current);
39293
39244
  }
39294
- loadLazyTimeout.current = setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
39245
+ loadLazyTimeout.current = setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
39295
39246
  var first, last, _items, result, newOptions, i, virtualscroll;
39296
- return _regenerator().w(function (_context3) {
39297
- while (1) switch (_context3.n) {
39247
+ return _regenerator().w(function (_context2) {
39248
+ while (1) switch (_context2.n) {
39298
39249
  case 0:
39299
39250
  first = event.first, last = event.last;
39300
39251
  _items = _toConsumableArray$7(loadedOptions);
39301
- _context3.n = 1;
39252
+ _context2.n = 1;
39302
39253
  return options(inputValue, [], {
39303
39254
  page: currentPageRef.current + 1
39304
39255
  });
39305
39256
  case 1:
39306
- result = _context3.v;
39257
+ result = _context2.v;
39307
39258
  newOptions = (result === null || result === void 0 ? void 0 : result.options) || [];
39308
39259
  for (i = first; i < last; i++) {
39309
39260
  if (!_items[i] && newOptions[i - first]) {
@@ -39320,9 +39271,9 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39320
39271
  virtualscroll.style.height = "auto";
39321
39272
  }
39322
39273
  case 2:
39323
- return _context3.a(2);
39274
+ return _context2.a(2);
39324
39275
  }
39325
- }, _callee3);
39276
+ }, _callee2);
39326
39277
  })), 500);
39327
39278
  };
39328
39279
  return /*#__PURE__*/React__default.createElement("div", {
@@ -39338,13 +39289,12 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39338
39289
  style: style,
39339
39290
  showSelectAll: showSelectAll,
39340
39291
  disabled: disabled,
39341
- filter: filter,
39292
+ filter: true,
39342
39293
  placeholder: placeholder,
39343
39294
  optionLabel: optionLabel,
39344
39295
  optionValue: optionValue,
39345
39296
  showClear: showClear,
39346
39297
  value: selectedOptions,
39347
- onFilterChange: handleInputChange,
39348
39298
  itemTemplate: optionTemplate,
39349
39299
  selectedItemTemplate: selectedItemTemplate,
39350
39300
  className: "w-full md:w-14rem",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.4.614",
4
+ "version": "2.4.617",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {