@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
59 lines (58 loc) • 2.04 kB
TypeScript
import * as React from 'react';
import { AdaptableApi } from '../../../Api/AdaptableApi';
import { AdaptableButton } from '../../../AdaptableState/Common/AdaptableButton';
import { AccessLevel } from '../../../AdaptableState/Common/Entitlement';
import { BaseContext } from '../../../types';
import { SimpleButtonProps } from '../../../components/SimpleButton';
/**
* Default variant/tone when `buttonStyle` omits them — differs by surface by design.
*/
export declare const ADAPTABLE_BUTTON_SURFACE_DEFAULTS: {
readonly dashboard: {
variant: "text";
tone: "none";
};
readonly customToolbar: {
variant: "outlined";
tone: "neutral";
};
readonly toolPanel: {
variant: "text";
tone: "none";
};
readonly customToolPanel: {
variant: "text";
tone: "none";
};
readonly actionColumn: {
variant: "text";
tone: "none";
};
};
export type AdaptableButtonSurfaceDefaults = Pick<SimpleButtonProps, 'variant' | 'tone'>;
export interface AdaptableButtonViewProps<CONTEXT extends BaseContext> {
button: AdaptableButton<CONTEXT>;
context: CONTEXT;
api: AdaptableApi;
accessLevel?: AccessLevel;
defaults?: AdaptableButtonSurfaceDefaults;
/** When true (default), re-renders after click so dynamic label/disabled/hidden update */
rerenderOnClick?: boolean;
onAfterClick?: () => void;
iconSize?: {
height: number;
width: number;
};
className?: string;
style?: React.CSSProperties;
buttonKey?: React.Key;
'data-name'?: string;
'data-text'?: string;
ariaLabel?: string;
autoFocus?: boolean;
/** Overrides `disabled` from the button definition and read-only access */
disabled?: boolean;
/** When set, invoked instead of `button.onClick` (e.g. Adaptable Form footer buttons) */
onClick?: () => void;
}
export declare function AdaptableButtonView<CONTEXT extends BaseContext>(props: AdaptableButtonViewProps<CONTEXT>): React.JSX.Element;