arengibook 2.4.605 → 2.4.607
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 +37 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35963,7 +35963,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35963
35963
|
_ref$objValue = _ref.objValue,
|
|
35964
35964
|
objValue = _ref$objValue === void 0 ? null : _ref$objValue,
|
|
35965
35965
|
_ref$placeholder = _ref.placeholder,
|
|
35966
|
-
placeholder = _ref$placeholder === void 0 ?
|
|
35966
|
+
placeholder = _ref$placeholder === void 0 ? null : _ref$placeholder,
|
|
35967
35967
|
_ref$disabled = _ref.disabled,
|
|
35968
35968
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
35969
35969
|
_ref$filter = _ref.filter,
|
|
@@ -35984,6 +35984,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
35984
35984
|
onChange = _ref.onChange,
|
|
35985
35985
|
_ref$optionStyle = _ref.optionStyle,
|
|
35986
35986
|
optionStyle = _ref$optionStyle === void 0 ? {} : _ref$optionStyle,
|
|
35987
|
+
_ref$editable = _ref.editable,
|
|
35988
|
+
editable = _ref$editable === void 0 ? false : _ref$editable,
|
|
35987
35989
|
name = _ref.name,
|
|
35988
35990
|
_ref$showClear = _ref.showClear,
|
|
35989
35991
|
showClear = _ref$showClear === void 0 ? false : _ref$showClear,
|
|
@@ -36018,7 +36020,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36018
36020
|
_useState6 = _slicedToArray$8(_useState5, 2),
|
|
36019
36021
|
loadedOptions = _useState6[0],
|
|
36020
36022
|
setLoadedOptions = _useState6[1];
|
|
36021
|
-
var isOptionLoadFunction = typeof options === 'function';
|
|
36023
|
+
var isOptionLoadFunction = typeof options === 'function'; // (détecte si l'option est une fonction donc fonction asynchrone)
|
|
36022
36024
|
var filterRef = useRef('');
|
|
36023
36025
|
var dropdownRef = useRef(null);
|
|
36024
36026
|
var _useState7 = useState(null),
|
|
@@ -36027,6 +36029,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36027
36029
|
setValueToOptionMap = _useState8[1];
|
|
36028
36030
|
useEffect(function () {
|
|
36029
36031
|
if (isOptionLoadFunction && objValue && isSelectMeta) {
|
|
36032
|
+
console.log("objValue");
|
|
36030
36033
|
setValueToOptionMap(objValue);
|
|
36031
36034
|
}
|
|
36032
36035
|
var handleScroll = function handleScroll(e) {
|
|
@@ -36058,7 +36061,9 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36058
36061
|
setLoading(true);
|
|
36059
36062
|
_context.p = 1;
|
|
36060
36063
|
_context.n = 2;
|
|
36061
|
-
return options(
|
|
36064
|
+
return options('', [], {
|
|
36065
|
+
page: 1
|
|
36066
|
+
});
|
|
36062
36067
|
case 2:
|
|
36063
36068
|
result = _context.v;
|
|
36064
36069
|
setLoadedOptions(Array.isArray(result.options) ? result.options : []);
|
|
@@ -36208,7 +36213,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36208
36213
|
return _regenerator().w(function (_context2) {
|
|
36209
36214
|
while (1) switch (_context2.n) {
|
|
36210
36215
|
case 0:
|
|
36211
|
-
if (isOptionLoadFunction) {
|
|
36216
|
+
if (!(!isOptionLoadFunction || loading)) {
|
|
36212
36217
|
_context2.n = 1;
|
|
36213
36218
|
break;
|
|
36214
36219
|
}
|
|
@@ -36344,18 +36349,19 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
36344
36349
|
itemTemplate: optionTemplate,
|
|
36345
36350
|
valueTemplate: valueTemplate,
|
|
36346
36351
|
showClear: showClear,
|
|
36347
|
-
optionGroupTemplate: isGroupedOption ? groupedItemTemplate : null
|
|
36352
|
+
optionGroupTemplate: isGroupedOption ? groupedItemTemplate : null,
|
|
36353
|
+
editable: editable
|
|
36348
36354
|
}, isGroupedOption && {
|
|
36349
36355
|
optionGroupLabel: 'label',
|
|
36350
36356
|
optionGroupChildren: 'items'
|
|
36351
36357
|
}, (isSelectMeta || isOptionLoadFunction) && {
|
|
36352
36358
|
virtualScrollerOptions: {
|
|
36353
|
-
|
|
36359
|
+
showLoader: true,
|
|
36354
36360
|
onLazyLoad: onLazyLoad,
|
|
36355
36361
|
itemSize: 38,
|
|
36356
|
-
|
|
36362
|
+
totalrecords: loadedOptions.length + 50,
|
|
36357
36363
|
loading: loading,
|
|
36358
|
-
|
|
36364
|
+
lazy: true
|
|
36359
36365
|
}
|
|
36360
36366
|
})), name && /*#__PURE__*/React__default.createElement("input", {
|
|
36361
36367
|
type: "hidden",
|
|
@@ -36436,11 +36442,19 @@ var optionsWithColors = [{
|
|
|
36436
36442
|
label: 'Vert',
|
|
36437
36443
|
value: 'vert',
|
|
36438
36444
|
color: '#00FF00'
|
|
36439
|
-
}
|
|
36440
|
-
|
|
36441
|
-
|
|
36442
|
-
|
|
36443
|
-
|
|
36445
|
+
}, {
|
|
36446
|
+
label: 'Bleu',
|
|
36447
|
+
value: 'bleu',
|
|
36448
|
+
color: '#0000FF'
|
|
36449
|
+
}, {
|
|
36450
|
+
label: 'Jaune',
|
|
36451
|
+
value: 'jaune',
|
|
36452
|
+
color: '#FFFF00'
|
|
36453
|
+
}, {
|
|
36454
|
+
label: 'Cyan',
|
|
36455
|
+
value: 'cyan',
|
|
36456
|
+
color: '#00FFFF'
|
|
36457
|
+
}];
|
|
36444
36458
|
var createFakeOptions = function createFakeOptions(start, length) {
|
|
36445
36459
|
var options = [];
|
|
36446
36460
|
for (var i = start; i < length; i++) {
|
|
@@ -36485,6 +36499,7 @@ var DropdownPresets = {
|
|
|
36485
36499
|
placeholder: 'Sélectionnez une couleur',
|
|
36486
36500
|
options: optionsWithColors,
|
|
36487
36501
|
isSelectMeta: true,
|
|
36502
|
+
editable: true,
|
|
36488
36503
|
selectMetaConfig: {
|
|
36489
36504
|
generalIcon: 'pi pi-circle-fill'
|
|
36490
36505
|
},
|
|
@@ -36499,9 +36514,14 @@ var DropdownPresets = {
|
|
|
36499
36514
|
}
|
|
36500
36515
|
},
|
|
36501
36516
|
SelectMetaAsyncLoad: {
|
|
36502
|
-
|
|
36503
|
-
value: 2,
|
|
36504
|
-
|
|
36517
|
+
editable: true,
|
|
36518
|
+
// value: 2,
|
|
36519
|
+
objValue: {
|
|
36520
|
+
label: 'Option 2',
|
|
36521
|
+
value: 2,
|
|
36522
|
+
color: '#000000'
|
|
36523
|
+
},
|
|
36524
|
+
// simule un affichage direct de l'option dans l'input si celle-ci a été enregistrée (si options asynchrones uniquement
|
|
36505
36525
|
options: function () {
|
|
36506
36526
|
var _options = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(search, loadedOptions, _ref) {
|
|
36507
36527
|
var page, length, start, data;
|
|
@@ -36509,7 +36529,7 @@ var DropdownPresets = {
|
|
|
36509
36529
|
while (1) switch (_context.n) {
|
|
36510
36530
|
case 0:
|
|
36511
36531
|
page = _ref.page;
|
|
36512
|
-
length =
|
|
36532
|
+
length = 20;
|
|
36513
36533
|
start = (page - 1) * length; // Simule un délai réseau
|
|
36514
36534
|
_context.n = 1;
|
|
36515
36535
|
return new Promise(function (res) {
|