99 <!-- Wrapper for content & navigation -->
1010 <div class =" entity-picker" >
1111 <!-- Search -->
12- <div class =" entity-picker__search" >
13- <div class =" entity-picker__search-icon icon-search" />
14- <input ref =" input"
15- v-model =" searchQuery"
16- :placeholder =" t('contacts', 'Search {types}', {types: searchPlaceholderTypes})"
17- class =" entity-picker__search-input"
18- type =" search"
19- @input =" onSearch" >
12+ <div class =" entity-picker__heading" >
13+ <h2 class =" entity-picker__title" >
14+ {{ t('contacts', 'Invite members to team') }}
15+ </h2 >
16+ </div >
17+ <div class =" entity-picker__search-container" >
18+ <div class =" entity-picker__search" >
19+ <div class =" entity-picker__search-icon icon-search" />
20+ <input ref =" input"
21+ v-model =" searchQuery"
22+ :placeholder =" t('contacts', 'Search {types}', {types: searchPlaceholderTypes})"
23+ class =" entity-picker__search-input"
24+ type =" search"
25+ @input =" onSearch" >
26+ </div >
27+ <Button v-if =" canInviteGuests"
28+ type =" button"
29+ variant =" tertiary-no-background"
30+ :title =" t('contacts', 'Add guest')"
31+ :aria-label =" t('contacts', 'Add guest')"
32+ @click =" onGuestButtonClick" >
33+ <IconAccountPlusOutline :size =" 20" />
34+ </Button >
2035 </div >
2136
2237 <!-- Loading -->
8398import debounce from ' debounce'
8499import VirtualList from ' vue-virtual-scroll-list'
85100import {
101+ NcButton as Button ,
86102 NcEmptyContent as EmptyContent ,
87103 NcLoadingIcon as IconLoading ,
88104 NcModal as Modal ,
89105} from ' @nextcloud/vue'
106+ import { subscribe } from ' @nextcloud/event-bus'
90107import IconSearch from ' vue-material-design-icons/Magnify.vue'
108+ import IconAccountPlusOutline from ' vue-material-design-icons/AccountPlusOutline.vue'
91109import EntityBubble from ' ./EntityBubble.vue'
92110import EntitySearchResult from ' ./EntitySearchResult.vue'
93111
94112export default {
95113 name: ' EntityPicker' ,
96114
97115 components: {
116+ Button,
98117 EmptyContent,
99118 EntityBubble,
119+ IconAccountPlusOutline,
100120 IconSearch,
101121 IconLoading,
102122 Modal,
@@ -184,6 +204,7 @@ export default {
184204
185205 data () {
186206 return {
207+ canInviteGuests: !! window ? .OCA ? .Guests ? .openGuestDialog ,
187208 searchQuery: ' ' ,
188209 localSelection: {},
189210 EntitySearchResult,
@@ -294,6 +315,10 @@ export default {
294315 this .$refs .input .focus ()
295316 this .$refs .input .select ()
296317 })
318+
319+ if (this .canInviteGuests ) {
320+ subscribe (' guests:user:created' , this .addGuest )
321+ }
297322 },
298323
299324 methods: {
@@ -359,6 +384,12 @@ export default {
359384 this .onPick (entity)
360385 }
361386 },
387+
388+ onGuestButtonClick () {
389+ if (this .canInviteGuests ) {
390+ window ? .OCA ? .Guests ? .openGuestDialog (' contacts' )
391+ }
392+ },
362393 },
363394
364395}
@@ -393,13 +424,25 @@ $icon-margin: math.div($clickable-area - $icon-size, 2);
393424 min- height: $dialog- height;
394425 height: 100 % ;
395426 padding: $dialog- padding;
427+ padding- top: 10px ;
396428 box- sizing: border- box;
397429
430+ & __title {
431+ margin- top: 0px ;
432+ }
433+
398434 & __search {
399435 position: relative;
400436 display: flex;
401437 align- items: center;
402438 width: 95 % ;
439+
440+ & - container {
441+ display: flex;
442+ flex- flow: row nowrap;
443+ column- gap: 12px ;
444+ }
445+
403446 & - input {
404447 width: 100 % ;
405448 height: $clickable- area - $entity- spacing ! important;
@@ -419,7 +462,6 @@ $icon-margin: math.div($clickable-area - $icon-size, 2);
419462 display: flex;
420463 overflow- y: auto;
421464 align- content: flex- start;
422- flex : 1 0 auto ;
423465 flex- wrap: wrap;
424466 justify- content: flex- start;
425467 // half a line height to know there is more lines
@@ -438,7 +480,7 @@ $icon-margin: math.div($clickable-area - $icon-size, 2);
438480
439481 & __options {
440482 overflow- y: auto;
441- flex : 1 1 100 % ;
483+ flex: 1 1 auto ;
442484 margin: $entity- spacing 0 ;
443485 }
444486
@@ -469,7 +511,7 @@ it back */
469511}
470512
471513: deep (.modal - container__close ) {
472- margin-top : 19 px ;
514+ margin- top: 10px ;
473515}
474516
475517< / style>
0 commit comments