-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into update-from-template-merged
- Loading branch information
Showing
38 changed files
with
2,537 additions
and
35 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
## 4.2.0 | ||
* Improved styling | ||
* Overlay now has the same minimum width as the underlying DateRangePicker | ||
* The default is ``20em``, this can be changed using ``--date-range-picker-min-width`` | ||
* Layouts inside the overlay now use the full available width | ||
* Removed excess top padding from input components | ||
* Refactored CSS class names (should cause less conflicts now) | ||
* Updated to Vaadin 24.5 | ||
|
||
## 4.1.1 | ||
* Only use client-side locale for formatting when no ``formatLocale`` has been set #353 | ||
|
||
## 4.1.0 | ||
* Updated to Vaadin 24.4 | ||
* Minor code improvements | ||
|
||
## 4.0.2 | ||
* ⚠️ GroupId changed from ``com.xdev-software`` to ``software.xdev`` | ||
* Updated dependencies | ||
|
||
## 4.0.1 | ||
* Various dependency updates including Vaadin 24.1 | ||
|
||
## 4.0.0 | ||
⚠️<i>This release contains breaking changes</i> | ||
|
||
* Adds support for Vaadin 24+, drops support for Vaadin 23<br/> | ||
<i>If you are still using Vaadin 23, use the ``3.x`` versions.</i> | ||
* Requires Java 17+ | ||
* Fixed Broken overlay detection on Vaadin 24 #224 | ||
* Added ``AllowRangeLimitExceeding``; default value is ``true`` | ||
* Updated dependencies | ||
|
||
## 3.0.3 | ||
* Renamed ``defaultModel`` to ``initialModel`` | ||
* Updated dependencies | ||
|
||
## 3.0.2 | ||
* Updated dependencies | ||
* Vaadin 23.3 | ||
|
||
## 3.0.1 | ||
* Updated dependencies | ||
* Vaadin 23.2 | ||
|
||
## 3.0.0 | ||
⚠️<i>This release contains breaking changes</i> | ||
|
||
* Adds support for Vaadin 23+, drops support for Vaadin 14 #155<br/> | ||
<i>If you are still using Vaadin 14, use the ``2.x`` versions.</i> | ||
* Requires Java 11+ | ||
* Updated dependencies |
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
File renamed without changes.
81 changes: 81 additions & 0 deletions
81
...-date-range-picker-demo/src/main/java/software/xdev/vaadin/daterange_picker/HomeView.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,81 @@ | ||
package software.xdev.vaadin.daterange_picker; | ||
|
||
import java.util.Arrays; | ||
|
||
import com.vaadin.flow.component.AttachEvent; | ||
import com.vaadin.flow.component.Composite; | ||
import com.vaadin.flow.component.grid.Grid; | ||
import com.vaadin.flow.component.grid.GridVariant; | ||
import com.vaadin.flow.component.html.Anchor; | ||
import com.vaadin.flow.component.html.Span; | ||
import com.vaadin.flow.component.orderedlayout.VerticalLayout; | ||
import com.vaadin.flow.data.renderer.ComponentRenderer; | ||
import com.vaadin.flow.router.PageTitle; | ||
import com.vaadin.flow.router.Route; | ||
|
||
import software.xdev.vaadin.daterange_picker.example.DateRangePickerCustomizedDemo; | ||
import software.xdev.vaadin.daterange_picker.example.DateRangePickerLocalizedDemo; | ||
import software.xdev.vaadin.daterange_picker.example.DateRangePickerParameterDemo; | ||
import software.xdev.vaadin.daterange_picker.example.DateRangePickerRangeExceedingDemo; | ||
import software.xdev.vaadin.daterange_picker.example.DateRangePickerStyledDemo; | ||
|
||
|
||
@PageTitle("DateRangePicker Examples") | ||
@Route("") | ||
public class HomeView extends Composite<VerticalLayout> | ||
{ | ||
private final Grid<Example> grExamples = new Grid<>(); | ||
|
||
public HomeView() | ||
{ | ||
this.grExamples | ||
.addColumn(new ComponentRenderer<>(example -> { | ||
final Anchor anchor = new Anchor(example.route(), example.name()); | ||
|
||
final Span spDesc = new Span(example.desc()); | ||
spDesc.getStyle().set("font-size", "90%"); | ||
|
||
final VerticalLayout vl = new VerticalLayout(anchor, spDesc); | ||
vl.setSpacing(false); | ||
return vl; | ||
})) | ||
.setHeader("Available demos"); | ||
|
||
this.grExamples.setSizeFull(); | ||
this.grExamples.addThemeVariants(GridVariant.LUMO_COMPACT, GridVariant.LUMO_NO_BORDER); | ||
|
||
this.getContent().add(this.grExamples); | ||
this.getContent().setHeightFull(); | ||
} | ||
|
||
@Override | ||
protected void onAttach(final AttachEvent attachEvent) | ||
{ | ||
this.grExamples.setItems(Arrays.asList( | ||
new Example( | ||
DateRangePickerStyledDemo.NAV, | ||
"Styled-Demo", | ||
"dark mode 🌑 and more"), | ||
new Example( | ||
DateRangePickerParameterDemo.NAV, | ||
"Parameter-Demo", | ||
"configuration is stored in QueryParameters"), | ||
new Example( | ||
DateRangePickerLocalizedDemo.NAV, | ||
"Localized-Demo", | ||
"🌐 simple localization"), | ||
new Example( | ||
DateRangePickerRangeExceedingDemo.NAV, | ||
"RangeExceeding-Demo", | ||
"usage of a range exceeding DateRange"), | ||
new Example( | ||
DateRangePickerCustomizedDemo.NAV, | ||
"Customized-Demo", | ||
"usage of a customized DateRange") | ||
)); | ||
} | ||
|
||
record Example(String route, String name, String desc) | ||
{ | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...src/main/java/software/xdev/vaadin/daterange_picker/example/AbstractSimpleChangeDemo.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,63 @@ | ||
package software.xdev.vaadin.daterange_picker.example; | ||
|
||
import java.time.LocalDate; | ||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
|
||
import com.vaadin.flow.component.Composite; | ||
import com.vaadin.flow.component.orderedlayout.VerticalLayout; | ||
import com.vaadin.flow.component.textfield.TextArea; | ||
|
||
import software.xdev.vaadin.daterange_picker.business.DateRangeModel; | ||
import software.xdev.vaadin.daterange_picker.business.SimpleDateRange; | ||
import software.xdev.vaadin.daterange_picker.business.SimpleDateRanges; | ||
import software.xdev.vaadin.daterange_picker.ui.DateRangePicker; | ||
|
||
|
||
public abstract class AbstractSimpleChangeDemo extends Composite<VerticalLayout> | ||
{ | ||
protected static final List<SimpleDateRange> DATERANGE_VALUES = Arrays.asList(SimpleDateRanges.allValues()); | ||
|
||
protected final DateRangePicker<SimpleDateRange> dateRangePicker = | ||
new DateRangePicker<>( | ||
() -> new DateRangeModel<>(LocalDate.now(), LocalDate.now(), SimpleDateRanges.TODAY), | ||
DATERANGE_VALUES); | ||
|
||
protected final TextArea taResult = | ||
new TextArea("ValueChangeEvent", "Change something in the date-picker to see the result"); | ||
|
||
protected void registerDefaultValueChangeListener() | ||
{ | ||
this.dateRangePicker.addValueChangeListener(ev -> | ||
{ | ||
final DateRangeModel<SimpleDateRange> modell = ev.getValue(); | ||
|
||
this.taResult.clear(); | ||
|
||
final Map<String, String> results = new HashMap<>(Map.of( | ||
"DateRange", modell.getDateRange().getKey(), | ||
"Start", modell.getStart().toString(), | ||
"End", modell.getEnd().toString(), | ||
"IsFromClient", String.valueOf(ev.isFromClient()) | ||
)); | ||
if(ev.getOldValue() != null) | ||
{ | ||
results.putAll(Map.of( | ||
"OldValue-DateRange", ev.getOldValue().getDateRange().getKey(), | ||
"OldValue-Start", ev.getOldValue().getStart().toString(), | ||
"OldValue-End", ev.getOldValue().getEnd().toString())); | ||
} | ||
else | ||
{ | ||
results.put("OldValue", "null"); | ||
} | ||
this.taResult.setValue(results.entrySet() | ||
.stream() | ||
.map(e -> e.getKey() + ": " + e.getValue()) | ||
.collect(Collectors.joining("\r\n"))); | ||
}); | ||
} | ||
} |
Oops, something went wrong.