Skip to content

Commit 2828970

Browse files
committed
refactor: rename VBottomSheet and VFullScreen to ModalBottom and ModalFullscreen
1 parent 4cd60f9 commit 2828970

File tree

16 files changed

+58
-58
lines changed

16 files changed

+58
-58
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<script setup lang="ts">
2-
import { VBottomSheet } from 'vue-final-modal'
2+
import { ModalBottom } from 'vue-final-modal'
33
44
const emit = defineEmits<{
55
(e: 'update:modelValue', modelValue: boolean): void
66
}>()
77
</script>
88

99
<template>
10-
<VBottomSheet
10+
<ModalBottom
1111
@update:model-value="val => emit('update:modelValue', val)"
1212
>
1313
<div class="flex justify-center items-center h-60 bg-primary-100 dark:bg-gray-800">
1414
<VButton @click="emit('update:modelValue', false)">
1515
Close
1616
</VButton>
1717
</div>
18-
</VBottomSheet>
18+
</ModalBottom>
1919
</template>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<script setup lang="ts">
2-
import { VFullscreen } from 'vue-final-modal'
2+
import { ModalFullscreen } from 'vue-final-modal'
33
44
const emit = defineEmits<{
55
(e: 'update:modelValue', modelValue: boolean): void
66
}>()
77
</script>
88

