arengibook 2.4.653 → 2.4.655

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 +28 -94
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -36198,7 +36198,10 @@ var DropdownSelectMetaAsync = function DropdownSelectMetaAsync(_ref) {
36198
36198
  borderRadius: '8px',
36199
36199
  boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.15)',
36200
36200
  display: 'inline-block',
36201
- fontFamily: 'Arial'
36201
+ marginBottom: '5px',
36202
+ fontFamily: 'Arial',
36203
+ cursor: 'pointer',
36204
+ marginRight: '15px'
36202
36205
  }, valueStyle)
36203
36206
  }, selectedOption[optionLabel]);
36204
36207
  };
@@ -36406,7 +36409,8 @@ var Dropdown = function Dropdown(props) {
36406
36409
  }, [value]);
36407
36410
  var style = {
36408
36411
  border: invalid ? '1px solid red' : '1px solid #ccc',
36409
- width: '100%'
36412
+ width: '100%',
36413
+ minHeight: '45px'
36410
36414
  };
36411
36415
  var inverseColor = function inverseColor(hexColor) {
36412
36416
  var r = parseInt(hexColor.substr(1, 2), 16);
@@ -36483,7 +36487,10 @@ var Dropdown = function Dropdown(props) {
36483
36487
  borderRadius: '8px',
36484
36488
  boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.15)',
36485
36489
  display: 'inline-block',
36486
- fontFamily: 'Arial'
36490
+ marginBottom: '5px',
36491
+ fontFamily: 'Arial',
36492
+ cursor: 'pointer',
36493
+ marginRight: '15px'
36487
36494
  }, valueStyle)
