Repository: flex-asjs Updated Branches: refs/heads/develop cb189c4d9 -> c007085b3
Navigation Layout initial commit Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c007085b Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c007085b Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c007085b Branch: refs/heads/develop Commit: c007085b3125e948cb0b322d7e1442ebceaa2000 Parents: cb189c4 Author: Carlos Rovira <[email protected]> Authored: Tue Nov 22 00:54:06 2016 +0100 Committer: Carlos Rovira <[email protected]> Committed: Tue Nov 22 00:54:06 2016 +0100 ---------------------------------------------------------------------- .../flexjs/MDLExample/src/main/flex/App.mxml | 12 +++ .../src/main/flex/org/apache/flex/mdl/Header.as | 97 ++++++++++++++++++ .../main/flex/org/apache/flex/mdl/HeaderRow.as | 76 ++++++++++++++ .../org/apache/flex/mdl/NavigationLayout.as | 100 +++++++++++++++++++ .../src/main/resources/mdl-manifest.xml | 3 + 5 files changed, 288 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c007085b/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 43fbcc9..1d607b5 100644 --- a/examples/flexjs/MDLExample/src/main/flex/App.mxml +++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml @@ -62,6 +62,18 @@ limitations under the License. </mdl:Button> </js:HContainer> + <mdl:NavigationLayout> + <mdl:Header> + <mdl:HeaderRow> + <js:Span text="Title" className="mdl-layout-title"/> + </mdl:HeaderRow> + </mdl:Header> + + <mdl:Button fab="true" colored="true"> + <i class="material-icons">add</i> + </mdl:Button> + </mdl:NavigationLayout> + <!-- Text Fields :: https://getmdl.io/components/index.html#textfields-section --> <mdl:TextField id="mdlti" change="mdlchk.text = mdlti.text" className="mdlti_example"> <js:beads> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c007085b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Header.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Header.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Header.as new file mode 100644 index 0000000..989921f --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Header.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 Header 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 Header extends ContainerBase + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function Header() + { + 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-layout__header"; + + element = document.createElement('header') 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 _transparent:Boolean; + /** + * A boolean flag to activate "mdl-transparent--Xdp" effect selector. + * Assigns variable transparent depths (0, 2, 3, 4, 6, 8, or 16) to card + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get transparent():Boolean + { + return _transparent; + } + public function set transparent(value:Boolean):void + { + _transparent = value; + + className += (_transparent ? " mdl-layout__header--transparent" : ""); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c007085b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/HeaderRow.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/HeaderRow.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/HeaderRow.as new file mode 100644 index 0000000..4cd4403 --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/HeaderRow.as @@ -0,0 +1,76 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 HeaderRow 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 HeaderRow extends ContainerBase + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function HeaderRow() + { + 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-layout__header-row"; + + 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; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c007085b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/NavigationLayout.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/NavigationLayout.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/NavigationLayout.as new file mode 100644 index 0000000..d2efd3a --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/NavigationLayout.as @@ -0,0 +1,100 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 NavigationLayout 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 NavigationLayout extends ContainerBase + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function NavigationLayout() + { + 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-layout mdl-js-layout"; + + 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 _shadow:Number = 0; + /** + * A boolean flag to activate "mdl-shadow--Xdp" effect selector. + * Assigns variable shadow depths (0, 2, 3, 4, 6, 8, or 16) to card + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get shadow():Number + { + return _shadow; + } + public function set shadow(value:Number):void + { + if(value == 0 || value == 2 || value == 3 || value == 4 || value == 6 || value == 8 || value == 16) + { + _shadow = value; + + className += (_shadow != 0 ? " mdl-shadow--" + _shadow + "dp" : ""); + } + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c007085b/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 c34e902..ac711e2 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml +++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml @@ -41,5 +41,8 @@ <component id="CardMenu" class="org.apache.flex.mdl.CardMenu"/> <component id="Spacer" class="org.apache.flex.mdl.Spacer"/> <component id="List" class="org.apache.flex.mdl.List"/> + <component id="NavigationLayout" class="org.apache.flex.mdl.NavigationLayout"/> + <component id="Header" class="org.apache.flex.mdl.Header"/> + <component id="HeaderRow" class="org.apache.flex.mdl.HeaderRow"/> </componentPackage>
