First MDL commit. This is a Material Design Google SWC project to create components with Google MDL look and feel
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/1e699517 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/1e699517 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/1e699517 Branch: refs/heads/feature/mdl Commit: 1e699517ce6fd980cb2873f08623a9cec7a3bcfa Parents: d47d3d9 Author: Carlos Rovira <carlosrov...@apache.org> Authored: Fri Oct 14 20:51:28 2016 +0200 Committer: Carlos Rovira <carlosrov...@apache.org> Committed: Sun Nov 6 13:15:38 2016 +0100 ---------------------------------------------------------------------- .../projects/MaterialDesignLite/build.xml | 116 ++++++++++++++++++ frameworks/projects/MaterialDesignLite/pom.xml | 117 +++++++++++++++++++ .../src/main/config/compile-as-config.xml | 87 ++++++++++++++ .../src/main/flex/MDLClasses.as | 37 ++++++ .../src/main/flex/org/apache/flex/mdl/Button.as | 81 +++++++++++++ .../src/main/resources/defaults.css | 25 ++++ .../src/main/resources/mdl-as-manifest.xml | 26 +++++ .../src/main/resources/mdl-manifest.xml | 27 +++++ 8 files changed, 516 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e699517/frameworks/projects/MaterialDesignLite/build.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/build.xml b/frameworks/projects/MaterialDesignLite/build.xml new file mode 100644 index 0000000..b61453d --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/build.xml @@ -0,0 +1,116 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<project name="MaterialDesignLite" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../../.."/> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + + <property name="target.name" value="${ant.project.name}.swc" /> + + <target name="main" depends="clean,check-compiler,compile,compile-js,copy-swc,test" description="Full build of ${ant.project.name}.swc"> + </target> + + <target name="compile-js"> + <ant dir="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/" inheritAll="false" /> + </target> + + <target name="copy-swc"> + <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name}" /> + </target> + + <target name="check-for-tests" > + <condition property="skip-tests" > + <not> + <available file="${basedir}/src/test/flex/build.xml" /> + </not> + </condition> + </target> + + <target name="test" depends="check-for-tests" unless="skip-tests"> + <ant dir="src/test/flex" /> + </target> + + <target name="clean"> + <delete failonerror="false"> + <fileset dir="${FLEXJS_HOME}/frameworks/libs"> + <include name="${target.name}"/> + </fileset> + </delete> + <delete failonerror="false" includeemptydirs="true"> + <fileset dir="${basedir}/target"> + <include name="**/**"/> + </fileset> + </delete> + <antcall target="clean-tests" /> + </target> + + <target name="clean-tests" depends="check-for-tests" unless="skip-tests"> + <ant dir="src/test/flex" target="clean"/> + </target> + + <target name="compile" description="Compiles .as files into .swc"> + <echo message="Compiling libs/${ant.project.name}.swc"/> + <echo message="FLEX_HOME: ${FLEX_HOME}"/> + <echo message="FALCON_HOME: ${FALCON_HOME}"/> + + <compc fork="true" + output="${basedir}/target/${target.name}"> + <jvmarg line="${compc.jvm.args}"/> + <load-config filename="${basedir}/src/main/config/compile-as-config.xml" /> + <arg value="+playerglobal.version=${playerglobal.version}" /> + <arg value="+env.AIR_HOME=${env.AIR_HOME}" /> + <arg value="-define=COMPILE::SWF,true" /> + <arg value="-define=COMPILE::JS,false" /> + </compc> + <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name}" /> + </target> + + <target name="check-compiler" depends="check-falcon-home"> + <path id="lib.path"> + <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/> + </path> + <taskdef resource="flexTasks.tasks" classpathref="lib.path"/> + </target> + + <target name="check-falcon-home" unless="FALCON_HOME" + description="Check FALCON_HOME is a directory."> + + <echo message="FALCON_HOME is ${env.FALCON_HOME}"/> + + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler"/> + + <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder" + unless="FALCON_HOME"/> + </target> + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e699517/frameworks/projects/MaterialDesignLite/pom.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/pom.xml b/frameworks/projects/MaterialDesignLite/pom.xml new file mode 100644 index 0000000..d5fde11 --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/pom.xml @@ -0,0 +1,117 @@ +<?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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>projects</artifactId> + <version>0.8.0-SNAPSHOT</version> + </parent> + + <artifactId>MaterialDesignLite</artifactId> + <version>0.8.0-SNAPSHOT</version> + <packaging>swc</packaging> + + <name>Apache Flex - FlexJS: Framework: Libs: Material Design Lite</name> + + <build> + <sourceDirectory>src/main/flex</sourceDirectory> + <plugins> + <plugin> + <groupId>org.apache.flex.flexjs.compiler</groupId> + <artifactId>flexjs-maven-plugin</artifactId> + <version>${flexjs.compiler.version}</version> + <extensions>true</extensions> + <configuration> + <namespaces> + <namespace> + <uri>library://ns.apache.org/flexjs/mdl</uri> + <manifest>${project.basedir}/src/main/resources/mdl-manifest.xml</manifest> + </namespace> + <namespace> + <type>as</type> + <uri>library://ns.apache.org/flexjs/mdl</uri> + <manifest>${project.basedir}/src/main/resources/mdl-as-manifest.xml</manifest> + </namespace> + </namespaces> + <includeClasses> + <includeClass>MDLClasses</includeClass> + </includeClasses> + <includeFiles> + <include-file> + <name>defaults.css</name> + <path>../src/main/resources/defaults.css</path> + </include-file> + </includeFiles> + <includeLookupOnly>true</includeLookupOnly> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>Core</artifactId> + <version>0.8.0-SNAPSHOT</version> + <type>swc</type> + </dependency> + <dependency> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>Core</artifactId> + <version>0.8.0-SNAPSHOT</version> + <type>swc</type> + <classifier>typedefs</classifier> + </dependency> + <dependency> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>Binding</artifactId> + <version>0.8.0-SNAPSHOT</version> + <type>swc</type> + </dependency> + <dependency> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>Graphics</artifactId> + <version>0.8.0-SNAPSHOT</version> + <type>swc</type> + </dependency> + <dependency> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>Collections</artifactId> + <version>0.8.0-SNAPSHOT</version> + <type>swc</type> + </dependency> + <dependency> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>HTML</artifactId> + <version>0.8.0-SNAPSHOT</version> + <type>swc</type> + </dependency> + <dependency> + <groupId>org.apache.flex.flexjs.framework</groupId> + <artifactId>HTML</artifactId> + <version>0.8.0-SNAPSHOT</version> + <type>swc</type> + <classifier>typedefs</classifier> + </dependency> + </dependencies> + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e699517/frameworks/projects/MaterialDesignLite/src/main/config/compile-as-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/config/compile-as-config.xml b/frameworks/projects/MaterialDesignLite/src/main/config/compile-as-config.xml new file mode 100644 index 0000000..9f81189 --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/config/compile-as-config.xml @@ -0,0 +1,87 @@ +<!-- + + 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. + +--> +<flex-config> + + <compiler> + <accessible>false</accessible> + + <external-library-path> + <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element> + <path-element>../../../../../libs/Binding.swc</path-element> + <path-element>../../../../../libs/Core.swc</path-element> + <path-element>../../../../../libs/Graphics.swc</path-element> + <path-element>../../../../../libs/HTML.swc</path-element> + </external-library-path> + + <mxml> + <children-as-data>true</children-as-data> + </mxml> + <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event> + <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind> + <binding-value-change-event-type>valueChange</binding-value-change-event-type> + + <keep-as3-metadata> + <name>Bindable</name> + <name>Managed</name> + <name>ChangeEvent</name> + <name>NonCommittingChangeEvent</name> + <name>Transient</name> + </keep-as3-metadata> + + <locale/> + + <library-path/> + + <namespaces> + <namespace> + <uri>library://ns.apache.org/flexjs/mdl</uri> + <manifest>../resources/mdl-manifest.xml</manifest> + </namespace> + <namespace> + <uri>library://ns.apache.org/flexjs/mdl</uri> + <manifest>../resources/mdl-as-manifest.xml</manifest> + </namespace> + </namespaces> + + <source-path> + <path-element>../flex</path-element> + </source-path> + + <warn-no-constructor>false</warn-no-constructor> + </compiler> + + <include-file> + <name>defaults.css</name> + <path>../resources/defaults.css</path> + </include-file> + + <include-lookup-only>true</include-lookup-only> + + <include-classes> + <class>MDLClasses</class> + </include-classes> + + <include-namespaces> + <uri>library://ns.apache.org/flexjs/mdl</uri> + </include-namespaces> + + <target-player>${playerglobal.version}</target-player> + + +</flex-config> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e699517/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as b/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as new file mode 100644 index 0000000..733728e --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/MDLClasses.as @@ -0,0 +1,37 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + +/** + * @private + * This class is used to link additional classes into mdl.swc + * beyond those that are found by dependecy analysis starting + * from the classes specified in manifest.xml. + */ +internal class MDLClasses +{ + COMPILE::SWF + { + //import org.apache.flex.flat.beads.CSSScrollBarView; CSSScrollBarView; + } +} + +} + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e699517/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as new file mode 100644 index 0000000..11f218c --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as @@ -0,0 +1,81 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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::SWF + { + import org.apache.flex.html.Button; + } + COMPILE::JS + { + import org.apache.flex.core.UIBase; + import org.apache.flex.core.WrappedHTMLElement; + } + + /** + * The Button class provides a Material Design Library UI-like appearance for + * a Button. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + COMPILE::SWF + public class Button extends org.apache.flex.html.Button + { + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function Button() + { + super(); + } + } + + COMPILE::JS + public class Button extends UIBase + { + private var button:HTMLButtonElement; + + /** + * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement + * @flexjsignorecoercion HTMLButtonElement + */ + override protected function createElement():WrappedHTMLElement + { + var button:HTMLButtonElement; + + element = button = document.createElement('button') as HTMLButtonElement; + button.className = 'mdl-button mdl-js-button mdl-button--fab mdl-button--colored'; + + positioner = element; + positioner.style.position = 'relative'; + (button as WrappedHTMLElement).flexjs_wrapper = this; + element.flexjs_wrapper = this; + + return element; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e699517/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css new file mode 100644 index 0000000..f795472 --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css @@ -0,0 +1,25 @@ +/* + * + * 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. + * + */ + +@namespace "library://ns.apache.org/flexjs/mdl"; + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e699517/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-as-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-as-manifest.xml b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-as-manifest.xml new file mode 100644 index 0000000..2e1e719 --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-as-manifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<componentPackage> + + <!--<component id="DropDownListList" class="org.apache.flex.mdl.supportClasses.DropDownListList" />--> + +</componentPackage> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e699517/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 new file mode 100644 index 0000000..68dffad --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml @@ -0,0 +1,27 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<componentPackage> + + <component id="Button" class="org.apache.flex.html.Button" lookupOnly="true" /> + <component id="TextInput" class="org.apache.flex.html.TextInput" lookupOnly="true" /> + +</componentPackage>