@opentiny/tiny-robot 0.3.0-alpha.3 → 0.3.0-alpha.30
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 +42 -39
- package/dist/attachments/index.js +526 -0
- package/dist/base-popper/index.js +4 -0
- package/dist/bubble/index.js +1613 -1624
- package/dist/container/index.js +44 -40
- package/dist/drag-overlay/index.js +57 -0
- package/dist/dropdown-menu/index.js +151 -64
- package/dist/feedback/index.js +73 -74
- package/dist/flow-layout-buttons/index.js +31 -28
- package/dist/history/index.js +2 -225
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +1370 -934
- package/dist/index.js +218 -77
- package/dist/index2.js +277 -534
- package/dist/index3.js +693 -290
- package/dist/index4.js +146 -622
- package/dist/mcp-add-form/index.js +212 -0
- package/dist/mcp-server-picker/index.js +556 -0
- package/dist/no-data.js +4 -0
- package/dist/prompts/index.js +36 -39
- package/dist/sender/index.js +1132 -1212
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +131 -155
- package/dist/suggestion-popover/index.js +253 -221
- package/dist/theme-provider/index.js +83 -0
- package/dist/useSlotRefs.js +36 -0
- package/dist/utils.js +8 -13
- package/package.json +4 -9
- package/dist/close.js +0 -29
- package/dist/index5.js +0 -2157
- package/dist/index6.js +0 -4752
- package/dist/question/index.js +0 -429
- package/dist/suggestion/index.js +0 -497
- package/dist/tiny-robot-svgs.js +0 -643
package/dist/feedback/index.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import $, { ActionGroupItem as
|
|
5
|
-
import
|
|
6
|
-
import { _ as
|
|
7
|
-
const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as V, ref as g, computed as P, onMounted as z, watch as O, createElementBlock as r, openBlock as t, createCommentVNode as k, Fragment as A, renderList as w, toDisplayString as y, createVNode as b, unref as l, nextTick as q, createElementVNode as d, createBlock as _, withCtx as f, createTextVNode as U, resolveDynamicComponent as x } from "vue";
|
|
2
|
+
import { IconArrowUp as T, IconArrowDown as N, IconDislike as j, IconLike as H, IconRefresh as J, IconCopy as K } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { TinyButton as G } from "@opentiny/vue";
|
|
4
|
+
import $, { ActionGroupItem as D } from "../action-group/index.js";
|
|
5
|
+
import Q from "../icon-button/index.js";
|
|
6
|
+
import { _ as X } from "../_plugin-vue_export-helper.js";
|
|
7
|
+
const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ V({
|
|
8
8
|
__name: "SourceList",
|
|
9
9
|
props: {
|
|
10
10
|
sources: {},
|
|
11
11
|
linesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
12
12
|
},
|
|
13
13
|
setup(h) {
|
|
14
|
-
const m = h, e =
|
|
14
|
+
const m = h, e = g(!1), I = g([]), c = g(null), L = () => {
|
|
15
15
|
q(() => {
|
|
16
|
-
const u =
|
|
16
|
+
const u = I.value.slice(0, m.sources.length).map((s) => (s == null ? void 0 : s.offsetTop) || 0), n = Array.from(new Set(u));
|
|
17
17
|
if (n.length > m.linesLimit) {
|
|
18
|
-
const
|
|
19
|
-
c.value =
|
|
18
|
+
const s = n[m.linesLimit - 1], o = u.lastIndexOf(s);
|
|
19
|
+
c.value = o;
|
|
20
20
|
} else
|
|
21
21
|
c.value = null;
|
|
22
22
|
});
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
u && (
|
|
23
|
+
}, E = P(() => m.sources.length - (c.value || 0));
|
|
24
|
+
z(L), O(() => m.sources, L);
|
|
25
|
+
const p = (u, n) => {
|
|
26
|
+
u && (I.value[n] = u);
|
|
27
27
|
};
|
|
28
|
-
return (u, n) => (t(),
|
|
29
|
-
(t(!0),
|
|
30
|
-
!c.value || e.value ||
|
|
28
|
+
return (u, n) => (t(), r("div", W, [
|
|
29
|
+
(t(!0), r(A, null, w(m.sources, (s, o) => (t(), r(A, { key: o }, [
|
|
30
|
+
!c.value || e.value || o < c.value ? (t(), r("a", {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "pill",
|
|
33
|
-
href:
|
|
33
|
+
href: s.link,
|
|
34
34
|
target: "_blank",
|
|
35
35
|
ref_for: !0,
|
|
36
|
-
ref: (
|
|
37
|
-
}, y(
|
|
38
|
-
c.value && !e.value &&
|
|
36
|
+
ref: (a) => p(a, o)
|
|
37
|
+
}, y(s.label), 9, Y)) : k("", !0),
|
|
38
|
+
c.value && !e.value && o === c.value ? (t(), r("span", {
|
|
39
39
|
key: 1,
|
|
40
40
|
class: "pill",
|
|
41
|
-
onClick: n[0] || (n[0] = (
|
|
42
|
-
}, y(
|
|
41
|
+
onClick: n[0] || (n[0] = (a) => e.value = !0)
|
|
42
|
+
}, y(E.value) + "+ ", 1)) : k("", !0)
|
|
43
43
|
], 64))), 128)),
|
|
44
|
-
e.value ? (t(),
|
|
44
|
+
e.value ? (t(), r("span", {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "pill collapse-pill",
|
|
47
|
-
onClick: n[1] || (n[1] = (
|
|
47
|
+
onClick: n[1] || (n[1] = (s) => e.value = !1)
|
|
48
48
|
}, [
|
|
49
49
|
b(l(T))
|
|
50
50
|
])) : k("", !0)
|
|
51
51
|
]));
|
|
52
52
|
}
|
|
53
|
-
}), ee = /* @__PURE__ */
|
|
53
|
+
}), ee = /* @__PURE__ */ X(Z, [["__scopeId", "data-v-c5fbb560"]]), te = { class: "tr-feedback" }, oe = { class: "tr-feedback__operations" }, se = { class: "tr-feedback__operations-left" }, ne = { key: 1 }, le = { class: "tr-feedback__operations-right" }, re = {
|
|
54
54
|
key: 0,
|
|
55
55
|
class: "tr-feedback__footer"
|
|
56
|
-
},
|
|
56
|
+
}, ae = { key: 0 }, ie = /* @__PURE__ */ V({
|
|
57
57
|
__name: "index",
|
|
58
58
|
props: {
|
|
59
59
|
operations: {},
|
|
@@ -65,26 +65,26 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
65
65
|
},
|
|
66
66
|
emits: ["operation", "action"],
|
|
67
67
|
setup(h, { emit: m }) {
|
|
68
|
-
const e = h,
|
|
69
|
-
copy:
|
|
70
|
-
refresh:
|
|
71
|
-
like:
|
|
72
|
-
dislike:
|
|
68
|
+
const e = h, I = {
|
|
69
|
+
copy: K,
|
|
70
|
+
refresh: J,
|
|
71
|
+
like: H,
|
|
72
|
+
dislike: j
|
|
73
73
|
}, c = m, L = (n) => {
|
|
74
|
-
var
|
|
75
|
-
(
|
|
76
|
-
},
|
|
77
|
-
var
|
|
78
|
-
(
|
|
79
|
-
},
|
|
80
|
-
|
|
74
|
+
var s, o, a;
|
|
75
|
+
(a = (o = (s = e.operations) == null ? void 0 : s.find((v) => v.name === n)) == null ? void 0 : o.onClick) == null || a.call(o), c("operation", n);
|
|
76
|
+
}, E = (n) => {
|
|
77
|
+
var s, o, a;
|
|
78
|
+
(a = (o = (s = e.actions) == null ? void 0 : s.find((v) => v.name === n)) == null ? void 0 : o.onClick) == null || a.call(o), c("action", n);
|
|
79
|
+
}, p = g(!1), u = () => {
|
|
80
|
+
p.value = !p.value;
|
|
81
81
|
};
|
|
82
|
-
return (n,
|
|
83
|
-
var
|
|
84
|
-
return t(),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(
|
|
82
|
+
return (n, s) => {
|
|
83
|
+
var o, a, v, S, F, M, R, B;
|
|
84
|
+
return t(), r("div", te, [
|
|
85
|
+
d("div", oe, [
|
|
86
|
+
d("div", se, [
|
|
87
|
+
(o = e.operations) != null && o.length ? (t(), _(l($), {
|
|
88
88
|
key: 0,
|
|
89
89
|
"max-num": e.operationsLimit,
|
|
90
90
|
"drop-down-show-label-only": !0,
|
|
@@ -92,34 +92,33 @@ const W = { 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
|
-
b(l(
|
|
95
|
+
b(l(G), {
|
|
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
|
-
|
|
102
|
+
s[0] || (s[0] = d("span", null, "更多", -1)),
|
|
103
103
|
b(l(N))
|
|
104
104
|
]),
|
|
105
|
-
_: 1
|
|
106
|
-
__: [0]
|
|
105
|
+
_: 1
|
|
107
106
|
})
|
|
108
107
|
]),
|
|
109
108
|
default: f(() => [
|
|
110
|
-
(t(!0),
|
|
109
|
+
(t(!0), r(A, null, w(e.operations, (i) => (t(), _(l(D), {
|
|
111
110
|
key: i.name,
|
|
112
111
|
name: i.name,
|
|
113
112
|
label: i.label
|
|
114
113
|
}, {
|
|
115
114
|
default: f(() => [
|
|
116
|
-
b(l(
|
|
115
|
+
b(l(G), {
|
|
117
116
|
round: "",
|
|
118
117
|
"reset-time": 0,
|
|
119
118
|
size: "mini"
|
|
120
119
|
}, {
|
|
121
120
|
default: f(() => [
|
|
122
|
-
|
|
121
|
+
U(y(i.label), 1)
|
|
123
122
|
]),
|
|
124
123
|
_: 2
|
|
125
124
|
}, 1024)
|
|
@@ -128,33 +127,33 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
128
127
|
}, 1032, ["name", "label"]))), 128))
|
|
129
128
|
]),
|
|
130
129
|
_: 1
|
|
131
|
-
}, 8, ["max-num"])) : (
|
|
132
|
-
|
|
130
|
+
}, 8, ["max-num"])) : (a = e.sources) != null && a.length ? (t(), r("div", ne, [
|
|
131
|
+
d("span", {
|
|
133
132
|
class: "tr-feedback__source",
|
|
134
133
|
onClick: u
|
|
135
134
|
}, [
|
|
136
|
-
|
|
137
|
-
(t(),
|
|
135
|
+
d("span", null, y((v = e.sources) == null ? void 0 : v.length) + "条来源", 1),
|
|
136
|
+
(t(), _(x(p.value ? l(T) : l(N))))
|
|
138
137
|
])
|
|
139
138
|
])) : k("", !0)
|
|
140
139
|
]),
|
|
141
|
-
|
|
140
|
+
d("div", le, [
|
|
142
141
|
b(l($), {
|
|
143
142
|
"max-num": e.actionsLimit,
|
|
144
143
|
"show-tooltip": !0,
|
|
145
|
-
onItemClick:
|
|
144
|
+
onItemClick: E
|
|
146
145
|
}, {
|
|
147
146
|
default: f(() => [
|
|
148
|
-
(t(!0),
|
|
147
|
+
(t(!0), r(A, null, w(e.actions, (i) => (t(), _(l(D), {
|
|
149
148
|
key: i.name,
|
|
150
149
|
name: i.name,
|
|
151
150
|
label: i.label
|
|
152
151
|
}, {
|
|
153
152
|
default: f(() => [
|
|
154
|
-
typeof i.icon == "string" ? (t(),
|
|
153
|
+
typeof i.icon == "string" ? (t(), _(l(Q), {
|
|
155
154
|
key: 0,
|
|
156
|
-
icon:
|
|
157
|
-
}, null, 8, ["icon"])) : (t(),
|
|
155
|
+
icon: I[i.icon]
|
|
156
|
+
}, null, 8, ["icon"])) : (t(), _(x(i.icon), { key: 1 }))
|
|
158
157
|
]),
|
|
159
158
|
_: 2
|
|
160
159
|
}, 1032, ["name", "label"]))), 128))
|
|
@@ -163,17 +162,17 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
163
162
|
}, 8, ["max-num"])
|
|
164
163
|
])
|
|
165
164
|
]),
|
|
166
|
-
(
|
|
167
|
-
(
|
|
168
|
-
|
|
165
|
+
(S = e.operations) != null && S.length && ((F = e.sources) != null && F.length) || p.value && e.sources ? (t(), r("div", re, [
|
|
166
|
+
(M = e.operations) != null && M.length && ((R = e.sources) != null && R.length) ? (t(), r("div", ae, [
|
|
167
|
+
d("span", {
|
|
169
168
|
class: "tr-feedback__source",
|
|
170
169
|
onClick: u
|
|
171
170
|
}, [
|
|
172
|
-
|
|
173
|
-
(t(),
|
|
171
|
+
d("span", null, y((B = e.sources) == null ? void 0 : B.length) + "条来源", 1),
|
|
172
|
+
(t(), _(x(p.value ? l(T) : l(N))))
|
|
174
173
|
])
|
|
175
174
|
])) : k("", !0),
|
|
176
|
-
|
|
175
|
+
p.value && e.sources ? (t(), _(l(ee), {
|
|
177
176
|
key: 1,
|
|
178
177
|
sources: e.sources,
|
|
179
178
|
"lines-limit": e.sourcesLinesLimit
|
|
@@ -182,12 +181,12 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
182
181
|
]);
|
|
183
182
|
};
|
|
184
183
|
}
|
|
185
|
-
}),
|
|
186
|
-
|
|
184
|
+
}), C = /* @__PURE__ */ X(ie, [["__scopeId", "data-v-affa572f"]]);
|
|
185
|
+
C.name = "TrFeedback";
|
|
187
186
|
const ce = function(h) {
|
|
188
|
-
h.component(
|
|
187
|
+
h.component(C.name, C);
|
|
189
188
|
};
|
|
190
|
-
|
|
189
|
+
C.install = ce;
|
|
191
190
|
export {
|
|
192
|
-
|
|
191
|
+
C as default
|
|
193
192
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
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 I, Fragment as C, renderList as D, createCommentVNode as _, normalizeClass as x, createBlock as B, resolveDynamicComponent as b, toDisplayString as S, nextTick as H } from "vue";
|
|
2
|
+
import { IconArrowDown as X } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { d 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 = {
|
|
6
6
|
key: 0,
|
|
@@ -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: A }) {
|
|
22
22
|
const n = d, u = G(d, "selected");
|
|
23
23
|
g(
|
|
24
24
|
() => n.items,
|
|
@@ -27,11 +27,11 @@ const P = ["onClick"], Q = {
|
|
|
27
27
|
},
|
|
28
28
|
{ immediate: !0 }
|
|
29
29
|
);
|
|
30
|
-
const
|
|
30
|
+
const F = A, w = i(null), y = i(null), k = i(null), M = i([]), s = i(null), m = i(!1), c = i(!1), N = (t, o) => {
|
|
31
31
|
t && (M.value[o] = t);
|
|
32
32
|
}, L = () => {
|
|
33
33
|
s.value = null, m.value = !1, H(() => {
|
|
34
|
-
const t =
|
|
34
|
+
const t = w.value, o = y.value;
|
|
35
35
|
if (!t || !o)
|
|
36
36
|
return;
|
|
37
37
|
const e = M.value.slice(0, n.items.length).filter((r) => !!r).map((r) => r.offsetTop), f = Array.from(new Set(e));
|
|
@@ -43,52 +43,55 @@ const P = ["onClick"], Q = {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
g(() => n.items, L);
|
|
46
|
-
const { width: W } = j(
|
|
46
|
+
const { width: W } = j(w);
|
|
47
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, F("item-click", t);
|
|
52
52
|
}, V = () => {
|
|
53
53
|
n.showMoreTrigger === "click" && (c.value = !c.value);
|
|
54
54
|
}, v = (t) => {
|
|
55
55
|
n.showMoreTrigger === "hover" && (c.value = t);
|
|
56
56
|
};
|
|
57
|
-
return J(
|
|
58
|
-
|
|
59
|
-
(
|
|
60
|
-
|
|
57
|
+
return J(
|
|
58
|
+
k,
|
|
59
|
+
() => {
|
|
60
|
+
c.value = !1;
|
|
61
|
+
},
|
|
62
|
+
{ ignore: [k, y] }
|
|
63
|
+
), (t, o) => (l(), a("div", {
|
|
61
64
|
class: "tr-flow-layout",
|
|
62
65
|
ref_key: "containerRef",
|
|
63
|
-
ref:
|
|
66
|
+
ref: w
|
|
64
67
|
}, [
|
|
65
|
-
(l(!0), a(
|
|
68
|
+
(l(!0), a(C, null, D(n.items, (e, f) => (l(), a(C, {
|
|
66
69
|
key: e.id
|
|
67
70
|
}, [
|
|
68
71
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
69
72
|
key: 0,
|
|
70
|
-
class:
|
|
73
|
+
class: x(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
71
74
|
ref_for: !0,
|
|
72
|
-
ref: (r) =>
|
|
75
|
+
ref: (r) => N(r, f),
|
|
73
76
|
onClick: (r) => R(e.id)
|
|
74
77
|
}, [
|
|
75
|
-
(l(),
|
|
76
|
-
e.label ? (l(), a("span", Q,
|
|
78
|
+
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
79
|
+
e.label ? (l(), a("span", Q, S(e.label), 1)) : _("", !0)
|
|
77
80
|
], 10, P)) : _("", !0)
|
|
78
81
|
], 64))), 128)),
|
|
79
|
-
|
|
82
|
+
I("div", U, [
|
|
80
83
|
m.value ? _("", !0) : (l(), a("button", {
|
|
81
84
|
key: 0,
|
|
82
|
-
class:
|
|
85
|
+
class: x(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
|
|
83
86
|
ref_key: "moreButtonRef",
|
|
84
|
-
ref:
|
|
87
|
+
ref: y,
|
|
85
88
|
onClick: V,
|
|
86
89
|
onMouseenter: o[0] || (o[0] = (e) => v(!0)),
|
|
87
90
|
onMouseleave: o[1] || (o[1] = (e) => v(!1))
|
|
88
91
|
}, [
|
|
89
|
-
(l(),
|
|
92
|
+
(l(), B(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
90
93
|
], 34)),
|
|
91
|
-
|
|
94
|
+
I("div", {
|
|
92
95
|
class: "tr-flow-layout__dropdown-container",
|
|
93
96
|
onMouseenter: o[2] || (o[2] = (e) => v(!0)),
|
|
94
97
|
onMouseleave: o[3] || (o[3] = (e) => v(!1))
|
|
@@ -99,20 +102,20 @@ const P = ["onClick"], Q = {
|
|
|
99
102
|
ref_key: "dropDownRef",
|
|
100
103
|
ref: k
|
|
101
104
|
}, [
|
|
102
|
-
(l(!0), a(
|
|
103
|
-
class:
|
|
105
|
+
(l(!0), a(C, null, D(z.value, (e) => (l(), a("button", {
|
|
106
|
+
class: x(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
|
|
104
107
|
key: e.id,
|
|
105
108
|
onClick: (f) => R(e.id)
|
|
106
109
|
}, [
|
|
107
|
-
(l(),
|
|
108
|
-
|
|
110
|
+
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
111
|
+
I("span", Z, S(e.label), 1)
|
|
109
112
|
], 10, Y))), 128))
|
|
110
113
|
], 512)) : _("", !0)
|
|
111
114
|
], 32)
|
|
112
115
|
])
|
|
113
116
|
], 512));
|
|
114
117
|
}
|
|
115
|
-
}), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-
|
|
118
|
+
}), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-f82cf3dc"]]);
|
|
116
119
|
p.name = "TrFlowLayout";
|
|
117
120
|
const te = function(d) {
|
|
118
121
|
d.component(p.name, p);
|
package/dist/history/index.js
CHANGED
|
@@ -1,227 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { w as oe, b as se, p as ae, A as ne, f as ie } from "../tiny-robot-svgs.js";
|
|
3
|
-
import { I as le } from "../index5.js";
|
|
4
|
-
import { T as U } from "../index4.js";
|
|
5
|
-
import B from "../icon-button/index.js";
|
|
6
|
-
import { o as ce } from "../index2.js";
|
|
7
|
-
import { _ as A } from "../_plugin-vue_export-helper.js";
|
|
8
|
-
const ue = /* @__PURE__ */ V({
|
|
9
|
-
__name: "item-tag",
|
|
10
|
-
props: {
|
|
11
|
-
text: {},
|
|
12
|
-
type: { default: "default" },
|
|
13
|
-
style: {}
|
|
14
|
-
},
|
|
15
|
-
setup(i) {
|
|
16
|
-
const t = i;
|
|
17
|
-
return (a, _) => (n(), u("div", {
|
|
18
|
-
class: D(["tr-history__item-tag", t.type]),
|
|
19
|
-
style: X(t.style)
|
|
20
|
-
}, [
|
|
21
|
-
p("span", null, k(t.text), 1)
|
|
22
|
-
], 6));
|
|
23
|
-
}
|
|
24
|
-
}), de = /* @__PURE__ */ A(ue, [["__scopeId", "data-v-346767bb"]]), _e = { class: "tr-history__empty" }, pe = { class: "tr-history__empty-icon" }, he = { class: "tr-history__empty-text" }, me = /* @__PURE__ */ V({
|
|
25
|
-
__name: "search-empty",
|
|
26
|
-
props: {
|
|
27
|
-
text: { default: "暂无内容" }
|
|
28
|
-
},
|
|
29
|
-
setup(i) {
|
|
30
|
-
const t = i;
|
|
31
|
-
return (a, _) => (n(), u("div", _e, [
|
|
32
|
-
p("span", pe, [
|
|
33
|
-
m(e(oe))
|
|
34
|
-
]),
|
|
35
|
-
p("span", he, k(t.text), 1)
|
|
36
|
-
]));
|
|
37
|
-
}
|
|
38
|
-
}), fe = /* @__PURE__ */ A(me, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
|
|
39
|
-
const t = G(), a = (l) => {
|
|
40
|
-
t.value = {
|
|
41
|
-
id: l.id,
|
|
42
|
-
title: l.title,
|
|
43
|
-
rawData: l
|
|
44
|
-
};
|
|
45
|
-
}, _ = G(null), f = (l) => {
|
|
46
|
-
l && Z(() => {
|
|
47
|
-
_.value = l, _.value.focus();
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
let r;
|
|
51
|
-
const v = () => {
|
|
52
|
-
if (t.value) {
|
|
53
|
-
if (t.value.title !== t.value.rawData.title) {
|
|
54
|
-
const { title: l, rawData: I } = t.value;
|
|
55
|
-
i("item-title-change", l, I);
|
|
56
|
-
}
|
|
57
|
-
t.value = void 0;
|
|
58
|
-
}
|
|
59
|
-
r == null || r(), r = void 0;
|
|
60
|
-
}, g = () => {
|
|
61
|
-
t.value = void 0, r == null || r(), r = void 0;
|
|
62
|
-
}, b = (l) => {
|
|
63
|
-
l.key === "Enter" ? v() : l.key === "Escape" && g();
|
|
64
|
-
};
|
|
65
|
-
return Y(() => {
|
|
66
|
-
_.value && (r == null || r(), r = ce(_, () => {
|
|
67
|
-
v();
|
|
68
|
-
}));
|
|
69
|
-
}), {
|
|
70
|
-
editingItem: t,
|
|
71
|
-
handleEdit: a,
|
|
72
|
-
handleEditorInputRef: f,
|
|
73
|
-
handleKeyDown: b
|
|
74
|
-
};
|
|
75
|
-
}, ye = { class: "tr-history" }, ke = { class: "tr-history__tabs" }, ge = ["onClick"], be = {
|
|
76
|
-
key: 0,
|
|
77
|
-
class: "tr-history__search"
|
|
78
|
-
}, xe = { class: "tr-history__content" }, Ce = {
|
|
79
|
-
key: 0,
|
|
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__ */ V({
|
|
82
|
-
__name: "index",
|
|
83
|
-
props: /* @__PURE__ */ N({
|
|
84
|
-
tabTitle: {},
|
|
85
|
-
data: {},
|
|
86
|
-
activeTab: {},
|
|
87
|
-
searchBar: { type: Boolean },
|
|
88
|
-
searchQuery: {},
|
|
89
|
-
searchPlaceholder: {},
|
|
90
|
-
searchFn: { type: Function, default: (i, { title: t }) => i ? t.toLowerCase().includes(i.toLowerCase()) : !0 },
|
|
91
|
-
selected: {},
|
|
92
|
-
tabs: {}
|
|
93
|
-
}, {
|
|
94
|
-
activeTab: {},
|
|
95
|
-
activeTabModifiers: {},
|
|
96
|
-
searchQuery: {},
|
|
97
|
-
searchQueryModifiers: {}
|
|
98
|
-
}),
|
|
99
|
-
emits: /* @__PURE__ */ N(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
|
|
100
|
-
setup(i, { emit: t }) {
|
|
101
|
-
q((c) => ({
|
|
102
|
-
d4b77bae: b.value ? "1px solid rgb(240, 240, 240)" : "none",
|
|
103
|
-
"659130e6": b.value ? "2px solid rgb(25, 25, 25)" : "none"
|
|
104
|
-
}));
|
|
105
|
-
const a = i, _ = P(i, "activeTab"), f = P(i, "searchQuery"), r = t, v = h(() => Array.isArray(a.tabs) ? a.tabs : [{ title: a.tabTitle, id: "0" }]), g = h(() => _.value || v.value[0].id), b = h(() => v.value.length > 1), l = (c) => {
|
|
106
|
-
var s;
|
|
107
|
-
const o = typeof ((s = c[0]) == null ? void 0 : s.group);
|
|
108
|
-
return o === "string" || o === "symbol";
|
|
109
|
-
}, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), M = h(() => {
|
|
110
|
-
const c = I.value;
|
|
111
|
-
return l(c) ? c : [{ group: w, items: c }];
|
|
112
|
-
}), x = h(() => a.searchBar ? M.value.map((o) => ({
|
|
113
|
-
...o,
|
|
114
|
-
items: o.items.filter((s) => a.searchFn(f.value || "", s))
|
|
115
|
-
})).filter((o) => o.items.length > 0) : M.value), L = h(() => x.value.length === 0 ? !1 : x.value[0].group === w ? x.value[0].items.length > 0 : !0), z = (c) => {
|
|
116
|
-
var o;
|
|
117
|
-
c.id !== ((o = C.value) == null ? void 0 : o.id) && r("item-click", c);
|
|
118
|
-
}, W = () => {
|
|
119
|
-
r("close");
|
|
120
|
-
}, F = (c) => {
|
|
121
|
-
r("item-delete", c);
|
|
122
|
-
}, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: O } = ve(r);
|
|
123
|
-
return (c, o) => (n(), u("div", ye, [
|
|
124
|
-
p("div", ke, [
|
|
125
|
-
(n(!0), u(T, null, $(v.value, (s) => (n(), u("div", {
|
|
126
|
-
key: s.id,
|
|
127
|
-
class: D(["tr-history__tab", { active: g.value === s.id }]),
|
|
128
|
-
onClick: (d) => _.value = s.id
|
|
129
|
-
}, k(s.title), 11, ge))), 128))
|
|
130
|
-
]),
|
|
131
|
-
a.searchBar ? (n(), u("div", be, [
|
|
132
|
-
m(e(le), {
|
|
133
|
-
modelValue: f.value,
|
|
134
|
-
"onUpdate:modelValue": o[0] || (o[0] = (s) => f.value = s),
|
|
135
|
-
placeholder: a.searchPlaceholder || "搜索对话名称",
|
|
136
|
-
"prefix-icon": e(se),
|
|
137
|
-
clearable: ""
|
|
138
|
-
}, null, 8, ["modelValue", "placeholder", "prefix-icon"])
|
|
139
|
-
])) : E("", !0),
|
|
140
|
-
p("div", xe, [
|
|
141
|
-
L.value ? (n(!0), u(T, { key: 0 }, $(x.value, (s) => (n(), u("div", {
|
|
142
|
-
key: s.group,
|
|
143
|
-
class: "tr-history__group"
|
|
144
|
-
}, [
|
|
145
|
-
s.group !== e(w) ? (n(), u("div", Ce, [
|
|
146
|
-
p("span", null, k(s.group), 1)
|
|
147
|
-
])) : E("", !0),
|
|
148
|
-
(n(!0), u(T, null, $(s.items, (d) => {
|
|
149
|
-
var Q;
|
|
150
|
-
return n(), u("div", {
|
|
151
|
-
key: `${d.id}-${d.title}`,
|
|
152
|
-
class: D(["tr-history__item", { selected: a.selected === d.id }]),
|
|
153
|
-
onClick: (y) => z(d)
|
|
154
|
-
}, [
|
|
155
|
-
((Q = e(C)) == null ? void 0 : Q.id) !== d.id ? (n(), u(T, { key: 0 }, [
|
|
156
|
-
p("span", Ie, k(d.title), 1),
|
|
157
|
-
d.tag ? (n(), R(e(de), te({
|
|
158
|
-
key: 0,
|
|
159
|
-
class: "tr-history__item-tag"
|
|
160
|
-
}, { ref_for: !0 }, d.tag), null, 16)) : E("", !0),
|
|
161
|
-
p("div", we, [
|
|
162
|
-
m(e(U), {
|
|
163
|
-
content: "编辑",
|
|
164
|
-
effect: "dark",
|
|
165
|
-
placement: "top",
|
|
166
|
-
"open-delay": 500
|
|
167
|
-
}, {
|
|
168
|
-
default: H(() => [
|
|
169
|
-
m(e(B), {
|
|
170
|
-
icon: e(ae),
|
|
171
|
-
onClick: S((y) => e(j)(d), ["stop"])
|
|
172
|
-
}, null, 8, ["icon", "onClick"])
|
|
173
|
-
]),
|
|
174
|
-
_: 2
|
|
175
|
-
}, 1024),
|
|
176
|
-
m(e(U), {
|
|
177
|
-
content: "删除",
|
|
178
|
-
effect: "dark",
|
|
179
|
-
placement: "top",
|
|
180
|
-
"open-delay": 500
|
|
181
|
-
}, {
|
|
182
|
-
default: H(() => [
|
|
183
|
-
m(e(B), {
|
|
184
|
-
icon: e(ne),
|
|
185
|
-
onClick: S((y) => F(d), ["stop"])
|
|
186
|
-
}, null, 8, ["icon", "onClick"])
|
|
187
|
-
]),
|
|
188
|
-
_: 2
|
|
189
|
-
}, 1024)
|
|
190
|
-
])
|
|
191
|
-
], 64)) : ee((n(), u("input", {
|
|
192
|
-
key: 1,
|
|
193
|
-
"onUpdate:modelValue": o[1] || (o[1] = (y) => e(C).title = y),
|
|
194
|
-
class: "tr-history__item-edit",
|
|
195
|
-
ref_for: !0,
|
|
196
|
-
ref: e(J),
|
|
197
|
-
onKeydown: o[2] || (o[2] = //@ts-ignore
|
|
198
|
-
(...y) => e(O) && e(O)(...y))
|
|
199
|
-
}, null, 544)), [
|
|
200
|
-
[re, e(C).title]
|
|
201
|
-
])
|
|
202
|
-
], 10, Te);
|
|
203
|
-
}), 128))
|
|
204
|
-
]))), 128)) : (n(), R(e(fe), {
|
|
205
|
-
key: 1,
|
|
206
|
-
text: f.value ? "暂无搜索结果" : "暂无内容"
|
|
207
|
-
}, null, 8, ["text"]))
|
|
208
|
-
]),
|
|
209
|
-
p("div", Ee, [
|
|
210
|
-
m(e(B), {
|
|
211
|
-
icon: e(ie),
|
|
212
|
-
rounded: "",
|
|
213
|
-
onClick: W
|
|
214
|
-
}, null, 8, ["icon"])
|
|
215
|
-
])
|
|
216
|
-
]));
|
|
217
|
-
}
|
|
218
|
-
}), K = /* @__PURE__ */ A($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
|
|
219
|
-
i.component("TrHistory", K);
|
|
220
|
-
}, Ne = {
|
|
221
|
-
...K,
|
|
222
|
-
install: Be,
|
|
223
|
-
name: "TrHistory"
|
|
224
|
-
};
|
|
1
|
+
import { H as f } from "../index2.js";
|
|
225
2
|
export {
|
|
226
|
-
|
|
3
|
+
f as default
|
|
227
4
|
};
|