arengibook 1.2.317-main → 1.2.319-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 +72 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41057,6 +41057,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41057
41057
|
var isLoadingRef = useRef(false);
|
|
41058
41058
|
var loadLazyTimeout = useRef();
|
|
41059
41059
|
var currentPageRef = useRef(1);
|
|
41060
|
+
var searchTermRef = useRef('');
|
|
41061
|
+
var searchTimeout = useRef(null);
|
|
41060
41062
|
|
|
41061
41063
|
// Wrapper qui synchronise state ET ref en un seul appel
|
|
41062
41064
|
var updateLoadedOptions = function updateLoadedOptions(opts) {
|
|
@@ -41335,7 +41337,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41335
41337
|
break;
|
|
41336
41338
|
}
|
|
41337
41339
|
_context3.n = 1;
|
|
41338
|
-
return options(
|
|
41340
|
+
return options(searchTermRef.current, [], {
|
|
41339
41341
|
page: nextPage
|
|
41340
41342
|
});
|
|
41341
41343
|
case 1:
|
|
@@ -41348,7 +41350,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41348
41350
|
break;
|
|
41349
41351
|
}
|
|
41350
41352
|
_context3.n = 3;
|
|
41351
|
-
return fetchOptionsFromUrl(
|
|
41353
|
+
return fetchOptionsFromUrl(searchTermRef.current, [], {
|
|
41352
41354
|
page: nextPage
|
|
41353
41355
|
});
|
|
41354
41356
|
case 3:
|
|
@@ -41506,6 +41508,62 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41506
41508
|
if (!openOnHover) return;
|
|
41507
41509
|
(_multiSelectRef$curre3 = multiSelectRef.current) === null || _multiSelectRef$curre3 === void 0 || _multiSelectRef$curre3.hide();
|
|
41508
41510
|
};
|
|
41511
|
+
var handleFilter = function handleFilter(e) {
|
|
41512
|
+
var _e$filter;
|
|
41513
|
+
if (isOptionsArray) return;
|
|
41514
|
+
var search = (_e$filter = e.filter) !== null && _e$filter !== void 0 ? _e$filter : '';
|
|
41515
|
+
searchTermRef.current = search;
|
|
41516
|
+
if (searchTimeout.current) clearTimeout(searchTimeout.current);
|
|
41517
|
+
searchTimeout.current = setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
41518
|
+
var _result6, _result7;
|
|
41519
|
+
var result;
|
|
41520
|
+
return _regenerator().w(function (_context4) {
|
|
41521
|
+
while (1) switch (_context4.n) {
|
|
41522
|
+
case 0:
|
|
41523
|
+
currentPageRef.current = 1;
|
|
41524
|
+
hasMoreRef.current = true;
|
|
41525
|
+
isLoadingRef.current = false;
|
|
41526
|
+
setLoading(true);
|
|
41527
|
+
if (!(typeof options === 'function')) {
|
|
41528
|
+
_context4.n = 2;
|
|
41529
|
+
break;
|
|
41530
|
+
}
|
|
41531
|
+
_context4.n = 1;
|
|
41532
|
+
return options(search, [], {
|
|
41533
|
+
page: 1
|
|
41534
|
+
});
|
|
41535
|
+
case 1:
|
|
41536
|
+
result = _context4.v;
|
|
41537
|
+
_context4.n = 5;
|
|
41538
|
+
break;
|
|
41539
|
+
case 2:
|
|
41540
|
+
if (!optionsUrl) {
|
|
41541
|
+
_context4.n = 4;
|
|
41542
|
+
break;
|
|
41543
|
+
}
|
|
41544
|
+
_context4.n = 3;
|
|
41545
|
+
return fetchOptionsFromUrl(search, [], {
|
|
41546
|
+
page: 1
|
|
41547
|
+
});
|
|
41548
|
+
case 3:
|
|
41549
|
+
result = _context4.v;
|
|
41550
|
+
_context4.n = 5;
|
|
41551
|
+
break;
|
|
41552
|
+
case 4:
|
|
41553
|
+
result = {
|
|
41554
|
+
options: [],
|
|
41555
|
+
hasMore: false
|
|
41556
|
+
};
|
|
41557
|
+
case 5:
|
|
41558
|
+
hasMoreRef.current = ((_result6 = result) === null || _result6 === void 0 ? void 0 : _result6.hasMore) !== false;
|
|
41559
|
+
updateLoadedOptions(_flattenOptions(((_result7 = result) === null || _result7 === void 0 ? void 0 : _result7.options) || []));
|
|
41560
|
+
setLoading(false);
|
|
41561
|
+
case 6:
|
|
41562
|
+
return _context4.a(2);
|
|
41563
|
+
}
|
|
41564
|
+
}, _callee4);
|
|
41565
|
+
})), 300);
|
|
41566
|
+
};
|
|
41509
41567
|
|
|
41510
41568
|
// ─── Templates ────────────────────────────────────────────────────────────
|
|
41511
41569
|
|
|
@@ -41564,9 +41622,9 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41564
41622
|
}
|
|
41565
41623
|
}, secondaryLabel)));
|
|
41566
41624
|
if (isSelectMeta) {
|
|
41567
|
-
var
|
|
41568
|
-
labelStyle =
|
|
41569
|
-
generalIcon =
|
|
41625
|
+
var _ref7 = selectMetaConfig || {},
|
|
41626
|
+
labelStyle = _ref7.labelStyle,
|
|
41627
|
+
generalIcon = _ref7.generalIcon;
|
|
41570
41628
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
41571
41629
|
style: _objectSpread2({
|
|
41572
41630
|
fontFamily: 'Arial',
|
|
@@ -41589,9 +41647,9 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41589
41647
|
}, /*#__PURE__*/React__default.createElement("div", tooltipProps, option[optionLabel]), option[optionLabel], secondaryLabelNode));
|
|
41590
41648
|
}
|
|
41591
41649
|
if (withColor || withIcon) {
|
|
41592
|
-
var
|
|
41593
|
-
_labelStyle =
|
|
41594
|
-
_generalIcon =
|
|
41650
|
+
var _ref8 = selectConfig || {},
|
|
41651
|
+
_labelStyle = _ref8.labelStyle,
|
|
41652
|
+
_generalIcon = _ref8.generalIcon;
|
|
41595
41653
|
return /*#__PURE__*/React__default.createElement("div", _extends$J({}, tooltipProps, {
|
|
41596
41654
|
style: _objectSpread2({
|
|
41597
41655
|
fontSize: '14px',
|
|
@@ -41988,8 +42046,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
41988
42046
|
}, displayBadge && selectedOptionsCount <= maxSelectedLabels ? {
|
|
41989
42047
|
display: 'chip',
|
|
41990
42048
|
pt: {
|
|
41991
|
-
token: function token(
|
|
41992
|
-
var context =
|
|
42049
|
+
token: function token(_ref9) {
|
|
42050
|
+
var context = _ref9.context;
|
|
41993
42051
|
var opt = flatOptions.find(function (o) {
|
|
41994
42052
|
return o[optionValue] === context.value;
|
|
41995
42053
|
});
|
|
@@ -42003,8 +42061,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
42003
42061
|
'data-pr-position': 'top'
|
|
42004
42062
|
};
|
|
42005
42063
|
},
|
|
42006
|
-
removeTokenIcon: function removeTokenIcon(
|
|
42007
|
-
var context =
|
|
42064
|
+
removeTokenIcon: function removeTokenIcon(_ref0) {
|
|
42065
|
+
var context = _ref0.context;
|
|
42008
42066
|
return {
|
|
42009
42067
|
style: function () {
|
|
42010
42068
|
var opt = flatOptions.find(function (o) {
|
|
@@ -42073,7 +42131,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
|
|
|
42073
42131
|
value: displayValue ? displayValue : selectedOptions,
|
|
42074
42132
|
placeholder: placeholder,
|
|
42075
42133
|
disabled: disabled || readOnly,
|
|
42076
|
-
filter: filter,
|
|
42134
|
+
filter: filter || !isOptionsArray && !!optionsUrl,
|
|
42135
|
+
onFilter: !isOptionsArray ? handleFilter : undefined,
|
|
42077
42136
|
optionLabel: optionLabel,
|
|
42078
42137
|
optionValue: optionValue,
|
|
42079
42138
|
style: style,
|