@opentiny/tiny-robot 0.3.0-alpha.12 → 0.3.0-alpha.13
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 +15 -15
- package/dist/attachments/index.js +62 -62
- package/dist/container/index.js +10 -10
- package/dist/dropdown-menu/index.js +116 -49
- package/dist/feedback/index.js +50 -50
- package/dist/flow-layout-buttons/index.js +10 -10
- package/dist/history/index.js +26 -26
- package/dist/index.d.ts +188 -34
- package/dist/index.js +47 -43
- package/dist/index2.js +7 -6
- package/dist/index3.js +426 -418
- package/dist/index4.js +67 -67
- package/dist/index5.js +22 -21
- package/dist/index6.js +795 -599
- package/dist/index7.js +3622 -1717
- package/dist/mcp-server-picker/index.js +29972 -0
- package/dist/question/index.js +12 -12
- package/dist/sender/index.js +212 -212
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +67 -67
- package/dist/suggestion-pills/index.js +11 -11
- package/dist/suggestion-popover/index.js +14 -14
- package/dist/tiny-robot-svgs.js +162 -108
- package/dist/useSlotRefs.js +13 -13
- package/dist/utils.js +8 -2
- package/package.json +10 -3
|
@@ -1,10 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { ref as k, onUnmounted as T, watch as C, defineComponent as E, mergeModels as y, useModel as H, computed as p, createBlock as I, openBlock as w, unref as X, withCtx as _, createElementVNode as j, createElementBlock as b, Fragment as D, renderList as L, toDisplayString as Y, renderSlot as O } from "vue";
|
|
2
|
+
import { w as S, b as M, o as $ } from "../index3.js";
|
|
3
|
+
import { B as A } from "../index4.js";
|
|
4
|
+
import { u as F } from "../utils.js";
|
|
5
|
+
import { _ as G } from "../_plugin-vue_export-helper.js";
|
|
6
|
+
const P = (o, t) => o.x >= t.left && o.x <= t.right && o.y >= t.top && o.y <= t.bottom, N = (o, t, g = !1) => {
|
|
7
|
+
if (t.length < 3) return !1;
|
|
8
|
+
const l = o.x, d = o.y;
|
|
9
|
+
let f = !1;
|
|
10
|
+
const r = (s, c, a, n, i, e) => {
|
|
11
|
+
const m = (i - a) * (c - n) - (e - n) * (s - a);
|
|
12
|
+
if (Math.abs(m) > 1e-10) return !1;
|
|
13
|
+
const u = Math.min(a, i), h = Math.max(a, i), x = Math.min(n, e), B = Math.max(n, e);
|
|
14
|
+
return s >= u && s <= h && c >= x && c <= B;
|
|
15
|
+
};
|
|
16
|
+
for (let s = 0, c = t.length - 1; s < t.length; c = s++) {
|
|
17
|
+
const a = t[s].x, n = t[s].y, i = t[c].x, e = t[c].y;
|
|
18
|
+
if (g && r(l, d, a, n, i, e))
|
|
19
|
+
return !0;
|
|
20
|
+
if (n > d && e <= d || e > d && n <= d) {
|
|
21
|
+
const u = (i - a) * (d - n) / (e - n) + a;
|
|
22
|
+
l < u && (f = !f);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return f;
|
|
26
|
+
}, U = (o, t) => t.bottom < o.top ? [
|
|
27
|
+
{ x: o.left, y: o.top },
|
|
28
|
+
{ x: o.right, y: o.top },
|
|
29
|
+
{ x: t.right, y: t.bottom },
|
|
30
|
+
{ x: t.left, y: t.bottom }
|
|
31
|
+
] : t.top > o.bottom ? [
|
|
32
|
+
{ x: o.left, y: o.bottom },
|
|
33
|
+
{ x: o.right, y: o.bottom },
|
|
34
|
+
{ x: t.right, y: t.top },
|
|
35
|
+
{ x: t.left, y: t.top }
|
|
36
|
+
] : [], { x: V, y: q } = F(), z = (o, t, g) => {
|
|
37
|
+
const { delayEnter: l = 0, delayLeave: d = 0 } = g || {}, f = k(!1), r = k("outside");
|
|
38
|
+
let s = null;
|
|
39
|
+
const c = () => {
|
|
40
|
+
s && (clearTimeout(s), s = null);
|
|
41
|
+
};
|
|
42
|
+
T(() => {
|
|
43
|
+
c();
|
|
44
|
+
});
|
|
45
|
+
const a = (n) => {
|
|
46
|
+
const i = n ? l : d;
|
|
47
|
+
c(), i ? s = setTimeout(() => f.value = n, i) : f.value = n;
|
|
48
|
+
};
|
|
49
|
+
return C(
|
|
50
|
+
r,
|
|
51
|
+
(n) => {
|
|
52
|
+
["trigger", "popper", "polygon"].includes(n) ? a(!0) : a(!1);
|
|
53
|
+
},
|
|
54
|
+
{ immediate: !0 }
|
|
55
|
+
), S(
|
|
56
|
+
[V, q],
|
|
57
|
+
([n, i]) => {
|
|
58
|
+
const e = M(o), m = M(t), u = e == null ? void 0 : e.getBoundingClientRect(), h = m == null ? void 0 : m.getBoundingClientRect();
|
|
59
|
+
if (u && P({ x: n, y: i }, u)) {
|
|
60
|
+
r.value = "trigger";
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (h && P({ x: n, y: i }, h)) {
|
|
64
|
+
r.value = "popper";
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!u || !h || u.width === 0 || u.height === 0 || h.width === 0 || h.height === 0) {
|
|
68
|
+
r.value = "outside";
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
N({ x: n, y: i }, U(u, h), !0) ? r.value = "polygon" : r.value = "outside";
|
|
72
|
+
},
|
|
73
|
+
{ throttle: 10 }
|
|
74
|
+
), f;
|
|
75
|
+
}, J = { class: "tr-dropdown-menu__list" }, K = ["onClick"], Q = /* @__PURE__ */ E({
|
|
6
76
|
__name: "index",
|
|
7
|
-
props: /* @__PURE__ */
|
|
77
|
+
props: /* @__PURE__ */ y({
|
|
8
78
|
appendTo: {},
|
|
9
79
|
items: {},
|
|
10
80
|
show: { type: Boolean },
|
|
@@ -13,80 +83,77 @@ const F = { class: "tr-dropdown-menu__list" }, N = ["onClick"], O = /* @__PURE__
|
|
|
13
83
|
show: { type: Boolean, default: !1 },
|
|
14
84
|
showModifiers: {}
|
|
15
85
|
}),
|
|
16
|
-
emits: /* @__PURE__ */
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
get: () =>
|
|
86
|
+
emits: /* @__PURE__ */ y(["item-click", "click-outside"], ["update:show"]),
|
|
87
|
+
setup(o, { expose: t, emit: g }) {
|
|
88
|
+
const l = o, d = g, f = H(o, "show"), r = p({
|
|
89
|
+
get: () => l.trigger === "manual" ? l.show : f.value,
|
|
20
90
|
set: (e) => {
|
|
21
|
-
|
|
91
|
+
l.trigger !== "manual" && (f.value = e);
|
|
22
92
|
}
|
|
23
|
-
}), s =
|
|
93
|
+
}), s = k(null), c = p(() => {
|
|
24
94
|
var e;
|
|
25
95
|
return (e = s.value) == null ? void 0 : e.triggerRef;
|
|
26
|
-
}),
|
|
96
|
+
}), a = p(() => {
|
|
27
97
|
var e;
|
|
28
98
|
return (e = s.value) == null ? void 0 : e.popperRef;
|
|
29
99
|
});
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
100
|
+
if (l.trigger === "click" || l.trigger === "manual")
|
|
101
|
+
$(
|
|
102
|
+
a,
|
|
33
103
|
(e) => {
|
|
34
|
-
|
|
104
|
+
d("click-outside", e), r.value = !1;
|
|
35
105
|
},
|
|
36
|
-
{ ignore: [
|
|
37
|
-
);
|
|
38
|
-
else if (t.trigger === "hover") {
|
|
39
|
-
const e = h(p, { delayEnter: 100, delayLeave: 300 }), m = h(u, { delayEnter: 100, delayLeave: 300 });
|
|
40
|
-
R(
|
|
41
|
-
() => [e.value, m.value],
|
|
42
|
-
([r, g]) => {
|
|
43
|
-
o.value = r || g;
|
|
44
|
-
}
|
|
106
|
+
{ ignore: [c] }
|
|
45
107
|
);
|
|
108
|
+
else if (l.trigger === "hover") {
|
|
109
|
+
const e = z(c, a, { delayEnter: 100, delayLeave: 100 });
|
|
110
|
+
C(e, (m) => {
|
|
111
|
+
r.value = m;
|
|
112
|
+
});
|
|
46
113
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
114
|
+
const n = () => {
|
|
115
|
+
l.trigger === "click" && (r.value = !r.value);
|
|
116
|
+
}, i = (e) => {
|
|
117
|
+
r.value = !1, d("item-click", e);
|
|
51
118
|
};
|
|
52
|
-
return
|
|
119
|
+
return t({
|
|
53
120
|
update: () => {
|
|
54
121
|
var e;
|
|
55
122
|
(e = s.value) == null || e.update();
|
|
56
123
|
}
|
|
57
|
-
}), (e, m) => (
|
|
58
|
-
show:
|
|
124
|
+
}), (e, m) => (w(), I(X(A), {
|
|
125
|
+
show: r.value,
|
|
59
126
|
class: "tr-dropdown-menu",
|
|
60
127
|
ref_key: "basePopperRef",
|
|
61
128
|
ref: s,
|
|
62
129
|
placement: "top-left",
|
|
63
|
-
"append-to":
|
|
130
|
+
"append-to": l.appendTo,
|
|
64
131
|
offset: 8,
|
|
65
132
|
"transition-props": { name: "tr-dropdown-menu" },
|
|
66
133
|
"prevent-overflow": !0,
|
|
67
|
-
"trigger-events": { onClick:
|
|
134
|
+
"trigger-events": { onClick: n }
|
|
68
135
|
}, {
|
|
69
|
-
trigger:
|
|
70
|
-
|
|
136
|
+
trigger: _(() => [
|
|
137
|
+
O(e.$slots, "trigger", {}, void 0, !0)
|
|
71
138
|
]),
|
|
72
|
-
content:
|
|
73
|
-
|
|
74
|
-
(
|
|
139
|
+
content: _(() => [
|
|
140
|
+
j("ul", J, [
|
|
141
|
+
(w(!0), b(D, null, L(l.items, (u) => (w(), b("li", {
|
|
75
142
|
class: "tr-dropdown-menu__list-item",
|
|
76
|
-
key:
|
|
77
|
-
onClick: (
|
|
78
|
-
},
|
|
143
|
+
key: u.id,
|
|
144
|
+
onClick: (h) => i(u)
|
|
145
|
+
}, Y(u.text), 9, K))), 128))
|
|
79
146
|
])
|
|
80
147
|
]),
|
|
81
148
|
_: 3
|
|
82
149
|
}, 8, ["show", "append-to", "trigger-events"]));
|
|
83
150
|
}
|
|
84
|
-
}),
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
151
|
+
}), v = /* @__PURE__ */ G(Q, [["__scopeId", "data-v-8d480727"]]);
|
|
152
|
+
v.name = "TrDropdownMenu";
|
|
153
|
+
const W = function(o) {
|
|
154
|
+
o.component(v.name, v);
|
|
88
155
|
};
|
|
89
|
-
|
|
156
|
+
v.install = W;
|
|
90
157
|
export {
|
|
91
|
-
|
|
158
|
+
v as default
|
|
92
159
|
};
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as X, ref as
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as X, ref as C, computed as z, onMounted as D, watch as O, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as E, renderList as S, toDisplayString as y, createVNode as h, unref as l, nextTick as Y, createElementVNode as d, createBlock as _, withCtx as f, createTextVNode as q, resolveDynamicComponent as A } from "vue";
|
|
2
|
+
import { f as T, d as N, C as j, B as H, Y as J, p as K } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { B as R } from "../index5.js";
|
|
4
|
+
import $, { ActionGroupItem as V } from "../action-group/index.js";
|
|
5
5
|
import Q from "../icon-button/index.js";
|
|
6
6
|
import { _ as P } from "../_plugin-vue_export-helper.js";
|
|
7
|
-
const U = { class: "tr-feedback__source-list" },
|
|
7
|
+
const U = { class: "tr-feedback__source-list" }, W = ["href"], Z = /* @__PURE__ */ X({
|
|
8
8
|
__name: "SourceList",
|
|
9
9
|
props: {
|
|
10
10
|
sources: {},
|
|
11
11
|
linesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
12
12
|
},
|
|
13
13
|
setup(b) {
|
|
14
|
-
const m = b, e =
|
|
15
|
-
|
|
14
|
+
const m = b, e = C(!1), g = C([]), c = C(null), L = () => {
|
|
15
|
+
Y(() => {
|
|
16
16
|
const u = g.value.slice(0, m.sources.length).map((o) => (o == null ? void 0 : o.offsetTop) || 0), n = Array.from(new Set(u));
|
|
17
17
|
if (n.length > m.linesLimit) {
|
|
18
18
|
const o = n[m.linesLimit - 1], s = u.lastIndexOf(o);
|
|
@@ -20,33 +20,33 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
20
20
|
} else
|
|
21
21
|
c.value = null;
|
|
22
22
|
});
|
|
23
|
-
},
|
|
24
|
-
D(L),
|
|
25
|
-
const
|
|
23
|
+
}, x = z(() => m.sources.length - (c.value || 0));
|
|
24
|
+
D(L), O(() => m.sources, L);
|
|
25
|
+
const p = (u, n) => {
|
|
26
26
|
u && (g.value[n] = u);
|
|
27
27
|
};
|
|
28
28
|
return (u, n) => (t(), a("div", U, [
|
|
29
|
-
(t(!0), a(
|
|
29
|
+
(t(!0), a(E, null, S(m.sources, (o, s) => (t(), a(E, { key: s }, [
|
|
30
30
|
!c.value || e.value || s < c.value ? (t(), a("a", {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "pill",
|
|
33
33
|
href: o.link,
|
|
34
34
|
target: "_blank",
|
|
35
35
|
ref_for: !0,
|
|
36
|
-
ref: (r) =>
|
|
37
|
-
}, y(o.label), 9,
|
|
36
|
+
ref: (r) => p(r, s)
|
|
37
|
+
}, y(o.label), 9, W)) : k("", !0),
|
|
38
38
|
c.value && !e.value && s === c.value ? (t(), a("span", {
|
|
39
39
|
key: 1,
|
|
40
40
|
class: "pill",
|
|
41
41
|
onClick: n[0] || (n[0] = (r) => e.value = !0)
|
|
42
|
-
}, y(
|
|
42
|
+
}, y(x.value) + "+ ", 1)) : k("", !0)
|
|
43
43
|
], 64))), 128)),
|
|
44
44
|
e.value ? (t(), a("span", {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "pill collapse-pill",
|
|
47
47
|
onClick: n[1] || (n[1] = (o) => e.value = !1)
|
|
48
48
|
}, [
|
|
49
|
-
h(l(
|
|
49
|
+
h(l(T))
|
|
50
50
|
])) : k("", !0)
|
|
51
51
|
]));
|
|
52
52
|
}
|
|
@@ -66,25 +66,25 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
66
66
|
emits: ["operation", "action"],
|
|
67
67
|
setup(b, { emit: m }) {
|
|
68
68
|
const e = b, g = {
|
|
69
|
-
copy:
|
|
70
|
-
refresh:
|
|
71
|
-
like:
|
|
72
|
-
dislike:
|
|
69
|
+
copy: K,
|
|
70
|
+
refresh: J,
|
|
71
|
+
like: H,
|
|
72
|
+
dislike: j
|
|
73
73
|
}, c = m, L = (n) => {
|
|
74
74
|
var o, s, r;
|
|
75
75
|
(r = (s = (o = e.operations) == null ? void 0 : o.find((v) => v.name === n)) == null ? void 0 : s.onClick) == null || r.call(s), c("operation", n);
|
|
76
|
-
},
|
|
76
|
+
}, x = (n) => {
|
|
77
77
|
var o, s, r;
|
|
78
78
|
(r = (s = (o = e.actions) == null ? void 0 : o.find((v) => v.name === n)) == null ? void 0 : s.onClick) == null || r.call(s), c("action", n);
|
|
79
|
-
},
|
|
80
|
-
|
|
79
|
+
}, p = C(!1), u = () => {
|
|
80
|
+
p.value = !p.value;
|
|
81
81
|
};
|
|
82
82
|
return (n, o) => {
|
|
83
|
-
var s, r, v,
|
|
83
|
+
var s, r, v, B, w, F, M, G;
|
|
84
84
|
return t(), a("div", te, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(s = e.operations) != null && s.length ? (t(),
|
|
85
|
+
d("div", se, [
|
|
86
|
+
d("div", oe, [
|
|
87
|
+
(s = e.operations) != null && s.length ? (t(), _(l($), {
|
|
88
88
|
key: 0,
|
|
89
89
|
"max-num": e.operationsLimit,
|
|
90
90
|
"drop-down-show-label-only": !0,
|
|
@@ -92,14 +92,14 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
92
92
|
class: "tr-feedback__operations-left-action-group"
|
|
93
93
|
}, {
|
|
94
94
|
moreBtn: f(() => [
|
|
95
|
-
h(l(
|
|
95
|
+
h(l(R), {
|
|
96
96
|
round: "",
|
|
97
97
|
size: "mini",
|
|
98
98
|
"reset-time": 0,
|
|
99
99
|
class: "tr-feedback__operations-more-btn"
|
|
100
100
|
}, {
|
|
101
101
|
default: f(() => [
|
|
102
|
-
o[0] || (o[0] =
|
|
102
|
+
o[0] || (o[0] = d("span", null, "更多", -1)),
|
|
103
103
|
h(l(N))
|
|
104
104
|
]),
|
|
105
105
|
_: 1,
|
|
@@ -107,19 +107,19 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
107
107
|
})
|
|
108
108
|
]),
|
|
109
109
|
default: f(() => [
|
|
110
|
-
(t(!0), a(
|
|
110
|
+
(t(!0), a(E, null, S(e.operations, (i) => (t(), _(l(V), {
|
|
111
111
|
key: i.name,
|
|
112
112
|
name: i.name,
|
|
113
113
|
label: i.label
|
|
114
114
|
}, {
|
|
115
115
|
default: f(() => [
|
|
116
|
-
h(l(
|
|
116
|
+
h(l(R), {
|
|
117
117
|
round: "",
|
|
118
118
|
"reset-time": 0,
|
|
119
119
|
size: "mini"
|
|
120
120
|
}, {
|
|
121
121
|
default: f(() => [
|
|
122
|
-
|
|
122
|
+
q(y(i.label), 1)
|
|
123
123
|
]),
|
|
124
124
|
_: 2
|
|
125
125
|
}, 1024)
|
|
@@ -129,32 +129,32 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
129
129
|
]),
|
|
130
130
|
_: 1
|
|
131
131
|
}, 8, ["max-num"])) : (r = e.sources) != null && r.length ? (t(), a("div", ne, [
|
|
132
|
-
|
|
132
|
+
d("span", {
|
|
133
133
|
class: "tr-feedback__source",
|
|
134
134
|
onClick: u
|
|
135
135
|
}, [
|
|
136
|
-
|
|
137
|
-
(t(),
|
|
136
|
+
d("span", null, y((v = e.sources) == null ? void 0 : v.length) + "条来源", 1),
|
|
137
|
+
(t(), _(A(p.value ? l(T) : l(N))))
|
|
138
138
|
])
|
|
139
139
|
])) : k("", !0)
|
|
140
140
|
]),
|
|
141
|
-
|
|
142
|
-
h(l(
|
|
141
|
+
d("div", le, [
|
|
142
|
+
h(l($), {
|
|
143
143
|
"max-num": e.actionsLimit,
|
|
144
144
|
"show-tooltip": !0,
|
|
145
|
-
onItemClick:
|
|
145
|
+
onItemClick: x
|
|
146
146
|
}, {
|
|
147
147
|
default: f(() => [
|
|
148
|
-
(t(!0), a(
|
|
148
|
+
(t(!0), a(E, null, S(e.actions, (i) => (t(), _(l(V), {
|
|
149
149
|
key: i.name,
|
|
150
150
|
name: i.name,
|
|
151
151
|
label: i.label
|
|
152
152
|
}, {
|
|
153
153
|
default: f(() => [
|
|
154
|
-
typeof i.icon == "string" ? (t(),
|
|
154
|
+
typeof i.icon == "string" ? (t(), _(l(Q), {
|
|
155
155
|
key: 0,
|
|
156
156
|
icon: g[i.icon]
|
|
157
|
-
}, null, 8, ["icon"])) : (t(),
|
|
157
|
+
}, null, 8, ["icon"])) : (t(), _(A(i.icon), { key: 1 }))
|
|
158
158
|
]),
|
|
159
159
|
_: 2
|
|
160
160
|
}, 1032, ["name", "label"]))), 128))
|
|
@@ -163,17 +163,17 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
163
163
|
}, 8, ["max-num"])
|
|
164
164
|
])
|
|
165
165
|
]),
|
|
166
|
-
(
|
|
166
|
+
(B = e.operations) != null && B.length && ((w = e.sources) != null && w.length) || p.value && e.sources ? (t(), a("div", ae, [
|
|
167
167
|
(F = e.operations) != null && F.length && ((M = e.sources) != null && M.length) ? (t(), a("div", re, [
|
|
168
|
-
|
|
168
|
+
d("span", {
|
|
169
169
|
class: "tr-feedback__source",
|
|
170
170
|
onClick: u
|
|
171
171
|
}, [
|
|
172
|
-
|
|
173
|
-
(t(),
|
|
172
|
+
d("span", null, y((G = e.sources) == null ? void 0 : G.length) + "条来源", 1),
|
|
173
|
+
(t(), _(A(p.value ? l(T) : l(N))))
|
|
174
174
|
])
|
|
175
175
|
])) : k("", !0),
|
|
176
|
-
|
|
176
|
+
p.value && e.sources ? (t(), _(l(ee), {
|
|
177
177
|
key: 1,
|
|
178
178
|
sources: e.sources,
|
|
179
179
|
"lines-limit": e.sourcesLinesLimit
|
|
@@ -182,12 +182,12 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
182
182
|
]);
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
}),
|
|
186
|
-
|
|
185
|
+
}), I = /* @__PURE__ */ P(ie, [["__scopeId", "data-v-cc6ef316"]]);
|
|
186
|
+
I.name = "TrFeedback";
|
|
187
187
|
const ce = function(b) {
|
|
188
|
-
b.component(
|
|
188
|
+
b.component(I.name, I);
|
|
189
189
|
};
|
|
190
|
-
|
|
190
|
+
I.install = ce;
|
|
191
191
|
export {
|
|
192
|
-
|
|
192
|
+
I as default
|
|
193
193
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as C, Fragment as I, renderList as S, createCommentVNode as _, normalizeClass as x, createBlock as B, resolveDynamicComponent as b, toDisplayString as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as C, Fragment as I, renderList as S, createCommentVNode as _, normalizeClass as x, createBlock as B, resolveDynamicComponent as b, toDisplayString as D, nextTick as H } from "vue";
|
|
2
|
+
import { d as X } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { e as j, o as J } from "../index3.js";
|
|
4
4
|
import { _ as K } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const P = ["onClick"], Q = {
|
|
@@ -18,7 +18,7 @@ const P = ["onClick"], Q = {
|
|
|
18
18
|
selectedModifiers: {}
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ E(["item-click"], ["update:selected"]),
|
|
21
|
-
setup(d, { emit:
|
|
21
|
+
setup(d, { emit: F }) {
|
|
22
22
|
const n = d, u = G(d, "selected");
|
|
23
23
|
g(
|
|
24
24
|
() => n.items,
|
|
@@ -27,7 +27,7 @@ const P = ["onClick"], Q = {
|
|
|
27
27
|
},
|
|
28
28
|
{ immediate: !0 }
|
|
29
29
|
);
|
|
30
|
-
const
|
|
30
|
+
const N = F, y = i(null), w = i(null), k = i(null), M = i([]), s = i(null), m = i(!1), c = i(!1), A = (t, o) => {
|
|
31
31
|
t && (M.value[o] = t);
|
|
32
32
|
}, L = () => {
|
|
33
33
|
s.value = null, m.value = !1, H(() => {
|
|
@@ -43,12 +43,12 @@ const P = ["onClick"], Q = {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
g(() => n.items, L);
|
|
46
|
-
const { width:
|
|
47
|
-
g(
|
|
46
|
+
const { width: W } = j(y);
|
|
47
|
+
g(W, (t) => {
|
|
48
48
|
t > 0 && L();
|
|
49
49
|
});
|
|
50
50
|
const z = $(() => s.value !== null ? n.items.slice(s.value) : []), O = $(() => s.value === null ? !1 : n.items.findIndex((o) => o.id === u.value) >= s.value), R = (t) => {
|
|
51
|
-
u.value = t, c.value = !1,
|
|
51
|
+
u.value = t, c.value = !1, N("item-click", t);
|
|
52
52
|
}, V = () => {
|
|
53
53
|
n.showMoreTrigger === "click" && (c.value = !c.value);
|
|
54
54
|
}, v = (t) => {
|
|
@@ -72,11 +72,11 @@ const P = ["onClick"], Q = {
|
|
|
72
72
|
key: 0,
|
|
73
73
|
class: x(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
74
74
|
ref_for: !0,
|
|
75
|
-
ref: (r) =>
|
|
75
|
+
ref: (r) => A(r, f),
|
|
76
76
|
onClick: (r) => R(e.id)
|
|
77
77
|
}, [
|
|
78
78
|
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
79
|
-
e.label ? (l(), a("span", Q,
|
|
79
|
+
e.label ? (l(), a("span", Q, D(e.label), 1)) : _("", !0)
|
|
80
80
|
], 10, P)) : _("", !0)
|
|
81
81
|
], 64))), 128)),
|
|
82
82
|
C("div", U, [
|
|
@@ -108,7 +108,7 @@ const P = ["onClick"], Q = {
|
|
|
108
108
|
onClick: (f) => R(e.id)
|
|
109
109
|
}, [
|
|
110
110
|
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
111
|
-
C("span", Z,
|
|
111
|
+
C("span", Z, D(e.label), 1)
|
|
112
112
|
], 10, Y))), 128))
|
|
113
113
|
], 512)) : _("", !0)
|
|
114
114
|
], 32)
|
package/dist/history/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as Q, createElementBlock as u, openBlock as n, normalizeStyle as X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as m, unref as e, ref as G, watchEffect as Y, nextTick as Z, mergeModels as N, useCssVars as q, computed as h, useModel as P, createCommentVNode as E, Fragment as T, renderList as $, createBlock as R, withDirectives as ee, mergeProps as te, withCtx as H, withModifiers as S, vModelText as re } from "vue";
|
|
2
|
+
import { a as oe, Q as se, u as ae, v as ne, c as ie } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { I as le } from "../index6.js";
|
|
4
|
-
import { T as
|
|
4
|
+
import { T as U } from "../index2.js";
|
|
5
5
|
import B from "../icon-button/index.js";
|
|
6
6
|
import { o as ce } from "../index3.js";
|
|
7
|
-
import { _ as
|
|
8
|
-
const ue = /* @__PURE__ */
|
|
7
|
+
import { _ as V } from "../_plugin-vue_export-helper.js";
|
|
8
|
+
const ue = /* @__PURE__ */ Q({
|
|
9
9
|
__name: "item-tag",
|
|
10
10
|
props: {
|
|
11
11
|
text: {},
|
|
@@ -21,7 +21,7 @@ const ue = /* @__PURE__ */ V({
|
|
|
21
21
|
p("span", null, k(t.text), 1)
|
|
22
22
|
], 6));
|
|
23
23
|
}
|
|
24
|
-
}), de = /* @__PURE__ */
|
|
24
|
+
}), de = /* @__PURE__ */ V(ue, [["__scopeId", "data-v-346767bb"]]), _e = { class: "tr-history__empty" }, pe = { class: "tr-history__empty-icon" }, he = { class: "tr-history__empty-text" }, me = /* @__PURE__ */ Q({
|
|
25
25
|
__name: "search-empty",
|
|
26
26
|
props: {
|
|
27
27
|
text: { default: "暂无内容" }
|
|
@@ -35,14 +35,14 @@ const ue = /* @__PURE__ */ V({
|
|
|
35
35
|
p("span", he, k(t.text), 1)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
}), ve = /* @__PURE__ */
|
|
39
|
-
const t =
|
|
38
|
+
}), ve = /* @__PURE__ */ V(me, [["__scopeId", "data-v-b21f5bc0"]]), ye = (i) => {
|
|
39
|
+
const t = G(), a = (l) => {
|
|
40
40
|
t.value = {
|
|
41
41
|
id: l.id,
|
|
42
42
|
title: l.title,
|
|
43
43
|
rawData: l
|
|
44
44
|
};
|
|
45
|
-
}, _ =
|
|
45
|
+
}, _ = G(null), v = (l) => {
|
|
46
46
|
l && Z(() => {
|
|
47
47
|
_.value = l, _.value.focus();
|
|
48
48
|
});
|
|
@@ -78,9 +78,9 @@ const ue = /* @__PURE__ */ V({
|
|
|
78
78
|
}, xe = { class: "tr-history__content" }, Ce = {
|
|
79
79
|
key: 0,
|
|
80
80
|
class: "tr-history__group-title"
|
|
81
|
-
}, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" }, Ee = { class: "tr-history__close" }, $e = /* @__PURE__ */
|
|
81
|
+
}, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" }, Ee = { class: "tr-history__close" }, $e = /* @__PURE__ */ Q({
|
|
82
82
|
__name: "index",
|
|
83
|
-
props: /* @__PURE__ */
|
|
83
|
+
props: /* @__PURE__ */ N({
|
|
84
84
|
tabTitle: {},
|
|
85
85
|
data: {},
|
|
86
86
|
activeTab: {},
|
|
@@ -96,13 +96,13 @@ const ue = /* @__PURE__ */ V({
|
|
|
96
96
|
searchQuery: {},
|
|
97
97
|
searchQueryModifiers: {}
|
|
98
98
|
}),
|
|
99
|
-
emits: /* @__PURE__ */
|
|
99
|
+
emits: /* @__PURE__ */ N(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
|
|
100
100
|
setup(i, { emit: t }) {
|
|
101
101
|
q((c) => ({
|
|
102
102
|
d4b77bae: b.value ? "1px solid rgb(240, 240, 240)" : "none",
|
|
103
103
|
"659130e6": b.value ? "2px solid rgb(25, 25, 25)" : "none"
|
|
104
104
|
}));
|
|
105
|
-
const a = i, _ =
|
|
105
|
+
const a = i, _ = P(i, "activeTab"), v = P(i, "searchQuery"), r = t, y = h(() => Array.isArray(a.tabs) ? a.tabs : [{ title: a.tabTitle, id: "0" }]), g = h(() => _.value || y.value[0].id), b = h(() => y.value.length > 1), l = (c) => {
|
|
106
106
|
var s;
|
|
107
107
|
const o = typeof ((s = c[0]) == null ? void 0 : s.group);
|
|
108
108
|
return o === "string" || o === "symbol";
|
|
@@ -146,43 +146,43 @@ const ue = /* @__PURE__ */ V({
|
|
|
146
146
|
p("span", null, k(s.group), 1)
|
|
147
147
|
])) : E("", !0),
|
|
148
148
|
(n(!0), u(T, null, $(s.items, (d) => {
|
|
149
|
-
var
|
|
149
|
+
var A;
|
|
150
150
|
return n(), u("div", {
|
|
151
151
|
key: `${d.id}-${d.title}`,
|
|
152
152
|
class: D(["tr-history__item", { selected: a.selected === d.id }]),
|
|
153
153
|
onClick: (f) => z(d)
|
|
154
154
|
}, [
|
|
155
|
-
((
|
|
155
|
+
((A = e(C)) == null ? void 0 : A.id) !== d.id ? (n(), u(T, { key: 0 }, [
|
|
156
156
|
p("span", Ie, k(d.title), 1),
|
|
157
|
-
d.tag ? (n(),
|
|
157
|
+
d.tag ? (n(), R(e(de), te({
|
|
158
158
|
key: 0,
|
|
159
159
|
class: "tr-history__item-tag"
|
|
160
160
|
}, { ref_for: !0 }, d.tag), null, 16)) : E("", !0),
|
|
161
161
|
p("div", we, [
|
|
162
|
-
m(e(
|
|
162
|
+
m(e(U), {
|
|
163
163
|
content: "编辑",
|
|
164
164
|
effect: "dark",
|
|
165
165
|
placement: "top",
|
|
166
166
|
"open-delay": 500
|
|
167
167
|
}, {
|
|
168
|
-
default:
|
|
168
|
+
default: H(() => [
|
|
169
169
|
m(e(B), {
|
|
170
170
|
icon: e(ae),
|
|
171
|
-
onClick:
|
|
171
|
+
onClick: S((f) => e(j)(d), ["stop"])
|
|
172
172
|
}, null, 8, ["icon", "onClick"])
|
|
173
173
|
]),
|
|
174
174
|
_: 2
|
|
175
175
|
}, 1024),
|
|
176
|
-
m(e(
|
|
176
|
+
m(e(U), {
|
|
177
177
|
content: "删除",
|
|
178
178
|
effect: "dark",
|
|
179
179
|
placement: "top",
|
|
180
180
|
"open-delay": 500
|
|
181
181
|
}, {
|
|
182
|
-
default:
|
|
182
|
+
default: H(() => [
|
|
183
183
|
m(e(B), {
|
|
184
184
|
icon: e(ne),
|
|
185
|
-
onClick:
|
|
185
|
+
onClick: S((f) => F(d), ["stop"])
|
|
186
186
|
}, null, 8, ["icon", "onClick"])
|
|
187
187
|
]),
|
|
188
188
|
_: 2
|
|
@@ -201,7 +201,7 @@ const ue = /* @__PURE__ */ V({
|
|
|
201
201
|
])
|
|
202
202
|
], 10, Te);
|
|
203
203
|
}), 128))
|
|
204
|
-
]))), 128)) : (n(),
|
|
204
|
+
]))), 128)) : (n(), R(e(ve), {
|
|
205
205
|
key: 1,
|
|
206
206
|
text: v.value ? "暂无搜索结果" : "暂无内容"
|
|
207
207
|
}, null, 8, ["text"]))
|
|
@@ -215,13 +215,13 @@ const ue = /* @__PURE__ */ V({
|
|
|
215
215
|
])
|
|
216
216
|
]));
|
|
217
217
|
}
|
|
218
|
-
}), K = /* @__PURE__ */
|
|
218
|
+
}), K = /* @__PURE__ */ V($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
|
|
219
219
|
i.component("TrHistory", K);
|
|
220
|
-
},
|
|
220
|
+
}, Ne = {
|
|
221
221
|
...K,
|
|
222
222
|
install: Be,
|
|
223
223
|
name: "TrHistory"
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Ne as default
|
|
227
227
|
};
|