8
8
<template slot="list">
9
9
<NcAppContentList class="content-list">
10
10
<div class="content-list__search">
11
- <input type="search" :placeholder="t('notes', 'Search for notes')" @input="event => searchText = event.target.value">
11
+ <NcTextField
12
+ :value.sync="searchText"
13
+ :label="t('notes', 'Search for notes')"
14
+ :show-trailing-button="searchText !== ''"
15
+ trailing-button-icon="close"
16
+ :trailing-button-label="t('Clear search')"
17
+ @trailing-button-click="searchText=''"
18
+ />
12
19
</div>
13
20
14
21
<NotesList v-if="groupedNotes.length === 1"
@@ -58,6 +65,7 @@ import {
58
65
NcAppContentList,
59
66
NcAppContentDetails,
60
67
NcButton,
68
+ NcTextField,
61
69
} from '@nextcloud/vue'
62
70
import { categoryLabel } from '../Util.js'
63
71
import NotesList from './NotesList.vue'
@@ -75,6 +83,7 @@ export default {
75
83
NcAppContentList,
76
84
NcAppContentDetails,
77
85
NcButton,
86
+ NcTextField,
78
87
Note,
79
88
NotesList,
80
89
NotesCaption,
@@ -98,6 +107,7 @@ export default {
98
107
lastYear: new Date(new Date().getFullYear() - 1, 0),
99
108
showFirstNotesOnly: true,
100
109
showNote: true,
110
+ searchText: '',
101
111
}
102
112
},
103
113
@@ -143,18 +153,11 @@ export default {
143
153
}, [])
144
154
}
145
155
},
146
- searchText: {
147
- get() {
148
- return store.state.searchText
149
- },
150
- set(value) {
151
- store.commit('updateSearchText', value)
152
- },
153
- },
154
156
},
155
157
156
158
watch: {
157
159
category() { this.showFirstNotesOnly = true },
160
+ searchText(value) { store.commit('updateSearchText', value) },
158
161
},
159
162
160
163
created() {
0 commit comments