arengibook 2.4.631 → 2.4.632
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 +177 -260
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36820,12 +36820,12 @@ var DropdownPresets = {
|
|
|
36820
36820
|
}
|
|
36821
36821
|
};
|
|
36822
36822
|
|
|
36823
|
-
var simulateNetworkDelay
|
|
36823
|
+
var simulateNetworkDelay = function simulateNetworkDelay() {
|
|
36824
36824
|
return new Promise(function (res) {
|
|
36825
36825
|
return setTimeout(res, 400);
|
|
36826
36826
|
});
|
|
36827
36827
|
};
|
|
36828
|
-
var createFakeOptions
|
|
36828
|
+
var createFakeOptions = function createFakeOptions(start, length) {
|
|
36829
36829
|
var options = [];
|
|
36830
36830
|
for (var i = start; i < start + length; i++) {
|
|
36831
36831
|
options.push({
|
|
@@ -36854,9 +36854,9 @@ var DropdownSelectMetaAsyncPresets = {
|
|
|
36854
36854
|
search = _args.length > 0 && _args[0] !== undefined ? _args[0] : '';
|
|
36855
36855
|
_ref = _args.length > 2 ? _args[2] : undefined, page = _ref.page;
|
|
36856
36856
|
_context.n = 1;
|
|
36857
|
-
return simulateNetworkDelay
|
|
36857
|
+
return simulateNetworkDelay();
|
|
36858
36858
|
case 1:
|
|
36859
|
-
allOptions = createFakeOptions
|
|
36859
|
+
allOptions = createFakeOptions(0, 100);
|
|
36860
36860
|
filtered = allOptions.filter(function (opt) {
|
|
36861
36861
|
return opt.label.toLowerCase().includes(search.toLowerCase());
|
|
36862
36862
|
});
|
|
@@ -39091,7 +39091,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39091
39091
|
_ref$valueStyle = _ref.valueStyle,
|
|
39092
39092
|
valueStyle = _ref$valueStyle === void 0 ? {} : _ref$valueStyle,
|
|
39093
39093
|
_ref$filter = _ref.filter,
|
|
39094
|
-
filter = _ref$filter === void 0 ?
|
|
39094
|
+
filter = _ref$filter === void 0 ? true : _ref$filter,
|
|
39095
39095
|
_ref$invalid = _ref.invalid,
|
|
39096
39096
|
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
39097
39097
|
_ref$errorMessage = _ref.errorMessage,
|
|
@@ -39110,7 +39110,9 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39110
39110
|
_ref$showSelectAll = _ref.showSelectAll,
|
|
39111
39111
|
showSelectAll = _ref$showSelectAll === void 0 ? true : _ref$showSelectAll;
|
|
39112
39112
|
// const [selectedOptions, setSelectedOptions] = useState(value ?? []);
|
|
39113
|
-
var _useState = useState(
|
|
39113
|
+
var _useState = useState(objValue ? _toConsumableArray$7(objValue.map(function (opt) {
|
|
39114
|
+
return opt[optionValue];
|
|
39115
|
+
})) : value !== null && value !== void 0 ? value : []),
|
|
39114
39116
|
_useState2 = _slicedToArray$9(_useState, 2),
|
|
39115
39117
|
selectedOptions = _useState2[0],
|
|
39116
39118
|
setSelectedOptions = _useState2[1];
|
|
@@ -39119,8 +39121,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39119
39121
|
loadedOptions = _useState4[0],
|
|
39120
39122
|
setLoadedOptions = _useState4[1];
|
|
39121
39123
|
var _useState5 = useState(''),
|
|
39122
|
-
_useState6 = _slicedToArray$9(_useState5, 2)
|
|
39123
|
-
_useState6[0];
|
|
39124
|
+
_useState6 = _slicedToArray$9(_useState5, 2),
|
|
39125
|
+
inputValue = _useState6[0];
|
|
39124
39126
|
_useState6[1];
|
|
39125
39127
|
var multiSelectRef = useRef(null);
|
|
39126
39128
|
var _useState7 = useState(false),
|
|
@@ -39128,36 +39130,15 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39128
39130
|
loading = _useState8[0],
|
|
39129
39131
|
setLoading = _useState8[1];
|
|
39130
39132
|
var loadLazyTimeout = useRef();
|
|
39131
|
-
useRef(1);
|
|
39133
|
+
var currentPageRef = useRef(1);
|
|
39132
39134
|
var isOptionsArray = Array.isArray(options);
|
|
39133
|
-
console.log(isOptionsArray);
|
|
39134
|
-
var numObjValue = objValue.map(function (opt) {
|
|
39135
|
-
return _objectSpread2(_objectSpread2({}, opt), {}, _defineProperty$b({}, optionValue, typeof opt[optionValue] === 'string' ? parseInt(opt[optionValue], 10) : opt[optionValue]));
|
|
39136
|
-
});
|
|
39137
|
-
var numValue = function numValue() {
|
|
39138
|
-
if (value && Array.isArray(value) && value.length) {
|
|
39139
|
-
return value;
|
|
39140
|
-
} else if (objValue && Array.isArray(objValue) && objValue.length) {
|
|
39141
|
-
return objValue.map(function (opt) {
|
|
39142
|
-
return parseInt(opt.value);
|
|
39143
|
-
});
|
|
39144
|
-
} else {
|
|
39145
|
-
return [];
|
|
39146
|
-
}
|
|
39147
|
-
};
|
|
39148
|
-
useEffect(function () {
|
|
39149
|
-
var _numValue;
|
|
39150
|
-
setSelectedOptions(objValue ? _toConsumableArray$7(numObjValue.map(function (opt) {
|
|
39151
|
-
return opt[optionValue];
|
|
39152
|
-
})) : (_numValue = numValue()) !== null && _numValue !== void 0 ? _numValue : []);
|
|
39153
|
-
}, []);
|
|
39154
39135
|
useEffect(function () {
|
|
39155
39136
|
if (isOptionsArray) {
|
|
39156
39137
|
setLoadedOptions(options);
|
|
39157
39138
|
} else {
|
|
39158
39139
|
var loadInitialOptions = /*#__PURE__*/function () {
|
|
39159
39140
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
39160
|
-
var result
|
|
39141
|
+
var result;
|
|
39161
39142
|
return _regenerator().w(function (_context) {
|
|
39162
39143
|
while (1) switch (_context.n) {
|
|
39163
39144
|
case 0:
|
|
@@ -39168,16 +39149,6 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39168
39149
|
case 1:
|
|
39169
39150
|
result = _context.v;
|
|
39170
39151
|
setLoadedOptions((result === null || result === void 0 ? void 0 : result.options) || []);
|
|
39171
|
-
if (numObjValue) {
|
|
39172
|
-
exists = result === null || result === void 0 || (_result$options = result.options) === null || _result$options === void 0 ? void 0 : _result$options.some(function (opt) {
|
|
39173
|
-
return opt[optionValue] === numObjValue[optionValue];
|
|
39174
|
-
});
|
|
39175
|
-
if (!exists) {
|
|
39176
|
-
setLoadedOptions(function (prev) {
|
|
39177
|
-
return [].concat(_toConsumableArray$7(prev), [numObjValue]);
|
|
39178
|
-
});
|
|
39179
|
-
}
|
|
39180
|
-
}
|
|
39181
39152
|
case 2:
|
|
39182
39153
|
return _context.a(2);
|
|
39183
39154
|
}
|
|
@@ -39286,64 +39257,45 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39286
39257
|
};
|
|
39287
39258
|
|
|
39288
39259
|
// Fonction de lazy loading
|
|
39289
|
-
// const onLazyLoad = (event) => {
|
|
39290
|
-
// if (isOptionsArray) return;
|
|
39291
|
-
// setLoading(true);
|
|
39292
|
-
// if (loadLazyTimeout.current) {
|
|
39293
|
-
// clearTimeout(loadLazyTimeout.current);
|
|
39294
|
-
// }
|
|
39295
|
-
// loadLazyTimeout.current = setTimeout(async () => {
|
|
39296
|
-
// const { first, last } = event;
|
|
39297
|
-
// const _items = [...loadedOptions];
|
|
39298
|
-
// const result = await options(inputValue, [], { page: currentPageRef.current + 1 });
|
|
39299
|
-
// const newOptions = result?.options || [];
|
|
39300
|
-
// for (let i = first; i < last; i++) {
|
|
39301
|
-
// if (!_items[i] && newOptions[i - first]) {
|
|
39302
|
-
// _items[i] = newOptions[i - first];
|
|
39303
|
-
// }
|
|
39304
|
-
// }
|
|
39305
|
-
// setLoadedOptions(_items);
|
|
39306
|
-
// setLoading(false);
|
|
39307
|
-
// currentPageRef.current += 1;
|
|
39308
|
-
//
|
|
39309
|
-
// // redimensionnement du conteneur
|
|
39310
|
-
// let virtualscroll = document.querySelector('.p-virtualscroller.p-dropdown-items-wrapper');
|
|
39311
|
-
// if (virtualscroll) {
|
|
39312
|
-
// virtualscroll.style.height = "auto";
|
|
39313
|
-
// }
|
|
39314
|
-
// }, 500);
|
|
39315
|
-
// };
|
|
39316
39260
|
var onLazyLoad = function onLazyLoad(event) {
|
|
39261
|
+
if (isOptionsArray) return;
|
|
39317
39262
|
setLoading(true);
|
|
39318
39263
|
if (loadLazyTimeout.current) {
|
|
39319
39264
|
clearTimeout(loadLazyTimeout.current);
|
|
39320
39265
|
}
|
|
39321
|
-
loadLazyTimeout.current = setTimeout(function () {
|
|
39322
|
-
var first
|
|
39323
|
-
|
|
39324
|
-
|
|
39325
|
-
|
|
39326
|
-
|
|
39327
|
-
|
|
39328
|
-
|
|
39329
|
-
|
|
39330
|
-
|
|
39331
|
-
|
|
39332
|
-
|
|
39333
|
-
|
|
39334
|
-
|
|
39335
|
-
|
|
39336
|
-
|
|
39337
|
-
|
|
39338
|
-
|
|
39339
|
-
|
|
39340
|
-
|
|
39341
|
-
|
|
39342
|
-
|
|
39343
|
-
|
|
39266
|
+
loadLazyTimeout.current = setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
39267
|
+
var first, last, _items, result, newOptions, i, virtualscroll;
|
|
39268
|
+
return _regenerator().w(function (_context2) {
|
|
39269
|
+
while (1) switch (_context2.n) {
|
|
39270
|
+
case 0:
|
|
39271
|
+
first = event.first, last = event.last;
|
|
39272
|
+
_items = _toConsumableArray$7(loadedOptions);
|
|
39273
|
+
_context2.n = 1;
|
|
39274
|
+
return options(inputValue, [], {
|
|
39275
|
+
page: currentPageRef.current + 1
|
|
39276
|
+
});
|
|
39277
|
+
case 1:
|
|
39278
|
+
result = _context2.v;
|
|
39279
|
+
newOptions = (result === null || result === void 0 ? void 0 : result.options) || [];
|
|
39280
|
+
for (i = first; i < last; i++) {
|
|
39281
|
+
if (!_items[i] && newOptions[i - first]) {
|
|
39282
|
+
_items[i] = newOptions[i - first];
|
|
39283
|
+
}
|
|
39284
|
+
}
|
|
39285
|
+
setLoadedOptions(_items);
|
|
39286
|
+
setLoading(false);
|
|
39287
|
+
currentPageRef.current += 1;
|
|
39288
|
+
|
|
39289
|
+
// redimensionnement du conteneur
|
|
39290
|
+
virtualscroll = document.querySelector('.p-virtualscroller.p-dropdown-items-wrapper');
|
|
39291
|
+
if (virtualscroll) {
|
|
39292
|
+
virtualscroll.style.height = "auto";
|
|
39293
|
+
}
|
|
39294
|
+
case 2:
|
|
39295
|
+
return _context2.a(2);
|
|
39344
39296
|
}
|
|
39345
|
-
}
|
|
39346
|
-
},
|
|
39297
|
+
}, _callee2);
|
|
39298
|
+
})), 500);
|
|
39347
39299
|
};
|
|
39348
39300
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
39349
39301
|
ref: multiSelectRef,
|
|
@@ -39357,7 +39309,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
39357
39309
|
style: style,
|
|
39358
39310
|
showSelectAll: showSelectAll,
|
|
39359
39311
|
disabled: disabled,
|
|
39360
|
-
filter:
|
|
39312
|
+
filter: true,
|
|
39361
39313
|
placeholder: placeholder,
|
|
39362
39314
|
optionLabel: optionLabel,
|
|
39363
39315
|
optionValue: optionValue,
|
|
@@ -39704,11 +39656,6 @@ var MultiSelect = function MultiSelect(props) {
|
|
|
39704
39656
|
}, errorMessage || 'Sélection invalide')));
|
|
39705
39657
|
};
|
|
39706
39658
|
|
|
39707
|
-
var simulateNetworkDelay$1 = function simulateNetworkDelay() {
|
|
39708
|
-
return new Promise(function (res) {
|
|
39709
|
-
return setTimeout(res, 400);
|
|
39710
|
-
});
|
|
39711
|
-
};
|
|
39712
39659
|
var optionsExample = [{
|
|
39713
39660
|
label: 'New York',
|
|
39714
39661
|
value: 'NY'
|
|
@@ -39795,17 +39742,68 @@ var syncOptions$1 = [{
|
|
|
39795
39742
|
value: '5',
|
|
39796
39743
|
color: '#ec4899'
|
|
39797
39744
|
}];
|
|
39798
|
-
var
|
|
39799
|
-
var
|
|
39800
|
-
|
|
39801
|
-
|
|
39802
|
-
|
|
39803
|
-
|
|
39804
|
-
|
|
39805
|
-
|
|
39806
|
-
|
|
39807
|
-
|
|
39808
|
-
|
|
39745
|
+
var asyncOptions$1 = /*#__PURE__*/function () {
|
|
39746
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(search, _, _ref) {
|
|
39747
|
+
var page, mockOptions, startIndex, paginatedOptions;
|
|
39748
|
+
return _regenerator().w(function (_context) {
|
|
39749
|
+
while (1) switch (_context.n) {
|
|
39750
|
+
case 0:
|
|
39751
|
+
page = _ref.page;
|
|
39752
|
+
mockOptions = [{
|
|
39753
|
+
label: 'Option 1',
|
|
39754
|
+
value: '1',
|
|
39755
|
+
color: '#ff9900'
|
|
39756
|
+
}, {
|
|
39757
|
+
label: 'Option 2',
|
|
39758
|
+
value: '2',
|
|
39759
|
+
color: '#3b82f6'
|
|
39760
|
+
}, {
|
|
39761
|
+
label: 'Option 3',
|
|
39762
|
+
value: '3',
|
|
39763
|
+
color: '#10b981'
|
|
39764
|
+
}, {
|
|
39765
|
+
label: 'Option 4',
|
|
39766
|
+
value: '4',
|
|
39767
|
+
color: '#8b5cf6'
|
|
39768
|
+
}, {
|
|
39769
|
+
label: 'Option 5',
|
|
39770
|
+
value: '5',
|
|
39771
|
+
color: '#ec4899'
|
|
39772
|
+
}, {
|
|
39773
|
+
label: 'Option 6',
|
|
39774
|
+
value: '6',
|
|
39775
|
+
color: '#f59e0b'
|
|
39776
|
+
}, {
|
|
39777
|
+
label: 'Option 7',
|
|
39778
|
+
value: '7',
|
|
39779
|
+
color: '#ef4444'
|
|
39780
|
+
}, {
|
|
39781
|
+
label: 'Option 8',
|
|
39782
|
+
value: '8',
|
|
39783
|
+
color: '#10b981'
|
|
39784
|
+
}, {
|
|
39785
|
+
label: 'Option 9',
|
|
39786
|
+
value: '9',
|
|
39787
|
+
color: '#3b82f6'
|
|
39788
|
+
}, {
|
|
39789
|
+
label: 'Option 10',
|
|
39790
|
+
value: '10',
|
|
39791
|
+
color: '#8b5cf6'
|
|
39792
|
+
}]; // Simulation de pagination
|
|
39793
|
+
startIndex = (page - 1) * 5;
|
|
39794
|
+
paginatedOptions = mockOptions.slice(startIndex, startIndex + 5);
|
|
39795
|
+
return _context.a(2, {
|
|
39796
|
+
options: search ? mockOptions.filter(function (opt) {
|
|
39797
|
+
return opt.label.toLowerCase().includes(search.toLowerCase());
|
|
39798
|
+
}) : paginatedOptions
|
|
39799
|
+
});
|
|
39800
|
+
}
|
|
39801
|
+
}, _callee);
|
|
39802
|
+
}));
|
|
39803
|
+
return function asyncOptions(_x, _x2, _x3) {
|
|
39804
|
+
return _ref2.apply(this, arguments);
|
|
39805
|
+
};
|
|
39806
|
+
}();
|
|
39809
39807
|
var MultiSelectPresets = {
|
|
39810
39808
|
Default: {
|
|
39811
39809
|
placeholder: 'Sélectionnez des options',
|
|
@@ -39890,78 +39888,17 @@ var MultiSelectPresets = {
|
|
|
39890
39888
|
// Configuration pour les options asynchrones
|
|
39891
39889
|
SelectMetaAsync: {
|
|
39892
39890
|
isSelectMeta: true,
|
|
39891
|
+
// value: ['3', '4', '5'],
|
|
39893
39892
|
objValue: [{
|
|
39894
|
-
label: 'Option
|
|
39895
|
-
value:
|
|
39893
|
+
label: 'Option 2',
|
|
39894
|
+
value: '2',
|
|
39896
39895
|
color: '#ff9900'
|
|
39897
39896
|
}, {
|
|
39898
39897
|
label: 'Option 4',
|
|
39899
|
-
value: 4,
|
|
39898
|
+
value: '4',
|
|
39900
39899
|
color: 'black'
|
|
39901
39900
|
}],
|
|
39902
|
-
|
|
39903
|
-
// {
|
|
39904
|
-
// "id": 2299,
|
|
39905
|
-
// "nom": "Economique",
|
|
39906
|
-
// "color": "#62BAC0",
|
|
39907
|
-
// "label": "Economique",
|
|
39908
|
-
// "value": 2299
|
|
39909
|
-
// },
|
|
39910
|
-
// {
|
|
39911
|
-
// "id": 2300,
|
|
39912
|
-
// "nom": "Financière",
|
|
39913
|
-
// "color": "#40839E",
|
|
39914
|
-
// "label": "Financière",
|
|
39915
|
-
// "value": 2300
|
|
39916
|
-
// },
|
|
39917
|
-
// {
|
|
39918
|
-
// "id": 2301,
|
|
39919
|
-
// "nom": "Données bancaires",
|
|
39920
|
-
// "color": "#E5E798",
|
|
39921
|
-
// "label": "Données bancaires",
|
|
39922
|
-
// "value": 2301
|
|
39923
|
-
// }
|
|
39924
|
-
// ],
|
|
39925
|
-
// value: ['3', '4'],
|
|
39926
|
-
options: function () {
|
|
39927
|
-
var _options = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
39928
|
-
var search,
|
|
39929
|
-
_ref3,
|
|
39930
|
-
page,
|
|
39931
|
-
allOptions,
|
|
39932
|
-
filtered,
|
|
39933
|
-
pageSize,
|
|
39934
|
-
start,
|
|
39935
|
-
_args2 = arguments;
|
|
39936
|
-
return _regenerator().w(function (_context2) {
|
|
39937
|
-
while (1) switch (_context2.n) {
|
|
39938
|
-
case 0:
|
|
39939
|
-
search = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : '';
|
|
39940
|
-
_ref3 = _args2.length > 2 ? _args2[2] : undefined, page = _ref3.page;
|
|
39941
|
-
_context2.n = 1;
|
|
39942
|
-
return simulateNetworkDelay$1();
|
|
39943
|
-
case 1:
|
|
39944
|
-
allOptions = createFakeOptions$1(0, 100);
|
|
39945
|
-
filtered = allOptions.filter(function (opt) {
|
|
39946
|
-
return opt.label.toLowerCase().includes(search.toLowerCase());
|
|
39947
|
-
});
|
|
39948
|
-
pageSize = 30;
|
|
39949
|
-
start = (page - 1) * pageSize;
|
|
39950
|
-
return _context2.a(2, {
|
|
39951
|
-
options: filtered.slice(start, start + pageSize),
|
|
39952
|
-
hasMore: start + pageSize < filtered.length,
|
|
39953
|
-
additional: {
|
|
39954
|
-
page: page + 1
|
|
39955
|
-
}
|
|
39956
|
-
});
|
|
39957
|
-
}
|
|
39958
|
-
}, _callee2);
|
|
39959
|
-
}));
|
|
39960
|
-
function options() {
|
|
39961
|
-
return _options.apply(this, arguments);
|
|
39962
|
-
}
|
|
39963
|
-
return options;
|
|
39964
|
-
}(),
|
|
39901
|
+
options: asyncOptions$1,
|
|
39965
39902
|
placeholder: 'Sélectionnez une ou plusieurs options',
|
|
39966
39903
|
optionLabel: 'label',
|
|
39967
39904
|
optionValue: 'value',
|
|
@@ -39982,12 +39919,6 @@ var MultiSelectPresets = {
|
|
|
39982
39919
|
}
|
|
39983
39920
|
};
|
|
39984
39921
|
|
|
39985
|
-
var simulateNetworkDelay = function simulateNetworkDelay() {
|
|
39986
|
-
return new Promise(function (res) {
|
|
39987
|
-
return setTimeout(res, 400);
|
|
39988
|
-
});
|
|
39989
|
-
};
|
|
39990
|
-
|
|
39991
39922
|
// Options synchrones (tableau)
|
|
39992
39923
|
var syncOptions = [{
|
|
39993
39924
|
label: 'Option 1',
|
|
@@ -40012,44 +39943,68 @@ var syncOptions = [{
|
|
|
40012
39943
|
}];
|
|
40013
39944
|
|
|
40014
39945
|
// Fonction pour simuler des options asynchrones
|
|
40015
|
-
|
|
40016
|
-
|
|
40017
|
-
|
|
40018
|
-
|
|
40019
|
-
|
|
40020
|
-
|
|
40021
|
-
|
|
40022
|
-
|
|
40023
|
-
|
|
40024
|
-
|
|
40025
|
-
|
|
40026
|
-
|
|
40027
|
-
|
|
40028
|
-
|
|
40029
|
-
|
|
40030
|
-
|
|
40031
|
-
|
|
40032
|
-
|
|
40033
|
-
|
|
40034
|
-
|
|
40035
|
-
|
|
40036
|
-
|
|
40037
|
-
|
|
40038
|
-
|
|
40039
|
-
|
|
40040
|
-
|
|
40041
|
-
|
|
40042
|
-
|
|
40043
|
-
|
|
40044
|
-
|
|
40045
|
-
|
|
40046
|
-
|
|
40047
|
-
|
|
40048
|
-
|
|
40049
|
-
|
|
40050
|
-
|
|
40051
|
-
|
|
40052
|
-
|
|
39946
|
+
var asyncOptions = /*#__PURE__*/function () {
|
|
39947
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(search, _, _ref) {
|
|
39948
|
+
var page, mockOptions, startIndex, paginatedOptions;
|
|
39949
|
+
return _regenerator().w(function (_context) {
|
|
39950
|
+
while (1) switch (_context.n) {
|
|
39951
|
+
case 0:
|
|
39952
|
+
page = _ref.page;
|
|
39953
|
+
mockOptions = [{
|
|
39954
|
+
label: 'Option 1',
|
|
39955
|
+
value: '1',
|
|
39956
|
+
color: '#ff9900'
|
|
39957
|
+
}, {
|
|
39958
|
+
label: 'Option 2',
|
|
39959
|
+
value: '2',
|
|
39960
|
+
color: '#3b82f6'
|
|
39961
|
+
}, {
|
|
39962
|
+
label: 'Option 3',
|
|
39963
|
+
value: '3',
|
|
39964
|
+
color: '#10b981'
|
|
39965
|
+
}, {
|
|
39966
|
+
label: 'Option 4',
|
|
39967
|
+
value: '4',
|
|
39968
|
+
color: '#8b5cf6'
|
|
39969
|
+
}, {
|
|
39970
|
+
label: 'Option 5',
|
|
39971
|
+
value: '5',
|
|
39972
|
+
color: '#ec4899'
|
|
39973
|
+
}, {
|
|
39974
|
+
label: 'Option 6',
|
|
39975
|
+
value: '6',
|
|
39976
|
+
color: '#f59e0b'
|
|
39977
|
+
}, {
|
|
39978
|
+
label: 'Option 7',
|
|
39979
|
+
value: '7',
|
|
39980
|
+
color: '#ef4444'
|
|
39981
|
+
}, {
|
|
39982
|
+
label: 'Option 8',
|
|
39983
|
+
value: '8',
|
|
39984
|
+
color: '#10b981'
|
|
39985
|
+
}, {
|
|
39986
|
+
label: 'Option 9',
|
|
39987
|
+
value: '9',
|
|
39988
|
+
color: '#3b82f6'
|
|
39989
|
+
}, {
|
|
39990
|
+
label: 'Option 10',
|
|
39991
|
+
value: '10',
|
|
39992
|
+
color: '#8b5cf6'
|
|
39993
|
+
}]; // Simulation de pagination
|
|
39994
|
+
startIndex = (page - 1) * 5;
|
|
39995
|
+
paginatedOptions = mockOptions.slice(startIndex, startIndex + 5);
|
|
39996
|
+
return _context.a(2, {
|
|
39997
|
+
options: search ? mockOptions.filter(function (opt) {
|
|
39998
|
+
return opt.label.toLowerCase().includes(search.toLowerCase());
|
|
39999
|
+
}) : paginatedOptions
|
|
40000
|
+
});
|
|
40001
|
+
}
|
|
40002
|
+
}, _callee);
|
|
40003
|
+
}));
|
|
40004
|
+
return function asyncOptions(_x, _x2, _x3) {
|
|
40005
|
+
return _ref2.apply(this, arguments);
|
|
40006
|
+
};
|
|
40007
|
+
}();
|
|
40053
40008
|
var MultiSelectMetaAsyncPresets = {
|
|
40054
40009
|
// Configuration pour les options synchrones
|
|
40055
40010
|
SyncOptions: {
|
|
@@ -40075,46 +40030,8 @@ var MultiSelectMetaAsyncPresets = {
|
|
|
40075
40030
|
},
|
|
40076
40031
|
// Configuration pour les options asynchrones
|
|
40077
40032
|
AsyncOptions: {
|
|
40078
|
-
value: ['
|
|
40079
|
-
options:
|
|
40080
|
-
var _options = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
40081
|
-
var search,
|
|
40082
|
-
_ref,
|
|
40083
|
-
page,
|
|
40084
|
-
allOptions,
|
|
40085
|
-
filtered,
|
|
40086
|
-
pageSize,
|
|
40087
|
-
start,
|
|
40088
|
-
_args = arguments;
|
|
40089
|
-
return _regenerator().w(function (_context) {
|
|
40090
|
-
while (1) switch (_context.n) {
|
|
40091
|
-
case 0:
|
|
40092
|
-
search = _args.length > 0 && _args[0] !== undefined ? _args[0] : '';
|
|
40093
|
-
_ref = _args.length > 2 ? _args[2] : undefined, page = _ref.page;
|
|
40094
|
-
_context.n = 1;
|
|
40095
|
-
return simulateNetworkDelay();
|
|
40096
|
-
case 1:
|
|
40097
|
-
allOptions = createFakeOptions(0, 100);
|
|
40098
|
-
filtered = allOptions.filter(function (opt) {
|
|
40099
|
-
return opt.label.toLowerCase().includes(search.toLowerCase());
|
|
40100
|
-
});
|
|
40101
|
-
pageSize = 30;
|
|
40102
|
-
start = (page - 1) * pageSize;
|
|
40103
|
-
return _context.a(2, {
|
|
40104
|
-
options: filtered.slice(start, start + pageSize),
|
|
40105
|
-
hasMore: start + pageSize < filtered.length,
|
|
40106
|
-
additional: {
|
|
40107
|
-
page: page + 1
|
|
40108
|
-
}
|
|
40109
|
-
});
|
|
40110
|
-
}
|
|
40111
|
-
}, _callee);
|
|
40112
|
-
}));
|
|
40113
|
-
function options() {
|
|
40114
|
-
return _options.apply(this, arguments);
|
|
40115
|
-
}
|
|
40116
|
-
return options;
|
|
40117
|
-
}(),
|
|
40033
|
+
value: ['1', '2'],
|
|
40034
|
+
options: asyncOptions,
|
|
40118
40035
|
placeholder: 'Sélectionnez une ou plusieurs options',
|
|
40119
40036
|
optionLabel: 'label',
|
|
40120
40037
|
optionValue: 'value',
|