blob: 5adc5efc4ee5e792c90b85c015da60a0e7c01150 [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,
Yoshie Muranaka82cca542020-04-07 10:20:37 -070011 DropdownPlugin,
Derick Montaguee080a1a2019-12-04 16:30:08 -060012 FormPlugin,
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060013 FormCheckboxPlugin,
Yoshie Muranaka37393812020-03-24 15:25:24 -070014 FormFilePlugin,
Derick Montaguee080a1a2019-12-04 16:30:08 -060015 FormGroupPlugin,
16 FormInputPlugin,
Yoshie Muranaka463a5702019-12-04 09:09:36 -080017 FormRadioPlugin,
18 FormSelectPlugin,
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070019 FormTagsPlugin,
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060020 LayoutPlugin,
Derick Montague42c19892020-01-17 16:10:34 -060021 LinkPlugin,
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060022 ListGroupPlugin,
Derick Montague42c19892020-01-17 16:10:34 -060023 ModalPlugin,
24 NavbarPlugin,
25 NavPlugin,
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080026 TablePlugin,
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070027 ToastPlugin,
28 TooltipPlugin
Derick Montaguefded0d12019-12-11 06:16:40 -060029} from 'bootstrap-vue';
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080030import Vuelidate from 'vuelidate';
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060031import i18n from './i18n';
Derick Montaguea2988f42020-01-17 13:46:30 -060032
Dixsie Wolmers97f41872020-02-23 15:56:16 -060033// Filters
34Vue.filter('formatDate', function(value) {
35 const dateOptions = {
36 year: 'numeric',
37 month: 'short',
38 day: 'numeric'
39 };
40 if (value instanceof Date) {
41 return value.toLocaleDateString(i18n.locale, dateOptions);
42 }
43});
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060044
Dixsie Wolmers97f41872020-02-23 15:56:16 -060045Vue.filter('formatTime', function(value) {
46 const timeOptions = {
47 hour: 'numeric',
48 minute: 'numeric',
49 second: 'numeric',
50 timeZoneName: 'short'
51 };
52 if (value instanceof Date) {
53 return value.toLocaleTimeString('default', timeOptions);
54 }
55});
56
57// Plugins
Derick Montague676f2fc2019-12-23 20:53:49 -060058Vue.use(AlertPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060059Vue.use(BadgePlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060060Vue.use(ButtonPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080061Vue.use(BVConfigPlugin, {
Derick Montague7f970a12020-03-02 17:56:09 -060062 BFormText: { textVariant: 'secondary' },
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080063 BTable: {
64 headVariant: 'light',
65 footVariant: 'light'
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070066 },
67 BFormTags: {
68 tagVariant: 'primary',
69 addButtonVariant: 'link-primary'
Yoshie Muranaka82cca542020-04-07 10:20:37 -070070 },
71 BBadge: {
72 variant: 'primary'
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080073 }
74});
Derick Montaguea2988f42020-01-17 13:46:30 -060075Vue.use(CollapsePlugin);
Yoshie Muranaka82cca542020-04-07 10:20:37 -070076Vue.use(DropdownPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060077Vue.use(FormPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060078Vue.use(FormCheckboxPlugin);
Yoshie Muranaka37393812020-03-24 15:25:24 -070079Vue.use(FormFilePlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060080Vue.use(FormGroupPlugin);
81Vue.use(FormInputPlugin);
Yoshie Muranaka463a5702019-12-04 09:09:36 -080082Vue.use(FormRadioPlugin);
83Vue.use(FormSelectPlugin);
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070084Vue.use(FormTagsPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060085Vue.use(LayoutPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060086Vue.use(LayoutPlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060087Vue.use(LinkPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060088Vue.use(ListGroupPlugin);
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060089Vue.use(ModalPlugin);
Derick Montague42c19892020-01-17 16:10:34 -060090Vue.use(NavbarPlugin);
91Vue.use(NavPlugin);
92Vue.use(TablePlugin);
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080093Vue.use(ToastPlugin);
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070094Vue.use(TooltipPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080095Vue.use(Vuelidate);
Derick Montaguea2988f42020-01-17 13:46:30 -060096
Derick Montaguea2988f42020-01-17 13:46:30 -060097new Vue({
98 router,
99 store,
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -0600100 i18n,
Derick Montaguea2988f42020-01-17 13:46:30 -0600101 render: h => h(App)
Derick Montaguefded0d12019-12-11 06:16:40 -0600102}).$mount('#app');