@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
31 lines (30 loc) • 1.54 kB
TypeScript
import * as React from 'react';
export interface KeyComboCaptureInputProps {
/** Resolved trigger to display when not recording (e.g. `+` or `shift+Enter`). */
value: string;
/** When true, `value` comes from the default/global setting (shown as a hint). */
isUsingDefault?: boolean;
/** Hint shown when there is no value and the field is not recording. */
placeholder?: string;
disabled?: boolean;
'data-name'?: string;
/** Called with a complete, valid trigger once the user records one. */
onCapture: (trigger: string) => void;
/** Reset back to the default/global trigger (clears the per-nudge override). */
onReset?: () => void;
/**
* Optional validation run on a captured trigger before committing.
* Return an error message to reject the capture (e.g. increment/decrement clash).
*/
validateCapture?: (trigger: string) => string | undefined;
}
/**
* VS Code-style keyboard shortcut recorder. While focused the field shows the
* current value and a "Hit Enter to edit" hint; pressing Enter enters edit mode
* (the value is cleared) where the next key press / combination is detected from
* the event. A valid press is persisted and edit mode ends; incomplete
* (modifier-only) and unrepresentable presses are rejected, and an optional
* `validateCapture` guards against clashes. The revert button restores the
* default once a custom value has been set.
*/
export declare const KeyComboCaptureInput: React.FunctionComponent<KeyComboCaptureInputProps>;