-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
874b141
commit b141d12
Showing
3 changed files
with
112 additions
and
6 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
arches_lingo/src/arches_lingo/components/scheme/editor/SchemeEditor.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,64 @@ | ||
<script lang="ts"> | ||
const MAXIMIZE = "maximize"; | ||
const SIDE = "side"; | ||
const CLOSE = "close"; | ||
</script> | ||
|
||
<script setup lang="ts"> | ||
import { useGettext } from "vue3-gettext"; | ||
import Button from "primevue/button"; | ||
const { $gettext } = useGettext(); | ||
const props = defineProps<{ | ||
editorMax: boolean; | ||
}>(); | ||
const emit = defineEmits([MAXIMIZE, SIDE, CLOSE]); | ||
const toggleSize = () => { | ||
if (props.editorMax) { | ||
emit(MAXIMIZE); | ||
} else { | ||
emit(SIDE); | ||
} | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div class="header"> | ||
<div> | ||
<h2>{{ $gettext("Scheme Editor Tools") }}</h2> | ||
<div> | ||
<Button @click="toggleSize" | ||
><i | ||
:class="{ | ||
pi: true, | ||
'pi-window-maximize': props.editorMax, | ||
'pi-window-minimize': !props.editorMax, | ||
}" | ||
aria-hidden="true" | ||
/> | ||
</Button> | ||
<Button @click="$emit(CLOSE)" | ||
><i | ||
class="pi pi-times" | ||
aria-hidden="true" | ||
/> | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
<style scoped> | ||
.header { | ||
background-color: #ddd; | ||
} | ||
.header div { | ||
margin: 0 1rem; | ||
display: flex; | ||
align-items: center; | ||
} | ||
.header div h2 { | ||
flex: 1; | ||
} | ||
</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