UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

164 lines (163 loc) 5.9 kB
import { EventEmitter, VNode } from "../../stencil-public-runtime"; import { EffectivePlacement, FloatingLayout, FloatingUIComponent, LogicalPlacement, OverlayPositioning, ReferenceElement } from "../../utils/floating-ui"; import { FocusTrap, FocusTrapComponent } from "../../utils/focusTrapComponent"; import { OpenCloseComponent } from "../../utils/openCloseComponent"; import { HeadingLevel } from "../functional/Heading"; import { Scale } from "../interfaces"; import { LocalizedComponent } from "../../utils/locale"; import { T9nComponent } from "../../utils/t9n"; import { PopoverMessages } from "./assets/popover/t9n"; import { LoadableComponent } from "../../utils/loadable"; /** * @slot - A slot for adding custom content. */ export declare class Popover implements FloatingUIComponent, OpenCloseComponent, FocusTrapComponent, LoadableComponent, LocalizedComponent, T9nComponent { /** * When `true`, clicking outside of the component automatically closes open `calcite-popover`s. */ autoClose: boolean; /** When `true`, display a close button within the component. */ closable: boolean; /** * When `true`, prevents flipping the component's placement when overlapping its `referenceElement`. */ flipDisabled: boolean; /** * When `true`, prevents focus trapping. */ focusTrapDisabled: boolean; handlefocusTrapDisabled(focusTrapDisabled: boolean): void; /** * When `true`, removes the caret pointer. */ pointerDisabled: boolean; /** * Defines the available placements that can be used when a flip occurs. */ flipPlacements: EffectivePlacement[]; flipPlacementsHandler(): void; /** * The component header text. */ heading: string; /** * Specifies the number at which section headings should start. */ headingLevel: HeadingLevel; /** Accessible name for the component. */ label: string; /** * Use this property to override individual strings used by the component. */ messageOverrides: Partial<PopoverMessages>; onMessagesChange(): void; /** * Made into a prop for testing purposes only * * @internal */ messages: PopoverMessages; /** * Offsets the position of the popover away from the `referenceElement`. * * @default 6 */ offsetDistance: number; offsetDistanceOffsetHandler(): void; /** * Offsets the position of the component along the `referenceElement`. */ offsetSkidding: number; offsetSkiddingHandler(): void; /** * When `true`, displays and positions the component. */ open: boolean; openHandler(value: boolean): void; /** * Determines the type of positioning to use for the overlaid content. * * Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout. * * `"fixed"` value should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`. * */ overlayPositioning: OverlayPositioning; overlayPositioningHandler(): void; /** * Determines where the component will be positioned relative to the `referenceElement`. */ placement: LogicalPlacement; placementHandler(): void; /** * The `referenceElement` used to position the component according to its `placement` value. Setting to an `HTMLElement` is preferred so the component does not need to query the DOM. However, a string `id` of the reference element can also be used. */ referenceElement: ReferenceElement | string; referenceElementHandler(): void; /** Specifies the size of the component. */ scale: Scale; /** * When `true`, disables automatically toggling the component when its `referenceElement` has been triggered. * * This property can be set to `true` to manage when the component is open. */ triggerDisabled: boolean; mutationObserver: MutationObserver; filteredFlipPlacements: EffectivePlacement[]; el: HTMLCalcitePopoverElement; effectiveLocale: string; floatingLayout: FloatingLayout; effectiveLocaleChange(): void; effectiveReferenceElement: ReferenceElement; defaultMessages: PopoverMessages; arrowEl: SVGElement; closeButtonEl: HTMLCalciteActionElement; guid: string; openTransitionProp: string; transitionEl: HTMLDivElement; hasLoaded: boolean; focusTrap: FocusTrap; connectedCallback(): void; componentWillLoad(): Promise<void>; componentDidLoad(): void; disconnectedCallback(): void; /** Fires when the component is requested to be closed and before the closing transition begins. */ calcitePopoverBeforeClose: EventEmitter<void>; /** Fires when the component is closed and animation is complete. */ calcitePopoverClose: EventEmitter<void>; /** Fires when the component is added to the DOM but not rendered, and before the opening transition begins. */ calcitePopoverBeforeOpen: EventEmitter<void>; /** Fires when the component is open and animation is complete. */ calcitePopoverOpen: EventEmitter<void>; /** * Updates the position of the component. * * @param delayed */ reposition(delayed?: boolean): Promise<void>; /** * Sets focus on the component's first focusable element. */ setFocus(): Promise<void>; /** * Updates the element(s) that are used within the focus-trap of the component. */ updateFocusTrapElements(): Promise<void>; private setTransitionEl; setFilteredPlacements: () => void; setUpReferenceElement: (warn?: boolean) => void; getId: () => string; setExpandedAttr: () => void; addReferences: () => void; removeReferences: () => void; getReferenceElement(): ReferenceElement; hide: () => void; onBeforeOpen(): void; onOpen(): void; onBeforeClose(): void; onClose(): void; storeArrowEl: (el: SVGElement) => void; renderCloseButton(): VNode; renderHeader(): VNode; render(): VNode; }