ant-design-x-vue 1.3.2 → 1.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/dist/index.esm.js +7971 -7704
- package/dist/index.esm.min.js +2 -2
- package/dist/index.umd.js +63 -63
- package/es/actions/ActionMenu.mjs +67 -0
- package/es/actions/Actions.mjs +100 -0
- package/es/actions/index.mjs +8 -0
- package/es/actions/interface.mjs +1 -0
- package/es/actions/style/index.mjs +76 -0
- package/es/attachments/FileList/FileList.mjs +121 -69
- package/es/attachments/FileList/FileListCard.mjs +64 -66
- package/es/attachments/PlaceholderUploader.mjs +2 -3
- package/es/attachments/constants.mjs +12 -0
- package/es/attachments/util.mjs +24 -20
- package/es/bubble/BubbleList.mjs +36 -35
- package/es/components.mjs +22 -19
- package/es/components.ts-chunk.mjs +5 -2
- package/es/index.mjs +42 -40
- package/es/prompts/Prompts.mjs +1 -3
- package/es/sender/useSpeech.mjs +25 -24
- package/es/x-provider/index-chunk.mjs +1 -0
- package/lib/actions/ActionMenu.js +1 -0
- package/lib/actions/Actions.js +1 -0
- package/lib/actions/index.js +1 -0
- package/lib/actions/interface.js +1 -0
- package/lib/actions/style/index.js +1 -0
- package/lib/attachments/FileList/FileList.js +1 -1
- package/lib/attachments/FileList/FileListCard.js +1 -1
- package/lib/attachments/PlaceholderUploader.js +1 -1
- package/lib/attachments/constants.js +1 -0
- package/lib/attachments/util.js +1 -1
- package/lib/bubble/BubbleList.js +1 -1
- package/lib/components.js +1 -1
- package/lib/components.ts-chunk.js +1 -1
- package/lib/index.js +1 -1
- package/lib/prompts/Prompts.js +1 -1
- package/lib/sender/useSpeech.js +1 -1
- package/lib/x-provider/index-chunk.js +1 -1
- package/package.json +2 -1
- package/typings/_util/cssinjs/StyleContext.d.ts +6 -6
- package/typings/_util/cssinjs/index.d.ts +3 -3
- package/typings/actions/ActionMenu.vue.d.ts +21 -0
- package/typings/actions/Actions.vue.d.ts +22 -0
- package/typings/actions/index.d.ts +4 -0
- package/typings/actions/interface.d.ts +105 -0
- package/typings/actions/style/index.d.ts +8 -0
- package/typings/attachments/constants.d.ts +9 -0
- package/typings/attachments/util.d.ts +1 -0
- package/typings/bubble/index.d.ts +26 -26
- package/typings/components.d.ts +1 -0
- package/typings/prompts/interface.d.ts +2 -1
- package/typings/theme/components.d.ts +2 -0
- package/typings/x-provider/context.d.ts +2 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent as g, computed as o, createVNode as r } from "vue";
|
|
2
|
+
import { Dropdown as k } from "ant-design-vue";
|
|
3
|
+
import "../x-provider/index.mjs";
|
|
4
|
+
import x from "../x-provider/hooks/use-x-provider-context.mjs";
|
|
5
|
+
import { E as h } from "../chunks/module-chunk.mjs";
|
|
6
|
+
const E = /* @__PURE__ */ g({
|
|
7
|
+
name: "AXActionMenu",
|
|
8
|
+
__name: "ActionMenu",
|
|
9
|
+
props: {
|
|
10
|
+
item: null,
|
|
11
|
+
prefixCls: null
|
|
12
|
+
},
|
|
13
|
+
emits: ["click"],
|
|
14
|
+
setup(u, {
|
|
15
|
+
emit: p
|
|
16
|
+
}) {
|
|
17
|
+
const t = u, a = p, c = (i, n) => {
|
|
18
|
+
const s = i[0];
|
|
19
|
+
for (const e of n)
|
|
20
|
+
if (e.key === s) {
|
|
21
|
+
if (i.length === 1) return e;
|
|
22
|
+
if ("children" in e && e.children)
|
|
23
|
+
return c(i.slice(1), e.children);
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}, {
|
|
27
|
+
getPrefixCls: f
|
|
28
|
+
} = x(), l = f("actions", t.prefixCls), d = o(() => {
|
|
29
|
+
var i;
|
|
30
|
+
return ((i = t.item) == null ? void 0 : i.icon) ?? r(h, null, null);
|
|
31
|
+
}), m = o(() => t.item.children || []), v = o(() => t.item.triggerSubMenuAction || "hover"), C = o(() => ({
|
|
32
|
+
items: m.value,
|
|
33
|
+
onClick: ({
|
|
34
|
+
key: i,
|
|
35
|
+
keyPath: n,
|
|
36
|
+
domEvent: s
|
|
37
|
+
}) => {
|
|
38
|
+
const e = c(n, m.value);
|
|
39
|
+
if (e != null && e.onItemClick) {
|
|
40
|
+
e.onItemClick(e);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
a("click", {
|
|
44
|
+
key: i,
|
|
45
|
+
keyPath: [...n, t.item.key],
|
|
46
|
+
domEvent: s,
|
|
47
|
+
item: e
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
return () => r(k, {
|
|
52
|
+
menu: C.value,
|
|
53
|
+
overlayClassName: `${l}-sub-item`,
|
|
54
|
+
arrow: !0,
|
|
55
|
+
trigger: [v.value]
|
|
56
|
+
}, {
|
|
57
|
+
default: () => [r("div", {
|
|
58
|
+
class: `${l}-list-item`
|
|
59
|
+
}, [r("div", {
|
|
60
|
+
class: `${l}-list-item-icon`
|
|
61
|
+
}, [d.value])])]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
E as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineComponent as P, computed as i, createVNode as r, mergeProps as p, isVNode as $ } from "vue";
|
|
2
|
+
import { Tooltip as j } from "ant-design-vue";
|
|
3
|
+
import { b as c } from "../chunks/module-chunk.mjs";
|
|
4
|
+
import A from "../_util/pick-attrs.mjs";
|
|
5
|
+
import V from "../_util/hooks/use-x-component-config.mjs";
|
|
6
|
+
import "../x-provider/index.mjs";
|
|
7
|
+
import X from "./ActionMenu.mjs";
|
|
8
|
+
import O from "./style/index.mjs";
|
|
9
|
+
import T from "../x-provider/hooks/use-x-provider-context.mjs";
|
|
10
|
+
function w(s) {
|
|
11
|
+
return typeof s == "function" || Object.prototype.toString.call(s) === "[object Object]" && !$(s);
|
|
12
|
+
}
|
|
13
|
+
const J = /* @__PURE__ */ P({
|
|
14
|
+
name: "AXActions",
|
|
15
|
+
__name: "Actions",
|
|
16
|
+
props: {
|
|
17
|
+
items: {
|
|
18
|
+
default: () => []
|
|
19
|
+
},
|
|
20
|
+
rootClassName: {
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
block: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
onClick: {
|
|
28
|
+
type: Function
|
|
29
|
+
},
|
|
30
|
+
style: null,
|
|
31
|
+
variant: {
|
|
32
|
+
default: "borderless"
|
|
33
|
+
},
|
|
34
|
+
prefixCls: null
|
|
35
|
+
},
|
|
36
|
+
emits: ["click"],
|
|
37
|
+
setup(s, {
|
|
38
|
+
emit: f
|
|
39
|
+
}) {
|
|
40
|
+
const o = s, a = f, {
|
|
41
|
+
getPrefixCls: d,
|
|
42
|
+
direction: C
|
|
43
|
+
} = T(), l = d("actions", o.prefixCls), m = V("actions"), [k, y, v] = O(l), b = i(() => c(l, m.value.className, o.rootClassName, v, y.value, {
|
|
44
|
+
[`${l}-rtl`]: C.value === "rtl"
|
|
45
|
+
})), g = i(() => ({
|
|
46
|
+
...m.value.style,
|
|
47
|
+
...typeof o.style == "object" ? o.style : {}
|
|
48
|
+
})), x = (t, e, n) => e ? r(j, p(n, {
|
|
49
|
+
title: e
|
|
50
|
+
}), w(t) ? t : {
|
|
51
|
+
default: () => [t]
|
|
52
|
+
}) : t, h = (t, e, n) => {
|
|
53
|
+
if (e.onItemClick) {
|
|
54
|
+
e.onItemClick(e);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
a("click", {
|
|
58
|
+
key: t,
|
|
59
|
+
item: e,
|
|
60
|
+
keyPath: [t],
|
|
61
|
+
domEvent: n
|
|
62
|
+
});
|
|
63
|
+
}, S = (t) => {
|
|
64
|
+
a("click", t);
|
|
65
|
+
}, _ = (t) => {
|
|
66
|
+
const {
|
|
67
|
+
icon: e,
|
|
68
|
+
label: n,
|
|
69
|
+
key: u
|
|
70
|
+
} = t;
|
|
71
|
+
return r("div", {
|
|
72
|
+
class: c(`${l}-list-item`),
|
|
73
|
+
onClick: (I) => h(u, t, I),
|
|
74
|
+
key: u
|
|
75
|
+
}, [x(r("div", {
|
|
76
|
+
class: `${l}-list-item-icon`
|
|
77
|
+
}, [e]), n)]);
|
|
78
|
+
}, N = i(() => A(o, {
|
|
79
|
+
aria: !0,
|
|
80
|
+
data: !0
|
|
81
|
+
}));
|
|
82
|
+
return () => k(r("div", p({
|
|
83
|
+
class: b.value
|
|
84
|
+
}, N.value, {
|
|
85
|
+
style: g.value
|
|
86
|
+
}), [r("div", {
|
|
87
|
+
class: c(`${l}-list`, o.variant, {
|
|
88
|
+
block: o.block
|
|
89
|
+
})
|
|
90
|
+
}, [o.items.map((t) => "children" in t && t.children ? r(X, {
|
|
91
|
+
key: t.key,
|
|
92
|
+
item: t,
|
|
93
|
+
prefixCls: l,
|
|
94
|
+
onClick: S
|
|
95
|
+
}, null) : _(t))])]));
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
export {
|
|
99
|
+
J as default
|
|
100
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import "vue";
|
|
2
|
+
import "../../_util/cssinjs/StyleContext.mjs";
|
|
3
|
+
import "../../_util/cssinjs/theme/ThemeCache.mjs";
|
|
4
|
+
import "../../_util/warning.mjs";
|
|
5
|
+
import "../../_util/cssinjs/transformers/legacyLogicalProperties.mjs";
|
|
6
|
+
import { merge as e } from "../../_util/cssinjs-utils/util/statistic.mjs";
|
|
7
|
+
import { genStyleHooks as t } from "../../theme/genStyleUtils.mjs";
|
|
8
|
+
const n = (i) => {
|
|
9
|
+
const { componentCls: o, calc: r } = i;
|
|
10
|
+
return {
|
|
11
|
+
[o]: {
|
|
12
|
+
[`&${o}-rtl`]: {
|
|
13
|
+
direction: "rtl"
|
|
14
|
+
},
|
|
15
|
+
[`${o}-list`]: {
|
|
16
|
+
display: "inline-flex",
|
|
17
|
+
flexDirection: "row",
|
|
18
|
+
gap: i.paddingXS,
|
|
19
|
+
color: i.colorTextDescription,
|
|
20
|
+
"&-item, &-sub-item": {
|
|
21
|
+
cursor: "pointer",
|
|
22
|
+
padding: i.paddingXXS,
|
|
23
|
+
borderRadius: i.borderRadius,
|
|
24
|
+
height: i.controlHeightSM,
|
|
25
|
+
width: i.controlHeightSM,
|
|
26
|
+
boxSizing: "border-box",
|
|
27
|
+
display: "inline-flex",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
"&-icon": {
|
|
31
|
+
display: "inline-flex",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
justifyContent: "center",
|
|
34
|
+
fontSize: i.fontSize,
|
|
35
|
+
width: "100%",
|
|
36
|
+
height: "100%"
|
|
37
|
+
},
|
|
38
|
+
"&:hover": {
|
|
39
|
+
background: i.colorBgTextHover
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"& .border": {
|
|
44
|
+
padding: `${i.paddingXS}px ${i.paddingSM}px`,
|
|
45
|
+
gap: i.paddingSM,
|
|
46
|
+
borderRadius: r(i.borderRadiusLG).mul(1.5).equal(),
|
|
47
|
+
backgroundColor: i.colorBorderSecondary,
|
|
48
|
+
color: i.colorTextSecondary,
|
|
49
|
+
[`${o}-list-item, ${o}-list-sub-item`]: {
|
|
50
|
+
padding: 0,
|
|
51
|
+
lineHeight: i.lineHeight,
|
|
52
|
+
"&-icon": {
|
|
53
|
+
fontSize: i.fontSizeLG
|
|
54
|
+
},
|
|
55
|
+
"&:hover": {
|
|
56
|
+
opacity: 0.8
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"& .block": {
|
|
61
|
+
display: "flex"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}, d = () => ({}), u = t(
|
|
66
|
+
"Actions",
|
|
67
|
+
(i) => {
|
|
68
|
+
const o = e(i, {});
|
|
69
|
+
return [n(o)];
|
|
70
|
+
},
|
|
71
|
+
d
|
|
72
|
+
);
|
|
73
|
+
export {
|
|
74
|
+
u as default,
|
|
75
|
+
d as prepareComponentToken
|
|
76
|
+
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { b as
|
|
1
|
+
import { defineComponent as b, computed as $, useTemplateRef as E, watchEffect as N, onWatcherCleanup as P, watch as k, nextTick as O, createVNode as i, TransitionGroup as T, Fragment as I, isVNode as j } from "vue";
|
|
2
|
+
import { b as g, P as A, L as F, R as M } from "../../chunks/module-chunk.mjs";
|
|
3
3
|
import { Button as s } from "ant-design-vue";
|
|
4
|
-
import
|
|
5
|
-
import { useAttachmentContextInject as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
4
|
+
import c from "../../_util/hooks/use-state.mjs";
|
|
5
|
+
import { useAttachmentContextInject as W } from "../context.mjs";
|
|
6
|
+
import X from "../SilentUploader.mjs";
|
|
7
|
+
import z from "./FileListCard.mjs";
|
|
8
|
+
function H(t) {
|
|
9
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !j(t);
|
|
10
|
+
}
|
|
11
|
+
const p = 1, Q = /* @__PURE__ */ b({
|
|
9
12
|
name: "AXAttachmentsFileList",
|
|
10
13
|
__name: "FileList",
|
|
11
14
|
props: {
|
|
@@ -20,79 +23,128 @@ const d = 1, I = /* @__PURE__ */ $({
|
|
|
20
23
|
itemClassName: {},
|
|
21
24
|
itemStyle: {}
|
|
22
25
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const n =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
setup(t) {
|
|
27
|
+
const n = $(() => `${t.prefixCls}-list`), r = E("file-list-container"), [V, m] = c(!1), v = W();
|
|
28
|
+
N(() => {
|
|
29
|
+
m(!0), P(() => {
|
|
30
|
+
m(!1);
|
|
28
31
|
});
|
|
29
32
|
});
|
|
30
|
-
const [
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
+
const [w, f] = c(!1), [x, u] = c(!1), d = () => {
|
|
34
|
+
const e = r.value;
|
|
35
|
+
e && (t.overflow === "scrollX" ? (f(Math.abs(e.scrollLeft) >= p), u(e.scrollWidth - e.clientWidth - Math.abs(e.scrollLeft) >= p)) : t.overflow === "scrollY" && (f(e.scrollTop !== 0), u(e.scrollHeight - e.clientHeight !== e.scrollTop)));
|
|
33
36
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
k([() => t.overflow, () => t.items.length], () => {
|
|
38
|
+
O(() => {
|
|
39
|
+
d();
|
|
37
40
|
});
|
|
38
41
|
}, {
|
|
39
42
|
immediate: !0
|
|
40
43
|
});
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
left:
|
|
44
|
+
const h = (e) => {
|
|
45
|
+
const l = r.value;
|
|
46
|
+
l && l.scrollTo({
|
|
47
|
+
left: l.scrollLeft + e * l.clientWidth,
|
|
45
48
|
behavior: "smooth"
|
|
46
49
|
});
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, null)), !h.value.disabled && t(O, {
|
|
72
|
-
upload: e.upload,
|
|
73
|
-
children: t(s, {
|
|
74
|
-
class: `${n.value}-upload-btn`,
|
|
75
|
-
type: "dashed"
|
|
50
|
+
}, y = () => {
|
|
51
|
+
h(-1);
|
|
52
|
+
}, C = () => {
|
|
53
|
+
h(1);
|
|
54
|
+
}, L = (e, l) => {
|
|
55
|
+
const a = e.classList.contains("ant-attachment-list-card-type-preview") ? [{
|
|
56
|
+
width: "0px"
|
|
57
|
+
}, {
|
|
58
|
+
width: "64px"
|
|
59
|
+
}] : [{
|
|
60
|
+
width: "0px"
|
|
61
|
+
}, {
|
|
62
|
+
width: "236px"
|
|
63
|
+
}], o = e.animate(a, {
|
|
64
|
+
duration: 300,
|
|
65
|
+
easing: "ease",
|
|
66
|
+
fill: "forwards"
|
|
67
|
+
});
|
|
68
|
+
o.onfinish = () => l();
|
|
69
|
+
}, R = (e, l) => {
|
|
70
|
+
const a = e.classList.contains("ant-attachment-list-card-type-preview") ? [{
|
|
71
|
+
opacity: 1,
|
|
72
|
+
width: "64px",
|
|
73
|
+
marginRight: "0px"
|
|
76
74
|
}, {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
opacity: 0,
|
|
76
|
+
width: "0px",
|
|
77
|
+
marginRight: "-10px"
|
|
78
|
+
}] : [{
|
|
79
|
+
opacity: 1,
|
|
80
|
+
width: "236px",
|
|
81
|
+
marginRight: "0px"
|
|
82
|
+
}, {
|
|
83
|
+
opacity: 0,
|
|
84
|
+
width: "0px",
|
|
85
|
+
marginRight: "-10px",
|
|
86
|
+
paddingRight: "0px",
|
|
87
|
+
paddingLeft: "0px"
|
|
88
|
+
}], o = e.animate(a, {
|
|
89
|
+
duration: 300,
|
|
90
|
+
easing: "ease",
|
|
91
|
+
fill: "forwards"
|
|
92
|
+
});
|
|
93
|
+
o.onfinish = () => l();
|
|
94
|
+
};
|
|
95
|
+
return () => {
|
|
96
|
+
let e;
|
|
97
|
+
return i("div", {
|
|
98
|
+
class: g(n.value, {
|
|
99
|
+
[`${n.value}-overflow-${t.overflow}`]: t.overflow,
|
|
100
|
+
[`${n.value}-overflow-ping-start`]: w.value,
|
|
101
|
+
[`${n.value}-overflow-ping-end`]: x.value
|
|
102
|
+
}, t.listClassName),
|
|
103
|
+
ref: "file-list-container",
|
|
104
|
+
onScroll: d,
|
|
105
|
+
style: t.listStyle
|
|
106
|
+
}, [i(T, {
|
|
107
|
+
onEnter: L,
|
|
108
|
+
onLeave: R,
|
|
109
|
+
css: !1
|
|
110
|
+
}, H(e = t.items.map((l) => i(z, {
|
|
111
|
+
key: l.uid,
|
|
112
|
+
prefixCls: t.prefixCls,
|
|
113
|
+
item: l,
|
|
114
|
+
onRemove: t.onRemove,
|
|
115
|
+
className: g(t.itemClassName),
|
|
116
|
+
imageProps: t.imageProps,
|
|
117
|
+
style: {
|
|
118
|
+
...t.itemStyle
|
|
119
|
+
}
|
|
120
|
+
}, null))) ? e : {
|
|
121
|
+
default: () => [e]
|
|
122
|
+
}), !v.value.disabled && i(X, {
|
|
123
|
+
upload: t.upload,
|
|
124
|
+
children: i(s, {
|
|
125
|
+
class: `${n.value}-upload-btn`,
|
|
126
|
+
type: "dashed"
|
|
127
|
+
}, {
|
|
128
|
+
default: () => [i(A, {
|
|
129
|
+
class: `${n.value}-upload-btn-icon`
|
|
130
|
+
}, null)]
|
|
131
|
+
})
|
|
132
|
+
}, null), t.overflow === "scrollX" && i(I, null, [i(s, {
|
|
133
|
+
size: "small",
|
|
134
|
+
shape: "circle",
|
|
135
|
+
class: `${n.value}-prev-btn`,
|
|
136
|
+
icon: i(F, null, null),
|
|
137
|
+
onClick: y
|
|
138
|
+
}, null), i(s, {
|
|
139
|
+
size: "small",
|
|
140
|
+
shape: "circle",
|
|
141
|
+
class: `${n.value}-next-btn`,
|
|
142
|
+
icon: i(M, null, null),
|
|
143
|
+
onClick: C
|
|
144
|
+
}, null)])]);
|
|
145
|
+
};
|
|
94
146
|
}
|
|
95
147
|
});
|
|
96
148
|
export {
|
|
97
|
-
|
|
149
|
+
Q as default
|
|
98
150
|
};
|