SiWeatherWidgetBodyComponent documentation¶
selector
si-weather-widget-bodyBody of the <si-weather-widget> . Useful for compositions that do not need the surrounding <si-card> chrome (e.g. embedding the weather inside a custom container).
Data is supplied as a composite value payload of type SiWeatherWidgetData .
The body delegates illustration resolution to the injected SiWeatherIconResolver . The library ships a default resolver that maps the built-in SiWeatherCondition vocabulary to Element icons.
In the vertical layout the forecast list responsively hides additional data columns (wind, humidity, …) via pure CSS container queries when the widget becomes too narrow. See si-weather-widget-body.component.scss for the thresholds.
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| disableAutoLoadingIndicator ¶ | boolean | false | Option to disable automatic start of skeleton loading indication. |
| forecastLabel ¶ | TranslatableString | $localize`:@@SI_WEATHER_WIDGET.FORECAST_LABEL:Weather forecast` | Accessible label for the forecast section. |
| initialLoadingIndicatorDebounceTime ¶ | number | 300 | Initial delay time in milliseconds before enabling loading indicator. Only used once initially during construction. |
| layout ¶ | SiWeatherWidgetLayout | 'vertical' | Visual layout. SiWeatherWidgetLayout . |
| location ¶ | TranslatableString | Optional location label, shown inside the body in the compact layout only. The non-compact layouts render the location via the <si-card> heading managed by SiWeatherWidgetComponent . | |
| metricsLabel ¶ | TranslatableString | $localize`:@@SI_WEATHER_WIDGET.METRICS_LABEL:Additional weather data` | Accessible label for the additional data list. |
| showLoadingIndicator ¶ | boolean | false | Input to start and stop the skeleton loading indication. |
| value | (SiWeatherWidgetData | undefined) | The main value to be displayed. If no value is set, the skeleton indicates the loading of the value. Disable the automatic loading mechanism by setting SiWidgetBodyBaseComponent.disableAutoLoadingIndicator . |
Attributes and Methods¶
| Name | Type | Default | Description |
|---|---|---|---|
| ngOnChanges() ¶ | () => void | A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked. | |
| ngOnInit() ¶ | () => void | A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated. | |
| (readonly) showLoadingIndicator ¶ | Signal<boolean> | ... |
Types Documentation¶
| Composite payload accepted by the body component. Granular widget/body inputs ( current , metrics , forecast ) take precedence when set. | ||||
|---|---|---|---|---|
|
| Built-in weather condition vocabulary. Mapped 1:1 by the library's default SiWeatherIconResolver to Element icons. Applications that need provider-specific vocabularies (Xweather, OpenWeather, …) should register their own resolver and may accept any string in their public APIs. |
|---|
| Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit . Equivalent to a normal string in usage and functionality. |
|---|
| Visual layout of the SiWeatherWidgetComponent . - vertical : full vertical card layout with header, today block, optional additional data and an optional vertical forecast table. - horizontal : wider card with the today block laid out side by side and a horizontal forecast strip below. - compact : condensed card without a card header. Location and min/max temperature are rendered next to the illustration. Does not show a forecast. |
|---|
| Describes how a weather illustration should be resolved. Callers can either provide a direct SiWeatherIcon.src or a semantic SiWeatherIcon.condition token resolved by a SiWeatherIconResolver . | ||||
|---|---|---|---|---|
|
Translatable import imported from @siemens/element-translate-ng |
|---|
import imported from @types/node |
|---|
| Today block of the weather widget. | |||||||
|---|---|---|---|---|---|---|---|
|
| Forecast block of the weather widget. The vertical layout supports up to five optional columns in addition to the mandatory rightmost min/max temperature column. The horizontal layout ignores columns and renders only day label, illustration and min/max temperature per column. A horizontal forecast should provide at least three days for a visually balanced layout. | |||
|---|---|---|---|
|
| A single metric row in the additional-data block (e.g. wind, precipitation). | |||
|---|---|---|---|
|
| Result returned by a SiWeatherIconResolver . Implementations should return either icon (rendered via <si-icon> ) or src (rendered as a plain <img> ). When both are present, icon wins. | ||||
|---|---|---|---|---|
|
Constructor |
|---|
| An optional forecast column shown left of the temperature column in vertical layouts. The widget supports up to five of these columns; additional columns are ignored. The temperature column is mandatory and always rendered on the right; it does not need to be modelled as a column here. | ||||
|---|---|---|---|---|
|
| A single day in the forecast block. | |||||
|---|---|---|---|---|---|
|
|
|
|
| Represents a menu item that navigates using the Angular Router. Requires a configured Angular Router. | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
| Implement and provide this to an SiMenuFactoryComponent to receive trigger events. | |||||||
|---|---|---|---|---|---|---|---|
| |||||||
|
| Used in events emitted from SiLinkActionService | |||
|---|---|---|---|
|
|
| Maps a semantic SiWeatherIcon to a renderable illustration. The library ships a SiDefaultWeatherIconResolver that maps the built-in SiWeatherCondition vocabulary to Element icons, so the widget renders a reasonable illustration out of the box. Applications can override the mapping or add provider-specific vocabularies by registering their own resolver: Example: Resolvers SHOULD return null for unknown or 'unknown' conditions so the widget can skip the illustration. | ||||||
|---|---|---|---|---|---|---|
| ||||||
|
| Built-in resolver that maps the library's minimal SiWeatherCondition vocabulary to Element icons: - clear → element-sun - clouds → element-cloudy - rain → element-rain - storm → element-storm - wind → element-wind - unknown → no illustrationUnknown tokens fall through to null so callers can register a more capable resolver without losing the built-in fallback. | ||||||
|---|---|---|---|---|---|---|
| ||||||
|
| Dashboard widget for current weather conditions, additional metrics and an optional multi-day forecast. The widget supports three layouts (see SiWeatherWidgetLayout ): - vertical (default): full vertical card with <si-card> heading, illustration, today block, optional additional data and an optional forecast table with up to five extra columns. - horizontal : wider card with the today block laid out side by side and a horizontal forecast strip below. The forecast SHOULD contain at least three days for a visually balanced layout. - compact : condensed variant without a card header. The location is rendered next to the illustration. The forecast is not shown.Data is supplied as a composite value payload of type SiWeatherWidgetData . Weather illustrations are resolved by an optional SiWeatherIconResolver that application developers register. Without a resolver the widget only renders illustrations when callers pass a direct illustration.src . | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||
|
| |||||||||||||||||||||
| |||||||||||||||||||||
|
| |||||||
| |||||||
|
Except where otherwise noted, content on this site is licensed under MIT License.