Skip to content

Commit be1667b

Browse files
committed
Merge branch 'develop' into update-from-template-merged
2 parents 56c50bc + b294ba2 commit be1667b

38 files changed

+2537
-35
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ body:
1515
attributes:
1616
label: "Checklist"
1717
options:
18-
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
18+
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/vaadin-date-range-picker/releases/latest)"
1919
required: true
20-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
20+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/vaadin-date-range-picker/issues) or [closed](https://github.com/xdev-software/vaadin-date-range-picker/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
2121
required: true
2222
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
2323
required: true

.github/ISSUE_TEMPLATE/enhancement.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
attributes:
1414
label: "Checklist"
1515
options:
16-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
16+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/vaadin-date-range-picker/issues) or [closed](https://github.com/xdev-software/vaadin-date-range-picker/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1717
required: true
1818
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
1919
required: true

.github/ISSUE_TEMPLATE/question.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ body:
1212
attributes:
1313
label: "Checklist"
1414
options:
15-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
15+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/vaadin-date-range-picker/issues) or [closed](https://github.com/xdev-software/vaadin-date-range-picker/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1616
required: true
1717
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
1818
required: true

.run/Run Demo.run.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
33
<option name="MAIN_CLASS_NAME" value="software.xdev.vaadin.Application" />
4-
<module name="template-placeholder-demo" />
4+
<module name="vaadin-date-range-picker-demo" />
55
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
66
<extension name="coverage">
77
<pattern>

CHANGELOG.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## 4.2.0
2+
* Improved styling
3+
* Overlay now has the same minimum width as the underlying DateRangePicker
4+
* The default is ``20em``, this can be changed using ``--date-range-picker-min-width``
5+
* Layouts inside the overlay now use the full available width
6+
* Removed excess top padding from input components
7+
* Refactored CSS class names (should cause less conflicts now)
8+
* Updated to Vaadin 24.5
9+
10+
## 4.1.1
11+
* Only use client-side locale for formatting when no ``formatLocale`` has been set #353
12+
13+
## 4.1.0
14+
* Updated to Vaadin 24.4
15+
* Minor code improvements
16+
17+
## 4.0.2
18+
* ⚠️ GroupId changed from ``com.xdev-software`` to ``software.xdev``
19+
* Updated dependencies
20+
21+
## 4.0.1
22+
* Various dependency updates including Vaadin 24.1
23+
24+
## 4.0.0
25+
⚠️<i>This release contains breaking changes</i>
26+
27+
* Adds support for Vaadin 24+, drops support for Vaadin 23<br/>
28+
<i>If you are still using Vaadin 23, use the ``3.x`` versions.</i>
29+
* Requires Java 17+
30+
* Fixed Broken overlay detection on Vaadin 24 #224
31+
* Added ``AllowRangeLimitExceeding``; default value is ``true``
32+
* Updated dependencies
33+
34+
## 3.0.3
35+
* Renamed ``defaultModel`` to ``initialModel``
36+
* Updated dependencies
37+
38+
## 3.0.2
39+
* Updated dependencies
40+
* Vaadin 23.3
41+
42+
## 3.0.1
43+
* Updated dependencies
44+
* Vaadin 23.2
45+
46+
## 3.0.0
47+
⚠️<i>This release contains breaking changes</i>
48+
49+
* Adds support for Vaadin 23+, drops support for Vaadin 14 #155<br/>
50+
<i>If you are still using Vaadin 14, use the ``2.x`` versions.</i>
51+
* Requires Java 11+
52+
* Updated dependencies

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ Bigger changes may require a complete restart.
4747
* [Vaadin automatically reloads the UI on each restart](https://vaadin.com/docs/latest/configuration/live-reload/spring-boot).<br/>
4848
You can control this behavior with the ``vaadin.devmode.liveReload.enabled`` property (default: ``true``).
4949

50-
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
50+
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/vaadin-date-range-picker/release.yml?branch=master)](https://github.com/xdev-software/vaadin-date-range-picker/actions/workflows/release.yml)
5151

5252
Before releasing:
53-
* Consider doing a [test-deployment](https://github.com/xdev-software/template-placeholder/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
53+
* Consider doing a [test-deployment](https://github.com/xdev-software/vaadin-date-range-picker/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
5454
* Check the [changelog](CHANGELOG.md)
5555

5656
If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes

README.md

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/template-placeholder)
2-
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
3-
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
4-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
1+
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/daterangepicker-for-vaadin)
2+
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/vaadin-date-range-picker?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/vaadin-date-range-picker)
3+
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/vaadin-date-range-picker/check-build.yml?branch=develop)](https://github.com/xdev-software/vaadin-date-range-picker/actions/workflows/check-build.yml?query=branch%3Adevelop)
4+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_vaadin-date-range-picker&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_vaadin-date-range-picker)
55
![Vaadin 24+](https://img.shields.io/badge/Vaadin%20Platform/Flow-24+-00b4f0)
66

7-
# template-placeholder
8-
A Vaadin Template Repo
7+
# vaadin-date-range-picker
8+
A Vaadin Flow DateRangePicker implementation
99

1010
![demo](assets/demo.png)
1111

1212

1313
## Installation
14-
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
14+
[Installation guide for the latest release](https://github.com/xdev-software/vaadin-date-range-picker/releases/latest#Installation)
15+
16+
#### Compatibility with Vaadin
17+
18+
| Vaadin version | DateRangePicker version |
19+
| --- | --- |
20+
| Vaadin 24+ (latest) | ``4+`` |
21+
| Vaadin 23 | ``3.x`` |
22+
| Vaadin 14 | ``2.x`` |
1523

1624
## Run the Demo
1725
* Checkout the repo
18-
* Run ``mvn install && mvn -f template-placeholder-demo spring-boot:run``
26+
* Run ``mvn install && mvn -f vaadin-date-range-picker-demo spring-boot:run``
1927
* Open http://localhost:8080
2028

2129
<details>
@@ -31,4 +39,4 @@ If you need support as soon as possible and you can't wait for any pull request,
3139
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.
3240

3341
## Dependencies and Licenses
34-
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/template-placeholder/dependencies)
42+
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/vaadin-date-range-picker/dependencies)

SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
## Reporting a Vulnerability
44

5-
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
5+
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/vaadin-date-range-picker/security/advisories/new).

assets/demo.avif

147 KB
Binary file not shown.

assets/demo.png

-8.72 KB
Loading

pom.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>software.xdev</groupId>
8-
<artifactId>template-placeholder-root</artifactId>
9-
<version>1.0.0-SNAPSHOT</version>
8+
<artifactId>vaadin-date-range-picker-root</artifactId>
9+
<version>4.2.1-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

1212
<organization>
@@ -15,8 +15,8 @@
1515
</organization>
1616

1717
<modules>
18-
<module>template-placeholder</module>
19-
<module>template-placeholder-demo</module>
18+
<module>vaadin-date-range-picker</module>
19+
<module>vaadin-date-range-picker-demo</module>
2020
</modules>
2121

2222
<properties>

renovate.json5

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"packageRules": [
55
{
66
"description": "Ignore project internal dependencies",
7-
"packagePattern": "^software.xdev:template-placeholder",
7+
"packagePattern": "^software.xdev:vaadin-date-range-picker",
88
"datasources": [
99
"maven"
1010
],

template-placeholder-demo/pom.xml vaadin-date-range-picker-demo/pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
<parent>
88
<groupId>software.xdev</groupId>
9-
<artifactId>template-placeholder-root</artifactId>
10-
<version>1.0.0-SNAPSHOT</version>
9+
<artifactId>vaadin-date-range-picker-root</artifactId>
10+
<version>4.2.1-SNAPSHOT</version>
1111
</parent>
1212

13-
<artifactId>template-placeholder-demo</artifactId>
14-
<version>1.0.0-SNAPSHOT</version>
13+
<artifactId>vaadin-date-range-picker-demo</artifactId>
14+
<version>4.2.1-SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616

1717
<organization>
@@ -70,7 +70,7 @@
7070
</dependency>
7171
<dependency>
7272
<groupId>software.xdev</groupId>
73-
<artifactId>template-placeholder</artifactId>
73+
<artifactId>vaadin-date-range-picker</artifactId>
7474
<version>${project.version}</version>
7575
</dependency>
7676

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package software.xdev.vaadin.daterange_picker;
2+
3+
import java.util.Arrays;
4+
5+
import com.vaadin.flow.component.AttachEvent;
6+
import com.vaadin.flow.component.Composite;
7+
import com.vaadin.flow.component.grid.Grid;
8+
import com.vaadin.flow.component.grid.GridVariant;
9+
import com.vaadin.flow.component.html.Anchor;
10+
import com.vaadin.flow.component.html.Span;
11+
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
12+
import com.vaadin.flow.data.renderer.ComponentRenderer;
13+
import com.vaadin.flow.router.PageTitle;
14+
import com.vaadin.flow.router.Route;
15+
16+
import software.xdev.vaadin.daterange_picker.example.DateRangePickerCustomizedDemo;
17+
import software.xdev.vaadin.daterange_picker.example.DateRangePickerLocalizedDemo;
18+
import software.xdev.vaadin.daterange_picker.example.DateRangePickerParameterDemo;
19+
import software.xdev.vaadin.daterange_picker.example.DateRangePickerRangeExceedingDemo;
20+
import software.xdev.vaadin.daterange_picker.example.DateRangePickerStyledDemo;
21+
22+
23+
@PageTitle("DateRangePicker Examples")
24+
@Route("")
25+
public class HomeView extends Composite<VerticalLayout>
26+
{
27+
private final Grid<Example> grExamples = new Grid<>();
28+
29+
public HomeView()
30+
{
31+
this.grExamples
32+
.addColumn(new ComponentRenderer<>(example -> {
33+
final Anchor anchor = new Anchor(example.route(), example.name());
34+
35+
final Span spDesc = new Span(example.desc());
36+
spDesc.getStyle().set("font-size", "90%");
37+
38+
final VerticalLayout vl = new VerticalLayout(anchor, spDesc);
39+
vl.setSpacing(false);
40+
return vl;
41+
}))
42+
.setHeader("Available demos");
43+
44+
this.grExamples.setSizeFull();
45+
this.grExamples.addThemeVariants(GridVariant.LUMO_COMPACT, GridVariant.LUMO_NO_BORDER);
46+
47+
this.getContent().add(this.grExamples);
48+
this.getContent().setHeightFull();
49+
}
50+
51+
@Override
52+
protected void onAttach(final AttachEvent attachEvent)
53+
{
54+
this.grExamples.setItems(Arrays.asList(
55+
new Example(
56+
DateRangePickerStyledDemo.NAV,
57+
"Styled-Demo",
58+
"dark mode 🌑 and more"),
59+
new Example(
60+
DateRangePickerParameterDemo.NAV,
61+
"Parameter-Demo",
62+
"configuration is stored in QueryParameters"),
63+
new Example(
64+
DateRangePickerLocalizedDemo.NAV,
65+
"Localized-Demo",
66+
"🌐 simple localization"),
67+
new Example(
68+
DateRangePickerRangeExceedingDemo.NAV,
69+
"RangeExceeding-Demo",
70+
"usage of a range exceeding DateRange"),
71+
new Example(
72+
DateRangePickerCustomizedDemo.NAV,
73+
"Customized-Demo",
74+
"usage of a customized DateRange")
75+
));
76+
}
77+
78+
record Example(String route, String name, String desc)
79+
{
80+
}
81+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package software.xdev.vaadin.daterange_picker.example;
2+
3+
import java.time.LocalDate;
4+
import java.util.Arrays;
5+
import java.util.HashMap;
6+
import java.util.List;
7+
import java.util.Map;
8+
import java.util.stream.Collectors;
9+
10+
import com.vaadin.flow.component.Composite;
11+
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
12+
import com.vaadin.flow.component.textfield.TextArea;
13+
14+
import software.xdev.vaadin.daterange_picker.business.DateRangeModel;
15+
import software.xdev.vaadin.daterange_picker.business.SimpleDateRange;
16+
import software.xdev.vaadin.daterange_picker.business.SimpleDateRanges;
17+
import software.xdev.vaadin.daterange_picker.ui.DateRangePicker;
18+
19+
20+
public abstract class AbstractSimpleChangeDemo extends Composite<VerticalLayout>
21+
{
22+
protected static final List<SimpleDateRange> DATERANGE_VALUES = Arrays.asList(SimpleDateRanges.allValues());
23+
24+
protected final DateRangePicker<SimpleDateRange> dateRangePicker =
25+
new DateRangePicker<>(
26+
() -> new DateRangeModel<>(LocalDate.now(), LocalDate.now(), SimpleDateRanges.TODAY),
27+
DATERANGE_VALUES);
28+
29+
protected final TextArea taResult =
30+
new TextArea("ValueChangeEvent", "Change something in the date-picker to see the result");
31+
32+
protected void registerDefaultValueChangeListener()
33+
{
34+
this.dateRangePicker.addValueChangeListener(ev ->
35+
{
36+
final DateRangeModel<SimpleDateRange> modell = ev.getValue();
37+
38+
this.taResult.clear();
39+
40+
final Map<String, String> results = new HashMap<>(Map.of(
41+
"DateRange", modell.getDateRange().getKey(),
42+
"Start", modell.getStart().toString(),
43+
"End", modell.getEnd().toString(),
44+
"IsFromClient", String.valueOf(ev.isFromClient())
45+
));
46+
if(ev.getOldValue() != null)
47+
{
48+
results.putAll(Map.of(
49+
"OldValue-DateRange", ev.getOldValue().getDateRange().getKey(),
50+
"OldValue-Start", ev.getOldValue().getStart().toString(),
51+
"OldValue-End", ev.getOldValue().getEnd().toString()));
52+
}
53+
else
54+
{
55+
results.put("OldValue", "null");
56+
}
57+
this.taResult.setValue(results.entrySet()
58+
.stream()
59+
.map(e -> e.getKey() + ": " + e.getValue())
60+
.collect(Collectors.joining("\r\n")));
61+
});
62+
}
63+
}

0 commit comments

Comments
 (0)