import { BasePlugin } from '../base';
export declare const PLUGIN_KEY = "emptyDataState";
export declare const PLUGIN_PRIORITY = 370;
/**
* @plugin EmptyDataState
* @class EmptyDataState
*
* @description
* The empty data state plugin provides a empty data state overlay system for Handsontable.
* It displays a empty data state overlay with customizable message.
*
* In order to enable the empty data state mechanism, {@link Options#emptyDataState} option must be set to `true`.
*
* When [[Options#dataProvider]] is enabled, the loading overlay is toggled from DataProvider fetch hooks
* ([[Hooks#beforeDataProviderFetch]], [[Hooks#afterDataProviderFetch]], [[Hooks#afterDataProviderFetchError]]).
*
* The plugin provides several configuration options to customize the empty data state behavior and appearance:
* - `message`: Message to display in the empty data state overlay.
* - `title`: Title to display in the empty data state overlay.
* - `description`: Description to display in the empty data state overlay.
* - `buttons`: Buttons to display in the empty data state overlay.
* - `text`: Text to display in the button.
* - `type`: Type of the button.
* - `callback`: Callback function to call when the button is clicked.
*
* @example
* ::: only-for javascript
* ```javascript
* // Enable empty data state plugin with default messages
* emptyDataState: true,
*
* // Enable empty data state plugin with custom message
* emptyDataState: {
* message: 'No data available',
* },
*
* // Enable empty data state plugin with custom message and buttons for any source
* emptyDataState: {
* message: {
* title: 'No data available',
* description: 'There’s nothing to display yet.',
* buttons: [{ text: 'Reset filters', type: 'secondary', callback: () => {} }],
* },
* },
*
* // Enable empty data state plugin with custom message and buttons for specific source
* emptyDataState: {
* message: (source) => {
* switch (source) {
* case "filters":
* return {
* title: 'No data available',
* description: 'There’s nothing to display yet.',
* buttons: [{ text: 'Reset filters', type: 'secondary', callback: () => {} }],
* };
* case "loading":
* return {
* title: 'Loading data',
* description: 'Please wait.',
* };
* default:
* return {
* title: 'No data available',
* description: 'There’s nothing to display yet.',
* };
* }
* },
* },
* ```
* :::
*
* ::: only-for react
* ```jsx
* // Enable empty data state plugin with default messages
* ;
*
* // Enable empty data state plugin with custom message
* ;
*
* // Enable empty data state plugin with custom message and buttons for any source
* {} }],
* }
* }} />;
*
* // Enable empty data state plugin with custom message and buttons for specific source
* {
* switch (source) {
* case "filters":
* return {
* title: 'No data available',
* description: 'There’s nothing to display yet.',
* buttons: [{ text: 'Reset filters', type: 'secondary', callback: () => {} }],
* };
* case "loading":
* return {
* title: 'Loading data',
* description: 'Please wait.',
* };
* default:
* return {
* title: 'No data available',
* description: 'There’s nothing to display yet.',
* };
* }
* }
* }} />;
* ```
* :::
*
* ::: only-for angular
* ```ts
* // Enable empty data state plugin with default messages
* hotSettings: Handsontable.GridSettings = {
* emptyDataState: true
* }
*
* // Enable empty data state plugin with custom message
* hotSettings: Handsontable.GridSettings = {
* emptyDataState: {
* message: 'No data available'
* }
* }
*
* // Enable empty data state plugin with custom message and buttons for any source
* hotSettings: Handsontable.GridSettings = {
* emptyDataState: {
* message: {
* title: 'No data available',
* description: 'There’s nothing to display yet.',
* buttons: [{ text: 'Reset filters', type: 'secondary', callback: () => {} }],
* },
* },
* },
*
* // Enable empty data state plugin with custom message and buttons for specific source
* hotSettings: Handsontable.GridSettings = {
* emptyDataState: {
* message: (source) => {
* switch (source) {
* case "filters":
* return {
* title: 'No data available for filters',
* description: 'There’s nothing to display yet.',
* buttons: [{ text: 'Reset filters', type: 'secondary', callback: () => {} }],
* };
* case "loading":
* return {
* title: 'Loading data',
* description: 'Please wait.',
* };
* default:
* return {
* title: 'No data available',
* description: 'There’s nothing to display yet.',
* };
* }
* }
* }
* }
* ```
*
* ```html
*
* ```
* :::
*/
export declare class EmptyDataState extends BasePlugin {
#private;
/**
* Returns the plugin key used to identify this plugin in Handsontable settings.
*/
static get PLUGIN_KEY(): string;
/**
* Returns the priority order used to determine the order in which plugins are initialized.
*/
static get PLUGIN_PRIORITY(): number;
/**
* Returns the default settings applied when the plugin is enabled without explicit configuration.
*/
static get DEFAULT_SETTINGS(): {
message: string | Record | undefined;
};
/**
* Returns validator functions for each plugin setting to verify their values are valid before applying them.
*/
static get SETTINGS_VALIDATORS(): {
message: (value: unknown) => boolean;
};
/**
* Check if the plugin is enabled in the handsontable settings.
*
* @returns {boolean}
*/
isEnabled(): boolean;
/**
* Enable plugin for this Handsontable instance.
*/
enablePlugin(): void;
/**
* Update plugin state after Handsontable settings update.
*/
updatePlugin(): void;
/**
* Disable plugin for this Handsontable instance.
*/
disablePlugin(): void;
/**
* Check if the plugin is currently visible.
*
* @returns {boolean}
*/
isVisible(): boolean;
/**
* Destroy plugin instance.
*/
destroy(): void;
}