1717 </template >
1818 </NcAppNavigationNew >
1919
20- <div class =" account-management__search" role =" search" :aria-label =" t('settings', 'Search accounts and groups')" >
21- <NcInputField
22- ref =" searchField"
23- v-model =" searchInput"
24- :label =" t('settings', 'Search accounts and groups…')"
25- :show-trailing-button =" searchInput !== ''"
26- :trailingButtonLabel =" t('settings', 'Clear search')"
27- @trailing-button-click =" clearSearch" >
28- <template #icon >
29- <NcIconSvgWrapper :path =" mdiMagnify" />
30- </template >
31- <template #trailing-button-icon >
32- <NcIconSvgWrapper :path =" mdiClose" />
33- </template >
34- </NcInputField >
35- </div >
20+ <NcAppNavigationSearch
21+ ref =" searchField"
22+ v-model =" searchInput"
23+ :label =" t('settings', 'Search accounts and groups…')" />
3624
3725 <NcAppNavigationList
3826 class =" account-management__system-list"
112100 <NcButton
113101 class =" account-management__settings-toggle"
114102 variant =" tertiary"
103+ wide
115104 @click =" isDialogOpen = true" >
116105 <template #icon >
117106 <NcIconSvgWrapper :path =" mdiCogOutline" />
118107 </template >
119- {{ t('settings', 'Account management settings') }}
108+ <span class =" account-management__settings-toggle-text" >
109+ {{ t('settings', 'Account management settings') }}
110+ </span >
120111 </NcButton >
121112 <UserSettingsDialog :open.sync =" isDialogOpen" />
122113 </template >
123114 </NcAppNavigation >
124115</template >
125116
126117<script setup lang="ts">
127- import { mdiAccountOffOutline , mdiAccountOutline , mdiClose , mdiCogOutline , mdiHistory , mdiMagnify , mdiPlus , mdiShieldAccountOutline } from ' @mdi/js'
118+ import { mdiAccountOffOutline , mdiAccountOutline , mdiCogOutline , mdiHistory , mdiPlus , mdiShieldAccountOutline } from ' @mdi/js'
128119import { translate as t } from ' @nextcloud/l10n'
129120import { useHotKey } from ' @nextcloud/vue/composables/useHotKey'
130121import debounce from ' debounce'
@@ -134,10 +125,10 @@ import NcAppNavigation from '@nextcloud/vue/components/NcAppNavigation'
134125import NcAppNavigationItem from ' @nextcloud/vue/components/NcAppNavigationItem'
135126import NcAppNavigationList from ' @nextcloud/vue/components/NcAppNavigationList'
136127import NcAppNavigationNew from ' @nextcloud/vue/components/NcAppNavigationNew'
128+ import NcAppNavigationSearch from ' @nextcloud/vue/components/NcAppNavigationSearch'
137129import NcButton from ' @nextcloud/vue/components/NcButton'
138130import NcCounterBubble from ' @nextcloud/vue/components/NcCounterBubble'
139131import NcIconSvgWrapper from ' @nextcloud/vue/components/NcIconSvgWrapper'
140- import NcInputField from ' @nextcloud/vue/components/NcInputField'
141132import AppNavigationGroupList from ' ../components/AppNavigationGroupList.vue'
142133import UserSettingsDialog from ' ../components/Users/UserSettingsDialog.vue'
143134import { useFormatGroups } from ' ../composables/useGroupsNavigation.js'
@@ -146,23 +137,19 @@ import { useStore } from '../store/index.js'
146137const route = useRoute ()
147138const store = useStore ()
148139
149- const searchField = ref <InstanceType <typeof NcInputField >>()
140+ const searchField = ref <InstanceType <typeof NcAppNavigationSearch >>()
150141const searchInput = ref (' ' )
151142const commitSearch = debounce ((query : string ) => {
152143 store .commit (' setSearchQuery' , query )
153144}, 300 )
154145watch (searchInput , (value ) => commitSearch (value ))
155- function clearSearch() {
156- commitSearch .clear ()
157- searchInput .value = ' '
158- store .commit (' setSearchQuery' , ' ' )
159- }
146+
160147onBeforeUnmount (() => commitSearch .clear ())
161148
162149// Intercept Ctrl/Cmd+F to focus the local search. useHotKey ignores the
163150// event when an input/textarea is already focused, so a second press falls
164151// through to the browser's native find-in-page.
165- useHotKey (' f' , () => searchField .value ?.focus (), { ctrl: true , stop: true , prevent: true })
152+ useHotKey (' f' , () => searchField .value ?.$refs . inputElement ?. focus (), { ctrl: true , stop: true , prevent: true })
166153
167154/** State of the 'new-account' dialog */
168155const isDialogOpen = ref (false )
@@ -216,7 +203,11 @@ function showNewUserMenu() {
216203 }
217204
218205 & __settings-toggle {
219- margin-bottom : 12px ;
206+ margin-bottom : var (--body-container-margin );
207+
208+ & -text {
209+ font-weight : 500 ;
210+ }
220211 }
221212}
222213 </style >
0 commit comments