@webority/ui-react 0.6.8 → 0.6.10
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/types/components/AppOtpInput.d.ts +12 -0
- package/dist/ui-react.js +228 -232
- package/package.json +3 -3
|
@@ -18,6 +18,18 @@ import '@webority/ui-elements';
|
|
|
18
18
|
* @param {(value: string) => void} [props.onChange]
|
|
19
19
|
* @param {(value: string) => void} [props.onComplete] Fires once, when the last character
|
|
20
20
|
* lands — so a form can submit itself without polling the value.
|
|
21
|
+
*
|
|
22
|
+
* It receives the CODE, not a DOM event. With react-hook-form that matters:
|
|
23
|
+
* `onComplete={handleSubmit(onSubmit)}` hands a string to a handler that expects an event
|
|
24
|
+
* and calls `preventDefault` on it. RHF v7 guards against it so the short form happens to
|
|
25
|
+
* work — by accident, and not something to rely on. Wrap it instead:
|
|
26
|
+
*
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <AppOtpInput onComplete={() => handleSubmit(onSubmit)()} />
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* The component is also CONTROLLED, so with RHF it wants `<Controller>` rather than
|
|
32
|
+
* `register`.
|
|
21
33
|
* @param {number} [props.length=6] Characters in the code. TOTP is 6; backup codes are often 8.
|
|
22
34
|
* @param {"numeric"|"alphanumeric"} [props.mode="numeric"] Drives the on-screen keyboard and
|
|
23
35
|
* what the field will accept.
|