Skip to content

Commit

Permalink
Merge branch 'development' into 533-update-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vaadin-miki authored Dec 17, 2024
2 parents 8e9d425 + 6b3ad98 commit acf58db
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@

/**
* Supports content for {@link SuperBigDecimalField}.
*
* @author miki
* @since 2021-01-15
*/
@Order(25)
public class SuperBigDecimalFieldBuilder implements ContentBuilder<SuperBigDecimalField> {

@Override
@SuppressWarnings("squid:S5411") // no way around boxed value
public void buildContent(SuperBigDecimalField component, Consumer<Component[]> callback) {
final Checkbox allowScientificNotation = new Checkbox("Support scientific notation as input? (format: 1 + 3 e 2)?");
allowScientificNotation.addValueChangeListener(event -> {
if(event.getValue())
component.withMaximumExponentDigits(2)
.withMaximumSignificandFractionDigits(3)
.withMaximumSignificandIntegerDigits(1);
else
component.setMaximumExponentDigits(0);
});
callback.accept(new Component[]{allowScientificNotation});
}
@Override
@SuppressWarnings("squid:S5411") // no way around boxed value
public void buildContent(SuperBigDecimalField component, Consumer<Component[]> callback) {
final Checkbox allowScientificNotation = new Checkbox("Support scientific notation as input? (format: 1 + 3 e 2)?");
allowScientificNotation.addValueChangeListener(event -> {
if (event.getValue())
component.withMaximumExponentDigits(2)
.withMaximumSignificandFractionDigits(3)
.withMaximumSignificandIntegerDigits(1);
else
component.setMaximumExponentDigits(0);
});
callback.accept(new Component[]{allowScientificNotation});
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>24.5.0</vaadin.version>
<vaadin.version>24.5.8</vaadin.version>
</properties>

</project>
2 changes: 1 addition & 1 deletion superfields/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>24.5.0</vaadin.version>
<vaadin.version>24.5.8</vaadin.version>
<maven.jar.plugin.version>3.1.2</maven.jar.plugin.version>
<javadoc.plugin.version>3.4.1</javadoc.plugin.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.dependency.JsModule;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.dom.DisabledUpdateMode;
import com.vaadin.flow.shared.Registration;
import org.vaadin.miki.events.text.TextSelectionListener;
import org.vaadin.miki.events.text.TextSelectionNotifier;
Expand Down Expand Up @@ -117,7 +118,7 @@ private void selectionChanged(int start, int end, String selection) {
this.delegate.fireTextSelectionEvent(true, start, end, selection);
}

@ClientCallable
@ClientCallable(DisabledUpdateMode.ALWAYS) // fixes #531
private void performDelayedInitialisation() {
// fixes #243
this.delegate.reinitialiseListeners();
Expand Down

0 comments on commit acf58db

Please sign in to comment.