react-asc 21.0.4 → 21.0.5

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 (3) hide show
  1. package/index.es.js +5 -10
  2. package/index.js +5 -10
  3. package/package.json +1 -1
package/index.es.js CHANGED
@@ -411,16 +411,11 @@ const AutoComplete = (props) => {
411
411
  }
412
412
  }, [value]);
413
413
  useEffect(() => {
414
- if (options && options.length > 0) {
415
- const optionsOrigin = JSON.parse(JSON.stringify(options));
416
- const regex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'), 'gi');
417
- const optionsFiltered = optionsOrigin.filter(o => { var _a; return (_a = o.label) === null || _a === void 0 ? void 0 : _a.match(regex); });
418
- if (optionsFiltered.length === 0 && showNoEntry) {
419
- setOptionsTemp([{ value: '', label: '- no entry found -' }]);
420
- }
421
- else {
422
- setOptionsTemp(optionsFiltered);
423
- }
414
+ if (options.length === 0 && showNoEntry) {
415
+ setOptionsTemp([{ value: '', label: '- no entry found -' }]);
416
+ }
417
+ else {
418
+ setOptionsTemp(options);
424
419
  }
425
420
  }, [options]);
426
421
  useDebounce(() => { onChange && onChange(searchText); }, debounce, [searchText]);
package/index.js CHANGED
@@ -419,16 +419,11 @@ const AutoComplete = (props) => {
419
419
  }
420
420
  }, [value]);
421
421
  React.useEffect(() => {
422
- if (options && options.length > 0) {
423
- const optionsOrigin = JSON.parse(JSON.stringify(options));
424
- const regex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'), 'gi');
425
- const optionsFiltered = optionsOrigin.filter(o => { var _a; return (_a = o.label) === null || _a === void 0 ? void 0 : _a.match(regex); });
426
- if (optionsFiltered.length === 0 && showNoEntry) {
427
- setOptionsTemp([{ value: '', label: '- no entry found -' }]);
428
- }
429
- else {
430
- setOptionsTemp(optionsFiltered);
431
- }
422
+ if (options.length === 0 && showNoEntry) {
423
+ setOptionsTemp([{ value: '', label: '- no entry found -' }]);
424
+ }
425
+ else {
426
+ setOptionsTemp(options);
432
427
  }
433
428
  }, [options]);
434
429
  useDebounce(() => { onChange && onChange(searchText); }, debounce, [searchText]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "21.0.4",
3
+ "version": "21.0.5",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",