@itwin/appui-abstract
Version:
iTwin.js UI abstractions
98 lines • 3.88 kB
TypeScript
/** @packageDocumentation
* @module Dialog
*/
import { BeUiEvent } from "@itwin/core-bentley";
import { PropertyRecord } from "../properties/Record";
import { BaseDialogItem, DialogItem, DialogPropertyItem, DialogPropertySyncItem } from "./DialogItem";
import { PropertyChangeResult, UiDataProvider } from "./UiDataProvider";
/** Enum for button types. Determines button label, and default button style.
* @public
*/
export declare enum DialogButtonType {
None = "",
Close = "close",
OK = "ok",
Cancel = "cancel",
Yes = "yes",
No = "no",
Retry = "retry",
Next = "next",
Previous = "previous"
}
/** Enum for button style.
* @public
*/
export declare enum DialogButtonStyle {
None = "",
Primary = "iui-cta",
Hollow = "iui-default",
Blue = "iui-high-visibility"
}
/** Interface for a dialog button in a button cluster
* @public
*/
export interface DialogButtonDef {
/** type of button */
type: DialogButtonType;
/** Triggered on button click */
onClick: () => void;
/** Which button style to decorate button width */
buttonStyle?: DialogButtonStyle;
/** Disable the button */
disabled?: boolean;
/** Custom label */
label?: string;
/** Custom CSS class */
className?: string;
}
/** [[DialogRow]] is the interface that groups dialog items into rows for building UI
* @public
*/
export interface DialogRow {
priority: number;
items: DialogItem[];
}
/**
* @public
*/
export declare abstract class UiLayoutDataProvider extends UiDataProvider {
private _items;
/** Applies changes from one or more properties - some dialogs will use this to send a bulk set of changes back to the provider */
processChangesInUi(properties: DialogPropertyItem[]): PropertyChangeResult;
/** Applies change of a single property - this is the default method used when property editors are dynamically generated. */
applyUiPropertyChange: (_updatedValue: DialogPropertySyncItem) => void;
private _rows;
/** Array of dialog rows */
get rows(): DialogRow[];
protected loadItemsInternal(items: ReadonlyArray<DialogItem> | undefined): void;
/** Called by UI to request available properties that can be bound to user supplied UI components (See Tool1UiProvider for example). */
supplyDialogItems(): DialogItem[] | undefined;
get items(): ReadonlyArray<DialogItem>;
/** Called to inform listeners that new properties are ready for display in UI. */
reloadDialogItems(emitEvent?: boolean): void;
/**
* @internal
*/
layoutDialogRows(): DialogRow[];
/** Determines if a dialog item editor wants a label */
static editorWantsLabel(item: DialogItem): boolean;
/** Determines if a dialog items has an associated lock property */
static hasAssociatedLockProperty(item: DialogItem): boolean;
/** Gets the disabled state for a given dialog item */
static getItemDisabledState(baseDialogItem: BaseDialogItem): boolean;
/** Gets a property record for a given dialog item */
static getPropertyRecord: (dialogItem: BaseDialogItem) => PropertyRecord;
/** Determines if a dialog row only contains button group editors */
static onlyContainButtonGroupEditors(row: DialogRow): boolean;
}
/** [[DialogLayoutDataProvider]] Abstract class that allows property values to be passed between hosting API and Dialog that generates and arranges components dynamically
* including the buttons at the bottom of the dialog.
* @public
*/
export declare abstract class DialogLayoutDataProvider extends UiLayoutDataProvider {
onButtonsReloadedEvent: BeUiEvent<void>;
/** Called to inform listeners that modal dialog button data needs to be refreshed. */
fireDialogButtonsReloadEvent(): void;
supplyButtonData(): DialogButtonDef[] | undefined;
}
//# sourceMappingURL=UiLayoutDataProvider.d.ts.map