Skip to content
Edit this page

SiSelectSimpleOptionsDirective documentation

import { SiSelectSimpleOptionsDirective } from '@siemens/element-ng/select';

This directive allows passing SelectItem to the SiSelectComponent.

Example:

<si-select [options]="[{ type: 'option', value: 'one', label: 'One' }, { type: 'option', value: 'two', label: 'Two' }]"></si-select>
<si-select [options]="[{ type: 'group', label: 'Group', options [{ type: 'option', value: 1, label: 'One' }, { type: 'option', value: 2, label: 'Two' }] }]"></si-select>

Input Properties

Name Type Default Description
optionEqualCheckFn
(a: T, b: T) => boolean (a: T, b: T): boolean => a === b

By default, values are check on referential equality. Provide a function to customize the behavior.

Inherited from SiSelectOptionsStrategyBase<T>

options
SelectItem<T>[] | null | undefined

Options to be shown in select dropdown

Attributes and Methods

Name Type Default Description
(readonly)allRows
Signal<SelectItem<T>[]> computed(() => this.options() ?? [])

All group and option items in the dropdown.

Inherited from SiSelectOptionsStrategyBase<T>

onFilter() inherited
(filterValue?: string) => void

This function is called when a user enters a filter query. It is expected that an implementation will update the rows based on the query.

Inherited from SiSelectOptionsStrategyBase<T>

Implements SiSelectOptionsStrategy<T>

Parameters
onValueChange() inherited
(value: T[]) => void

Is always called when the value changes. The implementation must update selectedRows when called.

Inherited from SiSelectOptionsStrategyBase<T>

Implements SiSelectOptionsStrategy<T>

Parameters
  • • currently selected value of the related si-select.

    value : T[]

(readonly)rows inherited
Signal<SelectItem<T>[]> []

Rows that should be shown.

Inherited from SiSelectOptionsStrategyBase<T>

Implements SiSelectOptionsStrategy<T>

(readonly)selectedRows inherited
Signal<SelectOption<T>[]> ...

List of all options that are currently selected. Must be updated when onValueChange is called.

Inherited from SiSelectOptionsStrategyBase<T>

Implements SiSelectOptionsStrategy<T>

Types Documentation

SelectItem

type SelectItem<T> = SelectGroup<T> | SelectOption<T>
type alias
import type { SelectItem } from '@siemens/element-ng/select';

Alias for SelectOption or SelectGroup

import type { SelectOption } from '@siemens/element-ng/select';

A select option

Properties
  • Whether this option is disabled.

    disabled ? : boolean

  • An optional icon.

    icon ? : string

  • The color of an icon.

    iconColor ? : string

  • A label to be shown for this option. Is optional if a custom template is provided or if the value should directly be rendered.

    label ? : TranslatableString

  • An optional stacked icon.

    stackedIcon ? : string

  • The color of a stacked icon.

    stackedIconColor ? : string

  • Defines this to be an option.

    type : "option"

  • Used for typeahead functionality when filtering is disabled. If provided, this will be used, otherwise the innerText of the rendered element.

    typeaheadLabel ? : TranslatableString

  • The value if this option. It will be used for formControls and the value property of this si-select. The value will internally be checked on equality by using ===. So an app should either use string or ensure that same values are referentially equal.

    value : T

import type { SelectGroup } from '@siemens/element-ng/select';

A select option group

Properties
  • An optional key to identify this group in a custom template.

    key ? : string

  • A label to be shown as header for this group. Is optional if a custom template is provided.

    label ? : TranslatableString

  • All options that are part of this group.

    options : SelectOption<T>[]

  • Defines this to be a group.

    type : "group"

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.


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