fix: complete field and OTP public contracts (HD-07)

This commit is contained in:
maoyingjie
2026-10-29 09:30:58 +08:00
parent 27cc62e36f
commit 2d7e3d4e1e
26 changed files with 1067 additions and 100 deletions
@@ -93,6 +93,7 @@ export default defineComponent({
onKeydownCapture: userKeydownCapture,
onPaste: userPaste,
onPasteCapture: userPasteCapture,
onInputCapture: userInputCapture,
...rest
} = attrs as Record<string, unknown>;
@@ -110,6 +111,7 @@ export default defineComponent({
...toHandlerArray(userPasteCapture),
...toHandlerArray(userPaste),
stopIfPrevented,
(event) => context?.handlePaste(event as ClipboardEvent, props.index),
];
return h(
@@ -117,6 +119,10 @@ export default defineComponent({
{
...rest,
class: [slotClass, cls],
onInputCapture: [
...toHandlerArray(userInputCapture),
(event: InputEvent) => context?.guardInput(event, props.index),
],
onKeydownCapture: keydownCapture,
onPasteCapture: pasteCapture,
"data-active": isActive.value || undefined,
@@ -151,6 +157,7 @@ export default defineComponent({
disabled: isDisabled.value,
readonly: isReadOnly.value || undefined,
class: inputClass,
style: { textAlign: context?.textAlign.value },
id: context?.inputId(props.index),
"data-slot": "input-otp-input",
autocomplete: "one-time-code",