Commit 5145937e authored by GuiΩ's avatar GuiΩ
Browse files

fix(types): add IContextMenuOption in types.ts

parent b7d0b1c8
......@@ -4,16 +4,8 @@
-->
<script lang="ts" setup>
import {nextTick, reactive, ref, watchEffect} from "vue";
export interface IContextMenuOption {
name?: string,
type?: 'item' | 'submenu' | 'rule',
callback?: (e?: MouseEvent) => void,
disabled?: boolean,
hidden?: boolean,
// options?: IContextMenuOption
}
import {nextTick, reactive, ref} from "vue";
import type {IContextMenuOption} from "@/types";
interface IContextMenuState {
visible: boolean,
......@@ -26,7 +18,6 @@ import {nextTick, reactive, ref, watchEffect} from "vue";
visible: true,
})
async function show(event: MouseEvent, options: IContextMenuOption[]) {
state.options = options
root.value!.style.left = (event.pageX || event.clientX) + 'px'
......
......@@ -22,16 +22,16 @@ Events:
-->
<script lang="ts" setup>
import Datepicker from '@vuepic/vue-datepicker';
import Datepicker from '@vuepic/vue-datepicker'
import '@vuepic/vue-datepicker/dist/main.css'
import {computed, inject, nextTick, reactive, ref} from "vue";
import {useFeuillesStore} from "@/store/feuilles";
import FeuilleListFeuilleSeanceSlot from "@/components/FeuilleListFeuilleSeanceSlot.vue";
import {useLatexStore} from "@/store/latex";
import type {IQuestionPosee, ISeanceR, SeanceID} from "@/types";
import {useClassesStore} from "@/store/classes";
import {useUndoablesStore} from "@/store/undoables";
import {computed, inject, nextTick, reactive, ref} from "vue"
import {useFeuillesStore} from "@/store/feuilles"
import FeuilleListFeuilleSeanceSlot from "@/components/FeuilleListFeuilleSeanceSlot.vue"
import {useLatexStore} from "@/store/latex"
import type {IContextMenuOption, IQuestionPosee, ISeanceR, SeanceID} from "@/types"
import {useClassesStore} from "@/store/classes"
import {useUndoablesStore} from "@/store/undoables"
interface IFeuilleListFeuilleSeanceState {
scoresEditing: boolean,
......
......@@ -13,9 +13,8 @@
import {useThemesStore} from "@/store/themes"
import {useClassesStore} from "@/store/classes"
import {useUndoablesStore} from "@/store/undoables";
import type {ClasseID, IQuestionDropEvent, IQuestionPosee, QuestionID, SeanceID, ThemeID} from "@/types";
import type {ClasseID, IContextMenuOption, IQuestionDropEvent, IQuestionPosee, QuestionID, SeanceID, ThemeID} from "@/types";
import ContextMenu from "@/components/ContextMenu.vue";
import type {IContextMenuOption} from "@/components/ContextMenu.vue";
import MessageBox from "@/components/MessageBox.vue";
const classes = useClassesStore()
......
......@@ -81,7 +81,7 @@ Events:
state.question.avalider = false
state.question.validee = false
setThemesSelection(state.question.themes!);
modal.value.show();
modal.value!.show();
await nextTick()
themeTree.value?.initOpenThemes()
}
......@@ -96,7 +96,7 @@ Events:
state.question = JSON.parse(JSON.stringify(state.oldQuestion))
}
setThemesSelection(state.question.themes!)
modal.value.show()
modal.value!.show()
// await nextTick()
// themeTree.value?.initOpenThemes()
}
......@@ -133,7 +133,7 @@ Events:
.then(() => {
if (questions.getSaveStatus)
close()
modal.value.setWaiting(false)
modal.value!.setWaiting(false)
})
}
......@@ -145,7 +145,7 @@ Events:
}
function close() {
modal.value.close()
modal.value!.close()
}
defineExpose({edit, duplicate})
......
......@@ -27,6 +27,15 @@ export interface IClipboardSeance {
questionsPosees: IClipboardQuestionPosee[]
}
export interface IContextMenuOption {
name?: string,
type?: 'item' | 'submenu' | 'rule',
callback?: (e?: MouseEvent) => void,
disabled?: boolean,
hidden?: boolean,
// options?: IContextMenuOption
}
export interface IQuestionDropEvent {
event: DragEvent,
seanceSourceId?: SeanceID,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment