arengibook 2.4.605 → 2.4.606

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 +55 -22
  2. 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 ? 'Sélectionnez une option' : _ref$placeholder,
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,10 +36061,14 @@ 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 : []);
36070
+ console.log(loadedOptions);
36071
+ console.log(loadedOptions.length);
36065
36072
  _context.n = 4;
36066
36073
  break;
36067
36074
  case 3:
@@ -36208,7 +36215,8 @@ var Dropdown = function Dropdown(_ref) {
36208
36215
  return _regenerator().w(function (_context2) {
36209
36216
  while (1) switch (_context2.n) {
36210
36217
  case 0:
36211
- if (isOptionLoadFunction) {
36218
+ console.log('onLazyLoad appelé avec :', event);
36219
+ if (!(!isOptionLoadFunction || loading)) {
36212
36220
  _context2.n = 1;
36213
36221
  break;
36214
36222
  }
@@ -36344,19 +36352,30 @@ var Dropdown = function Dropdown(_ref) {
36344
36352
  itemTemplate: optionTemplate,
36345
36353
  valueTemplate: valueTemplate,
36346
36354
  showClear: showClear,
36347
- optionGroupTemplate: isGroupedOption ? groupedItemTemplate : null
36355
+ optionGroupTemplate: isGroupedOption ? groupedItemTemplate : null,
36356
+ editable: editable
36348
36357
  }, isGroupedOption && {
36349
36358
  optionGroupLabel: 'label',
36350
36359
  optionGroupChildren: 'items'
36351
36360
  }, (isSelectMeta || isOptionLoadFunction) && {
36352
- virtualScrollerOptions: {
36353
- lazy: true,
36354
- onLazyLoad: onLazyLoad,
36355
- itemSize: 38,
36356
- showLoader: true,
36357
- loading: loading,
36358
- delay: 250
36359
- }
36361
+ /* virtualScrollerOptions: {
36362
+ onLazyLoad: onLazyLoad,
36363
+ itemSize: 38,
36364
+ lazy: false,
36365
+ showLoader: false,
36366
+ loading: loading,
36367
+ totalrecords: 17,
36368
+ }, */
36369
+
36370
+ /* virtualScrollerOptions: {
36371
+ lazy: true,
36372
+ onLazyLoad: onLazyLoad,
36373
+ itemSize: 0,
36374
+ showLoader: true,
36375
+ loading: false,
36376
+ delay: 0,
36377
+ totalrecords: 0,
36378
+ }, */
36360
36379
  })), name && /*#__PURE__*/React__default.createElement("input", {
36361
36380
  type: "hidden",
36362
36381
  name: name,
@@ -36436,11 +36455,19 @@ var optionsWithColors = [{
36436
36455
  label: 'Vert',
36437
36456
  value: 'vert',
36438
36457
  color: '#00FF00'
36439
- }
36440
- // { label: 'Bleu', value: 'bleu', color: '#0000FF' },
36441
- // { label: 'Jaune', value: 'jaune', color: '#FFFF00' },
36442
- // { label: 'Cyan', value: 'cyan', color: '#00FFFF' },
36443
- ];
36458
+ }, {
36459
+ label: 'Bleu',
36460
+ value: 'bleu',
36461
+ color: '#0000FF'
36462
+ }, {
36463
+ label: 'Jaune',
36464
+ value: 'jaune',
36465
+ color: '#FFFF00'
36466
+ }, {
36467
+ label: 'Cyan',
36468
+ value: 'cyan',
36469
+ color: '#00FFFF'
36470
+ }];
36444
36471
  var createFakeOptions = function createFakeOptions(start, length) {
36445
36472
  var options = [];
36446
36473
  for (var i = start; i < length; i++) {
@@ -36485,6 +36512,7 @@ var DropdownPresets = {
36485
36512
  placeholder: 'Sélectionnez une couleur',
36486
36513
  options: optionsWithColors,
36487
36514
  isSelectMeta: true,
36515
+ editable: true,
36488
36516
  selectMetaConfig: {
36489
36517
  generalIcon: 'pi pi-circle-fill'
36490
36518
  },
@@ -36499,9 +36527,14 @@ var DropdownPresets = {
36499
36527
  }
36500
36528
  },
36501
36529
  SelectMetaAsyncLoad: {
36502
- placeholder: 'Chargement distant simulé',
36503
- value: 2,
36504
- // objValue: { label: 'Option 2', value: 2, color: 'green' }, // simule un affichage direct de l'option dans l'input si celle-ci a été enregistrée (si options asynchrones uniquement
36530
+ editable: true,
36531
+ // value: 2,
36532
+ objValue: {
36533
+ label: 'Option 2',
36534
+ value: 2,
36535
+ color: '#000000'
36536
+ },
36537
+ // simule un affichage direct de l'option dans l'input si celle-ci a été enregistrée (si options asynchrones uniquement
36505
36538
  options: function () {
36506
36539
  var _options = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(search, loadedOptions, _ref) {
36507
36540
  var page, length, start, data;
@@ -36509,7 +36542,7 @@ var DropdownPresets = {
36509
36542
  while (1) switch (_context.n) {
36510
36543
  case 0:
36511
36544
  page = _ref.page;
36512
- length = 2;
36545
+ length = 20;
36513
36546
  start = (page - 1) * length; // Simule un délai réseau
36514
36547
  _context.n = 1;
36515
36548
  return new Promise(function (res) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.4.605",
4
+ "version": "2.4.606",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {