-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
71 lines (65 loc) · 1.91 KB
/
index.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* eslint-disable */
import Vue from 'vue';
import EuiSwitch from './src/components/form/switch/EuiSwitch';
import EuiIcon from './src/components/icon/EuiIcon';
import EuiTable from './src/components/table/EuiTable';
import EuiPanel from './src/components/panel/EuiPanel';
import EuiFieldText from './src/components/form/field-text/EuiFieldText';
import EuiSelect from './src/components/form/select/EuiSelect';
import {EuiCheckbox, EuiCheckboxGroup} from './src/components/form/checkbox';
import EuiButtonIcon from './src/components/button/EuiButtonIcon';
import EuiButton from './src/components/button/EuiButton';
import EuiButtonEmpty from './src/components/button/EuiButtonEmpty';
import EuiCodeBlock from './src/components/code/EuiCodeBlock';
import EuiLoadingSpinner from './src/components/loading/EuiLoadingSpinner';
import EuiToast from './src/components/toast';
import {EuiModal, Modal} from './src/components/modal';
const components = [
EuiIcon,
EuiPanel,
EuiTable,
EuiSwitch,
EuiButton,
EuiButtonIcon,
EuiButtonEmpty,
EuiFieldText,
EuiSelect,
EuiCheckbox,
EuiCheckboxGroup,
EuiCodeBlock,
EuiLoadingSpinner,
EuiModal
];
// Installation of the library as a plugin
export function install(Vue, opts = {}) {
components.forEach(component => {
Vue.component(component.name, component);
});
Vue.prototype.$euitoast = EuiToast;
Vue.prototype.$euialert = Modal.alert;
Vue.prototype.$euiconfirm = Modal.confirm;
}
if (typeof window !== 'undefined' && window.Vue) {
Vue.use({install});
}
// Library export as a plugin
export default {install: install}
// Export of the components individually
export {
EuiSwitch,
EuiIcon,
EuiTable,
EuiPanel,
EuiFieldText,
EuiSelect,
EuiCheckbox,
EuiCheckboxGroup,
EuiButton,
EuiButtonIcon,
EuiButtonEmpty,
EuiCodeBlock,
EuiLoadingSpinner,
EuiModal,
EuiToast,
Modal
};