-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(base-modal): migrate base-modal component and side effects (#1479)
- Loading branch information
1 parent
a160a0a
commit 610ec16
Showing
8 changed files
with
287 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/_vue3-migration-test/src/components/modals/test-base-modal.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<div class="base-modal"> | ||
<button @click="open = true">Open modal</button> | ||
<BaseModal | ||
@click:overlay="open = false" | ||
@focusin:body="open = false" | ||
:open="open" | ||
:focusOnOpen="true" | ||
referenceSelector=".header" | ||
:animation="Fade" | ||
:overlayAnimation="Fade" | ||
contentClass="content" | ||
overlayClass="overlay" | ||
> | ||
<h1>Hello</h1> | ||
<p>The modal is working</p> | ||
<button @click="open = false">Close modal</button> | ||
</BaseModal> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
import BaseModal from '../../../../x-components/src/components/modals/base-modal.vue'; | ||
import Fade from '../../../../x-components/src/components/animations/fade.vue'; | ||
const open = ref(false); | ||
</script> | ||
|
||
<style> | ||
.base-modal { | ||
.content { | ||
background: white; | ||
margin: auto; | ||
width: 50%; | ||
border: 3px solid green; | ||
padding: 10px; | ||
} | ||
.overlay { | ||
background-color: red; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
&--leave-to, | ||
&--enter { | ||
opacity: 0; | ||
opacity: 0 !important; | ||
} | ||
} | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.