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