Repository: flex-asjs
Updated Branches:
  refs/heads/develop 0343012a5 -> 85c28f03d


- Add first version of MDL Spinner


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

Branch: refs/heads/develop
Commit: 85c28f03d502220d23c07493958f295d7f85dcbc
Parents: 0343012
Author: piotrz <[email protected]>
Authored: Sat Dec 17 23:21:15 2016 +0100
Committer: piotrz <[email protected]>
Committed: Sat Dec 17 23:21:15 2016 +0100

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/mdl/Spinner.as    | 98 ++++++++++++++++++++
 .../src/main/resources/mdl-manifest.xml         |  1 +
 2 files changed, 99 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/85c28f03/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
new file mode 100644
index 0000000..201966b
--- /dev/null
+++ 
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Spinner.as
@@ -0,0 +1,98 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+    COMPILE::JS
+    {
+        import org.apache.flex.core.UIBase;
+        import org.apache.flex.core.WrappedHTMLElement;
+    }
+    /**
+     *  The Spinner class provides a MDL UI-like appearance for
+     *  a Spinner.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    COMPILE::SWF
+    public class Spinner
+    {
+        private var _isActive:Boolean;
+        private var _singleColor:Boolean;
+
+        public function set isActive(value:Boolean):void
+        {
+            _isActive = value;
+        }
+
+        public function set singleColor(value:Boolean):void
+        {
+            _singleColor = value;
+        }
+    }
+
+    COMPILE::JS
+    public class Spinner extends UIBase
+    {
+        public function Spinner()
+        {
+            super();
+
+            className = "";
+        }
+
+        private var _isActive:Boolean;
+        private var _singleColor:Boolean;
+
+        public function set isActive(value:Boolean):void
+        {
+            _isActive = value;
+
+            element.classList.toggle("is-active", _isActive);
+        }
+
+        public function set singleColor(value:Boolean):void
+        {
+            _singleColor = value;
+
+            element.classList.toggle("mdl-spinner--single-color", 
_singleColor);
+        }
+
+        /**
+         * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+         *
+         * @return
+         */
+        override protected function createElement():WrappedHTMLElement
+        {
+            typeNames = "mdl-spinner";
+
+            element = document.createElement('div') as WrappedHTMLElement;
+            element.classList.add("mdl-js-spinner");
+
+            positioner = element;
+            element.flexjs_wrapper = this;
+
+            return element;
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/85c28f03/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 ca29048..c8bb885 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -82,4 +82,5 @@
     <component id="Tooltip" class="org.apache.flex.mdl.beads.Tooltip"/>
     <component id="MdlColor" class="org.apache.flex.mdl.beads.MdlColor"/>
     <component id="MdlTextColor" 
class="org.apache.flex.mdl.beads.MdlTextColor"/>
+    <component id="Spinner" class="org.apache.flex.mdl.Spinner"/>
 </componentPackage>

Reply via email to