@opentiny/tiny-robot 0.2.0-alpha.5 → 0.2.0-alpha.7
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/action-group/index.js +69 -67
- package/dist/bubble/index.js +261 -259
- package/dist/dropdown-menu/index.js +33 -30
- package/dist/feedback/index.js +44 -44
- package/dist/flow-layout-buttons/index.js +74 -71
- package/dist/index.d.ts +215 -142
- package/dist/index3.js +233 -202
- package/dist/sender/index.js +898 -712
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +156 -98
- package/dist/suggestion-popover/index.js +68 -65
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { o as
|
|
3
|
-
import { T as
|
|
4
|
-
import { o as
|
|
5
|
-
import
|
|
6
|
-
import { _ as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as N, nextTick as W, createElementBlock as _, openBlock as n, createBlock as v, createCommentVNode as R, Fragment as G, renderList as I, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as x, renderSlot as L, createVNode as E, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, toDisplayString as Q, vShow as U } from "vue";
|
|
2
|
+
import { o as Y } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { T as M } from "../index4.js";
|
|
4
|
+
import { o as Z, b as ee } from "../index3.js";
|
|
5
|
+
import te from "../icon-button/index.js";
|
|
6
|
+
import { _ as oe } from "../_plugin-vue_export-helper.js";
|
|
7
|
+
const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae = { class: "tr-action-group__dropdown-item-text" }, ce = /* @__PURE__ */ $({
|
|
8
8
|
__name: "ActionGroup",
|
|
9
9
|
props: {
|
|
10
10
|
maxNum: {},
|
|
@@ -12,61 +12,61 @@ const re = { class: "tr-action-group" }, le = ["onClick"], ae = ["onClick"], ce
|
|
|
12
12
|
dropDownShowLabelOnly: { type: Boolean }
|
|
13
13
|
},
|
|
14
14
|
emits: ["item-click"],
|
|
15
|
-
setup(l, { emit:
|
|
16
|
-
const a = l,
|
|
15
|
+
setup(l, { emit: k }) {
|
|
16
|
+
const a = l, F = H(), O = k, p = i(() => {
|
|
17
17
|
var o, t;
|
|
18
|
-
const e =
|
|
18
|
+
const e = F.default();
|
|
19
19
|
return Array.isArray(e) ? e.length === 1 && ((o = e[0].type) == null ? void 0 : o.toString()) === "Symbol(v-fgt)" ? e[0].children : e : ((t = e.type) == null ? void 0 : t.toString()) === "Symbol(v-fgt)" ? e.children : [e];
|
|
20
|
-
}),
|
|
20
|
+
}), b = i(() => {
|
|
21
21
|
const e = a.maxNum ?? Number.MAX_SAFE_INTEGER;
|
|
22
22
|
return e > 0 ? e : Number.MAX_SAFE_INTEGER;
|
|
23
|
-
}),
|
|
23
|
+
}), y = i(() => p.value.length > b.value), V = i(() => y.value ? p.value.slice(0, b.value) : p.value), z = i(() => y.value ? p.value.slice(b.value) : []), m = f(null), d = f(null), r = f(!1), P = () => {
|
|
24
24
|
r.value = !r.value;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
Z(d, (e) => {
|
|
27
27
|
var o;
|
|
28
|
-
(o =
|
|
28
|
+
(o = m.value) != null && o.contains(e.target) || (r.value = !1);
|
|
29
29
|
});
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
if (!
|
|
30
|
+
const A = (e) => {
|
|
31
|
+
O("item-click", e), r.value = !1;
|
|
32
|
+
}, B = f("placement-bottom"), { height: D } = ee(), T = () => {
|
|
33
|
+
if (!d.value || !m.value)
|
|
34
34
|
return "placement-bottom";
|
|
35
|
-
const e =
|
|
36
|
-
|
|
35
|
+
const e = d.value.getBoundingClientRect(), o = m.value.getBoundingClientRect();
|
|
36
|
+
B.value = o.bottom + e.height + 16 > D.value ? "placement-top" : "placement-bottom";
|
|
37
37
|
};
|
|
38
38
|
return N(r, (e) => {
|
|
39
|
-
e &&
|
|
40
|
-
|
|
39
|
+
e && W(() => {
|
|
40
|
+
T();
|
|
41
41
|
});
|
|
42
|
-
}), N(
|
|
43
|
-
r.value &&
|
|
44
|
-
}), (e, o) => (n(),
|
|
45
|
-
(n(!0),
|
|
42
|
+
}), N(D, () => {
|
|
43
|
+
r.value && T();
|
|
44
|
+
}), (e, o) => (n(), _("div", ne, [
|
|
45
|
+
(n(!0), _(G, null, I(V.value, (t, C) => {
|
|
46
46
|
var c;
|
|
47
|
-
return n(),
|
|
48
|
-
key:
|
|
47
|
+
return n(), v(h(M), {
|
|
48
|
+
key: C,
|
|
49
49
|
content: (c = t.props) == null ? void 0 : c.label,
|
|
50
50
|
effect: "dark",
|
|
51
51
|
placement: "top",
|
|
52
52
|
"open-delay": 500,
|
|
53
53
|
disabled: !a.showTooltip
|
|
54
54
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
|
|
55
|
+
default: S(() => [
|
|
56
|
+
w("span", {
|
|
57
57
|
class: "tr-action-group__btn-wrapper",
|
|
58
|
-
onClick: (
|
|
58
|
+
onClick: (X) => {
|
|
59
59
|
var s;
|
|
60
|
-
return
|
|
60
|
+
return A((s = t.props) == null ? void 0 : s.name);
|
|
61
61
|
}
|
|
62
62
|
}, [
|
|
63
|
-
(n(),
|
|
64
|
-
], 8,
|
|
63
|
+
(n(), v(x(t)))
|
|
64
|
+
], 8, re)
|
|
65
65
|
]),
|
|
66
66
|
_: 2
|
|
67
67
|
}, 1032, ["content", "disabled"]);
|
|
68
68
|
}), 128)),
|
|
69
|
-
|
|
69
|
+
y.value ? (n(), v(h(M), {
|
|
70
70
|
key: 0,
|
|
71
71
|
content: "更多",
|
|
72
72
|
effect: "dark",
|
|
@@ -74,37 +74,39 @@ const re = { class: "tr-action-group" }, le = ["onClick"], ae = ["onClick"], ce
|
|
|
74
74
|
"open-delay": 500,
|
|
75
75
|
disabled: !a.showTooltip
|
|
76
76
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
default: S(() => [
|
|
78
|
+
w("span", {
|
|
79
|
+
ref_key: "moreBtnRef",
|
|
80
|
+
ref: m,
|
|
80
81
|
class: "tr-action-group__btn-wrapper",
|
|
81
|
-
onClick:
|
|
82
|
+
onClick: P
|
|
82
83
|
}, [
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
L(e.$slots, "moreBtn", {}, () => [
|
|
85
|
+
E(h(te), { icon: h(Y) }, null, 8, ["icon"])
|
|
85
86
|
], !0),
|
|
86
|
-
|
|
87
|
-
default:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
E(j, { name: "tr-action-group-dropdown" }, {
|
|
88
|
+
default: S(() => [
|
|
89
|
+
q(w("ul", {
|
|
90
|
+
ref_key: "dropDownRef",
|
|
91
|
+
ref: d,
|
|
92
|
+
class: J(["tr-action-group__dropdown", B.value])
|
|
91
93
|
}, [
|
|
92
|
-
(n(!0),
|
|
94
|
+
(n(!0), _(G, null, I(z.value, (t, C) => {
|
|
93
95
|
var c;
|
|
94
|
-
return n(),
|
|
96
|
+
return n(), _("li", {
|
|
95
97
|
class: "tr-action-group__dropdown-item",
|
|
96
|
-
key:
|
|
97
|
-
onClick:
|
|
98
|
+
key: C,
|
|
99
|
+
onClick: K((X) => {
|
|
98
100
|
var s;
|
|
99
|
-
return
|
|
101
|
+
return A((s = t.props) == null ? void 0 : s.name);
|
|
100
102
|
}, ["stop"])
|
|
101
103
|
}, [
|
|
102
|
-
a.dropDownShowLabelOnly ?
|
|
103
|
-
|
|
104
|
-
], 8,
|
|
104
|
+
a.dropDownShowLabelOnly ? R("", !0) : (n(), v(x(t), { key: 0 })),
|
|
105
|
+
w("span", ae, Q((c = t.props) == null ? void 0 : c.label), 1)
|
|
106
|
+
], 8, le);
|
|
105
107
|
}), 128))
|
|
106
108
|
], 2), [
|
|
107
|
-
[
|
|
109
|
+
[U, r.value]
|
|
108
110
|
])
|
|
109
111
|
]),
|
|
110
112
|
_: 1
|
|
@@ -112,31 +114,31 @@ const re = { class: "tr-action-group" }, le = ["onClick"], ae = ["onClick"], ce
|
|
|
112
114
|
], 512)
|
|
113
115
|
]),
|
|
114
116
|
_: 3
|
|
115
|
-
}, 8, ["disabled"])) :
|
|
117
|
+
}, 8, ["disabled"])) : R("", !0)
|
|
116
118
|
]));
|
|
117
119
|
}
|
|
118
|
-
}),
|
|
120
|
+
}), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-afd2130f"]]), u = /* @__PURE__ */ $({
|
|
119
121
|
__name: "ActionGroupItem",
|
|
120
122
|
props: {
|
|
121
123
|
name: {},
|
|
122
124
|
label: {}
|
|
123
125
|
},
|
|
124
126
|
setup(l) {
|
|
125
|
-
return (
|
|
127
|
+
return (k, a) => L(k.$slots, "default");
|
|
126
128
|
}
|
|
127
129
|
});
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
l.component(
|
|
130
|
+
g.name = "TrActionGroup";
|
|
131
|
+
const se = function(l) {
|
|
132
|
+
l.component(g.name, g);
|
|
131
133
|
};
|
|
132
|
-
|
|
134
|
+
g.install = se;
|
|
133
135
|
u.name = "TrActionGroupItem";
|
|
134
|
-
const
|
|
136
|
+
const ie = function(l) {
|
|
135
137
|
l.component(u.name, u);
|
|
136
138
|
};
|
|
137
|
-
u.install =
|
|
138
|
-
const
|
|
139
|
+
u.install = ie;
|
|
140
|
+
const ve = u;
|
|
139
141
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
ve as ActionGroupItem,
|
|
143
|
+
g as default
|
|
142
144
|
};
|