Skip to content

Commit

Permalink
Merge pull request #1022 from GwtMaterialDesign/release_2.6.0
Browse files Browse the repository at this point in the history
Release 2.6.0
  • Loading branch information
kevzlou7979 committed Jul 23, 2022
2 parents 8a429df + 4be2a83 commit 1b909f2
Show file tree
Hide file tree
Showing 51 changed files with 14,829 additions and 142 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -8,7 +8,7 @@ cache:
- $HOME/.m2
before_install:
# install the gwt-material-jquery because it will depends on built in jquery
- git clone -b release_2.5.0_rc1 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
- git clone -b release_2.6.0 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
- cd gwt-material-jquery
- mvn install -DskipTests=true -DdryRun=true
- cd ..
Expand Down
2 changes: 1 addition & 1 deletion .utility/deploy.sh
@@ -1,6 +1,6 @@
#!/bin/bash
set -ev
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.5.0_rc1" ]; then
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.6.0" ]; then
echo "<settings><servers><server><id>ossrh</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml
mvn deploy -DskipTests --settings ~/settings.xml
fi
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -20,20 +20,20 @@ We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs


## Maven
### Current Version 2.5.0
### Current Version 2.6.0
```xml
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material</artifactId>
<version>2.5.0</version>
<version>2.6.0</version>
</dependency>
```
### Snapshot Version 2.5.0
### Snapshot Version 2.6.1-SNAPSHOT
```xml
<dependency>
<groupId>com.github.gwtmaterialdesign</groupId>
<artifactId>gwt-material</artifactId>
<version>2.5.0</version>
<version>2.6.1-SNAPSHOT</version>
</dependency>
```

Expand Down
22 changes: 21 additions & 1 deletion gwt-material/pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>gwt-material-parent</artifactId>
<groupId>com.github.gwtmaterialdesign</groupId>
<version>2.5.0</version>
<version>2.6.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -41,6 +41,26 @@
<artifactId>htmlunit</artifactId>
<version>${htmlunit.version}</version>
</dependency>
<dependency>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-core</artifactId>
<version>${elemental2.version}</version>
</dependency>
<dependency>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-promise</artifactId>
<version>${elemental2.version}</version>
</dependency>
<dependency>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-dom</artifactId>
<version>${elemental2.version}</version>
</dependency>
<dependency>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-media</artifactId>
<version>${elemental2.version}</version>
</dependency>
</dependencies>

<repositories>
Expand Down
Expand Up @@ -21,12 +21,15 @@

import gwt.material.design.client.base.AbstractIconButton;
import gwt.material.design.client.constants.IconType;
import gwt.material.design.client.ui.animate.MaterialAnimation;
import gwt.material.design.client.ui.animate.Transition;

