blob: 17fc50fa36971100864d6cadc400a23387b7de3a [file] [log] [blame]
Derick Montaguefded0d12019-12-11 06:16:40 -06001import Vue from 'vue';
2import App from './App.vue';
3import router from './router';
4import store from './store';
Derick Montaguea2988f42020-01-17 13:46:30 -06005import {
Derick Montague676f2fc2019-12-23 20:53:49 -06006 AlertPlugin,
Dixsie Wolmers97d86b32019-12-02 05:07:57 -06007 BadgePlugin,
Derick Montaguea2988f42020-01-17 13:46:30 -06008 ButtonPlugin,
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -08009 BVConfigPlugin,
Derick Montaguea2988f42020-01-17 13:46:30 -060010 CollapsePlugin,
Derick Montaguee080a1a2019-12-04 16:30:08 -060011 FormPlugin,
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060012 FormCheckboxPlugin,
Yoshie Muranaka37393812020-03-24 15:25:24 -070013 FormFilePlugin,
Derick Montaguee080a1a2019-12-04 16:30:08 -060014 FormGroupPlugin,
15 FormInputPlugin,
Yoshie Muranaka463a5702019-12-04 09:09:36 -080016 FormRadioPlugin,
17 FormSelectPlugin,
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060018 LayoutPlugin,
Derick Montague42c19892020-01-17 16:10:34 -060019 LinkPlugin,
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060020 ListGroupPlugin,
Derick Montague42c19892020-01-17 16:10:34 -060021 ModalPlugin,
22 NavbarPlugin,
23 NavPlugin,
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080024 TablePlugin,
25 ToastPlugin
Derick Montaguefded0d12019-12-11 06:16:40 -060026} from 'bootstrap-vue';
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080027import Vuelidate from 'vuelidate';
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060028import i18n from './i18n';
Derick Montaguea2988f42020-01-17 13:46:30 -060029
Dixsie Wolmers97f41872020-02-23 15:56:16 -060030// Filters
31Vue.filter('formatDate', function(value) {
32 const dateOptions = {
33 year: 'numeric',
34 month: 'short',
35 day: 'numeric'
36 };
37 if (value instanceof Date) {
38 return value.toLocaleDateString(i18n.locale, dateOptions);
39 }
40});
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060041
Dixsie Wolmers97f41872020-02-23 15:56:16 -060042Vue.filter('formatTime', function(value) {
43 const timeOptions = {
44 hour: 'numeric',
45 minute: 'numeric',
46 second: 'numeric',
47 timeZoneName: 'short'
48 };
49 if (value instanceof Date) {
50 return value.toLocaleTimeString('default', timeOptions);
51 }
52});
53
54// Plugins
Derick Montague676f2fc2019-12-23 20:53:49 -060055Vue.use(AlertPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060056Vue.use(BadgePlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060057Vue.use(ButtonPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080058Vue.use(BVConfigPlugin, {
Derick Montague7f970a12020-03-02 17:56:09 -060059 BFormText: { textVariant: 'secondary' },
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080060 BTable: {
61 headVariant: 'light',
62 footVariant: 'light'
63 }
64});
Derick Montaguea2988f42020-01-17 13:46:30 -060065Vue.use(CollapsePlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060066Vue.use(FormPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060067Vue.use(FormCheckboxPlugin);
Yoshie Muranaka37393812020-03-24 15:25:24 -070068Vue.use(FormFilePlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060069Vue.use(FormGroupPlugin);
70Vue.use(FormInputPlugin);
Yoshie Muranaka463a5702019-12-04 09:09:36 -080071Vue.use(FormRadioPlugin);
72Vue.use(FormSelectPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060073Vue.use(LayoutPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060074Vue.use(LayoutPlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060075Vue.use(LinkPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060076Vue.use(ListGroupPlugin);
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060077Vue.use(ModalPlugin);
Derick Montague42c19892020-01-17 16:10:34 -060078Vue.use(NavbarPlugin);
79Vue.use(NavPlugin);
80Vue.use(TablePlugin);
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080081Vue.use(ToastPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080082Vue.use(Vuelidate);
Derick Montaguea2988f42020-01-17 13:46:30 -060083
Derick Montaguea2988f42020-01-17 13:46:30 -060084new Vue({
85 router,
86 store,
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060087 i18n,
Derick Montaguea2988f42020-01-17 13:46:30 -060088 render: h => h(App)
Derick Montaguefded0d12019-12-11 06:16:40 -060089}).$mount('#app');