blob: 6896ec2f61484171ed9886d96b27c5b6c2cdfd11 [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 Muranakaf9832b02020-05-12 12:04:46 -070027 PaginationPlugin,
Yoshie Muranaka3be801a2020-04-21 11:34:56 -070028 ProgressPlugin,
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080029 TablePlugin,
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070030 ToastPlugin,
31 TooltipPlugin
Derick Montaguefded0d12019-12-11 06:16:40 -060032} from 'bootstrap-vue';
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080033import Vuelidate from 'vuelidate';
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060034import i18n from './i18n';
Derick Montaguea2988f42020-01-17 13:46:30 -060035
Dixsie Wolmers97f41872020-02-23 15:56:16 -060036// Filters
37Vue.filter('formatDate', function(value) {
Dixsie Wolmers97f41872020-02-23 15:56:16 -060038 if (value instanceof Date) {
Dixsie Wolmers0e4760e2020-06-05 09:09:02 -050039 return value.toISOString().substring(0, 10);
Dixsie Wolmers97f41872020-02-23 15:56:16 -060040 }
41});
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060042
Dixsie Wolmers97f41872020-02-23 15:56:16 -060043Vue.filter('formatTime', function(value) {
44 const timeOptions = {
45 hour: 'numeric',
46 minute: 'numeric',
47 second: 'numeric',
48 timeZoneName: 'short'
49 };
50 if (value instanceof Date) {
51 return value.toLocaleTimeString('default', timeOptions);
52 }
53});
54
55// Plugins
Derick Montague676f2fc2019-12-23 20:53:49 -060056Vue.use(AlertPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060057Vue.use(BadgePlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060058Vue.use(ButtonPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080059Vue.use(BVConfigPlugin, {
Derick Montague7f970a12020-03-02 17:56:09 -060060 BFormText: { textVariant: 'secondary' },
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080061 BTable: {
62 headVariant: 'light',
63 footVariant: 'light'
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070064 },
65 BFormTags: {
66 tagVariant: 'primary',
67 addButtonVariant: 'link-primary'
Yoshie Muranaka82cca542020-04-07 10:20:37 -070068 },
69 BBadge: {
70 variant: 'primary'
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080071 }
72});
Derick Montaguea2988f42020-01-17 13:46:30 -060073Vue.use(CollapsePlugin);
Yoshie Muranaka82cca542020-04-07 10:20:37 -070074Vue.use(DropdownPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060075Vue.use(FormPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060076Vue.use(FormCheckboxPlugin);
Yoshie Muranaka37393812020-03-24 15:25:24 -070077Vue.use(FormFilePlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060078Vue.use(FormGroupPlugin);
79Vue.use(FormInputPlugin);
Yoshie Muranaka463a5702019-12-04 09:09:36 -080080Vue.use(FormRadioPlugin);
81Vue.use(FormSelectPlugin);
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070082Vue.use(FormTagsPlugin);
Yoshie Muranakac4e38ab2020-04-09 12:41:27 -070083Vue.use(InputGroupPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060084Vue.use(LayoutPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060085Vue.use(LayoutPlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060086Vue.use(LinkPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060087Vue.use(ListGroupPlugin);
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060088Vue.use(ModalPlugin);
Derick Montague42c19892020-01-17 16:10:34 -060089Vue.use(NavbarPlugin);
90Vue.use(NavPlugin);
Yoshie Muranakaf9832b02020-05-12 12:04:46 -070091Vue.use(PaginationPlugin);
Yoshie Muranaka3be801a2020-04-21 11:34:56 -070092Vue.use(ProgressPlugin);
Derick Montague42c19892020-01-17 16:10:34 -060093Vue.use(TablePlugin);
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080094Vue.use(ToastPlugin);
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070095Vue.use(TooltipPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080096Vue.use(Vuelidate);
Derick Montaguea2988f42020-01-17 13:46:30 -060097
Derick Montaguea2988f42020-01-17 13:46:30 -060098new Vue({
99 router,
100 store,
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -0600101 i18n,
Derick Montaguea2988f42020-01-17 13:46:30 -0600102 render: h => h(App)
Derick Montaguefded0d12019-12-11 06:16:40 -0600103}).$mount('#app');