arengibook 2.4.640 → 2.4.642

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 +61 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39265,6 +39265,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39265
39265
  exists = (_result2 = result) === null || _result2 === void 0 || (_result2 = _result2.options) === null || _result2 === void 0 ? void 0 : _result2.some(function (opt) {
39266
39266
  return opt[optionValue] === objValue[optionValue];
39267
39267
  });
39268
+ console.log("exists");
39269
+ console.log(exists);
39268
39270
  if (!exists) {
39269
39271
  setLoadedOptions(function (prev) {
39270
39272
  return [].concat(_toConsumableArray$7(prev), [objValue]);
@@ -39344,14 +39346,23 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39344
39346
  style: styleLabel
39345
39347
  }, option[optionLabel]));
39346
39348
  };
39347
- var selectedItemTemplate = function selectedItemTemplate(paramValue, index) {
39348
- var selectedOption = objValue;
39349
+ var selectedItemTemplate = function selectedItemTemplate(option) {
39350
+ var selectedOption = objValue.find(function (opt) {
39351
+ return opt[optionValue] === option;
39352
+ });
39353
+ console.log("ecoute de selectedOption");
39354
+ console.log(loadedOptions.find(function (opt) {
39355
+ return opt[optionValue] === option;
39356
+ }));
39357
+ console.log(selectedOption);
39358
+ console.log(objValue);
39359
+ console.log(selectedOptions);
39360
+ console.log(loadedOptions);
39349
39361
  if (!selectedOption) return null;
39350
- // const isLastItem = index === selectedOptions.length - 1;
39351
39362
  var handleRemove = function handleRemove(e) {
39352
39363
  e.stopPropagation();
39353
39364
  var newSelectedOptions = selectedOptions.filter(function (opt) {
39354
- return opt !== paramValue;
39365
+ return opt !== option;
39355
39366
  });
39356
39367
  setSelectedOptions(newSelectedOptions);
39357
39368
  if (onChange) onChange(newSelectedOptions);
@@ -39378,6 +39389,52 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39378
39389
  }, "\xD7"));
39379
39390
  };
39380
39391
 
39392
+ // const selectedItemTemplate = (paramValue, index) => {
39393
+ // // const selectedOption = loadedOptions.find(opt => opt[optionValue] === paramValue);
39394
+ // const selectedOption = objValue.find(opt => opt[optionValue] === paramValue);
39395
+ //
39396
+ // console.log("ecoute de selectedOption")
39397
+ // console.log(loadedOptions.find(opt => opt[optionValue] === paramValue))
39398
+ // console.log(selectedOption)
39399
+ // console.log(objValue)
39400
+ // console.log(paramValue)
39401
+ // console.log(selectedOptions)
39402
+ // console.log(loadedOptions)
39403
+ //
39404
+ // if (!selectedOption) return null;
39405
+ // // const isLastItem = index === selectedOptions.length - 1;
39406
+ // const handleRemove = (e) => {
39407
+ // e.stopPropagation();
39408
+ // const newSelectedOptions = selectedOptions.filter(opt => opt !== paramValue);
39409
+ // setSelectedOptions(newSelectedOptions);
39410
+ // if (onChange) onChange(newSelectedOptions);
39411
+ // };
39412
+ //
39413
+ // return (
39414
+ // <span
39415
+ // onClick={handleRemove}
39416
+ // style={{
39417
+ // backgroundColor: selectedOption?.color ? selectedOption?.color : '#f8e6ec',
39418
+ // color: selectedOption?.color ? inverseColor(selectedOption?.color) : '#333',
39419
+ // padding: '6px 12px',
39420
+ // fontSize: '14px',
39421
+ // borderRadius: '8px',
39422
+ // boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.15)',
39423
+ // display: 'inline-block',
39424
+ // marginBottom: '5px',
39425
+ // fontFamily: 'Arial',
39426
+ // cursor: 'pointer',
39427
+ // marginRight: '15px',
39428
+ // ...valueStyle,
39429
+ // }}
39430
+ // >
39431
+ // {selectedOption[optionLabel]}
39432
+ // <span style={{ marginLeft: '5px' }}>×</span>
39433
+ // </span>
39434
+ // );
39435
+ //
39436
+ // };
39437
+
39381
39438
  // Fonction de lazy loading
39382
39439
  var onLazyLoad = function onLazyLoad(event) {
39383
39440
  if (isOptionsArray) return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.4.640",
4
+ "version": "2.4.642",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {