Textarea
- Shows a textarea.
Features/Functionality
- Shows a textarea with the height and width as per outer container's dimension.
- Value will be set on blur in inputMdl variable passed.
- Disabled textarea is shown if disable is true.
- Blur event callback will called on blur.
- Placeholder is given in textbox. It can be overridden, by overriding 'placeholder' variable in pageLabels.
- Component is container responsive.
- It is cross browser compatible. (IE11, Edge, Firefox, chrome).
Basic Usage
Dependencies
- jquery
- shared styles
- shared scripts
HTML Structure
<require from="{user_path}/textareas/textarea"></require>
<cst-textarea input-mdl.bind="{inputMdl}" other-info.bind="{otherInfo}" ext-disabled.bind="{disabled}" evt-blur-callback.bind="{evtBlurCallback}"></cst-textarea>
Bindable Properties
Property Name | Data Type | Required | Decription |
---|---|---|---|
inputMdl | any | No | Two way bound variable in which value will be set. |
options | object | No | To give other options with pageLabels and color obj |
validations | object | No | To give validations |
otherInfo | any | No | Extra info to be passed on event. |
extDisabled | boolean | No | Disables any functionality on component. |
evtBlurCallback | method | No | Method to be called on blur. |
Structure of bindable properties
inputMdl
inputMdl = '' // On pageload default textarea value and will return textbox value
options
options = {
minLength: '',
maxLength: '',
pageLabel: {}, // Override page labels
pageColorData: {} // Override css colour porperty
}
validations
vailidations {
isRequired: true/false
/* To be developed:
minLength: '',
maxLength: '',
isEmail: true/false,
regEx: ''
*/
}
evtBlurCallback
evtBlurCallback(_event,_info);
_info = {
overrideContext: overrideContext,
otherInfo: otherInfo,
value: item
}
CSS Overrinding
- Following classes are given to override CSS:
- .cst-textarea-container-override : Container Class
- .cst-textarea-element-override: Element Class
Note
- While giving the classes in page, give them in nested structure.
Rules
Component measurements
** box-sizing: border-box is used. So width and height will be dimensions + padding.
Working Example
HTML
<template>
<require from="./shared/core_comp/textareas/textarea"></require>
<div>
<cst-textarea input-mdl.bind="inputMdl" other-info.bind="otherInfo" ext-disabled.bind="disabled" evt-blur-callback.bind="evtBlurCallback"></cst-textarea>
</div>
</template>
CSS
.cst-ex-textarea-textbox {
.cst-textarea-element-override {
height: 180px !important;
width: 150px !important;
}
}
JS
class MyCls{
constructor(){
this.inputMdl = "Welcome";
this.otherInfo = {
qId : 2
};
this.disabled = false;
}
evtBlurCallback(_event,_info){
console.log(_event);
console.log(_info);
}
}
export { MyCls }
Example Screen Shots
Desktop
IE
Tab
Mobile
Demo Link
Mark down usage
https://guides.github.com/features/mastering-markdown/
Version | Date | Developed By | Information Classification | Reviewed By | Approved By |
---|---|---|---|---|---|
1.0 | 12-10-2019 | Gunjan | INTERNAL | Prasan & Tarun | Prasan |