You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2016/11/29 20:50:25 UTC
git commit: [flex-asjs] [refs/heads/develop] - Initial Tabs
Repository: flex-asjs
Updated Branches:
refs/heads/develop 8dcedd25c -> 059b1f5a1
Initial Tabs
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/059b1f5a
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/059b1f5a
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/059b1f5a
Branch: refs/heads/develop
Commit: 059b1f5a1ea8323fec0f93a6b4e6eae627b38b8a
Parents: 8dcedd2
Author: Carlos Rovira <ca...@apache.org>
Authored: Tue Nov 29 21:50:20 2016 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Tue Nov 29 21:50:20 2016 +0100
----------------------------------------------------------------------
.../src/main/flex/MainNavigation.mxml | 3 +
.../flexjs/MDLExample/src/main/flex/Tabs.mxml | 51 ++++++++++
.../src/main/flex/org/apache/flex/mdl/Tabs.as | 97 ++++++++++++++++++++
.../src/main/resources/mdl-manifest.xml | 1 +
4 files changed, 152 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/059b1f5a/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml b/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
index 0a647d7..65e3661 100644
--- a/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/MainNavigation.mxml
@@ -38,6 +38,7 @@ limitations under the License.
<mdl:TabBarButton text="Cards" href="#cards_panel" isActive="true"/>
<mdl:TabBarButton text="Chips" href="#chips_panel"/>
<mdl:TabBarButton text="Grids" href="#grids_panel"/>
+ <mdl:TabBarButton text="Tabs" href="#tabs_panel"/>
<mdl:TabBarButton text="Buttons" href="#buttons_panel" />
<mdl:TabBarButton text="TextFields" href="#textfield_panel"/>
<mdl:TabBarButton text="Toggles" href="#toggles_panel"/>
@@ -63,6 +64,8 @@ limitations under the License.
<local:Chips id="chips_panel" />
<local:Grids id="grids_panel"/>
+
+ <local:Tabs id="tabs_panel"/>
<local:Buttons id="buttons_panel"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/059b1f5a/examples/flexjs/MDLExample/src/main/flex/Tabs.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/Tabs.mxml b/examples/flexjs/MDLExample/src/main/flex/Tabs.mxml
new file mode 100644
index 0000000..b9b3a40
--- /dev/null
+++ b/examples/flexjs/MDLExample/src/main/flex/Tabs.mxml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<mdl:TabBarPanel xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:js="library://ns.apache.org/flexjs/basic"
+ xmlns:mdl="library://ns.apache.org/flexjs/mdl"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <mdl:Grid className="demo-grid">
+
+ <mdl:Tabs>
+ <mdl:TabBar ripple="true">
+ <mdl:TabBarButton text="Tab One" href="#tab1" isActive="true"/>
+ <mdl:TabBarButton text="Tab Two" href="#tab2"/>
+ <mdl:TabBarButton text="Tab Three" href="#tab3"/>
+ </mdl:TabBar>
+
+ <mdl:TabBarPanel id="tab1">
+ <mdl:Button fab="true" ripple="true">
+ <i class="material-icons md-48">add</i>
+ </mdl:Button>
+ </mdl:TabBarPanel>
+
+ <mdl:TabBarPanel id="tab2">
+ <mdl:Button fab="true" ripple="true">
+ <i class="material-icons md-48">face</i>
+ </mdl:Button>
+ </mdl:TabBarPanel>
+
+ <mdl:TabBarPanel id="tab3">
+ </mdl:TabBarPanel>
+ </mdl:Tabs>
+ </mdl:Grid>
+
+</mdl:TabBarPanel>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/059b1f5a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as
new file mode 100644
index 0000000..b309f20
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Tabs.as
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ContainerBase;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The Tabs class is a Container component capable of parenting other
+ * components
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Tabs extends ContainerBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Tabs()
+ {
+ super();
+
+ className = ""; //set to empty string avoid 'undefined' output when no class selector is assigned by user;
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ typeNames = "mdl-tabs mdl-js-tabs";
+
+ element = document.createElement('div') as WrappedHTMLElement;
+ element.className = typeNames;
+
+ positioner = element;
+
+ // absolute positioned children need a non-null
+ // position value in the parent. It might
+ // get set to 'absolute' if the container is
+ // also absolutely positioned
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ protected var _ripple:Boolean = false;
+ /**
+ * A boolean flag to activate "mdl-js-ripple-effect" effect selector.
+ * Applies ripple click effect. May be used in combination with any other classes
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get ripple():Boolean
+ {
+ return _ripple;
+ }
+ public function set ripple(value:Boolean):void
+ {
+ _ripple = value;
+
+ className += (_ripple ? " mdl-js-ripple-effect" : "");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/059b1f5a/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 c7078bf..de38b0d 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -55,6 +55,7 @@
<component id="TabBar" class="org.apache.flex.mdl.TabBar"/>
<component id="TabBarButton" class="org.apache.flex.mdl.TabBarButton"/>
<component id="TabBarPanel" class="org.apache.flex.mdl.TabBarPanel"/>
+ <component id="Tabs" class="org.apache.flex.mdl.Tabs"/>
<component id="Grid" class="org.apache.flex.mdl.Grid"/>
<component id="GridCell" class="org.apache.flex.mdl.GridCell"/>
<component id="Chip" class="org.apache.flex.mdl.Chip"/>