-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'latest' into russell/add-descriptions-testing-upgrading
- Loading branch information
Showing
312 changed files
with
4,119 additions
and
2,789 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
:vaadin-version: 24.2.1 | ||
:vaadin-flow-version: 24.2.1 | ||
:vaadin-version: 24.2.4 | ||
:vaadin-flow-version: 24.2.3 | ||
:vaadin-seven-version: 7.7.38 | ||
:vaadin-eight-version: 8.20.0 |
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 |
---|---|---|
|
@@ -7,9 +7,9 @@ order: 145 | |
|
||
= Custom Error Handling | ||
|
||
You can customize the error views related to navigation between different routes, as described in the <<{articles}/routing/exceptions#, Router Exception Handling>> documentation page. | ||
You can customize the error views related to navigation between different routes. The handling of router exceptions is described on the <<{articles}/routing/exceptions#, Router Exception Handling>> documentation page. | ||
|
||
For other unhandled runtime exceptions, an [classname]`ErrorHandler` class can be used to let users know that something went wrong. To do so, first create a custom [classname]`ErrorHandler` class, then use that class to override the default error handler. | ||
For other unhandled runtime exceptions, an [classname]`ErrorHandler` class can be used to let users know that something went wrong. To do so, first create a custom [classname]`ErrorHandler` class. Then use that class to override the default error handler. | ||
|
||
For example, the following [classname]`CustomErrorHandler` class logs the error and displays a notification to the user: | ||
|
||
|
@@ -41,11 +41,22 @@ VaadinSession.getCurrent().setErrorHandler(new CustomErrorHandler()); | |
|
||
To apply the custom error handler to all user sessions, you can use a [classname]`SessionInitListener`, which receives an event each time a new [classname]`VaadinSession` is initialized. See the <<session-and-ui-init-listener#,Session and UI Listeners>> documentation page to learn how to create a [classname]`SessionInitListener`. | ||
|
||
[classname]`ErrorEvent` has the method [methodname]`getComponent()` to get the handled [classname]`Component`, and the [methodname]`getElement()` method to get the handled [classname]`Element` when the error is thrown, if available. | ||
|
||
For example, the following button-click listener has [classname]`ErrorEvent` [methodname]`getComponent()` return the clicked button: | ||
|
||
[source,java] | ||
---- | ||
Button button = new Button("Click me", event -> { | ||
throw new IllegalArgumentException("No clicking"); | ||
}); | ||
---- | ||
|
||
|
||
[role="since:com.vaadin:[email protected]"] | ||
== Showing Error Parameter Views for Non-Navigation Exceptions | ||
== Error Parameter Views for Non-Navigation Exceptions | ||
|
||
In the [classname]`DefaultErrorHandler`, it's possible to enable transitioning to an [interfacename]`HasErrorParameter<T extends Exception>` error view on exceptions. This is done by setting the `enableErrorHandlerRedirect` parameter to `true`. See <<{articles}/routing/exceptions#, Error Resolving>> for more information on the [interfacename]`HasErrorParameter`. | ||
In the [classname]`DefaultErrorHandler`, it's possible to enable transitioning to an [interfacename]`HasErrorParameter<T extends Exception>` error view on exceptions. See the <<{articles}/routing/exceptions#, Error Resolving>> page for more information on the [interfacename]`HasErrorParameter`. | ||
|
||
For a customized error handler, the same can be done by using the [classname]`ErrorHandlerUtil` method, [methodname]`handleErrorByRedirectingToErrorView` like so: | ||
|
||
|
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
169 changes: 169 additions & 0 deletions
169
articles/components/_styling-section-theming-props.adoc
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,169 @@ | ||
// tag::style-properties[] | ||
[role="since:com.vaadin:[email protected]"] | ||
== Style Properties | ||
The following style properties can be used in CSS stylesheets to customize the appearance of this component. | ||
|
||
To apply values to these properties globally in your application UI, place them in a CSS block using the `html {...}` selector. | ||
ifdef::flow,lit[] | ||
See <<../../styling/lumo/lumo-style-properties#,Lumo Style Properties>> for more information on style properties. | ||
endif::[] | ||
// end::style-properties[] | ||
|
||
// tag::input-fields[] | ||
.Input Field Components Shared Styles | ||
[NOTE] | ||
Style properties whose names start with `--vaadin-input-field` are shared among all input field components. To apply them only to a specific type of component, use an element selector like `vaadin-text-field {...}` | ||
|
||
// end::input-fields[] | ||
|
||
|
||
// tag::input-surface[] | ||
=== Field Surface | ||
|
||
[cols="1,2,2"] | ||
|=== | ||
| Feature | Property | Default Value | ||
|
||
|Background | ||
|`--vaadin-input-field-background` | ||
|`--lumo-contrast-10pct` | ||
|
||
|Background, invalid | ||
|`--vaadin-input-field-invalid-background` | ||
|`--lumo-error-color-10pct` | ||
|
||
|Background, hover highlight color | ||
|`--vaadin-input-field-hover-highlight` | ||
|`--lumo-contrast-50pct` | ||
|
||
|Background, invalid hover highlight color | ||
|`--vaadin-input-field-invalid-hover-highlight` | ||
|`--lumo-error-color-50pct` | ||
|
||
|Hover highlight opacity | ||
|`--vaadin-input-field-hover-highlight-opacity` | ||
|`0.1` | ||
|
||
|Height | ||
|`--vaadin-input-field-height` | ||
|`--lumo-size-m` | ||
|
||
|Value text color | ||
|`--vaadin-input-field-value-color` | ||
|`--lumo-body-text-color` | ||
|
||
|Value font size | ||
|`--vaadin-input-field-value-font-size` | ||
|`--lumo-font-size-m` | ||
|
||
|Value font weight | ||
|`--vaadin-input-field-value-font-weight` | ||
|`400` | ||
|
||
|Placeholder text color | ||
|`--vaadin-input-field-placeholder-color` | ||
|`--lumo-secondary-text-color` | ||
|
||
|Border radius | ||
|`--vaadin-input-field-border-radius` | ||
|`--lumo-border-radius-m` | ||
|
||
|Read-only border | ||
|`--vaadin-input-field-readonly-border` | ||
|`1px dashed --lumo-contrast-30pct` | ||
|
||
|=== | ||
// end::input-surface[] | ||
|
||
|
||
// tag::label-helper-error[] | ||
=== Label | ||
|
||
[cols="1,2,2"] | ||
|=== | ||
| Feature | Property | Default Value | ||
|
||
|Color | ||
|`--vaadin-input-field-label-color` | ||
|`--lumo-secondary-text-color` | ||
|
||
|Focused color | ||
|`--vaadin-input-field-focused-label-color` | ||
|`--lumo-primary-text-color` | ||
|
||
|Hovered color | ||
|`--vaadin-input-field-hovered-label-color` | ||
|`--lumo-body-text-color` | ||
|
||
|Font size | ||
|`--vaadin-input-field-label-font-size` | ||
|`--lumo-font-size-s` | ||
|
||
|Font weight | ||
|`--vaadin-input-field-label-font-weight` | ||
|`500` | ||
|
||
|=== | ||
|
||
=== Helper | ||
|
||
[cols="1,2,2"] | ||
|=== | ||
| Feature | Property | Default Value | ||
|
||
|Font size | ||
|`--vaadin-input-field-helper-font-size` | ||
|`--lumo-font-size-xs` | ||
|
||
|Font weight | ||
|`--vaadin-input-field-helper-font-weight` | ||
|`400` | ||
|
||
|Color | ||
|`--vaadin-input-field-helper-color` | ||
|`--lumo-secondary-text-color` | ||
|
||
|Top margin | ||
|`--vaadin-input-field-helper-spacing` | ||
|`0.4em` | ||
|
||
|=== | ||
|
||
=== Error Message | ||
|
||
[cols="1,2,2"] | ||
|=== | ||
| Feature | Property | Default Value | ||
|
||
|Font size | ||
|`--vaadin-input-field-error-font-size` | ||
|`--lumo-font-size-xs` | ||
|
||
|Font weight | ||
|`--vaadin-input-field-error-font-weight` | ||
|`400` | ||
|
||
|Color | ||
|`--vaadin-input-field-error-color` | ||
|`--lumo-error-text-color` | ||
|
||
|=== | ||
// end::label-helper-error[] | ||
|
||
|
||
// tag::input-icons[] | ||
=== Icons | ||
[cols="1,2,2"] | ||
|=== | ||
| Feature | Property | Default Value | ||
|
||
|Font size | ||
|`--vaadin-input-field-icon-font-size` | ||
|`--lumo-icon-size-m` | ||
|
||
|Color | ||
|`--vaadin-input-field-icon-color` | ||
|`--lumo-contrast-60pct` | ||
|
||
|=== | ||
// end::input-icons[] |
Oops, something went wrong.