99
<template>
10-
<VFullscreen
10+
<ModalFullscreen
1111
content-class="p-4 bg-primary-50 dark:bg-gray-800"
1212
@update:model-value="val => emit('update:modelValue', val)"
1313
>
@@ -17,5 +17,5 @@ const emit = defineEmits<{
1717
<VButton @click="emit('update:modelValue', false)">
1818
Close
1919
</VButton>
20-
</VFullscreen>
20+
</ModalFullscreen>
2121
</template>

docs/content/1.index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Powerful Features
7979
#title
8080
Built-in HOCs
8181
#description
82-
Provide Higher-Order Components including `<VFullscreen>`{lang=ts}, `<VBottomSheet>`{lang=ts}.
82+
Provide Higher-Order Components including `<ModalFullscreen>`{lang=ts}, `<ModalBottom>`{lang=ts}.
8383
::
8484

8585
::card

docs/content/2.get-started/1.guide/1.concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ These are the core concepts you need to know about vue-final-modal and its appro
2020
- Trap keyboard focus within modal element (uses [focus-trap]([/api/components/vue-final-modal#focustrap](https://github.com/focus-trap/focus-trap)) for best web accessibility).
2121
- Full control to the zIndex of the nested modals (see [zIndexFn prop](/api/components/vue-final-modal#zindexfn)).
2222
- Customizable `<Transition>` for the modal content and overlay.
23-
- Provide Higher order components including [VFullscreen](/api/components/v-fullscreen) and [VBottomSheet](/api/components/v-bottom-sheet).
23+
- Provide Higher order components including [ModalFullscreen](/api/components/v-fullscreen) and [ModalBottom](/api/components/v-bottom-sheet).
2424
- Fully tree-shakable! Only what you use will get imported.
2525
- Tiny footprint! Only 4.x kB! Vue Final Modal focuses on the core functionality of modals, leaves the complex CSS up to the developer.
2626
::

docs/content/3.api/1.components/2.v-full-screen.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# `<VFullscreen>`
1+
# `<ModalFullscreen>`
22

33
## Template structure
44

5-
This is the simplify template of the `<VFullscreen>`{lang=ts}.
5+
This is the simplify template of the `<ModalFullscreen>`{lang=ts}.
66
It will be helpful for understanding the naming of [props](#props).
77

8-
```html [VFullscreen.vue]
8+
```html [ModalFullscreen.vue]
99
<template>
1010
<div class="vfm">
1111
<div class=vfm__content>
@@ -20,10 +20,10 @@ It will be helpful for understanding the naming of [props](#props).
2020
## Props
2121

2222
::alert{type=info}
23-
`<VFullscreen>`{lang=ts} extends all [props](/api/components/vue-final-modal#props) from `<VueFinalModal>`{lang=ts}.
23+
`<ModalFullscreen>`{lang=ts} extends all [props](/api/components/vue-final-modal#props) from `<VueFinalModal>`{lang=ts}.
2424
::
2525

26-
`<VFullscreen>`{lang=ts} also provides the following properties:
26+
`<ModalFullscreen>`{lang=ts} also provides the following properties:
2727

2828
### hideOverlay
2929

@@ -68,7 +68,7 @@ When set `:preventNavigationGestures="true"`{lang=ts}, there will be two invisib
6868
## Events
6969

7070
::alert{type=info}
71-
`<VFullscreen>`{lang=ts} extends all [events](/api/components/vue-final-modal#events) from `<VueFinalModal>`{lang=ts}.
71+
`<ModalFullscreen>`{lang=ts} extends all [events](/api/components/vue-final-modal#events) from `<VueFinalModal>`{lang=ts}.
7272
::
7373

7474
## Slots

docs/content/3.api/1.components/3.v-bottom-sheet.md renamed to docs/content/3.api/1.components/3.modal-bottom.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# `<VBottomSheet>`
1+
# `<ModalBottom>`
22

33
## Template structure
44

5-
This is the simplify template of the `<VBottomSheet>`{lang=ts}.
5+
This is the simplify template of the `<ModalBottom>`{lang=ts}.
66
It will be helpful for understanding the naming of [props](#props).
77

8-
```html [VBottomSheet.vue]
8+
```html [ModalBottom.vue]
99
<template>
1010
<div class="vfm">
1111
<div class=vfm__content>
@@ -20,10 +20,10 @@ It will be helpful for understanding the naming of [props](#props).
2020
## Props
2121

2222
::alert{type=info}
23-
`<VBottomSheet>`{lang=ts} extends all [props](/api/components/vue-final-modal#props) from `<VueFinalModal>`{lang=ts}.
23+
`<ModalBottom>`{lang=ts} extends all [props](/api/components/vue-final-modal#props) from `<VueFinalModal>`{lang=ts}.
2424
::
2525

26-
`<VBottomSheet>`{lang=ts} also provides the following properties:
26+
`<ModalBottom>`{lang=ts} also provides the following properties:
2727

2828
### closeDirection
2929

@@ -44,7 +44,7 @@ Threshold for swipe to close
4444
## Events
4545

4646
::alert{type=info}
47-
`<VBottomSheet>`{lang=ts} extends all [events](/api/components/vue-final-modal#events) from `<VueFinalModal>`{lang=ts}.
47+
`<ModalBottom>`{lang=ts} extends all [events](/api/components/vue-final-modal#events) from `<VueFinalModal>`{lang=ts}.
4848
::
4949

5050
## Slots

docs/content/4.use-cases/6.fullscreen-modal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ head.title: 'Fullscreen Modal | Examples'
44

55
# Fullscreen Modal
66

7-
Create a `<Fullscreen>` component with `<VFullscreen>` and TailwindCSS.
7+
Create a `<Fullscreen>` component with `<ModalFullscreen>` and TailwindCSS.
88

99
## `<Fullscreen>` component
1010

docs/content/4.use-cases/7.bottom-sheet-modal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ head.title: 'Bottom Sheet Modal | Examples'
44

55
# Bottom Sheet Modal
66

7-
Create a `<BottomSheet>` component with `<VBottomSheet>` and TailwindCSS.
7+
Create a `<BottomSheet>` component with `<ModalBottom>` and TailwindCSS.
88

99
## `<BottomSheet>` component
1010

packages/vue-final-modal/src/components/VBottomSheet/VBottomSheet.vue renamed to packages/vue-final-modal/src/components/ModalBottom/ModalBottom.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { computed, ref, watch } from 'vue'
44
import type { VueFinalModalEmits } from '../VueFinalModal/VueFinalModal.vue'
55
import VueFinalModal from '../VueFinalModal/VueFinalModal.vue'
66
import { vueFinalModalProps } from '../VueFinalModal/VueFinalModalProps'
7-
import { vBottomSheetProps } from './VBottomSheetProps'
7+
import { modalBottomProps } from './ModalBottomProps'
88
import { useSwipeToClose } from '~/useSwipeToClose'
99
import { useVfmAttrs } from '~/useApi'
1010
11-
export interface VBottomSheetEmits extends VueFinalModalEmits {}
11+
export interface ModalBottomEmits extends VueFinalModalEmits {}
1212
1313
defineOptions({
1414
inheritAttrs: false,
1515
})
1616
1717
// eslint-disable-next-line vue/define-macros-order
18-
const props = defineProps(vBottomSheetProps)
19-
const emit = defineEmits<VBottomSheetEmits>()
18+
const props = defineProps(modalBottomProps)
19+
const emit = defineEmits<ModalBottomEmits>()
2020
2121
const vfmAttrs = useVfmAttrs({
2222
props,

packages/vue-final-modal/src/components/VBottomSheet/VBottomSheetProps.ts renamed to packages/vue-final-modal/src/components/ModalBottom/ModalBottomProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PropType } from 'vue'
22
import { vueFinalModalProps } from '../VueFinalModal/VueFinalModalProps'
33

4-
export const vBottomSheetProps = {
4+
export const modalBottomProps = {
55
...vueFinalModalProps,
66
/**
77
* @description The direction of swiping to close the bottom sheet modal

packages/vue-final-modal/src/components/VFullscreen/VFullscreen.vue renamed to packages/vue-final-modal/src/components/ModalFullscreen/ModalFullscreen.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { computed, ref, watch } from 'vue'
44
import type { VueFinalModalEmits } from '../VueFinalModal/VueFinalModal.vue'
55
import VueFinalModal from '../VueFinalModal/VueFinalModal.vue'
66
import { vueFinalModalProps } from '../VueFinalModal/VueFinalModalProps'
7-
import { vFullscreenProps } from './VFullscreenProps'
7+
import { modalFullscreenProps } from './ModalFullscreenProps'
88
import { useSwipeToClose } from '~/useSwipeToClose'
99
import { useVfmAttrs } from '~/useApi'
1010
11-
export interface VFullscreenEmits extends VueFinalModalEmits {}
11+
export interface ModalFullscreenEmits extends VueFinalModalEmits {}
1212
1313
defineOptions({
1414
inheritAttrs: false,
1515
})
1616
1717
// eslint-disable-next-line vue/define-macros-order
18-
const props = defineProps(vFullscreenProps)
19-
const emit = defineEmits<VFullscreenEmits>()
18+
const props = defineProps(modalFullscreenProps)
19+
const emit = defineEmits<ModalFullscreenEmits>()
2020
2121
const vfmAttrs = useVfmAttrs({
2222
props,

packages/vue-final-modal/src/components/VFullscreen/VFullscreenProps.ts renamed to packages/vue-final-modal/src/components/ModalFullscreen/ModalFullscreenProps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PropType } from 'vue'
22
import { vueFinalModalProps } from '../VueFinalModal/VueFinalModalProps'
33

4-
export const vFullscreenProps = {
4+
export const modalFullscreenProps = {
55
...vueFinalModalProps,
66
/**
77
* @description Hide the overlay or not.
@@ -46,7 +46,7 @@ export const vFullscreenProps = {
4646
* :showSwipeBanner="true"
4747
* ```
4848
* ```html
49-
* <VFullscreen
49+
* <ModalFullscreen
5050
* ...
5151
* closeDirection="RIGHT"
5252
* :showSwipeBanner="true"
@@ -55,7 +55,7 @@ export const vFullscreenProps = {
5555
* <div style="position: absolute; height: 100%; top: 0; left: 0; width: 10px;" />
5656
* </template>
5757
* ...modal content
58-
* </VFullscreen>
58+
* </ModalFullscreen>
5959
* ```
6060
*/
6161
showSwipeBanner: {

packages/vue-final-modal/src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import ModalsContainer from './components/ModalsContainer.vue'
22
import CoreModal from './components/CoreModal/CoreModal.vue'
33
import VueFinalModal from './components/VueFinalModal/VueFinalModal.vue'
4-
import VFullscreen from './components/VFullscreen/VFullscreen.vue'
5-
import VBottomSheet from './components/VBottomSheet/VBottomSheet.vue'
4+
import ModalFullscreen from './components/ModalFullscreen/ModalFullscreen.vue'
5+
import ModalBottom from './components/ModalBottom/ModalBottom.vue'
66

77
/** Types */
88
export * from './Modal'
@@ -15,18 +15,18 @@ export {
1515
ModalsContainer,
1616
CoreModal,
1717
VueFinalModal,
18-
VBottomSheet,
19-
VFullscreen,
18+
ModalBottom,
19+
ModalFullscreen,
2020
}
2121

2222
export { coreModalProps } from './components/CoreModal/CoreModalProps'
2323
export { vueFinalModalProps } from './components/VueFinalModal/VueFinalModalProps'
24-
export { vFullscreenProps } from './components/VFullscreen/VFullscreenProps'
25-
export { vBottomSheetProps } from './components/VBottomSheet/VBottomSheetProps'
24+
export { modalFullscreenProps } from './components/ModalFullscreen/ModalFullscreenProps'
25+
export { modalBottomProps } from './components/ModalBottom/ModalBottomProps'
2626

2727
export type { VueFinalModalEmits } from './components/VueFinalModal/VueFinalModal.vue'
28-
export type { VFullscreenEmits } from './components/VFullscreen/VFullscreen.vue'
29-
export type { VBottomSheetEmits } from './components/VBottomSheet/VBottomSheet.vue'
28+
export type { ModalFullscreenEmits } from './components/ModalFullscreen/ModalFullscreen.vue'
29+
export type { ModalBottomEmits } from './components/ModalBottom/ModalBottom.vue'
3030

3131
/** Composables */
3232
export { useVfm, useModal, useVfmAttrs } from './useApi'

viteplay/src/components/VBottomSheet/Basic.example.vue renamed to viteplay/src/components/ModalBottom/Basic.example.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { markRaw, ref } from 'vue'
3-
import { ModalsContainer, VBottomSheet, useModal, useVfm } from 'vue-final-modal'
3+
import { ModalsContainer, ModalBottom, useModal, useVfm } from 'vue-final-modal'
44
import DefaultSlot from '../DefaultSlot.vue'
55
66
const show = ref(false)
@@ -9,10 +9,10 @@ const theModalId = Symbol('theModalId')
99
const { toggle } = useVfm()
1010
1111
const bottomSheet = useModal<
12-
InstanceType<typeof VBottomSheet>['$props'],
12+
InstanceType<typeof ModalBottom>['$props'],
1313
InstanceType<typeof DefaultSlot>['$props']
1414
>({
15-
component: markRaw(VBottomSheet),
15+
component: markRaw(ModalBottom),
1616
attrs: {
1717
background: 'interactive',
1818
contentStyle: {
@@ -48,7 +48,7 @@ function beforeOpen(e: any) {
4848
<button @click="() => bottomSheet.open()">
4949
create bottom sheet component
5050
</button>
51-
<VBottomSheet
51+
<ModalBottom
5252
v-model="show"
5353
:modal-id="theModalId"
5454
content-style="background-color: #fff; border-top-left-radius: 12px; border-top-right-radius: 12px;"
@@ -70,7 +70,7 @@ function beforeOpen(e: any) {
7070
<div style="min-height: 500px">
7171
Direct use vfm
7272
</div> -->
73-
</VBottomSheet>
73+
</ModalBottom>
7474
</div>
7575

7676
<div v-for="i in 1000" :key="i">

viteplay/src/components/VFullScreen/Basic.example.vue renamed to viteplay/src/components/ModalFullscreen/Basic.example.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<script setup lang="ts">
22
import { markRaw, ref } from 'vue'
3-
import { ModalsContainer, VFullscreen, useModal, useVfm } from 'vue-final-modal'
3+
import { ModalsContainer, ModalFullscreen, useModal, useVfm } from 'vue-final-modal'
44
import DefaultSlot from '../DefaultSlot.vue'
55
66
const show = ref(false)
77
const theModalId = Symbol('theModalId')
88
const { toggle } = useVfm()
99
1010
const fullscreenModal = useModal<
11-
InstanceType<typeof VFullscreen>['$props'],
11+
InstanceType<typeof ModalFullscreen>['$props'],
1212
InstanceType<typeof DefaultSlot>['$props']
1313
>({
14-
component: markRaw(VFullscreen),
14+
component: markRaw(ModalFullscreen),
1515
attrs: {
1616
background: 'interactive',
1717
closeDirection: 'RIGHT',
@@ -47,7 +47,7 @@ const fullscreenModal = useModal<
4747
<button @click="() => fullscreenModal.open()">
4848
create full screen component
4949
</button>
50-
<VFullscreen
50+
<ModalFullscreen
5151
v-model="show"
5252
:modal-id="theModalId"
5353
close-direction="RIGHT"
@@ -76,7 +76,7 @@ const fullscreenModal = useModal<
7676
<div style="height: 500px">
7777
Direct use vfm
7878
</div>
79-
</VFullscreen>
79+
</ModalFullscreen>
8080
</div>
8181

8282
<div v-for="i in 1000" :key="i">

viteplay/vite.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ export default defineConfig({
2727
examples: `${examplesPath}/VueFinalModal/*.example.vue`,
2828
},
2929
{
30-
title: 'VBottomSheet',
31-
component: `${componentPath}/VBottomSheet/VBottomSheet.vue`,
32-
examples: `${examplesPath}/VBottomSheet/*.example.vue`,
30+
title: 'ModalBottom',
31+
component: `${componentPath}/ModalBottom/ModalBottom.vue`,
32+
examples: `${examplesPath}/ModalBottom/*.example.vue`,
3333
},
3434
{
35-
title: 'VFullscreen',
36-
component: `${componentPath}/VFullscreen/VFullscreen.vue`,
37-
examples: `${examplesPath}/VFullscreen/*.example.vue`,
35+
title: 'ModalFullscreen',
36+
component: `${componentPath}/ModalFullscreen/ModalFullscreen.vue`,
37+
examples: `${examplesPath}/ModalFullscreen/*.example.vue`,
3838
},
3939
],
4040
// base route for the development pages

0 commit comments

Comments
 (0)