Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
60d4484
refactor: plugin validation, unit test
hunterliu1003 Mar 30, 2021
77ccf5f
feat: add postcss plugin autoprefixer
hunterliu1003 Apr 4, 2021
c611a0f
chore: add favicon
hunterliu1003 Apr 5, 2021
19a005a
feat: support v-html in dynamic modal slot
hunterliu1003 Apr 5, 2021
2d6c02c
feat: draggable modal
hunterliu1003 Apr 3, 2021
0231bc4
docs: Bump @nuxt/content-theme-docs
hunterliu1003 Apr 5, 2021
12996be
feat: api return promise
hunterliu1003 Apr 5, 2021
3636325
Merge branch 'feat/autoprefixer' into feat/drag-resize
hunterliu1003 Apr 5, 2021
42353cd
Merge branch 'feat/bump-docs-version' into feat/drag-resize
hunterliu1003 Apr 5, 2021
9009c3f
Merge branch 'feat/api-return-promise' into feat/drag-resize
hunterliu1003 Apr 5, 2021
2554cbb
Merge branch 'feat/v-html-in-dynamic-modal-slot' into feat/drag-resize
hunterliu1003 Apr 5, 2021
155bbcb
Merge branch 'feat/favicon' into feat/drag-resize
hunterliu1003 Apr 5, 2021
ead4f35
Merge pull request #74 from vue-final/feat/bump-docs-version
hunterliu1003 Apr 6, 2021
c7134fc
Merge pull request #73 from vue-final/feat/v-html-in-dynamic-modal-slot
hunterliu1003 Apr 6, 2021
7234307
Merge pull request #72 from vue-final/feat/favicon
hunterliu1003 Apr 6, 2021
7d9632b
feat: add postcss plugin autoprefixer (#71)
hunterliu1003 Apr 6, 2021
a9efa81
refactor: plugin validation, unit test (#70)
hunterliu1003 Apr 6, 2021
18a2f8f
Merge branch 'master' into version/2.2
hunterliu1003 Apr 9, 2021
c2e5bf5
Merge branch 'master' into feat/drag-resize
hunterliu1003 Apr 9, 2021
3bcaad5
Feat: vite (#78)
hunterliu1003 Apr 11, 2021
e80a49b
Merge branch 'version/2.2' into feat/drag-resize
hunterliu1003 Apr 11, 2021
95f9381
feat!: api return promise (#76)
hunterliu1003 Apr 12, 2021
398ee66
Merge branch 'version/2.2' into feat/drag-resize
hunterliu1003 Apr 12, 2021
5d8ddbd
feat: unit tests
hunterliu1003 Apr 12, 2021
b17699a
feat: resizable modal in boundary
hunterliu1003 Apr 12, 2021
09543cd
feat: drag & resize
hunterliu1003 Apr 19, 2021
cdaea43
docs(en): drag & resize
hunterliu1003 Apr 19, 2021
9c2d11a
docs(zh-Hant): drag & resize
hunterliu1003 Apr 20, 2021
e8468e9
refactor: code review
hunterliu1003 May 3, 2021
7ce62d3
Merge branch 'master' into feat/drag-resize
hunterliu1003 May 4, 2021
98875f2
docs: fix v-button
hunterliu1003 May 4, 2021
3e2732a
docs: version 2
hunterliu1003 May 4, 2021
3025f27
chore: lint
hunterliu1003 May 4, 2021
1b2e906
refactor: CLASS_PROP, STYLE_PROP
hunterliu1003 May 4, 2021
762587f
Merge branch 'master' into feat/drag-resize
hunterliu1003 May 7, 2021
39fd1b8
Merge branch 'master' into feat/drag-resize
hunterliu1003 May 16, 2021
8395f38
chore: update yarn.lock
hunterliu1003 May 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

## 🎉 [Documentation](https://vue-final-modal.org)

## 🙌 [Examples](https://vue-final-modal.org/examples/manual)
## 🙌 [Examples](https://vue-final-modal.org/examples/liveDemo)

## Introduction

Expand All @@ -42,7 +42,7 @@ You can create a [higher-order component](https://vue-final-modal.org/examples/r
- [Tailwind CSS](https://vue-final-modal.org/examples/tailwind) friendly
- Renderless component
- [Tiny bundle size](https://bundlephobia.com/result?p=vue-final-modal)
- Support `stackable`, `detachable`, `scrollable`, `transition`, `accessibility`, `focusTrap`, `dynamic modal`
- Support `stackable`, `detachable`, `scrollable`, `draggable`, `resizable`, `transition`, `accessibility`, `focusTrap`, `dynamic modal`

## **Development**

Expand All @@ -63,7 +63,7 @@ yarn build
# Run examples
cd examples
yarn
yarn serve
yarn dev

# Run docs
cd docs
Expand Down Expand Up @@ -95,6 +95,8 @@ To develop `vue-final-modal`, I learn a lot from these awesome libraries:
- focusTrap for A11y
- [Bootstrap Vue](https://bootstrap-vue.org/)
- lockScroll
- [vue-resizable](https://github.com/nikitasnv/vue-resizable)
- drag & resize

> There is no perfect library even the `final` of vue modal.

Expand Down
2 changes: 1 addition & 1 deletion dist/VueFinalModal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.umd.js.map

Large diffs are not rendered by default.

105 changes: 91 additions & 14 deletions docs/components/examples/basic/BasicOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,31 @@
:attach="attach ? '#attach' : false"
:focus-retain="focusRetain"
:focus-trap="focusTrap"
:drag="drag"
:fit-parent="fitParent"
:keep-changed-style="keepChangedStyle"
:resize="resize"
:resize-directions="resizeDirections"
:drag-selector="allowDragSelector ? dragSelector : ''"
:min-width="minWidth"
:max-width="maxWidth"
:min-height="minHeight"
:max-height="maxHeight"
@confirm="showModal = false"
@cancel="showModal = false"
>
<template v-slot:title># Hello, world!</template>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
</v-modal>

<button class="vfm-btn" @click="showModal = true">Open Modal</button>
<div class="flex space-x-2">
<v-button highlight @click="showModal = true">Open Modal</v-button>
<v-button @click="reset">reset</v-button>
</div>

<h3>Prop Options:</h3>
<h3 class="py-2">Basic:</h3>

<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 p-4 border rounded">
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-y-4 p-4 border rounded select-none">
<label class="flex items-center space-x-2">
<span>value:</span>
<input v-model="showModal" type="checkbox" />
Expand All @@ -38,7 +49,6 @@
<span>ssr:</span>
<input v-model="ssr" type="checkbox" />
</label>

<label class="flex items-center space-x-2">
<span>lockScroll:</span>
<input v-model="lockScroll" type="checkbox" />
Expand Down Expand Up @@ -101,13 +111,69 @@
<span>focusTrap:</span>
<input v-model="focusTrap" type="checkbox" />
</label>
<button class="vfm-btn" @click="reset">reset</button>
</div>
<h4>Attach area:</h4>
<div id="attach" class="relative w-full h-64 mt-8 p-4 border rounded dark:bg-gray-700">
<button class="vfm-btn" @click="openAttach">
Attach to here and open modal
</button>
<h3 class="py-2">Drag & Resize:</h3>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 p-4 border rounded select-none">
<label class="flex items-center space-x-2">
<span>drag:</span>
<input v-model="drag" type="checkbox" />
</label>
<div class="flex flex-col">
<label class="flex items-center space-x-2">
<input v-model="allowDragSelector" type="checkbox" />
<span>dragSelector:</span>
</label>
<label>
<input
v-model="dragSelector"
:disabled="!allowDragSelector"
class="pl-2 dark:text-black rounded focus:outline-none"
/>
</label>
</div>
<label class="flex items-center space-x-2">
<span>fitParent:</span>
<input v-model="fitParent" type="checkbox" />
</label>
<label class="flex items-center space-x-2">
<span>keepChangedStyle:</span>
<input v-model="keepChangedStyle" type="checkbox" />
</label>
<label class="flex items-center space-x-2">
<span>resize:</span>
<input v-model="resize" type="checkbox" />
</label>
<div class="flex flex-col">
<span>resizeDirections:</span>
<div class="flex space-x-1">
<div v-for="direction in ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']" :key="direction">
<label>
{{ direction }}:
<input type="checkbox" v-model="resizeDirections" :value="direction" />
</label>
</div>
</div>
</div>
<label class="flex items-center space-x-2">
<span>minWidth:</span>
<input v-model.number="minWidth" type="number" class="w-20 pl-2 dark:text-black rounded focus:outline-none" />
</label>
<label class="flex items-center space-x-2">
<span>maxWidth:</span>
<input v-model.number="maxWidth" type="number" class="w-20 pl-2 dark:text-black rounded focus:outline-none" />
</label>
<label class="flex items-center space-x-2">
<span>minHeight:</span>
<input v-model.number="minHeight" type="number" class="w-20 pl-2 dark:text-black rounded focus:outline-none" />
</label>
<label class="flex items-center space-x-2">
<span>maxHeight:</span>
<input v-model.number="maxHeight" type="number" class="w-20 pl-2 dark:text-black rounded focus:outline-none" />
</label>
</div>
<h3 class="py-2">Attach:</h3>
<div id="attach" class="relative w-full h-64 p-4 border rounded dark:bg-gray-900 overflow-hidden">
<v-button highlight @click="openAttach">Attach to here and open modal</v-button>
<p>click will:</p>
<ul>
<li>set "attach" to "true"</li>
Expand All @@ -134,7 +200,18 @@ const initData = () => ({
zIndex: 0,
attach: false,
focusRetain: true,
focusTrap: false
focusTrap: false,
drag: false,
fitParent: true,
keepChangedStyle: false,
resize: false,
resizeDirections: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl'],
allowDragSelector: false,
dragSelector: '.modal__title',
minWidth: 0,
maxWidth: 2000,
minHeight: 0,
maxHeight: 2000
})

export default {
Expand Down
18 changes: 0 additions & 18 deletions docs/components/examples/basic/BasicPlainStyleCodepen.vue

This file was deleted.

2 changes: 1 addition & 1 deletion docs/components/examples/basic/VAccessibility.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>
</v-modal>

<button class="vfm-btn" @click="show = true">Open modal</button>
<v-button highlight @click="show = true">Open modal</v-button>
</div>
</template>

Expand Down
6 changes: 3 additions & 3 deletions docs/components/examples/basic/VActionButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
</p>
</div>
<div class="modal__action">
<button class="vfm-btn" @click="showModal = false">confirm</button>
<button class="vfm-btn" @click="showModal = false">cancel</button>
<v-button @click="showModal = false">confirm</v-button>
<v-button @click="showModal = false">cancel</v-button>
</div>
</vue-final-modal>
<button class="vfm-btn" @click="showModal = true">Open modal</button>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>

Expand Down
6 changes: 3 additions & 3 deletions docs/components/examples/basic/VApiShow.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div>
<v-modal v-model="showModal" name="VApiShow" @confirm="showModal = false" @cancel="showModal = false">
<template v-slot="{ params }"> Hi {{ params.userName }} </template>
<template v-slot="{ params }">Hi {{ params.userName }} </template>
<template v-slot:title>$vfm.show</template>
</v-modal>
<button class="vfm-btn" @click="$vfm.show('VApiShow', { userName: 'vue-final-modal' })">
<v-button highlight @click="$vfm.show('VApiShow', { userName: 'vue-final-modal' })">
Open modal
</button>
</v-button>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VBackground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<vue-final-modal v-model="showModal" content-class="modal-content">
<span class="modal__title">Hello, vue-final-modal</span>
</vue-final-modal>
<button class="vfm-btn" @click="showModal = true">Open modal</button>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VBasic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<vue-final-modal v-model="showModal">
<span class="modal__title">Hello, vue-final-modal</span>
</vue-final-modal>
<button class="vfm-btn" @click="showModal = true">Open modal</button>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>

Expand Down
22 changes: 22 additions & 0 deletions docs/components/examples/basic/VButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<button class="v-btn" v-on="$listeners"><span v-if="highlight">👉 </span><slot></slot></button>
</template>

<script>
export default {
props: {
highlight: {
type: Boolean,
default: false
}
}
}
</script>
<style scoped>
button.v-btn {
@apply px-2 py-1 border rounded;
}
button.v-btn + button.v-btn {
margin: 0 0 0 1rem;
}
</style>
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VCentered.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<vue-final-modal v-model="showModal" classes="modal-container" content-class="modal-content">
<span class="modal__title">Hello, vue-final-modal</span>
</vue-final-modal>
<button class="vfm-btn" @click="showModal = true">Open modal</button>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VCloseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>
</div>
</vue-final-modal>
<button class="vfm-btn" @click="showModal = true">Open modal</button>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</p>
</div>
</vue-final-modal>
<button class="vfm-btn" @click="showModal = true">Open modal</button>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VDynamic.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<button class="vfm-btn mb-4" @click="dynamic">Open Dynamic Modal</button>
<v-button class="mb-4" highlight @click="dynamic">Open Dynamic Modal</v-button>
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VDynamicAdvanced.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<button class="vfm-btn mb-4" @click="dynamic">Open Dynamic Modal</button>
<v-button class="mb-4" highlight @click="dynamic">Open Dynamic Modal</v-button>
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VEvents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
<template v-slot:title>Events Example!</template>
</v-modal>
<button class="vfm-btn" @click="showModal = true">Open modal</button>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>

Expand Down
24 changes: 12 additions & 12 deletions docs/components/examples/basic/VParams.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@
</p>
</div>
<div class="modal__action">
<button class="vfm-btn" @click="$vfm.hide('stackable')">
<v-button @click="$vfm.hide('stackable')">
confirm
</button>
<button class="vfm-btn" @click="$vfm.hide('stackable')">
</v-button>
<v-button @click="$vfm.hide('stackable')">
cancel
</button>
</v-button>
</div>
</template>
</vue-final-modal>
<button class="vfm-btn" @click="$vfm.show('stackable', { test: 123 })">
<v-button @click="$vfm.show('stackable', { test: 123 })">
Show modal with params
</button>
<button class="vfm-btn" @click="$vfm.toggle('stackable', null, { test: 321 })">
</v-button>
<v-button @click="$vfm.toggle('stackable', null, { test: 321 })">
Toggle modal with params
</button>
<button class="vfm-btn" @click="$vfm.show('stackable')">
</v-button>
<v-button @click="$vfm.show('stackable')">
Show modal
</button>
<button class="vfm-btn" @click="$vfm.hide('stackable')">
</v-button>
<v-button @click="$vfm.hide('stackable')">
Hide modal
</button>
</v-button>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion docs/components/examples/basic/VScrollable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>
</div>
</vue-final-modal>
<button class="vfm-btn" @click="showModal = true">Open modal</button>
<v-button highlight @click="showModal = true">Open modal</v-button>
</div>
</template>

Expand Down
Loading