aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/native/textarea.reel/textarea.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage/ui/native/textarea.reel/textarea.js')
-rw-r--r--node_modules/montage/ui/native/textarea.reel/textarea.js127
1 files changed, 127 insertions, 0 deletions
diff --git a/node_modules/montage/ui/native/textarea.reel/textarea.js b/node_modules/montage/ui/native/textarea.reel/textarea.js
new file mode 100644
index 00000000..00f6e096
--- /dev/null
+++ b/node_modules/montage/ui/native/textarea.reel/textarea.js
@@ -0,0 +1,127 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7/**
8 @module "montage/ui/textarea.reel"
9 @requires montage/ui/component
10 @requires montage/ui/text-input
11*/
12
13var Montage = require("montage").Montage,
14Component = require("ui/component").Component,
15TextInput = require("ui/text-input").TextInput;
16
17/**
18 * Wraps the a &lt;textarea> element with binding support for the element's standard attributes. Uses an ArrayController instance to manage the element's contents and selection.
19 @class module:"montage/ui/textarea.reel".Textarea
20 @extends module:montage/ui/text-input.TextInput
21 */
22
23var Textarea = exports.Textarea = Montage.create(TextInput, /** @lends module:"montage/ui/textarea.reel".Textarea# */ {
24
25 select: { value: function() { this._element.select(); } },
26
27/**
28 The text display by the Textarea component's element.
29 @type {string}
30 @default ""
31*/
32 textContent: {
33 get: function() {
34 return this.value;
35 },
36 set: function(v) {
37 this.value = v;
38 }
39 }
40
41});
42
43Textarea.addAttributes( /** @lends module:"montage/ui/textarea.reel".Textarea# */ {
44/**
45 Specifies whether the element should be focused as soon as the page is loaded.
46 @type {boolean}
47 @default false
48*/
49 autofocus: {dataType: 'boolean'},
50
51/**
52 The maximum number of characters per line of text to display.
53 @type {number}
54 @default null
55*/
56 cols: null,
57
58/**
59 The name of the field that contains that value that specifies the element's directionality.
60 @type {string}
61 @default null
62*/
63 dirname: null,
64
65/**
66 When true, the textarea element is disabled to user input, and "disabled" is added to the element's CSS class list.
67 @type {boolean}
68 @default false
69*/
70 disabled: {dataType: 'boolean'},
71
72/**
73 The value of the <code>id</code> attribute of the form with which to associate the component's element.
74 @type string}
75 @default null
76*/
77 form: null,
78
79/**
80 The maximum allowed value length of the element.
81 @type {number}
82 @default null
83*/
84 maxlength: null,
85
86/**
87 The name associated with the textarea element.
88 @type {string}
89 @default null
90*/
91 name: null,
92
93/**
94 Placeholder text to display in the textarea before the user has entered any text.
95 @type {string}
96 @default null
97*/
98 placeholder: null,
99
100/**
101 Specifies if this control is readonly.
102 @type {boolean}
103 @default false
104*/
105 readonly: {dataType: 'boolean'},
106
107/**
108 When true, the user will be required to enter a value in the textarea before submitting the form.
109 @type {string}
110 @default false
111*/
112 required: {dataType: 'boolean'},
113
114/**
115 The number of lines of text the browser should render for the textarea.
116 @type {number}
117 @default null
118*/
119 rows: null,
120
121/**
122 If the value of this property is "hard", the browser will insert line breaks such that each line of user input has no more characters than the value specified by the <code>cols</code> property. If the value is "soft" then no line breaks will be added.
123 @type {string}
124 @default
125*/
126 wrap: null
127});