https://github.com/vaadin-component-factory/field-description
https://github.com/vaadin-component-factory/field-description
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vaadin-component-factory/field-description
- Owner: vaadin-component-factory
- License: apache-2.0
- Created: 2021-08-18T01:40:39.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-31T01:11:23.000Z (over 3 years ago)
- Last Synced: 2025-01-10T00:36:36.342Z (4 months ago)
- Language: TypeScript
- Size: 204 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Component Factory Field Description for Vaadin 14+
This is server-side component of [<vcf-field-description>](https://github.com/vaadin-component-factory/vcf-field-description) Web Component.
Field description is component meant to be used as a HelperComponent.[Live Demo ↗](https://incubator.app.fi/field-description-demo)
## Usage
Some examples of this component usage:
```java
FieldDescription fieldDescription1 = new FieldDescription();
fieldDescription1.setDescription("This is a short description");
fieldDescription1.setReadMoreFocusable(true);
fieldDescription1.setFeedback("Some feedback huh ?", IFieldDescription.FeedbackState.INFO);TextField textField1 = new TextField();
textField1.setLabel("Short description:");
textField1.setHelperComponent(fieldDescription1);
textField1.setWidth("400px");FieldDescription fieldDescription2 = new FieldDescription();
fieldDescription2.setDescription("This is a very long description and also I decreased the width of the textfield. The idea here is to check if the styles will be applied and also if I'm able to expand the description box.");
fieldDescription2.setReserveDescriptionHeight(true);
fieldDescription2.setReserveFeedbackHeight(true);
fieldDescription2.setFeedback("Some feedback huh ?", IFieldDescription.FeedbackState.WARN);TextField textField2 = new TextField();
textField2.setLabel("Long description:");
textField2.setHelperComponent(fieldDescription2);
textField2.setWidth("250px");FieldDescription fieldDescription3 = new FieldDescription();
fieldDescription3.setDescriptionAsHtml("TEST!");TextField textField3 = new TextField();
textField3.setLabel("Description as html:");
textField3.setHelperComponent(fieldDescription3);
textField3.setWidth("400px");add(textField1, textField2, textField3);
Button button = new Button("update desc to check if it updates");
button.addClickListener(buttonClickEvent -> fieldDescription1.setDescription("dfalvjare akerjhg erlkge rlkgrgserg ersgesr gser gedrgdr gdrg rd drgdrgdrge rioguweçrghrwthgrthgkrjhg rgrtgk rtgrtilgurt"));add(button);
```
## Setting up for development:
Clone the project in GitHub (or fork it if you plan on contributing)
```
git clone [email protected]:vaadin-component-factory/field-description.git
```to install project, to your maven repository run
```mvn install```
## How to run the demo?
The Demo can be run going to the project `field-description-demo` and executing the maven goal:
```mvn spring-boot:run```
# License & Author
Apache License 2