Skip to content

Add Mentions Type #1845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions types/ant-design-vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { Layout } from './layout/layout';
import { List } from './list/list';
import { LocaleProvider } from './locale-provider';
import { Message } from './message';
import { Mentions } from './mentions/mentions';
import { Menu } from './menu/menu';
import { Modal } from './modal';
import { Notification } from './notification';
Expand Down
72 changes: 72 additions & 0 deletions types/mentions/mentions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions: https://github.com/vueComponent/ant-design-vue/types

import { AntdComponent } from '../component';
import { Option } from './option';

export declare class Mentions extends AntdComponent {
static Option: typeof Option;
/**
* Auto get focus when component mounted
* @default false
* @type boolean
*/
autoFocus: boolean;

/**
* Default value
* @type string
*/
defaultValue: string;

/**
* Customize filter option logic
* @type false | (input: string, option: OptionProps) => boolean
*/
filterOption: false | ((input: string, option: Option) => boolean);

/**
* Set mentions content when not match
* @type any (string | slot)
*/
notFoundContent: any;

/**
* Set popup placement
* @default 'top'
* @type string
*/
placement: 'top' | 'bottom';

/**
* Set trigger prefix keyword
* @default '@'
* @type string | string[]
*/
prefix: string | string[];

/**
* Set split string before and after selected mention
* @default ' '
* @type string
*/
split: string;

/**
* Customize trigger search logic
* @type (text: string, props: MentionsProps) => void
*/
validateSearch: (text: string, props: Mentions) => void;

/**
* Set value of mentions
* @type string
*/
value: string;

/**
* Set the mount HTML node for suggestions
* @default () => HTMLElement
*/
getPopupContainer: (triggerNode: HTMLElement) => HTMLElement;
}
13 changes: 13 additions & 0 deletions types/mentions/option.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions: https://github.com/vueComponent/ant-design-vue/types

import { AntdComponent } from '../component';

export declare class Option extends AntdComponent {
/**
* value of suggestion, the value will insert into input filed while selected
* @default ''
* @type string
*/
value: string;
}