@yh-ui/components 0.1.12 → 0.1.15
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/dist/ai-artifacts/src/ai-artifacts.d.ts +1 -1
- package/dist/ai-artifacts/src/ai-artifacts.d.vue.ts +18 -1
- package/dist/ai-artifacts/src/ai-artifacts.vue +30 -2
- package/dist/ai-artifacts/src/ai-artifacts.vue.d.ts +18 -1
- package/dist/ai-editor-sender/src/ai-editor-sender.d.vue.ts +2 -2
- package/dist/ai-editor-sender/src/ai-editor-sender.vue.d.ts +2 -2
- package/dist/ai-mention/__tests__/ai-mention.ssr.test.cjs +38 -0
- package/dist/ai-mention/__tests__/ai-mention.ssr.test.d.ts +1 -0
- package/dist/ai-mention/__tests__/ai-mention.ssr.test.mjs +37 -0
- package/dist/ai-mention/__tests__/ai-mention.test.cjs +113 -0
- package/dist/ai-mention/__tests__/ai-mention.test.d.ts +1 -0
- package/dist/ai-mention/__tests__/ai-mention.test.mjs +84 -0
- package/dist/ai-mention/index.cjs +26 -0
- package/dist/ai-mention/index.d.ts +29 -0
- package/dist/ai-mention/index.mjs +5 -0
- package/dist/ai-mention/src/ai-mention.cjs +95 -0
- package/dist/ai-mention/src/ai-mention.css +545 -0
- package/dist/ai-mention/src/ai-mention.d.ts +99 -0
- package/dist/ai-mention/src/ai-mention.d.vue.ts +68 -0
- package/dist/ai-mention/src/ai-mention.mjs +89 -0
- package/dist/ai-mention/src/ai-mention.vue +650 -0
- package/dist/ai-mention/src/ai-mention.vue.d.ts +68 -0
- package/dist/ai-sender/__tests__/ai-sender.test.cjs +17 -10
- package/dist/ai-sender/__tests__/ai-sender.test.mjs +17 -10
- package/dist/ai-sender/src/ai-sender.cjs +7 -0
- package/dist/ai-sender/src/ai-sender.d.ts +7 -0
- package/dist/ai-sender/src/ai-sender.d.vue.ts +8 -3
- package/dist/ai-sender/src/ai-sender.mjs +7 -0
- package/dist/ai-sender/src/ai-sender.vue +25 -18
- package/dist/ai-sender/src/ai-sender.vue.d.ts +8 -3
- package/dist/ai-sources/src/ai-sources.d.vue.ts +2 -2
- package/dist/ai-sources/src/ai-sources.vue +41 -57
- package/dist/ai-sources/src/ai-sources.vue.d.ts +2 -2
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +19 -2
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +12 -2
- package/dist/ai-voice-trigger/src/ai-voice-trigger.cjs +32 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.css +111 -12
- package/dist/ai-voice-trigger/src/ai-voice-trigger.d.ts +32 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.d.vue.ts +22 -2
- package/dist/ai-voice-trigger/src/ai-voice-trigger.mjs +32 -0
- package/dist/ai-voice-trigger/src/ai-voice-trigger.vue +201 -50
- package/dist/ai-voice-trigger/src/ai-voice-trigger.vue.d.ts +22 -2
- package/dist/alert/src/alert.d.vue.ts +1 -1
- package/dist/alert/src/alert.vue.d.ts +1 -1
- package/dist/autocomplete/src/autocomplete.d.vue.ts +2 -2
- package/dist/autocomplete/src/autocomplete.vue.d.ts +2 -2
- package/dist/calendar/src/calendar.d.vue.ts +1 -1
- package/dist/calendar/src/calendar.vue.d.ts +1 -1
- package/dist/date-picker/src/date-picker.d.vue.ts +2 -2
- package/dist/date-picker/src/date-picker.vue.d.ts +2 -2
- package/dist/dialog/src/dialog.d.vue.ts +8 -8
- package/dist/dialog/src/dialog.vue.d.ts +8 -8
- package/dist/drawer/index.d.ts +42 -1
- package/dist/drawer/src/drawer.d.vue.ts +4 -4
- package/dist/drawer/src/drawer.vue.d.ts +4 -4
- package/dist/icon/src/icons/index.cjs +7 -2
- package/dist/icon/src/icons/index.d.ts +1 -0
- package/dist/icon/src/icons/index.mjs +7 -1
- package/dist/index.cjs +13 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +4 -1
- package/dist/infinite-scroll/src/infinite-scroll.d.vue.ts +1 -1
- package/dist/infinite-scroll/src/infinite-scroll.vue.d.ts +1 -1
- package/dist/input/index.d.ts +3 -3
- package/dist/input/src/input.d.vue.ts +1 -1
- package/dist/input/src/input.vue.d.ts +1 -1
- package/dist/input-number/index.d.ts +3 -3
- package/dist/input-number/src/input-number.d.vue.ts +1 -1
- package/dist/input-number/src/input-number.vue.d.ts +1 -1
- package/dist/input-tag/src/input-tag.d.vue.ts +2 -2
- package/dist/input-tag/src/input-tag.vue.d.ts +2 -2
- package/dist/mention/index.d.ts +181 -1
- package/dist/mention/src/mention.d.vue.ts +5 -5
- package/dist/mention/src/mention.vue +6 -2
- package/dist/mention/src/mention.vue.d.ts +5 -5
- package/dist/message/src/message.d.vue.ts +1 -1
- package/dist/message/src/message.vue.d.ts +1 -1
- package/dist/notification/src/notification.d.vue.ts +1 -1
- package/dist/notification/src/notification.vue.d.ts +1 -1
- package/dist/select/src/select.d.vue.ts +3 -3
- package/dist/select/src/select.vue.d.ts +3 -3
- package/dist/skeleton/src/skeleton.d.vue.ts +1 -1
- package/dist/skeleton/src/skeleton.vue.d.ts +1 -1
- package/dist/table/src/table-column.d.vue.ts +1 -1
- package/dist/table/src/table-column.vue.d.ts +1 -1
- package/dist/table/src/table.d.vue.ts +2 -2
- package/dist/table/src/table.vue.d.ts +2 -2
- package/dist/time-picker/src/time-picker.d.vue.ts +1 -1
- package/dist/time-picker/src/time-picker.vue.d.ts +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type AiMentionOption } from './ai-mention';
|
|
2
|
+
declare var __VLS_22: any, __VLS_23: any;
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
[K in NonNullable<typeof __VLS_22>]?: (props: typeof __VLS_23) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
|
+
readonly modelValue: {
|
|
8
|
+
readonly type: StringConstructor;
|
|
9
|
+
readonly default: "";
|
|
10
|
+
};
|
|
11
|
+
readonly types: {
|
|
12
|
+
readonly type: import("vue").PropType<import("./ai-mention").AiMentionType[]>;
|
|
13
|
+
readonly default: () => string[];
|
|
14
|
+
};
|
|
15
|
+
readonly options: {
|
|
16
|
+
readonly type: import("vue").PropType<AiMentionOption[]>;
|
|
17
|
+
readonly default: () => never[];
|
|
18
|
+
};
|
|
19
|
+
readonly triggers: {
|
|
20
|
+
readonly type: import("vue").PropType<string[]>;
|
|
21
|
+
readonly default: () => string[];
|
|
22
|
+
};
|
|
23
|
+
readonly type: {
|
|
24
|
+
readonly type: import("vue").PropType<"input" | "textarea">;
|
|
25
|
+
readonly default: "textarea";
|
|
26
|
+
};
|
|
27
|
+
readonly placeholder: StringConstructor;
|
|
28
|
+
readonly disabled: BooleanConstructor;
|
|
29
|
+
readonly size: import("vue").PropType<"large" | "default" | "small">;
|
|
30
|
+
readonly maxLength: NumberConstructor;
|
|
31
|
+
readonly rows: {
|
|
32
|
+
readonly type: NumberConstructor;
|
|
33
|
+
readonly default: 3;
|
|
34
|
+
};
|
|
35
|
+
readonly loading: BooleanConstructor;
|
|
36
|
+
readonly themeOverrides: {
|
|
37
|
+
readonly type: import("vue").PropType<import("@yh-ui/theme").ComponentThemeVars>;
|
|
38
|
+
readonly default: () => {};
|
|
39
|
+
};
|
|
40
|
+
readonly filterOption: {
|
|
41
|
+
readonly type: import("vue").PropType<((keyword: string, option: import("../../mention").MentionOption) => boolean) | false>;
|
|
42
|
+
readonly default: undefined;
|
|
43
|
+
};
|
|
44
|
+
}>, {
|
|
45
|
+
focus: () => void | undefined;
|
|
46
|
+
blur: () => void | undefined;
|
|
47
|
+
clear: () => void | undefined;
|
|
48
|
+
getRef: () => HTMLTextAreaElement | HTMLInputElement | undefined;
|
|
49
|
+
insertMention: (option: AiMentionOption, trigger?: string) => void | undefined;
|
|
50
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
|
|
51
|
+
readonly disabled: boolean;
|
|
52
|
+
readonly themeOverrides: import("@yh-ui/theme").ComponentThemeVars;
|
|
53
|
+
readonly type: "textarea" | "input";
|
|
54
|
+
readonly loading: boolean;
|
|
55
|
+
readonly triggers: string[];
|
|
56
|
+
readonly options: AiMentionOption[];
|
|
57
|
+
readonly modelValue: string;
|
|
58
|
+
readonly filterOption: false | ((keyword: string, option: import("../../mention").MentionOption) => boolean);
|
|
59
|
+
readonly rows: number;
|
|
60
|
+
readonly types: ("table" | "document" | "agent" | "knowledge")[];
|
|
61
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
62
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
63
|
+
export default _default;
|
|
64
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
65
|
+
new (): {
|
|
66
|
+
$slots: S;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export const aiMentionTypes = ["agent", "document", "table", "knowledge"];
|
|
2
|
+
export const aiMentionProps = {
|
|
3
|
+
/**
|
|
4
|
+
* 绑定值
|
|
5
|
+
*/
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
/**
|
|
11
|
+
* AI 提及类型,支持多种类型过滤
|
|
12
|
+
*/
|
|
13
|
+
types: {
|
|
14
|
+
type: Array,
|
|
15
|
+
default: () => ["agent", "document", "table", "knowledge"]
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* 选项列表
|
|
19
|
+
*/
|
|
20
|
+
options: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => []
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* 触发字符
|
|
26
|
+
*/
|
|
27
|
+
triggers: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => ["@"]
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* 是否在输入框中
|
|
33
|
+
*/
|
|
34
|
+
type: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "textarea"
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* 占位符
|
|
40
|
+
*/
|
|
41
|
+
placeholder: String,
|
|
42
|
+
/**
|
|
43
|
+
* 是否禁用
|
|
44
|
+
*/
|
|
45
|
+
disabled: Boolean,
|
|
46
|
+
/**
|
|
47
|
+
* 尺寸
|
|
48
|
+
*/
|
|
49
|
+
size: String,
|
|
50
|
+
/**
|
|
51
|
+
* 最大长度
|
|
52
|
+
*/
|
|
53
|
+
maxLength: Number,
|
|
54
|
+
/**
|
|
55
|
+
* 文本域行数
|
|
56
|
+
*/
|
|
57
|
+
rows: {
|
|
58
|
+
type: Number,
|
|
59
|
+
default: 3
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* 是否正在加载
|
|
63
|
+
*/
|
|
64
|
+
loading: Boolean,
|
|
65
|
+
/**
|
|
66
|
+
* 主题覆盖
|
|
67
|
+
*/
|
|
68
|
+
themeOverrides: {
|
|
69
|
+
type: Object,
|
|
70
|
+
default: () => ({})
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* 选项过滤
|
|
74
|
+
*/
|
|
75
|
+
filterOption: {
|
|
76
|
+
type: [Function, Boolean],
|
|
77
|
+
default: void 0
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export const aiMentionEmits = {
|
|
81
|
+
"update:modelValue": (value) => typeof value === "string",
|
|
82
|
+
input: (value) => typeof value === "string",
|
|
83
|
+
change: (value) => typeof value === "string",
|
|
84
|
+
select: (option, trigger) => !!option && !!trigger,
|
|
85
|
+
search: (keyword, trigger) => typeof keyword === "string" && !!trigger,
|
|
86
|
+
focus: (event) => event instanceof FocusEvent,
|
|
87
|
+
blur: (event) => event instanceof FocusEvent,
|
|
88
|
+
keydown: (event) => event instanceof KeyboardEvent
|
|
89
|
+
};
|