listview component

This commit is contained in:
2023-05-17 07:43:53 +02:00
parent 0c4c7782e0
commit 95648988ef
9 changed files with 65 additions and 6 deletions

11
components.d.ts vendored
View File

@@ -9,11 +9,14 @@ export {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
Autocomplete: typeof import('./src/components/Autocomplete.vue')['default'] Autocomplete: typeof import('./src/components/Note/Autocomplete.vue')['default']
Hamburger: typeof import('./src/components/Hamburger.vue')['default'] Hamburger: typeof import('./src/components/TopBar/Hamburger.vue')['default']
Logo: typeof import('./src/components/Logo.vue')['default'] List: typeof import('./src/components/ViewModes/List.vue')['default']
ListView: typeof import('./src/components/ViewModes/ListView.vue')['default']
Logo: typeof import('./src/components/TopBar/Logo.vue')['default']
Mindmap: typeof import('./src/components/ViewModes/Mindmap.vue')['default']
Modal: typeof import('./src/components/Modal.vue')['default'] Modal: typeof import('./src/components/Modal.vue')['default']
Note: typeof import('./src/components/Note.vue')['default'] Note: typeof import('./src/components/ViewModes/Note.vue')['default']
NoteEditor: typeof import('./src/components/Note/NoteEditor.vue')['default'] NoteEditor: typeof import('./src/components/Note/NoteEditor.vue')['default']
NoteReferences: typeof import('./src/components/Note/NoteReferences.vue')['default'] NoteReferences: typeof import('./src/components/Note/NoteReferences.vue')['default']
NoteToolbar: typeof import('./src/components/Note/NoteToolbar.vue')['default'] NoteToolbar: typeof import('./src/components/Note/NoteToolbar.vue')['default']

View File

@@ -21,12 +21,14 @@ const sideBarCollapsed = ref(false)
:class="sideBarCollapsed ? 'ml-0' : 'ml-sidebar'" :class="sideBarCollapsed ? 'ml-0' : 'ml-sidebar'"
> >
<Note <Note
v-if="activeNote" v-if="activeViewMode.name === 'Note' && activeNote"
:key="activeNote.id" :key="activeNote.id"
:note="activeNote" :note="activeNote"
class="" class=""
@update="(note) => updateNote(note.id, note)" @update="(note) => updateNote(note.id, note)"
/> />
<ListView v-else-if="activeViewMode.name === 'List'" />
<ListView v-else-if="activeViewMode.name === 'Mindmap'" />
</main> </main>
</div> </div>
</template> </template>

View File

@@ -14,7 +14,7 @@ import AutoformatPlugin from '@ckeditor/ckeditor5-autoformat/src/autoformat'
import ContextedPlugin from '@/ckeditor/ContextedPlugin' import ContextedPlugin from '@/ckeditor/ContextedPlugin'
import { mdToHtml, htmlToMd } from '@/utils/markdown' import { mdToHtml, htmlToMd } from '@/utils/markdown'
import { getNoteByTitle, setActiveNote, addNote } from '@/composables/useNotes' import { getNoteByTitle, setActiveNote, addNote } from '@/composables/useNotes'
import Autocomplete from '@/components/Autocomplete.vue' import Autocomplete from '@/components/Note/Autocomplete.vue'
const props = defineProps<{ note: Note }>() const props = defineProps<{ note: Note }>()

View File

@@ -0,0 +1,54 @@
<template>
<div class="overflow-x-auto">
<table class="table-compact table w-full">
<!-- head -->
<thead>
<tr>
<th>
<label>
<input type="checkbox" class="checkbox-primary checkbox checkbox-sm" />
</label>
</th>
<th>Note title</th>
<th>References</th>
<th>Modified</th>
</tr>
</thead>
<tbody>
<!-- row 1 -->
<tr class="hover">
<th>
<label>
<input type="checkbox" class="checkbox-primary checkbox checkbox-sm" />
</label>
</th>
<td>Cy Ganderton</td>
<td>Quality Control Specialist</td>
<td>Blue</td>
</tr>
<!-- row 2 -->
<tr class="hover">
<th>
<label>
<input type="checkbox" class="checkbox-primary checkbox checkbox-sm" />
</label>
</th>
<td>Hart Hagerty</td>
<td>Desktop Support Technician</td>
<td>Purple</td>
</tr>
<!-- row 3 -->
<tr class="hover">
<th>
<label>
<input type="checkbox" class="checkbox-primary checkbox checkbox-sm" />
</label>
</th>
<td>Brice Swyre</td>
<td>Tax Accountant</td>
<td>Red</td>
</tr>
</tbody>
</table>
</div>
</template>

View File