aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-05-16 15:57:19 -0700
committerNivesh Rajbhandari2012-05-16 15:57:19 -0700
commit95069173e145691b0059f2dcbbaa7332694ed778 (patch)
tree2158ede11ccbc2eb3a12f0b2f3c0233f0ece0a30 /node_modules/montage/ui
parent727ad95f6828821f0682aa98104783e4bbda78b4 (diff)
parentfd54dabad7cbc27a0efb0957155c00d578912909 (diff)
downloadninja-95069173e145691b0059f2dcbbaa7332694ed778.tar.gz
Merge branch 'refs/heads/dom-architecture-master' into Dom-Architecture
Diffstat (limited to 'node_modules/montage/ui')
-rw-r--r--node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js126
-rw-r--r--node_modules/montage/ui/autocomplete/result-item.reel/result-item.js33
-rw-r--r--node_modules/montage/ui/autocomplete/results-list.reel/results-list.html5
-rw-r--r--node_modules/montage/ui/autocomplete/results-list.reel/results-list.js7
-rw-r--r--node_modules/montage/ui/button.reel/button.js6
-rwxr-xr-xnode_modules/montage/ui/component-placeholder.reel/component-placeholder.js146
-rwxr-xr-xnode_modules/montage/ui/component.js163
-rw-r--r--node_modules/montage/ui/composer/key-composer.js385
-rw-r--r--node_modules/montage/ui/composer/translate-composer.js230
-rwxr-xr-xnode_modules/montage/ui/condition.reel/condition.js79
-rw-r--r--node_modules/montage/ui/controller/array-controller.js53
-rwxr-xr-xnode_modules/montage/ui/flow-bezier-spline.js163
-rw-r--r--node_modules/montage/ui/flow-path-cubic.js115
-rw-r--r--node_modules/montage/ui/flow-path-lerp.js112
-rw-r--r--node_modules/montage/ui/flow-path-linear.js83
-rw-r--r--node_modules/montage/ui/flow-path-sigmoid.js148
-rw-r--r--node_modules/montage/ui/flow-path.js215
-rw-r--r--node_modules/montage/ui/flow.reel/flow.html10
-rw-r--r--node_modules/montage/ui/flow.reel/flow.js758
-rwxr-xr-xnode_modules/montage/ui/list.reel/list.html2
-rwxr-xr-xnode_modules/montage/ui/loader.reel/loader.js15
-rw-r--r--node_modules/montage/ui/nearest-neighbor-component-search.js122
-rwxr-xr-xnode_modules/montage/ui/repetition.reel/repetition.js711
-rw-r--r--node_modules/montage/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor-base.js4
-rw-r--r--node_modules/montage/ui/rich-text-editor/rich-text-editor.reel/rich-text-editor.js4
-rw-r--r--node_modules/montage/ui/scroller.reel/scroller.html9
-rw-r--r--node_modules/montage/ui/scroller.reel/scroller.js20
-rw-r--r--node_modules/montage/ui/skeleton/range-input.reel/range-input.html18
-rw-r--r--node_modules/montage/ui/skeleton/range-input.reel/range-input.js159
-rwxr-xr-xnode_modules/montage/ui/slot.reel/slot.js262
-rwxr-xr-xnode_modules/montage/ui/substitution.reel/substitution.js14
-rwxr-xr-xnode_modules/montage/ui/tabs.reel/tabs.html3
-rwxr-xr-xnode_modules/montage/ui/template.js9
-rw-r--r--node_modules/montage/ui/token-field/token-field.reel/token-field.css40
-rw-r--r--node_modules/montage/ui/token-field/token-field.reel/token-field.html87
-rw-r--r--node_modules/montage/ui/token-field/token-field.reel/token-field.js221
-rw-r--r--node_modules/montage/ui/token-field/token.reel/token.css54
-rw-r--r--node_modules/montage/ui/token-field/token.reel/token.html45
-rw-r--r--node_modules/montage/ui/token-field/token.reel/token.js91
39 files changed, 2651 insertions, 2076 deletions
diff --git a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js
index 0ce1ab85..c9cbca74 100644
--- a/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js
+++ b/node_modules/montage/ui/autocomplete/autocomplete.reel/autocomplete.js
@@ -54,6 +54,15 @@ var Autocomplete = exports.Autocomplete = Montage.create(TextInput, {
54 value: null 54 value: null
55 }, 55 },
56 56
57 /**
58 * If the delegate returns Objects, this property can be used to derive the
59 * display string for an object. If this property is not provided, the results
60 * provided by the delegate are assumed to be String.
61 */
62 textPropertyPath: {
63 value: null
64 },
65
57 separator: { 66 separator: {
58 value: ',', 67 value: ',',
59 distinct: true 68 distinct: true
@@ -112,42 +121,40 @@ var Autocomplete = exports.Autocomplete = Montage.create(TextInput, {
112 // get the entered text after the separator 121 // get the entered text after the separator
113 var value = this._value; 122 var value = this._value;
114 123
124 if(value) {
125 var arr = value.split(this.separator).map(function(item) {
126 return item.trim();
127 });
128 this.activeTokenIndex = this._findActiveTokenIndex(this.tokens, arr);
129 this._tokens = value.split(this.separator).map(function(item) {
130 return item.trim();
131 });
132 } else {
133 this.activeTokenIndex = 0;
134 this._tokens = [];
135 }
115 136
116 if(fromInput) { 137 if(fromInput) {
117 this._valueSyncedWithInputField = true; 138 this._valueSyncedWithInputField = true;
118 if(value) { 139 this.showPopup = false;
119 var arr = value.split(this.separator).map(function(item) { 140 if(this._tokens.length && this._tokens.length > 0) {
120 return item.trim(); 141 var searchTerm = this._tokens[this.activeTokenIndex];
121 }); 142 searchTerm = searchTerm ? searchTerm.trim() : '';
122 this.activeTokenIndex = this._findActiveTokenIndex(this.tokens, arr); 143 if(searchTerm.length >= this.minLength) {
123 this._tokens = value.split(this.separator).map(function(item) { 144 var self = this;
124 return item.trim(); 145 clearTimeout(this.delayTimer);
125 }); 146 this.delayTimer = setTimeout(function() {
126 if(this._tokens.length && this._tokens.length > 0) { 147 self.delayTimer = null;
127 var searchTerm = this._tokens[this.activeTokenIndex]; 148 if (logger.isDebug) {
128 searchTerm = searchTerm ? searchTerm.trim() : ''; 149 logger.debug('SEARCH for ', searchTerm);
129 if(searchTerm.length >= this.minLength) { 150 }
130 var self = this; 151 self.performSearch(searchTerm);
131 clearTimeout(this.delayTimer); 152 }, this.delay);
132 this.delayTimer = setTimeout(function() {
133 self.delayTimer = null;
134 if (logger.isDebug) {
135 logger.debug('SEARCH for ', searchTerm);
136 }
137 self.performSearch(searchTerm);
138 }, this.delay);
139 } else {
140 this.showPopup = false;
141 }
142 } else {
143 this.showPopup = false;
144 } 153 }
145 } 154 }
155
146 } else { 156 } else {
147 this.activeTokenIndex = 0;
148 this._tokens = [];
149 this.showPopup = false; 157 this.showPopup = false;
150
151 this._valueSyncedWithInputField = false; 158 this._valueSyncedWithInputField = false;
152 this.needsDraw = true; 159 this.needsDraw = true;
153 } 160 }
@@ -239,11 +246,24 @@ var Autocomplete = exports.Autocomplete = Montage.create(TextInput, {
239 get: function() { 246 get: function() {
240 return this._suggestedValue; 247 return this._suggestedValue;
241 }, 248 },
242 set: function(value) { 249 set: function(aValue) {
243 if(value) { 250 this._suggestedValue = aValue;
244 this._suggestedValue = value; 251 if(aValue) {
245 var arr = this.tokens; 252
246 arr[this.activeTokenIndex] = this._suggestedValue; 253 var arr = this.tokens || [];
254 var token;
255
256 if(String.isString(aValue)) {
257 token = aValue;
258 } else {
259 if(this.textPropertyPath) {
260 token = aValue[this.textPropertyPath];
261 } else {
262 token = '';
263 }
264 }
265
266 arr[this.activeTokenIndex] = token;
247 this.tokens = arr; 267 this.tokens = arr;
248 this.showPopup = false; 268 this.showPopup = false;
249 } 269 }
@@ -283,6 +303,7 @@ var Autocomplete = exports.Autocomplete = Montage.create(TextInput, {
283 if (logger.isDebug) { 303 if (logger.isDebug) {
284 logger.debug('got suggestions: ', value); 304 logger.debug('got suggestions: ', value);
285 } 305 }
306
286 this.loadingStatus = 'complete'; 307 this.loadingStatus = 'complete';
287 this._suggestions = value; 308 this._suggestions = value;
288 this.showPopup = (value && value.length > 0); 309 this.showPopup = (value && value.length > 0);
@@ -305,19 +326,12 @@ var Autocomplete = exports.Autocomplete = Montage.create(TextInput, {
305 enumerable: false, 326 enumerable: false,
306 value: function(searchTerm) {