upd: add basic search widget

Closes transfem-org/Sharkey#181
This commit is contained in:
Mar0xy 2023-11-30 23:45:13 +01:00
parent 90ddbc5dcd
commit 126b3839dd
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
7 changed files with 198 additions and 0 deletions

View file

@ -65,6 +65,13 @@ const props = defineProps<{
edit: boolean;
}>();
// This will not be available for now as I don't think this is needed
// const notesSearchAvailable = (($i == null && instance.policies.canSearchNotes) || ($i != null && $i.policies.canSearchNotes));
/* if (!notesSearchAvailable) {
const wid = widgetDefs.findIndex(widget => widget === 'search');
widgetDefs.splice(wid, 1);
} */
const emit = defineEmits<{
(ev: 'updateWidgets', widgets: Widget[]): void;
(ev: 'addWidget', widget: Widget): void;

View file

@ -0,0 +1,30 @@
<template>
<MkWindow ref="window" :initialWidth="600" :initialHeight="450" :canResize="true" @closed="emit('closed')">
<template #header>
<i class="ph-magnifying-glass ph-bold ph-lg" style="margin-right: 0.5em;"></i>
<b>Result</b>
</template>
<MkNotes :key="props.noteKey" :pagination="props.notePagination"/>
</MkWindow>
</template>
<script lang="ts" setup>
import { } from 'vue';
import type { Paging } from '@/components/MkPagination.vue';
import MkNotes from '@/components/MkNotes.vue';
import MkWindow from '@/components/MkWindow.vue';
const props = defineProps<{
noteKey: string | number | symbol | undefined;
notePagination: Paging;
}>();
const emit = defineEmits<{
(ev: 'closed'): void;
}>();
</script>
<style lang="scss" module>
</style>