ant-design-x-vue 1.2.7 → 1.2.8
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/index.esm.js +7353 -6936
- package/dist/index.umd.js +66 -66
- package/es/_util/cssinjs/StyleContext.mjs +48 -42
- package/es/attachments/FileList/FileList2.mjs +12 -10
- package/es/index.mjs +79 -45
- package/es/sender/Sender.mjs +82 -78
- package/es/sender/components/ActionButton/index.mjs +15 -12
- package/es/sender/components/ClearButton.mjs +15 -12
- package/es/sender/components/LoadingButton.mjs +16 -13
- package/es/sender/components/SendButton.mjs +17 -14
- package/es/sender/components/SpeechButton/RecordingIcon.mjs +21 -18
- package/es/sender/components/SpeechButton/index.mjs +31 -25
- package/es/suggestion/Suggestion.mjs +154 -49
- package/es/welcome/Welcome.mjs +44 -36
- package/lib/_util/cssinjs/StyleContext.js +1 -1
- package/lib/attachments/FileList/FileList2.js +1 -1
- package/lib/index.js +1 -1
- package/lib/sender/Sender.js +1 -1
- package/lib/sender/components/ActionButton/index.js +1 -1
- package/lib/sender/components/ClearButton.js +1 -1
- package/lib/sender/components/LoadingButton.js +1 -1
- package/lib/sender/components/SendButton.js +1 -1
- package/lib/sender/components/SpeechButton/RecordingIcon.js +1 -1
- package/lib/sender/components/SpeechButton/index.js +1 -1
- package/lib/suggestion/Suggestion.js +1 -1
- package/lib/welcome/Welcome.js +1 -1
- package/package.json +2 -2
- package/typings/_util/cssinjs/StyleContext.d.ts +6 -6
- package/typings/_util/cssinjs/index.d.ts +3 -3
- package/typings/bubble/hooks/useTypingConfig.d.ts +1 -1
- package/typings/bubble/interface.d.ts +1 -1
- package/typings/index.d.ts +1 -0
- package/typings/sender/interface.d.ts +6 -0
- package/typings/sender/useSpeech.d.ts +5 -1
- package/typings/welcome/interface.d.ts +4 -4
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { inject as A, shallowRef as C, getCurrentInstance as T, defineComponent as g, watch as
|
|
2
|
-
import
|
|
3
|
-
import { withInstall as
|
|
4
|
-
|
|
1
|
+
import { inject as A, shallowRef as C, getCurrentInstance as T, defineComponent as g, h as P, watch as v, unref as d, provide as x } from "vue";
|
|
2
|
+
import b from "./Cache.mjs";
|
|
3
|
+
import { withInstall as I, arrayType as u, booleanType as l, someType as E, stringType as f, objectType as N } from "../type.mjs";
|
|
4
|
+
import { StyleProvider as j } from "ant-design-vue";
|
|
5
|
+
const q = "data-token-hash", h = "data-css-hash", D = "data-cache-path", i = "__cssinjs_instance__";
|
|
5
6
|
function s() {
|
|
6
7
|
const e = Math.random().toString(12).slice(2);
|
|
7
8
|
if (typeof document < "u" && document.head && document.body) {
|
|
@@ -11,22 +12,22 @@ function s() {
|
|
|
11
12
|
Array.from(o).forEach((t) => {
|
|
12
13
|
t[i] = t[i] || e, t[i] === e && document.head.insertBefore(t, n);
|
|
13
14
|
});
|
|
14
|
-
const
|
|
15
|
+
const r = {};
|
|
15
16
|
Array.from(document.querySelectorAll(`style[${h}]`)).forEach((t) => {
|
|
16
|
-
var
|
|
17
|
-
const
|
|
18
|
-
c
|
|
17
|
+
var a;
|
|
18
|
+
const c = t.getAttribute(h);
|
|
19
|
+
r[c] ? t[i] === e && ((a = t.parentNode) == null || a.removeChild(t)) : r[c] = !0;
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
return new
|
|
22
|
+
return new b(e);
|
|
22
23
|
}
|
|
23
|
-
const p = Symbol("StyleContextKey"),
|
|
24
|
-
var n,
|
|
24
|
+
const p = Symbol("StyleContextKey"), w = () => {
|
|
25
|
+
var n, r, t;
|
|
25
26
|
const e = T();
|
|
26
27
|
let o;
|
|
27
28
|
if (e && e.appContext) {
|
|
28
|
-
const
|
|
29
|
-
|
|
29
|
+
const c = (t = (r = (n = e.appContext) == null ? void 0 : n.config) == null ? void 0 : r.globalProperties) == null ? void 0 : t.__ANTDV_CSSINJS_CACHE__;
|
|
30
|
+
c ? o = c : (o = s(), e.appContext.config.globalProperties && (e.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = o));
|
|
30
31
|
} else
|
|
31
32
|
o = s();
|
|
32
33
|
return o;
|
|
@@ -35,32 +36,32 @@ const p = Symbol("StyleContextKey"), N = () => {
|
|
|
35
36
|
defaultCache: !0,
|
|
36
37
|
hashPriority: "low"
|
|
37
38
|
}, y = () => {
|
|
38
|
-
const e =
|
|
39
|
+
const e = w();
|
|
39
40
|
return A(p, C({
|
|
40
41
|
...m,
|
|
41
42
|
cache: e
|
|
42
43
|
}));
|
|
43
|
-
},
|
|
44
|
+
}, S = (e) => {
|
|
44
45
|
const o = y(), n = C({
|
|
45
46
|
...m,
|
|
46
47
|
cache: s()
|
|
47
48
|
});
|
|
48
|
-
return
|
|
49
|
-
const
|
|
49
|
+
return v([() => d(e), o], () => {
|
|
50
|
+
const r = {
|
|
50
51
|
...o.value
|
|
51
52
|
}, t = d(e);
|
|
52
|
-
Object.keys(t).forEach((
|
|
53
|
-
const
|
|
54
|
-
t[
|
|
53
|
+
Object.keys(t).forEach((a) => {
|
|
54
|
+
const _ = t[a];
|
|
55
|
+
t[a] !== void 0 && (r[a] = _);
|
|
55
56
|
});
|
|
56
57
|
const {
|
|
57
|
-
cache:
|
|
58
|
+
cache: c
|
|
58
59
|
} = t;
|
|
59
|
-
|
|
60
|
+
r.cache = r.cache || s(), r.defaultCache = !c && o.value.defaultCache, n.value = r;
|
|
60
61
|
}, {
|
|
61
62
|
immediate: !0
|
|
62
|
-
}),
|
|
63
|
-
},
|
|
63
|
+
}), x(p, n), n;
|
|
64
|
+
}, H = () => ({
|
|
64
65
|
autoClear: l(),
|
|
65
66
|
/** @private Test only. Not work in production. */
|
|
66
67
|
mock: f(),
|
|
@@ -68,13 +69,13 @@ const p = Symbol("StyleContextKey"), N = () => {
|
|
|
68
69
|
* Only set when you need ssr to extract style on you own.
|
|
69
70
|
* If not provided, it will auto create <style /> on the end of Provider in server side.
|
|
70
71
|
*/
|
|
71
|
-
cache:
|
|
72
|
+
cache: N(),
|
|
72
73
|
/** Tell children that this context is default generated context */
|
|
73
74
|
defaultCache: l(),
|
|
74
75
|
/** Use `:where` selector to reduce hashId css selector priority */
|
|
75
76
|
hashPriority: f(),
|
|
76
77
|
/** Tell cssinjs where to inject style in */
|
|
77
|
-
container:
|
|
78
|
+
container: E(),
|
|
78
79
|
/** Component wil render inline `<style />` for fallback in SSR. Not recommend. */
|
|
79
80
|
ssrInline: l(),
|
|
80
81
|
/** Transform css before inject in document. Please note that `transformers` do not support dynamic update */
|
|
@@ -85,32 +86,37 @@ const p = Symbol("StyleContextKey"), N = () => {
|
|
|
85
86
|
* Please note that `linters` do not support dynamic update.
|
|
86
87
|
*/
|
|
87
88
|
linters: u()
|
|
88
|
-
}),
|
|
89
|
-
name: "
|
|
89
|
+
}), R = I(/* @__PURE__ */ g({
|
|
90
|
+
name: "AXStyleProvider",
|
|
90
91
|
inheritAttrs: !1,
|
|
91
|
-
props:
|
|
92
|
+
props: H(),
|
|
92
93
|
setup(e, {
|
|
93
94
|
slots: o
|
|
94
95
|
}) {
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
return S(e), () => P(
|
|
97
|
+
j,
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
e,
|
|
100
|
+
() => {
|
|
101
|
+
var n;
|
|
102
|
+
return (n = o.default) == null ? void 0 : n.call(o);
|
|
103
|
+
}
|
|
104
|
+
);
|
|
99
105
|
}
|
|
100
|
-
})),
|
|
106
|
+
})), M = {
|
|
101
107
|
useStyleInject: y,
|
|
102
|
-
useStyleProvider:
|
|
103
|
-
StyleProvider:
|
|
108
|
+
useStyleProvider: S,
|
|
109
|
+
StyleProvider: R
|
|
104
110
|
};
|
|
105
111
|
export {
|
|
106
|
-
|
|
112
|
+
D as ATTR_CACHE_PATH,
|
|
107
113
|
h as ATTR_MARK,
|
|
108
|
-
|
|
114
|
+
q as ATTR_TOKEN,
|
|
109
115
|
i as CSS_IN_JS_INSTANCE,
|
|
110
|
-
|
|
116
|
+
R as StyleProvider,
|
|
111
117
|
s as createCache,
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
M as default,
|
|
119
|
+
H as styleProviderProps,
|
|
114
120
|
y as useStyleInject,
|
|
115
|
-
|
|
121
|
+
S as useStyleProvider
|
|
116
122
|
};
|
|
@@ -1246,16 +1246,18 @@ const Me = 1, on = /* @__PURE__ */ ze({
|
|
|
1246
1246
|
name: "AXAttachmentsFileList",
|
|
1247
1247
|
__name: "FileList",
|
|
1248
1248
|
props: {
|
|
1249
|
-
prefixCls:
|
|
1250
|
-
items:
|
|
1251
|
-
onRemove: {
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1249
|
+
prefixCls: null,
|
|
1250
|
+
items: null,
|
|
1251
|
+
onRemove: {
|
|
1252
|
+
type: Function
|
|
1253
|
+
},
|
|
1254
|
+
overflow: null,
|
|
1255
|
+
upload: null,
|
|
1256
|
+
imageProps: null,
|
|
1257
|
+
listClassName: null,
|
|
1258
|
+
listStyle: null,
|
|
1259
|
+
itemClassName: null,
|
|
1260
|
+
itemStyle: null
|
|
1259
1261
|
},
|
|
1260
1262
|
setup(e) {
|
|
1261
1263
|
const r = dt(() => `${e.prefixCls}-list`), t = mt("file-list-container"), [n, a] = I(!1), i = ht();
|
package/es/index.mjs
CHANGED
|
@@ -1,49 +1,83 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { default as
|
|
5
|
-
import {
|
|
6
|
-
import { default as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { c as r } from "./components.ts2.mjs";
|
|
2
|
+
import a from "./_util/cssinjs/index.mjs";
|
|
3
|
+
import { _experimental as x } from "./_util/cssinjs/index.mjs";
|
|
4
|
+
import { default as d } from "./x-stream/x-stream.mjs";
|
|
5
|
+
import { default as c } from "./x-request/x-fetch.mjs";
|
|
6
|
+
import { default as h } from "./x-request/x-request.mjs";
|
|
7
|
+
import { XAgent as y, default as C } from "./use-x-agent/use-x-agent.mjs";
|
|
8
|
+
import { default as X } from "./use-x-chat/use-x-chat.mjs";
|
|
9
|
+
import { theme as T } from "ant-design-vue";
|
|
10
|
+
import { _ as L } from "./x-provider/index2.mjs";
|
|
11
|
+
import { defaultPrefixCls as k, default as A } from "./x-provider/hooks/use-x-provider-context.mjs";
|
|
12
|
+
import { default as B } from "./bubble/BubbleList.mjs";
|
|
13
|
+
import { default as _ } from "./conversations/Conversations.mjs";
|
|
14
|
+
import { default as E } from "./welcome/Welcome.mjs";
|
|
15
|
+
import { default as I } from "./prompts/Prompts.mjs";
|
|
16
|
+
import { default as N } from "./suggestion/Suggestion.mjs";
|
|
17
|
+
import { default as W } from "./thought-chain/ThoughtChain.mjs";
|
|
18
|
+
import { default as z } from "./_util/cssinjs/theme/Theme.mjs";
|
|
19
|
+
import { default as G } from "./_util/cssinjs/theme/createTheme.mjs";
|
|
20
|
+
import { e as J, u as M } from "./_util/cssinjs/hooks/useStyleRegister/index.tsx2.mjs";
|
|
21
|
+
import { u as U } from "./_util/cssinjs/hooks/useCacheToken.tsx2.mjs";
|
|
22
|
+
import { default as Z } from "./_util/cssinjs/Keyframes.mjs";
|
|
23
|
+
import { default as ee } from "./_util/cssinjs/transformers/legacyLogicalProperties.mjs";
|
|
24
|
+
import { default as re } from "./_util/cssinjs/transformers/px2rem.mjs";
|
|
25
|
+
import { default as ae } from "./_util/cssinjs/linters/logicalPropertiesLinter.mjs";
|
|
26
|
+
import { default as se } from "./_util/cssinjs/linters/legacyNotSelectorLinter.mjs";
|
|
27
|
+
import { default as le } from "./_util/cssinjs/linters/parentSelectorLinter.mjs";
|
|
28
|
+
import { default as pe } from "./_util/cssinjs/hooks/useCSSVarRegister.mjs";
|
|
29
|
+
import { default as ne } from "./bubble/index.mjs";
|
|
30
|
+
import { default as ie } from "./sender/index.mjs";
|
|
31
|
+
import { default as Se } from "./attachments/index.mjs";
|
|
32
|
+
import { StyleProvider as ge, createCache as ye, useStyleInject as Ce, useStyleProvider as Pe } from "./_util/cssinjs/StyleContext.mjs";
|
|
33
|
+
import { token2CSSVar as ve, unit as Te } from "./_util/cssinjs/util.mjs";
|
|
34
|
+
const f = function(e) {
|
|
35
|
+
return Object.keys(r).forEach((o) => {
|
|
36
|
+
const t = r[o];
|
|
22
37
|
t.install && e.use(t);
|
|
23
|
-
}), e;
|
|
24
|
-
},
|
|
25
|
-
install:
|
|
38
|
+
}), e.use(a.StyleProvider), e;
|
|
39
|
+
}, l = {
|
|
40
|
+
install: f
|
|
26
41
|
};
|
|
27
42
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
Se as Attachments,
|
|
44
|
+
ne as Bubble,
|
|
45
|
+
B as BubbleList,
|
|
46
|
+
_ as Conversations,
|
|
47
|
+
Z as Keyframes,
|
|
48
|
+
I as Prompts,
|
|
49
|
+
ie as Sender,
|
|
50
|
+
ge as StyleProvider,
|
|
51
|
+
N as Suggestion,
|
|
52
|
+
z as Theme,
|
|
53
|
+
W as ThoughtChain,
|
|
54
|
+
E as Welcome,
|
|
55
|
+
y as XAgent,
|
|
56
|
+
c as XFetch,
|
|
57
|
+
L as XProvider,
|
|
58
|
+
h as XRequest,
|
|
59
|
+
d as XStream,
|
|
60
|
+
x as _experimental,
|
|
61
|
+
ye as createCache,
|
|
62
|
+
G as createTheme,
|
|
63
|
+
l as default,
|
|
64
|
+
k as defaultPrefixCls,
|
|
65
|
+
J as extractStyle,
|
|
66
|
+
f as install,
|
|
67
|
+
ee as legacyLogicalPropertiesTransformer,
|
|
68
|
+
se as legacyNotSelectorLinter,
|
|
69
|
+
ae as logicalPropertiesLinter,
|
|
70
|
+
le as parentSelectorLinter,
|
|
71
|
+
re as px2remTransformer,
|
|
72
|
+
T as theme,
|
|
73
|
+
ve as token2CSSVar,
|
|
74
|
+
Te as unit,
|
|
75
|
+
pe as useCSSVarRegister,
|
|
76
|
+
U as useCacheToken,
|
|
77
|
+
Ce as useStyleInject,
|
|
78
|
+
Pe as useStyleProvider,
|
|
79
|
+
M as useStyleRegister,
|
|
80
|
+
C as useXAgent,
|
|
81
|
+
X as useXChat,
|
|
82
|
+
A as useXProviderContext
|
|
49
83
|
};
|
package/es/sender/Sender.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ee, mergeDefaults as
|
|
1
|
+
import { defineComponent as ee, mergeDefaults as ne, toRef as te, useSlots as ae, computed as a, ref as d, watch as le, createVNode as l, mergeProps as oe } from "vue";
|
|
2
2
|
import { a as se, c as r } from "../attachments/Attachments2.mjs";
|
|
3
3
|
import { Input as ie, Flex as ue } from "ant-design-vue";
|
|
4
4
|
import ce from "../_util/pick-attrs.mjs";
|
|
@@ -7,9 +7,9 @@ import "../x-provider/index.mjs";
|
|
|
7
7
|
import { SenderHeaderContextProvider as fe } from "./context.mjs";
|
|
8
8
|
import { ActionButtonContextProvider as de } from "./components/ActionButton/context.mjs";
|
|
9
9
|
import me from "./components/ClearButton.mjs";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
10
|
+
import $ from "./components/LoadingButton.mjs";
|
|
11
|
+
import I from "./components/SendButton.mjs";
|
|
12
|
+
import B from "./components/SpeechButton/index.mjs";
|
|
13
13
|
import ve from "./style/index.mjs";
|
|
14
14
|
import ye from "./useSpeech.mjs";
|
|
15
15
|
import Ce from "../_util/getValue.mjs";
|
|
@@ -17,7 +17,7 @@ import he from "../x-provider/hooks/use-x-provider-context.mjs";
|
|
|
17
17
|
const ze = /* @__PURE__ */ ee({
|
|
18
18
|
name: "AXSender",
|
|
19
19
|
__name: "Sender",
|
|
20
|
-
props:
|
|
20
|
+
props: ne({
|
|
21
21
|
onKeyPress: {
|
|
22
22
|
type: Function
|
|
23
23
|
},
|
|
@@ -87,45 +87,45 @@ const ze = /* @__PURE__ */ ee({
|
|
|
87
87
|
}),
|
|
88
88
|
emits: ["update:value"],
|
|
89
89
|
setup(e, {
|
|
90
|
-
expose:
|
|
91
|
-
emit:
|
|
90
|
+
expose: K,
|
|
91
|
+
emit: R
|
|
92
92
|
}) {
|
|
93
93
|
const V = se(e, ["prefixCls", "styles", "classNames", "className", "rootClassName", "style", "defaultValue", "value", "placeholder", "readOnly", "submitType", "onSubmit", "loading", "components", "onCancel", "onChange", "actions", "onKeyPress", "onKeyDown", "disabled", "allowSpeech", "prefix", "footer", "header", "onPaste", "onPasteFile", "autoSize"]);
|
|
94
|
-
|
|
95
|
-
function T(
|
|
96
|
-
return Ce(
|
|
94
|
+
te(e, "prefixCls");
|
|
95
|
+
function T(n, t, c) {
|
|
96
|
+
return Ce(n, t) || c;
|
|
97
97
|
}
|
|
98
98
|
const m = {
|
|
99
|
-
SendButton:
|
|
99
|
+
SendButton: I,
|
|
100
100
|
ClearButton: me,
|
|
101
|
-
LoadingButton:
|
|
102
|
-
SpeechButton:
|
|
103
|
-
}, z =
|
|
101
|
+
LoadingButton: $,
|
|
102
|
+
SpeechButton: B
|
|
103
|
+
}, z = R, i = ae(), {
|
|
104
104
|
direction: A,
|
|
105
105
|
getPrefixCls: E
|
|
106
|
-
} = he(), o =
|
|
106
|
+
} = he(), o = a(() => E("sender", e.prefixCls)), v = d(null), f = d(null), s = re("sender"), g = a(() => `${o.value}-input`), [k, O, X] = ve(o.value), L = a(() => r(o.value, s.value.className, e.className, e.rootClassName, O.value, X, {
|
|
107
107
|
[`${o.value}-rtl`]: A.value === "rtl",
|
|
108
108
|
[`${o.value}-disabled`]: e.disabled
|
|
109
|
-
})),
|
|
110
|
-
u.value =
|
|
109
|
+
})), M = a(() => `${o.value}-actions-btn`), S = a(() => `${o.value}-actions-list`), u = d(e.value ?? e.defaultValue ?? ""), b = (n) => {
|
|
110
|
+
u.value = n;
|
|
111
111
|
};
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
le(() => e.value, () => {
|
|
113
|
+
b(e.value);
|
|
114
114
|
});
|
|
115
|
-
const y = (
|
|
116
|
-
|
|
115
|
+
const y = (n, t) => {
|
|
116
|
+
b(n), z("update:value", n), e.onChange && e.onChange(n, t);
|
|
117
117
|
}, {
|
|
118
|
-
speechPermission:
|
|
119
|
-
triggerSpeech:
|
|
118
|
+
speechPermission: j,
|
|
119
|
+
triggerSpeech: x,
|
|
120
120
|
recording: q
|
|
121
|
-
} = ye((
|
|
122
|
-
y(`${u.value} ${
|
|
123
|
-
}, () => e.allowSpeech), H = T(e.components, ["input"], ie.TextArea),
|
|
121
|
+
} = ye((n) => {
|
|
122
|
+
y(`${u.value} ${n}`);
|
|
123
|
+
}, () => e.allowSpeech), H = T(e.components, ["input"], ie.TextArea), p = a(() => ce(V, {
|
|
124
124
|
attr: !0,
|
|
125
125
|
aria: !0,
|
|
126
126
|
data: !0
|
|
127
|
-
})), G =
|
|
128
|
-
...
|
|
127
|
+
})), G = a(() => ({
|
|
128
|
+
...p.value,
|
|
129
129
|
ref: f
|
|
130
130
|
})), C = () => {
|
|
131
131
|
u.value && e.onSubmit && !e.loading && e.onSubmit(u.value);
|
|
@@ -135,98 +135,102 @@ const ze = /* @__PURE__ */ ee({
|
|
|
135
135
|
h.value = !0;
|
|
136
136
|
}, U = () => {
|
|
137
137
|
h.value = !1;
|
|
138
|
-
}, W = (
|
|
139
|
-
const
|
|
138
|
+
}, W = (n) => {
|
|
139
|
+
const t = n.key === "Enter" && !h.value;
|
|
140
140
|
switch (e.submitType) {
|
|
141
141
|
case "enter":
|
|
142
|
-
|
|
142
|
+
t && !n.shiftKey && (n.preventDefault(), C());
|
|
143
143
|
break;
|
|
144
144
|
case "shiftEnter":
|
|
145
|
-
|
|
145
|
+
t && n.shiftKey && (n.preventDefault(), C());
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
148
|
-
e.onKeyPress && e.onKeyPress(
|
|
149
|
-
}, Y = (
|
|
150
|
-
var c,
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
}, Z = (
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
}, P =
|
|
157
|
-
let
|
|
148
|
+
e.onKeyPress && e.onKeyPress(n);
|
|
149
|
+
}, Y = (n) => {
|
|
150
|
+
var c, F;
|
|
151
|
+
const t = (c = n.clipboardData) == null ? void 0 : c.files;
|
|
152
|
+
t != null && t.length && e.onPasteFile && (e.onPasteFile(t[0], t), n.preventDefault()), (F = e.onPaste) == null || F.call(e, n);
|
|
153
|
+
}, Z = (n) => {
|
|
154
|
+
var t, c;
|
|
155
|
+
n.target !== ((t = v.value) == null ? void 0 : t.querySelector(`.${g.value}`)) && n.preventDefault(), (c = f.value) == null || c.focus();
|
|
156
|
+
}, P = a(() => {
|
|
157
|
+
let n = l(ue, {
|
|
158
158
|
class: `${S.value}-presets`
|
|
159
159
|
}, {
|
|
160
|
-
default: () => [e.allowSpeech &&
|
|
160
|
+
default: () => [e.allowSpeech && l(B, typeof e.allowSpeech == "object" ? {
|
|
161
|
+
audioIcon: e.allowSpeech.audioIcon,
|
|
162
|
+
audioDisabledIcon: e.allowSpeech.audioDisabledIcon,
|
|
163
|
+
audioRecordingIcon: e.allowSpeech.audioRecordingIcon
|
|
164
|
+
} : {}, null), e.loading ? l($, null, null) : l(I, null, null)]
|
|
161
165
|
});
|
|
162
|
-
const
|
|
166
|
+
const t = {
|
|
163
167
|
components: m
|
|
164
168
|
};
|
|
165
|
-
return i.actions ?
|
|
166
|
-
ori:
|
|
167
|
-
info:
|
|
168
|
-
}) : typeof e.actions == "function" ?
|
|
169
|
-
}), _ =
|
|
170
|
-
prefixCls:
|
|
169
|
+
return i.actions ? n = i.actions({
|
|
170
|
+
ori: n,
|
|
171
|
+
info: t
|
|
172
|
+
}) : typeof e.actions == "function" ? n = e.actions(n, t) : (e.actions || e.actions === !1) && (n = e.actions), n;
|
|
173
|
+
}), _ = a(() => ({
|
|
174
|
+
prefixCls: M.value,
|
|
171
175
|
onSend: C,
|
|
172
176
|
onSendDisabled: !u.value,
|
|
173
177
|
onClear: J,
|
|
174
178
|
onClearDisabled: !u.value,
|
|
175
179
|
onCancel: e.onCancel,
|
|
176
180
|
onCancelDisabled: !e.loading,
|
|
177
|
-
onSpeech: () =>
|
|
178
|
-
onSpeechDisabled: !
|
|
181
|
+
onSpeech: () => x(!1),
|
|
182
|
+
onSpeechDisabled: !j.value,
|
|
179
183
|
speechRecording: q.value,
|
|
180
184
|
disabled: e.disabled
|
|
181
|
-
})), N =
|
|
182
|
-
let
|
|
183
|
-
const
|
|
185
|
+
})), N = a(() => {
|
|
186
|
+
let n = null;
|
|
187
|
+
const t = {
|
|
184
188
|
components: m
|
|
185
189
|
};
|
|
186
|
-
return i.footer ?
|
|
187
|
-
info:
|
|
188
|
-
}) : typeof e.footer == "function" ?
|
|
190
|
+
return i.footer ? n = i.footer({
|
|
191
|
+
info: t
|
|
192
|
+
}) : typeof e.footer == "function" ? n = e.footer({
|
|
189
193
|
components: m
|
|
190
|
-
}) : e.footer && (
|
|
191
|
-
}),
|
|
192
|
-
return
|
|
194
|
+
}) : e.footer && (n = e.footer), n;
|
|
195
|
+
}), w = a(() => i.header ? i.header() : typeof e.header == "function" ? e.header() : e.header), D = a(() => i.prefix ? i.prefix() : typeof e.prefix == "function" ? e.prefix() : e.prefix);
|
|
196
|
+
return K({
|
|
193
197
|
nativeElement: v.value,
|
|
194
198
|
// @ts-expect-error
|
|
195
|
-
focus: (
|
|
196
|
-
var
|
|
197
|
-
return (
|
|
199
|
+
focus: (n) => {
|
|
200
|
+
var t;
|
|
201
|
+
return (t = f.value) == null ? void 0 : t.focus(n);
|
|
198
202
|
},
|
|
199
203
|
// @ts-expect-error
|
|
200
204
|
blur: () => {
|
|
201
|
-
var
|
|
202
|
-
return (
|
|
205
|
+
var n;
|
|
206
|
+
return (n = f.value) == null ? void 0 : n.blur();
|
|
203
207
|
}
|
|
204
|
-
}), () => k(
|
|
208
|
+
}), () => k(l("div", {
|
|
205
209
|
ref: v,
|
|
206
|
-
class:
|
|
210
|
+
class: L.value,
|
|
207
211
|
style: {
|
|
208
212
|
...s.value.style,
|
|
209
213
|
...e.style
|
|
210
214
|
}
|
|
211
|
-
}, [
|
|
215
|
+
}, [w.value && l(fe, {
|
|
212
216
|
value: {
|
|
213
217
|
prefixCls: o.value
|
|
214
218
|
}
|
|
215
219
|
}, {
|
|
216
|
-
default: () => [
|
|
217
|
-
}),
|
|
220
|
+
default: () => [w.value]
|
|
221
|
+
}), l(de, {
|
|
218
222
|
value: _.value
|
|
219
223
|
}, {
|
|
220
|
-
default: () => [
|
|
224
|
+
default: () => [l("div", {
|
|
221
225
|
class: `${o.value}-content`,
|
|
222
226
|
onMousedown: Z
|
|
223
|
-
}, [
|
|
227
|
+
}, [D.value && l("div", {
|
|
224
228
|
class: r(`${o.value}-prefix`, s.value.classNames.prefix, e.classNames.prefix),
|
|
225
229
|
style: {
|
|
226
230
|
...s.value.styles.prefix,
|
|
227
231
|
...e.styles.prefix
|
|
228
232
|
}
|
|
229
|
-
}, [
|
|
233
|
+
}, [D.value]), l(H, oe(G.value, {
|
|
230
234
|
disabled: e.disabled,
|
|
231
235
|
style: {
|
|
232
236
|
...s.value.styles.input,
|
|
@@ -235,8 +239,8 @@ const ze = /* @__PURE__ */ ee({
|
|
|
235
239
|
class: r(g.value, s.value.classNames.input, e.classNames.input),
|
|
236
240
|
autoSize: e.autoSize,
|
|
237
241
|
value: u.value,
|
|
238
|
-
onChange: (
|
|
239
|
-
y(
|
|
242
|
+
onChange: (n) => {
|
|
243
|
+
y(n.target.value, n), x(!0);
|
|
240
244
|
},
|
|
241
245
|
onPressEnter: W,
|
|
242
246
|
onCompositionstart: Q,
|
|
@@ -246,13 +250,13 @@ const ze = /* @__PURE__ */ ee({
|
|
|
246
250
|
onPaste: Y,
|
|
247
251
|
bordered: !1,
|
|
248
252
|
readOnly: e.readOnly
|
|
249
|
-
}), null), P.value &&
|
|
253
|
+
}), null), P.value && l("div", {
|
|
250
254
|
class: r(S.value, s.value.classNames.actions, e.classNames.actions),
|
|
251
255
|
style: {
|
|
252
256
|
...s.value.styles.actions,
|
|
253
257
|
...e.styles.actions
|
|
254
258
|
}
|
|
255
|
-
}, [P.value])]), N.value &&
|
|
259
|
+
}, [P.value])]), N.value && l("div", {
|
|
256
260
|
class: r(`${o.value}-footer`, s.value.classNames.footer, e.classNames.footer),
|
|
257
261
|
style: {
|
|
258
262
|
...s.value.styles.footer,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
1
|
+
import { defineComponent as r, toRef as u, useSlots as f, computed as s, createVNode as m, mergeProps as b } from "vue";
|
|
2
|
+
import { a as y, c as p } from "../../../attachments/Attachments2.mjs";
|
|
3
3
|
import { Button as C } from "ant-design-vue";
|
|
4
4
|
import { useActionButtonContextInject as x } from "./context.mjs";
|
|
5
|
-
const A = /* @__PURE__ */
|
|
5
|
+
const A = /* @__PURE__ */ r({
|
|
6
6
|
name: "AXSenderActionButton",
|
|
7
7
|
__name: "index",
|
|
8
8
|
props: {
|
|
@@ -35,28 +35,31 @@ const A = /* @__PURE__ */ d({
|
|
|
35
35
|
target: {},
|
|
36
36
|
title: {},
|
|
37
37
|
onClick: {},
|
|
38
|
-
onMousedown: {}
|
|
38
|
+
onMousedown: {},
|
|
39
|
+
audioIcon: {},
|
|
40
|
+
audioDisabledIcon: {},
|
|
41
|
+
audioRecordingIcon: {}
|
|
39
42
|
},
|
|
40
43
|
setup(e) {
|
|
41
|
-
const c =
|
|
44
|
+
const c = y(e, ["action", "type", "disabled", "onClick"]);
|
|
42
45
|
u(e, "disabled");
|
|
43
|
-
const
|
|
46
|
+
const d = f(), n = x(), i = s(() => {
|
|
44
47
|
var o;
|
|
45
48
|
const a = n.value.disabled, t = (o = n.value) == null ? void 0 : o[`${e.action}Disabled`];
|
|
46
49
|
return e.disabled ?? a ?? t;
|
|
47
|
-
}),
|
|
48
|
-
return () => m(C,
|
|
50
|
+
}), l = s(() => n.value.prefixCls);
|
|
51
|
+
return () => m(C, b({
|
|
49
52
|
type: e.type
|
|
50
53
|
}, c, {
|
|
51
54
|
onClick: (a) => {
|
|
52
55
|
var t, o;
|
|
53
|
-
|
|
56
|
+
i.value || ((o = (t = n.value) == null ? void 0 : t[e.action]) == null || o.call(t), e.onClick && !Array.isArray(e.onClick) && e.onClick(a));
|
|
54
57
|
},
|
|
55
|
-
class: p(
|
|
56
|
-
[`${
|
|
58
|
+
class: p(l.value, {
|
|
59
|
+
[`${l.value}-disabled`]: i.value
|
|
57
60
|
})
|
|
58
61
|
}), {
|
|
59
|
-
icon: () =>
|
|
62
|
+
icon: () => d.default()
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
65
|
});
|