import { default as WJElement } from '../wje-element/element.js'; import { default as SlidingContainerBackdrop } from './sliding-container.backdrop.js'; import { default as SlidingContainerTransition } from './sliding-container.transition.js'; /** * @summary SlidingContainer is a custom web component that extends WJElement. * @documentation https://elements.webjet.sk/components/SlidingContainer * @status stable * @augments WJElement * @csspart backdrop - Provides the style source for the viewport backdrop. * @csspart sliding-container - Styles the native sliding panel. * @csspart expanded - Styles the optional expanded panel. * @csspart close-button - Styles the generated close button. * @csspart sheet-handle-area - Styles the draggable resize handle hit area. * @csspart sheet-handle - Styles the visible draggable resize handle. * @slot - The default slot for the SlidingContainer. * @slot expanded - Optional content rendered next to the base panel while expanded. * @property {string} maxWidth - The maximum width of the SlidingContainer. * @property {string} maxHeight - The maximum height of the SlidingContainer. * @property {string} trigger - The trigger for the SlidingContainer. * @property {string|null} expandedWidth - Width added by the expanded panel. * @property {string} expandedDirection - Physical side where the expanded panel is rendered. * @property {string|null} expandedTrigger - Optional document event that toggles expansion. * @property {'left'|'right'|'bottom'} direction - Edge from which the drawer opens. * @property {string} variant - Determines how the SlidingContainer behaves, such as 'over' or 'in-place'. * @property {string} screenBreakPoint - The width (in pixels) at which the SlidingContainer switches to the "over" variant for smaller screens. * @property {boolean} removeChildAfterClose - Removes the child after the SlidingContainer is closed. * @property {string} animationDuration - Specifies the duration (in milliseconds) of the sliding animation. * @property {string} animationEasing - Specifies the easing function used for the sliding animation (e.g., 'linear', 'ease-in', 'ease-out'). * @property {boolean} hasOpacity - Sets the opacity of the SlidingContainer. * @property {string} mobilePresentation - Legacy responsive adapter. Prefer direction="bottom". * @property {string} mobileBreakPoint - Legacy viewport width where mobile presentation becomes active. * @property {boolean} backdrop - Shows a viewport backdrop while the container is open. Legacy bottom-sheet usage with backdrop-dismiss keeps its implicit backdrop. * @property {boolean} backdropDismiss - Closes the container when its backdrop is clicked. * @property {string|null} scope - Frame used by a bottom drawer: "container", "parent", or "viewport". * @property {boolean} sheetResizable - Enables bottom drawer resizing. * @property {string} sheetScope - Legacy alias that defines the bottom sheet scope. * @property {string} sheetBoundary - CSS selector for the composed ancestor that bounds the mobile bottom sheet panel. * @property {string} sheetHeight - The bottom drawer height after opening. * @property {string} sheetMinHeight - The minimum bottom drawer height while resizing. * @property {string} sheetMaxHeight - The maximum bottom drawer height while resizing. * @attribute {string} mobile-presentation - Legacy responsive adapter. Prefer direction="bottom". * @attribute {string} expanded-width - Width of the optional expanded panel. * @attribute {string} expanded-direction - Physical side where the expanded panel is rendered: "left" or "right". * @attribute {string} expanded-trigger - Document event that toggles the expanded panel. * @attribute {'left'|'right'|'bottom'} direction - Edge from which the drawer opens. Defaults to "right". * @attribute {string} mobile-break-point - Viewport width where mobile presentation becomes active. Defaults to "768". * @attribute {boolean} backdrop - Shows a viewport backdrop for every direction. * @attribute {boolean} backdrop-dismiss - Closes the container when its visible backdrop is clicked. * @attribute {string} scope - Frame used by a bottom drawer: "container", "parent", or "viewport". * @attribute {boolean} sheet-resizable - Enables resizing the bottom drawer with a handle. * @attribute {string} sheet-scope - Legacy scope alias for bottom-sheet compatibility. * @attribute {string} sheet-boundary - CSS selector for the composed ancestor that bounds the mobile bottom sheet panel. * @attribute {string} sheet-height - The bottom drawer height after opening. * @attribute {string} sheet-min-height - The minimum bottom drawer height while resizing. * @attribute {string} sheet-max-height - The maximum bottom drawer height while resizing. * @cssproperty [--wje-sliding-container-background=var(--wje-background)] - Background of the sliding panel. * @cssproperty [--wje-sliding-container-expanded-background=var(--wje-sliding-container-background)] - Background of the expanded panel. * @cssproperty [--wje-sliding-container-z-index=1000] - z-index of the side sliding container. * @cssproperty [--wje-sliding-container-bottom-sheet-z-index=var(--wje-sliding-container-z-index, 1000)] - z-index of the bottom drawer host. * @cssproperty [--wje-sliding-container-bottom-sheet-panel-z-index=1] - z-index of the bottom drawer panel inside the host layer. * @cssproperty [--wje-sliding-container-backdrop-z-index] - z-index of the body-level viewport backdrop. Defaults to one layer below the host. * @cssproperty [--wje-sliding-container-portal-backdrop-z-index] - Deprecated fallback for the viewport backdrop z-index. * @cssproperty [--wje-sliding-container-backdrop-background=var(--wje-backdrop)] - Background of the viewport backdrop. * @cssproperty [--wje-sliding-container-backdrop-opacity=1] - Backdrop opacity while the container is open. * @cssproperty [--wje-sliding-container-backdrop-filter=none] - CSS backdrop filter applied to the viewport backdrop. * @cssproperty [--wje-sliding-container-box-shadow=var(--wje-sliding-container-shadow)] - Shadow of the bottom drawer panel. * @cssproperty [--wje-sliding-container-sheet-border-radius=var(--wje-sliding-container-border-radius) var(--wje-sliding-container-border-radius) 0 0] - Border radius of the bottom drawer panel. * @cssproperty [--wje-sliding-container-sheet-handle-area-height=24px] - Height of the resize handle hit area. * @cssproperty [--wje-sliding-container-sheet-handle-width=36px] - Width of the visible resize handle. * @cssproperty [--wje-sliding-container-sheet-handle-height=2px] - Height of the visible resize handle. * @cssproperty [--wje-sliding-container-sheet-handle-background=var(--wje-border-color)] - Background of the visible resize handle. * @cssproperty [--wje-sliding-container-sheet-handle-radius=999px] - Border radius of the visible resize handle. * @tag wje-sliding-container * @example * * * * CONTENT Subtitle * CONTENT Title * * * CONTENT Lorem ipsum dolor sit amet, consectetur adipiscing elit. * * * */ export default class SlidingContainer extends WJElement { /** * Returns the observed attributes for the component. * @returns {string[]} */ static get observedAttributes(): string[]; /** * Returns the CSS styles for the component. * @static * @returns {CSSStyleSheet} */ static get cssStyleSheet(): CSSStyleSheet; _isOpen: boolean; _isClosing: boolean; _lastCaller: EventTarget; _sheetDrag: { pointerId: string | number; startY: number; startHeight: any; minHeight: number; maxHeight: number; hasMoved: boolean; }; _sheetIgnoreDismissUntil: number; _sheetBackdropGesture: { pointerId: number; startX: number; startY: number; hasMoved: boolean; }; _sheetBackdropHandledUntil: number; _bottomScopeFrame: { top: number; left: number; right: number; bottom: number; width: number; height: number; }; _resizeObserver: ResizeObserver; _boundTrigger: string; _boundExpandedTrigger: string; _sideOverStyleSnapshot: { position: string; top: string; left: string; right: string; height: string; wrapperHeight: string; }; _isExpanded: boolean; _expandedTarget: boolean; _expandedWidthPixels: number; _expandedTransition: any; _expandedOperationPromise: Promise; _expandedOperationVersion: number; backdropController: SlidingContainerBackdrop; baseTransition: SlidingContainerTransition; /** * Sets the maximum width of an element by updating the 'max-width' attribute. * @param {string} value The maximum width value to be set (e.g., '100px', '50%', etc.). */ set maxWidth(value: string); /** * Gets the maximum width value of the element. * Retrieves the value of the 'max-width' attribute. If the attribute is not set, it defaults to 'auto'. * @returns {string} The maximum width value of the element or 'auto' if the attribute is not defined. */ get maxWidth(): string; /** * Sets the maximum height for the element. * @param {string} value The maximum height value to be applied to the element. This can include units such as "px", "em", "%", etc. */ set maxHeight(value: string); /** * Retrieves the maximum height value of the element, or returns 'auto' if not set. * @returns {string} The maximum height value or 'auto' if the attribute is not specified. */ get maxHeight(): string; /** * Sets the 'trigger' attribute for the element. * @param {string} value The value to set for the 'trigger' attribute. */ set trigger(value: string); /** * Retrieves the value of the 'trigger' attribute. If the attribute is not set, it defaults to 'sliding-container'. * @returns {string} The value of the 'trigger' attribute or the default value 'sliding-container' if not defined. */ get trigger(): string; /** * Sets the width of the optional expanded panel. * @param {string} value A CSS width value. */ set expandedWidth(value: string); /** * Gets the configured expanded panel width. * @returns {string|null} A CSS width value or null when expansion is not configured. */ get expandedWidth(): string | null; /** * Sets the physical side where the expanded panel is rendered. * @param {string} value Either "left" or "right". */ set expandedDirection(value: string); /** * Gets the physical side where the expanded panel is rendered. By default, * it is opposite to the base sliding direction. * @returns {string} Either "left" or "right". */ get expandedDirection(): string; /** * Sets the document event used to toggle the expanded panel. * @param {string} value The document event name. */ set expandedTrigger(value: string); /** * Gets the document event used to toggle the expanded panel. * @returns {string|null} The event name or null. */ get expandedTrigger(): string | null; /** * Sets the edge from which the drawer opens. * @param {'left'|'right'|'bottom'} value Supported drawer direction. */ set direction(value: "left" | "right" | "bottom"); /** * Retrieves a normalized drawer direction. * @returns {'left'|'right'|'bottom'} Configured direction or 'right'. */ get direction(): "left" | "right" | "bottom"; /** * Gets the direction used by the current responsive presentation. The * legacy mobile-presentation API is normalized to "bottom" at this boundary. * @returns {'left'|'right'|'bottom'} Effective rendering direction. */ get presentationDirection(): "left" | "right" | "bottom"; /** * Gets the effective layout variant without changing the public attribute. * @returns {'in-place'|'over'} Effective variant. */ get presentationVariant(): "in-place" | "over"; /** * Gets the frame used by the current bottom presentation. Direct bottom * drawers default to their container; the legacy responsive adapter keeps * its viewport default. * @returns {'container'|'parent'|'viewport'} Effective scope. */ get presentationScope(): "container" | "parent" | "viewport"; /** * Sets the value of the `remove-child-after-close` attribute. * This attribute determines if a child element should be removed after a close operation. * @param {boolean|string} value The value to set for the `remove-child-after-close` attribute. The value can be a boolean or a string representation of a boolean. */ set removeChildAfterClose(value: boolean | string); /** * Gets the value indicating whether the child element should be removed after closing. * * This property checks the presence of the 'remove-child-after-close' attribute on the element. * Returns `false` if the attribute does not exist. * @returns {boolean} True if the 'remove-child-after-close' attribute is present, otherwise false. */ get removeChildAfterClose(): boolean; /** * Sets the 'variant' attribute to the specified value. * @param {string} value The value to set for the 'variant' attribute. */ set variant(value: string); /** * Retrieves the value of the "variant" attribute. If the attribute is not set, * it returns the default value 'in-place'. * @returns {string} The variant value or the default value 'in-place'. */ get variant(): string; /** * Sets the screen break point value to determine responsive behavior. * @param {string} value The value to set as the screen break point. */ set screenBreakPoint(value: string); /** * Retrieves the value of the 'screen-break-point' attribute. * @returns {string} The value of the 'screen-break-point' attribute. */ get screenBreakPoint(): string; /** * Sets mobile presentation mode. * @param {string} value The mobile presentation mode. */ set mobilePresentation(value: string); /** * Gets mobile presentation mode. * @returns {string|null} The mobile presentation mode. */ get mobilePresentation(): string | null; /** * Sets the breakpoint for mobile presentation. * @param {string} value The mobile breakpoint. */ set mobileBreakPoint(value: string); /** * Gets the breakpoint for mobile presentation. * @returns {string} The mobile breakpoint. */ get mobileBreakPoint(): string; /** * Sets the duration of the animation by updating the `animation-duration` attribute. * @param {string} value The duration value for the animation, specified in a format * such as seconds (e.g., "2s") or milliseconds (e.g., "200ms"). */ set animationDuration(value: string); /** * Gets the animation duration for an element. * It retrieves the value of the 'animation-duration' attribute if present; otherwise, it defaults to '500'. * @returns {string} The value of the animation duration, either from the attribute or the default '500'. */ get animationDuration(): string; /** * Sets the easing function for the animation. * @param {string} value The easing function to use for the animation. This can be any valid CSS timing function such as "ease", "linear", "ease-in", "ease-out", etc. */ set animationEasing(value: string); /** * Retrieves the easing function for the animation. * @returns {string} The value of the 'animation-easing' attribute if set, otherwise defaults to 'linear'. */ get animationEasing(): string; /** * Determines if the element has an 'has-opacity' attribute. * @returns {boolean} True if the element has the 'has-opacity' attribute, otherwise false. */ get hasOpacity(): boolean; /** * Enables or disables the viewport backdrop. * @param {boolean} value Whether the backdrop should be enabled. */ set backdrop(value: boolean); /** * Determines whether a viewport backdrop is shown while the panel is open. * The legacy bottom-sheet adapter preserves its historical implicit backdrop * when backdrop-dismiss is present. * @returns {boolean} True when the backdrop is enabled explicitly or by legacy compatibility. */ get backdrop(): boolean; /** * Determines if the container should close when the backdrop is clicked. * @returns {boolean} True if backdrop dismiss is enabled. */ get backdropDismiss(): boolean; /** * Sets resizing for the mobile bottom sheet. * @param {boolean|string} value The value to set. */ set sheetResizable(value: boolean | string); /** * Enables resizing for the mobile bottom sheet. * @returns {boolean} True if the sheet can be resized. */ get sheetResizable(): boolean; /** * Sets the preferred bottom drawer scope. * @param {string|null} value Either "container", "parent", or "viewport". */ set scope(value: string | null); /** * Gets the preferred bottom drawer scope. * @returns {string|null} Configured scope, or null for the context default. */ get scope(): string | null; /** * Sets the mobile bottom sheet panel scope. * @param {string} value The new boundary mode for the mobile sheet. */ set sheetScope(value: string); /** * Gets the mobile bottom sheet panel scope. The backdrop always covers the viewport. * @returns {string} Either 'viewport', 'container', or 'parent'. */ get sheetScope(): string; /** * Sets the selector used for container-scoped mobile bottom sheet panels. * @param {string} value Selector for the boundary element. */ set sheetBoundary(value: string); /** * Gets the selector used for container-scoped mobile bottom sheet panels. * @returns {string|null} A CSS selector used to find the composed boundary ancestor. */ get sheetBoundary(): string | null; /** * Sets the mobile bottom sheet opening height. * @param {string} value The opening height. */ set sheetHeight(value: string); /** * Gets the mobile bottom sheet opening height. * @returns {string|null} The opening height. */ get sheetHeight(): string | null; /** * Sets the minimum mobile bottom sheet height while resizing. * @param {string} value The minimum height. */ set sheetMinHeight(value: string); /** * Gets the minimum mobile bottom sheet height while resizing. * @returns {string|null} The minimum height. */ get sheetMinHeight(): string | null; /** * Sets the maximum mobile bottom sheet height while resizing. * @param {string} value The maximum height. */ set sheetMaxHeight(value: string); /** * Gets the maximum mobile bottom sheet height while resizing. * @returns {string|null} The maximum height. */ get sheetMaxHeight(): string | null; /** * Sets the value of the 'add-to-height' attribute. * This attribute is used to modify or adjust the height dynamically. * @param {string} value The value to be assigned to the 'add-to-height' attribute. */ set addToHeight(value: string); /** * Retrieves the value of the 'add-to-height' attribute from the element. * If the attribute is not set, it defaults to '0'. * @returns {string} The value of the 'add-to-height' attribute or '0' if the attribute is not present. */ get addToHeight(): string; /** * Determines whether the current state is open. * @returns {boolean} True if the state is open, otherwise false. */ get isOpen(): boolean; /** * Determines whether the optional expanded panel is currently open. * @returns {boolean} True when expanded. */ get isExpanded(): boolean; /** * Starts observing viewport size changes. The observer is intentionally kept * alive across attribute redraws and is stopped only when the host disconnects. */ startResizeObservation(): void; /** * Stops viewport size observation. */ stopResizeObservation(): void; /** * Applies the responsive presentation when the viewport changes. * @param {ResizeObserverEntry[]} entries Resize observer entries. */ handleViewportResize: (entries: ResizeObserverEntry[]) => void; /** * Binds the currently configured document trigger. */ bindTrigger(): void; /** * Unbinds the trigger name that was actually registered. */ unbindTrigger(): void; /** * Binds the optional document trigger used by the expanded panel. */ bindExpandedTrigger(): void; /** * Unbinds the expanded trigger that was actually registered. */ unbindExpandedTrigger(): void; /** * Executes before drawing the element. */ beforeDraw(): void; /** * Draws the component. * @param {object} context The context for drawing. * @param {object} store The store for drawing. * @param {object} params The parameters for drawing. * @returns {DocumentFragment} */ draw(context: object, store: object, params: object): DocumentFragment; sheetHandleArea: HTMLDivElement; /** * Performs actions after the element is drawn on the screen. * Attaches an event listener to the document based on the specified trigger. * Sets the variant to "over" if the document width is smaller than the screen break point. * Calls the checkForVariant method with the current variant. */ afterDraw(): void; /** * Returns whether the effective direction uses bottom drawer presentation. * @returns {boolean} */ usesBottomPresentation(): boolean; /** * Returns whether the legacy responsive bottom-sheet adapter is active. * This distinction is used only for backwards-compatible backdrop behavior; * new bottom drawers should use direction="bottom" and an explicit backdrop. * @returns {boolean} True when the legacy adapter is active below its breakpoint. */ usesLegacyBottomSheetPresentation(): boolean; /** * Returns whether the current effective presentation is a bottom drawer. * Kept as a public compatibility alias for existing applications. * @returns {boolean} True for direct and responsive bottom presentations. */ isBottomSheet(): boolean; /** * Handles backdrop click dismissal. * @param {MouseEvent} e The click event. */ handleBackdropClick: (e: MouseEvent) => void; /** * Keeps closed base content out of pointer and keyboard interaction. * @param {boolean} isInteractive Whether the base panel is available. */ setBaseInteractionState(isInteractive: boolean): void; /** * Sync ARIA attributes on host. */ syncAria(): void; /** * Creates and returns a styled close button element with an icon, * including an event listener to trigger the close method. * @returns {HTMLElement} The close button element configured with styles, an icon, and event listener. */ htmlCloseButton(): HTMLElement; /** * Creates the mobile bottom sheet resize handle. * @returns {HTMLElement} The resize handle element. */ htmlSheetHandle(): HTMLElement; /** * Retrieves the parent element of the current element. * If the parent element is not found, it attempts to find the root host element. * @returns {Element|null} The parent element or the root host element if no parent exists. Returns null if neither is found. */ getParentElement(): Element | null; /** * Finds the closest element across shadow DOM boundaries. * @param {string} selector The selector to match. * @returns {Element|null} The matched composed ancestor. */ getClosestComposedElement(selector: string): Element | null; /** * Returns the viewport frame. * @returns {{top: number, left: number, right: number, bottom: number, width: number, height: number}} */ getViewportFrame(): { top: number; left: number; right: number; bottom: number; width: number; height: number; }; /** * Returns the element that bounds the mobile bottom sheet panel. * @returns {Element|null} The scope element, or null for viewport scope. */ getBottomScopeElement(): Element | null; /** * Returns the frame used by the mobile bottom sheet panel. * @returns {{top: number, left: number, right: number, bottom: number, width: number, height: number}} */ getBottomScopeFrame(): { top: number; left: number; right: number; bottom: number; width: number; height: number; }; /** * Applies a fixed frame to a bottom sheet layer. * @param {HTMLElement|SlidingContainer} element The element to update. * @param {object} frame The frame to apply. */ setBottomLayerFrame(element: HTMLElement | SlidingContainer, frame: object): void; /** * Removes fixed frame styles from a bottom sheet layer. * @param {HTMLElement|SlidingContainer} element The element to reset. */ resetBottomLayerFrame(element: HTMLElement | SlidingContainer): void; /** * Adjusts the position and dimensions of the current element based on the specified variant. * * The method handles modifications to the element's positioning style, aligns it relative to its parent, * and manages alignment to its siblings based on the specified direction. * @param {string} variant The variant to determine how the element should be updated. For example, when set to 'over', specific adjustments to the position and size are performed. * @returns {void} No value is returned, the method modifies the element's style properties directly. */ checkForVariant(variant: string): void; /** * Stores an inline style value so side overlay layout can restore it later. * @param {CSSStyleDeclaration} style The style declaration to read. * @param {string} property The CSS property name. * @returns {string} The original inline value. */ getInlineStyleValue(style: CSSStyleDeclaration, property: string): string; /** * Restores an inline style value previously owned by the consumer. * @param {CSSStyleDeclaration} style The style declaration to update. * @param {string} property The CSS property name. * @param {string} value The original inline value. */ restoreInlineStyleValue(style: CSSStyleDeclaration, property: string, value: string): void; /** * Applies fixed positioning used by the side overlay variant. */ setSideOverVariant(): void; /** * Restores styles changed by the side overlay variant. */ resetSideOverVariant(): void; /** * Returns whether the named expanded slot contains renderable content. * @returns {boolean} True when expanded content is assigned. */ hasExpandedContent(): boolean; /** * Returns the rendered base width in pixels. * @returns {number} The base panel width. */ getBaseWidthInPixels(): number; /** * Resolves expanded-width through browser layout. Percentages are resolved * against the base panel width because the probe lives in the panels anchor. * @returns {number} The expanded panel width in pixels, or zero when invalid. */ resolveExpandedWidth(): number; /** * Positions the expanded clip next to the requested physical side. * @param {number} baseWidth Base panel width in pixels. */ positionExpandedPanel(baseWidth: number): void; /** * Returns whether the expanded panel replaces the base panel in the page * flow. This happens when it opens on the outer side of the component. The * outer side is opposite to the base panel's sliding direction. * @returns {boolean} True when the expanded panel owns the flow reservation. */ swapsExpandedFlowPanel(): boolean; /** * Resolves the panels anchor offset for the expanded in-place layout. * @param {number} baseWidth Base panel width in pixels. * @param {number} expandedWidth Expanded panel width in pixels. * @returns {number} Anchor offset from the host's left edge. */ getExpandedAnchorLeft(baseWidth: number, expandedWidth: number): number; /** * Restores the base panels anchor used by the existing side presentation. */ resetPanelsAnchor(): void; /** * Makes expanded content available to assistive technology and interaction. */ showExpandedContent(): void; /** * Hides expanded content without detaching its slotted DOM. */ hideExpandedContent(): void; /** * Applies a settled expanded or base-only layout. * @param {boolean} isExpanded Whether the expanded panel is open. * @param {number} [baseWidth] Base panel width in pixels. * @param {number} [expandedWidth] Expanded panel width in pixels. */ applyExpandedState(isExpanded: boolean, baseWidth?: number, expandedWidth?: number): void; /** * Returns whether the expanded panel can fit in the current browser viewport. * @returns {boolean} True when expansion is available. */ canExpand(): boolean; /** * Reapplies expanded geometry after an observed attribute redraw. */ syncExpandedAfterDraw(): void; /** * Collapses expansion when viewport or responsive mode makes it unavailable. */ handleExpandedViewportChange(): void; /** * Applies the mobile bottom sheet layout. */ applyBottomPresentation(): void; /** * Removes layout styles managed by the mobile bottom sheet mode. */ resetBottomPresentation(): void; /** * Applies the current visual open or closed state to the mobile bottom sheet. * @param {boolean} isOpen True when the sheet should be visible. */ setBottomVisualState(isOpen: boolean): void; /** * Gets the CSS height limit used for the mobile bottom sheet. * @returns {string} The CSS max height. */ getSheetMaxHeight(): string; /** * Applies the configured bottom sheet opening height. */ setSheetHeight(): void; /** * Resolves the sheet minimum height in pixels. * @returns {number} The minimum height. */ getSheetMinHeightInPixels(): number; /** * Resolves the sheet maximum height in pixels. * @returns {number} The maximum height. */ getSheetMaxHeightInPixels(): number; /** * Returns available height for the bottom sheet scope. * @returns {number} Pixel height that can be used inside the current sheet frame. */ getBottomAvailableHeight(): number; /** * Stops a handle interaction from dismissing the bottom sheet. * @param {Event} e The interaction emitted by the resize handle. */ stopSheetHandleEvent: (e: Event) => void; /** * Checks whether an event came from the resize handle. * @param {Event} e The event to check. * @returns {boolean} True when the event belongs to the resize handle. */ isSheetHandleEvent(e: Event): boolean; /** * Checks whether an event happened inside the visible bottom sheet. * @param {Event} e The event to check. * @returns {boolean} True when the event coordinates are inside the sheet. */ isEventInsideSheet(e: Event): boolean; /** * Prevents scroll events from reaching the page behind the bottom sheet. * @param {Event} e The scroll event. */ preventBackdropScroll: (e: Event) => void; /** * Stores the initial drag state for the mobile bottom sheet. * @param {number|string} pointerId The pointer identifier. * @param {number} startY The starting Y coordinate. */ startSheetDrag(pointerId: number | string, startY: number): void; animation: any; nativeAnimation: any; /** * Applies a new height while the bottom sheet is being dragged. * @param {number} clientY The current Y coordinate. */ updateSheetDrag(clientY: number): void; /** * Starts mobile bottom sheet resizing. * @param {PointerEvent} e The pointer event. */ handleSheetDragStart: (e: PointerEvent) => void; /** * Starts mobile bottom sheet resizing from a touch event. * @param {TouchEvent} e The touch event. */ handleSheetTouchStart: (e: TouchEvent) => void; /** * Starts tracking a possible backdrop dismiss tap. * @param {PointerEvent} e The pointer event. */ handleBackdropPointerStart: (e: PointerEvent) => void; /** * Tracks movement during a possible backdrop dismiss tap. * @param {PointerEvent} e The pointer event. */ handleBackdropPointerMove: (e: PointerEvent) => void; /** * Finishes a possible backdrop dismiss tap. * @param {PointerEvent} e The pointer event. */ handleBackdropPointerEnd: (e: PointerEvent) => void; /** * Cancels a possible backdrop dismiss tap. */ handleBackdropPointerCancel: () => void; /** * Resizes the mobile bottom sheet during dragging. * @param {PointerEvent} e The pointer event. */ handleSheetDragMove: (e: PointerEvent) => void; /** * Resizes the mobile bottom sheet during touch dragging. * @param {TouchEvent} e The touch event. */ handleSheetTouchMove: (e: TouchEvent) => void; /** * Ends mobile bottom sheet resizing. * @param {PointerEvent} e The pointer event. */ handleSheetDragEnd: (e: PointerEvent) => void; /** * Ends mobile bottom sheet resizing from a touch event. * @param {TouchEvent} e The touch event. */ handleSheetTouchEnd: (e: TouchEvent) => void; /** * Cleans up mobile bottom sheet resizing listeners. */ endSheetDrag(): void; /** * Triggers the event based on the target element. * If the target element is different from the last caller, it refreshes the children by calling the `open` method. * If the target element is the same as the last caller, it toggles the state by calling the `toggle` method. * @param {Event} e The event object. */ triggerEvent: (e: Event) => Promise; /** * Toggles the expanded panel from its optional document trigger. * @param {Event} e The event that triggered expansion. */ expandedTriggerEvent: (e: Event) => Promise; /** * Executes before the expanded panel opens. * @param {Event} [e] The triggering event. */ beforeExpand(e?: Event): void; /** * Executes after the expanded panel opens. * @param {Event} [e] The triggering event. */ afterExpand(e?: Event): void; /** * Executes before the expanded panel closes. * @param {Event} [e] The triggering event. */ beforeCollapse(e?: Event): void; /** * Executes after the expanded panel closes. * @param {Event} [e] The triggering event. */ afterCollapse(e?: Event): void; /** * Cancels the active expanded transition and settles its promise as interrupted. */ cancelExpandedTransition(): void; /** * Completes a specific expanded transition and applies its settled geometry. * @param {object} transition The active transition record. */ completeExpandedTransition(transition: object): void; /** * Immediately completes an in-flight expanded transition before a redraw. */ finishExpandedTransitionImmediately(): void; /** * Animates the optional expanded panel to its requested state. * @param {boolean} target True to expand, false to collapse. * @param {number} baseWidth Base panel width in pixels. * @param {number} expandedWidth Expanded panel width in pixels. * @returns {Promise} True when the transition completed. */ animateExpandedTransition(target: boolean, baseWidth: number, expandedWidth: number): Promise; /** * Opens the optional expanded panel when it can fit in the viewport. * @param {Event} [e] The event that requested expansion. * @returns {Promise} True when expanded, otherwise false. */ expand(e?: Event): Promise; /** * Closes only the optional expanded panel and keeps its slotted DOM mounted. * @param {Event} [e] The event that requested collapse. * @returns {Promise} True when the panel collapsed, otherwise false. */ collapse(e?: Event): Promise; /** * Toggles only the optional expanded panel. * @param {Event} [e] The event that requested the toggle. * @returns {Promise} The result of expand or collapse. */ toggleExpanded(e?: Event): Promise; /** * Immediately resets expansion without detaching consumer-owned slot content. * @returns {void} */ resetExpanded(): void; /** * Executes before the element is opened. */ beforeOpen(e: any): void; /** * Callback function called after the element is opened. */ afterOpen(e: any): void; /** * Executes before closing the element. */ beforeClose(e: any): void; /** * Callback function that is called after the container is closed. */ afterClose(e: any): void; /** * Returns animation options shared by side and bottom-sheet transitions. * @returns {object} Web Animation options. */ getAnimationOptions(): object; /** * Settles the currently running base open/close transition before its DOM is * redrawn or disconnected. This prevents a delayed Web Animations cancel * callback from mutating a newer transition. */ finishBaseTransitionImmediately(): void; /** * Applies a settled visual state to the side presentation. * @param {boolean} isOpen True when the panel is open. */ setSideVisualState(isOpen: boolean): void; /** * Animates the transition of elements with specified options, toggling the visibility and/or dimensions * of the associated elements based on their current state. * * This method handles both forward and reverse animations for two elements (`transparentDiv` and `nativeElement`) * with optional opacity changes. It ensures smooth transitioning by canceling any previous animations on the provided * elements before initiating a new animation sequence. * @returns {Promise} A promise that resolves when the transition animation is completed. */ doAnimateTransition(): Promise; /** * Animates the mobile bottom sheet and its backdrop. * @param {object} options Web Animation options. * @returns {Promise} */ doAnimateBottomTransition(options: object): Promise; /** * Opens the sliding container by performing necessary preparatory and transitional operations. * @param {Event} e The event that triggered the open operation. * @returns {Promise} A promise that resolves when the open operation, including animations and subsequent handlers, is complete. */ open(e: Event): Promise; /** * Closes the sliding container and performs associated operations such as animations and event dispatches. * @param {Event} e The event object associated with the close action. * @returns {Promise} A promise that resolves when the closing operation, including animations and child element removal, is completed. */ close(e: Event): Promise; /** * Forces the closed visual state for the mobile bottom sheet. */ setBottomClosedState(): void; /** * Toggles the state between open and closed. * @param {Event} e The event object triggering the toggle. * @returns {Promise} A promise that resolves once the toggle operation (open or close) is complete. */ toggle(e: Event): Promise; }