UNPKG

@nextcloud/vue

Version:
1 lines 1.78 kB
{"version":3,"file":"index.cjs","sources":["../src/plugin.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { DefineComponent, Directive, PluginObject } from 'vue'\n\nimport * as NcComponents from './components/index.js'\nimport * as NcDirectives from './directives/index.js'\n\n/**\n * Install all Nextcloud Vue components and directives globally\n *\n * @example\n * ```js\n * import { NextcloudVuePlugin } from '@nextcloud/vue'\n * import Vue from 'vue'\n *\n * // ...\n *\n * Vue.use(NextcloudVuePlugin)\n * new Vue({\n * // options\n * })\n * ```\n */\nexport const NextcloudVuePlugin: PluginObject<never> = {\n\tinstall(Vue) {\n\t\t// Install components\n\t\tObject.entries(NcComponents as { [key: string]: DefineComponent }).forEach(([name, component]) => {\n\t\t\tVue.component(component.name || name, component)\n\t\t})\n\n\t\t// Install directives\n\t\tObject.entries(NcDirectives as { [key: string]: Directive }).forEach(([name, directive]) => {\n\t\t\tVue.directive(name, directive)\n\t\t})\n\t},\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,MAAM,qBAA0C;AAAA,EACtD,QAAQ,KAAK;AAEZ,WAAO,QAAQ,YAAkD,EAAE,QAAQ,CAAC,CAAC,MAAM,SAAS,MAAM;AACjG,UAAI,UAAU,UAAU,QAAQ,MAAM,SAAS;AAAA,IAChD,CAAC;AAGD,WAAO,QAAQ,YAA4C,EAAE,QAAQ,CAAC,CAAC,MAAM,SAAS,MAAM;AAC3F,UAAI,UAAU,MAAM,SAAS;AAAA,IAC9B,CAAC;AAAA,EACF;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}