blob: 9e0502de495818f4b03027a3d7cef5356871f61b [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 Muranaka3be801a2020-04-21 11:34:56 -070027 ProgressPlugin,
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080028 TablePlugin,
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070029 ToastPlugin,
30 TooltipPlugin
Derick Montaguefded0d12019-12-11 06:16:40 -060031} from 'bootstrap-vue';
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080032import Vuelidate from 'vuelidate';
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060033import i18n from './i18n';
Derick Montaguea2988f42020-01-17 13:46:30 -060034
Dixsie Wolmers97f41872020-02-23 15:56:16 -060035// Filters
36Vue.filter('formatDate', function(value) {
Dixsie Wolmers97f41872020-02-23 15:56:16 -060037 if (value instanceof Date) {
Dixsie Wolmers0e4760e2020-06-05 09:09:02 -050038 return value.toISOString().substring(0, 10);
Dixsie Wolmers97f41872020-02-23 15:56:16 -060039 }
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'
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070063 },
64 BFormTags: {
65 tagVariant: 'primary',
66 addButtonVariant: 'link-primary'
Yoshie Muranaka82cca542020-04-07 10:20:37 -070067 },
68 BBadge: {
69 variant: 'primary'
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080070 }
71});
Derick Montaguea2988f42020-01-17 13:46:30 -060072Vue.use(CollapsePlugin);
Yoshie Muranaka82cca542020-04-07 10:20:37 -070073Vue.use(DropdownPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060074Vue.use(FormPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060075Vue.use(FormCheckboxPlugin);
Yoshie Muranaka37393812020-03-24 15:25:24 -070076Vue.use(FormFilePlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060077Vue.use(FormGroupPlugin);
78Vue.use(FormInputPlugin);
Yoshie Muranaka463a5702019-12-04 09:09:36 -080079Vue.use(FormRadioPlugin);
80Vue.use(FormSelectPlugin);
Yoshie Muranaka532a4b02020-03-27 11:00:50 -070081Vue.use(FormTagsPlugin);
Yoshie Muranakac4e38ab2020-04-09 12:41:27 -070082Vue.use(InputGroupPlugin);
Derick Montaguee080a1a2019-12-04 16:30:08 -060083Vue.use(LayoutPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060084Vue.use(LayoutPlugin);
Derick Montaguea2988f42020-01-17 13:46:30 -060085Vue.use(LinkPlugin);
Dixsie Wolmers97d86b32019-12-02 05:07:57 -060086Vue.use(ListGroupPlugin);
Yoshie Muranaka35080ac2020-01-17 15:38:57 -060087Vue.use(ModalPlugin);
Derick Montague42c19892020-01-17 16:10:34 -060088Vue.use(NavbarPlugin);
89Vue.use(NavPlugin);
Yoshie Muranaka3be801a2020-04-21 11:34:56 -070090Vue.use(ProgressPlugin);
Derick Montague42c19892020-01-17 16:10:34 -060091Vue.use(TablePlugin);
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080092Vue.use(ToastPlugin);
Yoshie Muranaka1be6b412020-04-16 12:03:38 -070093Vue.use(TooltipPlugin);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080094Vue.use(Vuelidate);
Derick Montaguea2988f42020-01-17 13:46:30 -060095
Derick Montaguea2988f42020-01-17 13:46:30 -060096new Vue({
97 router,
98 store,
Dixsie Wolmerscbcd2132020-01-30 20:58:37 -060099 i18n,
Derick Montaguea2988f42020-01-17 13:46:30 -0600100 render: h => h(App)
Derick Montaguefded0d12019-12-11 06:16:40 -0600101}).$mount('#app');