-
Notifications
You must be signed in to change notification settings - Fork 142
Expand file tree
/
Copy pathreference.js
More file actions
31 lines (26 loc) · 819 Bytes
/
reference.js
File metadata and controls
31 lines (26 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import './init-shared.js'
import Vue from 'vue'
import { translate as t } from '@nextcloud/l10n'
import { registerCustomPickerElement, NcCustomPickerRenderResult } from '@nextcloud/vue/dist/Functions/registerReference.js'
import DocumentTargetPicker from './view/DocumentTargetPicker.vue'
Vue.mixin({
methods: {
t,
},
})
registerCustomPickerElement('office-target', (el, { providerId, accessible }) => {
const Element = Vue.extend(DocumentTargetPicker)
const vueElement = new Element({
propsData: {
providerId,
accessible,
},
}).$mount(el)
return new NcCustomPickerRenderResult(vueElement.$el, vueElement)
}, (el, renderResult) => {
renderResult.object.$destroy()
})