Skip to content

SiWeatherWidgetBodyComponent documentation

import { SiWeatherWidgetBodyComponent } from '@siemens/element-ng/dashboard';

Body 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

NameTypeDefaultDescription
disableAutoLoadingIndicatorinherited
boolean false

Option to disable automatic start of skeleton loading indication.

Inherited from SiWidgetBaseDirective<SiWeatherWidgetData>

forecastLabel
TranslatableString $localize`:@@SI_WEATHER_WIDGET.FORECAST_LABEL:Weather forecast`

Accessible label for the forecast section.

initialLoadingIndicatorDebounceTimeinherited
number 300

Initial delay time in milliseconds before enabling loading indicator. Only used once initially during construction.

Inherited from SiWidgetBaseDirective<SiWeatherWidgetData>

layout
SiWeatherWidgetLayout 'vertical'

Visual layout. SiWeatherWidgetLayout.

location
TranslatableString | undefined

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.

showLoadingIndicatorinherited
boolean false

Input to start and stop the skeleton loading indication.

Inherited from SiWidgetBaseDirective<SiWeatherWidgetData>

valuerequiredinherited
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.

Inherited from SiWidgetBaseDirective<SiWeatherWidgetData>

Attributes and Methods

NameTypeDefaultDescription
(readonly) showLoadingIndicatorinherited
Signal<boolean> ...

Inherited from SiWidgetBaseDirective<SiWeatherWidgetData>

Types Documentation

import type { SiWeatherWidgetData } from '@siemens/element-ng/dashboard';

Composite payload accepted by the body component. Granular widget/body inputs (current, metrics, forecast) take precedence when set.

SiWeatherWidgetLayout

'vertical' | 'horizontal' | 'compact'
type alias
import type { SiWeatherWidgetLayout } from '@siemens/element-ng/dashboard';

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.

import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';

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.

import type { SiWeatherWidgetCurrent } from '@siemens/element-ng/dashboard';

Today block of the weather widget.

Properties
import type { SiWeatherWidgetMetric } from '@siemens/element-ng/dashboard';

A single metric row in the additional-data block (e.g. wind, precipitation).

Properties
import type { SiWeatherWidgetForecast } from '@siemens/element-ng/dashboard';

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.

Properties
import type { SiWeatherIcon } from '@siemens/element-ng/dashboard';

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.

Properties
import type { SiWeatherWidgetForecastDay } from '@siemens/element-ng/dashboard';

A single day in the forecast block.

Properties
import type { SiWeatherWidgetForecastColumn } from '@siemens/element-ng/dashboard';

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.

Properties

Except where otherwise noted, content on this site is licensed under MIT License.