savor-ui 0.3.2 → 0.4.0
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/CHANGELOG.md +45 -0
- package/dist/es/components/index.d.ts +4 -0
- package/dist/es/components/index.mjs +6 -1
- package/dist/es/components/src/alert/alert.d.ts +22 -0
- package/dist/es/components/src/alert/alert.vue.mjs +5 -0
- package/dist/es/components/src/alert/alert.vue_vue_type_script_setup_true_vapor_true_lang.mjs +58 -0
- package/dist/es/components/src/alert/index.d.ts +26 -0
- package/dist/es/components/src/alert/index.mjs +7 -0
- package/dist/es/components/src/alert/types.d.ts +24 -0
- package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs +93 -82
- package/dist/es/components/src/cascader/index.d.ts +1 -0
- package/dist/es/components/src/cascader/types.d.ts +2 -0
- package/dist/es/components/src/chat-list/chat-list.d.ts +35 -0
- package/dist/es/components/src/chat-list/chat-list.vue.mjs +5 -0
- package/dist/es/components/src/chat-list/chat-list.vue_vue_type_script_setup_true_vapor_true_lang.mjs +55 -0
- package/dist/es/components/src/chat-list/index.d.ts +47 -0
- package/dist/es/components/src/chat-list/index.mjs +7 -0
- package/dist/es/components/src/chat-list/types.d.ts +44 -0
- package/dist/es/components/src/chat-sender/chat-sender.d.ts +26 -0
- package/dist/es/components/src/chat-sender/chat-sender.vue.mjs +5 -0
- package/dist/es/components/src/chat-sender/chat-sender.vue_vue_type_script_setup_true_vapor_true_lang.mjs +92 -0
- package/dist/es/components/src/chat-sender/index.d.ts +27 -0
- package/dist/es/components/src/chat-sender/index.mjs +7 -0
- package/dist/es/components/src/chat-sender/types.d.ts +24 -0
- package/dist/es/components/src/collapse/collapse-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +2 -2
- package/dist/es/components/src/date-picker/date-picker.vue_vue_type_script_setup_true_vapor_true_lang.mjs +28 -28
- package/dist/es/components/src/datetime-picker/datetime-picker.vue_vue_type_script_setup_true_vapor_true_lang.mjs +28 -28
- package/dist/es/components/src/drawer/drawer.vue_vue_type_script_setup_true_vapor_true_lang.mjs +72 -72
- package/dist/es/components/src/form/form-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +13 -13
- package/dist/es/components/src/form/use-form-item.d.ts +1 -1
- package/dist/es/components/src/grid/grid-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +26 -17
- package/dist/es/components/src/grid/grid.vue_vue_type_script_setup_true_vapor_true_lang.mjs +10 -6
- package/dist/es/components/src/grid/types.d.ts +2 -0
- package/dist/es/components/src/input/input.vue_vue_type_script_setup_true_vapor_true_lang.mjs +9 -9
- package/dist/es/components/src/input-number/input-number.vue_vue_type_script_setup_true_vapor_true_lang.mjs +83 -83
- package/dist/es/components/src/input-tag/input-tag.vue_vue_type_script_setup_true_vapor_true_lang.mjs +10 -10
- package/dist/es/components/src/layer/layer.vue_vue_type_script_setup_true_vapor_true_lang.mjs +105 -105
- package/dist/es/components/src/list/index.d.ts +5 -5
- package/dist/es/components/src/list/list.d.ts +3 -3
- package/dist/es/components/src/list/list.vue_vue_type_script_setup_true_vapor_true_lang.mjs +7 -12
- package/dist/es/components/src/list/types.d.ts +7 -5
- package/dist/es/components/src/menu/menu-item.vue_vue_type_script_setup_true_vapor_true_lang.mjs +46 -37
- package/dist/es/components/src/menu/sub-menu.vue_vue_type_script_setup_true_vapor_true_lang.mjs +2 -2
- package/dist/es/components/src/modal/modal.vue_vue_type_script_setup_true_vapor_true_lang.mjs +121 -121
- package/dist/es/components/src/panel/panel.vue_vue_type_script_setup_true_vapor_true_lang.mjs +2 -2
- package/dist/es/components/src/popover/index.d.ts +1 -0
- package/dist/es/components/src/popover/popover.vue_vue_type_script_setup_true_vapor_true_lang.mjs +77 -76
- package/dist/es/components/src/popover/types.d.ts +4 -0
- package/dist/es/components/src/scrollbar/index.d.ts +7 -2
- package/dist/es/components/src/scrollbar/scrollbar.d.ts +5 -2
- package/dist/es/components/src/scrollbar/scrollbar.vue_vue_type_script_setup_true_vapor_true_lang.mjs +131 -96
- package/dist/es/components/src/scrollbar/types.d.ts +15 -1
- package/dist/es/components/src/segmented/segmented.vue_vue_type_script_setup_true_vapor_true_lang.mjs +41 -45
- package/dist/es/components/src/select/select.vue_vue_type_script_setup_true_vapor_true_lang.mjs +9 -9
- package/dist/es/components/src/table/col-group.d.ts +22 -0
- package/dist/es/components/src/table/col-group.vue.mjs +5 -0
- package/dist/es/components/src/table/col-group.vue_vue_type_script_setup_true_vapor_true_lang.mjs +25 -0
- package/dist/es/components/src/table/index.d.ts +18 -41
- package/dist/es/components/src/table/index.mjs +1 -0
- package/dist/es/components/src/table/table-body.d.ts +32 -0
- package/dist/es/components/src/table/table-body.vue.mjs +5 -0
- package/dist/es/components/src/table/table-body.vue_vue_type_script_setup_true_vapor_true_lang.mjs +153 -0
- package/dist/es/components/src/table/table-header.d.ts +23 -0
- package/dist/es/components/src/table/table-header.vue.mjs +5 -0
- package/dist/es/components/src/table/table-header.vue_vue_type_script_setup_true_vapor_true_lang.mjs +80 -0
- package/dist/es/components/src/table/table.d.ts +12 -25
- package/dist/es/components/src/table/table.vue_vue_type_script_setup_true_vapor_true_lang.mjs +167 -380
- package/dist/es/components/src/table/types.d.ts +61 -45
- package/dist/es/components/src/table/types.mjs +4 -0
- package/dist/es/components/src/textarea/textarea.vue_vue_type_script_setup_true_vapor_true_lang.mjs +6 -6
- package/dist/es/components/src/tooltip/index.d.ts +1 -0
- package/dist/es/components/src/tooltip/tooltip.vue_vue_type_script_setup_true_vapor_true_lang.mjs +2 -0
- package/dist/es/components/src/tooltip/types.d.ts +2 -0
- package/dist/es/components/src/transition/index.d.ts +29 -0
- package/dist/es/components/src/transition/index.mjs +7 -0
- package/dist/es/components/src/{_comp/HeightTransition.d.ts → transition/transition-height.d.ts} +0 -4
- package/dist/es/components/src/transition/transition-height.vue.mjs +5 -0
- package/dist/es/components/src/transition/transition-height.vue_vue_type_script_setup_true_vapor_true_lang.mjs +54 -0
- package/dist/es/components/src/transition/transition-opacity.vue.mjs +5 -0
- package/dist/es/components/src/{_comp/OpacityTransition.vue_vue_type_script_setup_true_vapor_true_lang.mjs → transition/transition-opacity.vue_vue_type_script_setup_true_vapor_true_lang.mjs} +2 -2
- package/dist/es/components/src/transition/transition-scale.vue.mjs +5 -0
- package/dist/es/components/src/{_comp/ScaleTransition.vue_vue_type_script_setup_true_vapor_true_lang.mjs → transition/transition-scale.vue_vue_type_script_setup_true_vapor_true_lang.mjs} +2 -2
- package/dist/es/components/src/transition/transition-side.vue.mjs +5 -0
- package/dist/es/components/src/{_comp/SideTransition.vue_vue_type_script_setup_true_vapor_true_lang.mjs → transition/transition-side.vue_vue_type_script_setup_true_vapor_true_lang.mjs} +2 -2
- package/dist/es/components/src/transition/transition-width.d.ts +31 -0
- package/dist/es/components/src/transition/transition-width.vue.mjs +5 -0
- package/dist/es/components/src/transition/transition-width.vue_vue_type_script_setup_true_vapor_true_lang.mjs +54 -0
- package/dist/es/components/src/transition/transition.d.ts +27 -0
- package/dist/es/components/src/transition/transition.vue.mjs +5 -0
- package/dist/es/components/src/transition/transition.vue_vue_type_script_setup_true_vapor_true_lang.mjs +47 -0
- package/dist/es/components/src/transition/types.d.ts +28 -0
- package/dist/es/components/src/tree/index.d.ts +15 -7
- package/dist/es/components/src/tree/node.d.ts +2 -1
- package/dist/es/components/src/tree/node.vue_vue_type_script_setup_true_vapor_true_lang.mjs +27 -29
- package/dist/es/components/src/tree/tree.d.ts +8 -2
- package/dist/es/components/src/tree/tree.vue_vue_type_script_setup_true_vapor_true_lang.mjs +69 -65
- package/dist/es/components/src/tree/types.d.ts +18 -12
- package/dist/es/core/components.mjs +94 -86
- package/dist/es/core/index.mjs +84 -79
- package/dist/es/hooks/src/use-element-size.mjs +7 -38
- package/dist/es/icons/index.d.ts +4 -1
- package/dist/es/icons/index.mjs +3 -0
- package/dist/es/icons/src/loading-stop.d.ts +19 -0
- package/dist/es/icons/src/loading-stop.vue.mjs +11 -0
- package/dist/es/icons/src/send.d.ts +19 -0
- package/dist/es/icons/src/send.vue.mjs +11 -0
- package/dist/es/icons/src/stop.d.ts +19 -0
- package/dist/es/icons/src/stop.vue.mjs +5 -0
- package/dist/es/theme/components/alert.scss +101 -0
- package/dist/es/theme/components/button.scss +21 -4
- package/dist/es/theme/components/cascader.scss +3 -0
- package/dist/es/theme/components/chat-list.scss +134 -0
- package/dist/es/theme/components/chat-sender.scss +123 -0
- package/dist/es/theme/components/index.scss +3 -0
- package/dist/es/theme/components/input.scss +2 -1
- package/dist/es/theme/components/list.scss +7 -0
- package/dist/es/theme/components/menu.scss +14 -1
- package/dist/es/theme/components/scrollbar.scss +61 -7
- package/dist/es/theme/components/table.scss +360 -328
- package/dist/es/theme/components/transition.scss +21 -21
- package/dist/es/theme/components/tree.scss +8 -0
- package/dist/es/utils/src/tool.d.ts +8 -3
- package/dist/es/utils/src/tool.mjs +6 -6
- package/dist/json/vetur-attributes.json +196 -46
- package/dist/json/vetur-tags.json +82 -15
- package/dist/json/web-types.json +432 -75
- package/package.json +1 -1
- package/dist/es/components/src/_comp/HeightTransition.vue.mjs +0 -5
- package/dist/es/components/src/_comp/HeightTransition.vue_vue_type_script_setup_true_vapor_true_lang.mjs +0 -77
- package/dist/es/components/src/_comp/OpacityTransition.vue.mjs +0 -5
- package/dist/es/components/src/_comp/ScaleTransition.vue.mjs +0 -5
- package/dist/es/components/src/_comp/SideTransition.vue.mjs +0 -5
- /package/dist/es/components/src/{_comp/OpacityTransition.d.ts → transition/transition-opacity.d.ts} +0 -0
- /package/dist/es/components/src/{_comp/ScaleTransition.d.ts → transition/transition-scale.d.ts} +0 -0
- /package/dist/es/components/src/{_comp/SideTransition.d.ts → transition/transition-side.d.ts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ChatListItemProps } from './types.js';
|
|
2
|
+
import { PublicProps, ShallowUnwrapRef, VNode, Plugin } from 'vue';
|
|
3
|
+
export declare const SChatList: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
4
|
+
attrs: any;
|
|
5
|
+
slots: {
|
|
6
|
+
'user-text'?: (props: {
|
|
7
|
+
item: ChatListItemProps;
|
|
8
|
+
}) => any;
|
|
9
|
+
} & {
|
|
10
|
+
'assistant-text'?: (props: {
|
|
11
|
+
item: ChatListItemProps;
|
|
12
|
+
}) => any;
|
|
13
|
+
} & {
|
|
14
|
+
extra?: (props: {
|
|
15
|
+
item: ChatListItemProps;
|
|
16
|
+
}) => any;
|
|
17
|
+
};
|
|
18
|
+
emit: {};
|
|
19
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
20
|
+
props: PublicProps & {
|
|
21
|
+
data?: ChatListItemProps[] | undefined;
|
|
22
|
+
} & (typeof globalThis extends {
|
|
23
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
24
|
+
} ? P : {});
|
|
25
|
+
expose: (exposed: ShallowUnwrapRef<{
|
|
26
|
+
scrollToTop: () => void;
|
|
27
|
+
scrollToBottom: () => void;
|
|
28
|
+
}>) => void;
|
|
29
|
+
attrs: any;
|
|
30
|
+
slots: {
|
|
31
|
+
'user-text'?: (props: {
|
|
32
|
+
item: ChatListItemProps;
|
|
33
|
+
}) => any;
|
|
34
|
+
} & {
|
|
35
|
+
'assistant-text'?: (props: {
|
|
36
|
+
item: ChatListItemProps;
|
|
37
|
+
}) => any;
|
|
38
|
+
} & {
|
|
39
|
+
extra?: (props: {
|
|
40
|
+
item: ChatListItemProps;
|
|
41
|
+
}) => any;
|
|
42
|
+
};
|
|
43
|
+
emit: {};
|
|
44
|
+
}>) => VNode & {
|
|
45
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
46
|
+
}) & Plugin;
|
|
47
|
+
export * from './types.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface ChatListProps {
|
|
2
|
+
/** 聊天列表数据 */
|
|
3
|
+
data?: ChatListItemProps[];
|
|
4
|
+
}
|
|
5
|
+
export interface ChatListSlots {
|
|
6
|
+
/** 额外内容 */
|
|
7
|
+
extra?: (props: {
|
|
8
|
+
item: ChatListItemProps;
|
|
9
|
+
}) => any;
|
|
10
|
+
/** 用户文本 */
|
|
11
|
+
"user-text"?: (props: {
|
|
12
|
+
item: ChatListItemProps;
|
|
13
|
+
}) => any;
|
|
14
|
+
/** 助手文本 */
|
|
15
|
+
"assistant-text"?: (props: {
|
|
16
|
+
item: ChatListItemProps;
|
|
17
|
+
}) => any;
|
|
18
|
+
}
|
|
19
|
+
export interface ChatListItemProps {
|
|
20
|
+
/** 头像 */
|
|
21
|
+
avatar?: string;
|
|
22
|
+
/** 名称 */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** 时间 */
|
|
25
|
+
datetime?: string;
|
|
26
|
+
/** 角色 */
|
|
27
|
+
role?: "user" | "assistant" | "error" | "model-change" | "system";
|
|
28
|
+
/** 内容 */
|
|
29
|
+
content?: ChatListItemContentProps[];
|
|
30
|
+
/** 状态 */
|
|
31
|
+
status?: "error";
|
|
32
|
+
}
|
|
33
|
+
export interface ChatListItemContentProps {
|
|
34
|
+
/** 类型 */
|
|
35
|
+
type?: "text" | "markdown";
|
|
36
|
+
/** 数据 */
|
|
37
|
+
data?: any;
|
|
38
|
+
}
|
|
39
|
+
export interface ChatListExpose {
|
|
40
|
+
/** 滚动到顶部 */
|
|
41
|
+
scrollToTop: () => void;
|
|
42
|
+
/** 滚动到底部 */
|
|
43
|
+
scrollToBottom: () => void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChatSenderExpose, ChatSenderProps, ChatSenderSlots } from './types';
|
|
2
|
+
import { PublicProps, ShallowUnwrapRef, VNode } from 'vue';
|
|
3
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: PublicProps & __VLS_PrettifyLocal<(ChatSenderProps & {
|
|
5
|
+
modelValue?: string;
|
|
6
|
+
}) & {
|
|
7
|
+
onStop?: (() => any) | undefined;
|
|
8
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
9
|
+
onSend?: (() => any) | undefined;
|
|
10
|
+
}> & (typeof globalThis extends {
|
|
11
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
12
|
+
} ? P : {});
|
|
13
|
+
expose: (exposed: ShallowUnwrapRef<ChatSenderExpose>) => void;
|
|
14
|
+
attrs: any;
|
|
15
|
+
slots: ChatSenderSlots;
|
|
16
|
+
emit: (((evt: "stop") => void) & ((evt: "send") => void)) & ((event: "update:modelValue", value: string) => void);
|
|
17
|
+
}>) => VNode & {
|
|
18
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
19
|
+
};
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
23
|
+
[K in keyof T]: T[K];
|
|
24
|
+
} : {
|
|
25
|
+
[K in keyof T as K]: T[K];
|
|
26
|
+
}) & {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
2
|
+
import "../../../hooks/index.mjs";
|
|
3
|
+
import t from "../../../icons/src/loading-stop.vue.mjs";
|
|
4
|
+
import n from "../../../icons/src/send.vue.mjs";
|
|
5
|
+
import "../../../icons/index.mjs";
|
|
6
|
+
import { SButton as r } from "../button/index.mjs";
|
|
7
|
+
import { child as i, createComponent as a, createIf as o, createInvoker as s, createSlot as c, createTemplateRefSetter as l, defineVaporComponent as u, delegateEvents as d, mergeModels as f, next as p, on as m, onMounted as h, ref as g, renderEffect as _, setClass as v, setInsertionState as y, setProp as b, setValue as x, template as S, unref as C, useModel as w, useTemplateRef as T, watch as E } from "vue";
|
|
8
|
+
//#region ../components/src/chat-sender/chat-sender.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
9
|
+
var D = S("<div><div><textarea></textarea></div><div></div>"), O = S("<div><div><textarea></textarea></div><div><div></div><div>"), k = S("<div>", 1);
|
|
10
|
+
d("input", "keydown");
|
|
11
|
+
var A = /*@__PURE__*/ u({
|
|
12
|
+
name: "SChatSender",
|
|
13
|
+
__name: "chat-sender",
|
|
14
|
+
props: /*@__PURE__*/ f({
|
|
15
|
+
modelValue: {},
|
|
16
|
+
loading: { type: Boolean },
|
|
17
|
+
autofocus: { type: Boolean },
|
|
18
|
+
placeholder: { default: "发消息..." },
|
|
19
|
+
updown: { type: Boolean }
|
|
20
|
+
}, {
|
|
21
|
+
modelValue: { default: "" },
|
|
22
|
+
modelModifiers: {}
|
|
23
|
+
}),
|
|
24
|
+
emits: /*@__PURE__*/ f(["send", "stop"], ["update:modelValue"]),
|
|
25
|
+
setup(u, { expose: d, emit: f }) {
|
|
26
|
+
let S = u, A = f, j = e("chat-sender"), M = w(u, "modelValue"), N = T("textareaRef"), P = () => {
|
|
27
|
+
let e = N.value;
|
|
28
|
+
if (!e) return;
|
|
29
|
+
let t = S.updown ? 1 : 2, n = getComputedStyle(e), r = parseInt(n.lineHeight, 10) || 20, i = (parseInt(n.paddingTop, 10) || 0) + (parseInt(n.paddingBottom, 10) || 0), a = t * r + i, o = 6 * r + i;
|
|
30
|
+
e.style.height = "0px";
|
|
31
|
+
let s = e.scrollHeight, c = s;
|
|
32
|
+
S.updown && M.value && s <= a && (c = a), c = Math.max(c, a), c = Math.min(c, o), e.style.height = `${c}px`;
|
|
33
|
+
}, F = g(!1), I = () => {
|
|
34
|
+
F.value = !0;
|
|
35
|
+
}, L = (e) => {
|
|
36
|
+
F.value = !1, R(e);
|
|
37
|
+
}, R = (e) => {
|
|
38
|
+
M.value = e.target.value;
|
|
39
|
+
}, z = () => {
|
|
40
|
+
M.value && A("send");
|
|
41
|
+
}, B = () => {
|
|
42
|
+
A("stop");
|
|
43
|
+
}, V = (e) => {
|
|
44
|
+
if (e.key === "Enter" && !e.ctrlKey && !e.metaKey && (e.preventDefault(), z()), e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
let t = e.target, n = t.selectionStart;
|
|
47
|
+
t.value = t.value.slice(0, n) + "\n" + t.value.slice(n), t.selectionStart = t.selectionEnd = n + 1;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
E(M, () => {
|
|
51
|
+
P();
|
|
52
|
+
}, { immediate: !0 }), h(() => {
|
|
53
|
+
P();
|
|
54
|
+
}), d();
|
|
55
|
+
let H = l(), U = k();
|
|
56
|
+
return _(() => v(U, [C(j).b()])), y(U, null, 0), o(() => u.updown, () => {
|
|
57
|
+
let e = D(), c = i(e), l = i(c), d = p(c, 1);
|
|
58
|
+
return l.$evtinput = s(R), m(l, "compositionend", L), m(l, "compositionstart", I), l.$evtkeydown = s(V), H(l, N, null, "textareaRef"), _(() => {
|
|
59
|
+
let t = C(j);
|
|
60
|
+
v(e, [t.e("updown-wrapper")]), v(c, [t.e("inner")]), x(l, M.value), v(l, [t.e("textarea")]), b(l, "autofocus", u.autofocus), b(l, "placeholder", u.placeholder), v(d, [t.e("operation")]);
|
|
61
|
+
}), y(d, null, 0), a(C(r), {
|
|
62
|
+
type: "primary",
|
|
63
|
+
circle: "",
|
|
64
|
+
disabled: () => !M.value,
|
|
65
|
+
secondary: () => !M.value,
|
|
66
|
+
onClick: () => z
|
|
67
|
+
}, { icon: () => a(C(n), { style: "height: 20px; width: 20px" }) }), y(d, null, 1), o(() => u.loading, () => a(C(r), {
|
|
68
|
+
type: "primary",
|
|
69
|
+
circle: "",
|
|
70
|
+
onClick: () => B
|
|
71
|
+
}, { icon: () => a(C(t), { style: "height: 20px; width: 20px" }) })), e;
|
|
72
|
+
}, () => {
|
|
73
|
+
let e = O(), l = i(e), d = i(l), f = p(l, 1), h = i(f), g = p(h, 1);
|
|
74
|
+
return d.$evtinput = s(R), m(d, "compositionend", L), m(d, "compositionstart", I), d.$evtkeydown = s(V), H(d, N, null, "textareaRef"), _(() => {
|
|
75
|
+
let t = C(j);
|
|
76
|
+
v(e, [t.e("wrapper")]), v(l, [t.e("inner")]), x(d, M.value), v(d, [t.e("textarea")]), b(d, "autofocus", u.autofocus), b(d, "placeholder", u.placeholder), v(f, [t.e("footer")]), v(h, t.e("extra"));
|
|
77
|
+
}), y(h, null, 0), c("extra"), _(() => v(g, [C(j).e("operation")])), y(g, null, 0), a(C(r), {
|
|
78
|
+
type: "primary",
|
|
79
|
+
circle: "",
|
|
80
|
+
disabled: () => !M.value,
|
|
81
|
+
secondary: () => !M.value,
|
|
82
|
+
onClick: () => z
|
|
83
|
+
}, { icon: () => a(C(n), { style: "height: 20px; width: 20px" }) }), y(g, null, 1), o(() => u.loading, () => a(C(r), {
|
|
84
|
+
type: "primary",
|
|
85
|
+
circle: "",
|
|
86
|
+
onClick: () => B
|
|
87
|
+
}, { icon: () => a(C(t), { style: "height: 20px; width: 20px" }) })), e;
|
|
88
|
+
}, 517), U;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { A as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ChatSenderSlots, ChatSenderExpose } from './types.js';
|
|
2
|
+
import { PublicProps, ShallowUnwrapRef, VNode, Plugin } from 'vue';
|
|
3
|
+
export declare const SChatSender: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
|
4
|
+
attrs: any;
|
|
5
|
+
slots: ChatSenderSlots;
|
|
6
|
+
emit: (((evt: "stop") => void) & ((evt: "send") => void)) & ((event: "update:modelValue", value: string) => void);
|
|
7
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
+
props: PublicProps & {
|
|
9
|
+
modelValue?: string | undefined;
|
|
10
|
+
loading?: boolean | undefined;
|
|
11
|
+
autofocus?: boolean | undefined;
|
|
12
|
+
placeholder?: string | undefined;
|
|
13
|
+
updown?: boolean | undefined;
|
|
14
|
+
onStop?: (() => any) | undefined;
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
16
|
+
onSend?: (() => any) | undefined;
|
|
17
|
+
} & (typeof globalThis extends {
|
|
18
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
19
|
+
} ? P : {});
|
|
20
|
+
expose: (exposed: ShallowUnwrapRef<ChatSenderExpose>) => void;
|
|
21
|
+
attrs: any;
|
|
22
|
+
slots: ChatSenderSlots;
|
|
23
|
+
emit: (((evt: "stop") => void) & ((evt: "send") => void)) & ((event: "update:modelValue", value: string) => void);
|
|
24
|
+
}>) => VNode & {
|
|
25
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
26
|
+
}) & Plugin;
|
|
27
|
+
export * from './types.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ChatSenderProps {
|
|
2
|
+
/** 内容 (v-model)*/
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
/** 加载中 */
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
/** 自动聚焦 */
|
|
7
|
+
autofocus?: boolean;
|
|
8
|
+
/** 占位符 */
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
/** 是否上下结构 */
|
|
11
|
+
updown?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ChatSenderSlots {
|
|
14
|
+
/** 额外操作 */
|
|
15
|
+
extra?: () => any;
|
|
16
|
+
}
|
|
17
|
+
export interface ChatSenderEmits {
|
|
18
|
+
/** 发送 */
|
|
19
|
+
send: [];
|
|
20
|
+
/** 停止 */
|
|
21
|
+
stop: [];
|
|
22
|
+
}
|
|
23
|
+
export interface ChatSenderExpose {
|
|
24
|
+
}
|
|
@@ -2,7 +2,7 @@ import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
|
2
2
|
import "../../../hooks/index.mjs";
|
|
3
3
|
import t from "../../../icons/src/right.vue.mjs";
|
|
4
4
|
import "../../../icons/index.mjs";
|
|
5
|
-
import n from "../
|
|
5
|
+
import { STransition as n } from "../transition/index.mjs";
|
|
6
6
|
import { collapseContextKey as r } from "./types.mjs";
|
|
7
7
|
import { applyVShow as i, child as a, computed as o, createComponent as s, createInvoker as c, createSlot as l, defineVaporComponent as u, delegateEvents as d, inject as f, next as p, renderEffect as m, setClass as h, setInsertionState as g, setStyle as _, setText as v, template as y, toDisplayString as b, unref as x } from "vue";
|
|
8
8
|
//#region ../components/src/collapse/collapse-item.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
@@ -26,7 +26,7 @@ var T = /*@__PURE__*/ u({
|
|
|
26
26
|
}), g(A, null, 0), s(x(t)), m(() => h(j, x(y).e("header-title"))), g(j, null, 0), l("title", null, () => {
|
|
27
27
|
let e = S();
|
|
28
28
|
return m(() => v(e, b(u.title))), e;
|
|
29
|
-
}), m(() => h(M, x(y).e("extra"))), g(M, null, 0), l("extra"), k.$evtclick = c(D), g(O, null, 1), s(n,
|
|
29
|
+
}), m(() => h(M, x(y).e("extra"))), g(M, null, 0), l("extra"), k.$evtclick = c(D), g(O, null, 1), s(x(n), { type: "height" }, () => {
|
|
30
30
|
let e = C();
|
|
31
31
|
return m(() => h(e, x(y).e("content"))), g(e, null, 0), l(), i(e, () => E.value), e;
|
|
32
32
|
}), O;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
2
2
|
import "../../../hooks/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import r from "../../../icons/src/calendar.vue.mjs";
|
|
6
|
-
import i from "../../../icons/src/close.vue.mjs";
|
|
3
|
+
import t from "../../../icons/src/calendar.vue.mjs";
|
|
4
|
+
import n from "../../../icons/src/close.vue.mjs";
|
|
7
5
|
import "../../../icons/index.mjs";
|
|
6
|
+
import { formItemContextKey as r } from "../form/types.mjs";
|
|
7
|
+
import { useFormItem as i } from "../form/use-form-item.mjs";
|
|
8
8
|
import { configProviderContextKey as a } from "../config-provider/types.mjs";
|
|
9
9
|
import "../config-provider/index.mjs";
|
|
10
10
|
import { SPopover as o } from "../popover/index.mjs";
|
|
@@ -53,7 +53,7 @@ var O = /*@__PURE__*/ m({
|
|
|
53
53
|
emits: /*@__PURE__*/ h(["change", "clear"], ["update:modelValue"]),
|
|
54
54
|
setup(m, { emit: oe }) {
|
|
55
55
|
E.extend(xe), E.extend(ve), E.extend(be), E.extend(ye);
|
|
56
|
-
let h = m, C = oe, O = e("date-picker"), k = me(m, "modelValue"), Ee = se(a, void 0), De = u(() => Ee?.inputFilled?.value || h.filled), { size: Oe, error: ke } = fe(h), { mergedSize: Ae, mergedError: je } =
|
|
56
|
+
let h = m, C = oe, O = e("date-picker"), k = me(m, "modelValue"), Ee = se(a, void 0), De = u(() => Ee?.inputFilled?.value || h.filled), { size: Oe, error: ke } = fe(h), { mergedSize: Ae, mergedError: je } = i({
|
|
57
57
|
size: Oe,
|
|
58
58
|
error: ke
|
|
59
59
|
}), A = _(!1), Me = () => {
|
|
@@ -243,7 +243,7 @@ var O = /*@__PURE__*/ m({
|
|
|
243
243
|
}, Ye = (e) => Y(e, !1), Xe = () => X(!1), Ze = (e) => Y(e, !0, 0), Qe = () => X(!0, 0), $e = (e) => Y(e, !0, 1), et = () => X(!0, 1), Z = () => {
|
|
244
244
|
let e = k.value;
|
|
245
245
|
P.value = Array.isArray(e) ? [...e] : e, C("change", e), Q("change"), B(!1);
|
|
246
|
-
}, tt = se(
|
|
246
|
+
}, tt = se(r, null), Q = (e) => {
|
|
247
247
|
tt?.validate(e).catch(() => {});
|
|
248
248
|
};
|
|
249
249
|
ge(k, (e) => {
|
|
@@ -315,41 +315,41 @@ var O = /*@__PURE__*/ m({
|
|
|
315
315
|
})), 2565), 2309), 2053), 1797), 1541), 1285), 1029), e.$evtmousedown = _e(() => {}, ["prevent"]), e;
|
|
316
316
|
},
|
|
317
317
|
default: () => f(() => !H.value, () => {
|
|
318
|
-
let e = Ce(),
|
|
319
|
-
return
|
|
320
|
-
let
|
|
318
|
+
let e = Ce(), r = ae(e);
|
|
319
|
+
return r.$evtinput = p(Ye), g(r, "blur", Xe), g(r, "click", T(V, ["stop"])), v(() => {
|
|
320
|
+
let t = w(O), n = m.disabled;
|
|
321
321
|
y(e, [
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
]), S(
|
|
322
|
+
t.e("wrapper"),
|
|
323
|
+
t.is("disabled", n),
|
|
324
|
+
t.is("range", H.value),
|
|
325
|
+
t.is("error", w(je)),
|
|
326
|
+
t.is("filled", De.value)
|
|
327
|
+
]), S(r, Re.value), x(r, "clearable", m.clearable), x(r, "placeholder", Be.value), x(r, "disabled", n), y(r, [t.e("input")]);
|
|
328
328
|
}), b(e, null, 1), f(() => A.value && !!k.value && m.clearable, () => {
|
|
329
329
|
let e = Se();
|
|
330
|
-
return v(() => y(e, [w(O).e("close")])), b(e, null, 0), d(w(
|
|
330
|
+
return v(() => y(e, [w(O).e("close")])), b(e, null, 0), d(w(n)), g(e, "click", T(Pe, ["stop"])), e;
|
|
331
331
|
}, () => {
|
|
332
332
|
let e = D();
|
|
333
|
-
return v(() => y(e, [w(O).e("icon")])), b(e, null, 0), d(w(
|
|
333
|
+
return v(() => y(e, [w(O).e("icon")])), b(e, null, 0), d(w(t)), e;
|
|
334
334
|
}, 261), g(e, "mouseenter", Me), g(e, "mouseleave", Ne), e;
|
|
335
335
|
}, () => {
|
|
336
|
-
let e = we(),
|
|
337
|
-
|
|
338
|
-
let o = pe(
|
|
336
|
+
let e = we(), r = ae(e), i = ce(r, 1), a = ce(i, 2);
|
|
337
|
+
r.$evtinput = p(Ze), g(r, "blur", Qe), g(r, "click", T(V, ["stop"]));
|
|
338
|
+
let o = pe(i);
|
|
339
339
|
return a.$evtinput = p($e), g(a, "blur", et), g(a, "click", T(V, ["stop"])), v(() => {
|
|
340
|
-
let
|
|
340
|
+
let t = w(O), n = m.disabled, i = ze.value, s = m.clearable, c = Ve.value, l = [t.e("input")];
|
|
341
341
|
y(e, [
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
]), S(
|
|
342
|
+
t.e("wrapper"),
|
|
343
|
+
t.is("disabled", n),
|
|
344
|
+
t.is("range", H.value),
|
|
345
|
+
t.is("error", w(je))
|
|
346
|
+
]), S(r, i[0]), x(r, "clearable", s), x(r, "placeholder", c[0]), x(r, "disabled", n), y(r, l), ue(o, de(m.textSeparator)), S(a, i[1]), x(a, "clearable", s), x(a, "placeholder", c[1]), x(a, "disabled", n), y(a, l);
|
|
347
347
|
}), b(e, null, 3), f(() => A.value && !!k.value && m.clearable, () => {
|
|
348
348
|
let e = Se();
|
|
349
|
-
return v(() => y(e, [w(O).e("close")])), b(e, null, 0), d(w(
|
|
349
|
+
return v(() => y(e, [w(O).e("close")])), b(e, null, 0), d(w(n)), g(e, "click", T(Pe, ["stop"])), e.$evtmousedown = _e(() => {}, ["prevent"]), e;
|
|
350
350
|
}, () => {
|
|
351
351
|
let e = D();
|
|
352
|
-
return v(() => y(e, [w(O).e("icon")])), b(e, null, 0), d(w(
|
|
352
|
+
return v(() => y(e, [w(O).e("icon")])), b(e, null, 0), d(w(t)), e;
|
|
353
353
|
}, 773), g(e, "mouseenter", Me), g(e, "mouseleave", Ne), e;
|
|
354
354
|
}, 645)
|
|
355
355
|
}), z, null, "popoverRef"), $;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/src/use-namespace.mjs";
|
|
2
2
|
import "../../../hooks/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import r from "../../../icons/src/calendar.vue.mjs";
|
|
6
|
-
import i from "../../../icons/src/close.vue.mjs";
|
|
3
|
+
import t from "../../../icons/src/calendar.vue.mjs";
|
|
4
|
+
import n from "../../../icons/src/close.vue.mjs";
|
|
7
5
|
import "../../../icons/index.mjs";
|
|
6
|
+
import { formItemContextKey as r } from "../form/types.mjs";
|
|
7
|
+
import { useFormItem as i } from "../form/use-form-item.mjs";
|
|
8
8
|
import { configProviderContextKey as a } from "../config-provider/types.mjs";
|
|
9
9
|
import "../config-provider/index.mjs";
|
|
10
10
|
import { SPopover as o } from "../popover/index.mjs";
|
|
@@ -48,7 +48,7 @@ var k = /*@__PURE__*/ m({
|
|
|
48
48
|
emits: /*@__PURE__*/ h(["change", "clear"], ["update:modelValue"]),
|
|
49
49
|
setup(m, { emit: te }) {
|
|
50
50
|
D.extend(pe), D.extend(he), D.extend(fe), D.extend(me);
|
|
51
|
-
let h = m, w = te, k = e("datetime-picker"), A = ce(m, "modelValue"), be = ne(a, void 0), xe = u(() => be?.inputFilled?.value || h.filled), { size: Se, error: Ce } = oe(h), { mergedSize: we, mergedError: j } =
|
|
51
|
+
let h = m, w = te, k = e("datetime-picker"), A = ce(m, "modelValue"), be = ne(a, void 0), xe = u(() => be?.inputFilled?.value || h.filled), { size: Se, error: Ce } = oe(h), { mergedSize: we, mergedError: j } = i({
|
|
52
52
|
size: Se,
|
|
53
53
|
error: Ce
|
|
54
54
|
}), M = v(!1), Te = () => {
|
|
@@ -202,7 +202,7 @@ var k = /*@__PURE__*/ m({
|
|
|
202
202
|
}, Ve = (e) => Y(e, !1), He = () => X(!1), Ue = (e) => Y(e, !0, 0), We = () => X(!0, 0), Ge = (e) => Y(e, !0, 1), Ke = () => X(!0, 1), Z = () => {
|
|
203
203
|
let e = A.value;
|
|
204
204
|
I.value = Array.isArray(e) ? [...e] : e, w("change", e), Q("change"), H(!1);
|
|
205
|
-
}, qe = ne(
|
|
205
|
+
}, qe = ne(r, null), Q = (e) => {
|
|
206
206
|
qe?.validate(e).catch(() => {});
|
|
207
207
|
};
|
|
208
208
|
ue(A, (e) => {
|
|
@@ -243,41 +243,41 @@ var k = /*@__PURE__*/ m({
|
|
|
243
243
|
})), 1285), 1029), e.$evtmousedown = de(() => {}, ["prevent"]), e;
|
|
244
244
|
},
|
|
245
245
|
default: () => f(() => !W.value, () => {
|
|
246
|
-
let e = _e(),
|
|
247
|
-
return
|
|
248
|
-
let
|
|
246
|
+
let e = _e(), r = ee(e);
|
|
247
|
+
return r.$evtinput = p(Ve), _(r, "blur", He), _(r, "click", E(U, ["stop"])), y(() => {
|
|
248
|
+
let t = T(k), n = m.disabled;
|
|
249
249
|
b(e, [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
]), C(
|
|
250
|
+
t.e("wrapper"),
|
|
251
|
+
t.is("disabled", n),
|
|
252
|
+
t.is("range", W.value),
|
|
253
|
+
t.is("error", T(j)),
|
|
254
|
+
t.is("filled", xe.value)
|
|
255
|
+
]), C(r, Me.value), S(r, "clearable", m.clearable), S(r, "placeholder", Pe.value), S(r, "disabled", n), b(r, [t.e("input")]);
|
|
256
256
|
}), x(e, null, 1), f(() => M.value && !!A.value && m.clearable, () => {
|
|
257
257
|
let e = ge();
|
|
258
|
-
return y(() => b(e, [T(k).e("close")])), x(e, null, 0), d(T(
|
|
258
|
+
return y(() => b(e, [T(k).e("close")])), x(e, null, 0), d(T(n)), _(e, "click", E(De, ["stop"])), e;
|
|
259
259
|
}, () => {
|
|
260
260
|
let e = O();
|
|
261
|
-
return y(() => b(e, [T(k).e("icon")])), x(e, null, 0), d(T(
|
|
261
|
+
return y(() => b(e, [T(k).e("icon")])), x(e, null, 0), d(T(t)), e;
|
|
262
262
|
}, 261), _(e, "mouseenter", Te), _(e, "mouseleave", Ee), e;
|
|
263
263
|
}, () => {
|
|
264
|
-
let e = ve(),
|
|
265
|
-
|
|
266
|
-
let o = se(
|
|
264
|
+
let e = ve(), r = ee(e), i = g(r, 1), a = g(i, 2);
|
|
265
|
+
r.$evtinput = p(Ue), _(r, "blur", We), _(r, "click", E(U, ["stop"]));
|
|
266
|
+
let o = se(i);
|
|
267
267
|
return a.$evtinput = p(Ge), _(a, "blur", Ke), _(a, "click", E(U, ["stop"])), y(() => {
|
|
268
|
-
let
|
|
268
|
+
let t = T(k), n = m.disabled, i = Ne.value, s = m.clearable, c = Fe.value, l = [t.e("input")];
|
|
269
269
|
b(e, [
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
]), C(
|
|
270
|
+
t.e("wrapper"),
|
|
271
|
+
t.is("disabled", n),
|
|
272
|
+
t.is("range", W.value),
|
|
273
|
+
t.is("error", T(j))
|
|
274
|
+
]), C(r, i[0]), S(r, "clearable", s), S(r, "placeholder", c[0]), S(r, "disabled", n), b(r, l), ie(o, ae(m.textSeparator)), C(a, i[1]), S(a, "clearable", s), S(a, "placeholder", c[1]), S(a, "disabled", n), b(a, l);
|
|
275
275
|
}), x(e, null, 3), f(() => M.value && !!A.value && m.clearable, () => {
|
|
276
276
|
let e = ge();
|
|
277
|
-
return y(() => b(e, [T(k).e("close")])), x(e, null, 0), d(T(
|
|
277
|
+
return y(() => b(e, [T(k).e("close")])), x(e, null, 0), d(T(n)), _(e, "click", E(De, ["stop"])), e.$evtmousedown = de(() => {}, ["prevent"]), e;
|
|
278
278
|
}, () => {
|
|
279
279
|
let e = O();
|
|
280
|
-
return y(() => b(e, [T(k).e("icon")])), x(e, null, 0), d(T(
|
|
280
|
+
return y(() => b(e, [T(k).e("icon")])), x(e, null, 0), d(T(t)), e;
|
|
281
281
|
}, 773), _(e, "mouseenter", Te), _(e, "mouseleave", Ee), e;
|
|
282
282
|
}, 645)
|
|
283
283
|
}), V, null, "popoverRef"), $;
|