import * as i0 from '@angular/core';
import { EventEmitter, ElementRef, NgZone, AfterContentChecked, OnDestroy, ChangeDetectorRef, Type, Signal } from '@angular/core';
import * as i1$1 from '@angular/common';
import * as i2 from '@angular/cdk/a11y';
import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
import { AnimationEvent } from '@angular/animations';
import * as i1 from '@daffodil/design';
import { DaffOpenable, DaffFocusStackService, DaffOpenableDirective, AnimationStateWithParams } from '@daffodil/design';
import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
import { BehaviorSubject, Observable } from 'rxjs';
/**
* The available display modes for the `DaffSidebarComponent`.
*
* | Mode | Description |
* | -- | -- |
* | `side` | Displays the sidebar alongside the main content. |
* | `side-fixed` | Displays the sidebar alongside the content, but the sidebar remains fixed in place and scrolls independently from the content. |
* | `over` | The sidebar slides over the main content when open, temporarily covering part of the content when active. |
* | `under` | The sidebar remains fixed in place while the main content slides over it when the sidebar is closed. |
*/
type DaffSidebarMode = 'side' | 'over' | 'under' | 'side-fixed';
/**
* Enum for representing the available sidebar display modes.
* See {@link DaffSidebarMode} for descriptions of each mode.
*/
declare const enum DaffSidebarModeEnum {
Side = "side",
SideFixed = "side-fixed",
Over = "over",
Under = "under"
}
type DaffSidebarAnimationState = 'open' | 'closed' | 'under-open' | 'under-closed' | 'side-fixed-open' | 'side-fixed-closed' | 'none';
/**
* The sides of a viewport that that a sidebar can appear on.
*/
type DaffSidebarSide = 'left' | 'right';
/**
* A enum representing the different sidebar modes.
* See {@link DaffSidebarSide}
*/
declare const enum DaffSidebarSideEnum {
Left = "left",
Right = "right"
}
/**
* DaffSidebarComponent is heavily based upon the work done by the `@angular/components`
* team on `mat-drawer` and `mat-sidenav`. It's intended to be a simplified version
* (with a different design) of `mat-drawer`.
*
* ```html
*
* ```
*/
declare class DaffSidebarComponent implements DaffOpenable {
private _elementRef;
private _ngZone;
private _focusTrapFactory;
private _focusStack;
private openDirective;
private _doc;
/**
* @docs-private
*
* The animation state of the sidebar.
*/
get transformSidebar(): {
value: DaffSidebarAnimationState;
params: {
width: string;
};
};
/**
* Event fired when `ESC` key is pressed when the sidebar has focus.
*/
escapePressed: EventEmitter;
/**
* What side of the viewport to show the sidebar on.
*/
side: DaffSidebarSide;
/**
* The mode of the sidebar.
*/
mode: DaffSidebarMode;
/**
* @docs-private
*
* The width of the sidebar.
*/
get width(): number;
/**
* @docs-private
*/
get open(): i0.ModelSignal;
constructor(_elementRef: ElementRef, _ngZone: NgZone, _focusTrapFactory: ConfigurableFocusTrapFactory, _focusStack: DaffFocusStackService, openDirective: DaffOpenableDirective, _doc: any);
private _focusTrap;
/**
* @docs-private
*
* Animation event that can be used to hook into when the transformSidebar
* animation begins. This is used in sidebar to determine when to show the
* visibility of the sidebar so that the animation does not jump as the element is shown.
*/
onAnimationStart(e: AnimationEvent): void;
/**
* @docs-private
*
* Animation event that can be used to hook into when the
* transformSidebar animation is complete.
*/
onAnimationComplete(e: AnimationEvent): void;
/**
* Reveal the contents of the sidebar.
*/
reveal(): void;
/**
* Hide the contents of the sidebar.
*/
hide(): void;
/**
* Toggle the visibility of the sidebar.
*/
toggle(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* The placement of the nav in relation to the sidebar.
* See {@link DaffNavPlacementEnum }
*/
type DaffNavPlacement = 'above' | 'beside';
/**
* An interface that enables a user to enable or disable scrolling on sidebars.
*
* See {@link DAFF_SIDEBAR_SCROLL_TOKEN}
*/
interface DaffSidebarScroll {
enable(): void;
disable(): void;
}
declare enum DaffSidebarAnimationStates {
OPEN = "open",
CLOSED = "closed",
UNDEROPEN = "under-open",
UNDERCLOSED = "under-closed",
SIDEFIXEDOPEN = "side-fixed-open",
SIDEFIXEDCLOSED = "side-fixed-closed",
NONE = "none"
}
type DaffSidebarViewportAnimationState = DaffSidebarAnimationStates.OPEN | DaffSidebarAnimationStates.CLOSED;
interface DaffSidebarAnimationStateParams {
shift: string;
}
type DaffSidebarViewportAnimationStateWithParams = AnimationStateWithParams;
/**
* DaffSidebarViewportComponent serves as the container for managing sidebars across an entire application.
* Because it's a functional component, it supports multiple simultaneously open sidebar and is designed to
* handle these scenarios gracefully.
*
* > However, there is one key contraint: only one sidebar per **mode** is allowed
* on each **side** (e.g., left or right) at any given time.
*
* If this constraint is violated, the component will throw an exception to prevent unintended behavior.
*
* ```html
*
*
* Site content
*
* ```
*/
declare class DaffSidebarViewportComponent implements AfterContentChecked, OnDestroy {
private cdRef;
private _elementRef;
private bodyScroll;
private parentViewport;
private scroll;
/**
* @docs-private
*/
onContentAnimationStart(e: AnimationEvent): void;
/**
* @docs-private
*/
onContentAnimationDone(e: AnimationEvent): void;
/**
* The placement of the nav in relation to the sidebar. Note that this is really only available when there is a `side-fixed` sidebar.
*/
navPlacement: DaffNavPlacement;
constructor(cdRef: ChangeDetectorRef, _elementRef: ElementRef, bodyScroll: DaffSidebarScroll, parentViewport: any, scroll: DaffSidebarScroll);
/**
* The list of sidebars in the viewport.
*
* @docs-private
*/
private sidebars;
/**
* The number of pixels that the main content of the page should be shifted to
* right when there are child sidebars.
*/
private _shift;
/**
* @docs-private
*/
_isPaddedLeft: boolean;
/**
* @docs-private
*/
_isPaddedRight: boolean;
/**
* @docs-private
*
* Whether or not the backdrop is interactable
*/
_backdropInteractable: boolean;
/**
* @docs-private
*
* The animation state
*/
_animationState: DaffSidebarViewportAnimationStateWithParams;
/**
* Event fired when the backdrop is clicked. This is often used to close the sidebar.
*/
backdropClicked: EventEmitter;
/**
* @docs-private
*/
ngAfterContentChecked(): void;
/**
* @docs-private
*/
ngOnDestroy(): void;
/**
* @docs-private
*
* Updates the animation state of the viewport depending upon the state
* of all sidebars within the viewport.
*/
private updateAnimationState;
/**
* @docs-private
*
* Called when the backdrop of the viewport is clicked upon.
*/
_backdropClicked(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* Sidebar header is a child component of the sidebar that is used to display a header container,
* positioned at the top of a sidebar. It includes an optional title (`[daffSidebarHeaderTitle]`)
* slot and a slot to render any custom content.
*
* ```html
*
* ```
*/
declare class DaffSidebarHeaderComponent {
/**
* @docs-private
*/
faTimes: _fortawesome_fontawesome_common_types.IconDefinition;
/** Whether or not a sidebar header should display the close icon. */
dismissible: boolean;
/**
* Output event triggered when the close icon is clicked.
*/
closeSidebar: EventEmitter;
/**
* @docs-private
*/
onCloseSidebar(event: Event): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* Sidebar footer is a child component of the sidebar that is used to display a
* footer container, positioned at the bottom of a sidebar.
*
* ```html
*
* ```
*/
declare class DaffSidebarFooterComponent {
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* Sidebar header title is a child directive of `DaffSidebarHeaderComponent`
* that can be used to provide a title for the sidebar.
*
* ```html
* Title
* ```
*/
declare class DaffSidebarHeaderTitleDirective {
/**
* @docs-private
*/
class: boolean;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵdir: i0.ɵɵDirectiveDeclaration;
}
/**
* @deprecated in favor of {@link DAFF_SIDEBAR_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
*/
declare class DaffSidebarModule {
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵmod: i0.ɵɵNgModuleDeclaration;
static ɵinj: i0.ɵɵInjectorDeclaration;
}
/**
* Represents a registration of a sidebar.
* A collection of sidebar components is associated with an ID which can be passed to {@link DaffSidebarService#open}.
*/
interface DaffSidebarRegistration {
id: string;
header?: Type;
body?: Type;
footer?: Type;
}
/**
* 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`.
*/
declare abstract class DaffSidebarService {
protected _id$: BehaviorSubject;
protected _open: i0.WritableSignal;
readonly id$: Observable;
get isOpen(): Signal;
constructor(defaultId?: DaffSidebarRegistration['id']);
/**
* Opens the specified sidebar.
*
* @param id The optional sidebar ID. If omitted the most recently passed opened sidebar ID will persist (or the default if none was passed).
*/
open(id?: DaffSidebarRegistration['id']): void;
/**
* Closes the sidebar. Does not clear the ID.
*/
close(): void;
}
/**
* Returns whether the passed mode is a docked mode, i.e. side or side-fixed.
*/
declare const daffSidebarIsDockedMode: (mode: DaffSidebarModeEnum) => boolean;
/**
* Returns whether the passed mode is a floating mode, i.e. under or over.
*/
declare const daffSidebarIsFloatingMode: (mode: DaffSidebarModeEnum) => boolean;
/**
* @docs-private
*/
declare const DAFF_SIDEBAR_COMPONENTS: readonly [typeof DaffSidebarComponent, typeof DaffSidebarViewportComponent, typeof DaffSidebarHeaderComponent, typeof DaffSidebarFooterComponent, typeof DaffSidebarHeaderTitleDirective];
export { DAFF_SIDEBAR_COMPONENTS, DaffSidebarComponent, DaffSidebarFooterComponent, DaffSidebarHeaderComponent, DaffSidebarHeaderTitleDirective, DaffSidebarModeEnum, DaffSidebarModule, DaffSidebarService, DaffSidebarSideEnum, DaffSidebarViewportComponent, daffSidebarIsDockedMode, daffSidebarIsFloatingMode };
export type { DaffSidebarMode, DaffSidebarRegistration, DaffSidebarSide };