Skip to content

Commit e5a9ee4

Browse files
committed
Merge branch 'dev' into next
2 parents 475814b + 544086d commit e5a9ee4

18 files changed

+161
-113
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ const CLASS_TYPES = [String, Object, Array]
249249
transition: { type: String, default: 'vfm' },
250250
overlayTransition: { type: String, default: 'vfm' },
251251
zIndexBase: { type: [String, Number], default: 1000 },
252-
zIndex: { type: [Boolean, String, Number], default: false }
252+
zIndex: { type: [Boolean, String, Number], default: false },
253+
focusTrap: { type: Boolean, default: false }
253254
}
254255
```
255256

dist/VueFinalModal.esm.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/VueFinalModal.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/VueFinalModal.umd.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/VueFinalModal.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/content/en/examples.md

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -603,53 +603,19 @@ export default {
603603

604604
### **Accessibility**
605605

606-
Using [focus-trap-vue](https://github.com/posva/focus-trap-vue) can easily support Accessibility.
607-
608-
**1. Install**
609-
610-
<code-group>
611-
<code-block label="Yarn" active>
612-
613-
```bash
614-
yarn add focus-trap focus-trap-vue
615-
```
616-
617-
</code-block>
618-
<code-block label="NPM">
619-
620-
```bash
621-
npm install focus-trap focus-trap-vue
622-
```
623-
624-
</code-block>
625-
</code-group>
626-
627-
**2. Register component**
628-
629-
```js[main.js]
630-
import { FocusTrap } from 'focus-trap-vue'
631-
Vue.component('FocusTrap', FocusTrap)
632-
```
633-
634-
**3. Wrap the modal component**
635606

636607
<v-accessibility></v-accessibility>
637608

638609
<show-code open class="mt-2">
639610

640611
```html
641612
<template>
642-
<focus-trap :value="value">
643613
<vue-final-modal
644-
:value="value"
645-
v-bind="$attrs"
646-
classes="modal-container"
647-
content-class="modal-content"
648-
v-on="$listeners"
614+
...
615+
focus-trap
649616
>
650617
...modal content
651618
</vue-final-modal>
652-
</focus-trap>
653619
</template>
654620
```
655621

docs/content/en/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,13 @@ Calculate `z-index` automatically with zIndexBase. If zIndex is set, `zIndexBase
372372

373373
Set specific `z-index` to root of the modal element. If zIndex is set, `zIndexBase` will become invalid.
374374

375+
### `focusTrap`
376+
377+
- Type: `Boolean`
378+
- Default: `false`
379+
380+
Enables focus trap meaning that only inputs/buttons that are withing the modal window can be focused by pressing Tab (plugin uses very naive implementation of the focus trap)
381+
375382
## **Events**
376383

377384
### **Live example**

docs/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
},
1111
"dependencies": {
1212
"@nuxt/content-theme-docs": "^0.6.1",
13-
"focus-trap": "^6.1.1",
14-
"focus-trap-vue": "^1.0.0",
1513
"nuxt": "^2.14.1",
1614
"vue-final-modal": "^0.13.5"
1715
},

docs/plugins/global.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import VueFinalModal from 'vue-final-modal/lib/VueFinalModal.vue'
55

66
Vue.use(VueFinalModal)
77

8-
import { FocusTrap } from 'focus-trap-vue'
9-
10-
Vue.component('FocusTrap', FocusTrap)
11-
128
import components from '../../example/src/components/index.js'
139
Object.keys(components).forEach(name => {
1410
Vue.component(name, components[name])

docs/yarn.lock

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4418,18 +4418,6 @@ flush-write-stream@^1.0.0:
44184418
inherits "^2.0.3"
44194419
readable-stream "^2.3.6"
44204420

4421-
focus-trap-vue@^1.0.0:
4422-
version "1.0.0"
4423-
resolved "https://registry.yarnpkg.com/focus-trap-vue/-/focus-trap-vue-1.0.0.tgz#0726c18a33dc2ad88994d978b9c65a537540e4ae"
4424-
integrity sha512-u5S7jOstKV47vs8+zpqhpTt/ghGk9bprrI6noCMyUt+58Ar5jC0Rpw88yJl5uqkAu3O5usk5Sm9bT547BYXoAg==
4425-
4426-
focus-trap@^6.1.1:
4427-
version "6.1.1"
4428-
resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-6.1.1.tgz#61881b58e56783a7ca7331c6969336b986313594"
4429-
integrity sha512-sTTf6esJ2iCdn8WpUEB4LfJl7tvjGLASV3JmXbi7q1N5Ajjyk+65qZdrmjOF01s+/1v81rTNYZrsTeGha5KKpg==
4430-
dependencies:
4431-
tabbable "^5.1.0"
4432-
44334421
for-in@^1.0.2:
44344422
version "1.0.2"
44354423
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
@@ -9266,11 +9254,6 @@ svgo@^1.0.0:
92669254
unquote "~1.1.1"
92679255
util.promisify "~1.0.0"
92689256

9269-
tabbable@^5.1.0:
9270-
version "5.1.0"
9271-
resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.1.0.tgz#b81115168d0a8359ba69003b6a99d05f8480a664"
9272-
integrity sha512-Y3nSukchqM5UchuZjhj/WyE79Qb4RM/Vx3x3oHO3UYKKpf70Hy3iVRxb61MzCavN74aZsKzvPl4KNG8tQUAjFQ==
9273-
92749257
tailwindcss@^1.8.10:
92759258
version "1.8.10"
92769259
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-1.8.10.tgz#945ef151c401c04a1c95e6a6bc747387a8d1b9dc"

0 commit comments

Comments
 (0)