Skip to content

Commit 21adff6

Browse files
committed
Merge branch 'release/2.1.0'
2 parents aa0649f + aac7ea2 commit 21adff6

File tree

287 files changed

+16496
-4141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+16496
-4141
lines changed

domino-ui-shared/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>domino-ui-parent</artifactId>
77
<groupId>org.dominokit</groupId>
8-
<version>2.0.5</version>
8+
<version>2.1.0</version>
99
</parent>
1010
<packaging>jar</packaging>
1111
<modelVersion>4.0.0</modelVersion>

domino-ui-shared/src/main/java/org/dominokit/domino/ui/mediaquery/MediaQuery.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ public interface MediaQueryListener {
499499
/** on match the query */
500500
void onMatch();
501501
}
502+
502503
/** A listener that will be called when media query matches */
503504
@FunctionalInterface
504505
public interface MediaQueryListenerRecord {

domino-ui-shared/src/main/java/org/dominokit/domino/ui/style/BooleanCssClass.java

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.dominokit.domino.ui.style;
1818

1919
import elemental2.dom.Element;
20+
import java.util.function.Supplier;
2021
import org.dominokit.domino.ui.IsElement;
2122

2223
/**
@@ -30,7 +31,7 @@
3031
public class BooleanCssClass implements CssClass {
3132

3233
private CssClass cssClass;
33-
private boolean addRemove;
34+
private Supplier<Boolean> addRemove;
3435

3536
/**
3637
* Creates an instance with a specified {@link CssClass} and a condition flag.
@@ -44,6 +45,18 @@ public static BooleanCssClass of(CssClass cssClass, boolean addRemove) {
4445
return new BooleanCssClass(cssClass, addRemove);
4546
}
4647

48+
/**
49+
* Creates an instance with a specified {@link CssClass} and a condition flag.
50+
*
51+
* @param cssClass The CSS class to be conditionally applied or removed.
52+
* @param addRemove Condition flag to determine if the class should be applied (true) or removed
53+
* (false).
54+
* @return A new instance of {@code BooleanCssClass}.
55+
*/
56+
public static BooleanCssClass of(CssClass cssClass, Supplier<Boolean> addRemove) {
57+
return new BooleanCssClass(cssClass, addRemove);
58+
}
59+
4760
/**
4861
* Creates an instance with a specified {@link HasCssClass} and a condition flag. This method
4962
* extracts the {@link CssClass} from the provided {@link HasCssClass}.
@@ -57,6 +70,19 @@ public static BooleanCssClass of(HasCssClass cssClass, boolean addRemove) {
5770
return new BooleanCssClass(cssClass.getCssClass(), addRemove);
5871
}
5972

73+
/**
74+
* Creates an instance with a specified {@link HasCssClass} and a condition flag. This method
75+
* extracts the {@link CssClass} from the provided {@link HasCssClass}.
76+
*
77+
* @param cssClass The object implementing {@link HasCssClass} whose CSS class will be extracted.
78+
* @param addRemove Condition flag to determine if the class should be applied (true) or removed
79+
* (false).
80+
* @return A new instance of {@code BooleanCssClass}.
81+
*/
82+
public static BooleanCssClass of(HasCssClass cssClass, Supplier<Boolean> addRemove) {
83+
return new BooleanCssClass(cssClass.getCssClass(), addRemove);
84+
}
85+
6086
/**
6187
* Creates an instance with a specified CSS class string and a condition flag.
6288
*
@@ -70,6 +96,19 @@ public static BooleanCssClass of(String cssClass, boolean addRemove) {
7096
return new BooleanCssClass(() -> cssClass, addRemove);
7197
}
7298

99+
/**
100+
* Creates an instance with a specified CSS class string and a condition flag.
101+
*
102+
* @param cssClass The string representation of the CSS class to be conditionally applied or
103+
* removed.
104+
* @param addRemove Condition flag to determine if the class should be applied (true) or removed
105+
* (false).
106+
* @return A new instance of {@code BooleanCssClass}.
107+
*/
108+
public static BooleanCssClass of(String cssClass, Supplier<Boolean> addRemove) {
109+
return new BooleanCssClass(() -> cssClass, addRemove);
110+
}
111+
73112
/**
74113
* Creates an instance with a specified {@link CssClass} and sets the condition flag to true
75114
* (class will be applied by default).
@@ -112,6 +151,17 @@ public static BooleanCssClass of(String cssClass) {
112151
* (false).
113152
*/
114153
public BooleanCssClass(CssClass cssClass, boolean addRemove) {
154+
this(cssClass, () -> addRemove);
155+
}
156+
157+
/**
158+
* Initializes the {@code BooleanCssClass} with a provided {@link CssClass} and a condition flag.
159+
*
160+
* @param cssClass The CSS class to be managed.
161+
* @param addRemove Condition flag to determine if the class should be applied (true) or removed
162+
* (false).
163+
*/
164+
public BooleanCssClass(CssClass cssClass, Supplier<Boolean> addRemove) {
115165
this.cssClass = cssClass;
116166
this.addRemove = addRemove;
117167
}
@@ -133,7 +183,7 @@ public BooleanCssClass(CssClass cssClass) {
133183
*/
134184
@Override
135185
public void apply(Element element) {
136-
apply(element, addRemove);
186+
apply(element, addRemove.get());
137187
}
138188

139189
/**

0 commit comments

Comments
 (0)