flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Fix MaterialIconBase to support properties and introduce MaterialIcon Person
Date Sat, 10 Dec 2016 15:04:40 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop caaf5cd3f -> 807667699


Fix MaterialIconBase to support properties and introduce MaterialIcon Person


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

Branch: refs/heads/develop
Commit: 8076676994748ef8ac7f88beb15fa6aaef50395c
Parents: caaf5cd
Author: Carlos Rovira <carlosrovira@apache.org>
Authored: Sat Dec 10 16:04:32 2016 +0100
Committer: Carlos Rovira <carlosrovira@apache.org>
Committed: Sat Dec 10 16:04:32 2016 +0100

----------------------------------------------------------------------
 .../beads/materialIcons/MaterialIconPerson.as   | 72 ++++++++++++++++++++
 .../beads/materialIcons/MaterialIconsType.as    |  1 +
 .../flex/mdl/supportClasses/MaterialIconBase.as | 60 ++++++++++------
 .../src/main/resources/mdl-manifest.xml         |  1 +
 4 files changed, 113 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/80766769/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
new file mode 100644
index 0000000..6e210c5
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
@@ -0,0 +1,72 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.mdl.beads.materialIcons
+{
+    import org.apache.flex.core.IBead;
+    import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.UIBase;
+    import org.apache.flex.mdl.supportClasses.MaterialIconBase;
+
+    /**
+     *  The MaterialIconPerson bead class is a specialty bead that add "person" icon
+     *  to component taken from "material-icons"
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    public class MaterialIconPerson extends MaterialIconBase implements IBead
+    {
+        /**
+         *  constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function MaterialIconPerson()
+        {
+            super();
+        }
+        
+        private var _strand:IStrand;
+
+        /**
+         * @flexjsignorecoercion HTMLElement
+         *
+         * @param value
+         */
+        public function set strand(value:IStrand):void
+        {
+            _strand = value;
+
+            COMPILE::JS
+            {
+                var host:UIBase = value as UIBase;
+                var htmlElement:HTMLElement = host.element as HTMLElement;
+
+                materialIcon.text = MaterialIconsType.PERSON;
+
+                htmlElement.appendChild(element);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/80766769/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconsType.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconsType.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconsType.as
index 6759926..ecbb1d5 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconsType.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconsType.as
@@ -22,5 +22,6 @@ package org.apache.flex.mdl.beads.materialIcons
     {
         public static const CANCEL:String = "cancel";
         public static const ADD:String = "add";
+        public static const PERSON:String = "person";
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/80766769/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
index d633acf..bfb218c 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
@@ -28,23 +28,6 @@ package org.apache.flex.mdl.supportClasses
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    COMPILE::SWF
-    public class MaterialIconBase
-    {
-        public function MaterialIconBase()
-        {
-        }
-    }
-
-    /**
-     *  Provide HTML element and common features for all material icons type
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-    COMPILE::JS
     public class MaterialIconBase
     {
         /**
@@ -59,22 +42,57 @@ package org.apache.flex.mdl.supportClasses
          */
         public function MaterialIconBase()
         {
-            materialIcon = new I();
-            element.classList.add("material-icons");
+            COMPILE::JS
+            {
+                materialIcon = new I();
+                element.classList.add("material-icons");
+            }
         }
 
-        private var _md48:Boolean;
+        COMPILE::JS
         protected var materialIcon:I;
 
+        COMPILE::JS
         public function get element():HTMLElement
         {
             return materialIcon.element as HTMLElement;
         }
 
+        private var _md48:Boolean;
+        
+        public function get md48():Boolean
+        {
+            return _md48;
+        }
+        /**
+         * Activate "md-48" class selector.
+         */
         public function set md48(value:Boolean):void
         {
             _md48 = value;
-            element.classList.toggle("md-48", _md48);
+
+            COMPILE::JS
+            {
+                element.classList.toggle("md-48", _md48);
+            }
+        }
+
+        private var _listItemIcon:Boolean;
+        /**
+         * Activate "mdl-list__item-icon" class selector, for use in list item
+         */
+        public function get listItemIcon():Boolean
+        {
+            return _listItemIcon;
+        }
+        public function set listItemIcon(value:Boolean):void
+        {
+            _listItemIcon = value;
+
+            COMPILE::JS
+            {
+                element.classList.toggle("mdl-list__item-icon", _listItemIcon);
+            }
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/80766769/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
index 5ed46cd..578dafa 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -68,6 +68,7 @@
     <component id="DeletableLinkChip" class="org.apache.flex.mdl.beads.DeletableLinkChip"/>
     <component id="MaterialIconCancel" class="org.apache.flex.mdl.beads.materialIcons.MaterialIconCancel"/>
     <component id="MaterialIconAdd" class="org.apache.flex.mdl.beads.materialIcons.MaterialIconAdd"/>
+    <component id="MaterialIconPerson" class="org.apache.flex.mdl.beads.materialIcons.MaterialIconPerson"/>
     <component id="ContactChip" class="org.apache.flex.mdl.beads.ContactChip"/>
     <component id="ContactImageChip" class="org.apache.flex.mdl.beads.ContactImageChip"/>
     <component id="Tooltip" class="org.apache.flex.mdl.beads.Tooltip"/>


Mime
View raw message