mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
* ✨ Implemented Vue plugins that register design system and element UI components * 💄 Replacing `any` with object type in Vue plugins
76 lines
2.2 KiB
TypeScript
76 lines
2.2 KiB
TypeScript
// @ts-nocheck
|
|
|
|
import Vue from "vue";
|
|
import Fragment from 'vue-fragment';
|
|
|
|
import "regenerator-runtime/runtime";
|
|
|
|
import VueAgile from 'vue-agile';
|
|
|
|
import {
|
|
Loading,
|
|
MessageBox,
|
|
Message,
|
|
Notification,
|
|
designSystemComponents,
|
|
elementUIComponents,
|
|
} from 'n8n-design-system';
|
|
import { ElMessageBoxOptions } from "element-ui/types/message-box";
|
|
|
|
Vue.use(Fragment.Plugin);
|
|
Vue.use(elementUIComponents);
|
|
Vue.use(designSystemComponents);
|
|
Vue.use(VueAgile);
|
|
Vue.use(Loading.directive);
|
|
|
|
Vue.prototype.$loading = Loading.service;
|
|
Vue.prototype.$msgbox = MessageBox;
|
|
|
|
Vue.prototype.$alert = async (message: string, configOrTitle: string | ElMessageBoxOptions | undefined, config: ElMessageBoxOptions | undefined) => {
|
|
let temp = config || (typeof configOrTitle === 'object' ? configOrTitle : {});
|
|
temp = {
|
|
...temp,
|
|
cancelButtonClass: 'btn--cancel',
|
|
confirmButtonClass: 'btn--confirm',
|
|
};
|
|
|
|
if (typeof configOrTitle === 'string') {
|
|
return await MessageBox.alert(message, configOrTitle, temp);
|
|
}
|
|
return await MessageBox.alert(message, temp);
|
|
};
|
|
|
|
Vue.prototype.$confirm = async (message: string, configOrTitle: string | ElMessageBoxOptions | undefined, config: ElMessageBoxOptions | undefined) => {
|
|
let temp = config || (typeof configOrTitle === 'object' ? configOrTitle : {});
|
|
temp = {
|
|
...temp,
|
|
cancelButtonClass: 'btn--cancel',
|
|
confirmButtonClass: 'btn--confirm',
|
|
distinguishCancelAndClose: true,
|
|
showClose: config.showClose || false,
|
|
closeOnClickModal: false,
|
|
};
|
|
|
|
if (typeof configOrTitle === 'string') {
|
|
return await MessageBox.confirm(message, configOrTitle, temp);
|
|
}
|
|
return await MessageBox.confirm(message, temp);
|
|
};
|
|
|
|
Vue.prototype.$prompt = async (message: string, configOrTitle: string | ElMessageBoxOptions | undefined, config: ElMessageBoxOptions | undefined) => {
|
|
let temp = config || (typeof configOrTitle === 'object' ? configOrTitle : {});
|
|
temp = {
|
|
...temp,
|
|
cancelButtonClass: 'btn--cancel',
|
|
confirmButtonClass: 'btn--confirm',
|
|
};
|
|
|
|
if (typeof configOrTitle === 'string') {
|
|
return await MessageBox.prompt(message, configOrTitle, temp);
|
|
}
|
|
return await MessageBox.prompt(message, temp);
|
|
};
|
|
|
|
Vue.prototype.$notify = Notification;
|
|
Vue.prototype.$message = Message;
|