@majoo-ui/react 1.47.0 → 1.48.0
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.
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface InputOTPProps {
|
|
3
|
+
/**
|
|
4
|
+
* Number of input boxes.
|
|
5
|
+
*/
|
|
6
|
+
OTPLength?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Returns OTP code typed in inputs.
|
|
9
|
+
*/
|
|
10
|
+
onChange: (value: string | number) => void;
|
|
11
|
+
/**
|
|
12
|
+
* The value of the otp passed into the component.
|
|
13
|
+
*/
|
|
14
|
+
value: string | number;
|
|
15
|
+
/**
|
|
16
|
+
* Disables all the inputs.
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Auto focuses input on initial page load.
|
|
21
|
+
*/
|
|
22
|
+
autoFocus?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* any - allows any value. number - allow only numbers. alpha - allows only a-zA-Z. alphanumeric - allows 0-9a-zA-z.
|
|
25
|
+
*/
|
|
26
|
+
otpType?: 'any' | 'number' | 'alpha' | 'alphanumeric';
|
|
27
|
+
/**
|
|
28
|
+
* Change input type to password.
|
|
29
|
+
*/
|
|
30
|
+
secure?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Class for input element.
|
|
33
|
+
*/
|
|
34
|
+
inputClassName?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Class for root element.
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Styles for input element.
|
|
41
|
+
*/
|
|
42
|
+
inputStyles?: object;
|
|
43
|
+
/**
|
|
44
|
+
* Styles for root element.
|
|
45
|
+
*/
|
|
46
|
+
style?: object;
|
|
47
|
+
/**
|
|
48
|
+
* Placeholder value of each input.
|
|
49
|
+
*/
|
|
50
|
+
placeholder?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Error state input OTP.
|
|
53
|
+
*/
|
|
54
|
+
isError?: boolean;
|
|
55
|
+
}
|
|
56
|
+
declare function InputOTP(props: InputOTPProps): JSX.Element;
|
|
57
|
+
declare namespace InputOTP {
|
|
58
|
+
var defaultProps: {
|
|
59
|
+
OTPLength: number;
|
|
60
|
+
value: string;
|
|
61
|
+
disabled: boolean;
|
|
62
|
+
autoFocus: boolean;
|
|
63
|
+
otpType: string;
|
|
64
|
+
secure: boolean;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export default InputOTP;
|
|
68
|
+
interface ResendOTPProps {
|
|
69
|
+
/**
|
|
70
|
+
* Timer that user has to wait before resend otp gets active.
|
|
71
|
+
*/
|
|
72
|
+
maxTime?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Function get triggers when user click on resend otp button. But when button is disabled(i.e. time is not completed) it won't get trigger.
|
|
75
|
+
*/
|
|
76
|
+
onResendClick: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* An optional callback when timer completes.
|
|
79
|
+
*/
|
|
80
|
+
onTimerComplete?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* You can change time interval.
|
|
83
|
+
*/
|
|
84
|
+
timeInterval?: number;
|
|
85
|
+
/**
|
|
86
|
+
* You can use your own component for seconds. Function will get remainingTime as props you can use it to show timer.
|
|
87
|
+
*/
|
|
88
|
+
renderTime?: (remainingTime: number) => React.ReactElement;
|
|
89
|
+
/**
|
|
90
|
+
* You can use your own component for resend button. Function will get disabled and onClick function and remainingTime as props you can pass it to your component.
|
|
91
|
+
*/
|
|
92
|
+
renderButton?: (buttonProps: object) => void;
|
|
93
|
+
/**
|
|
94
|
+
* For changing root component inline styles.
|
|
95
|
+
*/
|
|
96
|
+
style?: object;
|
|
97
|
+
/**
|
|
98
|
+
* For adding class to root component.
|
|
99
|
+
*/
|
|
100
|
+
className?: string;
|
|
101
|
+
}
|
|
102
|
+
export declare function ResendOTP(props: ResendOTPProps): JSX.Element;
|
|
103
|
+
export declare namespace ResendOTP {
|
|
104
|
+
var defaultProps: {
|
|
105
|
+
maxTime: number;
|
|
106
|
+
timeInterval: number;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
@@ -20,3 +20,4 @@ export { default as InputSelectTag } from './InputSelectTag/InputSelectTag';
|
|
|
20
20
|
export { default as InputCreatable } from './InputCreatable/InputCreatable';
|
|
21
21
|
export { default as InputResourceList } from './InputResourceList/InputResourceList';
|
|
22
22
|
export * from './InputCombobox';
|
|
23
|
+
export * from './InputOTP';
|