import { HtmlElement, HtmlElementConfig, HtmlElementInstance } from "./HtmlElement"; import type { RenderingContext } from "../ui/RenderingContext"; import type { Instance, RenderProps } from "../ui/Instance"; import { BooleanProp, StringProp, Prop } from "../ui/Prop"; import type { FormRenderingContext } from "./form/ValidationGroup"; export interface ButtonConfig extends Omit, "disabled" | "type" | "form"> { /** Confirmation text or configuration object. See MsgBox.yesNo for more details. */ confirm?: Prop | false>; /** If true button appears in pressed state. Useful for implementing toggle buttons. */ pressed?: BooleanProp; /** Name of the icon to be put on the left side of the button. */ icon?: StringProp; /** Base CSS class to be applied to the element. Default is 'button'. */ baseClass?: string; /** * Determines if button should receive focus on mousedown event. * Default is `false`, which means that focus can be set only using the keyboard `Tab` key. */ focusOnMouseDown?: boolean; /** Add type="submit" to the button. */ submit?: boolean; /** Set to `true` to disable the button. */ disabled?: BooleanProp; /** Set to `false` to disable the button. */ enabled?: BooleanProp; /** Button type. */ type?: "submit" | "button"; /** If set to `true`, the Button will cause its parent Overlay (if one exists) to close. This, however, can be prevented if `onClick` explicitly returns `false`. */ dismiss?: boolean; /** The form attribute specifies the form the button belongs to. * The value of this attribute must be equal to the `id` attribute of a `
` element in the same document. */ form?: StringProp; } export declare class Button extends HtmlElement { constructor(config?: ButtonConfig); icon?: boolean | string; focusOnMouseDown?: boolean; submit?: boolean; dismiss?: boolean; onMouseDown?: string | ((e: MouseEvent, instance: Instance) => void); baseClass: string; declareData(...args: Record[]): void; prepareData(context: RenderingContext, instance: HtmlElementInstance): void; explore(context: FormRenderingContext, instance: HtmlElementInstance): void; attachProps(context: RenderingContext, instance: HtmlElementInstance, props: RenderProps): void; } //# sourceMappingURL=Button.d.ts.map