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,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a
|
|
3
|
-
import
|
|
4
|
-
import { i
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as o, mergeDefaults as u, createVNode as n, mergeProps as r } from "vue";
|
|
2
|
+
import { a } from "../../attachments/Attachments2.mjs";
|
|
3
|
+
import t from "./ActionButton/index.mjs";
|
|
4
|
+
import { i } from "../../attachments/FileList/FileList2.mjs";
|
|
5
|
+
const p = /* @__PURE__ */ o({
|
|
6
6
|
name: "AXSenderClearButton",
|
|
7
7
|
__name: "ClearButton",
|
|
8
|
-
props:
|
|
8
|
+
props: u({
|
|
9
9
|
prefixCls: null,
|
|
10
10
|
type: null,
|
|
11
11
|
htmlType: null,
|
|
@@ -21,21 +21,24 @@ const f = /* @__PURE__ */ r({
|
|
|
21
21
|
target: null,
|
|
22
22
|
title: null,
|
|
23
23
|
onClick: null,
|
|
24
|
-
onMousedown: null
|
|
24
|
+
onMousedown: null,
|
|
25
|
+
audioIcon: null,
|
|
26
|
+
audioDisabledIcon: null,
|
|
27
|
+
audioRecordingIcon: null
|
|
25
28
|
}, {
|
|
26
29
|
disabled: void 0
|
|
27
30
|
}),
|
|
28
31
|
setup(l) {
|
|
29
|
-
const
|
|
30
|
-
return () =>
|
|
32
|
+
const e = a(l, ["disabled"]);
|
|
33
|
+
return () => n(t, r({
|
|
31
34
|
disabled: l.disabled
|
|
32
|
-
},
|
|
35
|
+
}, e, {
|
|
33
36
|
action: "onClear"
|
|
34
37
|
}), {
|
|
35
|
-
default: () => [
|
|
38
|
+
default: () => [n(i, null, null)]
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
});
|
|
39
42
|
export {
|
|
40
|
-
|
|
43
|
+
p as default
|
|
41
44
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as a, mergeDefaults as
|
|
2
|
-
import { a as
|
|
1
|
+
import { defineComponent as a, mergeDefaults as i, createVNode as l, mergeProps as r } from "vue";
|
|
2
|
+
import { a as s, c as u } from "../../attachments/Attachments2.mjs";
|
|
3
3
|
import c from "./ActionButton/index.mjs";
|
|
4
4
|
import d from "../StopLoading.mjs";
|
|
5
5
|
import { useActionButtonContextInject as m } from "./ActionButton/context.mjs";
|
|
@@ -7,7 +7,7 @@ import { theme as p } from "ant-design-vue";
|
|
|
7
7
|
const x = /* @__PURE__ */ a({
|
|
8
8
|
name: "AXSenderLoadingButton",
|
|
9
9
|
__name: "LoadingButton",
|
|
10
|
-
props:
|
|
10
|
+
props: i({
|
|
11
11
|
prefixCls: null,
|
|
12
12
|
type: null,
|
|
13
13
|
htmlType: null,
|
|
@@ -23,32 +23,35 @@ const x = /* @__PURE__ */ a({
|
|
|
23
23
|
target: null,
|
|
24
24
|
title: null,
|
|
25
25
|
onClick: null,
|
|
26
|
-
onMousedown: null
|
|
26
|
+
onMousedown: null,
|
|
27
|
+
audioIcon: null,
|
|
28
|
+
audioDisabledIcon: null,
|
|
29
|
+
audioRecordingIcon: null
|
|
27
30
|
}, {
|
|
28
31
|
type: "primary",
|
|
29
32
|
shape: "circle",
|
|
30
33
|
icon: void 0,
|
|
31
34
|
disabled: void 0
|
|
32
35
|
}),
|
|
33
|
-
setup(
|
|
34
|
-
const o =
|
|
36
|
+
setup(n) {
|
|
37
|
+
const o = s(n, ["type", "shape", "icon", "disabled"]), e = m(), {
|
|
35
38
|
token: t
|
|
36
39
|
} = p.useToken();
|
|
37
|
-
return () => l(c,
|
|
38
|
-
type:
|
|
39
|
-
disabled:
|
|
40
|
-
shape:
|
|
41
|
-
icon:
|
|
40
|
+
return () => l(c, r({
|
|
41
|
+
type: n.type,
|
|
42
|
+
disabled: n.disabled,
|
|
43
|
+
shape: n.shape,
|
|
44
|
+
icon: n.icon
|
|
42
45
|
}, o, {
|
|
43
46
|
style: {
|
|
44
47
|
backgroundColor: "transparent",
|
|
45
48
|
color: t.value.colorPrimary
|
|
46
49
|
},
|
|
47
|
-
class: u(`${
|
|
50
|
+
class: u(`${e.value.prefixCls}-loading-button`),
|
|
48
51
|
action: "onCancel"
|
|
49
52
|
}), {
|
|
50
53
|
default: () => [l(d, {
|
|
51
|
-
className: `${
|
|
54
|
+
className: `${e.value.prefixCls}-loading-icon`
|
|
52
55
|
}, null)]
|
|
53
56
|
});
|
|
54
57
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as o, mergeDefaults as t, createVNode as e, mergeProps as u } from "vue";
|
|
2
2
|
import { a } from "../../attachments/Attachments2.mjs";
|
|
3
|
-
import
|
|
4
|
-
import { A as
|
|
5
|
-
const
|
|
3
|
+
import r from "./ActionButton/index.mjs";
|
|
4
|
+
import { A as d } from "../../attachments/FileList/FileList2.mjs";
|
|
5
|
+
const c = /* @__PURE__ */ o({
|
|
6
6
|
name: "AXSenderLoadingButton",
|
|
7
7
|
__name: "SendButton",
|
|
8
|
-
props:
|
|
8
|
+
props: t({
|
|
9
9
|
prefixCls: null,
|
|
10
10
|
type: null,
|
|
11
11
|
htmlType: null,
|
|
@@ -21,25 +21,28 @@ const f = /* @__PURE__ */ t({
|
|
|
21
21
|
target: null,
|
|
22
22
|
title: null,
|
|
23
23
|
onClick: null,
|
|
24
|
-
onMousedown: null
|
|
24
|
+
onMousedown: null,
|
|
25
|
+
audioIcon: null,
|
|
26
|
+
audioDisabledIcon: null,
|
|
27
|
+
audioRecordingIcon: null
|
|
25
28
|
}, {
|
|
26
29
|
type: "primary",
|
|
27
30
|
shape: "circle",
|
|
28
31
|
disabled: void 0
|
|
29
32
|
}),
|
|
30
|
-
setup(
|
|
31
|
-
const n = a(
|
|
32
|
-
return () =>
|
|
33
|
-
type:
|
|
34
|
-
shape:
|
|
35
|
-
disabled:
|
|
33
|
+
setup(l) {
|
|
34
|
+
const n = a(l, ["type", "shape", "disabled"]);
|
|
35
|
+
return () => e(r, u({
|
|
36
|
+
type: l.type,
|
|
37
|
+
shape: l.shape,
|
|
38
|
+
disabled: l.disabled
|
|
36
39
|
}, n, {
|
|
37
40
|
action: "onSend"
|
|
38
41
|
}), {
|
|
39
|
-
default: () => [
|
|
42
|
+
default: () => [e(d, null, null)]
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
45
|
});
|
|
43
46
|
export {
|
|
44
|
-
|
|
47
|
+
c as default
|
|
45
48
|
};
|
|
@@ -1,49 +1,52 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as p, createVNode as e, createTextVNode as I } from "vue";
|
|
2
|
+
const n = 1e3, t = 4, r = 140, s = 250, i = 500, c = 0.8, _ = /* @__PURE__ */ p({
|
|
3
3
|
name: "AXSenderRecordingIcon",
|
|
4
4
|
__name: "RecordingIcon",
|
|
5
5
|
props: {
|
|
6
|
-
className: null
|
|
6
|
+
className: null,
|
|
7
|
+
audioIcon: null,
|
|
8
|
+
audioDisabledIcon: null,
|
|
9
|
+
audioRecordingIcon: null
|
|
7
10
|
},
|
|
8
11
|
setup(u) {
|
|
9
|
-
const
|
|
12
|
+
const a = r / 2;
|
|
10
13
|
return () => e("svg", {
|
|
11
14
|
color: "currentColor",
|
|
12
|
-
viewBox: `0 0 ${
|
|
15
|
+
viewBox: `0 0 ${n} ${n}`,
|
|
13
16
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
17
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
15
18
|
class: u.className
|
|
16
|
-
}, [e("title", null, [
|
|
17
|
-
length:
|
|
18
|
-
}).map((
|
|
19
|
-
const m = (
|
|
19
|
+
}, [e("title", null, [I("Speech Recording")]), Array.from({
|
|
20
|
+
length: t
|
|
21
|
+
}).map((T, o) => {
|
|
22
|
+
const m = (n - r * t) / (t - 1), d = o * (m + r), l = n / 2 - s / 2, g = n / 2 - i / 2;
|
|
20
23
|
return e("rect", {
|
|
21
24
|
fill: "currentColor",
|
|
22
|
-
rx:
|
|
23
|
-
ry:
|
|
25
|
+
rx: a,
|
|
26
|
+
ry: a,
|
|
24
27
|
height: s,
|
|
25
28
|
width: r,
|
|
26
|
-
x:
|
|
27
|
-
y:
|
|
29
|
+
x: d,
|
|
30
|
+
y: l,
|
|
28
31
|
key: o
|
|
29
32
|
}, [e("animate", {
|
|
30
33
|
attributeName: "height",
|
|
31
|
-
values: `${s}; ${
|
|
34
|
+
values: `${s}; ${i}; ${s}`,
|
|
32
35
|
keyTimes: "0; 0.5; 1",
|
|
33
36
|
dur: `${c}s`,
|
|
34
|
-
begin: `${c /
|
|
37
|
+
begin: `${c / t * o}s`,
|
|
35
38
|
repeatCount: "indefinite"
|
|
36
39
|
}, null), e("animate", {
|
|
37
40
|
attributeName: "y",
|
|
38
|
-
values: `${
|
|
41
|
+
values: `${l}; ${g}; ${l}`,
|
|
39
42
|
keyTimes: "0; 0.5; 1",
|
|
40
43
|
dur: `${c}s`,
|
|
41
|
-
begin: `${c /
|
|
44
|
+
begin: `${c / t * o}s`,
|
|
42
45
|
repeatCount: "indefinite"
|
|
43
46
|
}, null)]);
|
|
44
47
|
})]);
|
|
45
48
|
}
|
|
46
49
|
});
|
|
47
50
|
export {
|
|
48
|
-
|
|
51
|
+
_ as default
|
|
49
52
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
3
|
-
import { theme as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as r, mergeDefaults as s, computed as i, createVNode as l, mergeProps as m } from "vue";
|
|
2
|
+
import { a as f } from "../../../attachments/Attachments2.mjs";
|
|
3
|
+
import { theme as p } from "ant-design-vue";
|
|
4
|
+
import I from "../ActionButton/index.mjs";
|
|
5
5
|
import { useActionButtonContextInject as g } from "../ActionButton/context.mjs";
|
|
6
|
-
import
|
|
7
|
-
import { j as
|
|
8
|
-
const
|
|
6
|
+
import y from "./RecordingIcon.mjs";
|
|
7
|
+
import { j as b, k as h } from "../../../attachments/FileList/FileList2.mjs";
|
|
8
|
+
const A = /* @__PURE__ */ r({
|
|
9
9
|
name: "AXSenderSpeechButton",
|
|
10
10
|
__name: "index",
|
|
11
|
-
props:
|
|
11
|
+
props: s({
|
|
12
12
|
prefixCls: null,
|
|
13
13
|
type: null,
|
|
14
14
|
htmlType: null,
|
|
@@ -24,36 +24,42 @@ const j = /* @__PURE__ */ c({
|
|
|
24
24
|
target: null,
|
|
25
25
|
title: null,
|
|
26
26
|
onClick: null,
|
|
27
|
-
onMousedown: null
|
|
27
|
+
onMousedown: null,
|
|
28
|
+
audioIcon: null,
|
|
29
|
+
audioDisabledIcon: null,
|
|
30
|
+
audioRecordingIcon: null
|
|
28
31
|
}, {
|
|
29
32
|
type: "text",
|
|
30
|
-
disabled: void 0
|
|
33
|
+
disabled: void 0,
|
|
34
|
+
audioIcon: () => l(h, null, null),
|
|
35
|
+
audioDisabledIcon: () => l(b, null, null),
|
|
36
|
+
audioRecordingIcon: void 0
|
|
31
37
|
}),
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
34
|
-
token:
|
|
35
|
-
} =
|
|
36
|
-
let
|
|
37
|
-
return
|
|
38
|
-
className: `${
|
|
39
|
-
}, null) :
|
|
38
|
+
setup(e) {
|
|
39
|
+
const t = f(e, ["type", "disabled", "audioIcon", "audioDisabledIcon", "audioRecordingIcon"]), o = g(), {
|
|
40
|
+
token: u
|
|
41
|
+
} = p.useToken(), d = i(() => o.value.speechRecording), a = i(() => o.value.prefixCls), c = i(() => {
|
|
42
|
+
let n;
|
|
43
|
+
return d.value ? n = e.audioRecordingIcon ? e.audioRecordingIcon : l(y, {
|
|
44
|
+
className: `${a.value}-recording-icon`
|
|
45
|
+
}, null) : o.value.onSpeechDisabled ? n = e.audioDisabledIcon : n = e.audioIcon, n;
|
|
40
46
|
});
|
|
41
|
-
return () => l(
|
|
42
|
-
type:
|
|
43
|
-
disabled:
|
|
44
|
-
},
|
|
47
|
+
return () => l(I, m({
|
|
48
|
+
type: e.type,
|
|
49
|
+
disabled: e.disabled
|
|
50
|
+
}, t, {
|
|
45
51
|
style: {
|
|
46
52
|
display: "flex",
|
|
47
53
|
justifyContent: "center",
|
|
48
54
|
alignItems: "center",
|
|
49
|
-
color:
|
|
55
|
+
color: u.value.colorPrimary
|
|
50
56
|
},
|
|
51
57
|
action: "onSpeech"
|
|
52
58
|
}), {
|
|
53
|
-
default: () => [
|
|
59
|
+
default: () => [c.value]
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
62
|
});
|
|
57
63
|
export {
|
|
58
|
-
|
|
64
|
+
A as default
|
|
59
65
|
};
|
|
@@ -1,16 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
1
|
+
import { onMounted as W, nextTick as I, unref as L, getCurrentScope as G, onScopeDispose as P, getCurrentInstance as V, computed as v, ref as y, watch as $, defineComponent as X, mergeDefaults as E, toRef as H, useSlots as K, createVNode as B } from "vue";
|
|
2
|
+
import { c as k } from "../attachments/Attachments2.mjs";
|
|
3
3
|
import "../x-provider/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { Cascader as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
4
|
+
import U from "../_util/hooks/use-x-component-config.mjs";
|
|
5
|
+
import j from "./style/index.mjs";
|
|
6
|
+
import A from "../_util/hooks/use-state.mjs";
|
|
7
|
+
import { Cascader as q } from "ant-design-vue";
|
|
8
|
+
import J from "./useActive.mjs";
|
|
9
|
+
import Q from "../x-provider/hooks/use-x-provider-context.mjs";
|
|
10
|
+
function Y(e) {
|
|
11
|
+
return G() ? (P(e), !0) : !1;
|
|
12
|
+
}
|
|
13
|
+
function D(e) {
|
|
14
|
+
return typeof e == "function" ? e() : L(e);
|
|
15
|
+
}
|
|
16
|
+
const Z = typeof window < "u" && typeof document < "u";
|
|
17
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
18
|
+
function _(e) {
|
|
19
|
+
return V();
|
|
20
|
+
}
|
|
21
|
+
function ee(e, n = !0, i) {
|
|
22
|
+
_() ? W(e, i) : n ? e() : I(e);
|
|
23
|
+
}
|
|
24
|
+
const M = Z ? window : void 0;
|
|
25
|
+
function g(e) {
|
|
26
|
+
var n;
|
|
27
|
+
const i = D(e);
|
|
28
|
+
return (n = i == null ? void 0 : i.$el) != null ? n : i;
|
|
29
|
+
}
|
|
30
|
+
function te() {
|
|
31
|
+
const e = y(!1), n = V();
|
|
32
|
+
return n && W(() => {
|
|
33
|
+
e.value = !0;
|
|
34
|
+
}, n), e;
|
|
35
|
+
}
|
|
36
|
+
function ne(e) {
|
|
37
|
+
const n = te();
|
|
38
|
+
return v(() => (n.value, !!e()));
|
|
39
|
+
}
|
|
40
|
+
function oe(e, n, i = {}) {
|
|
41
|
+
const { window: a = M, ...c } = i;
|
|
42
|
+
let r;
|
|
43
|
+
const l = ne(() => a && "ResizeObserver" in a), u = () => {
|
|
44
|
+
r && (r.disconnect(), r = void 0);
|
|
45
|
+
}, w = v(() => {
|
|
46
|
+
const t = D(e);
|
|
47
|
+
return Array.isArray(t) ? t.map((o) => g(o)) : [g(t)];
|
|
48
|
+
}), h = $(
|
|
49
|
+
w,
|
|
50
|
+
(t) => {
|
|
51
|
+
if (u(), l.value && a) {
|
|
52
|
+
r = new ResizeObserver(n);
|
|
53
|
+
for (const o of t)
|
|
54
|
+
o && r.observe(o, c);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{ immediate: !0, flush: "post" }
|
|
58
|
+
), m = () => {
|
|
59
|
+
u(), h();
|
|
60
|
+
};
|
|
61
|
+
return Y(m), {
|
|
62
|
+
isSupported: l,
|
|
63
|
+
stop: m
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function se(e, n = { width: 0, height: 0 }, i = {}) {
|
|
67
|
+
const { window: a = M, box: c = "content-box" } = i, r = v(() => {
|
|
68
|
+
var t, o;
|
|
69
|
+
return (o = (t = g(e)) == null ? void 0 : t.namespaceURI) == null ? void 0 : o.includes("svg");
|
|
70
|
+
}), l = y(n.width), u = y(n.height), { stop: w } = oe(
|
|
71
|
+
e,
|
|
72
|
+
([t]) => {
|
|
73
|
+
const o = c === "border-box" ? t.borderBoxSize : c === "content-box" ? t.contentBoxSize : t.devicePixelContentBoxSize;
|
|
74
|
+
if (a && r.value) {
|
|
75
|
+
const f = g(e);
|
|
76
|
+
if (f) {
|
|
77
|
+
const d = f.getBoundingClientRect();
|
|
78
|
+
l.value = d.width, u.value = d.height;
|
|
79
|
+
}
|
|
80
|
+
} else if (o) {
|
|
81
|
+
const f = Array.isArray(o) ? o : [o];
|
|
82
|
+
l.value = f.reduce((d, { inlineSize: C }) => d + C, 0), u.value = f.reduce((d, { blockSize: C }) => d + C, 0);
|
|
83
|
+
} else
|
|
84
|
+
l.value = t.contentRect.width, u.value = t.contentRect.height;
|
|
85
|
+
},
|
|
86
|
+
i
|
|
87
|
+
);
|
|
88
|
+
ee(() => {
|
|
89
|
+
const t = g(e);
|
|
90
|
+
t && (l.value = "offsetWidth" in t ? t.offsetWidth : n.width, u.value = "offsetHeight" in t ? t.offsetHeight : n.height);
|
|
91
|
+
});
|
|
92
|
+
const h = $(
|
|
93
|
+
() => g(e),
|
|
94
|
+
(t) => {
|
|
95
|
+
l.value = t ? n.width : 0, u.value = t ? n.height : 0;
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
function m() {
|
|
99
|
+
w(), h();
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
width: l,
|
|
103
|
+
height: u,
|
|
104
|
+
stop: m
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const me = /* @__PURE__ */ X({
|
|
11
108
|
name: "AXSuggestion",
|
|
12
109
|
__name: "Suggestion",
|
|
13
|
-
props:
|
|
110
|
+
props: E({
|
|
14
111
|
prefixCls: null,
|
|
15
112
|
className: null,
|
|
16
113
|
rootClassName: null,
|
|
@@ -39,55 +136,63 @@ const H = /* @__PURE__ */ D({
|
|
|
39
136
|
open: !1
|
|
40
137
|
}),
|
|
41
138
|
setup(e) {
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
direction:
|
|
45
|
-
getPrefixCls:
|
|
46
|
-
} =
|
|
47
|
-
`${
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
139
|
+
H(e, "prefixCls");
|
|
140
|
+
const n = K(), {
|
|
141
|
+
direction: i,
|
|
142
|
+
getPrefixCls: a
|
|
143
|
+
} = Q(), c = v(() => a("suggestion", e.prefixCls));
|
|
144
|
+
`${c.value}`;
|
|
145
|
+
const r = v(() => i.value === "rtl"), l = U("suggestion"), u = y(), [w, h, m] = j(c), {
|
|
146
|
+
width: t
|
|
147
|
+
} = se(u), o = v(() => {
|
|
148
|
+
if (e.block && t.value)
|
|
149
|
+
return {
|
|
150
|
+
width: `${t.value}px`
|
|
151
|
+
};
|
|
152
|
+
}), [f, d] = A(e.open), [C, T] = A(), p = (s) => {
|
|
153
|
+
var N;
|
|
154
|
+
d(s), (N = e.onOpenChange) == null || N.call(e, s);
|
|
155
|
+
}, b = (s) => {
|
|
156
|
+
s === !1 ? p(!1) : (T(s), p(!0));
|
|
157
|
+
}, S = () => {
|
|
158
|
+
p(!1);
|
|
159
|
+
}, x = v(() => typeof e.items == "function" ? e.items(C.value) : e.items), R = (s) => {
|
|
160
|
+
e.onSelect && e.onSelect(s[s.length - 1]), p(!1);
|
|
161
|
+
}, [z, O] = J(x, f, r, R, S), F = v(() => {
|
|
162
|
+
var s;
|
|
163
|
+
return n.default ? n.default({
|
|
164
|
+
onTrigger: b,
|
|
165
|
+
onKeyDown: O
|
|
166
|
+
}) : (s = e.children) == null ? void 0 : s.call(e, {
|
|
167
|
+
onTrigger: b,
|
|
168
|
+
onKeyDown: O
|
|
65
169
|
});
|
|
66
170
|
});
|
|
67
|
-
return () =>
|
|
68
|
-
options:
|
|
69
|
-
open:
|
|
70
|
-
value:
|
|
71
|
-
placement:
|
|
72
|
-
onDropdownVisibleChange: (
|
|
73
|
-
|
|
171
|
+
return () => w(B(q, {
|
|
172
|
+
options: x.value,
|
|
173
|
+
open: f.value,
|
|
174
|
+
value: z.value,
|
|
175
|
+
placement: r.value ? "topRight" : "topLeft",
|
|
176
|
+
onDropdownVisibleChange: (s) => {
|
|
177
|
+
s || S();
|
|
74
178
|
},
|
|
75
|
-
class:
|
|
76
|
-
[`${
|
|
179
|
+
class: k(e.rootClassName, c.value, h, m, {
|
|
180
|
+
[`${c.value}-block`]: e.block
|
|
77
181
|
}),
|
|
78
|
-
onChange:
|
|
79
|
-
|
|
182
|
+
onChange: R,
|
|
183
|
+
dropdownStyle: o.value
|
|
80
184
|
}, {
|
|
81
|
-
default: () =>
|
|
82
|
-
|
|
185
|
+
default: () => B("div", {
|
|
186
|
+
ref: u,
|
|
187
|
+
class: k(c.value, l.value.className, e.rootClassName, e.className, `${c.value}-wrapper`, h.value, m),
|
|
83
188
|
style: {
|
|
84
|
-
...
|
|
189
|
+
...l.value.style,
|
|
85
190
|
...e.style
|
|
86
191
|
}
|
|
87
|
-
}, [
|
|
192
|
+
}, [F.value])
|
|
88
193
|
}));
|
|
89
194
|
}
|
|
90
195
|
});
|
|
91
196
|
export {
|
|
92
|
-
|
|
197
|
+
me as default
|
|
93
198
|
};
|