Skip to content

Commit a019b38

Browse files
Merge branch 'release/v1.1.0'
2 parents c6cb7f0 + 91c6390 commit a019b38

File tree

13 files changed

+128
-29
lines changed

13 files changed

+128
-29
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
VUE_APP_PACKAGE_JSON=''
33

44
# TAG must be corresponding with the version tag in package.json, need to modify it when new version releases
5-
TAG=1.0.0
5+
TAG=1.1.0

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ module.exports = {
4646
'vue/html-indent': 'error',
4747
'vue/html-quotes': 'error',
4848
'vue/mustache-interpolation-spacing': 'error',
49-
'vue/html-self-closing': 'error'
49+
'vue/html-self-closing': 'error',
50+
'no-unused-vars': 'error'
5051
},
5152
parserOptions: {
5253
parser: '@typescript-eslint/parser',

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# [1.1.0](https://github.com/johnnymillergh/vuetify-typescript-playground/compare/v1.0.0...v1.1.0) (2019-12-30)
2+
3+
4+
### Features
5+
6+
* **$Directive:** add customized directive `Throttled Click` ([fdd17cf](https://github.com/johnnymillergh/vuetify-typescript-playground/commit/fdd17cfaa375126fa3344b7c3af0421ec88704b5))
7+
* **$Theme:** adaptive color scheme support ([7da3520](https://github.com/johnnymillergh/vuetify-typescript-playground/commit/7da3520b436bd043c2271201976487fd56ab9145))
8+
* **$Theme:** add self-adaptive color scheme ([ffe12e6](https://github.com/johnnymillergh/vuetify-typescript-playground/commit/ffe12e6a4dff2f0e9055fdf607d90f642c3a148b))
9+
10+
11+
### Performance Improvements
12+
13+
* **$ESLint:** add new rule for ESLint ([abcb400](https://github.com/johnnymillergh/vuetify-typescript-playground/commit/abcb4007f70400c20151b1e11c7a20ab92899b01))
14+
* **$package.json:** add dependencies ([0fb370e](https://github.com/johnnymillergh/vuetify-typescript-playground/commit/0fb370e679ca699f639f32dda16487b923be91e2))
15+
16+
17+
### BREAKING CHANGES
18+
19+
* **$Theme:** adaptive color scheme support.
20+
* **$Theme:** self-adaptive color scheme acording user's computer
21+
setting (dark or light)
22+
* **$Directive:** Throttled Click is a customized directive which can prevent user mouse input from triggering for several times in specific
23+
duration.
24+
25+
26+
127
# [1.0.0](https://github.com/johnnymillergh/vuetify-typescript-playground/compare/v0.1.2...v1.0.0) (2019-12-30)
228

329

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module.exports = {
22
presets: [
33
'@vue/cli-plugin-babel/preset'
4+
],
5+
plugins: [
6+
'@babel/plugin-proposal-optional-chaining'
47
]
58
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuetify-typescript-playground",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"license": "Apache-2.0",
55
"description": "Vuetify Typescript Playground",
66
"author": {
@@ -34,7 +34,9 @@
3434
},
3535
"dependencies": {
3636
"@mdi/font": "4.7.95",
37+
"@types/lodash": "4.14.149",
3738
"core-js": "3.6.1",
39+
"lodash": "4.17.15",
3840
"roboto-fontface": "*",
3941
"vue": "2.6.11",
4042
"vue-class-component": "7.1.0",
@@ -44,6 +46,7 @@
4446
"vuex": "3.1.2"
4547
},
4648
"devDependencies": {
49+
"@babel/plugin-proposal-optional-chaining": "^7.7.5",
4750
"@types/jest": "^24.0.19",
4851
"@typescript-eslint/eslint-plugin": "2.13.0",
4952
"@typescript-eslint/parser": "2.13.0",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Vue from 'vue'
2+
import throttledClickDirectiveOptions from './throttled-click-directive-options'
3+
4+
Vue.directive('throttled-click', throttledClickDirectiveOptions)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* eslint-disable no-unused-vars */
2+
import { DirectiveOptions } from 'vue'
3+
import _ from 'lodash'
4+
5+
const throttledClickDirectiveOptions: DirectiveOptions = {
6+
inserted (el, directiveBinding) {
7+
const wait: number = directiveBinding.arg ? +directiveBinding.arg : 1000
8+
el.addEventListener('click', _.throttle(event => {
9+
directiveBinding.value.call(el, event)
10+
}, wait))
11+
}
12+
}
13+
14+
export default throttledClickDirectiveOptions

src/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ import store from './store'
55
import vuetify from './plugins/vuetify'
66
import 'roboto-fontface/css/roboto/roboto-fontface.css'
77
import '@mdi/font/css/materialdesignicons.css'
8+
import '@/directives/throttled-click'
9+
import { ColorSchemeUtil } from '@/utils/color-scheme-util'
810

911
Vue.config.productionTip = false
1012

11-
new Vue({
13+
const vue = new Vue({
1214
router,
1315
store,
1416
vuetify,
1517
render: h => h(App)
1618
}).$mount('#app')
19+
20+
const media = window.matchMedia('(prefers-color-scheme: dark)')
21+
media.addEventListener('change', () => {
22+
vue.$vuetify.theme.dark = ColorSchemeUtil.isDarkMode()
23+
})

src/plugins/vuetify.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/plugins/vuetify/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Vue from 'vue'
2+
import Vuetify from 'vuetify/lib'
3+
import { ColorSchemeUtil } from '@/utils/color-scheme-util'
4+
import { darkTheme, lightTheme } from '@/plugins/vuetify/theme'
5+
6+
Vue.use(Vuetify)
7+
8+
export default new Vuetify({
9+
theme: {
10+
dark: ColorSchemeUtil.isDarkMode(),
11+
options: {
12+
customProperties: true
13+
},
14+
themes: {
15+
dark: darkTheme,
16+
light: lightTheme
17+
}
18+
}
19+
})

0 commit comments

Comments
 (0)