dhre-ui-kit 0.0.332 → 0.0.334
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/lib/index.js +3 -24
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +3 -23
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -2
package/lib/index.mjs
CHANGED
|
@@ -15,7 +15,6 @@ import { TextInput as TextInput$1 } from 'react-native-paper';
|
|
|
15
15
|
import { Dropdown } from 'react-native-element-dropdown';
|
|
16
16
|
import DocumentPicker from 'react-native-document-picker';
|
|
17
17
|
import RNFS from 'react-native-fs';
|
|
18
|
-
import OTPVerify, { removeListener, startOtpListener } from 'react-native-otp-verify';
|
|
19
18
|
|
|
20
19
|
var ShapeType = /* @__PURE__ */ ((ShapeType2) => {
|
|
21
20
|
ShapeType2["LINE"] = "line";
|
|
@@ -4120,28 +4119,6 @@ const OTPInput = React.forwardRef(
|
|
|
4120
4119
|
setTimeLeft(timerToResend / 1e3);
|
|
4121
4120
|
}, timerToResend);
|
|
4122
4121
|
};
|
|
4123
|
-
useEffect(() => {
|
|
4124
|
-
if (Platform.OS === "android") {
|
|
4125
|
-
onStartListeningOtp();
|
|
4126
|
-
}
|
|
4127
|
-
return () => {
|
|
4128
|
-
if (Platform.OS === "android") {
|
|
4129
|
-
OTPVerify.removeListener();
|
|
4130
|
-
removeListener();
|
|
4131
|
-
}
|
|
4132
|
-
};
|
|
4133
|
-
}, []);
|
|
4134
|
-
const onStartListeningOtp = async () => {
|
|
4135
|
-
await OTPVerify.getOtp();
|
|
4136
|
-
startOtpListener((message) => {
|
|
4137
|
-
const otpRegex = new RegExp(`(\\d{${length}})`, "g");
|
|
4138
|
-
const otp2 = otpRegex.exec(message)?.[1];
|
|
4139
|
-
setOTP(otp2 ?? "");
|
|
4140
|
-
if (otp2) {
|
|
4141
|
-
refs.current[otp2?.length - 1]?.focus();
|
|
4142
|
-
}
|
|
4143
|
-
});
|
|
4144
|
-
};
|
|
4145
4122
|
React.useImperativeHandle(ref, () => ({
|
|
4146
4123
|
reset() {
|
|
4147
4124
|
setOTP("");
|
|
@@ -4153,6 +4130,9 @@ const OTPInput = React.forwardRef(
|
|
|
4153
4130
|
}
|
|
4154
4131
|
}));
|
|
4155
4132
|
const handleChange = (index, value) => {
|
|
4133
|
+
if (/^\.-,$/.test(value) || value === "\u25CF." || value === "\u25CF-" || value === "\u25CF,") {
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4156
4136
|
const specialCharacterRegex = /[^a-zA-Z0-9 ]/;
|
|
4157
4137
|
if (value === "" || value?.length > 1 || !specialCharacterRegex.test(value)) {
|
|
4158
4138
|
const regex = /^\d+$/;
|