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 NameData TypeRequiredDecription
inputMdlanyNoTwo way bound variable in which value will be set.
optionsobjectNoTo give other options with pageLabels and color obj
validationsobjectNoTo give validations
otherInfoanyNoExtra info to be passed on event.
extDisabledbooleanNoDisables any functionality on component.
evtBlurCallbackmethodNoMethod 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

Image of 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

Image of Ex


IE

Image of Ex


Tab

Image of Ex


Mobile

Image of Ex


Demo Link

Demo


Mark down usage
https://guides.github.com/features/mastering-markdown/

VersionDateDeveloped ByInformation ClassificationReviewed ByApproved By
1.012-10-2019GunjanINTERNALPrasan & TarunPrasan