dhre-component-lib 0.8.13 → 0.8.15
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/components/Button/Button.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +17 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -21634,6 +21634,10 @@ const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDel
|
|
|
21634
21634
|
}
|
|
21635
21635
|
};
|
|
21636
21636
|
const handleKeyDown = (e, index) => {
|
|
21637
|
+
if (e.key === "Enter") {
|
|
21638
|
+
e.stopPropagation();
|
|
21639
|
+
return;
|
|
21640
|
+
}
|
|
21637
21641
|
if (!!patternRegex && !patternRegex.test(e.key) && e.key !== "Backspace") {
|
|
21638
21642
|
e.preventDefault();
|
|
21639
21643
|
return;
|
|
@@ -21678,7 +21682,7 @@ const OTPInput = ({ length = 4, onChange, autoFocus = false, onResend, resendDel
|
|
|
21678
21682
|
React__default.createElement("div", { className: "timerText" },
|
|
21679
21683
|
timer ? icon : "",
|
|
21680
21684
|
timer > 0 ? `00:${timer} secs` : ""),
|
|
21681
|
-
React__default.createElement("button", { onClick: handleResendClick, disabled: timer > 0 || disableResend, style: {
|
|
21685
|
+
React__default.createElement("button", { type: "button", onClick: handleResendClick, disabled: timer > 0 || disableResend, style: {
|
|
21682
21686
|
border: "none",
|
|
21683
21687
|
background: "none",
|
|
21684
21688
|
cursor: timer > 0 || disableResend ? "not-allowed" : "pointer",
|
|
@@ -21699,6 +21703,16 @@ const Search = ({ searchIcon, crossIcon, disabled = false, onSearch, onSelectSug
|
|
|
21699
21703
|
useEffect(() => {
|
|
21700
21704
|
queryRef.current = query;
|
|
21701
21705
|
}, [query]);
|
|
21706
|
+
useEffect(() => {
|
|
21707
|
+
if (!!suggestions?.length && query.length >= 3 && shouldShowAll) {
|
|
21708
|
+
setShowSuggestions(true);
|
|
21709
|
+
setFilteredSuggestions(suggestions);
|
|
21710
|
+
}
|
|
21711
|
+
else {
|
|
21712
|
+
setFilteredSuggestions([]);
|
|
21713
|
+
setShowSuggestions(false);
|
|
21714
|
+
}
|
|
21715
|
+
}, [suggestions]);
|
|
21702
21716
|
const handleChange = (e) => {
|
|
21703
21717
|
if (disabled)
|
|
21704
21718
|
return;
|
|
@@ -21729,8 +21743,8 @@ const Search = ({ searchIcon, crossIcon, disabled = false, onSearch, onSelectSug
|
|
|
21729
21743
|
onSearch(queryRef.current);
|
|
21730
21744
|
}, 500);
|
|
21731
21745
|
setTimeoutId(newTimeoutId);
|
|
21732
|
-
if (suggestions && value) {
|
|
21733
|
-
const filtered =
|
|
21746
|
+
if (suggestions && value && !shouldShowAll) {
|
|
21747
|
+
const filtered = suggestions.filter((suggestion) => suggestion.title.toLowerCase().includes(value.toLowerCase()));
|
|
21734
21748
|
setFilteredSuggestions(filtered);
|
|
21735
21749
|
setShowSuggestions(true);
|
|
21736
21750
|
}
|