UNPKG

@itwin/presentation-components

Version:

React components based on iTwin.js Presentation library

73 lines 3.25 kB
/** @packageDocumentation * @module InstancesFilter */ import "./PresentationInstanceFilterDialog.scss"; import { ReactNode } from "react"; import { IModelConnection } from "@itwin/core-frontend"; import { Descriptor, Keys } from "@itwin/presentation-common"; import { PresentationInstanceFilterInfo } from "./PresentationFilterBuilder.js"; /** * Data structure that describes source to gather properties from. * @public */ export interface PresentationInstanceFilterPropertiesSource { /** * [Descriptor]($presentation-common) that will be used to get properties. */ descriptor: Descriptor; /** * [Keys]($presentation-common) of filterables on which the filter was called. * These keys should match the keys that were used to create the descriptor. */ inputKeys?: Keys; } /** * Props for [[PresentationInstanceFilterDialog]] component. * @public */ export interface PresentationInstanceFilterDialogProps { /** iModel connection to pull data from. */ imodel: IModelConnection; /** * Specifies how deep rule groups can be nested. * @deprecated in 5.0. Rule groups nesting was removed from [PropertyFilterBuilderRenderer]($components-react) */ ruleGroupDepthLimit?: number; /** Specifies whether dialog is open or not. */ isOpen: boolean; /** Callback that is invoked when 'Apply' button is clicked. */ onApply: (filter?: PresentationInstanceFilterInfo) => void; /** Callback that is invoked when 'Close' button is clicked or dialog is closed. */ onClose?: () => void; /** Callback that is invoked when 'Reset' button is clicked. */ onReset?: () => void; /** Renderer that will be used to render a custom toolbar instead of the default one. */ toolbarButtonsRenderer?: (toolbarHandlers: FilteringDialogToolbarHandlers) => ReactNode; /** * [[PresentationInstanceFilterPropertiesSource]] that will be used in [[InstanceFilterBuilder]] component to populate properties. * * This property can be set to function in order to lazy load [[PresentationInstanceFilterPropertiesSource]] when dialog is opened. */ propertiesSource: (() => Promise<PresentationInstanceFilterPropertiesSource>) | PresentationInstanceFilterPropertiesSource | undefined; /** Renders filter results count. */ filterResultsCountRenderer?: (filter: PresentationInstanceFilterInfo) => ReactNode; /** Dialog title. */ title?: React.ReactNode; /** Initial filter that will be show when component is mounted. */ initialFilter?: PresentationInstanceFilterInfo | ((descriptor: Descriptor) => PresentationInstanceFilterInfo); } /** * Set of action handlers that are passed to [[PresentationInstanceFilterDialogProps.toolbarButtonsRenderer]] for rendering custom buttons. * @public */ export interface FilteringDialogToolbarHandlers { handleApply: () => void; handleClose: () => void; handleReset: () => void; } /** * Dialog component that renders [[InstanceFilterBuilder]] inside. * @public */ export declare function PresentationInstanceFilterDialog(props: PresentationInstanceFilterDialogProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=PresentationInstanceFilterDialog.d.ts.map