diff --git a/README.md b/README.md index 10d644a12..41beae7ae 100644 --- a/README.md +++ b/README.md @@ -6,21 +6,21 @@ Gwt Material Design Extra Components for https://github.com/GwtMaterialDesign/gwt-material
-## Current Version 2.5.0-rc1 +## Current Version 2.5.0 ```xml com.github.gwtmaterialdesign gwt-material-addins - 2.5.0-rc1 + 2.5.0 ``` -## Snapshot Version 2.5.0-SNAPSHOT +## Snapshot Version 2.5.0 ```xml com.github.gwtmaterialdesign gwt-material-addins - 2.5.0-SNAPSHOT + 2.5.0 ``` diff --git a/pom.xml b/pom.xml index 8a79fa488..f31f5a9f3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ gwt-material-parent com.github.gwtmaterialdesign - 2.5.0-rc1 + 2.5.0 gwt-material-addins @@ -24,7 +24,7 @@ scm:git:git@github.com:GwtMaterialDesign/gwt-material-addins.git scm:git:git@github.com:GwtMaterialDesign/gwt-material-addins.git http://github.com/GwtMaterialDesign/gwt-material-addins - v2.5.0-rc1 + v2.5.0 diff --git a/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatar.java b/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatar.java index 02f473c8b..067a9cdd5 100644 --- a/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatar.java +++ b/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatar.java @@ -23,6 +23,8 @@ import gwt.material.design.addins.client.MaterialAddins; import gwt.material.design.addins.client.avatar.js.AvatarOptions; import gwt.material.design.addins.client.avatar.js.JsAvatar; +import gwt.material.design.addins.client.md5.Md5ClientBundle; +import gwt.material.design.addins.client.md5.Md5DebugClientBundle; import gwt.material.design.client.MaterialDesignBase; import gwt.material.design.client.base.AbstractValueWidget; import gwt.material.design.client.base.JsLoader; @@ -59,10 +61,10 @@ public class MaterialAvatar extends AbstractValueWidget implements JsLoa static { if (MaterialAddins.isDebug()) { MaterialDesignBase.injectDebugJs(MaterialAvatarDebugClientBundle.INSTANCE.jdenticonDebugJs()); - MaterialDesignBase.injectDebugJs(MaterialAvatarDebugClientBundle.INSTANCE.md5DebugJs()); + MaterialDesignBase.injectDebugJs(Md5DebugClientBundle.INSTANCE.md5DebugJs()); } else { MaterialDesignBase.injectJs(MaterialAvatarClientBundle.INSTANCE.jdenticonJs()); - MaterialDesignBase.injectJs(MaterialAvatarClientBundle.INSTANCE.md5Js()); + MaterialDesignBase.injectJs(Md5ClientBundle.INSTANCE.md5Js()); } } diff --git a/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatarClientBundle.java b/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatarClientBundle.java index 979f75ca9..ea8c6a225 100644 --- a/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatarClientBundle.java +++ b/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatarClientBundle.java @@ -34,8 +34,4 @@ public interface MaterialAvatarClientBundle extends ClientBundle { @Source("resources/js/jdenticon-2.2.0.min.js") TextResource jdenticonJs(); - - @Source("resources/js/md5.min.js") - TextResource md5Js(); - } diff --git a/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatarDebugClientBundle.java b/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatarDebugClientBundle.java index 633ed0eb9..b6871baf7 100644 --- a/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatarDebugClientBundle.java +++ b/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatarDebugClientBundle.java @@ -34,7 +34,4 @@ public interface MaterialAvatarDebugClientBundle extends ClientBundle { @Source("resources/js/jdenticon-2.2.0.js") TextResource jdenticonDebugJs(); - - @Source("resources/js/md5.js") - TextResource md5DebugJs(); } diff --git a/src/main/java/gwt/material/design/addins/client/banner/MaterialBanner.java b/src/main/java/gwt/material/design/addins/client/banner/MaterialBanner.java new file mode 100644 index 000000000..5416a33f9 --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/banner/MaterialBanner.java @@ -0,0 +1,217 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2021 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.addins.client.banner; + +import com.google.gwt.dom.client.Document; +import com.google.gwt.dom.client.Element; +import com.google.gwt.event.logical.shared.CloseEvent; +import com.google.gwt.event.logical.shared.CloseHandler; +import com.google.gwt.event.logical.shared.OpenEvent; +import com.google.gwt.event.logical.shared.OpenHandler; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.user.client.ui.RootPanel; +import com.google.gwt.user.client.ui.Widget; +import gwt.material.design.addins.client.MaterialAddins; +import gwt.material.design.addins.client.banner.event.HasBannerHandlers; +import gwt.material.design.addins.client.dark.AddinsDarkThemeReloader; +import gwt.material.design.client.MaterialDesignBase; +import gwt.material.design.client.base.HasOpenClose; +import gwt.material.design.client.base.MaterialWidget; +import gwt.material.design.client.base.mixin.ToggleStyleMixin; +import gwt.material.design.client.constants.IconType; +import gwt.material.design.client.ui.MaterialIcon; +import gwt.material.design.client.ui.MaterialLabel; +import gwt.material.design.client.ui.MaterialPanel; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static gwt.material.design.jquery.client.api.JQuery.$; + +public class MaterialBanner extends MaterialWidget implements HasOpenClose, HasBannerHandlers { + + private final MaterialIcon icon; + private final MaterialLabel messageLabel; + private final MaterialPanel actions; + private int offsetTop = 0; + private int durationInMillis = 300; + private List targetPushElements; + + private ToggleStyleMixin openMixin; + + static { + if (MaterialAddins.isDebug()) { + MaterialDesignBase.injectCss(MaterialBannerDebugClientBundle.INSTANCE.bannerDebugCss()); + } else { + MaterialDesignBase.injectCss(MaterialBannerClientBundle.INSTANCE.bannerCss()); + } + } + + public MaterialBanner() { + super(Document.get().createDivElement(), "banner"); + + icon = new MaterialIcon(); + icon.setVisible(false); + icon.addStyleName("banner-icon"); + + messageLabel = new MaterialLabel(); + messageLabel.addStyleName("message"); + + actions = new MaterialPanel(); + actions.addStyleName("actions"); + + targetPushElements = new ArrayList<>(); + } + + @Override + protected void onLoad() { + super.onLoad(); + + add(icon); + add(messageLabel); + add(actions); + + close(); + + AddinsDarkThemeReloader.get().reload(MaterialBannerDarkTheme.class); + } + + @Override + public void add(Widget child) { + if (child instanceof MaterialBannerActions) { + actions.add(child); + } else { + super.add(child); + } + } + + @Override + public boolean isOpen() { + return false; + } + + @Override + public void open() { + getOpenMixin().setOn(true); + setTop(offsetTop); + pushTargetElements(getOuterHeight()); + OpenEvent.fire(this, getMessage()); + } + + public void open(Element... targetElements) { + setTargetPushElements(Arrays.asList(targetElements)); + open(); + } + + @Override + public void close() { + getOpenMixin().setOn(false); + setTop(-getOuterHeight()); + pushTargetElements(0); + CloseEvent.fire(this, getMessage()); + } + + protected void pushTargetElements(int translateY) { + $(getElement()).css("transition", "all " + durationInMillis + "ms ease"); + for (Element element : targetPushElements) { + $(element).css("transition", "all " + durationInMillis + "ms ease"); + $(element).css("transform", "translateY(" + translateY + "px)"); + } + } + + public int getDurationInMillis() { + return durationInMillis; + } + + public void setDurationInMillis(int durationInMillis) { + this.durationInMillis = durationInMillis; + } + + public String getMessage() { + return messageLabel.getText(); + } + + public void setMessage(String message) { + if (message != null && !message.isEmpty()) { + messageLabel.setText(message); + } else { + messageLabel.setText(""); + } + } + + public IconType getIconType() { + return icon.getIconType(); + } + + public void setIconType(IconType iconType) { + if (iconType != null) { + icon.setIconType(iconType); + icon.setVisible(true); + } else { + icon.setVisible(false); + } + } + + public MaterialIcon getIcon() { + return icon; + } + + public MaterialLabel getMessageLabel() { + return messageLabel; + } + + public List getTargetPushElements() { + return targetPushElements; + } + + public void setTargetPushElements(List targetPushElements) { + this.targetPushElements = targetPushElements; + } + + public int getOffsetTop() { + return offsetTop; + } + + public void setOffsetTop(int offsetTop) { + this.offsetTop = offsetTop; + } + + public int getOuterHeight() { + return $(getElement()).outerHeight(true); + } + + public ToggleStyleMixin getOpenMixin() { + if (openMixin == null) { + openMixin = new ToggleStyleMixin<>(RootPanel.get(), "banner-open"); + } + return openMixin; + } + + @Override + public HandlerRegistration addCloseHandler(CloseHandler handler) { + return addHandler(handler, CloseEvent.getType()); + } + + @Override + public HandlerRegistration addOpenHandler(OpenHandler handler) { + return addHandler(handler, OpenEvent.getType()); + } +} diff --git a/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerActions.java b/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerActions.java new file mode 100644 index 000000000..9d58f4e88 --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerActions.java @@ -0,0 +1,29 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2021 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.addins.client.banner; + +import gwt.material.design.client.ui.MaterialPanel; + +public class MaterialBannerActions extends MaterialPanel { + + public MaterialBannerActions() { + super(); + } +} diff --git a/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerClientBundle.java b/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerClientBundle.java new file mode 100644 index 000000000..f450efae6 --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerClientBundle.java @@ -0,0 +1,40 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2017 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.addins.client.banner; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.TextResource; + +/** + * Client Bundle for Avatar component + * + * @author kevzlou7979 + */ +public interface MaterialBannerClientBundle extends ClientBundle { + + MaterialBannerClientBundle INSTANCE = GWT.create(MaterialBannerClientBundle.class); + + @Source("resources/css/banner.min.css") + TextResource bannerCss(); + + @Source("resources/css/banner-dark.min.css") + TextResource bannerDarkCss(); +} diff --git a/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerDarkTheme.java b/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerDarkTheme.java new file mode 100644 index 000000000..8a5e8d85a --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerDarkTheme.java @@ -0,0 +1,30 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2019 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.addins.client.banner; + +import gwt.material.design.addins.client.MaterialAddins; +import gwt.material.design.addins.client.dark.AddinsWidgetDarkTheme; + +public class MaterialBannerDarkTheme extends AddinsWidgetDarkTheme { + + public MaterialBannerDarkTheme() { + super(MaterialAddins.isDebug() ? MaterialBannerDebugClientBundle.INSTANCE.bannerDarkCss() : MaterialBannerClientBundle.INSTANCE.bannerDarkCss()); + } +} diff --git a/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerDebugClientBundle.java b/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerDebugClientBundle.java new file mode 100644 index 000000000..a9d00d1ba --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/banner/MaterialBannerDebugClientBundle.java @@ -0,0 +1,40 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2017 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.addins.client.banner; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.TextResource; + +/** + * Client Bundle for Avatar component + * + * @author kevzlou7979 + */ +public interface MaterialBannerDebugClientBundle extends ClientBundle { + + MaterialBannerDebugClientBundle INSTANCE = GWT.create(MaterialBannerDebugClientBundle.class); + + @Source("resources/css/banner.css") + TextResource bannerDebugCss(); + + @Source("resources/css/banner-dark.css") + TextResource bannerDarkCss(); +} diff --git a/src/main/java/gwt/material/design/addins/client/banner/event/HasBannerHandlers.java b/src/main/java/gwt/material/design/addins/client/banner/event/HasBannerHandlers.java new file mode 100644 index 000000000..b56f98f54 --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/banner/event/HasBannerHandlers.java @@ -0,0 +1,26 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2021 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.addins.client.banner.event; + +import com.google.gwt.event.logical.shared.HasCloseHandlers; +import com.google.gwt.event.logical.shared.HasOpenHandlers; + +public interface HasBannerHandlers extends HasOpenHandlers, HasCloseHandlers { +} diff --git a/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java b/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java index 367c45524..02f39e906 100644 --- a/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java +++ b/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java @@ -23,6 +23,7 @@ import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Style; +import com.google.gwt.event.dom.client.DomEvent; import com.google.gwt.event.logical.shared.*; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.DOM; @@ -58,6 +59,7 @@ import gwt.material.design.client.events.ClosingEvent; import gwt.material.design.client.events.OpeningEvent; import gwt.material.design.client.ui.MaterialLabel; +import gwt.material.design.client.ui.MaterialToast; import gwt.material.design.client.ui.html.Label; import gwt.material.design.client.ui.html.OptGroup; import gwt.material.design.client.ui.html.Option; @@ -220,12 +222,24 @@ public void load() { return true; }); + body().on(ComboBoxEvents.FOCUS, getSelectContainerSelector(), (e, param1) -> { + if (!e.getCurrentTarget().getClassName().contains("select2-container--focus")) { + DomEvent.fireNativeEvent(Document.get().createFocusEvent(), this, getElement()); + } + return false; + }); + displayArrowForAllowClearOption(false); if (getTextColor() != null) { $(getElement()).find(".select2-selection__rendered").css("color", getTextColor().getCssName()); } + addFocusHandler(event -> { + if (!isMultiple()) { + open(); + } + }); getStatusTextMixin().getStatusDisplayMixin().setContainer(new MaterialWidget($(getElement()))); AddinsDarkThemeReloader.get().reload(MaterialComboBoxDarkTheme.class); } @@ -1238,6 +1252,10 @@ public JsComboBox getJsComboBox() { return $(listbox.getElement()); } + public String getSelectContainerSelector() { + return "#" + getId() + " .select2.select2-container"; + } + @Override public AsyncDisplayLoader getAsyncDisplayLoader() { return getAsyncWidgetMixin().getAsyncDisplayLoader(); diff --git a/src/main/java/gwt/material/design/addins/client/combobox/events/ComboBoxEvents.java b/src/main/java/gwt/material/design/addins/client/combobox/events/ComboBoxEvents.java index 71e787219..43861d003 100644 --- a/src/main/java/gwt/material/design/addins/client/combobox/events/ComboBoxEvents.java +++ b/src/main/java/gwt/material/design/addins/client/combobox/events/ComboBoxEvents.java @@ -35,4 +35,5 @@ public interface ComboBoxEvents { String CLOSING = "select2:closing"; String CLEAR = "select2:clear"; String CLEARING = "select2:clearing"; + String FOCUS = "focus"; } diff --git a/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUp.java b/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUp.java index 4374d1487..9d7f41b2e 100644 --- a/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUp.java +++ b/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUp.java @@ -64,8 +64,10 @@ public class MaterialCountUp extends AbstractValueWidget { static { if (MaterialAddins.isDebug()) { + MaterialDesignBase.injectCss(MaterialCountUpDebugClientBundle.INSTANCE.countUpCssDebug()); MaterialDesignBase.injectDebugJs(MaterialCountUpDebugClientBundle.INSTANCE.countUpJsDebug()); } else { + MaterialDesignBase.injectCss(MaterialCountUpClientBundle.INSTANCE.countUpCss()); MaterialDesignBase.injectJs(MaterialCountUpClientBundle.INSTANCE.countUpJs()); } } @@ -77,6 +79,8 @@ public class MaterialCountUp extends AbstractValueWidget { public MaterialCountUp() { super(Document.get().createLabelElement()); + + addStyleName("count-up"); } public void start() { diff --git a/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUpClientBundle.java b/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUpClientBundle.java index ea99bd26e..ae204ede6 100644 --- a/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUpClientBundle.java +++ b/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUpClientBundle.java @@ -32,6 +32,9 @@ interface MaterialCountUpClientBundle extends ClientBundle { MaterialCountUpClientBundle INSTANCE = GWT.create(MaterialCountUpClientBundle.class); + @Source("resources/css/countUp.min.css") + TextResource countUpCss(); + @Source("resources/js/countUp.min.js") TextResource countUpJs(); } diff --git a/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUpDebugClientBundle.java b/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUpDebugClientBundle.java index 037405c36..a72bb9c17 100644 --- a/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUpDebugClientBundle.java +++ b/src/main/java/gwt/material/design/addins/client/countup/MaterialCountUpDebugClientBundle.java @@ -32,6 +32,9 @@ interface MaterialCountUpDebugClientBundle extends ClientBundle { MaterialCountUpDebugClientBundle INSTANCE = GWT.create(MaterialCountUpDebugClientBundle.class); + @Source("resources/css/countUp.css") + TextResource countUpCssDebug(); + @Source("resources/js/countUp.js") TextResource countUpJsDebug(); } diff --git a/src/main/java/gwt/material/design/addins/client/cutout/MaterialCutOut.java b/src/main/java/gwt/material/design/addins/client/cutout/MaterialCutOut.java index 85432d2bc..3b276e8c2 100644 --- a/src/main/java/gwt/material/design/addins/client/cutout/MaterialCutOut.java +++ b/src/main/java/gwt/material/design/addins/client/cutout/MaterialCutOut.java @@ -102,6 +102,8 @@ public class MaterialCutOut extends MaterialWidget implements HasCloseHandlers setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle))); - registerHandler(Window.addWindowScrollHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle))); + registerHandler(Window.addResizeHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle, absolute))); + registerHandler(Window.addWindowScrollHandler(event -> setupCutOutPosition(focusElement, targetElement, cutOutPadding, circle, absolute))); } protected void setupTransition() { @@ -474,6 +482,14 @@ public int getDuration() { return duration; } + public boolean isScrollIntoView() { + return scrollIntoView; + } + + public void setScrollIntoView(boolean scrollIntoView) { + this.scrollIntoView = scrollIntoView; + } + @Override public HandlerRegistration addCloseHandler(final CloseHandler handler) { return addHandler(handler, CloseEvent.getType()); diff --git a/src/main/java/gwt/material/design/addins/client/dark/AddinsDarkThemeLoader.java b/src/main/java/gwt/material/design/addins/client/dark/AddinsDarkThemeLoader.java index 49702ebfc..33561ad9c 100644 --- a/src/main/java/gwt/material/design/addins/client/dark/AddinsDarkThemeLoader.java +++ b/src/main/java/gwt/material/design/addins/client/dark/AddinsDarkThemeLoader.java @@ -20,6 +20,7 @@ package gwt.material.design.addins.client.dark; import gwt.material.design.addins.client.autocomplete.MaterialAutoCompleteDarkTheme; +import gwt.material.design.addins.client.banner.MaterialBannerDarkTheme; import gwt.material.design.addins.client.bubble.MaterialBubbleDarkTheme; import gwt.material.design.addins.client.carousel.MaterialCarouselDarkTheme; import gwt.material.design.addins.client.combobox.MaterialComboBoxDarkTheme; @@ -40,6 +41,7 @@ public class AddinsDarkThemeLoader extends DarkThemeLoader { public AddinsDarkThemeLoader() { super(new MaterialAutoCompleteDarkTheme(), new MaterialBubbleDarkTheme(), + new MaterialBannerDarkTheme(), new MaterialComboBoxDarkTheme(), new MaterialCarouselDarkTheme(), new MaterialFileUploaderDarkTheme(), diff --git a/src/main/java/gwt/material/design/addins/client/inputmask/MaterialDateInputMask.java b/src/main/java/gwt/material/design/addins/client/inputmask/MaterialDateInputMask.java index 3a884c121..813a39f05 100644 --- a/src/main/java/gwt/material/design/addins/client/inputmask/MaterialDateInputMask.java +++ b/src/main/java/gwt/material/design/addins/client/inputmask/MaterialDateInputMask.java @@ -19,41 +19,66 @@ */ package gwt.material.design.addins.client.inputmask; +import com.google.gwt.event.dom.client.FocusHandler; +import com.google.gwt.event.logical.shared.InitializeHandler; +import com.google.gwt.event.logical.shared.ValueChangeEvent; +import com.google.gwt.event.logical.shared.ValueChangeHandler; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.user.client.DOM; import gwt.material.design.addins.client.inputmask.base.DateInputParser; +import gwt.material.design.addins.client.inputmask.events.*; +import gwt.material.design.client.base.*; +import gwt.material.design.client.constants.Autocomplete; +import gwt.material.design.client.constants.FieldType; +import gwt.material.design.client.events.PasteEvent; +import gwt.material.design.client.events.SensitivityChangedEvent; +import gwt.material.design.client.events.ToggleReadOnlyEvent; import java.util.Date; -public class MaterialDateInputMask extends AbstractInputMask { +public class MaterialDateInputMask extends AbstractValueWidget + implements HasFieldTypes, HasLabel, HasInputMaskHandlers, HasPlaceholder, HasReadOnly, HasActive, HasToggleReadOnlyHandler, HasAutocomplete, HasPasteHandlers, HasFieldSensitivity { - private String format = "MM/dd/yyyy"; - private DateInputParser dateInputParser = new DateInputParser(this); + private String format = "YYYY-mm-dd"; + private MaterialInputMask inputMask; + private DateInputParser inputParser; public MaterialDateInputMask() { - super(); + super(DOM.createDiv()); - setFormat(format); + inputMask = new MaterialInputMask(); + inputParser = new DateInputParser(inputMask); + inputMask.setPlaceholder(format.toUpperCase()); + setMask(format); + + setValidateOnBlur(true); } @Override - public Date getValue() { - return dateInputParser.parseDate(format); + protected void onLoad() { + super.onLoad(); + + add(inputMask); + inputMask.addValueChangeHandler(event -> { + inputParser.validate(format); + ValueChangeEvent.fire(this, getValue()); + }); } - @Override public void setMask(String mask) { this.format = mask - .replace("m", "M") - .replace("Y", "y") - .replace("D", "d"); + .replace("m", "M") + .replace("Y", "y") + .replace("D", "d"); parseFormatToMask(mask); } protected void parseFormatToMask(String format) { String dateFormatMask = format.toLowerCase() - .replace("m", "0") - .replace("d", "0") - .replace("y", "0"); - super.setMask(dateFormatMask); + .replace("m", "0") + .replace("d", "0") + .replace("y", "0"); + inputMask.setMask(dateFormatMask); } public String getFormat() { @@ -62,6 +87,174 @@ public String getFormat() { public void setFormat(String format) { this.format = format; - parseFormatToMask(format); + } + + @Override + public void setValue(Date value) { + inputParser.setValue(format, value); + } + + @Override + public void setValue(Date value, boolean fireEvents) { + inputParser.setValue(format, value); + } + + @Override + public void setValue(Date value, boolean fireEvents, boolean reload) { + inputParser.setValue(format, value); + } + + @Override + public Date getValue() { + return inputParser.parseDate(format); + } + + @Override + public FieldType getFieldType() { + return inputMask.getFieldType(); + } + + @Override + public void setLabelWidth(double percentWidth) { + inputMask.setLabelWidth(percentWidth); + } + + @Override + public void setFieldWidth(double percentWidth) { + inputMask.setFieldWidth(percentWidth); + } + + public void setFieldType(FieldType fieldType) { + inputMask.setFieldType(fieldType); + } + + @Override + public void setLabel(String label) { + inputMask.setLabel(label); + } + + @Override + public String getLabel() { + return inputMask.getLabel(); + } + + @Override + public HandlerRegistration addCompleteHandler(CompleteEvent.CompleteHandler handler) { + return inputMask.addCompleteHandler(handler); + } + + @Override + public HandlerRegistration addMaskChangeHandler(MaskChangeEvent.MaskChangeHandler handler) { + return inputMask.addMaskChangeHandler(handler); + } + + @Override + public HandlerRegistration addInvalidHandler(InvalidEvent.InvalidHandler handler) { + return inputMask.addInvalidHandler(handler); + } + + @Override + public HandlerRegistration addMaskKeyPressHandler(MaskKeyPressEvent.MaskKeyPressHandler handler) { + return inputMask.addMaskKeyPressHandler(handler); + } + + @Override + public HandlerRegistration addInitializeHandler(InitializeHandler handler) { + return inputMask.addInitializeHandler(handler); + } + + @Override + public void setActive(boolean active) { + inputMask.setActive(active); + } + + @Override + public boolean isActive() { + return inputMask.isActive(); + } + + @Override + public void setAutocomplete(Autocomplete autocomplete) { + inputMask.setAutocomplete(autocomplete); + } + + @Override + public Autocomplete getAutocomplete() { + return inputMask.getAutocomplete(); + } + + @Override + public void setSensitive(boolean sensitive) { + inputMask.setSensitive(sensitive); + } + + @Override + public void setSensitive(boolean sensitive, boolean fireEvents) { + inputMask.setSensitive(sensitive, fireEvents); + } + + @Override + public boolean isSensitive() { + return inputMask.isSensitive(); + } + + @Override + public HandlerRegistration addSensitivityChangedHandler(SensitivityChangedEvent.SensitivityChangedHandler handler) { + return inputMask.addSensitivityChangedHandler(handler); + } + + @Override + public HandlerRegistration addPasteHandler(PasteEvent.PasteEventHandler handler) { + return inputMask.addPasteHandler(handler); + } + + @Override + public String getPlaceholder() { + return inputMask.getPlaceholder(); + } + + @Override + public void setPlaceholder(String placeholder) { + inputMask.setPlaceholder(placeholder); + } + + @Override + public void setReadOnly(boolean value) { + inputMask.setReadOnly(value); + } + + @Override + public boolean isReadOnly() { + return inputMask.isReadOnly(); + } + + @Override + public void setRequired(boolean required) { + inputMask.setRequired(required); + } + + @Override + public boolean isRequired() { + return inputMask.isRequired(); + } + + @Override + public void setToggleReadOnly(boolean toggle) { + inputMask.setToggleReadOnly(toggle); + } + + @Override + public boolean isToggleReadOnly() { + return inputMask.isToggleReadOnly(); + } + + @Override + public HandlerRegistration addFocusHandler(FocusHandler handler) { + return inputMask.addFocusHandler(handler); + } + + @Override + public HandlerRegistration addToggleReadOnlyHandler(ToggleReadOnlyEvent.ToggleReadOnlyHandler handler) { + return inputMask.addToggleReadOnlyHandler(handler); } } diff --git a/src/main/java/gwt/material/design/addins/client/inputmask/base/DateInputParser.java b/src/main/java/gwt/material/design/addins/client/inputmask/base/DateInputParser.java index 07c713314..6f83e8173 100644 --- a/src/main/java/gwt/material/design/addins/client/inputmask/base/DateInputParser.java +++ b/src/main/java/gwt/material/design/addins/client/inputmask/base/DateInputParser.java @@ -24,7 +24,7 @@ import java.util.Date; -public class DateInputParser { +public class DateInputParser> { private final T valuebox; @@ -33,16 +33,22 @@ public DateInputParser(T valuebox) { } public Date parseDate(String format) { - if (isValid(format)) { + if (validate(format)) { valuebox.clearStatusText(); return DateTimeFormat.getFormat(format).parse(valuebox.getText()); } return null; } - protected boolean isValid(String format) { + public void setValue(String format, Date value) { + if (value != null) { + valuebox.setValue(DateTimeFormat.getFormat(format).format(value), true); + } + } + + public boolean validate(String format) { if (valuebox.getText() != null && !valuebox.getText().isEmpty() - && valuebox.getMask() != null && format != null) { + && valuebox.getMask() != null && format != null) { format = format.toLowerCase(); String dateString = valuebox.getText(); String month = dateString.substring(format.indexOf("m"), format.indexOf("m") + 2); @@ -50,16 +56,21 @@ protected boolean isValid(String format) { String year = dateString.substring(format.indexOf("y"), format.lastIndexOf("y") + 1); boolean validLeapYear = validateLeapYear(day, month, Integer.parseInt(year)); - if(!validLeapYear) { + if (!validLeapYear) { valuebox.setErrorText("Not a valid date"); } - return validate(month, getMonthRegex(), getMothDoesNotMatchError()) - && validate(day, getDayRegex(), getDayDoesNotMatchError()) - && validate(year, getYearRegex(), getYearDoesNotMatchError()) - && validLeapYear; + boolean valid = validate(month, getMonthRegex(), getMothDoesNotMatchError()) + && validate(day, getDayRegex(), getDayDoesNotMatchError()) + && validate(year, getYearRegex(), getYearDoesNotMatchError()) + && validLeapYear; + + if (valid) { + valuebox.clearStatusText(); + } + + return valid; } - valuebox.setErrorText("Text input must not be empty or null"); return false; } @@ -70,9 +81,9 @@ protected boolean validate(String type, String regex, String message) { protected boolean validateLeapYear(String day, String month, int year) { if (day.equals("31") && - (month.equals("4") || month.equals("6") || month.equals("9") || - month.equals("11") || month.equals("04") || month.equals("06") || - month.equals("09"))) { + (month.equals("4") || month.equals("6") || month.equals("9") || + month.equals("11") || month.equals("04") || month.equals("06") || + month.equals("09"))) { return false; } else if (month.equals("2") || month.equals("02")) { if (year % 4 == 0) { diff --git a/src/main/java/gwt/material/design/addins/client/md5/Md5.java b/src/main/java/gwt/material/design/addins/client/md5/Md5.java new file mode 100644 index 000000000..6f2a6896e --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/md5/Md5.java @@ -0,0 +1,52 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2021 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.addins.client.md5; + +import jsinterop.annotations.JsMethod; +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsType; + +@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "md5") +public class Md5 { + + public Md5(String message) { + } + + public Md5() { + } + + @JsMethod(namespace = "md5") + public static native String hex(String message); + + @JsMethod(namespace = "md5") + public static native byte[] array(String message); + + @JsMethod(namespace = "md5") + public static native byte[] digest(String message); + + @JsMethod(namespace = "md5") + public static native Object arrayBuffer(String message); + + @JsMethod(namespace = "md5") + public static native Object buffer(String message); + + @JsMethod(namespace = "md5") + public static native String base64(String message); +} diff --git a/src/main/java/gwt/material/design/addins/client/md5/Md5ClientBundle.java b/src/main/java/gwt/material/design/addins/client/md5/Md5ClientBundle.java new file mode 100644 index 000000000..635420efe --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/md5/Md5ClientBundle.java @@ -0,0 +1,38 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2017 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.addins.client.md5; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.TextResource; + +/** + * Client Bundle for Avatar component + * + * @author kevzlou7979 + */ +public interface Md5ClientBundle extends ClientBundle { + + Md5ClientBundle INSTANCE = GWT.create(Md5ClientBundle.class); + + @Source("resources/js/md5.min.js") + TextResource md5Js(); + +} diff --git a/src/main/java/gwt/material/design/addins/client/md5/Md5DebugClientBundle.java b/src/main/java/gwt/material/design/addins/client/md5/Md5DebugClientBundle.java new file mode 100644 index 000000000..872224bd7 --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/md5/Md5DebugClientBundle.java @@ -0,0 +1,37 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2017 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.addins.client.md5; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.TextResource; + +/** + * Client Bundle for Avatar component + * + * @author kevzlou7979 + */ +public interface Md5DebugClientBundle extends ClientBundle { + + Md5DebugClientBundle INSTANCE = GWT.create(Md5DebugClientBundle.class); + + @Source("resources/js/md5.js") + TextResource md5DebugJs(); +} diff --git a/src/main/java/gwt/material/design/addins/client/md5/Md5Util.java b/src/main/java/gwt/material/design/addins/client/md5/Md5Util.java new file mode 100644 index 000000000..0b60d6260 --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/md5/Md5Util.java @@ -0,0 +1,61 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2021 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.addins.client.md5; + +import gwt.material.design.addins.client.MaterialAddins; +import gwt.material.design.client.MaterialDesignBase; + +public class Md5Util { + static { + if (MaterialAddins.isDebug()) { + MaterialDesignBase.injectDebugJs(Md5DebugClientBundle.INSTANCE.md5DebugJs()); + } else { + MaterialDesignBase.injectJs(Md5ClientBundle.INSTANCE.md5Js()); + } + } + + public Md5Util() { + + } + + public String hex(String message) { + return Md5.hex(message); + } + + public byte[] array(String message) { + return Md5.array(message); + } + + public byte[] digest(String message) { + return Md5.digest(message); + } + + public Object arrayBuffer(String message) { + return Md5.arrayBuffer(message); + } + + public Object buffer(String message) { + return Md5.buffer(message); + } + + public String base64(String message) { + return Md5.base64(message); + } +} diff --git a/src/main/java/gwt/material/design/addins/client/popupmenu/MaterialPopupMenu.java b/src/main/java/gwt/material/design/addins/client/popupmenu/MaterialPopupMenu.java index b75c0e79a..92a325e87 100644 --- a/src/main/java/gwt/material/design/addins/client/popupmenu/MaterialPopupMenu.java +++ b/src/main/java/gwt/material/design/addins/client/popupmenu/MaterialPopupMenu.java @@ -19,7 +19,6 @@ */ package gwt.material.design.addins.client.popupmenu; -import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.Element; import com.google.gwt.event.logical.shared.*; import com.google.gwt.event.shared.HandlerRegistration; @@ -42,7 +41,7 @@ * @author Ben Dol */ public class MaterialPopupMenu extends UnorderedList implements JsLoader, HasSelectionHandlers, HasOpenHandlers, - HasCloseHandlers, HasOpenClose { + HasCloseHandlers, HasOpenClose { static { if (MaterialAddins.isDebug()) { @@ -56,6 +55,7 @@ public class MaterialPopupMenu extends UnorderedList implements JsLoader, HasSel private int popupY; private String id; private Object selected; + private boolean autoClose = true; public MaterialPopupMenu() { id = DOM.createUniqueId(); @@ -73,12 +73,16 @@ protected void onLoad() { public void load() { $(this).attr("tabindex", "0"); $(this).on("blur", e -> { - close(); + if (autoClose) { + close(); + } return true; }); $("*").on("scroll." + id, e -> { - close(); + if (autoClose) { + close(); + } return true; }); @@ -91,7 +95,7 @@ public void load() { protected void onUnload() { super.onUnload(); - unload(); + unload(); } @Override @@ -169,6 +173,14 @@ public void setPopupPosition(int popupX, int popupY) { setTop(popupY); } + public boolean isAutoClose() { + return autoClose; + } + + public void setAutoClose(boolean autoClose) { + this.autoClose = autoClose; + } + @Override public HandlerRegistration addSelectionHandler(SelectionHandler selectionHandler) { return addHandler(selectionHandler, SelectionEvent.getType()); @@ -177,7 +189,7 @@ public HandlerRegistration addSelectionHandler(SelectionHandler selecti @Override public void open() { setVisible(true); - Scheduler.get().scheduleDeferred(() -> setFocus(true)); + /*Scheduler.get().scheduleDeferred(() -> setFocus(true));*/ // Check if dropdown is out of the container (Left) if ($(this).width() + $(this).offset().left > body().width()) { diff --git a/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner-dark.css b/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner-dark.css new file mode 100644 index 000000000..dad05f85d --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner-dark.css @@ -0,0 +1,12 @@ +.banner { + background: #363636; + border: none; +} + +.banner button { + color: #bb86fc; +} + +.banner i.banner-icon { + background: #bb86fc; +} \ No newline at end of file diff --git a/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner-dark.min.css b/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner-dark.min.css new file mode 100644 index 000000000..e6c925c16 --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner-dark.min.css @@ -0,0 +1 @@ +.banner{background:#363636;border:none}.banner button{color:#bb86fc}.banner i.banner-icon{background:#bb86fc} \ No newline at end of file diff --git a/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner.css b/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner.css new file mode 100644 index 000000000..3c1eb2f51 --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner.css @@ -0,0 +1,47 @@ +.banner { + padding: 12px; + border: 1px solid #e9e9e9; + background: white; + clear: both; + overflow: hidden; + box-sizing: border-box; + position: fixed; + z-index: 999; + width: 100%; + top: 0; + left: 0; + right: 0; +} + +.banner i.banner-icon { + padding: 8px; + border-radius: 100%; + background: #42a5f5; + color: white; + display: inline-block; + vertical-align: middle; +} + +.banner span.material-label { + max-width: 70%; + margin-left: 12px; + display: inline-block; + vertical-align: middle; +} + +.banner .actions { + float: right; + font-weight: bold; +} + +.banner button, +.banner button:hover, +.banner button:focus { + cursor: pointer; + background: transparent; + color: #42a5f5; + box-shadow: none; + padding-left: 8px; + padding-right: 8px; + margin-left: 12px; +} \ No newline at end of file diff --git a/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner.min.css b/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner.min.css new file mode 100644 index 000000000..30d575e16 --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/client/banner/resources/css/banner.min.css @@ -0,0 +1 @@ +.banner{padding:12px;border:1px solid #e9e9e9;background:#fff;clear:both;overflow:hidden;box-sizing:border-box;position:fixed;z-index:999;width:100%;top:0;left:0;right:0}.banner i.banner-icon{padding:8px;border-radius:100%;background:#42a5f5;color:#fff;display:inline-block;vertical-align:middle}.banner span.material-label{max-width:70%;margin-left:12px;display:inline-block;vertical-align:middle}.banner .actions{float:right;font-weight:700}.banner button,.banner button:focus,.banner button:hover{cursor:pointer;background:0 0;color:#42a5f5;box-shadow:none;padding-left:8px;padding-right:8px;margin-left:12px} \ No newline at end of file diff --git a/src/main/resources/gwt/material/design/addins/client/countup/resources/css/countUp.css b/src/main/resources/gwt/material/design/addins/client/countup/resources/css/countUp.css new file mode 100644 index 000000000..0933502b0 --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/client/countup/resources/css/countUp.css @@ -0,0 +1,3 @@ +.count-up { + color: #212121; +} \ No newline at end of file diff --git a/src/main/resources/gwt/material/design/addins/client/countup/resources/css/countUp.min.css b/src/main/resources/gwt/material/design/addins/client/countup/resources/css/countUp.min.css new file mode 100644 index 000000000..7467e41c5 --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/client/countup/resources/css/countUp.min.css @@ -0,0 +1 @@ +.count-up{color:#212121} \ No newline at end of file diff --git a/src/main/resources/gwt/material/design/addins/client/md5/resources/js/md5.js b/src/main/resources/gwt/material/design/addins/client/md5/resources/js/md5.js new file mode 100644 index 000000000..c5d700c86 --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/client/md5/resources/js/md5.js @@ -0,0 +1,607 @@ +/** + * [js-md5]{@link https://github.com/emn178/js-md5} + * + * @namespace md5 + * @version 0.4.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2016 + * @license MIT + */ +(function (root) { + 'use strict'; + + var NODE_JS = typeof process == 'object' && process.versions && process.versions.node; + if (NODE_JS) { + root = global; + } + var COMMON_JS = !root.JS_MD5_TEST && typeof module == 'object' && module.exports; + var AMD = typeof define == 'function' && define.amd; + var ARRAY_BUFFER = !root.JS_MD5_TEST && typeof ArrayBuffer != 'undefined'; + var HEX_CHARS = '0123456789abcdef'.split(''); + var EXTRA = [128, 32768, 8388608, -2147483648]; + var SHIFT = [0, 8, 16, 24]; + var OUTPUT_TYPES = ['hex', 'array', 'digest', 'buffer', 'arrayBuffer']; + + var blocks = [], buffer8; + if (ARRAY_BUFFER) { + var buffer = new ArrayBuffer(68); + buffer8 = new Uint8Array(buffer); + blocks = new Uint32Array(buffer); + } + + /** + * @method hex + * @memberof md5 + * @description Output hash as hex string + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {String} Hex string + * @example + * md5.hex('The quick brown fox jumps over the lazy dog'); + * // equal to + * md5('The quick brown fox jumps over the lazy dog'); + */ + /** + * @method digest + * @memberof md5 + * @description Output hash as bytes array + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Array} Bytes array + * @example + * md5.digest('The quick brown fox jumps over the lazy dog'); + */ + /** + * @method array + * @memberof md5 + * @description Output hash as bytes array + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Array} Bytes array + * @example + * md5.array('The quick brown fox jumps over the lazy dog'); + */ + /** + * @method arrayBuffer + * @memberof md5 + * @description Output hash as ArrayBuffer + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {ArrayBuffer} ArrayBuffer + * @example + * md5.arrayBuffer('The quick brown fox jumps over the lazy dog'); + */ + /** + * @method buffer + * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. + * @memberof md5 + * @description Output hash as ArrayBuffer + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {ArrayBuffer} ArrayBuffer + * @example + * md5.buffer('The quick brown fox jumps over the lazy dog'); + */ + var createOutputMethod = function (outputType) { + return function (message) { + return new Md5(true).update(message)[outputType](); + }; + }; + + /** + * @method create + * @memberof md5 + * @description Create Md5 object + * @returns {Md5} Md5 object. + * @example + * var hash = md5.create(); + */ + /** + * @method update + * @memberof md5 + * @description Create and update Md5 object + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Md5} Md5 object. + * @example + * var hash = md5.update('The quick brown fox jumps over the lazy dog'); + * // equal to + * var hash = md5.create(); + * hash.update('The quick brown fox jumps over the lazy dog'); + */ + var createMethod = function () { + var method = createOutputMethod('hex'); + if (NODE_JS) { + method = nodeWrap(method); + } + method.create = function () { + return new Md5(); + }; + method.update = function (message) { + return method.create().update(message); + }; + for (var i = 0;i < OUTPUT_TYPES.length;++i) { + var type = OUTPUT_TYPES[i]; + method[type] = createOutputMethod(type); + } + return method; + }; + + var nodeWrap = function (method) { + var crypto, Buffer; + try { + if (root.JS_MD5_TEST) { + throw 'JS_MD5_TEST'; + } + crypto = require('crypto'); + Buffer = require('buffer').Buffer; + } catch (e) { + console.log(e); + return method; + } + var nodeMethod = function (message) { + if (typeof message == 'string') { + return crypto.createHash('md5').update(message, 'utf8').digest('hex'); + } else if (message.constructor == ArrayBuffer) { + message = new Uint8Array(message); + } else if (message.length === undefined) { + return method(message); + } + return crypto.createHash('md5').update(new Buffer(message)).digest('hex'); + }; + return nodeMethod; + }; + + /** + * Md5 class + * @class Md5 + * @description This is internal class. + * @see {@link md5.create} + */ + function Md5(sharedMemory) { + if (sharedMemory) { + blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + this.blocks = blocks; + this.buffer8 = buffer8; + } else { + if (ARRAY_BUFFER) { + var buffer = new ArrayBuffer(68); + this.buffer8 = new Uint8Array(buffer); + this.blocks = new Uint32Array(buffer); + } else { + this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + } + } + this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = 0; + this.finalized = this.hashed = false; + this.first = true; + } + + /** + * @method update + * @memberof Md5 + * @instance + * @description Update hash + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {Md5} Md5 object. + * @see {@link md5.update} + */ + Md5.prototype.update = function (message) { + if (this.finalized) { + return; + } + var notString = typeof(message) != 'string'; + if (notString && message.constructor == root.ArrayBuffer) { + message = new Uint8Array(message); + } + var code, index = 0, i, length = message.length || 0, blocks = this.blocks; + var buffer8 = this.buffer8; + + while (index < length) { + if (this.hashed) { + this.hashed = false; + blocks[0] = blocks[16]; + blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + } + + if (notString) { + if (ARRAY_BUFFER) { + for (i = this.start;index < length && i < 64; ++index) { + buffer8[i++] = message[index]; + } + } else { + for (i = this.start;index < length && i < 64; ++index) { + blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; + } + } + } else { + if (ARRAY_BUFFER) { + for (i = this.start;index < length && i < 64; ++index) { + code = message.charCodeAt(index); + if (code < 0x80) { + buffer8[i++] = code; + } else if (code < 0x800) { + buffer8[i++] = 0xc0 | (code >> 6); + buffer8[i++] = 0x80 | (code & 0x3f); + } else if (code < 0xd800 || code >= 0xe000) { + buffer8[i++] = 0xe0 | (code >> 12); + buffer8[i++] = 0x80 | ((code >> 6) & 0x3f); + buffer8[i++] = 0x80 | (code & 0x3f); + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); + buffer8[i++] = 0xf0 | (code >> 18); + buffer8[i++] = 0x80 | ((code >> 12) & 0x3f); + buffer8[i++] = 0x80 | ((code >> 6) & 0x3f); + buffer8[i++] = 0x80 | (code & 0x3f); + } + } + } else { + for (i = this.start;index < length && i < 64; ++index) { + code = message.charCodeAt(index); + if (code < 0x80) { + blocks[i >> 2] |= code << SHIFT[i++ & 3]; + } else if (code < 0x800) { + blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else if (code < 0xd800 || code >= 0xe000) { + blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); + blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } + } + } + } + this.lastByteIndex = i; + this.bytes += i - this.start; + if (i >= 64) { + this.start = i - 64; + this.hash(); + this.hashed = true; + } else { + this.start = i; + } + } + return this; + }; + + Md5.prototype.finalize = function () { + if (this.finalized) { + return; + } + this.finalized = true; + var blocks = this.blocks, i = this.lastByteIndex; + blocks[i >> 2] |= EXTRA[i & 3]; + if (i >= 56) { + if (!this.hashed) { + this.hash(); + } + blocks[0] = blocks[16]; + blocks[16] = blocks[1] = blocks[2] = blocks[3] = + blocks[4] = blocks[5] = blocks[6] = blocks[7] = + blocks[8] = blocks[9] = blocks[10] = blocks[11] = + blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; + } + blocks[14] = this.bytes << 3; + this.hash(); + }; + + Md5.prototype.hash = function () { + var a, b, c, d, bc, da, blocks = this.blocks; + + if (this.first) { + a = blocks[0] - 680876937; + a = (a << 7 | a >>> 25) - 271733879 << 0; + d = (-1732584194 ^ a & 2004318071) + blocks[1] - 117830708; + d = (d << 12 | d >>> 20) + a << 0; + c = (-271733879 ^ (d & (a ^ -271733879))) + blocks[2] - 1126478375; + c = (c << 17 | c >>> 15) + d << 0; + b = (a ^ (c & (d ^ a))) + blocks[3] - 1316259209; + b = (b << 22 | b >>> 10) + c << 0; + } else { + a = this.h0; + b = this.h1; + c = this.h2; + d = this.h3; + a += (d ^ (b & (c ^ d))) + blocks[0] - 680876936; + a = (a << 7 | a >>> 25) + b << 0; + d += (c ^ (a & (b ^ c))) + blocks[1] - 389564586; + d = (d << 12 | d >>> 20) + a << 0; + c += (b ^ (d & (a ^ b))) + blocks[2] + 606105819; + c = (c << 17 | c >>> 15) + d << 0; + b += (a ^ (c & (d ^ a))) + blocks[3] - 1044525330; + b = (b << 22 | b >>> 10) + c << 0; + } + + a += (d ^ (b & (c ^ d))) + blocks[4] - 176418897; + a = (a << 7 | a >>> 25) + b << 0; + d += (c ^ (a & (b ^ c))) + blocks[5] + 1200080426; + d = (d << 12 | d >>> 20) + a << 0; + c += (b ^ (d & (a ^ b))) + blocks[6] - 1473231341; + c = (c << 17 | c >>> 15) + d << 0; + b += (a ^ (c & (d ^ a))) + blocks[7] - 45705983; + b = (b << 22 | b >>> 10) + c << 0; + a += (d ^ (b & (c ^ d))) + blocks[8] + 1770035416; + a = (a << 7 | a >>> 25) + b << 0; + d += (c ^ (a & (b ^ c))) + blocks[9] - 1958414417; + d = (d << 12 | d >>> 20) + a << 0; + c += (b ^ (d & (a ^ b))) + blocks[10] - 42063; + c = (c << 17 | c >>> 15) + d << 0; + b += (a ^ (c & (d ^ a))) + blocks[11] - 1990404162; + b = (b << 22 | b >>> 10) + c << 0; + a += (d ^ (b & (c ^ d))) + blocks[12] + 1804603682; + a = (a << 7 | a >>> 25) + b << 0; + d += (c ^ (a & (b ^ c))) + blocks[13] - 40341101; + d = (d << 12 | d >>> 20) + a << 0; + c += (b ^ (d & (a ^ b))) + blocks[14] - 1502002290; + c = (c << 17 | c >>> 15) + d << 0; + b += (a ^ (c & (d ^ a))) + blocks[15] + 1236535329; + b = (b << 22 | b >>> 10) + c << 0; + a += (c ^ (d & (b ^ c))) + blocks[1] - 165796510; + a = (a << 5 | a >>> 27) + b << 0; + d += (b ^ (c & (a ^ b))) + blocks[6] - 1069501632; + d = (d << 9 | d >>> 23) + a << 0; + c += (a ^ (b & (d ^ a))) + blocks[11] + 643717713; + c = (c << 14 | c >>> 18) + d << 0; + b += (d ^ (a & (c ^ d))) + blocks[0] - 373897302; + b = (b << 20 | b >>> 12) + c << 0; + a += (c ^ (d & (b ^ c))) + blocks[5] - 701558691; + a = (a << 5 | a >>> 27) + b << 0; + d += (b ^ (c & (a ^ b))) + blocks[10] + 38016083; + d = (d << 9 | d >>> 23) + a << 0; + c += (a ^ (b & (d ^ a))) + blocks[15] - 660478335; + c = (c << 14 | c >>> 18) + d << 0; + b += (d ^ (a & (c ^ d))) + blocks[4] - 405537848; + b = (b << 20 | b >>> 12) + c << 0; + a += (c ^ (d & (b ^ c))) + blocks[9] + 568446438; + a = (a << 5 | a >>> 27) + b << 0; + d += (b ^ (c & (a ^ b))) + blocks[14] - 1019803690; + d = (d << 9 | d >>> 23) + a << 0; + c += (a ^ (b & (d ^ a))) + blocks[3] - 187363961; + c = (c << 14 | c >>> 18) + d << 0; + b += (d ^ (a & (c ^ d))) + blocks[8] + 1163531501; + b = (b << 20 | b >>> 12) + c << 0; + a += (c ^ (d & (b ^ c))) + blocks[13] - 1444681467; + a = (a << 5 | a >>> 27) + b << 0; + d += (b ^ (c & (a ^ b))) + blocks[2] - 51403784; + d = (d << 9 | d >>> 23) + a << 0; + c += (a ^ (b & (d ^ a))) + blocks[7] + 1735328473; + c = (c << 14 | c >>> 18) + d << 0; + b += (d ^ (a & (c ^ d))) + blocks[12] - 1926607734; + b = (b << 20 | b >>> 12) + c << 0; + bc = b ^ c; + a += (bc ^ d) + blocks[5] - 378558; + a = (a << 4 | a >>> 28) + b << 0; + d += (bc ^ a) + blocks[8] - 2022574463; + d = (d << 11 | d >>> 21) + a << 0; + da = d ^ a; + c += (da ^ b) + blocks[11] + 1839030562; + c = (c << 16 | c >>> 16) + d << 0; + b += (da ^ c) + blocks[14] - 35309556; + b = (b << 23 | b >>> 9) + c << 0; + bc = b ^ c; + a += (bc ^ d) + blocks[1] - 1530992060; + a = (a << 4 | a >>> 28) + b << 0; + d += (bc ^ a) + blocks[4] + 1272893353; + d = (d << 11 | d >>> 21) + a << 0; + da = d ^ a; + c += (da ^ b) + blocks[7] - 155497632; + c = (c << 16 | c >>> 16) + d << 0; + b += (da ^ c) + blocks[10] - 1094730640; + b = (b << 23 | b >>> 9) + c << 0; + bc = b ^ c; + a += (bc ^ d) + blocks[13] + 681279174; + a = (a << 4 | a >>> 28) + b << 0; + d += (bc ^ a) + blocks[0] - 358537222; + d = (d << 11 | d >>> 21) + a << 0; + da = d ^ a; + c += (da ^ b) + blocks[3] - 722521979; + c = (c << 16 | c >>> 16) + d << 0; + b += (da ^ c) + blocks[6] + 76029189; + b = (b << 23 | b >>> 9) + c << 0; + bc = b ^ c; + a += (bc ^ d) + blocks[9] - 640364487; + a = (a << 4 | a >>> 28) + b << 0; + d += (bc ^ a) + blocks[12] - 421815835; + d = (d << 11 | d >>> 21) + a << 0; + da = d ^ a; + c += (da ^ b) + blocks[15] + 530742520; + c = (c << 16 | c >>> 16) + d << 0; + b += (da ^ c) + blocks[2] - 995338651; + b = (b << 23 | b >>> 9) + c << 0; + a += (c ^ (b | ~d)) + blocks[0] - 198630844; + a = (a << 6 | a >>> 26) + b << 0; + d += (b ^ (a | ~c)) + blocks[7] + 1126891415; + d = (d << 10 | d >>> 22) + a << 0; + c += (a ^ (d | ~b)) + blocks[14] - 1416354905; + c = (c << 15 | c >>> 17) + d << 0; + b += (d ^ (c | ~a)) + blocks[5] - 57434055; + b = (b << 21 | b >>> 11) + c << 0; + a += (c ^ (b | ~d)) + blocks[12] + 1700485571; + a = (a << 6 | a >>> 26) + b << 0; + d += (b ^ (a | ~c)) + blocks[3] - 1894986606; + d = (d << 10 | d >>> 22) + a << 0; + c += (a ^ (d | ~b)) + blocks[10] - 1051523; + c = (c << 15 | c >>> 17) + d << 0; + b += (d ^ (c | ~a)) + blocks[1] - 2054922799; + b = (b << 21 | b >>> 11) + c << 0; + a += (c ^ (b | ~d)) + blocks[8] + 1873313359; + a = (a << 6 | a >>> 26) + b << 0; + d += (b ^ (a | ~c)) + blocks[15] - 30611744; + d = (d << 10 | d >>> 22) + a << 0; + c += (a ^ (d | ~b)) + blocks[6] - 1560198380; + c = (c << 15 | c >>> 17) + d << 0; + b += (d ^ (c | ~a)) + blocks[13] + 1309151649; + b = (b << 21 | b >>> 11) + c << 0; + a += (c ^ (b | ~d)) + blocks[4] - 145523070; + a = (a << 6 | a >>> 26) + b << 0; + d += (b ^ (a | ~c)) + blocks[11] - 1120210379; + d = (d << 10 | d >>> 22) + a << 0; + c += (a ^ (d | ~b)) + blocks[2] + 718787259; + c = (c << 15 | c >>> 17) + d << 0; + b += (d ^ (c | ~a)) + blocks[9] - 343485551; + b = (b << 21 | b >>> 11) + c << 0; + + if (this.first) { + this.h0 = a + 1732584193 << 0; + this.h1 = b - 271733879 << 0; + this.h2 = c - 1732584194 << 0; + this.h3 = d + 271733878 << 0; + this.first = false; + } else { + this.h0 = this.h0 + a << 0; + this.h1 = this.h1 + b << 0; + this.h2 = this.h2 + c << 0; + this.h3 = this.h3 + d << 0; + } + }; + + /** + * @method hex + * @memberof Md5 + * @instance + * @description Output hash as hex string + * @returns {String} Hex string + * @see {@link md5.hex} + * @example + * hash.hex(); + */ + Md5.prototype.hex = function () { + this.finalize(); + + var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3; + + return HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] + + HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] + + HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] + + HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] + + HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] + + HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] + + HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] + + HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] + + HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] + + HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] + + HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] + + HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] + + HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] + + HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] + + HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] + + HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F]; + }; + + /** + * @method toString + * @memberof Md5 + * @instance + * @description Output hash as hex string + * @returns {String} Hex string + * @see {@link md5.hex} + * @example + * hash.toString(); + */ + Md5.prototype.toString = Md5.prototype.hex; + + /** + * @method digest + * @memberof Md5 + * @instance + * @description Output hash as bytes array + * @returns {Array} Bytes array + * @see {@link md5.digest} + * @example + * hash.digest(); + */ + Md5.prototype.digest = function () { + this.finalize(); + + var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3; + return [ + h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 24) & 0xFF, + h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 24) & 0xFF, + h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 24) & 0xFF, + h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 24) & 0xFF + ]; + }; + + /** + * @method array + * @memberof Md5 + * @instance + * @description Output hash as bytes array + * @returns {Array} Bytes array + * @see {@link md5.array} + * @example + * hash.array(); + */ + Md5.prototype.array = Md5.prototype.digest; + + /** + * @method arrayBuffer + * @memberof Md5 + * @instance + * @description Output hash as ArrayBuffer + * @returns {ArrayBuffer} ArrayBuffer + * @see {@link md5.arrayBuffer} + * @example + * hash.arrayBuffer(); + */ + Md5.prototype.arrayBuffer = function () { + this.finalize(); + + var buffer = new ArrayBuffer(16); + var blocks = new Uint32Array(buffer); + blocks[0] = this.h0; + blocks[1] = this.h1; + blocks[2] = this.h2; + blocks[3] = this.h3; + return buffer; + }; + + /** + * @method buffer + * @deprecated This maybe confuse with Buffer in node.js. Please use arrayBuffer instead. + * @memberof Md5 + * @instance + * @description Output hash as ArrayBuffer + * @returns {ArrayBuffer} ArrayBuffer + * @see {@link md5.buffer} + * @example + * hash.buffer(); + */ + Md5.prototype.buffer = Md5.prototype.arrayBuffer; + + var exports = createMethod(); + + if (COMMON_JS) { + module.exports = exports; + } else { + /** + * @method md5 + * @description Md5 hash function, export to global in browsers. + * @param {String|Array|Uint8Array|ArrayBuffer} message message to hash + * @returns {String} md5 hashes + * @example + * md5(''); // d41d8cd98f00b204e9800998ecf8427e + * md5('The quick brown fox jumps over the lazy dog'); // 9e107d9d372bb6826bd81d3542a419d6 + * md5('The quick brown fox jumps over the lazy dog.'); // e4d909c290d0fb1ca068ffaddf22cbd0 + * + * // It also supports UTF-8 encoding + * md5('中文'); // a7bac2239fcdcb3a067903d8077c4a07 + * + * // It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` + * md5([]); // d41d8cd98f00b204e9800998ecf8427e + * md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e + */ + root.md5 = exports; + if (AMD) { + define(function () { + return exports; + }); + } + } +}(this)); \ No newline at end of file diff --git a/src/main/resources/gwt/material/design/addins/client/md5/resources/js/md5.min.js b/src/main/resources/gwt/material/design/addins/client/md5/resources/js/md5.min.js new file mode 100644 index 000000000..384e1a633 --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/client/md5/resources/js/md5.min.js @@ -0,0 +1,10 @@ +/** + * [js-md5]{@link https://github.com/emn178/js-md5} + * + * @namespace md5 + * @version 0.4.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2016 + * @license MIT + */ +!function(t){"use strict";function r(t){if(t)c[0]=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0,this.blocks=c,this.buffer8=i;else if(n){var r=new ArrayBuffer(68);this.buffer8=new Uint8Array(r),this.blocks=new Uint32Array(r)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0}var e="object"==typeof process&&process.versions&&process.versions.node;e&&(t=global);var i,h=!t.JS_MD5_TEST&&"object"==typeof module&&module.exports,s="function"==typeof define&&define.amd,n=!t.JS_MD5_TEST&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),a=[128,32768,8388608,-2147483648],o=[0,8,16,24],u=["hex","array","digest","buffer","arrayBuffer"],c=[];if(n){var p=new ArrayBuffer(68);i=new Uint8Array(p),c=new Uint32Array(p)}var y=function(t){return function(e){return new r(!0).update(e)[t]()}},d=function(){var t=y("hex");e&&(t=l(t)),t.create=function(){return new r},t.update=function(r){return t.create().update(r)};for(var i=0;is;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),e)if(n)for(h=this.start;f>s&&64>h;++s)u[h++]=r[s];else for(h=this.start;f>s&&64>h;++s)a[h>>2]|=r[s]<s&&64>h;++s)i=r.charCodeAt(s),128>i?u[h++]=i:2048>i?(u[h++]=192|i>>6,u[h++]=128|63&i):55296>i||i>=57344?(u[h++]=224|i>>12,u[h++]=128|i>>6&63,u[h++]=128|63&i):(i=65536+((1023&i)<<10|1023&r.charCodeAt(++s)),u[h++]=240|i>>18,u[h++]=128|i>>12&63,u[h++]=128|i>>6&63,u[h++]=128|63&i);else for(h=this.start;f>s&&64>h;++s)i=r.charCodeAt(s),128>i?a[h>>2]|=i<i?(a[h>>2]|=(192|i>>6)<>2]|=(128|63&i)<i||i>=57344?(a[h>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=64?(this.start=h-64,this.hash(),this.hashed=!0):this.start=h}return this}},r.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex;t[r>>2]|=a[3&r],r>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,this.hash()}},r.prototype.hash=function(){var t,r,e,i,h,s,n=this.blocks;this.first?(t=n[0]-680876937,t=(t<<7|t>>>25)-271733879<<0,i=(-1732584194^2004318071&t)+n[1]-117830708,i=(i<<12|i>>>20)+t<<0,e=(-271733879^i&(-271733879^t))+n[2]-1126478375,e=(e<<17|e>>>15)+i<<0,r=(t^e&(i^t))+n[3]-1316259209,r=(r<<22|r>>>10)+e<<0):(t=this.h0,r=this.h1,e=this.h2,i=this.h3,t+=(i^r&(e^i))+n[0]-680876936,t=(t<<7|t>>>25)+r<<0,i+=(e^t&(r^e))+n[1]-389564586,i=(i<<12|i>>>20)+t<<0,e+=(r^i&(t^r))+n[2]+606105819,e=(e<<17|e>>>15)+i<<0,r+=(t^e&(i^t))+n[3]-1044525330,r=(r<<22|r>>>10)+e<<0),t+=(i^r&(e^i))+n[4]-176418897,t=(t<<7|t>>>25)+r<<0,i+=(e^t&(r^e))+n[5]+1200080426,i=(i<<12|i>>>20)+t<<0,e+=(r^i&(t^r))+n[6]-1473231341,e=(e<<17|e>>>15)+i<<0,r+=(t^e&(i^t))+n[7]-45705983,r=(r<<22|r>>>10)+e<<0,t+=(i^r&(e^i))+n[8]+1770035416,t=(t<<7|t>>>25)+r<<0,i+=(e^t&(r^e))+n[9]-1958414417,i=(i<<12|i>>>20)+t<<0,e+=(r^i&(t^r))+n[10]-42063,e=(e<<17|e>>>15)+i<<0,r+=(t^e&(i^t))+n[11]-1990404162,r=(r<<22|r>>>10)+e<<0,t+=(i^r&(e^i))+n[12]+1804603682,t=(t<<7|t>>>25)+r<<0,i+=(e^t&(r^e))+n[13]-40341101,i=(i<<12|i>>>20)+t<<0,e+=(r^i&(t^r))+n[14]-1502002290,e=(e<<17|e>>>15)+i<<0,r+=(t^e&(i^t))+n[15]+1236535329,r=(r<<22|r>>>10)+e<<0,t+=(e^i&(r^e))+n[1]-165796510,t=(t<<5|t>>>27)+r<<0,i+=(r^e&(t^r))+n[6]-1069501632,i=(i<<9|i>>>23)+t<<0,e+=(t^r&(i^t))+n[11]+643717713,e=(e<<14|e>>>18)+i<<0,r+=(i^t&(e^i))+n[0]-373897302,r=(r<<20|r>>>12)+e<<0,t+=(e^i&(r^e))+n[5]-701558691,t=(t<<5|t>>>27)+r<<0,i+=(r^e&(t^r))+n[10]+38016083,i=(i<<9|i>>>23)+t<<0,e+=(t^r&(i^t))+n[15]-660478335,e=(e<<14|e>>>18)+i<<0,r+=(i^t&(e^i))+n[4]-405537848,r=(r<<20|r>>>12)+e<<0,t+=(e^i&(r^e))+n[9]+568446438,t=(t<<5|t>>>27)+r<<0,i+=(r^e&(t^r))+n[14]-1019803690,i=(i<<9|i>>>23)+t<<0,e+=(t^r&(i^t))+n[3]-187363961,e=(e<<14|e>>>18)+i<<0,r+=(i^t&(e^i))+n[8]+1163531501,r=(r<<20|r>>>12)+e<<0,t+=(e^i&(r^e))+n[13]-1444681467,t=(t<<5|t>>>27)+r<<0,i+=(r^e&(t^r))+n[2]-51403784,i=(i<<9|i>>>23)+t<<0,e+=(t^r&(i^t))+n[7]+1735328473,e=(e<<14|e>>>18)+i<<0,r+=(i^t&(e^i))+n[12]-1926607734,r=(r<<20|r>>>12)+e<<0,h=r^e,t+=(h^i)+n[5]-378558,t=(t<<4|t>>>28)+r<<0,i+=(h^t)+n[8]-2022574463,i=(i<<11|i>>>21)+t<<0,s=i^t,e+=(s^r)+n[11]+1839030562,e=(e<<16|e>>>16)+i<<0,r+=(s^e)+n[14]-35309556,r=(r<<23|r>>>9)+e<<0,h=r^e,t+=(h^i)+n[1]-1530992060,t=(t<<4|t>>>28)+r<<0,i+=(h^t)+n[4]+1272893353,i=(i<<11|i>>>21)+t<<0,s=i^t,e+=(s^r)+n[7]-155497632,e=(e<<16|e>>>16)+i<<0,r+=(s^e)+n[10]-1094730640,r=(r<<23|r>>>9)+e<<0,h=r^e,t+=(h^i)+n[13]+681279174,t=(t<<4|t>>>28)+r<<0,i+=(h^t)+n[0]-358537222,i=(i<<11|i>>>21)+t<<0,s=i^t,e+=(s^r)+n[3]-722521979,e=(e<<16|e>>>16)+i<<0,r+=(s^e)+n[6]+76029189,r=(r<<23|r>>>9)+e<<0,h=r^e,t+=(h^i)+n[9]-640364487,t=(t<<4|t>>>28)+r<<0,i+=(h^t)+n[12]-421815835,i=(i<<11|i>>>21)+t<<0,s=i^t,e+=(s^r)+n[15]+530742520,e=(e<<16|e>>>16)+i<<0,r+=(s^e)+n[2]-995338651,r=(r<<23|r>>>9)+e<<0,t+=(e^(r|~i))+n[0]-198630844,t=(t<<6|t>>>26)+r<<0,i+=(r^(t|~e))+n[7]+1126891415,i=(i<<10|i>>>22)+t<<0,e+=(t^(i|~r))+n[14]-1416354905,e=(e<<15|e>>>17)+i<<0,r+=(i^(e|~t))+n[5]-57434055,r=(r<<21|r>>>11)+e<<0,t+=(e^(r|~i))+n[12]+1700485571,t=(t<<6|t>>>26)+r<<0,i+=(r^(t|~e))+n[3]-1894986606,i=(i<<10|i>>>22)+t<<0,e+=(t^(i|~r))+n[10]-1051523,e=(e<<15|e>>>17)+i<<0,r+=(i^(e|~t))+n[1]-2054922799,r=(r<<21|r>>>11)+e<<0,t+=(e^(r|~i))+n[8]+1873313359,t=(t<<6|t>>>26)+r<<0,i+=(r^(t|~e))+n[15]-30611744,i=(i<<10|i>>>22)+t<<0,e+=(t^(i|~r))+n[6]-1560198380,e=(e<<15|e>>>17)+i<<0,r+=(i^(e|~t))+n[13]+1309151649,r=(r<<21|r>>>11)+e<<0,t+=(e^(r|~i))+n[4]-145523070,t=(t<<6|t>>>26)+r<<0,i+=(r^(t|~e))+n[11]-1120210379,i=(i<<10|i>>>22)+t<<0,e+=(t^(i|~r))+n[2]+718787259,e=(e<<15|e>>>17)+i<<0,r+=(i^(e|~t))+n[9]-343485551,r=(r<<21|r>>>11)+e<<0,this.first?(this.h0=t+1732584193<<0,this.h1=r-271733879<<0,this.h2=e-1732584194<<0,this.h3=i+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+r<<0,this.h2=this.h2+e<<0,this.h3=this.h3+i<<0)},r.prototype.hex=function(){this.finalize();var t=this.h0,r=this.h1,e=this.h2,i=this.h3;return f[t>>4&15]+f[15&t]+f[t>>12&15]+f[t>>8&15]+f[t>>20&15]+f[t>>16&15]+f[t>>28&15]+f[t>>24&15]+f[r>>4&15]+f[15&r]+f[r>>12&15]+f[r>>8&15]+f[r>>20&15]+f[r>>16&15]+f[r>>28&15]+f[r>>24&15]+f[e>>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15]+f[i>>4&15]+f[15&i]+f[i>>12&15]+f[i>>8&15]+f[i>>20&15]+f[i>>16&15]+f[i>>28&15]+f[i>>24&15]},r.prototype.toString=r.prototype.hex,r.prototype.digest=function(){this.finalize();var t=this.h0,r=this.h1,e=this.h2,i=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&e,e>>8&255,e>>16&255,e>>24&255,255&i,i>>8&255,i>>16&255,i>>24&255]},r.prototype.array=r.prototype.digest,r.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),r=new Uint32Array(t);return r[0]=this.h0,r[1]=this.h1,r[2]=this.h2,r[3]=this.h3,t},r.prototype.buffer=r.prototype.arrayBuffer;var v=d();h?module.exports=v:(t.md5=v,s&&define(function(){return v}))}(this); \ No newline at end of file diff --git a/src/test/java/gwt/material/design/addins/client/ui/MaterialComboBoxTest.java b/src/test/java/gwt/material/design/addins/client/ui/MaterialComboBoxTest.java index cbf518db4..98148c9bc 100644 --- a/src/test/java/gwt/material/design/addins/client/ui/MaterialComboBoxTest.java +++ b/src/test/java/gwt/material/design/addins/client/ui/MaterialComboBoxTest.java @@ -19,9 +19,11 @@ */ package gwt.material.design.addins.client.ui; +import com.google.gwt.event.dom.client.HasAllFocusHandlers; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.event.shared.GwtEvent; +import com.google.gwt.user.client.ui.HasEnabled; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import gwt.material.design.addins.client.base.constants.AddinsCssName; @@ -376,4 +378,9 @@ public void testLanguage() { comboBox.setLanguage(languageOptions); assertEquals(languageOptions, comboBox.getLanguage()); } + + @Override + protected void checkFocusAndBlurEvents(H widget) { + + } }