public class DefaultButtonLoader implements AsyncIconDisplayLoader<String> {

protected String initialText;
protected IconType initialIcon;
protected AbstractIconButton button;
protected MaterialAnimation animation;

protected DefaultButtonLoader() {}

Expand All @@ -43,8 +46,13 @@ public DefaultButtonLoader(AbstractIconButton button) {
@Override
public void loading() {
button.setEnabled(false);
button.setText("Loading");
button.setIconType(getLoadingIcon());
animation = new MaterialAnimation();
animation.delay(0);
animation.duration(600);
animation.setTransition(Transition.SPIN);
animation.setInfinite(true);
animation.animate(button.getIcon());
}

@Override
Expand All @@ -67,6 +75,10 @@ public void finalize() {
if (initialIcon != null) {
button.setIconType(initialIcon);
}

if (animation != null) {
animation.stopAnimation();
}
}


Expand Down
Expand Up @@ -140,6 +140,16 @@ public String getCustomIconType() {
return icon.getCustomIconType();
}

@Override
public void setIconDisplay(IconDisplay iconDisplay) {
icon.setIconDisplay(iconDisplay);
}

@Override
public IconDisplay getIconDisplay() {
return icon.getIconDisplay();
}

/**
* Ensure the icon is attached in slot 0.
*/
Expand Down
Expand Up @@ -34,6 +34,7 @@
import gwt.material.design.client.base.mixin.DensityMixin;
import gwt.material.design.client.base.mixin.OverlayStyleMixin;
import gwt.material.design.client.base.mixin.StyleMixin;
import gwt.material.design.client.base.mixin.ToggleStyleMixin;
import gwt.material.design.client.base.viewport.ViewPort;
import gwt.material.design.client.base.viewport.WidthBoundary;
import gwt.material.design.client.constants.*;
Expand Down Expand Up @@ -62,7 +63,6 @@ public abstract class AbstractSideNav extends MaterialWidget
protected int width = 240;
protected int inDuration = 400;
protected int outDuration = 200;
protected boolean open;
protected boolean closeOnClick;
protected boolean alwaysShowActivator = true;
protected boolean allowBodyScroll = true;
Expand All @@ -76,6 +76,7 @@ public abstract class AbstractSideNav extends MaterialWidget
private StyleMixin<MaterialSideNav> typeMixin;
private OverlayStyleMixin<AbstractSideNav> overlayStyleMixin;
private DensityMixin<AbstractSideNav> densityMixin;
private ToggleStyleMixin<AbstractSideNav> openMixin;

public AbstractSideNav() {
super(Document.get().createULElement(), CssName.SIDE_NAV);
Expand Down Expand Up @@ -431,10 +432,8 @@ protected MaterialWidget getNavMenu() {
}

protected void onClosing() {
open = false;
$("#sidenav-overlay").remove();
getOpenMixin().setOn(false);
SideNavClosingEvent.fire(this);

resetOverlayStyle();
}

Expand All @@ -443,14 +442,7 @@ protected void onClosed() {
}

protected void onOpening() {
open = true;

$("#sidenav-overlay").each((param1, element) -> {
if (element != null) {
element.removeFromParent();
}
});

getOpenMixin().setOn(true);
SideNavOpeningEvent.fire(this);
}

Expand All @@ -472,7 +464,14 @@ protected void onOverlayAttached() {
* Hide the overlay menu.
*/
public void hideOverlay() {
$("#sidenav-overlay").remove();
JQueryElement overlayElement = getOverlayElement();
if (overlayElement != null) {
overlayElement.each((param1, element) -> {
if (element != null) {
element.removeFromParent();
}
});
}
}

/**
Expand All @@ -488,8 +487,9 @@ public void show() {
*/
@Override
public void open() {
$("#sidenav-overlay").remove();
$(activator).sideNav("show");
if (!isOpen()) {
$(activator).sideNav("show");
}
}

/**
Expand All @@ -510,7 +510,7 @@ public void close() {

@Override
public boolean isOpen() {
return open;
return getOpenMixin().isOn();
}

/**
Expand Down Expand Up @@ -696,4 +696,11 @@ protected DensityMixin<AbstractSideNav> getDensityMixin() {
}
return densityMixin;
}

public ToggleStyleMixin<AbstractSideNav> getOpenMixin() {
if (openMixin == null) {
openMixin = new ToggleStyleMixin<>(this, "opened");
}
return openMixin;
}
}
Expand Up @@ -20,10 +20,7 @@
package gwt.material.design.client.base;

import com.google.gwt.dom.client.Style;
import gwt.material.design.client.constants.Color;
import gwt.material.design.client.constants.IconPosition;
import gwt.material.design.client.constants.IconSize;
import gwt.material.design.client.constants.IconType;
import gwt.material.design.client.constants.*;
import gwt.material.design.client.ui.MaterialIcon;

public interface HasIcon {
Expand Down Expand Up @@ -84,4 +81,14 @@ public interface HasIcon {
* Will get the css class for custom icons.
*/
String getCustomIconType();

/**
* Will set the icon display structure.
* OUTLINED, FILLED, ROUNDED, SHARP and TWO TONE
*
* @see <a href="https://fonts.google.com/icons">Example</a>
*/
void setIconDisplay(IconDisplay iconDisplay);

IconDisplay getIconDisplay();
}
@@ -0,0 +1,37 @@
/*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2022 GwtMaterialDesign
* %%
* Licensed 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.
* #L%
*/
package gwt.material.design.client.base;

public interface HasTruncate {

/**
* If true the label inside this component will be truncated by ellipsis
**/
void setTruncate(boolean truncate);

boolean isTruncate();

/**
* Will enable long texts to set the elements attribute when mouse overed the truncated text
*/
void setEnableTruncateTitle(boolean value);

boolean isEnableTruncateTitle();
}
Expand Up @@ -54,7 +54,7 @@ public class MaterialWidget extends ComplexPanel implements HasId, HasEnabled, H
HasShadow, Focusable, HasInlineStyle, HasSeparator, HasScrollspy, HasHideOn, HasShowOn, HasCenterOn, HasCircle, HasWaves,
HasDataAttributes, HasFloat, HasTooltip, HasFlexbox, HasHoverable, HasFontWeight, HasFontSize, HasDepth, HasInitialClasses,
HasInteractionHandlers, HasAllFocusHandlers, HasFilterStyle, HasBorder, HasVerticalAlign, HasTransform, HasOrientation,
HasContainer, HasWordBreak, HasZoom, HasGridLayout, HasResize, HasContentEditable {
HasContainer, HasWordBreak, HasZoom, HasGridLayout, HasResize, HasContentEditable, HasTruncate {

private static JQueryElement window = null;
private static JQueryElement body = null;
Expand Down Expand Up @@ -125,7 +125,7 @@ public Appender(Widget widget) {
private FlexboxMixin<MaterialWidget> flexboxMixin;
private ToggleStyleMixin<MaterialWidget> hoverableMixin;
private CssNameMixin<MaterialWidget, FontWeight> fontWeightMixin;
private ToggleStyleMixin<MaterialWidget> truncateMixin;
private TruncateMixin<MaterialWidget> truncateMixin;
private FilterStyleMixin<MaterialWidget> filterMixin;
private BorderMixin<MaterialWidget> borderMixin;
private DimensionMixin<MaterialWidget> dimensionMixin;
Expand Down Expand Up @@ -1065,15 +1065,25 @@ public String getFilterStyle() {
return getFilterStyleMixin().getFilterStyle();
}

/**
* If true the label inside this component will be truncated by ellipsis
**/

@Override
public void setTruncate(boolean truncate) {
getTruncateMixin().setOn(truncate);
getTruncateMixin().setTruncate(truncate);
}

@Override
public boolean isTruncate() {
return getTruncateMixin().isOn();
return getTruncateMixin().isTruncate();
}

@Override
public void setEnableTruncateTitle(boolean value) {
getTruncateMixin().setEnableTruncateTitle(value);
}

@Override
public boolean isEnableTruncateTitle() {
return getTruncateMixin().isEnableTruncateTitle();
}

@Override
Expand Down Expand Up @@ -1880,9 +1890,9 @@ protected CssNameMixin<MaterialWidget, FontWeight> getFontWeightMixin() {
return fontWeightMixin;
}

public ToggleStyleMixin<MaterialWidget> getTruncateMixin() {
public TruncateMixin<MaterialWidget> getTruncateMixin() {
if (truncateMixin == null) {
truncateMixin = new ToggleStyleMixin<>(this, CssName.TRUNCATE);
truncateMixin = new TruncateMixin<>(this);
}
return truncateMixin;
}
Expand Down
Expand Up @@ -42,6 +42,7 @@ public class NumberBox<T> extends ValueBox<T> {
public NumberBox(NumberHandler handler) {
// currently there's no way to create a <input type="number"> directly
super(Document.get().createTextInputElement(), handler, handler);
addStyleName("number-box");
}

public static class NumberHandler<T> implements Renderer<T>, Parser<T> {
Expand Down
Expand Up @@ -36,7 +36,9 @@ public static void sort(String containerSelector, String childSelector, String d
Object elem1Order = $(elem1).data(dataAttribute);
Object elem2Order = $(elem2).data(dataAttribute);
if (elem1Order != null && elem2Order != null) {
return Integer.parseInt(elem2Order.toString()) < Integer.parseInt(elem1Order.toString()) ? 1 : -1;
int order1 = Integer.parseInt(elem1Order.toString());
int order2 = Integer.parseInt(elem2Order.toString());
return order2 < order1 || order1 < 0 ? 1 : -1;
}
return -1;
}).appendTo(containerSelector);
Expand Down

0 comments on commit 1b909f2

Please sign in to comment.