36488
36495
  }, option !== null && option !== void 0 && option[optionLabel] ? /*#__PURE__*/React__default.createElement("span", {
36489
36496
  style: {
@@ -39123,6 +39130,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39123
39130
  ongletID = _ref$ongletID === void 0 ? null : _ref$ongletID,
39124
39131
  _ref$classInput = _ref.classInput,
39125
39132
  classInput = _ref$classInput === void 0 ? null : _ref$classInput;
39133
+ _ref.displayNbOption;
39126
39134
  var _useState = useState(null),
39127
39135
  _useState2 = _slicedToArray$9(_useState, 2),
39128
39136
  selectedOptions = _useState2[0],
@@ -39140,6 +39148,10 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39140
39148
  var currentPageRef = useRef(1);
39141
39149
  var isOptionsArray = Array.isArray(options);
39142
39150
  var clickedFromList = useRef(false);
39151
+ var _useState7 = useState(false),
39152
+ _useState8 = _slicedToArray$9(_useState7, 2);
39153
+ _useState8[0];
39154
+ var setHovered = _useState8[1];
39143
39155
  var fetchOptionsFromUrl = /*#__PURE__*/function () {
39144
39156
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
39145
39157
  var search,
@@ -39181,9 +39193,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39181
39193
  return response.json();
39182
39194
  case 4:
39183
39195
  responseJSON = _context.v;
39184
- // Simule le filtrage et le mapping comme dans loadOptions
39185
39196
  dataAjax = responseJSON.data.filter(function (data) {
39186
- // Logique de filtrage si nécessaire (à adapter selon vos besoins)
39187
39197
  return true;
39188
39198
  });
39189
39199
  mappedOptions = dataAjax.map(function (opt) {
@@ -39273,7 +39283,6 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39273
39283
  options: []
39274
39284
  };
39275
39285
  case 5:
39276
- // setLoadedOptions(result?.options || []);
39277
39286
  setLoadedOptions(_flattenOptions(((_result = result) === null || _result === void 0 ? void 0 : _result.options) || []));
39278
39287
  if (objValue) {
39279
39288
  exists = (_result2 = result) === null || _result2 === void 0 || (_result2 = _result2.options) === null || _result2 === void 0 ? void 0 : _result2.some(function (opt) {
@@ -39313,14 +39322,10 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39313
39322
  observer.disconnect();
39314
39323
  };
39315
39324
  }, []);
39316
-
39317
- // Gestion du changement de sélection
39318
39325
  var handleChange = function handleChange(e) {
39319
39326
  setSelectedOptions(e.value);
39320
39327
  if (onChange) onChange(e.value);
39321
39328
  };
39322
-
39323
- // Inversion de couleur pour le texte des badges
39324
39329
  var inverseColor = function inverseColor(hexColor) {
39325
39330
  var r = parseInt(hexColor.substr(1, 2), 16);
39326
39331
  var g = parseInt(hexColor.substr(3, 2), 16);
@@ -39330,7 +39335,8 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39330
39335
  };
39331
39336
  var style = {
39332
39337
  border: invalid ? '1px solid red' : '1px solid #ccc',
39333
- width: '100%'
39338
+ width: '100%',
39339
+ minHeight: '45px'
39334
39340
  };
39335
39341
  var optionTemplate = function optionTemplate(option) {
39336
39342
  if (!option) return null;
@@ -39360,45 +39366,6 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39360
39366
  style: styleLabel
39361
39367
  }, option[optionLabel]));
39362
39368
  };
39363
-
39364
- // const selectedItemTemplate = (option) => {
39365
- //
39366
- // const selectedOption = objValue.find(opt => opt[optionValue] === option);
39367
- // if (!selectedOption) return null;
39368
- // // const isLastItem = index === selectedOptions.length - 1;
39369
- // const handleRemove = (e) => {
39370
- // e.stopPropagation();
39371
- // const newSelectedOptions = selectedOptions.filter(opt => opt !== option);
39372
- // setSelectedOptions(newSelectedOptions);
39373
- // if (onChange) onChange(newSelectedOptions);
39374
- // };
39375
- //
39376
- // return (
39377
- // <span
39378
- // onClick={handleRemove}
39379
- // style={{
39380
- // backgroundColor: selectedOption?.color ? selectedOption?.color : '#f8e6ec',
39381
- // color: selectedOption?.color ? inverseColor(selectedOption?.color) : '#333',
39382
- // padding: '6px 12px',
39383
- // fontSize: '14px',
39384
- // borderRadius: '8px',
39385
- // boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.15)',
39386
- // display: 'inline-block',
39387
- // marginBottom: '5px',
39388
- // fontFamily: 'Arial',
39389
- // cursor: 'pointer',
39390
- // marginRight: '15px',
39391
- // ...valueStyle,
39392
- // }}
39393
- // >
39394
- // {selectedOption[optionLabel]}
39395
- // <span style={{ marginLeft: '5px' }}>×</span>
39396
- // </span>
39397
- // );
39398
- //
39399
- //
39400
- // };
39401
-
39402
39369
  var _flattenOptions = function flattenOptions(options) {
39403
39370
  if (!Array.isArray(options)) return [];
39404
39371
  return options.reduce(function (acc, item) {
@@ -39410,8 +39377,6 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39410
39377
  return acc;
39411
39378
  }, []);
39412
39379
  };
39413
-
39414
- // util pour unifier la comparaison (objet => id | primitif => lui-même)
39415
39380
  var getKey = function getKey(v) {
39416
39381
  return v && _typeof$b(v) === 'object' ? v[optionValue] : v;
39417
39382
  };
@@ -39530,11 +39495,18 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39530
39495
  }, _callee3);
39531
39496
  })), 500);
39532
39497
  };
