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 4.0.1 #285

Merged
merged 10 commits into from
Oct 13, 2023
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.0.1
* Added shortcut method ``invokeSelfReturn`` #282
* Updated dependencies

## 4.0.0
⚠️<i>This release contains breaking changes</i>

Expand Down
2 changes: 1 addition & 1 deletion vaadin-maps-leaflet-flow-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<mainClass>software.xdev.vaadin.Application</mainClass>

<!-- Dependency-Versions -->
<vaadin.version>24.1.11</vaadin.version>
<vaadin.version>24.1.12</vaadin.version>

<org.springframework.boot.version>3.1.4</org.springframework.boot.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.vaadin.flow.component.dialog.Dialog;
import com.vaadin.flow.component.icon.Icon;
import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.router.Route;

Expand Down Expand Up @@ -184,6 +185,7 @@ public ComplexDemo()
this.addImageOverlayDemo();
this.addVideoOverlayDemo();
this.addComplexPolygonDemo();
this.addRetrieveClientSideDataDemo();

this.addOpenDialogOverMapDemo();
}
Expand Down Expand Up @@ -363,6 +365,17 @@ private void addComplexPolygonDemo()
));
}

private void addRetrieveClientSideDataDemo()
{
// Note: Usage is not recommended as clientside data can be manipulated
this.hlButtons.add(
new Button(
"Get bounds",
ev -> this.map.invokeSelfReturn(".getBounds()")
.then(v -> Notification.show(v.toJson())))
);
}

private void addOpenDialogOverMapDemo()
{
this.hlButtons.add(
Expand Down
4 changes: 2 additions & 2 deletions vaadin-maps-leaflet-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- Dependency-Versions -->
<vaadin.version>24.1.11</vaadin.version>
<vaadin.version>24.1.12</vaadin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -108,7 +108,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
<version>2.15.3</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ default PendingJavaScriptResult invokeSelf(final String payload, final Serializa
return this.componentRegistry().execJs(this.clientComponentJsAccessor() + payload, params);
}

/**
* @apiNote Usage is not recommended as clientside data can be manipulated
*/
default PendingJavaScriptResult invokeSelfReturn(final String payload, final Serializable... params)
{
return this.componentRegistry().execJs("return " + this.clientComponentJsAccessor() + payload, params);
}

@SuppressWarnings("unchecked")
default S self()
{
Expand Down