This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
plugin.js
49 lines (41 loc) · 1.92 KB
/
plugin.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { ImageUpload } from 'quill-image-upload';
import * as VueChartJs from 'vue-chartjs';
import store from './store';
function chartJsComponent(classType) {
return {
mixins: [classType, VueChartJs.mixins.reactiveProp],
template: "",
props: {
options: {
type: Object,
default: null
}
},
mounted () {
this.renderChart(this.chartData, this.options)
}
};
}
var SanjabPlugin = {store};
SanjabPlugin.install = function (Vue, options) {
Quill.register('modules/imageUpload', ImageUpload);
Quill.register(Quill.import('attributors/class/color'), true);
Quill.register(Quill.import('attributors/class/align'), true);
Quill.register(Quill.import('attributors/class/size'), true);
Vue.use(require('bootstrap-vue').default);
Vue.use(require('vue-quill-editor').default);
Vue.use(require('vue-datetime').default);
Vue.prototype.sanjabTrans = sanjabTrans;
Vue.prototype.numberFormat = numberFormat;
Vue.prototype.$sanjabStore = store;
Vue.component('vue-bootstrap-typeahead', require('vue-bootstrap-typeahead').default);
Vue.component('tags-input', require('@voerro/vue-tagsinput').default);
Vue.component('draggable', require('vuedraggable').default);
let chartTypes = {'bar-chart': VueChartJs.Bar,'horizontal-bar-chart': VueChartJs.HorizontalBar,'doughnut-chart': VueChartJs.Doughnut,'line-chart': VueChartJs.Line,'pie-chart': VueChartJs.Pie,'polar-area-chart': VueChartJs.PolarArea,'radar-chart': VueChartJs.Radar,'bubble-chart': VueChartJs.Bubble,'scatter-chart': VueChartJs.Scatter};
for (let i in chartTypes) {
Vue.component(i, chartJsComponent(chartTypes[i]));
}
const files = require.context('./components/', true, /\.vue$/i);
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
}
export default SanjabPlugin;