@opentiny/tiny-robot 0.2.1 → 0.3.0-alpha.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/action-group/index.js +5 -5
- package/dist/attachments/index.js +602 -0
- package/dist/bubble/index.js +1 -1
- package/dist/container/index.js +10 -10
- package/dist/dropdown-menu/index.js +8 -8
- package/dist/feedback/index.js +20 -20
- package/dist/flow-layout-buttons/index.js +27 -27
- package/dist/history/index.js +46 -46
- package/dist/index.d.ts +231 -98
- package/dist/index.js +50 -46
- package/dist/index2.js +397 -330
- package/dist/question/index.js +64 -64
- package/dist/sender/index.js +906 -844
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +62 -62
- package/dist/suggestion-pills/index.js +80 -77
- package/dist/suggestion-popover/index.js +2 -2
- package/dist/tiny-robot-svgs.js +500 -174
- package/package.json +3 -3
package/dist/container/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as m, useCssVars as v, useModel as d, computed as _, createElementBlock as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as m, useCssVars as v, useModel as d, computed as _, createElementBlock as w, openBlock as g, createElementVNode as n, renderSlot as r, createVNode as c, unref as a } from "vue";
|
|
2
|
+
import { N as h, K as $, T as C } from "../tiny-robot-svgs.js";
|
|
3
3
|
import u from "../icon-button/index.js";
|
|
4
4
|
import { _ as b } from "../_plugin-vue_export-helper.js";
|
|
5
|
-
const z = { class: "tr-container" }, B = { class: "tr-container__header" },
|
|
5
|
+
const z = { class: "tr-container" }, B = { class: "tr-container__header" }, N = { class: "tr-container__header-operations" }, T = { class: "tr-container__footer" }, k = /* @__PURE__ */ m({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
8
8
|
show: { type: Boolean, required: !0 },
|
|
@@ -18,8 +18,8 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
|
|
|
18
18
|
"234493b2": l.value ? "var(--tr-z-index-fixed)" : "-1",
|
|
19
19
|
"0c2ba509": l.value ? "1" : "0"
|
|
20
20
|
}));
|
|
21
|
-
const l = d(o, "show"), s = d(o, "fullscreen"), f = _(() => s.value ?
|
|
22
|
-
return (t, e) => (
|
|
21
|
+
const l = d(o, "show"), s = d(o, "fullscreen"), f = _(() => s.value ? h : $);
|
|
22
|
+
return (t, e) => (g(), w("div", z, [
|
|
23
23
|
e[3] || (e[3] = n("div", { class: "tr-container__dragging-bar-wrapper" }, [
|
|
24
24
|
n("div", { class: "tr-container__dragging-bar" })
|
|
25
25
|
], -1)),
|
|
@@ -27,7 +27,7 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
|
|
|
27
27
|
r(t.$slots, "title", {}, () => [
|
|
28
28
|
e[2] || (e[2] = n("h3", { class: "tr-container__title" }, "OpenTiny NEXT", -1))
|
|
29
29
|
]),
|
|
30
|
-
n("div",
|
|
30
|
+
n("div", N, [
|
|
31
31
|
r(t.$slots, "operations"),
|
|
32
32
|
c(a(u), {
|
|
33
33
|
size: "28",
|
|
@@ -44,17 +44,17 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
|
|
|
44
44
|
])
|
|
45
45
|
]),
|
|
46
46
|
r(t.$slots, "default"),
|
|
47
|
-
n("div",
|
|
47
|
+
n("div", T, [
|
|
48
48
|
r(t.$slots, "footer")
|
|
49
49
|
])
|
|
50
50
|
]));
|
|
51
51
|
}
|
|
52
|
-
}), i = /* @__PURE__ */ b(
|
|
52
|
+
}), i = /* @__PURE__ */ b(k, [["__scopeId", "data-v-6a9b9126"]]);
|
|
53
53
|
i.name = "TrContainer";
|
|
54
|
-
const
|
|
54
|
+
const y = function(o) {
|
|
55
55
|
o.component(i.name, i);
|
|
56
56
|
};
|
|
57
|
-
i.install =
|
|
57
|
+
i.install = y;
|
|
58
58
|
export {
|
|
59
59
|
i as default
|
|
60
60
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as S, useCssVars as T, unref as M, ref as m, computed as R, watch as V, createElementBlock as o, openBlock as r, Fragment as p, createElementVNode as f, createVNode as B, renderSlot as E, Transition as N, withCtx as O, createCommentVNode as W, normalizeStyle as I, renderList as b, toDisplayString as z } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { d as _, o as F } from "../index2.js";
|
|
3
3
|
import { t as n } from "../utils.js";
|
|
4
4
|
import { _ as H } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__ */ S({
|
|
@@ -19,8 +19,8 @@ const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__
|
|
|
19
19
|
top: `max(${n(g.value)} - ${n(C.value)} + ${n(a.topOffset)} - 8px, 0px)`
|
|
20
20
|
}));
|
|
21
21
|
F(d, (e) => {
|
|
22
|
-
var
|
|
23
|
-
(
|
|
22
|
+
var u;
|
|
23
|
+
(u = i.value) != null && u.contains(e.target) && e.stopPropagation(), t.value = !1;
|
|
24
24
|
}), V(t, (e) => {
|
|
25
25
|
e && k();
|
|
26
26
|
});
|
|
@@ -29,7 +29,7 @@ const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__
|
|
|
29
29
|
}, D = (e) => {
|
|
30
30
|
t.value = !1, h("item-click", e);
|
|
31
31
|
};
|
|
32
|
-
return (e,
|
|
32
|
+
return (e, u) => (r(), o(p, null, [
|
|
33
33
|
f("div", {
|
|
34
34
|
class: "tr-dropdown-menu__wrapper",
|
|
35
35
|
ref_key: "dropDownTriggerRef",
|
|
@@ -48,11 +48,11 @@ const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__
|
|
|
48
48
|
ref: d
|
|
49
49
|
}, [
|
|
50
50
|
f("ul", L, [
|
|
51
|
-
(r(!0), o(p, null, b(a.items, (
|
|
51
|
+
(r(!0), o(p, null, b(a.items, (c) => (r(), o("li", {
|
|
52
52
|
class: "tr-dropdown-menu__list-item",
|
|
53
|
-
key:
|
|
54
|
-
onClick: (q) => D(
|
|
55
|
-
}, z(
|
|
53
|
+
key: c.id,
|
|
54
|
+
onClick: (q) => D(c)
|
|
55
|
+
}, z(c.text), 9, P))), 128))
|
|
56
56
|
])
|
|
57
57
|
], 4)) : W("", !0)
|
|
58
58
|
]),
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as X, ref as E, computed as
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as X, ref as E, computed as j, onMounted as z, watch as D, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as I, renderList as S, toDisplayString as y, createVNode as h, unref as l, nextTick as H, createElementVNode as d, createBlock as _, withCtx as f, createTextVNode as O, resolveDynamicComponent as C } from "vue";
|
|
2
|
+
import { H as T, B as N, E as q, $ as J, i as K, j as Q } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { B as G } from "../index3.js";
|
|
4
|
+
import R, { ActionGroupItem as V } from "../action-group/index.js";
|
|
5
|
+
import U from "../icon-button/index.js";
|
|
6
6
|
import { _ as P } from "../_plugin-vue_export-helper.js";
|
|
7
7
|
const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ X({
|
|
8
8
|
__name: "SourceList",
|
|
@@ -12,7 +12,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
12
12
|
},
|
|
13
13
|
setup(b) {
|
|
14
14
|
const m = b, e = E(!1), g = E([]), c = E(null), L = () => {
|
|
15
|
-
|
|
15
|
+
H(() => {
|
|
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,8 +20,8 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
20
20
|
} else
|
|
21
21
|
c.value = null;
|
|
22
22
|
});
|
|
23
|
-
}, A =
|
|
24
|
-
|
|
23
|
+
}, A = j(() => m.sources.length - (c.value || 0));
|
|
24
|
+
z(L), D(() => m.sources, L);
|
|
25
25
|
const p = (u, n) => {
|
|
26
26
|
u && (g.value[n] = u);
|
|
27
27
|
};
|
|
@@ -66,9 +66,9 @@ const W = { 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:
|
|
69
|
+
copy: Q,
|
|
70
|
+
refresh: K,
|
|
71
|
+
like: J,
|
|
72
72
|
dislike: q
|
|
73
73
|
}, c = m, L = (n) => {
|
|
74
74
|
var o, s, r;
|
|
@@ -80,11 +80,11 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
80
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, $;
|
|
84
84
|
return t(), a("div", te, [
|
|
85
85
|
d("div", se, [
|
|
86
86
|
d("div", oe, [
|
|
87
|
-
(s = e.operations) != null && s.length ? (t(), _(l(
|
|
87
|
+
(s = e.operations) != null && s.length ? (t(), _(l(R), {
|
|
88
88
|
key: 0,
|
|
89
89
|
"max-num": e.operationsLimit,
|
|
90
90
|
"drop-down-show-label-only": !0,
|
|
@@ -92,7 +92,7 @@ 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
|
-
h(l(
|
|
95
|
+
h(l(G), {
|
|
96
96
|
round: "",
|
|
97
97
|
size: "mini",
|
|
98
98
|
"reset-time": 0,
|
|
@@ -112,13 +112,13 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
112
112
|
label: i.label
|
|
113
113
|
}, {
|
|
114
114
|
default: f(() => [
|
|
115
|
-
h(l(
|
|
115
|
+
h(l(G), {
|
|
116
116
|
round: "",
|
|
117
117
|
"reset-time": 0,
|
|
118
118
|
size: "mini"
|
|
119
119
|
}, {
|
|
120
120
|
default: f(() => [
|
|
121
|
-
|
|
121
|
+
O(y(i.label), 1)
|
|
122
122
|
]),
|
|
123
123
|
_: 2
|
|
124
124
|
}, 1024)
|
|
@@ -138,7 +138,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
138
138
|
])) : k("", !0)
|
|
139
139
|
]),
|
|
140
140
|
d("div", le, [
|
|
141
|
-
h(l(
|
|
141
|
+
h(l(R), {
|
|
142
142
|
"max-num": e.actionsLimit,
|
|
143
143
|
"show-tooltip": !0,
|
|
144
144
|
onItemClick: A
|
|
@@ -150,7 +150,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
150
150
|
label: i.label
|
|
151
151
|
}, {
|
|
152
152
|
default: f(() => [
|
|
153
|
-
typeof i.icon == "string" ? (t(), _(l(
|
|
153
|
+
typeof i.icon == "string" ? (t(), _(l(U), {
|
|
154
154
|
key: 0,
|
|
155
155
|
icon: g[i.icon]
|
|
156
156
|
}, null, 8, ["icon"])) : (t(), _(C(i.icon), { key: 1 }))
|
|
@@ -162,13 +162,13 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
162
162
|
}, 8, ["max-num"])
|
|
163
163
|
])
|
|
164
164
|
]),
|
|
165
|
-
(
|
|
165
|
+
(B = e.operations) != null && B.length && ((w = e.sources) != null && w.length) || p.value && e.sources ? (t(), a("div", ae, [
|
|
166
166
|
(F = e.operations) != null && F.length && ((M = e.sources) != null && M.length) ? (t(), a("div", re, [
|
|
167
167
|
d("span", {
|
|
168
168
|
class: "tr-feedback__source",
|
|
169
169
|
onClick: u
|
|
170
170
|
}, [
|
|
171
|
-
d("span", null, y((
|
|
171
|
+
d("span", null, y(($ = e.sources) == null ? void 0 : $.length) + "条来源", 1),
|
|
172
172
|
(t(), _(C(p.value ? l(T) : l(N))))
|
|
173
173
|
])
|
|
174
174
|
])) : k("", !0),
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
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 B, Fragment as C, renderList as S, createCommentVNode as _, normalizeClass as I, createBlock as x, resolveDynamicComponent as b, toDisplayString as D, nextTick as H } from "vue";
|
|
2
|
+
import { B as X } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { c as j, o as J } from "../index2.js";
|
|
4
|
+
import { _ as K } from "../_plugin-vue_export-helper.js";
|
|
5
|
+
const P = ["onClick"], Q = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "tr-flow-layout__item-label"
|
|
8
|
-
},
|
|
8
|
+
}, U = { class: "tr-flow-layout__dropdown-wrapper" }, Y = ["onClick"], Z = { class: "tr-flow-layout__item-label" }, ee = /* @__PURE__ */ q({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: /* @__PURE__ */ E({
|
|
11
11
|
items: {},
|
|
12
12
|
selected: {},
|
|
13
13
|
linesLimit: { default: Number.MAX_SAFE_INTEGER },
|
|
14
|
-
moreIcon: { default:
|
|
14
|
+
moreIcon: { default: X },
|
|
15
15
|
showMoreTrigger: { default: "click" }
|
|
16
16
|
}, {
|
|
17
17
|
selected: {},
|
|
@@ -19,7 +19,7 @@ const K = ["onClick"], P = {
|
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ E(["item-click"], ["update:selected"]),
|
|
21
21
|
setup(d, { emit: F }) {
|
|
22
|
-
const n = d, u =
|
|
22
|
+
const n = d, u = G(d, "selected");
|
|
23
23
|
g(
|
|
24
24
|
() => n.items,
|
|
25
25
|
(t) => {
|
|
@@ -30,7 +30,7 @@ const K = ["onClick"], P = {
|
|
|
30
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
|
-
s.value = null, m.value = !1,
|
|
33
|
+
s.value = null, m.value = !1, H(() => {
|
|
34
34
|
const t = y.value, o = w.value;
|
|
35
35
|
if (!t || !o)
|
|
36
36
|
return;
|
|
@@ -43,18 +43,18 @@ const K = ["onClick"], P = {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
g(() => n.items, L);
|
|
46
|
-
const { width: W } =
|
|
46
|
+
const { width: W } = j(y);
|
|
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
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) => {
|
|
55
55
|
n.showMoreTrigger === "hover" && (c.value = t);
|
|
56
56
|
};
|
|
57
|
-
return
|
|
57
|
+
return J(k, (t) => {
|
|
58
58
|
var o, e;
|
|
59
59
|
(o = k.value) != null && o.contains(t.target) || (e = w.value) != null && e.contains(t.target) || (c.value = !1);
|
|
60
60
|
}), (t, o) => (l(), a("div", {
|
|
@@ -62,33 +62,33 @@ const K = ["onClick"], P = {
|
|
|
62
62
|
ref_key: "containerRef",
|
|
63
63
|
ref: y
|
|
64
64
|
}, [
|
|
65
|
-
(l(!0), a(
|
|
65
|
+
(l(!0), a(C, null, S(n.items, (e, f) => (l(), a(C, {
|
|
66
66
|
key: e.id
|
|
67
67
|
}, [
|
|
68
68
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
69
69
|
key: 0,
|
|
70
|
-
class:
|
|
70
|
+
class: I(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
71
71
|
ref_for: !0,
|
|
72
72
|
ref: (r) => A(r, f),
|
|
73
73
|
onClick: (r) => R(e.id)
|
|
74
74
|
}, [
|
|
75
|
-
(l(), x(
|
|
76
|
-
e.label ? (l(), a("span",
|
|
77
|
-
], 10,
|
|
75
|
+
(l(), x(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
76
|
+
e.label ? (l(), a("span", Q, D(e.label), 1)) : _("", !0)
|
|
77
|
+
], 10, P)) : _("", !0)
|
|
78
78
|
], 64))), 128)),
|
|
79
|
-
|
|
79
|
+
B("div", U, [
|
|
80
80
|
m.value ? _("", !0) : (l(), a("button", {
|
|
81
81
|
key: 0,
|
|
82
|
-
class:
|
|
82
|
+
class: I(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
|
|
83
83
|
ref_key: "moreButtonRef",
|
|
84
84
|
ref: w,
|
|
85
|
-
onClick:
|
|
85
|
+
onClick: V,
|
|
86
86
|
onMouseenter: o[0] || (o[0] = (e) => v(!0)),
|
|
87
87
|
onMouseleave: o[1] || (o[1] = (e) => v(!1))
|
|
88
88
|
}, [
|
|
89
|
-
(l(), x(
|
|
89
|
+
(l(), x(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
90
90
|
], 34)),
|
|
91
|
-
|
|
91
|
+
B("div", {
|
|
92
92
|
class: "tr-flow-layout__dropdown-container",
|
|
93
93
|
onMouseenter: o[2] || (o[2] = (e) => v(!0)),
|
|
94
94
|
onMouseleave: o[3] || (o[3] = (e) => v(!1))
|
|
@@ -99,20 +99,20 @@ const K = ["onClick"], P = {
|
|
|
99
99
|
ref_key: "dropDownRef",
|
|
100
100
|
ref: k
|
|
101
101
|
}, [
|
|
102
|
-
(l(!0), a(
|
|
103
|
-
class:
|
|
102
|
+
(l(!0), a(C, null, S(z.value, (e) => (l(), a("button", {
|
|
103
|
+
class: I(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
|
|
104
104
|
key: e.id,
|
|
105
105
|
onClick: (f) => R(e.id)
|
|
106
106
|
}, [
|
|
107
|
-
(l(), x(
|
|
108
|
-
|
|
107
|
+
(l(), x(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
108
|
+
B("span", Z, D(e.label), 1)
|
|
109
109
|
], 10, Y))), 128))
|
|
110
110
|
], 512)) : _("", !0)
|
|
111
111
|
], 32)
|
|
112
112
|
])
|
|
113
113
|
], 512));
|
|
114
114
|
}
|
|
115
|
-
}), p = /* @__PURE__ */
|
|
115
|
+
}), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-5c283520"]]);
|
|
116
116
|
p.name = "TrFlowLayout";
|
|
117
117
|
const te = function(d) {
|
|
118
118
|
d.component(p.name, p);
|
package/dist/history/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as M, createElementBlock as u, openBlock as n, normalizeStyle as J, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as m, unref as e, ref as A, watchEffect as X, 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 { G as oe, l as se, Y as ae, M as ne, T as ie } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { I as le } from "../index5.js";
|
|
4
|
-
import { T as
|
|
4
|
+
import { T as U } from "../index4.js";
|
|
5
5
|
import B from "../icon-button/index.js";
|
|
6
6
|
import { o as ce } from "../index2.js";
|
|
7
|
-
import { _ as
|
|
8
|
-
const ue = /* @__PURE__ */
|
|
7
|
+
import { _ as V } from "../_plugin-vue_export-helper.js";
|
|
8
|
+
const ue = /* @__PURE__ */ M({
|
|
9
9
|
__name: "item-tag",
|
|
10
10
|
props: {
|
|
11
11
|
text: {},
|
|
@@ -16,12 +16,12 @@ const ue = /* @__PURE__ */ V({
|
|
|
16
16
|
const t = i;
|
|
17
17
|
return (a, _) => (n(), u("div", {
|
|
18
18
|
class: D(["tr-history__item-tag", t.type]),
|
|
19
|
-
style:
|
|
19
|
+
style: J(t.style)
|
|
20
20
|
}, [
|
|
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__ */ M({
|
|
25
25
|
__name: "search-empty",
|
|
26
26
|
props: {
|
|
27
27
|
text: { default: "暂无内容" }
|
|
@@ -35,20 +35,20 @@ const ue = /* @__PURE__ */ V({
|
|
|
35
35
|
p("span", he, k(t.text), 1)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
39
|
-
const t =
|
|
38
|
+
}), ve = /* @__PURE__ */ V(me, [["__scopeId", "data-v-b21f5bc0"]]), ye = (i) => {
|
|
39
|
+
const t = A(), a = (l) => {
|
|
40
40
|
t.value = {
|
|
41
41
|
id: l.id,
|
|
42
42
|
title: l.title,
|
|
43
43
|
rawData: l
|
|
44
44
|
};
|
|
45
|
-
}, _ =
|
|
45
|
+
}, _ = A(null), v = (l) => {
|
|
46
46
|
l && Z(() => {
|
|
47
47
|
_.value = l, _.value.focus();
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
let r;
|
|
51
|
-
const
|
|
51
|
+
const y = () => {
|
|
52
52
|
if (t.value) {
|
|
53
53
|
if (t.value.title !== t.value.rawData.title) {
|
|
54
54
|
const { title: l, rawData: I } = t.value;
|
|
@@ -60,25 +60,25 @@ const ue = /* @__PURE__ */ V({
|
|
|
60
60
|
}, g = () => {
|
|
61
61
|
t.value = void 0, r == null || r(), r = void 0;
|
|
62
62
|
}, b = (l) => {
|
|
63
|
-
l.key === "Enter" ?
|
|
63
|
+
l.key === "Enter" ? y() : l.key === "Escape" && g();
|
|
64
64
|
};
|
|
65
|
-
return
|
|
65
|
+
return X(() => {
|
|
66
66
|
_.value && (r == null || r(), r = ce(_, () => {
|
|
67
|
-
|
|
67
|
+
y();
|
|
68
68
|
}));
|
|
69
69
|
}), {
|
|
70
70
|
editingItem: t,
|
|
71
71
|
handleEdit: a,
|
|
72
|
-
handleEditorInputRef:
|
|
72
|
+
handleEditorInputRef: v,
|
|
73
73
|
handleKeyDown: b
|
|
74
74
|
};
|
|
75
|
-
},
|
|
75
|
+
}, fe = { class: "tr-history" }, ke = { class: "tr-history__tabs" }, ge = ["onClick"], be = {
|
|
76
76
|
key: 0,
|
|
77
77
|
class: "tr-history__search"
|
|
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__ */ M({
|
|
82
82
|
__name: "index",
|
|
83
83
|
props: /* @__PURE__ */ N({
|
|
84
84
|
tabTitle: {},
|
|
@@ -102,27 +102,27 @@ const ue = /* @__PURE__ */ V({
|
|
|
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, _ = P(i, "activeTab"),
|
|
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";
|
|
109
|
-
}, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"),
|
|
109
|
+
}, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), G = h(() => {
|
|
110
110
|
const c = I.value;
|
|
111
111
|
return l(c) ? c : [{ group: w, items: c }];
|
|
112
|
-
}), x = h(() => a.searchBar ?
|
|
112
|
+
}), x = h(() => a.searchBar ? G.value.map((o) => ({
|
|
113
113
|
...o,
|
|
114
|
-
items: o.items.filter((s) => a.searchFn(
|
|
115
|
-
})).filter((o) => o.items.length > 0) :
|
|
114
|
+
items: o.items.filter((s) => a.searchFn(v.value || "", s))
|
|
115
|
+
})).filter((o) => o.items.length > 0) : G.value), L = h(() => x.value.length === 0 ? !1 : x.value[0].group === w ? x.value[0].items.length > 0 : !0), z = (c) => {
|
|
116
116
|
var o;
|
|
117
117
|
c.id !== ((o = C.value) == null ? void 0 : o.id) && r("item-click", c);
|
|
118
118
|
}, W = () => {
|
|
119
119
|
r("close");
|
|
120
|
-
},
|
|
120
|
+
}, Y = (c) => {
|
|
121
121
|
r("item-delete", c);
|
|
122
|
-
}, { editingItem: C, handleEdit:
|
|
123
|
-
return (c, o) => (n(), u("div",
|
|
122
|
+
}, { editingItem: C, handleEdit: F, handleEditorInputRef: j, handleKeyDown: O } = ye(r);
|
|
123
|
+
return (c, o) => (n(), u("div", fe, [
|
|
124
124
|
p("div", ke, [
|
|
125
|
-
(n(!0), u(T, null, $(
|
|
125
|
+
(n(!0), u(T, null, $(y.value, (s) => (n(), u("div", {
|
|
126
126
|
key: s.id,
|
|
127
127
|
class: D(["tr-history__tab", { active: g.value === s.id }]),
|
|
128
128
|
onClick: (d) => _.value = s.id
|
|
@@ -130,15 +130,15 @@ const ue = /* @__PURE__ */ V({
|
|
|
130
130
|
]),
|
|
131
131
|
a.searchBar ? (n(), u("div", be, [
|
|
132
132
|
m(e(le), {
|
|
133
|
-
modelValue:
|
|
134
|
-
"onUpdate:modelValue": o[0] || (o[0] = (s) =>
|
|
133
|
+
modelValue: v.value,
|
|
134
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => v.value = s),
|
|
135
135
|
placeholder: a.searchPlaceholder || "搜索对话名称",
|
|
136
136
|
"prefix-icon": e(se),
|
|
137
137
|
clearable: ""
|
|
138
138
|
}, null, 8, ["modelValue", "placeholder", "prefix-icon"])
|
|
139
139
|
])) : E("", !0),
|
|
140
140
|
p("div", xe, [
|
|
141
|
-
|
|
141
|
+
L.value ? (n(!0), u(T, { key: 0 }, $(x.value, (s) => (n(), u("div", {
|
|
142
142
|
key: s.group,
|
|
143
143
|
class: "tr-history__group"
|
|
144
144
|
}, [
|
|
@@ -146,13 +146,13 @@ 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 Q;
|
|
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
|
-
onClick: (
|
|
153
|
+
onClick: (f) => z(d)
|
|
154
154
|
}, [
|
|
155
|
-
((
|
|
155
|
+
((Q = e(C)) == null ? void 0 : Q.id) !== d.id ? (n(), u(T, { key: 0 }, [
|
|
156
156
|
p("span", Ie, k(d.title), 1),
|
|
157
157
|
d.tag ? (n(), R(e(de), te({
|
|
158
158
|
key: 0,
|
|
@@ -160,30 +160,30 @@ const ue = /* @__PURE__ */ V({
|
|
|
160
160
|
ref_for: !0
|
|
161
161
|
}, d.tag), null, 16)) : E("", !0),
|
|
162
162
|
p("div", we, [
|
|
163
|
-
m(e(
|
|
163
|
+
m(e(U), {
|
|
164
164
|
content: "编辑",
|
|
165
165
|
effect: "dark",
|
|
166
166
|
placement: "top",
|
|
167
167
|
"open-delay": 500
|
|
168
168
|
}, {
|
|
169
|
-
default:
|
|
169
|
+
default: H(() => [
|
|
170
170
|
m(e(B), {
|
|
171
171
|
icon: e(ae),
|
|
172
|
-
onClick:
|
|
172
|
+
onClick: S((f) => e(F)(d), ["stop"])
|
|
173
173
|
}, null, 8, ["icon", "onClick"])
|
|
174
174
|
]),
|
|
175
175
|
_: 2
|
|
176
176
|
}, 1024),
|
|
177
|
-
m(e(
|
|
177
|
+
m(e(U), {
|
|
178
178
|
content: "删除",
|
|
179
179
|
effect: "dark",
|
|
180
180
|
placement: "top",
|
|
181
181
|
"open-delay": 500
|
|
182
182
|
}, {
|
|
183
|
-
default:
|
|
183
|
+
default: H(() => [
|
|
184
184
|
m(e(B), {
|
|
185
185
|
icon: e(ne),
|
|
186
|
-
onClick:
|
|
186
|
+
onClick: S((f) => Y(d), ["stop"])
|
|
187
187
|
}, null, 8, ["icon", "onClick"])
|
|
188
188
|
]),
|
|
189
189
|
_: 2
|
|
@@ -191,20 +191,20 @@ const ue = /* @__PURE__ */ V({
|
|
|
191
191
|
])
|
|
192
192
|
], 64)) : ee((n(), u("input", {
|
|
193
193
|
key: 1,
|
|
194
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
194
|
+
"onUpdate:modelValue": o[1] || (o[1] = (f) => e(C).title = f),
|
|
195
195
|
class: "tr-history__item-edit",
|
|
196
196
|
ref_for: !0,
|
|
197
|
-
ref: e(
|
|
197
|
+
ref: e(j),
|
|
198
198
|
onKeydown: o[2] || (o[2] = //@ts-ignore
|
|
199
|
-
(...
|
|
199
|
+
(...f) => e(O) && e(O)(...f))
|
|
200
200
|
}, null, 544)), [
|
|
201
201
|
[re, e(C).title]
|
|
202
202
|
])
|
|
203
203
|
], 10, Te);
|
|
204
204
|
}), 128))
|
|
205
|
-
]))), 128)) : (n(), R(e(
|
|
205
|
+
]))), 128)) : (n(), R(e(ve), {
|
|
206
206
|
key: 1,
|
|
207
|
-
text:
|
|
207
|
+
text: v.value ? "暂无搜索结果" : "暂无内容"
|
|
208
208
|
}, null, 8, ["text"]))
|
|
209
209
|
]),
|
|
210
210
|
p("div", Ee, [
|
|
@@ -216,10 +216,10 @@ const ue = /* @__PURE__ */ V({
|
|
|
216
216
|
])
|
|
217
217
|
]));
|
|
218
218
|
}
|
|
219
|
-
}),
|
|
220
|
-
i.component("TrHistory",
|
|
219
|
+
}), K = /* @__PURE__ */ V($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
|
|
220
|
+
i.component("TrHistory", K);
|
|
221
221
|
}, Ne = {
|
|
222
|
-
...
|
|
222
|
+
...K,
|
|
223
223
|
install: Be,
|
|
224
224
|
name: "TrHistory"
|
|
225
225
|
};
|