-
Notifications
You must be signed in to change notification settings - Fork 76
feat: create Slider component #8485
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
base: main
Are you sure you want to change the base?
Conversation
Add Slider Flow component wrapping <vaadin-slider> web component. The Slider extends AbstractSinglePropertyField and provides min, max, step, and value properties. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
db3a5dd to
2282aaf
Compare
- Remove explicit flow dependency versions from integration-tests pom.xml - Add README.md and LICENSE files - Add vite.config.ts for integration tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests for constructors, min/max/step properties, and validation that throws IllegalArgumentException for invalid values. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
e903825 to
c00aa07
Compare
…ider - Add ExperimentalFeatureException thrown when feature flag is disabled - Add feature flag check in Slider.onAttach - Add getMin, getMax, getStep methods to SliderElement - Add basic integration test verifying slider properties Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ce3a04e to
35b5b9d
Compare
…rties - Create SliderBase<TComponent, TValue> abstract class extending AbstractSinglePropertyField - Move min, max, step getters/setters with validation to SliderBase - Update Slider to extend SliderBase<Slider, Double> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move min, max, step tests to SliderBaseTest. Add tests for SliderBase constructors and value change listener constructors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| @Tag("vaadin-slider") | ||
| // @NpmPackage(value = "@vaadin/slider", version = "25.1.0-alpha1") | ||
| // @JsModule("@vaadin/slider/src/vaadin-slider.js") | ||
| public class Slider extends SliderBase<Slider, Double> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking out load: I'm wondering if it's better for java developer to either use
Slider<T extends Number> or IntSlider / DoubleSlider.
Having to deal with double all the time when I just have a simple 0-5 slider feels awkward. (Same could be said for min/max and step.. might be good to add overloaded methods?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid point, thank you. We could add an IntegerSlider later
Add a utility method to schedule actions that run before the client response, with deduplication by key. This allows deferring state validity checks until all property changes are complete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Log warnings when setMin, setMax, or setStep is called and the current value becomes inconsistent with the new constraints. The warnings are deferred using beforeClientResponse to check the final state after all property changes in the current request are complete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests verifying that warnings are logged when value doesn't align with min, max, or step constraints after property changes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change SliderBase constructor from protected to package-private. Update SliderTest to use the 4-parameter constructor with step value. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add constructors that use default step value of 1: - Slider(min, max, value) - Slider(min, max, value, listener) - Slider(label, min, max, value) - Slider(label, min, max, value, listener) Add corresponding unit tests verifying step defaults to 1. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's register Mockito as an agent explicitly as is done here: #8478.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.
Update SliderBase to use SerializableBiFunction for value converters, allowing subclasses to access component state during conversion. Remove unused constructor and inline init method. Update Slider to validate values during conversion and throw exceptions for invalid min/max/step changes. Remove SliderWarningsTest as warnings are replaced with exceptions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests for IllegalArgumentException scenarios: - setValue with value not aligned to step - setValue with null value (NullPointerException) - setMin greater than current value - setMax less than current value - setStep with negative value - setStep when current value is not aligned Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…n Slider Remove setMin, setMax, setStep methods from Slider and add setValue overloads that update min, max, step, and value atomically. This avoids validation errors when changing multiple properties that depend on each other. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace setStep() call with constructor that accepts step parameter, as setStep is no longer public. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|



Description
Constructors:
Slider()Slider(listener)Slider(min, max, value)Slider(min, max, value, listener)Slider(min, max, step, value)Slider(min, max, step, value, listener)Slider(label)Slider(label, listener)Slider(label, min, max, value)Slider(label, min, max, value, listener)Slider(label, min, max, step, value)Slider(label, min, max, step, value, listener)Methods:
setValue(value)setValue(min, max, value)setValue(min, max, step, value)getMin()getMax()getStep()Fixes #8480
Type of change