https://github.com/jkutianski/meteor-autoform-textarea-plus
Custom textarea input type with char counter & well area for AutoForm
https://github.com/jkutianski/meteor-autoform-textarea-plus
Last synced: 2 months ago
JSON representation
Custom textarea input type with char counter & well area for AutoForm
- Host: GitHub
- URL: https://github.com/jkutianski/meteor-autoform-textarea-plus
- Owner: jkutianski
- License: gpl-3.0
- Created: 2019-08-07T19:19:42.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-07T19:42:14.000Z (almost 6 years ago)
- Last Synced: 2024-10-06T04:21:45.866Z (8 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# meteor-autoform-textarea-plus
Custom textarea input type with char counter & well area for AutoForm## How to install it
`meteor add jkutianski:autoform-textarea-plus`
## How to use it
Create a SimpleSchema and set `textareaPlus` as AutoForm type
```
const SchemaTextAreaField = new SimpleSchema({
textarea: {
type: String,
label: 'Texto',
optional: false,
max: 250,
min: 200,
autoform: {
type: 'textareaPlus',
rows: 5,
placeholder: 'Placeholder',
afFormGroup: {
afWell: {
class: 'm-t-1 col-xs-12',
content: 'This is a well area for {{label}}'
},
afCounterBlock: {
class: 'help-block text-right m-t-0',
content: '{{countRestMax}} characters left'
}
}
}
}
});
```afWell & afCounterBlock content can be an String or Template
```
afWell: {
content: 'This is a well area for {{label}}'
},
afCounterBlock: {
content: '{{countRestMax}} characters left'
}
```or
```
afWell: {
content: Template && Template.textAreaWell
},
afCounterBlock: {
content: Template && Template.textAreaCounter
}
```## Template helpers
`afWell` content template helpers:
* `formId` the Form id.
* `label` the label defined on the schema.
* `placeholder` the placeholder defined on the schema.
* `max` the maximun characters defined on the schema.
* `min` the minimun characters defined on the schema.`afCounterBlock` content template helpers:
* `formId` the Form id.
* `label` the label defined on the schema.
* `count` characters count on the textarea.
* `countRestMax` character left from the max.
* `countRestMin` characters left from the min.
* `max` the maximun characters defined on the schema.
* `min` the minimun characters defined on the schema.