@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
120 lines (119 loc) • 3.53 kB
TypeScript
import { EventEmitter, VNode } from "../../stencil-public-runtime";
import { ConditionalSlotComponent } from "../../utils/conditionalSlot";
import { InteractiveComponent } from "../../utils/interactive";
import { OpenCloseComponent } from "../../utils/openCloseComponent";
import { FlipContext, Scale, SelectionMode } from "../interfaces";
import { TreeItemSelectDetail } from "./interfaces";
/**
* @slot - A slot for adding text.
* @slot children - A slot for adding nested `calcite-tree` elements.
* @slot actions-end - A slot for adding actions to the end of the component. It is recommended to use two or fewer actions.
*/
export declare class TreeItem implements ConditionalSlotComponent, InteractiveComponent, OpenCloseComponent {
el: HTMLCalciteTreeItemElement;
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
*/
disabled: boolean;
/** When `true`, the component is expanded. */
expanded: boolean;
/** When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`). */
iconFlipRtl: FlipContext;
/** Specifies an icon to display at the start of the component. */
iconStart: string;
/** When `true`, the component is selected. */
selected: boolean;
expandedHandler(newValue: boolean): void;
/**
* @internal
*/
parentExpanded: boolean;
/**
* @internal
*/
depth: number;
/**
* @internal
*/
hasChildren: boolean;
/**
* @internal
*/
lines: boolean;
/**
* @internal
*/
scale: Scale;
/**
* In ancestor selection mode, show as indeterminate when only some children are selected.
*
* @internal
*/
indeterminate: boolean;
/**
* @internal
*/
selectionMode: SelectionMode;
getselectionMode(): void;
openTransitionProp: string;
transitionProp: string;
/**
* Specifies element that the transition is allowed to emit on.
*/
transitionEl: HTMLDivElement;
/**
* Defines method for `beforeOpen` event handler.
*/
onBeforeOpen(): void;
/**
* Defines method for `open` event handler:
*/
onOpen(): void;
/**
* Defines method for `beforeClose` event handler:
*/
onBeforeClose(): void;
/**
* Defines method for `close` event handler:
*/
onClose(): void;
connectedCallback(): void;
disconnectedCallback(): void;
componentWillRender(): void;
componentWillLoad(): void;
componentDidLoad(): void;
componentDidRender(): void;
private isSelectionMultiLike;
render(): VNode;
setTransitionEl(el: HTMLDivElement): void;
onClick(event: Event): void;
iconClickHandler: (event: MouseEvent) => void;
childrenClickHandler: (event: MouseEvent) => void;
keyDownHandler(event: KeyboardEvent): void;
/**
* @internal
*/
calciteInternalTreeItemSelect: EventEmitter<TreeItemSelectDetail>;
/**
* Used to make sure initially expanded tree-item can properly
* transition and emit events from closed state when rendered.
*
* @private
*/
updateAfterInitialRender: boolean;
childrenSlotWrapper: HTMLElement;
defaultSlotWrapper: HTMLElement;
actionSlotWrapper: HTMLElement;
private parentTreeItem?;
hasEndActions: boolean;
private isActionEndEvent;
private updateParentIsExpanded;
/**
* This is meant to be called in `componentDidLoad` in order to take advantage of the hierarchical component lifecycle
* and help check for item selection as items are initialized
*
* @private
*/
private updateAncestorTree;
private actionsEndSlotChangeHandler;
}