react-core-ts 1.3.79 → 1.3.80

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-core-ts",
3
- "version": "1.3.79",
3
+ "version": "1.3.80",
4
4
  "description": "React Components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -72,6 +72,7 @@ const AutoCompleteWithTreeStructure = forwardRef<
72
72
  hasDisableSelection,
73
73
  inputType = 'text',
74
74
  onFocusTreeDropdown,
75
+ filterCondition,
75
76
  },
76
77
  ref
77
78
  ) => {
@@ -478,8 +479,22 @@ const AutoCompleteWithTreeStructure = forwardRef<
478
479
  }
479
480
  port.children?.forEach(searchRecursive);
480
481
  };
481
-
482
- dropDownData.forEach(searchRecursive);
482
+ if (
483
+ filterCondition &&
484
+ filterCondition.filterKey &&
485
+ filterCondition.filterValue
486
+ ) {
487
+ // Apply filtering only when condition is met
488
+ dropDownData
489
+ .filter(
490
+ (port) =>
491
+ port[filterCondition?.filterKey] === filterCondition.filterValue
492
+ ) // Modify this condition as needed
493
+ .forEach(searchRecursive);
494
+ } else {
495
+ // Default behavior (filter entire array)
496
+ dropDownData.forEach(searchRecursive);
497
+ }
483
498
  result;
484
499
  setFilteredData(result);
485
500
  };
@@ -73,6 +73,10 @@ export interface AutoSuggestionInputProps {
73
73
  e: React.FocusEvent<HTMLTextAreaElement, Element>
74
74
  ) => void;
75
75
  inputType?: 'text' | 'textarea';
76
+ filterCondition?: {
77
+ filterKey?: any;
78
+ filterValue?: any;
79
+ };
76
80
  }
77
81
  export interface IconsProps {
78
82
  name: any;