39498
+ selectedOptions ? selectedOptions.length : 0;
39533
39499
  return /*#__PURE__*/React__default.createElement("div", {
39534
39500
  ref: multiSelectRef,
39535
39501
  className: "flex flex-col gap-1",
39536
39502
  style: {
39537
39503
  width: '100%'
39504
+ },
39505
+ onMouseEnter: function onMouseEnter() {
39506
+ return setHovered(true);
39507
+ },
39508
+ onMouseLeave: function onMouseLeave() {
39509
+ return setHovered(false);
39538
39510
  }
39539
39511
  }, /*#__PURE__*/React__default.createElement(MultiSelect$1, {
39540
39512
  options: _flattenOptions(loadedOptions),
@@ -39655,7 +39627,8 @@ var MultiSelect = function MultiSelect(props) {
39655
39627
  setHovered = _useState4[1];
39656
39628
  var style = {
39657
39629
  border: invalid ? '1px solid red' : '1px solid #ccc',
39658
- width: '100%'
39630
+ width: '100%',
39631
+ minHeight: '45px'
39659
39632
  };
39660
39633
  useEffect(function () {
39661
39634
  var observer = new MutationObserver(function () {
@@ -39885,7 +39858,7 @@ var MultiSelect = function MultiSelect(props) {
39885
39858
  });
39886
39859
  return /*#__PURE__*/React__default.createElement("div", {
39887
39860
  key: index
39888
- }, option ? option.label : optionValue);
39861
+ }, option ? option[optionLabel] : optionValue);
39889
39862
  })))), name && /*#__PURE__*/React__default.createElement("div", null, (Array.isArray(selectedOptions) ? selectedOptions : []).filter(function (opt) {
39890
39863
  return opt && (_typeof$b(opt) === 'object' || typeof opt === 'number' || typeof opt === 'string');
39891
39864
  }).map(function (opt, index) {
@@ -40091,46 +40064,6 @@ var MultiSelectPresets = {
40091
40064
  useCheckbox: false,
40092
40065
  showSelectAll: false
40093
40066
  },
40094
- // Configuration pour les options asynchrones
40095
- // SelectMetaAsync: {
40096
- // isSelectMeta: true,
40097
- // value: [9, 4],
40098
- // objValue: [{ label: 'Option 9', value: 9, color: "#67688C" }, { label: 'Option 4', value: 4, color: "#39C9BF" }],
40099
- // options: async (search = '', _, { page }) => {
40100
- // await simulateNetworkDelay();
40101
- // const allOptions = createFakeOptions(0, 100);
40102
- // const filtered = allOptions.filter(opt =>
40103
- // opt.label.toLowerCase().includes(search.toLowerCase())
40104
- // );
40105
- // const pageSize = 30;
40106
- // const start = (page - 1) * pageSize;
40107
- // return {
40108
- // options: filtered.slice(start, start + pageSize),
40109
- // hasMore: start + pageSize < filtered.length,
40110
- // additional: { page: page + 1 },
40111
- // };
40112
- // },
40113
- // optionLabel: 'label',
40114
- // optionValue: 'value',
40115
- //
40116
- // // value: [3,4],
40117
- // // objValue: [{ name: 'Clementine Bauch', id: 3 }, { name: 'Patricia Lebsack', id: 4 }],
40118
- // // optionsUrl: "https://jsonplaceholder.typicode.com/users",
40119
- // // optionLabel: 'name',
40120
- // // optionValue: 'id',
40121
- //
40122
- // placeholder: 'Sélectionnez une ou plusieurs options',
40123
- // valueStyle: { marginRight: '15px', marginBottom: '5px' },
40124
- // selectMetaConfig: {
40125
- // labelStyle: { fontWeight: 'bold' },
40126
- // generalIcon: 'pi pi-tag',
40127
- // },
40128
- // filter: false,
40129
- // showClear: false,
40130
- // useCheckbox: false,
40131
- // showSelectAll: false,
40132
- // },
40133
-
40134
40067
  SelectMetaAsync: {
40135
40068
  isSelectMeta: true,
40136
40069
  value: [9, 4],
@@ -40210,6 +40143,7 @@ var MultiSelectPresets = {
40210
40143
  },
40211
40144
  generalIcon: 'pi pi-tag'
40212
40145
  },
40146
+ displayNbOption: true,
40213
40147
  filter: false,
40214
40148
  showClear: false,
40215
40149
  useCheckbox: false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.4.653",
4
+ "version": "2.4.655",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {