arengibook 2.4.617 → 2.4.619

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 +29 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39131,30 +39131,35 @@ 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);
39134
39135
  useEffect(function () {
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();
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
+ }
39158
39163
  }, [options]);
39159
39164
 
39160
39165
  // Gestion du changement de sélection
@@ -39238,6 +39243,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39238
39243
 
39239
39244
  // Fonction de lazy loading
39240
39245
  var onLazyLoad = function onLazyLoad(event) {
39246
+ if (isOptionsArray) return;
39241
39247
  setLoading(true);
39242
39248
  if (loadLazyTimeout.current) {
39243
39249
  clearTimeout(loadLazyTimeout.current);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.4.617",
4
+ "version": "2.4.619",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {