Derick Montague | fded0d1 | 2019-12-11 06:16:40 -0600 | [diff] [blame] | 1 | import Vue from 'vue'; |
| 2 | import App from './App.vue'; |
| 3 | import router from './router'; |
| 4 | import store from './store'; |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 5 | import { |
Derick Montague | 676f2fc | 2019-12-23 20:53:49 -0600 | [diff] [blame] | 6 | AlertPlugin, |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 7 | BadgePlugin, |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 8 | ButtonPlugin, |
Yoshie Muranaka | 4b0fc1d | 2020-01-06 07:36:16 -0800 | [diff] [blame] | 9 | BVConfigPlugin, |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 10 | CollapsePlugin, |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 11 | FormPlugin, |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 12 | FormCheckboxPlugin, |
Yoshie Muranaka | 3739381 | 2020-03-24 15:25:24 -0700 | [diff] [blame^] | 13 | FormFilePlugin, |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 14 | FormGroupPlugin, |
| 15 | FormInputPlugin, |
Yoshie Muranaka | 463a570 | 2019-12-04 09:09:36 -0800 | [diff] [blame] | 16 | FormRadioPlugin, |
| 17 | FormSelectPlugin, |
Yoshie Muranaka | 35080ac | 2020-01-17 15:38:57 -0600 | [diff] [blame] | 18 | LayoutPlugin, |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 19 | LinkPlugin, |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 20 | ListGroupPlugin, |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 21 | ModalPlugin, |
| 22 | NavbarPlugin, |
| 23 | NavPlugin, |
Yoshie Muranaka | 0fc91e7 | 2020-02-05 11:23:06 -0800 | [diff] [blame] | 24 | TablePlugin, |
| 25 | ToastPlugin |
Derick Montague | fded0d1 | 2019-12-11 06:16:40 -0600 | [diff] [blame] | 26 | } from 'bootstrap-vue'; |
Yoshie Muranaka | 4b0fc1d | 2020-01-06 07:36:16 -0800 | [diff] [blame] | 27 | import Vuelidate from 'vuelidate'; |
Dixsie Wolmers | cbcd213 | 2020-01-30 20:58:37 -0600 | [diff] [blame] | 28 | import i18n from './i18n'; |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 29 | |
Dixsie Wolmers | 97f4187 | 2020-02-23 15:56:16 -0600 | [diff] [blame] | 30 | // Filters |
| 31 | Vue.filter('formatDate', function(value) { |
| 32 | const dateOptions = { |
| 33 | year: 'numeric', |
| 34 | month: 'short', |
| 35 | day: 'numeric' |
| 36 | }; |
| 37 | if (value instanceof Date) { |
| 38 | return value.toLocaleDateString(i18n.locale, dateOptions); |
| 39 | } |
| 40 | }); |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 41 | |
Dixsie Wolmers | 97f4187 | 2020-02-23 15:56:16 -0600 | [diff] [blame] | 42 | Vue.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 Montague | 676f2fc | 2019-12-23 20:53:49 -0600 | [diff] [blame] | 55 | Vue.use(AlertPlugin); |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 56 | Vue.use(BadgePlugin); |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 57 | Vue.use(ButtonPlugin); |
Yoshie Muranaka | 4b0fc1d | 2020-01-06 07:36:16 -0800 | [diff] [blame] | 58 | Vue.use(BVConfigPlugin, { |
Derick Montague | 7f970a1 | 2020-03-02 17:56:09 -0600 | [diff] [blame] | 59 | BFormText: { textVariant: 'secondary' }, |
Yoshie Muranaka | 4b0fc1d | 2020-01-06 07:36:16 -0800 | [diff] [blame] | 60 | BTable: { |
| 61 | headVariant: 'light', |
| 62 | footVariant: 'light' |
| 63 | } |
| 64 | }); |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 65 | Vue.use(CollapsePlugin); |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 66 | Vue.use(FormPlugin); |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 67 | Vue.use(FormCheckboxPlugin); |
Yoshie Muranaka | 3739381 | 2020-03-24 15:25:24 -0700 | [diff] [blame^] | 68 | Vue.use(FormFilePlugin); |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 69 | Vue.use(FormGroupPlugin); |
| 70 | Vue.use(FormInputPlugin); |
Yoshie Muranaka | 463a570 | 2019-12-04 09:09:36 -0800 | [diff] [blame] | 71 | Vue.use(FormRadioPlugin); |
| 72 | Vue.use(FormSelectPlugin); |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 73 | Vue.use(LayoutPlugin); |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 74 | Vue.use(LayoutPlugin); |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 75 | Vue.use(LinkPlugin); |
Dixsie Wolmers | 97d86b3 | 2019-12-02 05:07:57 -0600 | [diff] [blame] | 76 | Vue.use(ListGroupPlugin); |
Yoshie Muranaka | 35080ac | 2020-01-17 15:38:57 -0600 | [diff] [blame] | 77 | Vue.use(ModalPlugin); |
Derick Montague | 42c1989 | 2020-01-17 16:10:34 -0600 | [diff] [blame] | 78 | Vue.use(NavbarPlugin); |
| 79 | Vue.use(NavPlugin); |
| 80 | Vue.use(TablePlugin); |
Yoshie Muranaka | 0fc91e7 | 2020-02-05 11:23:06 -0800 | [diff] [blame] | 81 | Vue.use(ToastPlugin); |
Yoshie Muranaka | 4b0fc1d | 2020-01-06 07:36:16 -0800 | [diff] [blame] | 82 | Vue.use(Vuelidate); |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 83 | |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 84 | new Vue({ |
| 85 | router, |
| 86 | store, |
Dixsie Wolmers | cbcd213 | 2020-01-30 20:58:37 -0600 | [diff] [blame] | 87 | i18n, |
Derick Montague | a2988f4 | 2020-01-17 13:46:30 -0600 | [diff] [blame] | 88 | render: h => h(App) |
Derick Montague | fded0d1 | 2019-12-11 06:16:40 -0600 | [diff] [blame] | 89 | }).$mount('#app'); |