Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.9.2 ready #249

Merged
merged 81 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
66c3c12
#100 development branch with snapshot version set up
vaadin-miki May 4, 2020
d50a607
#100 ready (#101)
vaadin-miki May 7, 2020
85009d5
#105 fixed
vaadin-miki May 7, 2020
2ce9a58
#108 set up in a separate profile (#109)
vaadin-miki May 12, 2020
ac137aa
automated release notes (#110)
vaadin-miki May 12, 2020
5a61be5
#111 done
vaadin-miki May 12, 2020
06212f3
Merge pull request #112 from vaadin-miki/111-run-sonar-more-often
vaadin-miki May 12, 2020
aa302b5
#113 done
vaadin-miki May 12, 2020
06374ab
Merge pull request #114 from vaadin-miki/113-sonar-and-github-token
vaadin-miki May 12, 2020
bfcb333
#115 done
vaadin-miki May 12, 2020
7c824e4
Merge pull request #116 from vaadin-miki/115-no-shallow-clone
vaadin-miki May 12, 2020
b62bf69
#117 done
vaadin-miki May 13, 2020
82bbb44
#119 hopefully done, needs merging and testing (#120)
vaadin-miki May 25, 2020
8cb6b86
#22 and #124 done (#125)
vaadin-miki May 25, 2020
b833449
#126, #127, #129 done (#128)
vaadin-miki May 28, 2020
88f970e
#132 done (#133)
vaadin-miki May 29, 2020
3e2429e
122 super text field (#134)
vaadin-miki Jun 1, 2020
c50f655
#136 done
vaadin-miki Jun 2, 2020
396c8fe
Merge pull request #138 from vaadin-miki/136-fixed-setreadonly-for-nu…
vaadin-miki Jun 2, 2020
5601d60
#137 done (#140)
vaadin-miki Jun 2, 2020
9c89b31
123 text selection api (#142)
vaadin-miki Jun 4, 2020
df8cdf5
#139 done (#144)
vaadin-miki Jun 5, 2020
292cf82
#143 done (#145)
vaadin-miki Jun 5, 2020
bfc1641
#135 and #146 done (#148)
vaadin-miki Jun 5, 2020
39a3755
#147 done (#149)
vaadin-miki Jun 5, 2020
4cbaffe
#152 done (#153)
vaadin-miki Jun 8, 2020
d6931a3
Bump websocket-extensions from 0.1.3 to 0.1.4 in /demo-v14 (#151)
dependabot[bot] Jun 8, 2020
7d9efbf
#154 fixed (#155)
vaadin-miki Jun 9, 2020
c1be9fe
#131 could it be this simple?
vaadin-miki Jun 10, 2020
01efd91
Merge pull request #158 from vaadin-miki/131-conflict-resolving
vaadin-miki Jun 10, 2020
f9d1431
131 conflict resolving (#164)
vaadin-miki Jun 16, 2020
89c6bd3
#131 using separate step with PR for notes (with automatic merge) (#165)
vaadin-miki Jun 17, 2020
47f03a6
#131 using delayed merge action (#167)
vaadin-miki Jun 21, 2020
ac39ffa
(bot) release notes updated for 0.7.0
vaadin-miki Jun 21, 2020
5222ef1
automatic merge of PR #168
github-actions[bot] Jun 21, 2020
ab9bcca
#171 DatePattern now in a separate package (#172)
vaadin-miki Jun 22, 2020
c3a8281
173 threadlocal unload observer (#175)
vaadin-miki Jun 25, 2020
58ffe02
#170 done (#177)
vaadin-miki Jun 26, 2020
cbcfca6
#178 UnloadObserver is now UI-scoped singleton (#179)
vaadin-miki Jul 1, 2020
187eb88
(bot) release notes updated for 0.7.1
vaadin-miki Jul 1, 2020
e4a3335
automatic merge of PR #180
github-actions[bot] Jul 1, 2020
9aef510
done #182 and #183
vaadin-miki Jul 3, 2020
dd837d7
#174 done (#185)
vaadin-miki Jul 4, 2020
e70d813
(bot) release notes updated for 0.7.2
vaadin-miki Jul 4, 2020
36dd05a
automatic merge of PR #186
github-actions[bot] Jul 4, 2020
677592f
#188 fixes to automated release-notes.md creation (#190)
vaadin-miki Jul 6, 2020
7314c22
#189 done, #191 fixed in the process (#192)
vaadin-miki Jul 6, 2020
558f31e
#188 fixed wrong path (#193)
vaadin-miki Jul 6, 2020
8b04d63
(bot) release notes updated for 0.7.3
vaadin-miki Jul 6, 2020
6ffa1e0
automatic merge of PR #194
github-actions[bot] Jul 6, 2020
7630686
#160 done (#197)
vaadin-miki Jul 8, 2020
6bf0427
#196 done (#198)
vaadin-miki Jul 8, 2020
21a4e7e
#199 fixed (#200)
vaadin-miki Jul 22, 2020
e382394
#201 done (#202)
vaadin-miki Jul 24, 2020
f8a2eb1
(bot) release notes updated for 0.8.0
vaadin-miki Jul 27, 2020
34fa62d
automatic merge of PR #203
github-actions[bot] Jul 27, 2020
fca71dd
Removing beforeunload EventListener on detach (#207)
vaadin-miki Jul 28, 2020
c4d4c19
#208 added contributors to README
vaadin-miki Jul 28, 2020
92f74a1
GridSelect (#213)
vaadin-miki Aug 24, 2020
8e1fc7b
#214 seems done (#215)
vaadin-miki Aug 24, 2020
f2ab4ef
super date (time) picker now optionally always accepts short year (#217)
vaadin-miki Aug 24, 2020
0366d0a
(bot) release notes updated for 0.9.0
vaadin-miki Aug 27, 2020
8801399
automatic merge of PR #218
github-actions[bot] Aug 27, 2020
9e1beea
GridSelect's grid now can no longer have the selection mode changed (…
vaadin-miki Sep 3, 2020
dbd540d
#224 done (#225)
vaadin-miki Sep 7, 2020
563715b
#227 upgraded to vaadin 14.4 and added field helpers (#228)
vaadin-miki Oct 12, 2020
86d1954
#226 slf4j-simple is now demo dependency only (#230)
vaadin-miki Oct 12, 2020
7f009cd
#231 done (#232)
vaadin-miki Oct 12, 2020
aa8f3a2
Bump junit from 4.13 to 4.13.1 in /superfields (#229)
dependabot[bot] Oct 12, 2020
899e5c8
(bot) release notes updated for 0.9.1
vaadin-miki Oct 13, 2020
0bb0cb9
automatic merge of PR #233
github-actions[bot] Oct 13, 2020
3e810fc
Revert "Release notes for version " (#235) because of #220
vaadin-miki Oct 13, 2020
a40eec9
220 release process (#236)
vaadin-miki Oct 13, 2020
637944d
(bot) release notes updated for 0.9.1
vaadin-miki Oct 13, 2020
10e95f0
automatic merge of PR #237
github-actions[bot] Oct 13, 2020
dda5138
number fields validation fixed (#246)
vaadin-miki Nov 20, 2020
0387111
text selection mixin now works in grid (#247)
vaadin-miki Nov 20, 2020
2a89882
(bot) release notes updated for 0.9.2
vaadin-miki Nov 20, 2020
9a58f61
automatic merge of PR #248
github-actions[bot] Nov 20, 2020
661aede
(bot) version updated to 0.9.2
vaadin-miki Nov 20, 2020
d7abb60
Merge branch 'master' into release-0.9.2
vaadin-miki Nov 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This is the relevant dependency:
<dependency>
<groupId>org.vaadin.miki</groupId>
<artifactId>superfields</artifactId>
<version>0.9.1</version>
<version>0.9.2</version>
</dependency>
```

Expand Down Expand Up @@ -58,7 +58,9 @@ The author of the majority of the code is Miki, but this project would not be po
* Gerald Koch
* Sebastian Kühnau
* Jean-François Lamy
* Erik Lumme
* Simon Martinelli
* Dmitry Nazukin
* Stefan Penndorf
* Stuart Robinson
* Kaspar Scherrer
Expand All @@ -68,3 +70,5 @@ The author of the majority of the code is Miki, but this project would not be po
## Small print

All components are provided "as is", with no warranty or liability. See license for details.

This library is not officially supported or endorsed by Vaadin and is not part of the Vaadin Platform.
12 changes: 8 additions & 4 deletions demo-v14/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<artifactId>superfields-parent</artifactId>
<groupId>org.vaadin.miki</groupId>
<version>0.9.1</version>
<version>0.9.2</version>
</parent>

<artifactId>superfields-demo-v14</artifactId>
<version>0.9.1</version>
<version>0.9.2</version>
<name>V14 demo app for SuperFields</name>
<description>Showcase application for V14 and SuperFields.</description>
<packaging>war</packaging>
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>org.vaadin.miki</groupId>
<artifactId>superfields</artifactId>
<version>0.9.1</version>
<version>0.9.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Expand All @@ -38,7 +38,11 @@
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
</dependency>

<dependency>
<groupId>org.atteo.classindex</groupId>
<artifactId>classindex</artifactId>
<version>3.10</version>
</dependency>

<dependency>
<groupId>com.vaadin</groupId>
Expand Down
421 changes: 65 additions & 356 deletions demo-v14/src/main/java/org/vaadin/miki/DemoComponentFactory.java

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-v14/src/main/java/org/vaadin/miki/MainLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public MainLayout() {
public void afterNavigation(AfterNavigationEvent event) {
if(event.getLocation().getPath().isEmpty())
this.navigationTabs.setSelectedIndex(0);
else
else if(!event.getLocation().getPath().equals("binder"))
this.navigationTabs.setSelectedTab(this.tabs.get(event.getLocation().getSegments().get(1)));
}
}
21 changes: 21 additions & 0 deletions demo-v14/src/main/java/org/vaadin/miki/SampleModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.vaadin.miki;

/**
* A generic model to use in validation.
* @param <T> Type of the object to hold.
* @author miki
* @since 2020-11-14
*/
public class SampleModel<T> {

private T value;

public T getValue() {
return value;
}

public void setValue(T value) {
this.value = value;
}

}
23 changes: 23 additions & 0 deletions demo-v14/src/main/java/org/vaadin/miki/demo/ComponentProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.vaadin.miki.demo;

import com.vaadin.flow.component.Component;
import org.atteo.classindex.IndexSubclasses;

/**
* Marker interface for objects that provide an instance of a Vaadin {@link Component}.
* It is assumed that implementations of this interface provide a public, no-arg constructor.
* @param <T> Type of the component to be created.
* @author miki
* @since 2020-11-17
*/
@FunctionalInterface
@IndexSubclasses
public interface ComponentProvider<T extends Component> {

/**
* Builds a fresh instance of a component.
* @return A non-null instance of an object.
*/
T getComponent();

}
26 changes: 26 additions & 0 deletions demo-v14/src/main/java/org/vaadin/miki/demo/ContentBuilder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.vaadin.miki.demo;

import com.vaadin.flow.component.Component;
import org.atteo.classindex.IndexSubclasses;

import java.util.function.Consumer;

/**
* Marker interface for objects that build content for components.
* Implementations of this interface must have a public no-arg constructor.
* @param <T> Type of the object to build content for.
* @author miki
* @since 2020-11-18
*/
@IndexSubclasses
@FunctionalInterface
public interface ContentBuilder<T> {

/**
* Builds content.
* @param component {@link Component} to build content for. Already cast to {@code T} for easier use.
* @param callback Callback to call when content is built.
*/
void buildContent(T component, Consumer<Component[]> callback);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.vaadin.miki.demo;

/**
* Marker interface for an object that needs access to {@link ValidatorStorage}.
* @author miki
* @since 2020-11-18
*/
@FunctionalInterface
public interface NeedsValidatorStorage {

/**
* Sets the {@link ValidatorStorage} associated with this object.
* @param storage Storage. Must not be {@code null}.
*/
void setValidatorStorage(ValidatorStorage storage);

}
19 changes: 19 additions & 0 deletions demo-v14/src/main/java/org/vaadin/miki/demo/Order.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.vaadin.miki.demo;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Defines order in which classes will be sorted.
* @author miki
* @since 2020-11-20
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Order {

int value() default Integer.MAX_VALUE;

}
38 changes: 38 additions & 0 deletions demo-v14/src/main/java/org/vaadin/miki/demo/ValidatorStorage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.vaadin.miki.demo;

import com.vaadin.flow.component.HasValue;
import com.vaadin.flow.data.binder.Validator;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;

/**
* Stores component-specific {@link Validator}s.
* @author miki
* @since 2020-11-18
*/
public class ValidatorStorage {

private final Map<HasValue<?, ?>, Validator<?>> validators = new HashMap<>();

public <V, C extends HasValue<?, V>> void registerValidator(C instance, Validator<V> validator) {
this.validators.put(instance, validator);
}

public <V, C extends HasValue<?, V>> Consumer<Validator<V>> registerValidator(final C instance) {
return validator -> this.validators.put(instance, validator);
}

public boolean isValidatorPresent(HasValue<?, ?> component) {
return this.validators.containsKey(component);
}

@SuppressWarnings("unchecked")
public <V, C extends HasValue<?, V>> Validator<V> getValidator(C instance) {
if(this.isValidatorPresent(instance))
return (Validator<V>)this.validators.get(instance);
else return null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.vaadin.miki.demo.builders;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.checkbox.Checkbox;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.textfield.TextFieldVariant;
import org.vaadin.miki.demo.ContentBuilder;
import org.vaadin.miki.demo.Order;
import org.vaadin.miki.superfields.numbers.AbstractSuperNumberField;

import java.util.function.Consumer;

/**
* Builds content for {@link AbstractSuperNumberField}.
* @author miki
* @since 2020-11-19
*/
@Order(30)
@SuppressWarnings("squid:S5411") // no way around boxed values
public class AbstractSuperNumberFieldBuilder implements ContentBuilder<AbstractSuperNumberField<?, ?>> {

@Override
public void buildContent(AbstractSuperNumberField<?, ?> component, Consumer<Component[]> callback) {
final Checkbox autoselect = new Checkbox("Select automatically on focus?");
autoselect.addValueChangeListener(event -> component.setAutoselect(event.getValue()));

final Checkbox separatorHidden = new Checkbox("Hide grouping separator on focus?");
separatorHidden.addValueChangeListener(event -> component.setGroupingSeparatorHiddenOnFocus(event.getValue()));

final Checkbox prefix = new Checkbox("Show prefix component?");
prefix.addValueChangeListener(event -> component.setPrefixComponent(
event.getValue() ? new Span(">") : null
));

final Checkbox suffix = new Checkbox("Show suffix component?");
suffix.addValueChangeListener(event -> component.setSuffixComponent(
event.getValue() ? new Span("€") : null
));

final Checkbox alignRight = new Checkbox("Align text to the right?");
alignRight.addValueChangeListener(event -> {
if(event.getValue())
component.addThemeVariants(TextFieldVariant.LUMO_ALIGN_RIGHT);
else
component.removeThemeVariants(TextFieldVariant.LUMO_ALIGN_RIGHT);
}
);
callback.accept(new Component[]{autoselect, separatorHidden, prefix, suffix, alignRight});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.vaadin.miki.demo.builders;

import com.vaadin.flow.component.BlurNotifier;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.notification.Notification;
import org.vaadin.miki.demo.ContentBuilder;
import org.vaadin.miki.demo.Order;

import java.util.function.Consumer;

/**
* Builds content for {@link BlurNotifier}.
* @author miki
* @since 2020-11-19
*/
@Order(130)
public class BlurNotifierBuilder implements ContentBuilder<BlurNotifier<?>> {

@Override
public void buildContent(BlurNotifier<?> component, Consumer<Component[]> callback) {
component.addBlurListener(event ->
Notification.show(String.format(NotificationConstants.BLUR_MESSAGE, component.getClass().getSimpleName()), NotificationConstants.NOTIFICATION_TIME, Notification.Position.BOTTOM_END)
);
callback.accept(new Component[]{new Span("Leave the demo component to see a notification.")});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package org.vaadin.miki.demo.builders;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.checkbox.Checkbox;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.icon.Icon;
import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.orderedlayout.FlexComponent;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import org.vaadin.miki.demo.ContentBuilder;
import org.vaadin.miki.demo.Order;
import org.vaadin.miki.events.text.TextSelectionNotifier;
import org.vaadin.miki.markers.CanReceiveSelectionEventsFromClient;
import org.vaadin.miki.markers.CanSelectText;

import java.util.function.Consumer;

/**
* Builds content for {@link CanSelectText}.
* @author miki
* @since 2020-11-18
*/
@Order(10)
public class CanSelectTextBuilder implements ContentBuilder<CanSelectText> {

@Override
public void buildContent(CanSelectText component, Consumer<Component[]> callback) {
final Button selectAll = new Button("Select all", event -> component.selectAll());
final Button selectNone = new Button("Select none", event -> component.selectNone());
final HorizontalLayout layout = new HorizontalLayout(new Span("Type something in the field, then click one of the buttons:"), selectAll, selectNone);
layout.setAlignItems(FlexComponent.Alignment.CENTER);
callback.accept(new Component[]{
layout
});
if(component instanceof CanReceiveSelectionEventsFromClient) {
final Checkbox receiveFromClient = new Checkbox("Allow selection events initiated by keyboard or mouse?",
event -> ((CanReceiveSelectionEventsFromClient) component).setReceivingSelectionEventsFromClient(event.getValue()));
callback.accept(new Component[] {receiveFromClient});
}
if(component instanceof TextSelectionNotifier<?>) {
final Span selection = new Span();
((TextSelectionNotifier<?>) component).addTextSelectionListener(event -> selection.setText(event.getSelectedText()));
Icon icon = VaadinIcon.INFO_CIRCLE.create();
icon.setColor("green");
icon.getElement().setAttribute("title", "When the component does not receive events from the browser, selection events will only be called for server-side initiated actions.");
callback.accept(new Component[]{
new HorizontalLayout(new Span("Most recently selected text: <"), selection, new Span(">"), icon)
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.vaadin.miki.demo.builders;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.notification.Notification;
import org.vaadin.miki.demo.ContentBuilder;
import org.vaadin.miki.demo.Order;
import org.vaadin.miki.superfields.lazyload.ComponentObserver;

import java.util.function.Consumer;

/**
* Builds content for {@link ComponentObserver}.
* @author miki
* @since 2020-11-19
*/
@Order(100)
public class ComponentObserverBuilder implements ContentBuilder<ComponentObserver> {

@Override
public void buildContent(ComponentObserver component, Consumer<Component[]> callback) {
for(String s: new String[]{"span-one", "span-two", "span-three"}) {
Span span = new Span("This text is observed by the intersection observer. Resize the window to make it disappear and see what happens. It has id of "+s+". ");
span.setId(s);
component.observe(span);
callback.accept(new Component[]{span});
}
component.addComponentObservationListener(event -> {
if(event.isFullyVisible()) {
Notification.show("Component with id " + event.getObservedComponent().getId().orElse("(no id)") + " is now fully visible.");
if(event.getObservedComponent().getId().orElse("").equals("span-two")) {
event.getSource().unobserve(event.getObservedComponent());
Notification.show("Component with id span-two has been unobserved.");
}
}
else if(event.isNotVisible())
Notification.show("Component with id "+event.getObservedComponent().getId().orElse("(no id)")+" is now not visible.");
});
}
}
Loading