UNPKG

@limetech/lime-elements

Version:
100 lines 3.2 kB
import { Languages } from '../date-picker/date.types'; /** * A Snackbar –also known as "Toast"– is used to inform the end user * about an action or a process in the system. * The information could vary from announcing that a process has just started, * is taking place now, has ended, or has been interrupted or canceled. * * The information that you provide using a snackbar should be: * - temporary * - contextual * - short * - and most importantly, ignorable. * * It means if the user misses the information, it shouldn't be a big deal. * * :::note * If the information you want to display has a higher importance or priority, * and you need to make sure that the user takes an action to dismiss it, * consider using the [Banner](/#/component/limel-banner/) component instead. * For more complex interactions and for delivering more detailed information, * [Dialog](/#/component/limel-dialog/) is a better choice. * ::: * * @exampleComponent limel-example-snackbar * @exampleComponent limel-example-snackbar-with-action * @exampleComponent limel-example-snackbar-with-changing-messages * @exampleComponent limel-example-snackbar-dismissible * @exampleComponent limel-example-snackbar-persistent * @exampleComponent limel-example-snackbar-persistent-non-dismissible */ export declare class Snackbar { /** * `true` if the snackbar is open, `false` otherwise. */ open: boolean; /** * The text message to display. */ message: string; /** * The amount of time in milliseconds to show the snackbar. * If set to `-1`, the snackbar will be persistent. * This means: * - either the end user will need to close it manually, * which requires the `dismissible` property to be set to `true`. * - or the snackbar needs to be closed programmatically. */ timeout?: number; /** * The text to display for the action button. */ actionText: string; /** * When `true` displays a dismiss button on the snackbar, * allowing users to close it. */ dismissible: boolean; /** * Whether to show the snackbar with space for multiple lines of text * @deprecated Setting this property no longer has any effect. The property will be removed in a future major version. */ multiline: boolean; /** * Defines the language for translations. */ language: Languages; private readonly host; /** * Emitted when the action button is pressed */ private readonly action; /** * Emitted when the snackbar hides itself */ private readonly hide; private offset; private isOpen; private closing; private readonly snackbarId; private timeoutId?; constructor(); componentDidLoad(): void; protected onChangeIndex(event: CustomEvent<number>): void; protected watchOpen(): void; /** * Show the snackbar * @deprecated Use the `open` property instead. */ show(): Promise<void>; handleOpen: () => void; private readonly handleClose; render(): any; private setAriaRoles; private readonly handleClickAction; private renderActions; private renderActionButton; private renderDismissButton; private renderTimeoutVisualization; } //# sourceMappingURL=snackbar.d.ts.map