import { EventEmitter, h } from '../../stencil-public-runtime'; import { PartialConfig } from '../../lib/config'; import { Environment } from '../../lib/environment'; import { FilterTreeOptions, SceneTreeController } from './lib/controller'; import { SceneTreeErrorDetails } from './lib/errors'; import { Row } from './lib/row'; import { FilterOptions, MetadataKey, RowArg, RowDataProvider, SceneTreeOperationOptions, ScrollToOptions, SelectItemOptions } from './types'; /** * @slot header - A slot that places content above the rows in the tree. By * default, a search toolbar will be placed in this slot. Elements can be * stacked by assigning multiple elements to this slot. * @slot footer - A slot that places content below the rows in the tree. * Elements can be stacked by assigning multiple elements to this slot. */ export declare class SceneTree { /** * The number of offscreen rows above and below the viewport to render. Having * a higher number reduces the chance of the browser not displaying a row * while scrolling. */ overScanCount: number; /** * A CSS selector that points to a `` element. Either this * property or `viewer` must be set. */ viewerSelector?: string; /** * An instance of a `` element. Either this property or * `viewerSelector` must be set. */ viewer?: HTMLVertexViewerElement | null; /** * A callback that is invoked immediately before a row is about to be rendered. * This callback can return additional data that can be bound to in a * template. * * @example * * ```html * * * * * * * * * * ``` */ rowData?: RowDataProvider; /** * An object to configure the scene tree. */ config?: PartialConfig | string; /** * Sets the default environment for the viewer. This setting is used for * auto-configuring network hosts. * * Use the `config` property for manually setting hosts. */ configEnv: Environment; controller?: SceneTreeController; /** * A set of options to configure scene tree searching behavior. */ searchOptions: FilterOptions; /** * @deprecated Use `searchOptions` * Indicates whether the metadata search should use an exact match. */ metadataSearchExactMatch: boolean; /** * @deprecated Use `searchOptions` * A list of the metadata keys that a scene tree search should be performed on. */ metadataSearchKeys: MetadataKey[]; /** * A list of part metadata keys that will be made available to each row. This * metadata can be used for data binding inside the scene tree's template. * * **Note:** for the values of these metadata keys to be evaluated for search, * they must be provided to the `metadataSearchKeys` specified in the `searchOptions`. * Otherwise, the search will only be performed against the item name. */ metadataKeys: MetadataKey[]; /** * The duration of operations with animations, in milliseconds, when a user performs * an action that results in an animation such as isolate. Defaults to 500ms. */ operationAnimationDuration: number; /** * An event that is emitted when this encounters a connection * error. */ connectionError: EventEmitter; /** * An event that is emitted when the first row of this has * been rendered. */ firstRowRendered: EventEmitter; private rows; private totalRows; private showLoader; private showEmptyResults; /** * This stores internal state that you want to preserve across live-reloads, * but shouldn't trigger a refresh if the data changes. Marking this with * @State to allow to preserve state across live-reloads. */ private stateMap; private errorDetails; private hasPartialFilterResults; private refreshingResults; private attemptingRetry; private el; private lastSelectedItemId?; private firstCellRendered; /** * Schedules a render of the rows in the scene tree. Useful if any custom * data in your scene tree has changed, and you want to update the row's * contents. * * **Note:** This is an asynchronous operation. The update may happen on the * next frame. */ invalidateRows(): Promise; /** * Scrolls the tree to the given row index. * * @param index An index of the row to scroll to. * @param options A set of options to configure the scrolling behavior. */ scrollToIndex(index: number, options?: ScrollToOptions): Promise; /** * Scrolls the tree to an item with the given ID. If the node for the item is * not expanded, the tree will expand each of its parent nodes. * * @param itemId An ID of an item to scroll to. * @param options A set of options to configure the scrolling behavior. * @returns A promise that resolves when the operation is finished. */ scrollToItem(itemId: string, options?: ScrollToOptions): Promise; /** * Performs an API call to expand all nodes in the tree. */ expandAll(): Promise; /** * Performs an API call to collapse all nodes in the tree. */ collapseAll(): Promise; /** * Performs an API call that will expand the node associated to the specified * row or row index. * * @param row A row, row index, or node to expand. */ expandItem(row: RowArg): Promise; /** * Performs an API call that will collapse the node associated to the * specified row or row index. * * @param row A row, row index, or node to collapse. */ collapseItem(row: RowArg): Promise; /** * Performs an API call that will either expand or collapse the node * associated to the given row or row index. * * @param row The row, row index, or node to collapse or expand. */ toggleExpandItem(row: RowArg): Promise; /** * Performs an API call that will either hide or show the item associated to * the given row or row index. * * @param row The row, row index, or node to toggle visibility. */ toggleItemVisibility(row: RowArg): Promise; /** * Performs an API call that will hide the item associated to the given row * or row index. * * @param row The row, row index, or node to hide. */ hideItem(row: RowArg): Promise; /** * Performs an API call that will show the item associated to the given row * or row index. * * @param row The row, row index, or node to show. */ showItem(row: RowArg): Promise; /** * Performs an API call that will select the item associated to the given row * or row index. * * This method supports a `recurseParent` option that allows for recursively * selecting the next unselected parent node. This behavior is considered * stateful. Each call to `selectItem` will track the ancestry of the passed * in `rowArg`. If calling `selectItem` with a row not belonging to the * ancestry of a previous selection, then this method will perform a standard * selection. * * @param row The row, row index or node to select. * @param options A set of options to configure selection behavior. */ selectItem(row: RowArg, { recurseParent, ...options }?: SelectItemOptions): Promise; /** * Performs an API call that will deselect the item associated to the given * row or row index. * * @param row The row, row index, or node to deselect. */ deselectItem(row: RowArg): Promise; /** * Performs an API call that will show only the item associated to * the given row or row index and fit the camera to the item's bounding box. * * @param row The row, row index, or node to isolate. */ isolateItem(row: RowArg): Promise; /** * Returns a row at the given index. If the row data has not been loaded, * returns `undefined`. * * @param index The index of the row. * @returns A row, or `undefined` if the row hasn't been loaded. */ getRowAtIndex(index: number): Promise; /** * Returns the row with the given id. If there is not a row * matching the id, returns `undefined`. * * @param itemId An ID of an item to return the row for. * @returns A row, or `undefined` if a corresponding row doesn't exist */ getRowForItemId(itemId: string): Promise; /** * Returns the row data from the given mouse or pointer event. The event must * originate from a `vertex-scene-tree-table-cell` contained by this element, * otherwise `undefined` is returned. * * @param event A mouse or pointer event that originated from this component. * @returns A row, or `undefined` if the row hasn't been loaded. */ getRowForEvent(event: MouseEvent | PointerEvent): Promise; /** * Returns the row data from the given vertical client position. * * @param clientY The vertical client position. * @returns A row or `undefined` if the row hasn't been loaded. */ getRowAtClientY(clientY: number): Promise; /** * Performs an async request that will filter the displayed items in the tree * that match the given term and options. * * @param term The filter term. * @param options The options to apply to the filter. * @returns A promise that completes when the request has completed. Note, * items are displayed asynchronously. So the displayed items may not reflect * the result of this filter when the promise completes. */ filterItems(term: string, options?: FilterTreeOptions): Promise; /** * Performs an async request that will select the filtered items in the tree * that match the given term. * * @param term The filter term. * @returns A promise that completes when the request has completed. */ selectFilteredItems(term: string, options?: SceneTreeOperationOptions): Promise; /** * Fetches the metadata keys that are available to the scene tree. Metadata * keys can be assigned to the scene tree using the `metadataKeys` property. * The scene tree will fetch this metadata and make these values available * for data binding. * * @returns A promise that resolves with the names of available keys. */ fetchMetadataKeys(): Promise; /** * @ignore */ protected disconnectedCallback(): void; /** * @ignore */ protected connectedCallback(): void; /** * @ignore */ protected componentWillLoad(): void; /** * @ignore */ protected componentDidLoad(): Promise; componentWillRender(): void; /** * @ignore */ protected render(): h.JSX.IntrinsicElements; private renderError; /** * @ignore */ protected handleViewerChanged(newViewer: HTMLVertexViewerElement | undefined, oldViewer: HTMLVertexViewerElement | undefined): void; /** * @ignore */ protected handleControllerChanged(newController: SceneTreeController): void; /** * @ignore */ protected handleMetadataKeysChanged(): void; private retryConnectToViewer; private connectToViewer; private scheduleClearUnusedData; private handleControllerStateChange; private getNodeFromRowOrIndex; private performRowOperation; protected handleSearch(event: CustomEvent): Promise; protected handleCellLoaded(): Promise; private getScrollToPosition; private getConfig; private ensureLayoutDefined; private updateLayoutElement; private getLayoutElement; private getMetadataSearchKeys; }