blob: b59afd9aac9c36b6e69be66d582f720a98fc4d64 [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 Muranakac4e38ab2020-04-09 12:41:27 -070020 InputGroupPlugin,
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060021 LayoutPlugin,
Derick Montague42c19892020-01-17 16:10:34 -060022 LinkPlugin,
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060023 ListGroupPlugin,
Derick Montague42c19892020-01-17 16:10:34 -060024 ModalPlugin,
25 NavbarPlugin,
26 NavPlugin,
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080027 TablePlugin,
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070028 ToastPlugin,
29 TooltipPlugin
Derick Montaguefded0d12019-12-11 06:16:40 -060030} from 'bootstrap-vue';
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080031import Vuelidate from 'vuelidate';
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060032import i18n from './i18n';
Derick Montaguea2988f42020-01-17 13:46:30 -060033
Dixsie Wolmers97f41872020-02-23 15:56:16 -060034// Filters
35Vue.filter('formatDate', function(value) {
36 const dateOptions = {
37 year: 'numeric',
38 month: 'short',
39 day: 'numeric'
40 };
41 if (value instanceof Date) {
42 return value.toLocaleDateString(i18n.locale, dateOptions);
43 }
44});
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060045
Dixsie Wolmers97f41872020-02-23 15:56:16 -060046Vue.filter('formatTime', function(value) {
47 const timeOptions = {
48 hour: 'numeric',
49 minute: 'numeric',
50 second: 'numeric',
51 timeZoneName: 'short'
52 };
53 if (value instanceof Date) {
54 return value.toLocaleTimeString('default', timeOptions);
55 }
56});
57
58// Plugins
Derick Montague676f2fc2019-12-23 20:53:49 -060059Vue.use(AlertPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060060Vue.use(BadgePlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060061Vue.use(ButtonPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080062Vue.use(BVConfigPlugin, {
Derick Montague7f970a12020-03-02 17:56:09 -060063 BFormText: { textVariant: 'secondary' },
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080064 BTable: {
65 headVariant: 'light',
66 footVariant: 'light'
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070067 },
68 BFormTags: {
69 tagVariant: 'primary',
70 addButtonVariant: 'link-primary'
Yoshie Muranaka82cca542020-04-07 10:20:37 -070071 },
72 BBadge: {
73 variant: 'primary'
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080074 }
75});
Derick Montaguea2988f42020-01-17 13:46:30 -060076Vue.use(CollapsePlugin);
Yoshie Muranaka82cca542020-04-07 10:20:37 -070077Vue.use(DropdownPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060078Vue.use(FormPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060079Vue.use(FormCheckboxPlugin);
Yoshie Muranaka37393812020-03-24 15:25:24 -070080Vue.use(FormFilePlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060081Vue.use(FormGroupPlugin);
82Vue.use(FormInputPlugin);
Yoshie Muranaka463a5702019-12-04 09:09:36 -080083Vue.use(FormRadioPlugin);
84Vue.use(FormSelectPlugin);
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070085Vue.use(FormTagsPlugin);
Yoshie Muranakac4e38ab2020-04-09 12:41:27 -070086Vue.use(InputGroupPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060087Vue.use(LayoutPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060088Vue.use(LayoutPlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060089Vue.use(LinkPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060090Vue.use(ListGroupPlugin);
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060091Vue.use(ModalPlugin);
Derick Montague42c19892020-01-17 16:10:34 -060092Vue.use(NavbarPlugin);
93Vue.use(NavPlugin);
94Vue.use(TablePlugin);
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080095Vue.use(ToastPlugin);
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070096Vue.use(TooltipPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080097Vue.use(Vuelidate);
Derick Montaguea2988f42020-01-17 13:46:30 -060098
Derick Montaguea2988f42020-01-17 13:46:30 -060099new Vue({
100 router,
101 store,
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -0600102 i18n,
Derick Montaguea2988f42020-01-17 13:46:30 -0600103 render: h => h(App)
Derick Montaguefded0d12019-12-11 06:16:40 -0600104}).$mount('#app');