-
Notifications
You must be signed in to change notification settings - Fork 0
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
67 changed files
with
3,336 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,20 @@ | ||
# 2.0.1 | ||
* Make it possible to control how filtering is applied to Grid #32 | ||
* Updated dependencies | ||
|
||
# 2.0.0 | ||
_Reworked component_ | ||
|
||
* New customizable UI, including | ||
* nested filters (AND, OR, NOT) | ||
* depth can be limited | ||
* customizable operations (=,>,<,contains,is empty) | ||
* support for multiple value types | ||
* can easily be bound with Vaadin components | ||
* Improved support for QueryParameters | ||
* Better translation support | ||
|
||
v1 component can now be found at https://github.com/xdev-software/vaadin-simple-grid-filter | ||
|
||
# 1.0.0 | ||
_Initial release_ |
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
vaadin-grid-filter-demo/src/main/java/software/xdev/vaadin/gridfilter/DemoView.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.gridfilter; | ||
|
||
import java.util.List; | ||
|
||
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.gridfilter.demo.LocalizationDemo; | ||
import software.xdev.vaadin.gridfilter.demo.MaxNestedDepthDemo; | ||
import software.xdev.vaadin.gridfilter.demo.MinimalisticDemo; | ||
import software.xdev.vaadin.gridfilter.demo.QueryParameterDemo; | ||
|
||
|
||
@PageTitle("Grid Filter demos") | ||
@Route("") | ||
public class DemoView extends Composite<VerticalLayout> | ||
{ | ||
private final Grid<Example> grExamples = new Grid<>(); | ||
|
||
public DemoView() | ||
{ | ||
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%"); | ||
spDesc.getStyle().set("white-space", "pre"); | ||
|
||
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(List.of( | ||
new Example( | ||
MinimalisticDemo.NAV, | ||
"Minimalistic", | ||
"Showcasing the simplest form of using the component" | ||
), | ||
new Example( | ||
QueryParameterDemo.NAV, | ||
"Store filters in QueryParameter", | ||
"Shows how filters can be persisted in and loaded from QueryParameters/Url" | ||
), | ||
new Example( | ||
MaxNestedDepthDemo.NAV, | ||
"Limit depth/nesting of filters", | ||
"Limits the how many filters can be nested" | ||
), | ||
new Example( | ||
LocalizationDemo.NAV, | ||
"Localization", | ||
"Showcases how localization can be done (UI in German)" | ||
) | ||
)); | ||
} | ||
|
||
record Example(String route, String name, String desc) | ||
{ | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
vaadin-grid-filter-demo/src/main/java/software/xdev/vaadin/gridfilter/demo/AbstractDemo.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,33 @@ | ||
package software.xdev.vaadin.gridfilter.demo; | ||
|
||
import java.time.LocalDate; | ||
|
||
import com.vaadin.flow.component.AttachEvent; | ||
import com.vaadin.flow.component.grid.Grid; | ||
import com.vaadin.flow.component.orderedlayout.VerticalLayout; | ||
|
||
import software.xdev.vaadin.gridfilter.GridFilter; | ||
import software.xdev.vaadin.gridfilter.model.Department; | ||
import software.xdev.vaadin.gridfilter.model.Person; | ||
|
||
|
||
public class AbstractDemo extends VerticalLayout | ||
{ | ||
protected final Grid<Person> grid = new Grid<>(Person.class, true); | ||
|
||
protected GridFilter<Person> createDefaultFilter() | ||
{ | ||
return GridFilter.createDefault(this.grid) | ||
.withFilterableField("ID", Person::id, Integer.class) | ||
.withFilterableField("First Name", Person::firstName, String.class) | ||
.withFilterableField("Birthday", Person::birthday, LocalDate.class) | ||
.withFilterableField("Married", Person::married, Boolean.class) | ||
.withFilterableField("Department", Person::department, Department.class); | ||
} | ||
|
||
@Override | ||
protected void onAttach(final AttachEvent attachEvent) | ||
{ | ||
this.grid.setItems(Person.list()); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...grid-filter-demo/src/main/java/software/xdev/vaadin/gridfilter/demo/LocalizationDemo.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,31 @@ | ||
package software.xdev.vaadin.gridfilter.demo; | ||
|
||
import com.vaadin.flow.router.Route; | ||
|
||
import software.xdev.vaadin.gridfilter.GridFilter; | ||
import software.xdev.vaadin.gridfilter.GridFilterLocalizationConfig; | ||
import software.xdev.vaadin.gridfilter.model.Person; | ||
|
||
|
||
@Route(LocalizationDemo.NAV) | ||
public class LocalizationDemo extends AbstractDemo | ||
{ | ||
public static final String NAV = "/localization"; | ||
|
||
public LocalizationDemo() | ||
{ | ||
final GridFilter<Person> filter = this.createDefaultFilter() | ||
.withLocalizationConfig(new GridFilterLocalizationConfig() | ||
.with(GridFilterLocalizationConfig.BLOCK_AND, "UND") | ||
.with(GridFilterLocalizationConfig.BLOCK_OR, "ODER") | ||
.with(GridFilterLocalizationConfig.BLOCK_NOT, "NICHT") | ||
.with(GridFilterLocalizationConfig.OP_CONTAINS, "enthält") | ||
.with(GridFilterLocalizationConfig.OP_GREATER_THAN, "größer als") | ||
.with(GridFilterLocalizationConfig.OP_LESS_THAN, "kleiner als") | ||
.with(GridFilterLocalizationConfig.OP_EQUALS, "ist gleich") | ||
.with(GridFilterLocalizationConfig.OP_IS_EMPTY, "ist leer") | ||
.with(GridFilterLocalizationConfig.CONDITION, "Bedingung")); | ||
|
||
this.add(filter, this.grid); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...id-filter-demo/src/main/java/software/xdev/vaadin/gridfilter/demo/MaxNestedDepthDemo.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,21 @@ | ||
package software.xdev.vaadin.gridfilter.demo; | ||
|
||
import com.vaadin.flow.router.Route; | ||
|
||
import software.xdev.vaadin.gridfilter.GridFilter; | ||
import software.xdev.vaadin.gridfilter.model.Person; | ||
|
||
|
||
@Route(MaxNestedDepthDemo.NAV) | ||
public class MaxNestedDepthDemo extends AbstractDemo | ||
{ | ||
public static final String NAV = "/maxNestedDepth"; | ||
|
||
public MaxNestedDepthDemo() | ||
{ | ||
final GridFilter<Person> filter = this.createDefaultFilter() | ||
.withMaxNestedDepth(1); | ||
|
||
this.add(filter, this.grid); | ||
} | ||
} |
Oops, something went wrong.