@elemental/ui / Class

LmnSelectionDirective

Decorators:@Directive
Generic types:T
Selectors:[lmnSelection]

Add selection capabilities to the table

Properties

NameTypeDescription
allSelected
r
Signal<boolean>

Whether all items are selected.

compareFn
r
InputSignal<LmnCompareFn<T>>

The function to compare two items for selection.

disabledItems
r
InputSignal<readonly T[]>

The list of items that are selected and disabled for massive operation.

You can still deselect them individually.

enabled
r
InputSignalWithTransform<boolean, unknown>

Whether selection is enabled.

hasValue
r
Signal<boolean>

Whether any items are selected.

isEmpty
r
Signal<boolean>

Whether no items are selected.

mode
r
InputSignal<LmnSelectionMode>

The selection mode, either 'single' or 'multiple'.

multipleSelectionValueFn
r
InputSignal<(item: T) => string>

The function to get the value for multiple selection.

selection
r
ModelSignal<LmnSelection<T>>

The selection model for the table.

setInput
r
<This, T extends keyof { [P in keyof This as This[P] extends InputSignalWithTransform<any, any> ? P : never]: any; }>(this: This, input: T, value: ExtractInputSignal<This[T]>) => void

Function to set input values.

someSelected
r
Signal<boolean>

Whether some but not all items are selected.

total
r
InputSignal<number | undefined>

The total number of items that can be selected.

Methods

clear()

Clears the selection.

Presentation
clear(): void;
Returns
void

deselect()

Deselects an item.

Presentation
deselect(item: T): void;
Parameters
NameTypeDescription
item
T
Returns
void

isSelected()

Checks if an item is selected.

Presentation
isSelected(item: T): boolean;
Parameters
NameTypeDescription
item
T
Returns
boolean

select()

Selects an item.

Presentation
select(item: T): void;
Parameters
NameTypeDescription
item
T
Returns
void

selectAll()

Selects all items.

Presentation
selectAll(selected: T[]): void;
Parameters
NameTypeDescription
selected
T[]
Returns
void

toggle()

Toggles the selection state of an item.

Presentation
toggle(item: T): boolean;
Parameters
NameTypeDescription
item
T
Returns
boolean

toMultipleSelectionValue()

Converts an item to a string for multiple selection.

Presentation
toMultipleSelectionValue(item: T): string;
Parameters
NameTypeDescription
item
T
Returns
string