Skip to content

Commit

Permalink
Merge pull request #285 from xdev-software/develop
Browse files Browse the repository at this point in the history
Release 4.0.1
  • Loading branch information
AB-xdev authored Oct 13, 2023
2 parents 76d0b90 + 602e27f commit 3443209
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
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

0 comments on commit 3443209

Please sign in to comment.