forked from wimdeblauwe/htmx-spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dedicated annotations for HX-Trigger-After-Settle and HX-Trigger-…
…After-Swap and support multiple events
- Loading branch information
Showing
8 changed files
with
184 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...g-boot/src/main/java/io/github/wimdeblauwe/htmx/spring/boot/mvc/HxTriggerAfterSettle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.github.wimdeblauwe.htmx.spring.boot.mvc; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Annotation to trigger client side events after the | ||
* <a href="https://htmx.org/docs/#request-operations">settling step</a> | ||
* on the target element. | ||
* <br> | ||
* You can trigger a single event or as many uniquely named events as you would like. | ||
* | ||
* @see <a href="https://htmx.org/headers/hx-trigger/">HX-Trigger Response Headers</a> | ||
*/ | ||
@Target({ElementType.TYPE, ElementType.METHOD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface HxTriggerAfterSettle { | ||
|
||
/** | ||
* The events to trigger after the | ||
* <a href="https://htmx.org/docs/#request-operations">settling step</a> | ||
* on the target element. | ||
*/ | ||
String[] value(); | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...ing-boot/src/main/java/io/github/wimdeblauwe/htmx/spring/boot/mvc/HxTriggerAfterSwap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.github.wimdeblauwe.htmx.spring.boot.mvc; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Annotation to trigger client side events after the | ||
* <a href="https://htmx.org/docs/#request-operations">swap step</a> | ||
* on the target element. | ||
* <br> | ||
* You can trigger a single event or as many uniquely named events as you would like. | ||
* | ||
* @see <a href="https://htmx.org/headers/hx-trigger/">HX-Trigger Response Headers</a> | ||
*/ | ||
@Target({ElementType.TYPE, ElementType.METHOD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface HxTriggerAfterSwap { | ||
|
||
/** | ||
* The events to trigger after the | ||
* <a href="https://htmx.org/docs/#request-operations">swap step</a> | ||
* on the target element. | ||
*/ | ||
String[] value(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters