235235 </DetailsHeader >
236236
237237 <!-- qrcode -->
238- <Modal
238+ <NcDialog
239239 v-if =" qrcode "
240240 id="qrcode-modal"
241241 size="small"
242- :clear-view-delay =" - 1 "
243242 :name =" contact .displayName "
244- :close-button-contained =" false "
245243 @close =" closeQrModal " >
246244 <img
247245 :src =" `data:image/svg+xml;base64,${qrcode}`"
248246 :alt =" t('contacts', 'Contact vCard as QR code')"
249247 class =" qrcode"
250248 width =" 400" >
251- </Modal >
249+ </NcDialog >
252250
253251 <!-- pick addressbook when cloning contact -->
254- <Modal
252+ <NcDialog
255253 v-if =" showPickAddressbookModal "
256254 id="pick-addressbook-modal"
257- :clear-view-delay = " - 1 "
258- :name = " t ( ' contacts ' , ' Pick an address book ' ) "
255+ :name = " t ( ' contacts ' , ' Clone contact ' ) "
256+ :buttons = " buttonsPickAddressbookModal "
259257 @close =" closePickAddressbookModal " >
260258 <NcSelect
261- ref="pickAddressbook"
262259 v-model =" pickedAddressbook "
263- class="address-book"
264- :allow-empty =" false "
260+ required
265261 :options =" copyableAddressbooksOptions "
266262 :placeholder =" t (' contacts' , ' Select address book' )"
263+ :aria-label-combobox =" t (' contacts' , ' Select address book' )"
267264 label="name" />
268- <button @click =" closePickAddressbookModal" >
269- {{ t('contacts', 'Cancel') }}
270- </button >
271- <button class =" primary" @click =" cloneContact" >
272- {{ t('contacts', 'Clone contact') }}
273- </button >
274- </Modal >
265+ </NcDialog >
275266
276267 <!-- contact details loading -->
277268 <IconLoading v-if =" loadingData " :size =" 20 " class="contact-details" />
@@ -403,8 +394,8 @@ import {
403394 NcAppContentDetails as AppContentDetails ,
404395 NcEmptyContent as EmptyContent ,
405396 NcLoadingIcon as IconLoading ,
406- NcModal as Modal ,
407397 NcButton ,
398+ NcDialog ,
408399 NcEmptyContent ,
409400 NcInputField ,
410401 NcRelatedResourcesPanel ,
@@ -470,7 +461,7 @@ export default defineComponent({
470461 IconLoading,
471462 PencilIcon,
472463 CheckIcon,
473- Modal ,
464+ NcDialog ,
474465 NcSelect,
475466 NcInputField,
476467 PropertyGroups,
@@ -550,6 +541,19 @@ export default defineComponent({
550541 calendarPanelHasError: false ,
551542 sharedState: reactive ({ validEmail: true , validUrl: true }),
552543 lastUsedAddressBook: undefined ,
544+
545+ buttonsPickAddressbookModal: [
546+ {
547+ variant: ' tertiary' ,
548+ callback: this .closePickAddressbookModal ,
549+ label: t (' contacts' , ' Cancel' ),
550+ },
551+ {
552+ variant: ' primary' ,
553+ callback: this .cloneContact ,
554+ label: t (' contacts' , ' Clone contact' ),
555+ },
556+ ],
553557 }
554558 },
555559
@@ -1152,6 +1156,7 @@ export default defineComponent({
11521156 await this .copyContactToAddressbook (this .addressbooksOptions [0 ].id )
11531157 } else {
11541158 this .showPickAddressbookModal = true
1159+ return false
11551160 }
11561161 },
11571162
@@ -1253,46 +1258,16 @@ section.contact-details {
12531258}
12541259
12551260#qrcode- modal {
1256- : deep (.modal - container ) {
1257- display: flex;
1258- padding: 10px ;
1259- background- color: #fff;
1260- .qrcode {
1261- max- width: 100 % ;
1262- }
1261+ .qrcode {
1262+ max- width: 100 % ;
12631263 }
12641264}
12651265
12661266: deep (.v - select .select ) {
12671267 min- width: 0 ;
1268- flex: 1 auto;
1269- }
1270-
1271- : deep (.v - select .select .vs__selected - options), : deep (.vs__search ) {
1272- min- height: unset;
1273- margin: 0 ! important;
1274- }
1275-
1276- : deep (.vs__selected ) {
1277- height: calc (var (-- default- clickable- area) - var (-- default- grid- baseline)) ! important;
1278- margin: 0 ! important;
1279- }
1280-
1281- #pick- addressbook- modal {
1282- : deep (.modal - container ) {
1283- display: flex;
1284- overflow: visible;
1285- flex- wrap: wrap;
1286- justify- content: space- evenly;
1287- margin- bottom: 20px ;
1288- padding: 10px ;
1289- background- color: #fff;
1290- .multiselect {
1291- flex: 1 1 100 % ;
1292- width: 100 % ;
1293- margin- bottom: 20px ;
1294- }
1295- }
1268+ width: 100 % ;
1269+ max- width: 100 % ;
1270+ margin: 0 ;
12961271}
12971272
12981273.action - item {
@@ -1332,10 +1307,6 @@ section.contact-details {
13321307 color: var (-- color- primary- element);
13331308}
13341309
1335- .address - book {
1336- min- width: 260px ! important;
1337- }
1338-
13391310.empty - content {
13401311 height: 100 % ;
13411312}
@@ -1350,14 +1321,6 @@ section.contact-details {
13501321 box- shadow: none ! important;
13511322}
13521323
1353- : deep (.vs__selected - options ) {
1354- max- height: 30px ;
1355- }
1356-
1357- : deep (.v - select ) {
1358- margin- bottom: 0 ! important;
1359- }
1360-
13611324.quick - actions {
13621325 display: flex;
13631326}
0 commit comments