arengibook 2.4.632 → 2.4.633

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 +88 -73
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -36820,12 +36820,12 @@ var DropdownPresets = {
36820
36820
  }
36821
36821
  };
36822
36822
 
36823
- var simulateNetworkDelay = function simulateNetworkDelay() {
36823
+ var simulateNetworkDelay$1 = function simulateNetworkDelay() {
36824
36824
  return new Promise(function (res) {
36825
36825
  return setTimeout(res, 400);
36826
36826
  });
36827
36827
  };
36828
- var createFakeOptions = function createFakeOptions(start, length) {
36828
+ var createFakeOptions$1 = function createFakeOptions(start, length) {
36829
36829
  var options = [];
36830
36830
  for (var i = start; i < start + length; i++) {
36831
36831
  options.push({
@@ -36854,9 +36854,9 @@ var DropdownSelectMetaAsyncPresets = {
36854
36854
  search = _args.length > 0 && _args[0] !== undefined ? _args[0] : '';
36855
36855
  _ref = _args.length > 2 ? _args[2] : undefined, page = _ref.page;
36856
36856
  _context.n = 1;
36857
- return simulateNetworkDelay();
36857
+ return simulateNetworkDelay$1();
36858
36858
  case 1:
36859
- allOptions = createFakeOptions(0, 100);
36859
+ allOptions = createFakeOptions$1(0, 100);
36860
36860
  filtered = allOptions.filter(function (opt) {
36861
36861
  return opt.label.toLowerCase().includes(search.toLowerCase());
36862
36862
  });
@@ -39091,7 +39091,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39091
39091
  _ref$valueStyle = _ref.valueStyle,
39092
39092
  valueStyle = _ref$valueStyle === void 0 ? {} : _ref$valueStyle,
39093
39093
  _ref$filter = _ref.filter,
39094
- filter = _ref$filter === void 0 ? true : _ref$filter,
39094
+ filter = _ref$filter === void 0 ? false : _ref$filter,
39095
39095
  _ref$invalid = _ref.invalid,
39096
39096
  invalid = _ref$invalid === void 0 ? false : _ref$invalid,
39097
39097
  _ref$errorMessage = _ref.errorMessage,
@@ -39309,7 +39309,7 @@ var MultiSelectMetaAsync = function MultiSelectMetaAsync(_ref) {
39309
39309
  style: style,
39310
39310
  showSelectAll: showSelectAll,
39311
39311
  disabled: disabled,
39312
- filter: true,
39312
+ filter: filter,
39313
39313
  placeholder: placeholder,
39314
39314
  optionLabel: optionLabel,
39315
39315
  optionValue: optionValue,
@@ -39656,6 +39656,11 @@ var MultiSelect = function MultiSelect(props) {
39656
39656
  }, errorMessage || 'Sélection invalide')));
39657
39657
  };
39658
39658
 
39659
+ var simulateNetworkDelay = function simulateNetworkDelay() {
39660
+ return new Promise(function (res) {
39661
+ return setTimeout(res, 400);
39662
+ });
39663
+ };
39659
39664
  var optionsExample = [{
39660
39665
  label: 'New York',
39661
39666
  value: 'NY'
@@ -39742,68 +39747,17 @@ var syncOptions$1 = [{
39742
39747
  value: '5',
39743
39748
  color: '#ec4899'
39744
39749
  }];
39745
- var asyncOptions$1 = /*#__PURE__*/function () {
39746
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(search, _, _ref) {
39747
- var page, mockOptions, startIndex, paginatedOptions;
39748
- return _regenerator().w(function (_context) {
39749
- while (1) switch (_context.n) {
39750
- case 0:
39751
- page = _ref.page;
39752
- mockOptions = [{
39753
- label: 'Option 1',
39754
- value: '1',
39755
- color: '#ff9900'
39756
- }, {
39757
- label: 'Option 2',
39758
- value: '2',
39759
- color: '#3b82f6'
39760
- }, {
39761
- label: 'Option 3',
39762
- value: '3',
39763
- color: '#10b981'
39764
- }, {
39765
- label: 'Option 4',
39766
- value: '4',
39767
- color: '#8b5cf6'
39768
- }, {
39769
- label: 'Option 5',
39770
- value: '5',
39771
- color: '#ec4899'
39772
- }, {
39773
- label: 'Option 6',
39774
- value: '6',
39775
- color: '#f59e0b'
39776
- }, {
39777
- label: 'Option 7',
39778
- value: '7',
39779
- color: '#ef4444'
39780
- }, {
39781
- label: 'Option 8',
39782
- value: '8',
39783
- color: '#10b981'
39784
- }, {
39785
- label: 'Option 9',
39786
- value: '9',
39787
- color: '#3b82f6'
39788
- }, {
39789
- label: 'Option 10',
39790
- value: '10',
39791
- color: '#8b5cf6'
39792
- }]; // Simulation de pagination
39793
- startIndex = (page - 1) * 5;
39794
- paginatedOptions = mockOptions.slice(startIndex, startIndex + 5);
39795
- return _context.a(2, {
39796
- options: search ? mockOptions.filter(function (opt) {
39797
- return opt.label.toLowerCase().includes(search.toLowerCase());
39798
- }) : paginatedOptions
39799
- });
39800
- }
39801
- }, _callee);
39802
- }));
39803
- return function asyncOptions(_x, _x2, _x3) {
39804
- return _ref2.apply(this, arguments);
39805
- };
39806
- }();
39750
+ var createFakeOptions = function createFakeOptions(start, length) {
39751
+ var options = [];
39752
+ for (var i = start; i < start + length; i++) {
39753
+ options.push({
39754
+ value: i,
39755
+ label: "Option ".concat(i),
39756
+ color: 'black'
39757
+ });
39758
+ }
39759
+ return options;
39760
+ };
39807
39761
  var MultiSelectPresets = {
39808
39762
  Default: {
39809
39763
  placeholder: 'Sélectionnez des options',
@@ -39888,17 +39842,78 @@ var MultiSelectPresets = {
39888
39842
  // Configuration pour les options asynchrones
39889
39843
  SelectMetaAsync: {
39890
39844
  isSelectMeta: true,
39891
- // value: ['3', '4', '5'],
39892
39845
  objValue: [{
39893
- label: 'Option 2',
39894
- value: '2',
39846
+ label: 'Option 9',
39847
+ value: 9,
39895
39848
  color: '#ff9900'
39896
39849
  }, {
39897
39850
  label: 'Option 4',
39898
- value: '4',
39851
+ value: 4,
39899
39852
  color: 'black'
39900
39853
  }],
39901
- options: asyncOptions$1,
39854
+ // objValue: [
39855
+ // {
39856
+ // "id": 2299,
39857
+ // "nom": "Economique",
39858
+ // "color": "#62BAC0",
39859
+ // "label": "Economique",
39860
+ // "value": 2299
39861
+ // },
39862
+ // {
39863
+ // "id": 2300,
39864
+ // "nom": "Financière",
39865
+ // "color": "#40839E",
39866
+ // "label": "Financière",
39867
+ // "value": 2300
39868
+ // },
39869
+ // {
39870
+ // "id": 2301,
39871
+ // "nom": "Données bancaires",
39872
+ // "color": "#E5E798",
39873
+ // "label": "Données bancaires",
39874
+ // "value": 2301
39875
+ // }
39876
+ // ],
39877
+ // value: ['3', '4'],
39878
+ options: function () {
39879
+ var _options = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
39880
+ var search,
39881
+ _ref3,
39882
+ page,
39883
+ allOptions,
39884
+ filtered,
39885
+ pageSize,
39886
+ start,
39887
+ _args2 = arguments;
39888
+ return _regenerator().w(function (_context2) {
39889
+ while (1) switch (_context2.n) {
39890
+ case 0:
39891
+ search = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : '';
39892
+ _ref3 = _args2.length > 2 ? _args2[2] : undefined, page = _ref3.page;
39893
+ _context2.n = 1;
39894
+ return simulateNetworkDelay();
39895
+ case 1:
39896
+ allOptions = createFakeOptions(0, 100);
39897
+ filtered = allOptions.filter(function (opt) {
39898
+ return opt.label.toLowerCase().includes(search.toLowerCase());
39899
+ });
39900
+ pageSize = 30;
39901
+ start = (page - 1) * pageSize;
39902
+ return _context2.a(2, {
39903
+ options: filtered.slice(start, start + pageSize),
39904
+ hasMore: start + pageSize < filtered.length,
39905
+ additional: {
39906
+ page: page + 1
39907
+ }
39908
+ });
39909
+ }
39910
+ }, _callee2);
39911
+ }));
39912
+ function options() {
39913
+ return _options.apply(this, arguments);
39914
+ }
39915
+ return options;
39916
+ }(),
39902
39917
  placeholder: 'Sélectionnez une ou plusieurs options',
39903
39918
  optionLabel: 'label',
39904
39919
  optionValue: 'value',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.4.632",
4
+ "version": "2.4.633",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {