[15/20] git commit: [flex-asjs] [refs/heads/feature/mdl] - Text Input with floating text

2016-10-26 Thread carlosrovira
Text Input with floating text


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/828bb418
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/828bb418
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/828bb418

Branch: refs/heads/feature/mdl
Commit: 828bb4182ada8344983242d64842691d367f4281
Parents: a8c4fe4
Author: Carlos Rovira 
Authored: Wed Oct 19 02:21:37 2016 +0200
Committer: Carlos Rovira 
Committed: Wed Oct 26 10:59:07 2016 +0200

--
 .../flexjs/MDLExample/src/main/flex/App.mxml|  5 ++-
 .../main/flex/org/apache/flex/mdl/TextInput.as  | 45 +++-
 2 files changed, 48 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/828bb418/examples/flexjs/MDLExample/src/main/flex/App.mxml
--
diff --git a/examples/flexjs/MDLExample/src/main/flex/App.mxml 
b/examples/flexjs/MDLExample/src/main/flex/App.mxml
index 95dad1b..636b72b 100644
--- a/examples/flexjs/MDLExample/src/main/flex/App.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml
@@ -57,7 +57,9 @@ limitations under the License.
 
 
 
-
+
+
+
 
 
 
@@ -66,6 +68,7 @@ limitations under the License.
 
 
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/828bb418/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
--
diff --git 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
index 4617678..48d71bf 100644
--- 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
+++ 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
@@ -49,8 +49,17 @@ package org.apache.flex.mdl
super();
}

+COMPILE::JS
+{
+private var _textNode:Text;
+}
+
 /**
  * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion HTMLDivElement
+ * @flexjsignorecoercion HTMLInputElement
+ * @flexjsignorecoercion HTMLLabelElement
+ * @flexjsignorecoercion Text
  */
 COMPILE::JS
 override protected function createElement():WrappedHTMLElement
@@ -70,7 +79,7 @@ package org.apache.flex.mdl
 label = document.createElement('label') as HTMLLabelElement;
 label.className = "mdl-textfield__label";
 
-textNode = document.createTextNode('') as Text;
+_textNode = textNode = document.createTextNode('') as Text;
 label.appendChild(textNode);
 
 div.appendChild(input);
@@ -94,5 +103,39 @@ package org.apache.flex.mdl
 return element;
 }
 
+private var _mdlEffect:String = "";
+
+public function get mdlEffect():String
+{
+return _mdlEffect;
+}
+
+public function set mdlEffect(value:String):void
+{
+_mdlEffect = value;
+COMPILE::JS 
+{
+element.className = 'mdl-textfield mdl-js-textfield ' + 
_mdlEffect;
+}
+}
+
+/**
+ *  @private
+ *  @flexjsignorecoercion HTMLInputElement
+ */
+   override public function set text(value:String):void
+   {
+COMPILE::SWF
+{
+//inSetter = true;
+//ITextModel(model).text = value;
+//inSetter = false;
+}
+COMPILE::JS
+{
+_textNode.text = value;
+dispatchEvent(new Event('textChange'));
+}
+   }
}
 }



[15/20] git commit: [flex-asjs] [refs/heads/feature/mdl] - Text Input with floating text

2016-10-20 Thread carlosrovira
Text Input with floating text


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3a9b5f54
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3a9b5f54
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3a9b5f54

Branch: refs/heads/feature/mdl
Commit: 3a9b5f540bd9e83f1d17cc9e296e1c161cd0960b
Parents: b332c96
Author: Carlos Rovira 
Authored: Wed Oct 19 02:21:37 2016 +0200
Committer: Carlos Rovira 
Committed: Thu Oct 20 17:46:39 2016 +0200

--
 .../flexjs/MDLExample/src/main/flex/App.mxml|  5 ++-
 .../main/flex/org/apache/flex/mdl/TextInput.as  | 45 +++-
 2 files changed, 48 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3a9b5f54/examples/flexjs/MDLExample/src/main/flex/App.mxml
--
diff --git a/examples/flexjs/MDLExample/src/main/flex/App.mxml 
b/examples/flexjs/MDLExample/src/main/flex/App.mxml
index 95dad1b..636b72b 100644
--- a/examples/flexjs/MDLExample/src/main/flex/App.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml
@@ -57,7 +57,9 @@ limitations under the License.
 
 
 
-
+
+
+
 
 
 
@@ -66,6 +68,7 @@ limitations under the License.
 
 
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3a9b5f54/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
--
diff --git 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
index 4617678..48d71bf 100644
--- 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
+++ 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as
@@ -49,8 +49,17 @@ package org.apache.flex.mdl
super();
}

+COMPILE::JS
+{
+private var _textNode:Text;
+}
+
 /**
  * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion HTMLDivElement
+ * @flexjsignorecoercion HTMLInputElement
+ * @flexjsignorecoercion HTMLLabelElement
+ * @flexjsignorecoercion Text
  */
 COMPILE::JS
 override protected function createElement():WrappedHTMLElement
@@ -70,7 +79,7 @@ package org.apache.flex.mdl
 label = document.createElement('label') as HTMLLabelElement;
 label.className = "mdl-textfield__label";
 
-textNode = document.createTextNode('') as Text;
+_textNode = textNode = document.createTextNode('') as Text;
 label.appendChild(textNode);
 
 div.appendChild(input);
@@ -94,5 +103,39 @@ package org.apache.flex.mdl
 return element;
 }
 
+private var _mdlEffect:String = "";
+
+public function get mdlEffect():String
+{
+return _mdlEffect;
+}
+
+public function set mdlEffect(value:String):void
+{
+_mdlEffect = value;
+COMPILE::JS 
+{
+element.className = 'mdl-textfield mdl-js-textfield ' + 
_mdlEffect;
+}
+}
+
+/**
+ *  @private
+ *  @flexjsignorecoercion HTMLInputElement
+ */
+   override public function set text(value:String):void
+   {
+COMPILE::SWF
+{
+//inSetter = true;
+//ITextModel(model).text = value;
+//inSetter = false;
+}
+COMPILE::JS
+{
+_textNode.text = value;
+dispatchEvent(new Event('textChange'));
+}
+   }
}
 }