import { LitElement, type CSSResultGroup, type PropertyValues, type TemplateResult } from "lit"; import { ClosedEvent, ClosingEvent, HideEvent, OpenedEvent, OpeningEvent, ShowEvent, SnappedEvent } from "./events.ts"; import type { MetaData, SnapToCallbackArgument } from "./types.ts"; interface TapsiBottomSheetEventMap extends HTMLElementEventMap { [ClosedEvent.type]: ClosedEvent; [ClosingEvent.type]: ClosingEvent; [HideEvent.type]: HideEvent; [OpenedEvent.type]: OpenedEvent; [OpeningEvent.type]: OpeningEvent; [ShowEvent.type]: ShowEvent; [SnappedEvent.type]: SnappedEvent; } /** * @summary The Bottom sheet component that shows the secondary content anchored to the bottom of the screen. * * @tag tapsi-bottom-sheet * * @slot [header] - The slot for the header content. * @slot [body] - The slot for the main body content. * @slot [action-bar] - The slot for the action bar content. * * @fires {SnappedEvent} snapped - Fired when the bottom-sheet is snapped to a specific position. * @fires {OpeningEvent} opening - Fired when the bottom-sheet starts to open. (cancelable) * @fires {ClosingEvent} closing - Fired when the bottom-sheet starts to close. (cancelable) * @fires {OpenedEvent} opened - Fired when the bottom-sheet has fully opened. * @fires {ClosedEvent} closed - Fired when the bottom-sheet has fully closed. * @fires {HideEvent} hide - Fired when the bottom-sheet is hidden. (cancelable) * @fires {ShowEvent} show - Fired when the bottom-sheet is shown. (cancelable) */ export declare class BottomSheet extends LitElement { /** @internal */ static readonly styles: CSSResultGroup; /** @internal */ static readonly shadowRootOptions: { delegatesFocus: boolean; mode: ShadowRootMode; serializable?: boolean; slotAssignment?: SlotAssignmentMode; }; /** @internal */ addEventListener: (type: K, listener: (this: BottomSheet, ev: TapsiBottomSheetEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void; /** @internal */ removeEventListener: (type: K, listener: (this: BottomSheet, ev: TapsiBottomSheetEventMap[K]) => void, options?: boolean | EventListenerOptions) => void; /** * Sets the heading title in a declarative-way. * * @prop {string} headingTitle * @attr {string} heading-title * @default "" */ headingTitle: string; /** * Sets the heading description in a declarative-way. * * @prop {string} headingDescription * @attr {string} heading-description * @default "" */ headingDescription: string; /** * Determines whether the grabber should be visible or not. * * @prop {boolean} hasGrabber * @attr {string} has-grabber * @default false */ hasGrabber: boolean; /** * Determines whether the dismiss button should be visible or not. * * @prop {boolean} hasDismissButton * @attr {string} has-dismiss-button * @default false */ hasDismissButton: boolean; /** * Determines whether the action bar should be sticky or not. * * @prop {boolean} hasStickyActionBar * @attr {string} sticky-action-bar * @default false */ hasStickyActionBar: boolean; /** * Determines whether the header should be sticky or not. * * @prop {boolean} hasStickyHeader * @attr {string} sticky-header * @default false */ hasStickyHeader: boolean; /** * Determines whether the bottom sheet should be expanded * by grabbing gesture. * * @prop {boolean} expandable * @attr {string} expandable * @default false */ expandable: boolean; /** * The variant of the bottom sheet. * * @prop {"modal" | "inline"} variant * @attr {"modal" | "inline"} variant * @default "modal" */ variant: "modal" | "inline"; /** * Defines a string value that can be used to set a label * for assistive technologies. * * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label * * @prop {string} label * @attr {string} label * @default "" */ label: string; /** * Identifies the element (or elements) that labels the element. * * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby * * @props {string} labelledBy * @attr {string} labelledby * @default "" */ labelledBy: string; /** * Identifies the element that should get focused when bottom sheet opens. * * @props {string} focusTarget * @attr {string} focus-target * @default "" */ focusTarget: string; private _status; private _height; private _expandGrabber; private _isGrabbing; private _isDismissClicksAllowed; private get _preventContainerScrolling(); private _hasHeaderSlot; private _hasBodySlot; private _hasActionBarSlot; private _root; private _container; private _headerSlotNodes; private _bodySlotNodes; private _actionBarSlotNodes; private _open; private _snapPoints; private _previouslyFocusedElement; private readonly _DRAG_GESTURE_DEFAULT_CONFIG; private readonly _animationController; private readonly _scrollLocker; private readonly _focusTrapper; private _dragGesture; private _init; constructor(); protected updated(changed: PropertyValues): void; protected willUpdate(changed: PropertyValues): void; private _handleHeaderSlotChange; private _handleBodySlotChange; private _handleActionBarSlotChange; /** @internal */ connectedCallback(): void; /** @internal */ disconnectedCallback(): void; private _lockScroll; private _unlockScroll; private _attachEvents; private _detachEvents; private get _headerHeight(); private get _bodyHeight(); private get _actionBarHeight(); private get _grabberHeight(); private get _maxSnapPoint(); private get _minSnapPoint(); /** * The metadata of the bottom sheet. * * @prop {MetaData} metaData */ get metaData(): MetaData; /** * An array containing two snap points. * - The first snap point is either the container's scroll height * or half the window's inner height, whichever is smaller. * - The second snap point is 90% of the window's inner height. * * @prop {[number, number]} defaultSnapPoints */ get defaultSnapPoints(): [number, number]; /** * The snap points for bottom sheet to snap to. * Note that snap points will be sorted, no matter * how to set it. * * @prop {number[]} snapPoints */ get snapPoints(): number[]; set snapPoints(newSnapPoints: number[]); /** * Determines whether the bottom sheet should be open or not. * * @prop {boolean} open * @attr {string} open * @default false */ set open(openState: boolean); get open(): boolean; private _handleDocumentKeyDown; private _handleContainerScrollEnd; private _handleContainerScroll; private _handleContainerTouchMove; private _handleContainerTouchStart; private _handleDrag; private _snapTo; /** * Strictly snaps to the provided or resolved snap point. * * @param {number | SnapToCallbackArgument} numberOrCallback */ strictSnapTo(numberOrCallback: number | SnapToCallbackArgument): void; /** * When given a number it'll find the closest snap point, * so you don't need to know the exact value. * Use the callback method to resolve the snap point. * * @param {number | SnapToCallbackArgument} numberOrCallback */ snapTo(numberOrCallback: number | SnapToCallbackArgument): void; /** * Opens the bottom sheet if it is not already open. * Dispatches a cancelable ShowEvent ("show"). */ show(): void; /** * Closes the bottom sheet if it is currently open. * Dispatches a cancelable HideEvent ("hide"). */ hide(): void; private _toggleOpenState; private _renderDismissButton; private _renderGrabber; private _renderOverlay; private _renderHeadingTitle; private _renderHeadingDescription; private _renderHeading; private _renderContainer; protected render(): TemplateResult; } export {};