Skip to content

Commit

Permalink
Merge branch 'develop' into update-from-template-merged
Browse files Browse the repository at this point in the history
  • Loading branch information
xdev-gh-bot committed Sep 9, 2024
2 parents 9a88197 + 46ddd28 commit bd53a97
Show file tree
Hide file tree
Showing 38 changed files with 2,537 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ body:
attributes:
label: "Checklist"
options:
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/vaadin-date-range-picker/releases/latest)"
required: true
- 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."
- 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."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- 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."
- 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."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- 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."
- 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."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .run/Run Demo.run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="software.xdev.vaadin.Application" />
<module name="template-placeholder-demo" />
<module name="vaadin-date-range-picker-demo" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<extension name="coverage">
<pattern>
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## 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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Bigger changes may require a complete restart.
* [Vaadin automatically reloads the UI on each restart](https://vaadin.com/docs/latest/configuration/live-reload/spring-boot).<br/>
You can control this behavior with the ``vaadin.devmode.liveReload.enabled`` property (default: ``true``).

## 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)
## 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)

Before releasing:
* Consider doing a [test-deployment](https://github.com/xdev-software/template-placeholder/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* 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.
* Check the [changelog](CHANGELOG.md)

If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes
Expand Down
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/template-placeholder)
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
[![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)
[![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)
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/daterangepicker-for-vaadin)
[![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)
[![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)
[![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)
![Vaadin 24+](https://img.shields.io/badge/Vaadin%20Platform/Flow-24+-00b4f0)

# template-placeholder
A Vaadin Template Repo
# vaadin-date-range-picker
A Vaadin Flow DateRangePicker implementation

![demo](assets/demo.png)


## Installation
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
[Installation guide for the latest release](https://github.com/xdev-software/vaadin-date-range-picker/releases/latest#Installation)

#### Compatibility with Vaadin

| Vaadin version | DateRangePicker version |
| --- | --- |
| Vaadin 24+ (latest) | ``4+`` |
| Vaadin 23 | ``3.x`` |
| Vaadin 14 | ``2.x`` |

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

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

## Dependencies and Licenses
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/template-placeholder/dependencies)
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/vaadin-date-range-picker/dependencies)
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/vaadin-date-range-picker/security/advisories/new).
Binary file modified assets/demo.avif
Binary file not shown.
Binary file modified assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>software.xdev</groupId>
<artifactId>template-placeholder-root</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>vaadin-date-range-picker-root</artifactId>
<version>4.1.2-SNAPSHOT</version>
<packaging>pom</packaging>

<organization>
Expand All @@ -15,8 +15,8 @@
</organization>

<modules>
<module>template-placeholder</module>
<module>template-placeholder-demo</module>
<module>vaadin-date-range-picker</module>
<module>vaadin-date-range-picker-demo</module>
</modules>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"packageRules": [
{
"description": "Ignore project internal dependencies",
"packagePattern": "^software.xdev:template-placeholder",
"packagePattern": "^software.xdev:vaadin-date-range-picker",
"datasources": [
"maven"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<parent>
<groupId>software.xdev</groupId>
<artifactId>template-placeholder-root</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>vaadin-date-range-picker-root</artifactId>
<version>4.1.2-SNAPSHOT</version>
</parent>

<artifactId>template-placeholder-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>vaadin-date-range-picker-demo</artifactId>
<version>4.1.2-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand Down Expand Up @@ -64,7 +64,7 @@
</dependency>
<dependency>
<groupId>software.xdev</groupId>
<artifactId>template-placeholder</artifactId>
<artifactId>vaadin-date-range-picker</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
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)
{
}
}
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")));
});
}
}
Loading

0 comments on commit bd53a97

Please sign in to comment.