GitHub

DaffSidebarService

A service that stores the open state and ID of the currently opened sidebar.

A default sidebar ID can be passed to the constructor that will be the initial value of $id.

import { DaffSidebarService } from '@daffodil/design/sidebar'
abstract class DaffSidebarService {
  protected _id$: BehaviorSubject<DaffSidebarRegistration['id']>
  protected _open: signal(false)
  readonly id$: Observable<DaffSidebarRegistration['id']>
  get isOpen(): Signal<boolean>
  open(id?: string)
  close()
}

Properties

Name Type Description
_id$ BehaviorSubject<DaffSidebarRegistration['id']>
_open signal(false)
id$ Observable<DaffSidebarRegistration['id']>
isOpen Signal<boolean>
open

Opens the specified sidebar.

close

Closes the sidebar. Does not clear the ID.