feat(input) : anneau de focus clavier sur InputPassword
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,8 +20,8 @@
|
|||||||
placeholder="_"
|
placeholder="_"
|
||||||
:type="isPasswordVisible ? 'text' : 'password'"
|
:type="isPasswordVisible ? 'text' : 'password'"
|
||||||
@input="onInput"
|
@input="onInput"
|
||||||
@focus="isFocused = true"
|
@focus="isFocused = true; onKbdFocus()"
|
||||||
@blur="isFocused = false"
|
@blur="isFocused = false; onKbdBlur()"
|
||||||
>
|
>
|
||||||
|
|
||||||
<label
|
<label
|
||||||
@@ -70,9 +70,12 @@ import {computed, ref, useAttrs, useId} from 'vue'
|
|||||||
import { Icon as IconifyIcon } from '@iconify/vue'
|
import { Icon as IconifyIcon } from '@iconify/vue'
|
||||||
import {twMerge} from 'tailwind-merge'
|
import {twMerge} from 'tailwind-merge'
|
||||||
import MalioRequiredMark from '../shared/RequiredMark.vue'
|
import MalioRequiredMark from '../shared/RequiredMark.vue'
|
||||||
|
import {useKbdFocusRing} from '../shared/useKbdFocusRing'
|
||||||
|
|
||||||
defineOptions({name: 'MalioInputPassword', inheritAttrs: false})
|
defineOptions({name: 'MalioInputPassword', inheritAttrs: false})
|
||||||
|
|
||||||
|
const {keyboardFocused, onFocus: onKbdFocus, onBlur: onKbdBlur} = useKbdFocusRing()
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
id?: string
|
id?: string
|
||||||
@@ -147,6 +150,7 @@ const mergedGroupClass = computed(() =>
|
|||||||
const mergedInputClass = computed(() =>
|
const mergedInputClass = computed(() =>
|
||||||
twMerge(
|
twMerge(
|
||||||
'floating-input peer min-h-[40px] w-full border bg-white pl-3 pr-3 py-1 outline-none placeholder:text-transparent text-lg rounded-md',
|
'floating-input peer min-h-[40px] w-full border bg-white pl-3 pr-3 py-1 outline-none placeholder:text-transparent text-lg rounded-md',
|
||||||
|
keyboardFocused.value ? 'm-focus-ring-kbd' : '',
|
||||||
isReadonly.value ? '' : 'grow-height',
|
isReadonly.value ? '' : 'grow-height',
|
||||||
isReadonly.value
|
isReadonly.value
|
||||||
? 'border-black'
|
? 'border-black'
|
||||||
|
|||||||
Reference in New Issue
Block a user