import { Component, ReactElement } from 'react'; import type { OptionsProps, OptionsSeparatorProps } from '@instructure/ui-options/v11_6'; import { Popover } from '@instructure/ui-popover/v11_6'; import type { SelectableRender } from '@instructure/ui-selectable'; import { DrilldownSeparator } from './DrilldownSeparator'; import { DrilldownOption } from './DrilldownOption'; import type { DrilldownOptionValue } from './DrilldownOption/props'; import { DrilldownGroup } from './DrilldownGroup'; import type { DrilldownGroupProps, GroupChildren } from './DrilldownGroup/props'; import { DrilldownPage } from './DrilldownPage'; import type { DrilldownPageProps, PageChildren } from './DrilldownPage/props'; import { SelectedGroupOptionsMap } from './props'; import type { DrilldownProps, DrilldownStyleProps, DrilldownState, PageChild, OptionChild, GroupChild, SeparatorChild } from './props'; type OptionData = { groupProps?: DrilldownGroupProps; }; type MappedOption = OptionChild & OptionData & { index: number; }; type MappedPage = DrilldownPageProps & { children: PageChildren[]; }; type PageMap = Record; /** --- category: components --- **/ declare class Drilldown extends Component { static readonly componentId = "Drilldown"; static allowedProps: readonly (keyof { rootPageId: string; children?: PageChild | PageChild[]; id?: string; label?: string; disabled?: boolean; rotateFocus?: boolean; as?: import("@instructure/shared-types").AsElementType; role?: string; elementRef?: (el: Element | null) => void; drilldownRef?: (el: HTMLDivElement | null) => void; overflowX?: "auto" | "hidden" | "visible"; overflowY?: "auto" | "hidden" | "visible"; height?: string | number; width?: string | number; minHeight?: string | number; minWidth?: string | number; maxHeight?: string | number; maxWidth?: string | number; trigger?: React.ReactNode; placement?: import("@instructure/ui-position").PlacementPropValues; defaultShow?: boolean; show?: boolean; onToggle?: (event: React.UIEvent | React.FocusEvent, args: { shown: boolean; drilldown: Drilldown; pageHistory: string[]; goToPage: (pageId: string) => { prevPageId: string; newPageId: string; } | undefined; goToPreviousPage: () => { prevPageId: string; newPageId: string; } | undefined; }) => void; onSelect?: (event: React.SyntheticEvent, args: { value: DrilldownOptionValue | DrilldownOptionValue[]; isSelected: boolean; selectedOption: OptionChild; drilldown: Drilldown; }) => void; onDismiss?: (event: React.UIEvent | React.FocusEvent, documentClick: boolean) => void; onFocus?: (event: React.FocusEvent) => void; onMouseOver?: (event: React.MouseEvent) => void; popoverRef?: (el: Popover | null) => void; mountNode?: import("@instructure/ui-position").PositionMountNode; positionTarget?: import("@instructure/ui-position").PositionMountNode; positionContainerDisplay?: "inline-block" | "block"; constrain?: import("@instructure/ui-position").PositionConstraint; shouldHideOnSelect?: boolean; shouldContainFocus?: boolean; shouldReturnFocus?: boolean; withArrow?: boolean; offsetX?: string | number; offsetY?: string | number; shouldSetAriaExpanded?: boolean; })[]; static defaultProps: { disabled: boolean; rotateFocus: boolean; as: string; role: string; overflowX: string; overflowY: string; placement: string; defaultShow: boolean; shouldHideOnSelect: boolean; shouldContainFocus: boolean; shouldReturnFocus: boolean; withArrow: boolean; offsetX: number; offsetY: number; shouldSetAriaExpanded: boolean; }; static Group: typeof DrilldownGroup; static Option: typeof DrilldownOption; static Page: typeof DrilldownPage; static Separator: typeof DrilldownSeparator; private _drilldownRef; private _popover; private _trigger; private _containerElement; readonly _id: string; readonly _triggerId: string; readonly _headerBackId: string; readonly _headerTitleId: string; readonly _headerTitleLabelId: string; readonly _headerActionId: string; private readonly _pageHistory; _activeOptionsMap: { [optionId: string]: MappedOption; }; ref: HTMLDivElement | Element | null; handleRef: (el: HTMLDivElement | Element | null) => void; handleDrilldownRef: (el: Element | null) => void; constructor(props: DrilldownProps); componentDidMount(): void; componentDidUpdate(_prevProps: DrilldownProps, prevState: DrilldownState): void; get makeStylesVariables(): DrilldownStyleProps; get activeOptionIds(): string[]; get activeOptions(): MappedOption[]; get pages(): PageChild[]; get pageMap(): PageMap | undefined; get isOnRootPage(): boolean; get currentPage(): MappedPage | undefined; get previousPage(): MappedPage | undefined; get exposedNavigationProps(): { pageHistory: string[]; goToPage: (newPageId: string) => { prevPageId: string; newPageId: string; } | undefined; goToPreviousPage: () => { newPageId: string; prevPageId: string; } | undefined; }; get currentPageAriaLabel(): string | undefined; getChildrenArray(children?: C | C[]): C[]; getPageById(id?: string): MappedPage | undefined; getPageChildById(id?: string): MappedOption | undefined; getNormalizedMap(map: Map): [string, DrilldownOptionValue][]; /** * Initializes the map of selected options for each group on initial render. * * This function establishes the selection state based on a clear precedence: * 1. **Controlled Mode**: If a `Drilldown.Group` has the `selectedOptions` prop * (as an array), it is treated as the absolute source of truth. * * 2. **Uncontrolled Mode**: If `selectedOptions` is not provided, the selection * is determined by `defaultSelected` props, with the following priority: * a. The `defaultSelected` boolean on an individual `Drilldown.Option`. * b. The `defaultSelected` array of values on the `Drilldown.Group`. * * It also validates that 'single' selection groups do not mistakenly receive * multiple selected or default values. * * @returns {SelectedGroupOptionsMap} An object where keys are group IDs and * values are Maps of the selected { optionId: optionValue } pairs for that group. */ getSelectedGroupOptionsMap(): SelectedGroupOptionsMap; get selectedGroupOptionIdsArray(): string[]; get headerChildren(): PageChildren[]; get shown(): boolean; containsDuplicateChild(children: PageChildren[]): boolean; show: (event: React.SyntheticEvent) => void; hide: (event: React.SyntheticEvent) => void; reset(): void; focus(): void; focused(): boolean; focusOption(id: string): void; handleOptionHighlight: (_event: React.SyntheticEvent, { id, direction }: { id?: string; direction?: -1 | 1; }) => void; goToPage: (newPageId: string) => { prevPageId: string; newPageId: string; } | undefined; goToPreviousPage: () => { newPageId: string; prevPageId: string; } | undefined; handleBackButtonClick: () => void; handleGroupOptionSelected(event: React.SyntheticEvent, selectedOption: MappedOption): void; handleOptionSelect: (event: React.SyntheticEvent, { id }: { id?: string; }) => void; handleKeyDown: (event: React.KeyboardEvent) => void; handleToggle: (event: React.UIEvent | React.FocusEvent, shown: boolean) => void; getFirstOption: () => OptionChild | undefined; renderList(getOptionProps: SelectableRender['getOptionProps'], getDisabledOptionProps: SelectableRender['getDisabledOptionProps']): (import("@emotion/react/jsx-runtime").JSX.Element | (ReactElement> | ReactElement>)[] | null)[] | null; renderSeparator(separator: SeparatorChild): import("@emotion/react/jsx-runtime").JSX.Element; renderOption(option: OptionChild, getOptionProps: SelectableRender['getOptionProps'], getDisabledOptionProps: SelectableRender['getDisabledOptionProps'], groupProps?: DrilldownGroupProps): import("@emotion/react/jsx-runtime").JSX.Element | null; renderGroup(group: GroupChild, getOptionProps: SelectableRender['getOptionProps'], getDisabledOptionProps: SelectableRender['getDisabledOptionProps'], needsFirstSeparator: boolean, needsLastSeparator: boolean): (ReactElement> | ReactElement>)[] | null; renderPage(): import("@emotion/react/jsx-runtime").JSX.Element | null; render(): import("@emotion/react/jsx-runtime").JSX.Element | null; } export default Drilldown; export { Drilldown }; //# sourceMappingURL=index.d.ts.map