SiWeatherWidgetComponent documentation¶
import { SiWeatherWidgetComponent } from '@siemens/element-ng/dashboard';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.
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| accentLine ¶ | AccentLineType | undefined | Optional accent line. | |
| disableAutoLoadingIndicator ¶ | boolean | false | Option to disable automatic start of skeleton loading indication. |
| heading ¶ | TranslatableString | undefined | Card heading text. Used as the card header in | |
| imgAlt ¶ | TranslatableString | undefined | Alt text for a provided image. | |
| imgDir ¶ | "horizontal" | "vertical" | 'vertical' | Defines if an image is placed on top or start (left) of the card. |
| imgObjectFit ¶ | "fill" | "contain" | "cover" | "none" | "scale-down" | 'scale-down' | Sets the image object-fit CSS property. |
| imgObjectPosition ¶ | string | undefined | Sets the image object-position CSS property. | |
| imgSrc ¶ | string | undefined | Image source for the card. | |
| 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 | undefined | Location displayed next to the illustration in the | |
| primaryActions ¶ | ContentActionBarMainItem[] | [] | Input list of primary action items. Supports up to 4 actions and omits additional ones. |
| secondaryActions ¶ | MenuItem[] | [] | Input list of secondary action items. |
| showLoadingIndicator ¶ | boolean | false | Input to start and stop the skeleton loading indication. |
| value ¶ | SiWeatherWidgetData | undefined | Composite weather payload of type SiWeatherWidgetData. |
Types Documentation¶
import type { AccentLineType } from '@siemens/element-ng/common'; ContentActionBarMainItem
( MenuItemAction | MenuItemCheckbox | MenuItemLink | MenuItemRouterLink | MenuItemGroup ) & { iconOnly?: boolean } ¶import type { ContentActionBarMainItem } from '@siemens/element-ng/content-action-bar'; MenuItem
| MenuItemGroup | MenuItemAction | MenuItemRouterLink | MenuItemLink | MenuItemRadioGroup | MenuItemCheckbox | MenuItemRadio | MenuItemHeader | MenuDivider ¶import type { MenuItem } from '@siemens/element-ng/menu'; 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.
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.
-
Translatable condition label, e.g.
"Sunny". -
Weather illustration. A string is shorthand for
{ src }. -
Optional alt text used when illustration is given as a string.
-
Today's maximum temperature, pre-formatted by the caller.
-
Today's minimum temperature, pre-formatted by the caller.
-
Current temperature, pre-formatted by the caller (e.g.
"26°"or26).
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.
-
Optional extra columns (vertical layout only). At most five are rendered.
columns?:
readonly SiWeatherWidgetForecastColumn[]¶ -
The forecast days in display order.
days:
readonly SiWeatherWidgetForecastDay[]¶
import type { MenuItemAction } from '@siemens/element-ng/menu'; -
Action that called when the item is triggered. A function will be called, a string will be dispatched to the SiMenuActionService.
action:
string | ((actionParam: any, source: MenuItemAction) => void)¶ -
Badge that is rendered after the label.
badge?:
string | numberInherited from MenuItemBase¶ -
Color of the badge (not iconBadge).
badgeColor?:
stringInherited from MenuItemBase¶ -
Whether the menu item id disabled.
disabled?:
booleanInherited from MenuItemBase¶ -
Optional icon that will be rendered before the label.
icon?:
stringInherited from MenuItemBase¶ -
Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.
iconBadge?:
string | number | booleanInherited from MenuItemBase¶ -
ID that will be attached to the DOM node.
id?:
stringInherited from MenuItemBase¶ -
Label that is shown to the user.
label:
TranslatableStringInherited from MenuItemBase¶
import type { MenuItemCheckbox } from '@siemens/element-ng/menu'; -
Action that called when the item is triggered. A function will be called, a string will be dispatched to the SiMenuActionService.
action:
string | ((actionParam: any, source: MenuItemCheckbox) => void)¶ -
Badge that is rendered after the label.
badge?:
string | numberInherited from MenuItemBase¶ -
Color of the badge (not iconBadge).
badgeColor?:
stringInherited from MenuItemBase¶ -
Whether the checkbox is checked.
-
Whether the menu item id disabled.
disabled?:
booleanInherited from MenuItemBase¶ -
Optional icon that will be rendered before the label.
icon?:
stringInherited from MenuItemBase¶ -
Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.
iconBadge?:
string | number | booleanInherited from MenuItemBase¶ -
ID that will be attached to the DOM node.
id?:
stringInherited from MenuItemBase¶ -
Label that is shown to the user.
label:
TranslatableStringInherited from MenuItemBase¶
import type { MenuItemLink } from '@siemens/element-ng/menu'; -
Badge that is rendered after the label.
badge?:
string | numberInherited from MenuItemBase¶ -
Color of the badge (not iconBadge).
badgeColor?:
stringInherited from MenuItemBase¶ -
Whether the menu item id disabled.
disabled?:
booleanInherited from MenuItemBase¶ -
The href property of the anchor.
-
Optional icon that will be rendered before the label.
icon?:
stringInherited from MenuItemBase¶ -
Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.
iconBadge?:
string | number | booleanInherited from MenuItemBase¶ -
ID that will be attached to the DOM node.
id?:
stringInherited from MenuItemBase¶ -
Label that is shown to the user.
label:
TranslatableStringInherited from MenuItemBase¶ -
The target property of the anchor.
import type { MenuItemRouterLink } from '@siemens/element-ng/menu';Represents a menu item that navigates using the Angular Router.
Requires a configured Angular Router.
-
Badge that is rendered after the label.
badge?:
string | numberInherited from MenuItemBase¶ -
Color of the badge (not iconBadge).
badgeColor?:
stringInherited from MenuItemBase¶ -
Whether the menu item id disabled.
disabled?:
booleanInherited from MenuItemBase¶ -
Navigation extras that are passed to the RouterLink.
-
Optional icon that will be rendered before the label.
icon?:
stringInherited from MenuItemBase¶ -
Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.
iconBadge?:
string | number | booleanInherited from MenuItemBase¶ -
ID that will be attached to the DOM node.
id?:
stringInherited from MenuItemBase¶ -
Label that is shown to the user.
label:
TranslatableStringInherited from MenuItemBase¶ -
Link for the angular router. Accepts the same values as RouterLink.
routerLink:
string | any[]¶
import type { MenuItemGroup } from '@siemens/element-ng/menu'; -
Badge that is rendered after the label.
badge?:
string | numberInherited from MenuItemBase¶ -
Color of the badge (not iconBadge).
badgeColor?:
stringInherited from MenuItemBase¶ -
Submenu items for this menu item.
-
Whether the menu item id disabled.
disabled?:
booleanInherited from MenuItemBase¶ -
Optional icon that will be rendered before the label.
icon?:
stringInherited from MenuItemBase¶ -
Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.
iconBadge?:
string | number | booleanInherited from MenuItemBase¶ -
ID that will be attached to the DOM node.
id?:
stringInherited from MenuItemBase¶ -
Label that is shown to the user.
label:
TranslatableStringInherited from MenuItemBase¶
import type { MenuItemRadioGroup } from '@siemens/element-ng/menu'; -
Items that are part of the radio group.
children:
[MenuItemHeader, ...(MenuItemRadio | MenuItemHeader | MenuDivider)[]]¶
import type { MenuItemRadio } from '@siemens/element-ng/menu'; -
Action that called when the item is triggered. A function will be called, a string will be dispatched to the SiMenuActionService.
action:
string | ((actionParam: any, source: MenuItemRadio) => void)¶ -
Badge that is rendered after the label.
badge?:
string | numberInherited from MenuItemBase¶ -
Color of the badge (not iconBadge).
badgeColor?:
stringInherited from MenuItemBase¶ -
Whether the radio is checked.
-
Whether the menu item id disabled.
disabled?:
booleanInherited from MenuItemBase¶ -
Optional icon that will be rendered before the label.
icon?:
stringInherited from MenuItemBase¶ -
Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.
iconBadge?:
string | number | booleanInherited from MenuItemBase¶ -
ID that will be attached to the DOM node.
id?:
stringInherited from MenuItemBase¶ -
Label that is shown to the user.
label:
TranslatableStringInherited from MenuItemBase¶
import type { StatusType } from '@siemens/element-ng/common'; 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.
import type { SiWeatherWidgetForecastDay } from '@siemens/element-ng/dashboard';A single day in the forecast block.
-
Weather illustration for the day. A string is shorthand for
{ src }. -
Translatable day label, e.g.
"Mon". -
Maximum temperature, pre-formatted by the caller.
-
Minimum temperature, pre-formatted by the caller.
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.
-
element-icons icon name shown next to each row value.
-
Translatable column label, used as
aria-labelfor the column. -
Per-day values, aligned by index with SiWeatherWidgetForecast.days. Missing entries are rendered as empty cells.
import type { MenuItemBase } from '@siemens/element-ng/menu'; -
Badge that is rendered after the label.
-
Color of the badge (not iconBadge).
-
Whether the menu item id disabled.
-
Optional icon that will be rendered before the label.
-
Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.
-
ID that will be attached to the DOM node.
-
Label that is shown to the user.
Except where otherwise noted, content on this site is licensed under MIT License.