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/dist/AutoCompleteWithTreeStructure.js +15 -2
- package/dist/AutoCompleteWithTreeStructure.js.map +1 -1
- package/dist/commontypes.d.ts +4 -0
- package/dist/styles/styles/components/autocomplete.css +630 -0
- package/dist/styles/styles/components/selectedautocomplete.css +130 -0
- package/dist/styles/styles/components/tooltip.css +497 -0
- package/dist/styles/styles/components/treedropdown.css +97 -0
- package/dist/styles/styles/global.css +8 -0
- package/package.json +1 -1
- package/src/AutoCompleteWithTreeStructure.tsx +17 -2
- package/src/commontypes.ts +4 -0
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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
|
};
|
package/src/commontypes.ts
CHANGED
|
@@ -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;
|