ant-design-x-vue 1.2.7 → 1.2.9
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 +8533 -8065
- package/dist/index.esm.min.js +6 -0
- package/dist/index.umd.js +66 -66
- package/es/_util/cssinjs/StyleContext.mjs +48 -42
- package/es/bubble/Bubble.mjs +40 -38
- package/es/bubble/BubbleList.mjs +123 -87
- package/es/bubble/style/list.mjs +18 -5
- 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 +153 -48
- package/es/welcome/Welcome.mjs +44 -36
- package/lib/_util/cssinjs/StyleContext.js +1 -1
- package/lib/bubble/Bubble.js +1 -1
- package/lib/bubble/BubbleList.js +1 -1
- package/lib/bubble/style/list.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 +3 -2
- package/typings/_util/cssinjs/StyleContext.d.ts +6 -6
- package/typings/_util/cssinjs/index.d.ts +3 -3
- package/typings/bubble/BubbleList.vue.d.ts +47 -1
- package/typings/bubble/hooks/useTypingConfig.d.ts +1 -1
- package/typings/bubble/index.d.ts +65 -3
- package/typings/bubble/interface.d.ts +2 -2
- 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
|
};
|
package/es/bubble/Bubble.mjs
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
3
|
-
import { Avatar as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as H, mergeDefaults as k, toRef as h, useSlots as q, ref as d, watch as N, unref as z, watchEffect as G, computed as r, createVNode as l, isVNode as x, Fragment as J, toValue as i, mergeProps as K } from "vue";
|
|
2
|
+
import { a as L } from "../attachments/Attachments2.mjs";
|
|
3
|
+
import { Avatar as M } from "ant-design-vue";
|
|
4
|
+
import O from "../_util/hooks/use-x-component-config.mjs";
|
|
5
5
|
import "../x-provider/index.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useBubbleContextInject as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
6
|
+
import Q from "./hooks/useTypedEffect.mjs";
|
|
7
|
+
import W from "./hooks/useTypingConfig.mjs";
|
|
8
|
+
import Y from "./loading.mjs";
|
|
9
|
+
import Z from "./style/index.mjs";
|
|
10
|
+
import { useBubbleContextInject as U } from "./context.mjs";
|
|
11
|
+
import p from "../x-provider/hooks/use-x-provider-context.mjs";
|
|
12
|
+
const ue = /* @__PURE__ */ H({
|
|
13
13
|
name: "AXBubble",
|
|
14
14
|
__name: "Bubble",
|
|
15
|
-
props:
|
|
15
|
+
props: k({
|
|
16
16
|
prefixCls: null,
|
|
17
17
|
rootClassName: null,
|
|
18
18
|
styles: null,
|
|
19
19
|
classNames: null,
|
|
20
|
-
avatar:
|
|
20
|
+
avatar: {
|
|
21
|
+
type: Function
|
|
22
|
+
},
|
|
21
23
|
placement: null,
|
|
22
24
|
loading: {
|
|
23
25
|
type: Boolean
|
|
@@ -44,35 +46,35 @@ const ie = /* @__PURE__ */ j({
|
|
|
44
46
|
variant: "filled"
|
|
45
47
|
}),
|
|
46
48
|
setup(e, {
|
|
47
|
-
expose:
|
|
49
|
+
expose: $
|
|
48
50
|
}) {
|
|
49
|
-
const
|
|
51
|
+
const b = L(e, ["prefixCls", "rootClassName", "classNames", "styles", "avatar", "placement", "loading", "loadingRender", "typing", "content", "messageRender", "variant", "shape", "onTypingComplete", "header", "footer"]);
|
|
50
52
|
h(e, "content"), h(e, "prefixCls");
|
|
51
|
-
const a =
|
|
53
|
+
const a = q(), y = d(e.content);
|
|
52
54
|
N(() => e.content, () => {
|
|
53
|
-
|
|
55
|
+
y.value = e.content;
|
|
54
56
|
});
|
|
55
57
|
const {
|
|
56
|
-
onUpdate:
|
|
57
|
-
} =
|
|
58
|
-
direction:
|
|
59
|
-
getPrefixCls:
|
|
60
|
-
} =
|
|
58
|
+
onUpdate: c
|
|
59
|
+
} = z(U()), g = d(null), {
|
|
60
|
+
direction: R,
|
|
61
|
+
getPrefixCls: T
|
|
62
|
+
} = p(), t = T("bubble", e.prefixCls), n = O("bubble"), [P, S, V, C] = W(() => e.typing), [s, u] = Q(y, P, S, V), f = d(!1);
|
|
61
63
|
N(s, () => {
|
|
62
|
-
|
|
63
|
-
}),
|
|
64
|
+
c == null || c();
|
|
65
|
+
}), G(() => {
|
|
64
66
|
var o;
|
|
65
67
|
!u.value && !e.loading ? f.value || (f.value = !0, (o = e.onTypingComplete) == null || o.call(e)) : f.value = !1;
|
|
66
68
|
});
|
|
67
|
-
const [
|
|
68
|
-
[`${t}-rtl`]:
|
|
69
|
+
const [A, w, B] = Z(() => t), E = r(() => [t, e.rootClassName, n.value.className, w.value, B, `${t}-${e.placement}`, {
|
|
70
|
+
[`${t}-rtl`]: R.value === "rtl"
|
|
69
71
|
}, {
|
|
70
72
|
[`${t}-typing`]: u.value && !e.loading && !e.messageRender && !a.message && !C.value
|
|
71
|
-
}]), F = r(() => a.avatar ? a.avatar() :
|
|
73
|
+
}]), F = (o) => Array.isArray(o) && o.every(x), I = r(() => a.avatar ? a.avatar() : typeof e.avatar == "function" ? e.avatar() : x(e.avatar) || F(e.avatar) ? e.avatar : l(M, e.avatar, null)), X = r(() => a.message ? a.message({
|
|
72
74
|
content: s.value
|
|
73
|
-
}) : e.messageRender ? e.messageRender(s.value) : s.value),
|
|
75
|
+
}) : e.messageRender ? e.messageRender(s.value) : s.value), j = r(() => e.loading ? a.loading ? a.loading() : e.loadingRender ? e.loadingRender() : l(Y, {
|
|
74
76
|
prefixCls: t
|
|
75
|
-
}, null) : l(
|
|
77
|
+
}, null) : l(J, null, [X.value, u.value && i(C)])), D = r(() => {
|
|
76
78
|
const o = l("div", {
|
|
77
79
|
style: {
|
|
78
80
|
...n.value.styles.content,
|
|
@@ -81,7 +83,7 @@ const ie = /* @__PURE__ */ j({
|
|
|
81
83
|
class: [`${t}-content`, `${t}-content-${e.variant}`, {
|
|
82
84
|
[`${t}-content-${e.shape}`]: e.shape
|
|
83
85
|
}, n.value.classNames.content, e.classNames.content]
|
|
84
|
-
}, [
|
|
86
|
+
}, [i(j)]), m = a.header ? a.header({
|
|
85
87
|
content: s.value
|
|
86
88
|
}) : typeof e.header == "function" ? e.header(s.value) : e.header, v = a.footer ? a.footer({
|
|
87
89
|
content: s.value
|
|
@@ -102,25 +104,25 @@ const ie = /* @__PURE__ */ j({
|
|
|
102
104
|
}
|
|
103
105
|
}, [v])]) : o;
|
|
104
106
|
});
|
|
105
|
-
return
|
|
106
|
-
nativeElement:
|
|
107
|
-
}), () =>
|
|
107
|
+
return $({
|
|
108
|
+
nativeElement: g
|
|
109
|
+
}), () => A(l("div", K({
|
|
108
110
|
style: {
|
|
109
111
|
...n.value.style
|
|
110
112
|
// ...(style as object),
|
|
111
113
|
},
|
|
112
|
-
class:
|
|
113
|
-
},
|
|
114
|
-
ref:
|
|
114
|
+
class: i(E)
|
|
115
|
+
}, b, {
|
|
116
|
+
ref: g
|
|
115
117
|
}), [(a.avatar || e.avatar) && l("div", {
|
|
116
118
|
style: {
|
|
117
119
|
...n.value.styles.avatar,
|
|
118
120
|
...e.styles.avatar
|
|
119
121
|
},
|
|
120
122
|
class: [`${t}-avatar`, n.value.classNames.avatar, e.classNames.avatar]
|
|
121
|
-
}, [
|
|
123
|
+
}, [i(I)]), i(D)]));
|
|
122
124
|
}
|
|
123
125
|
});
|
|
124
126
|
export {
|
|
125
|
-
|
|
127
|
+
ue as default
|
|
126
128
|
};
|
package/es/bubble/BubbleList.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
3
|
-
import { useEventCallback as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as q, mergeDefaults as F, toRef as p, useAttrs as G, useSlots as J, computed as A, mergeProps as v, ref as d, watch as g, watchEffect as Q, onWatcherCleanup as Y, unref as o, nextTick as Z, createVNode as x } from "vue";
|
|
2
|
+
import { a as k, c as b } from "../attachments/Attachments2.mjs";
|
|
3
|
+
import { useEventCallback as _ } from "../_util/hooks/use-event-callback.mjs";
|
|
4
|
+
import tt from "../_util/pick-attrs.mjs";
|
|
5
5
|
import "../x-provider/index.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { BubbleContextProvider as
|
|
12
|
-
import
|
|
13
|
-
const nt = 1,
|
|
6
|
+
import et from "./Bubble.mjs";
|
|
7
|
+
import ot from "./hooks/useDisplayData.mjs";
|
|
8
|
+
import st from "./hooks/useListData.mjs";
|
|
9
|
+
import at from "./style/index.mjs";
|
|
10
|
+
import S from "../_util/hooks/use-state.mjs";
|
|
11
|
+
import { BubbleContextProvider as lt } from "./context.mjs";
|
|
12
|
+
import rt from "../x-provider/hooks/use-x-provider-context.mjs";
|
|
13
|
+
const nt = 1, Rt = /* @__PURE__ */ q({
|
|
14
14
|
name: "AXBubbleList",
|
|
15
15
|
inheritAttrs: !1,
|
|
16
16
|
__name: "BubbleList",
|
|
17
|
-
props:
|
|
17
|
+
props: F({
|
|
18
18
|
prefixCls: null,
|
|
19
19
|
rootClassName: null,
|
|
20
20
|
items: null,
|
|
@@ -25,111 +25,147 @@ const nt = 1, bt = /* @__PURE__ */ M({
|
|
|
25
25
|
}, {
|
|
26
26
|
autoScroll: !0
|
|
27
27
|
}),
|
|
28
|
-
setup(
|
|
29
|
-
expose:
|
|
28
|
+
setup(s, {
|
|
29
|
+
expose: N
|
|
30
30
|
}) {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
31
|
+
const w = k(s, ["prefixCls", "rootClassName", "items", "autoScroll", "roles"]);
|
|
32
|
+
p(s, "roles"), p(s, "items"), p(s, "prefixCls");
|
|
33
|
+
const B = G(), a = J(), L = A(() => tt(v(w, B), {
|
|
34
34
|
attr: !0,
|
|
35
35
|
aria: !0
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}),
|
|
40
|
-
|
|
36
|
+
})), R = d(s.items), P = d(s.roles);
|
|
37
|
+
g(() => s.items, () => {
|
|
38
|
+
R.value = s.items;
|
|
39
|
+
}), g(() => s.roles, () => {
|
|
40
|
+
P.value = s.roles;
|
|
41
41
|
});
|
|
42
|
-
const
|
|
43
|
-
getPrefixCls:
|
|
44
|
-
} =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const i = d(null), u = d({}), {
|
|
43
|
+
getPrefixCls: H
|
|
44
|
+
} = rt(), I = H("bubble", s.prefixCls), E = `${I}-list`, [U, $, z] = at(I), [X, D] = S(!1);
|
|
45
|
+
Q(() => {
|
|
46
|
+
D(!0), Y(() => {
|
|
47
|
+
D(!1);
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
50
|
+
const y = st(R, P), [m, K] = ot(y), [T, C] = S(!0), [h, V] = S(0), M = (t) => {
|
|
51
|
+
const l = t.target;
|
|
52
|
+
C(l.scrollHeight - Math.abs(l.scrollTop) - l.clientHeight <= nt);
|
|
53
53
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
top:
|
|
54
|
+
g(h, () => {
|
|
55
|
+
s.autoScroll && o(i) && o(T) && Z(() => {
|
|
56
|
+
o(i).scrollTo({
|
|
57
|
+
top: o(i).scrollHeight
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
|
-
}),
|
|
61
|
-
var
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
60
|
+
}), g(() => o(m).length, () => {
|
|
61
|
+
var t;
|
|
62
|
+
if (s.autoScroll) {
|
|
63
|
+
const l = (t = o(m)[o(m).length - 2]) == null ? void 0 : t.key, e = o(u)[l];
|
|
64
|
+
if (e) {
|
|
65
65
|
const {
|
|
66
66
|
nativeElement: n
|
|
67
|
-
} =
|
|
67
|
+
} = e, {
|
|
68
68
|
top: c = 0,
|
|
69
|
-
bottom:
|
|
69
|
+
bottom: f = 0
|
|
70
70
|
} = (n == null ? void 0 : n.getBoundingClientRect()) ?? {}, {
|
|
71
|
-
top:
|
|
72
|
-
bottom:
|
|
73
|
-
} =
|
|
74
|
-
c <
|
|
71
|
+
top: r,
|
|
72
|
+
bottom: j
|
|
73
|
+
} = o(i).getBoundingClientRect();
|
|
74
|
+
c < j && f > r && (V(o(h) + 1), C(!0));
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
}),
|
|
81
|
-
onUpdate:
|
|
78
|
+
const O = _(() => {
|
|
79
|
+
s.autoScroll && V(o(h) + 1);
|
|
80
|
+
}), W = A(() => ({
|
|
81
|
+
onUpdate: O
|
|
82
82
|
}));
|
|
83
|
-
return
|
|
84
|
-
nativeElement:
|
|
83
|
+
return N({
|
|
84
|
+
nativeElement: i,
|
|
85
85
|
scrollTo: ({
|
|
86
|
-
key:
|
|
87
|
-
offset:
|
|
88
|
-
behavior:
|
|
86
|
+
key: t,
|
|
87
|
+
offset: l,
|
|
88
|
+
behavior: e = "smooth",
|
|
89
89
|
block: n
|
|
90
90
|
}) => {
|
|
91
|
-
if (typeof
|
|
92
|
-
|
|
93
|
-
top:
|
|
94
|
-
behavior:
|
|
91
|
+
if (typeof l == "number")
|
|
92
|
+
o(i).scrollTo({
|
|
93
|
+
top: l,
|
|
94
|
+
behavior: e
|
|
95
95
|
});
|
|
96
|
-
else if (
|
|
97
|
-
const c =
|
|
96
|
+
else if (t !== void 0) {
|
|
97
|
+
const c = o(u)[t];
|
|
98
98
|
if (c) {
|
|
99
|
-
const
|
|
100
|
-
f
|
|
101
|
-
behavior:
|
|
99
|
+
const f = o(m).findIndex((r) => r.key === t);
|
|
100
|
+
C(f === o(m).length - 1), c.nativeElement.scrollIntoView({
|
|
101
|
+
behavior: e,
|
|
102
102
|
block: n
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
}), () =>
|
|
108
|
-
value:
|
|
107
|
+
}), () => U(x(lt, {
|
|
108
|
+
value: W.value
|
|
109
109
|
}, {
|
|
110
|
-
default: () => [x("div",
|
|
111
|
-
class:
|
|
112
|
-
[`${
|
|
110
|
+
default: () => [x("div", v(L.value, {
|
|
111
|
+
class: b(E, s.rootClassName, $.value, z, {
|
|
112
|
+
[`${E}-reach-end`]: T.value
|
|
113
113
|
}),
|
|
114
|
-
ref:
|
|
115
|
-
onScroll:
|
|
116
|
-
}), [
|
|
117
|
-
key:
|
|
118
|
-
onTypingComplete:
|
|
119
|
-
...
|
|
120
|
-
}) =>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
114
|
+
ref: i,
|
|
115
|
+
onScroll: M
|
|
116
|
+
}), [o(m).map(({
|
|
117
|
+
key: t,
|
|
118
|
+
onTypingComplete: l,
|
|
119
|
+
...e
|
|
120
|
+
}) => {
|
|
121
|
+
var n, c, f;
|
|
122
|
+
return x(et, v(e, {
|
|
123
|
+
avatar: a.avatar ? () => {
|
|
124
|
+
var r;
|
|
125
|
+
return (r = a.avatar) == null ? void 0 : r.call(a, {
|
|
126
|
+
item: {
|
|
127
|
+
key: t,
|
|
128
|
+
...e
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
} : e.avatar,
|
|
132
|
+
header: ((n = a.header) == null ? void 0 : n.call(a, {
|
|
133
|
+
item: {
|
|
134
|
+
key: t,
|
|
135
|
+
...e
|
|
136
|
+
}
|
|
137
|
+
})) ?? e.header,
|
|
138
|
+
footer: ((c = a.footer) == null ? void 0 : c.call(a, {
|
|
139
|
+
item: {
|
|
140
|
+
key: t,
|
|
141
|
+
...e
|
|
142
|
+
}
|
|
143
|
+
})) ?? e.footer,
|
|
144
|
+
loadingRender: a.loading ? () => a.loading({
|
|
145
|
+
item: {
|
|
146
|
+
key: t,
|
|
147
|
+
...e
|
|
148
|
+
}
|
|
149
|
+
}) : e.loadingRender,
|
|
150
|
+
content: ((f = a.message) == null ? void 0 : f.call(a, {
|
|
151
|
+
item: {
|
|
152
|
+
key: t,
|
|
153
|
+
...e
|
|
154
|
+
}
|
|
155
|
+
})) ?? e.content,
|
|
156
|
+
key: t,
|
|
157
|
+
ref: (r) => {
|
|
158
|
+
r ? u.value[t] = r : delete u.value[t];
|
|
159
|
+
},
|
|
160
|
+
typing: X.value ? e.typing : !1,
|
|
161
|
+
onTypingComplete: () => {
|
|
162
|
+
l == null || l(), K(t);
|
|
163
|
+
}
|
|
164
|
+
}), null);
|
|
165
|
+
})])]
|
|
130
166
|
}));
|
|
131
167
|
}
|
|
132
168
|
});
|
|
133
169
|
export {
|
|
134
|
-
|
|
170
|
+
Rt as default
|
|
135
171
|
};
|
package/es/bubble/style/list.mjs
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
const
|
|
2
|
-
const { componentCls:
|
|
1
|
+
const t = (r) => {
|
|
2
|
+
const { componentCls: o, padding: l } = r;
|
|
3
3
|
return {
|
|
4
|
-
[`${
|
|
4
|
+
[`${o}-list`]: {
|
|
5
5
|
display: "flex",
|
|
6
6
|
flexDirection: "column",
|
|
7
7
|
gap: l,
|
|
8
|
-
overflowY: "auto"
|
|
8
|
+
overflowY: "auto",
|
|
9
|
+
"&::-webkit-scrollbar": {
|
|
10
|
+
width: 8,
|
|
11
|
+
backgroundColor: "transparent"
|
|
12
|
+
},
|
|
13
|
+
"&::-webkit-scrollbar-thumb": {
|
|
14
|
+
backgroundColor: r.colorTextTertiary,
|
|
15
|
+
borderRadius: r.borderRadiusSM
|
|
16
|
+
},
|
|
17
|
+
// For Firefox
|
|
18
|
+
"&": {
|
|
19
|
+
scrollbarWidth: "thin",
|
|
20
|
+
scrollbarColor: `${r.colorTextTertiary} transparent`
|
|
21
|
+
}
|
|
9
22
|
}
|
|
10
23
|
};
|
|
11
24
|
};
|
|
12
25
|
export {
|
|
13
|
-
|
|
26
|
+
t as default
|
|
14
27
|
};
|