Skip to content

Commit 4616cc8

Browse files
committed
Merge branch 'feature/#17_Re-calculate_textarea_height_on_window_resize' into develop
2 parents 720ef40 + 34f8220 commit 4616cc8

35 files changed

+12985
-8910
lines changed

.babelrc

-6
This file was deleted.

.eslintignore

-2
This file was deleted.

.eslintrc.js

-25
This file was deleted.

.gitignore

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
node_modules/
2-
*.sublime-project
3-
*.sublime-workspace
41
.DS_Store
2+
node_modules
3+
public
4+
dist/*.gz
5+
dist/*.map
6+
coverage
7+
docs/.vuepress/dist
8+
9+
# local env files
10+
.env.local
11+
.env.*.local
12+
13+
# related test files
14+
/tests/e2e/reports
15+
/tests/e2e/videos
16+
/tests/e2e/screenshots
17+
18+
# editor directories and files
19+
.idea
20+
.vscode
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw*
26+

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [1.1.0] - 2019-09-07
8+
### Changed
9+
- make `minHeight` and `maxHeight` props reactive. by [#17](https://github.com/devstark-com/vue-textarea-autosize/issues/17) from [@deathg0d](https://github.com/deathg0d)
10+
- rewrite textarea height updating in the data-first manner. by [#15](https://github.com/devstark-com/vue-textarea-autosize/issues/15) from [@danielSONCCO](https://github.com/danielSONCCO)
11+
- rebuild the plugin with [vue-cli-plugin-p11n](https://github.com/kazupon/vue-cli-plugin-p11n)
12+
- update README.md

LICENSE

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) 2017 devstark-com
3+
Copyright (c) 2019
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
1111

1212
The above copyright notice and this permission notice shall be included in all
1313
copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+20-18
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ Vue component provides textarea with automatically adjustable height and without
1313

1414
Note
1515

16-
- You are able to handle all native events via `@eventname.native` [read more](https://vuejs.org/v2/guide/components.html#Binding-Native-Events-to-Components)
17-
- There is no CSS from box, so you are free to style it as you wish
16+
- You are able to handle all native events with `.native` modifier [read more](https://vuejs.org/v2/guide/components.html#Binding-Native-Events-to-Components)
17+
- You are able to use native attrs like this `<textarea-autosize rows="1" ... />`
18+
- There is no CSS out of the box, so you feel free to style it as you wish
1819

1920
# Install
2021

2122
Install with npm
2223
```
23-
npm install vue-textarea-autosize --save
24+
npm i -S vue-textarea-autosize
2425
```
2526
or with yarn
2627
```
2728
yarn add vue-textarea-autosize
2829
```
2930

30-
## Adding into app
31+
## Add to your app
3132

32-
In your main.js
3333
```js
3434
import Vue from 'vue'
35-
import VueTextareaAutosize from 'vue-textarea-autosize'
35+
import TextareaAutosize from 'vue-textarea-autosize'
3636

37-
Vue.use(VueTextareaAutosize)
37+
Vue.use(TextareaAutosize)
3838
```
3939

4040
# Usage
@@ -43,19 +43,19 @@ In components
4343
```html
4444
<textarea-autosize
4545
placeholder="Type something here..."
46-
ref="someName"
47-
v-model="someValue"
46+
ref="myTextarea"
47+
v-model="value"
4848
:min-height="30"
4949
:max-height="350"
5050
@blur.native="onBlurTextarea"
51-
></textarea-autosize>
51+
/>
5252
```
5353

5454
Focus/blur or select content in components
5555
```js
56-
this.$refs.someName.$el.focus()
57-
this.$refs.someName.$el.blur()
58-
this.$refs.someName.$el.select()
56+
this.$refs.myTextarea.$el.focus()
57+
this.$refs.myTextarea.$el.blur()
58+
this.$refs.myTextarea.$el.select()
5959
```
6060

6161
# Interface
@@ -64,15 +64,18 @@ this.$refs.someName.$el.select()
6464

6565
| Props | Required | Type | Default | Description |
6666
| ---------------- | --------- | --------------- | --------- | -------------|
67-
| autosize         | false | Boolean      | true | allow to enable/disable auto resizing dynamically |
68-
| minHeight | false | Number | null | min textarea height |
69-
| maxHeight | false | Number | null | max textarea height |
67+
| `v-model` | no | String, Number | '' | value binding |
68+
| `value` | no | String, Number | '' | part of the `v-model` binding |
69+
| `autosize`         | no | Boolean      | true | allow to enable/disable auto resizing dynamically |
70+
| `minHeight` | no | Number | null | min textarea height |
71+
| `maxHeight` | no | Number | null | max textarea height |
72+
| `important` | no | Boolean, Array | false | Force !important for style properties e.g. when using [http://cleanslatecss.com/](http://cleanslatecss.com/). Allowed values: `true`, `false`, all or some of `['resize', 'overflow', 'height']`|
7073

7174
### Events
7275

7376
| Name | Params | Description |
7477
| ----------|:---------|--------------|
75-
| input | value | fires on textarea content changed. part of a `v-model` binding. [read more](https://vuejs.org/v2/guide/components.html#Form-Input-Components-using-Custom-Events) |
78+
| input | value | fires on textarea content changed. part of the `v-model` binding. [read more](https://vuejs.org/v2/guide/components.html#Form-Input-Components-using-Custom-Events) |
7679

7780
### Slots
7881

@@ -83,4 +86,3 @@ There are no slots available
8386
## License
8487

8588
[MIT](http://opensource.org/licenses/MIT)
86-

babel.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/app'
4+
]
5+
}

config/webpack.config.base.js

-41
This file was deleted.

config/webpack.config.browser.js

-29
This file was deleted.

config/webpack.config.common.js

-29
This file was deleted.

config/webpack.config.dev.js

-16
This file was deleted.

demo/Demo.vue

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="demo">
3+
<h1>vue-textarea-autosize demo</h1>
4+
<textarea-autosize
5+
v-model="value"
6+
/>
7+
</div>
8+
</template>
9+
<script>
10+
export default {
11+
name: 'Demo',
12+
data () {
13+
return {
14+
value: ''
15+
}
16+
}
17+
}
18+
</script>

demo/index.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>vue-textarea-autosize demo</title>
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
</body>
10+
</html>

demo/main.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Vue from 'vue'
2+
import App from '../src/App.vue'
3+
import plugin from '../src/index'
4+
5+
Vue.use(plugin)
6+
7+
Vue.config.productionTip = false
8+
9+
new Vue({
10+
// NOTE: if you need to inject as option, you can set here!
11+
plugin,
12+
render: h => h(App)
13+
}).$mount('#app')

dist/vue-textarea-autosize.browser.js

-1
This file was deleted.

0 commit comments

Comments
 (0)