Fixed focus trap demo
parent
d103a8ef15
commit
0242c7987c
|
@ -3,27 +3,26 @@
|
|||
<p>FocusTrap is enabled by attaching the directive with the v- prefix.</p>
|
||||
</DocSectionText>
|
||||
<div class="card flex justify-center p-fluid">
|
||||
<div v-focustrap class="w-full" style="max-width: 20rem">
|
||||
<div class="field">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-user" />
|
||||
</InputIcon>
|
||||
<InputText id="input" v-model="name" type="text" placeholder="Name" autofocus />
|
||||
</IconField>
|
||||
</div>
|
||||
<div class="field">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-envelope" />
|
||||
</InputIcon>
|
||||
<InputText id="email" v-model="email" type="email" placeholder="Email" />
|
||||
</IconField>
|
||||
</div>
|
||||
<div class="field-checkbox">
|
||||
<div v-focustrap class="w-full sm:w-80 flex flex-col gap-6">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-user" />
|
||||
</InputIcon>
|
||||
<InputText id="input" v-model="name" type="text" placeholder="Name" autofocus />
|
||||
</IconField>
|
||||
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-envelope" />
|
||||
</InputIcon>
|
||||
<InputText id="email" v-model="email" type="email" placeholder="Email" />
|
||||
</IconField>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<Checkbox id="accept" v-model="accept" name="accept" value="Accept" />
|
||||
<label for="accept">I agree to the terms and conditions.</label>
|
||||
</div>
|
||||
|
||||
<Button type="submit" label="Submit" class="mt-2" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -39,54 +38,52 @@ export default {
|
|||
accept: false,
|
||||
code: {
|
||||
basic: `
|
||||
<div v-focustrap class="w-full" style="max-width: 20rem">
|
||||
<div class="field">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-user" />
|
||||
</InputIcon>
|
||||
<InputText id="input" v-model="name" type="text" placeholder="Name" autofocus />
|
||||
</IconField>
|
||||
</div>
|
||||
<div class="field">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-envelope" />
|
||||
</InputIcon>
|
||||
<InputText id="email" v-model="email" type="email" placeholder="Email" />
|
||||
</IconField>
|
||||
</div>
|
||||
<div class="field-checkbox">
|
||||
<div v-focustrap class="w-full sm:w-80 flex flex-col gap-6">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-user" />
|
||||
</InputIcon>
|
||||
<InputText id="input" v-model="name" type="text" placeholder="Name" autofocus />
|
||||
</IconField>
|
||||
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-envelope" />
|
||||
</InputIcon>
|
||||
<InputText id="email" v-model="email" type="email" placeholder="Email" />
|
||||
</IconField>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<Checkbox id="accept" v-model="accept" name="accept" value="Accept" />
|
||||
<label for="accept">I agree to the terms and conditions.</label>
|
||||
</div>
|
||||
|
||||
<Button type="submit" label="Submit" class="mt-2" />
|
||||
</div>
|
||||
`,
|
||||
options: `
|
||||
<template>
|
||||
<div class="card flex justify-center p-fluid">
|
||||
<div v-focustrap class="w-full" style="max-width: 20rem">
|
||||
<div class="field">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-user" />
|
||||
</InputIcon>
|
||||
<InputText id="input" v-model="name" type="text" placeholder="Name" autofocus />
|
||||
</IconField>
|
||||
</div>
|
||||
<div class="field">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-envelope" />
|
||||
</InputIcon>
|
||||
<InputText id="email" v-model="email" type="email" placeholder="Email" />
|
||||
</IconField>
|
||||
</div>
|
||||
<div class="field-checkbox">
|
||||
<div v-focustrap class="w-full sm:w-80 flex flex-col gap-6">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-user" />
|
||||
</InputIcon>
|
||||
<InputText id="input" v-model="name" type="text" placeholder="Name" autofocus />
|
||||
</IconField>
|
||||
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-envelope" />
|
||||
</InputIcon>
|
||||
<InputText id="email" v-model="email" type="email" placeholder="Email" />
|
||||
</IconField>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<Checkbox id="accept" v-model="accept" name="accept" value="Accept" />
|
||||
<label for="accept">I agree to the terms and conditions.</label>
|
||||
</div>
|
||||
|
||||
<Button type="submit" label="Submit" class="mt-2" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -107,27 +104,26 @@ export default {
|
|||
composition: `
|
||||
<template>
|
||||
<div class="card flex justify-center p-fluid">
|
||||
<div v-focustrap class="w-full" style="max-width: 20rem">
|
||||
<div class="field">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-user" />
|
||||
</InputIcon>
|
||||
<InputText id="input" v-model="name" type="text" placeholder="Name" autofocus />
|
||||
</IconField>
|
||||
</div>
|
||||
<div class="field">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-envelope" />
|
||||
</InputIcon>
|
||||
<InputText id="email" v-model="email" type="email" placeholder="Email" />
|
||||
</IconField>
|
||||
</div>
|
||||
<div class="field-checkbox">
|
||||
<div v-focustrap class="w-full sm:w-80 flex flex-col gap-6">
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-user" />
|
||||
</InputIcon>
|
||||
<InputText id="input" v-model="name" type="text" placeholder="Name" autofocus />
|
||||
</IconField>
|
||||
|
||||
<IconField>
|
||||
<InputIcon>
|
||||
<i class="pi pi-envelope" />
|
||||
</InputIcon>
|
||||
<InputText id="email" v-model="email" type="email" placeholder="Email" />
|
||||
</IconField>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<Checkbox id="accept" v-model="accept" name="accept" value="Accept" />
|
||||
<label for="accept">I agree to the terms and conditions.</label>
|
||||
</div>
|
||||
|
||||
<Button type="submit" label="Submit" class="mt-2" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue