@yuntijs/ui
Version:
☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps
49 lines (48 loc) • 1.65 kB
TypeScript
import { type InitialConfigType } from '@lexical/react/LexicalComposer';
import React, { PropsWithChildren } from 'react';
import { type MentionPickerPluginProps } from './plugins/mention-picker';
import { AutoSize, MentionsEditor } from './types';
export * from './types';
export * from './utils';
export { CLEAR_EDITOR_COMMAND } from 'lexical';
export interface MentionsProps extends MentionPickerPluginProps, PropsWithChildren {
className?: string;
classNames?: {
wrapper?: string;
menuOverlay?: string;
};
wrapperClassname?: string;
placeholder?: React.ReactNode;
style?: React.CSSProperties;
value?: string;
defaultValue?: string;
readOnly?: boolean;
disabled?: boolean;
onChange?: (text: string) => void;
onBlur?: () => void;
onFocus?: () => void;
/**
* 按下回车的回调,指定后会改变回车的默认行为,换行需要使用 shift + enter
*/
onPressEnter?: (value: string, { event }: {
event: KeyboardEvent | null;
}) => void;
/**
* 用户输入 trigger 后的回调
*/
/**
* 按下键盘的回调
*/
onKeyDown?: (event: KeyboardEvent | null) => void;
/**
* 用户输入 trigger 后的回调
*/
onTrigger?: (trigger: string) => void;
variant?: 'outlined' | 'filled' | 'borderless';
autoSize?: AutoSize;
code?: boolean;
getPopContainer?: () => HTMLElement;
autoFocus?: 'rootStart' | 'rootEnd';
extraNodes?: InitialConfigType['nodes'];
}
export declare const Mentions: React.ForwardRefExoticComponent<MentionsProps & React.RefAttributes<MentionsEditor>>;