File

src/ui/lookup/services/smart-lookup-multiselect.service.ts

Description

Component-scoped service that holds the lookup multi-selection state and the pure value helpers consumed by SmartLookupComponent. Provided per-component via providers: [SmartLookupMultiSelectService] so each lookup instance has its own state. Intentionally free of DOM, @ViewChild and @Output concerns - those stay in the component.

Index

Properties
Methods

Methods

isMultiValueInput
isMultiValueInput(text: any)

Returns true when multi-selection is enabled and the supplied text holds the delimiter, i.e. it represents multiple values.

Parameters :
Name Type Optional Description
text any No
  • The candidate input text.
Returns : boolean
serialize
serialize(values: string[])

Serializes selected chip display values into the delimited model string.

Parameters :
Name Type Optional Description
values string[] No
  • The selected display values.
Returns : string
setInputs
setInputs(inputs: SmartLookupMultiSelectInputs)

Push the latest input values into the service. Only the keys present on inputs are updated, so callers can update a single field without resetting the others.

Parameters :
Name Type Optional
inputs SmartLookupMultiSelectInputs No
Returns : void
toChipValues
toChipValues(model: any)

Splits a delimited model value into the individual chip display values, dropping empty segments. Returns an empty array when there is no value.

Parameters :
Name Type Optional Description
model any No
  • The bound model value (a delimited display string).
Returns : string[]
toDisplayValues
toDisplayValues(items: any[], displayField: string)

Maps fetched lookup records to plain display strings (via the binding's display field) for the multiselect dropdown data. Feeding strings rather than record objects keeps chips rendering even when a value is not present in the freshly filtered data.

Parameters :
Name Type Optional Description
items any[] No
  • The fetched autocomplete records.
displayField string No
  • The lookup display field.
Returns : string[]

Properties

Readonly effectiveDelimiter
Type : Signal<string>
Default value : computed(() => this._multiple() ? this._delimiter() || ',' : undefined )

The delimiter actually used for multiple values: the configured delimiter, or , as a default. Undefined when multi-selection is off.

Readonly enabled
Type : Signal<boolean>
Default value : computed(() => !!this._multiple())

True when multi-selection (chip mode) is enabled.

results matching ""

    No results matching ""