@v-c/mentions 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/DropdownMenu.cjs +124 -0
- package/dist/DropdownMenu.d.ts +12 -0
- package/dist/DropdownMenu.js +117 -0
- package/dist/KeywordTrigger.cjs +130 -0
- package/dist/KeywordTrigger.d.ts +16 -0
- package/dist/KeywordTrigger.js +123 -0
- package/dist/Mentions.cjs +802 -0
- package/dist/Mentions.d.ts +58 -0
- package/dist/Mentions.js +795 -0
- package/dist/MentionsContext.cjs +19 -0
- package/dist/MentionsContext.d.ts +18 -0
- package/dist/MentionsContext.js +16 -0
- package/dist/Option.cjs +7 -0
- package/dist/Option.d.ts +10 -0
- package/dist/Option.js +3 -0
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/context.cjs +12 -0
- package/dist/context.d.ts +7 -0
- package/dist/context.js +9 -0
- package/dist/hooks/useEffectState.cjs +23 -0
- package/dist/hooks/useEffectState.d.ts +5 -0
- package/dist/hooks/useEffectState.js +18 -0
- package/dist/index.cjs +12 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/util.cjs +65 -0
- package/dist/util.d.ts +37 -0
- package/dist/util.js +59 -0
- package/package.json +40 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CommonInputProps } from '@v-c/input';
|
|
2
|
+
import { TextAreaProps } from '../../textarea/src';
|
|
3
|
+
import { VueNode } from '../../util/src';
|
|
4
|
+
import { CSSProperties } from 'vue';
|
|
5
|
+
import { OptionProps } from './Option';
|
|
6
|
+
import { filterOption as defaultFilterOption, validateSearch as defaultValidateSearch } from './util';
|
|
7
|
+
type BaseTextareaAttrs = Omit<TextAreaProps, 'prefix' | 'onChange' | 'onSelect' | 'showCount' | 'classNames'>;
|
|
8
|
+
export type Placement = 'top' | 'bottom';
|
|
9
|
+
export type Direction = 'ltr' | 'rtl';
|
|
10
|
+
export interface DataDrivenOptionProps extends OptionProps {
|
|
11
|
+
label?: VueNode;
|
|
12
|
+
}
|
|
13
|
+
export interface MentionsProps extends BaseTextareaAttrs {
|
|
14
|
+
id?: string;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
notFoundContent?: VueNode;
|
|
19
|
+
split?: string;
|
|
20
|
+
transitionName?: string;
|
|
21
|
+
placement?: Placement;
|
|
22
|
+
direction?: Direction;
|
|
23
|
+
prefix?: string | string[];
|
|
24
|
+
prefixCls?: string;
|
|
25
|
+
value?: string;
|
|
26
|
+
silent?: boolean;
|
|
27
|
+
filterOption?: false | typeof defaultFilterOption;
|
|
28
|
+
validateSearch?: typeof defaultValidateSearch;
|
|
29
|
+
onChange?: (text: string) => void;
|
|
30
|
+
onSelect?: (option: OptionProps, prefix: string) => void;
|
|
31
|
+
onSearch?: (text: string, prefix: string) => void;
|
|
32
|
+
onFocus?: (e: FocusEvent) => void;
|
|
33
|
+
onBlur?: (e: FocusEvent) => void;
|
|
34
|
+
getPopupContainer?: () => HTMLElement;
|
|
35
|
+
popupClassName?: string;
|
|
36
|
+
options?: DataDrivenOptionProps[];
|
|
37
|
+
classNames?: CommonInputProps['classNames'] & {
|
|
38
|
+
mentions?: string;
|
|
39
|
+
textarea?: string;
|
|
40
|
+
popup?: string;
|
|
41
|
+
};
|
|
42
|
+
styles?: {
|
|
43
|
+
suffix?: CSSProperties;
|
|
44
|
+
textarea?: CSSProperties;
|
|
45
|
+
popup?: CSSProperties;
|
|
46
|
+
};
|
|
47
|
+
onPopupScroll?: (event: UIEvent) => void;
|
|
48
|
+
rows?: HTMLTextAreaElement['rows'];
|
|
49
|
+
}
|
|
50
|
+
export interface MentionsRef {
|
|
51
|
+
focus: VoidFunction;
|
|
52
|
+
blur: VoidFunction;
|
|
53
|
+
/** @deprecated It may not work as expected */
|
|
54
|
+
textarea: HTMLTextAreaElement | null;
|
|
55
|
+
nativeElement: HTMLElement;
|
|
56
|
+
}
|
|
57
|
+
declare const Mentions: import('vue').DefineSetupFnComponent<MentionsProps, {}, {}, MentionsProps & {}, import('vue').PublicProps>;
|
|
58
|
+
export default Mentions;
|