Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheme editor side panel #124

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
chrabyrd marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<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"]);
chrabyrd marked this conversation as resolved.
Show resolved Hide resolved

const toggleSize = () => {
if (props.editorMax) {
emit("maximize");
} else {
emit("side");
}
};
</script>

<template>
<div class="header">
<div>
<h3>{{ $gettext("Scheme Editor Tools") }}</h3>
<div>
<Button
:aria-label="$gettext('toggle editor size')"
@click="toggleSize"
>
<i
:class="{
pi: true,
'pi-window-maximize': props.editorMax,
'pi-window-minimize': !props.editorMax,
}"
aria-hidden="true"
/>
</Button>
<Button
:aria-label="$gettext('close editor')"
@click="$emit('close')"
>
<i
class="pi pi-times"
aria-hidden="true"
/>
</Button>
</div>
</div>
</div>
</template>
<style scoped>
.header {
background-color: var(--p-surface-200);
}
.header div {
margin: 0 1rem;
display: flex;
align-items: center;
}
.header div h2 {
flex: 1;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { useGettext } from "vue3-gettext";
import Button from "primevue/button";

defineEmits(["openEditor"]);
chrabyrd marked this conversation as resolved.
Show resolved Hide resolved

const { $gettext } = useGettext();
const props = defineProps<{
titleText: string;
Expand Down
52 changes: 46 additions & 6 deletions arches_lingo/src/arches_lingo/pages/SchemePage.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,62 @@
<script setup lang="ts">
import { ref } from "vue";
import Splitter from "primevue/splitter";
import SplitterPanel from "primevue/splitterpanel";
import SchemeLicense from "@/arches_lingo/components/scheme/report/SchemeLicense.vue";
import SchemeNote from "@/arches_lingo/components/scheme/report/SchemeNote.vue";
import SchemeUri from "@/arches_lingo/components/scheme/report/SchemeUri.vue";
import SchemeStandard from "@/arches_lingo/components/scheme/report/SchemeStandard.vue";
import SchemeAuthority from "@/arches_lingo/components/scheme/report/SchemeAuthority.vue";
import SchemeEditor from "@/arches_lingo/components/scheme/editor/SchemeEditor.vue";

const editorVisible = ref(true);
const sectionVisible = ref(true);

const onMaximize = () => {
editorVisible.value = true;
sectionVisible.value = false;
};

const onSide = () => {
editorVisible.value = true;
editorVisible.value = true;
sectionVisible.value = true;
};

const onClose = () => {
editorVisible.value = false;
sectionVisible.value = true;
};

const onOpenEditor = () => {
editorVisible.value = true;
sectionVisible.value = true;
};
</script>

<template>
<div>
<Splitter>
<SplitterPanel>
<SchemeNote />
<SchemeAuthority />
<SchemeStandard />
<SchemeLicense />
<SchemeUri />
<SplitterPanel
v-if="sectionVisible"
size="75"
>
<SchemeNote @open-editor="onOpenEditor" />
<SchemeAuthority @open-editor="onOpenEditor" />
<SchemeStandard @open-editor="onOpenEditor" />
<SchemeLicense @open-editor="onOpenEditor" />
<SchemeUri @open-editor="onOpenEditor" />
</SplitterPanel>
<SplitterPanel
v-if="editorVisible"
size="25"
>
<SchemeEditor
:editor-max="sectionVisible"
@maximize="onMaximize"
@side="onSide"
@close="onClose"
/>
</SplitterPanel>
</Splitter>
</div>
Expand Down
Loading