src/ui/lookup/services/smart-lookup-binding.service.ts
Component-scoped service that holds the lookup binding context and
value-resolution helpers consumed by SmartLookupComponent. Provided
per-component via providers: [SmartLookupBindingService] so each
lookup instance has its own state.
Properties |
|
Methods |
| getModelField |
getModelField()
|
|
Returns the lookup field whose value mirrors
Returns :
string
|
| isBoundToValueField |
isBoundToValueField()
|
|
True when the bound viewer field corresponds to the value side of
the lookup (i.e.
Returns :
boolean
|
| readBoundFieldValue |
readBoundFieldValue(record: any, field: string)
|
|
Reads a value from a lookup record honoring the same fallbacks the
legacy
Returns :
any
|
| resolveDisplayValueAfterSelection | ||||||||||||||||
resolveDisplayValueAfterSelection(selected: any, datasourceSelected: any, fallback: any)
|
||||||||||||||||
|
Resolves the text written to the Kendo input after key-value
navigation (
Parameters :
Returns :
string
|
| resolveInputDisplayText | ||||||||||||||||
resolveInputDisplayText(sourceSelection: any, selected: any, fallback: any)
|
||||||||||||||||
|
Resolves the text written to the Kendo input after a live selection synchronization (autocomplete, dialog OK).
Parameters :
Returns :
any
|
| resolveKeyValueModel |
resolveKeyValueModel(sourceSelection: any, fallback?: any)
|
|
Resolves the value to assign to
Returns :
any
|
| resolveModelValue |
resolveModelValue(sourceSelection: any, fallback?: any)
|
|
Resolves the value to assign to
Returns :
any
|
| resolveRestoreDisplayText |
resolveRestoreDisplayText(selected: any, fallback: any, displayFallback?: any)
|
|
Resolves the text written to the Kendo input when restoring after cancel / no autocomplete match. Falls back to the previous model value supplied by the caller.
Returns :
string
|
| resolveViewerFieldReference | |||||||||
resolveViewerFieldReference(fieldName: string, viewerFields: T[])
|
|||||||||
Type parameters :
|
|||||||||
|
Locates a viewer field by exact or short-name match. Mirrors the
old
Parameters :
Returns :
T | undefined
|
| setInputs | ||||||
setInputs(inputs: SmartLookupBindingInputs)
|
||||||
|
Push the latest input values into the service. Only the keys present
on
Parameters :
Returns :
void
|
| Readonly context |
Type : Signal<LookupBindingContext>
|
Default value : computed(() => {
const tokens = (this._name() || '').split('.');
const boundFieldName = this.resolveBoundFieldName(tokens);
const keyField = this._keyField();
const keyValueField = this._keyValueField();
const keyValueFieldBinding = this._keyValueFieldBinding();
return {
boundFieldName,
displayField: keyField || keyValueField,
effectiveKeyValueField: keyValueField || keyField,
keyValueFieldBinding
};
})
|
|
Reactive lookup binding context. Recomputes whenever any of the
underlying inputs ( |