blob: 4b0722e24974311135b803ba5fff5ccae25c3cde [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 Muranaka532a4b02020-03-27 11:00:50 -070018 FormTagsPlugin,
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060019 LayoutPlugin,
Derick Montague42c19892020-01-17 16:10:34 -060020 LinkPlugin,
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060021 ListGroupPlugin,
Derick Montague42c19892020-01-17 16:10:34 -060022 ModalPlugin,
23 NavbarPlugin,
24 NavPlugin,
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080025 TablePlugin,
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070026 ToastPlugin,
27 TooltipPlugin
Derick Montaguefded0d12019-12-11 06:16:40 -060028} from 'bootstrap-vue';
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080029import Vuelidate from 'vuelidate';
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060030import i18n from './i18n';
Derick Montaguea2988f42020-01-17 13:46:30 -060031
Dixsie Wolmers97f41872020-02-23 15:56:16 -060032// Filters
33Vue.filter('formatDate', function(value) {
34 const dateOptions = {
35 year: 'numeric',
36 month: 'short',
37 day: 'numeric'
38 };
39 if (value instanceof Date) {
40 return value.toLocaleDateString(i18n.locale, dateOptions);
41 }
42});
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060043
Dixsie Wolmers97f41872020-02-23 15:56:16 -060044Vue.filter('formatTime', function(value) {
45 const timeOptions = {
46 hour: 'numeric',
47 minute: 'numeric',
48 second: 'numeric',
49 timeZoneName: 'short'
50 };
51 if (value instanceof Date) {
52 return value.toLocaleTimeString('default', timeOptions);
53 }
54});
55
56// Plugins
Derick Montague676f2fc2019-12-23 20:53:49 -060057Vue.use(AlertPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060058Vue.use(BadgePlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060059Vue.use(ButtonPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080060Vue.use(BVConfigPlugin, {
Derick Montague7f970a12020-03-02 17:56:09 -060061 BFormText: { textVariant: 'secondary' },
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080062 BTable: {
63 headVariant: 'light',
64 footVariant: 'light'
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070065 },
66 BFormTags: {
67 tagVariant: 'primary',
68 addButtonVariant: 'link-primary'
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080069 }
70});
Derick Montaguea2988f42020-01-17 13:46:30 -060071Vue.use(CollapsePlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060072Vue.use(FormPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060073Vue.use(FormCheckboxPlugin);
Yoshie Muranaka37393812020-03-24 15:25:24 -070074Vue.use(FormFilePlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060075Vue.use(FormGroupPlugin);
76Vue.use(FormInputPlugin);
Yoshie Muranaka463a5702019-12-04 09:09:36 -080077Vue.use(FormRadioPlugin);
78Vue.use(FormSelectPlugin);
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070079Vue.use(FormTagsPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060080Vue.use(LayoutPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060081Vue.use(LayoutPlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060082Vue.use(LinkPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060083Vue.use(ListGroupPlugin);
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060084Vue.use(ModalPlugin);
Derick Montague42c19892020-01-17 16:10:34 -060085Vue.use(NavbarPlugin);
86Vue.use(NavPlugin);
87Vue.use(TablePlugin);
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080088Vue.use(ToastPlugin);
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070089Vue.use(TooltipPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080090Vue.use(Vuelidate);
Derick Montaguea2988f42020-01-17 13:46:30 -060091
Derick Montaguea2988f42020-01-17 13:46:30 -060092new Vue({
93 router,
94 store,
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060095 i18n,
Derick Montaguea2988f42020-01-17 13:46:30 -060096 render: h => h(App)
Derick Montaguefded0d12019-12-11 06:16:40 -060097}).$mount('#app');