GitHub

Selectable

Selectable enforces consistent use of the selected state across components.

Directives

DaffSelectableDirective

import { DaffSelectableDirective } from '@daffodil/design'

Enforces consistent use of the selected state.

@Directive()
class DaffSelectableDirective implements DaffSelectable {
  @Input() selected: boolean = false

  @Output() becameSelected: EventEmitter<void> = new EventEmitter<void>()

  select(): this
  deselect(): this
}

Inputs

selected
boolean
Defaultfalse
Description

Whether the component is selected.

Outputs

becameSelected
EventEmitter<void>
Default –
Description

An event that fires after the component becomes selected.

() Methods

select
this

Selects the component and emits the becameSelected event.

deselect
this

Deselects the component.


Types

DaffSelectable

import { DaffSelectable } from '@daffodil/design'

An interface for giving a component the ability to display a selected UI. In order to be selectable, the class must implement this property.

interface DaffSelectable {
  selected: boolean
}