@opentiny/tiny-robot 0.2.0-alpha.3 → 0.2.0-alpha.4
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 +20 -20
- package/dist/container/index.js +7 -7
- package/dist/feedback/index.js +38 -38
- package/dist/history/index.js +23 -23
- package/dist/index.d.ts +10 -0
- package/dist/question/index.js +297 -243
- package/dist/sender/index.js +504 -415
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +70 -70
- package/dist/tiny-robot-svgs.js +46 -46
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { T as
|
|
1
|
+
import { defineComponent as $, useSlots as W, computed as i, useTemplateRef as T, ref as R, watch as N, nextTick as j, createElementBlock as m, openBlock as n, createBlock as d, createCommentVNode as G, Fragment as I, renderList as x, unref as f, withCtx as C, createElementVNode as _, resolveDynamicComponent as E, renderSlot as L, createVNode as M, Transition as q, withDirectives as J, normalizeClass as K, withModifiers as Q, toDisplayString as U, vShow as Y } from "vue";
|
|
2
|
+
import { V as Z } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { T as V } from "../index4.js";
|
|
4
4
|
import { o as ee, a as te } from "../index2.js";
|
|
5
5
|
import oe from "../icon-button/index.js";
|
|
6
6
|
import { _ as ne } from "../_plugin-vue_export-helper.js";
|
|
7
|
-
const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce = { class: "tr-action-group__dropdown-item-text" }, se = /* @__PURE__ */
|
|
7
|
+
const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce = { class: "tr-action-group__dropdown-item-text" }, se = /* @__PURE__ */ $({
|
|
8
8
|
__name: "ActionGroup",
|
|
9
9
|
props: {
|
|
10
10
|
maxNum: {},
|
|
@@ -13,14 +13,14 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
13
13
|
},
|
|
14
14
|
emits: ["item-click"],
|
|
15
15
|
setup(a, { emit: h }) {
|
|
16
|
-
const l = a,
|
|
16
|
+
const l = a, F = W(), O = h, 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
|
}), w = i(() => {
|
|
21
21
|
const e = l.maxNum ?? Number.MAX_SAFE_INTEGER;
|
|
22
22
|
return e > 0 ? e : Number.MAX_SAFE_INTEGER;
|
|
23
|
-
}), g = i(() => p.value.length > w.value),
|
|
23
|
+
}), g = i(() => p.value.length > w.value), z = i(() => g.value ? p.value.slice(0, w.value) : p.value), P = i(() => g.value ? p.value.slice(w.value) : []), b = T("moreBtnRef"), k = T("dropDownRef"), r = R(!1), X = () => {
|
|
24
24
|
r.value = !r.value;
|
|
25
25
|
};
|
|
26
26
|
ee(k, (e) => {
|
|
@@ -28,7 +28,7 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
28
28
|
(o = b.value) != null && o.contains(e.target) || (r.value = !1);
|
|
29
29
|
});
|
|
30
30
|
const S = (e) => {
|
|
31
|
-
|
|
31
|
+
O("item-click", e), r.value = !1;
|
|
32
32
|
}, A = R("placement-bottom"), { height: B } = te(), D = () => {
|
|
33
33
|
if (!k.value || !b.value)
|
|
34
34
|
return "placement-bottom";
|
|
@@ -36,15 +36,15 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
36
36
|
A.value = o.bottom + e.height + 16 > B.value ? "placement-top" : "placement-bottom";
|
|
37
37
|
};
|
|
38
38
|
return N(r, (e) => {
|
|
39
|
-
e &&
|
|
39
|
+
e && j(() => {
|
|
40
40
|
D();
|
|
41
41
|
});
|
|
42
42
|
}), N(B, () => {
|
|
43
43
|
r.value && D();
|
|
44
44
|
}), (e, o) => (n(), m("div", re, [
|
|
45
|
-
(n(!0), m(I, null, x(
|
|
45
|
+
(n(!0), m(I, null, x(z.value, (t, y) => {
|
|
46
46
|
var c;
|
|
47
|
-
return n(), d(f(
|
|
47
|
+
return n(), d(f(V), {
|
|
48
48
|
key: y,
|
|
49
49
|
content: (c = t.props) == null ? void 0 : c.label,
|
|
50
50
|
effect: "dark",
|
|
@@ -55,7 +55,7 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
55
55
|
default: C(() => [
|
|
56
56
|
_("span", {
|
|
57
57
|
class: "tr-action-group__btn-wrapper",
|
|
58
|
-
onClick: (
|
|
58
|
+
onClick: (H) => {
|
|
59
59
|
var s;
|
|
60
60
|
return S((s = t.props) == null ? void 0 : s.name);
|
|
61
61
|
}
|
|
@@ -66,7 +66,7 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
66
66
|
_: 2
|
|
67
67
|
}, 1032, ["content", "disabled"]);
|
|
68
68
|
}), 128)),
|
|
69
|
-
g.value ? (n(), d(f(
|
|
69
|
+
g.value ? (n(), d(f(V), {
|
|
70
70
|
key: 0,
|
|
71
71
|
content: "更多",
|
|
72
72
|
effect: "dark",
|
|
@@ -78,23 +78,23 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
78
78
|
_("span", {
|
|
79
79
|
ref: "moreBtnRef",
|
|
80
80
|
class: "tr-action-group__btn-wrapper",
|
|
81
|
-
onClick:
|
|
81
|
+
onClick: X
|
|
82
82
|
}, [
|
|
83
|
-
|
|
83
|
+
L(e.$slots, "moreBtn", {}, () => [
|
|
84
84
|
M(f(oe), { icon: f(Z) }, null, 8, ["icon"])
|
|
85
85
|
], !0),
|
|
86
|
-
M(
|
|
86
|
+
M(q, { name: "tr-action-group-dropdown" }, {
|
|
87
87
|
default: C(() => [
|
|
88
88
|
J(_("ul", {
|
|
89
89
|
ref: "dropDownRef",
|
|
90
90
|
class: K(["tr-action-group__dropdown", A.value])
|
|
91
91
|
}, [
|
|
92
|
-
(n(!0), m(I, null, x(
|
|
92
|
+
(n(!0), m(I, null, x(P.value, (t, y) => {
|
|
93
93
|
var c;
|
|
94
94
|
return n(), m("li", {
|
|
95
95
|
class: "tr-action-group__dropdown-item",
|
|
96
96
|
key: y,
|
|
97
|
-
onClick: Q((
|
|
97
|
+
onClick: Q((H) => {
|
|
98
98
|
var s;
|
|
99
99
|
return S((s = t.props) == null ? void 0 : s.name);
|
|
100
100
|
}, ["stop"])
|
|
@@ -115,14 +115,14 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
115
115
|
}, 8, ["disabled"])) : G("", !0)
|
|
116
116
|
]));
|
|
117
117
|
}
|
|
118
|
-
}), v = /* @__PURE__ */ ne(se, [["__scopeId", "data-v-43d0f1ba"]]), u = /* @__PURE__ */
|
|
118
|
+
}), v = /* @__PURE__ */ ne(se, [["__scopeId", "data-v-43d0f1ba"]]), u = /* @__PURE__ */ $({
|
|
119
119
|
__name: "ActionGroupItem",
|
|
120
120
|
props: {
|
|
121
121
|
name: {},
|
|
122
122
|
label: {}
|
|
123
123
|
},
|
|
124
124
|
setup(a) {
|
|
125
|
-
return (h, l) =>
|
|
125
|
+
return (h, l) => L(h.$slots, "default");
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
v.name = "TrActionGroup";
|
package/dist/container/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as m, useCssVars as v, useModel as c, computed as _, createElementBlock as w, openBlock as g, createElementVNode as n, renderSlot as r, createVNode as u, unref as a } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { Z as h, E as $, y as C } from "../tiny-robot-svgs.js";
|
|
3
3
|
import d from "../icon-button/index.js";
|
|
4
4
|
import { _ as b } from "../_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const y = { class: "tr-container" }, B = { class: "tr-container__header" }, E = { class: "tr-container__header-operations" }, k = { class: "tr-container__footer" }, z = /* @__PURE__ */ m({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
8
8
|
show: { type: Boolean, required: !0 },
|
|
@@ -19,15 +19,15 @@ const B = { class: "tr-container" }, N = { class: "tr-container__header" }, T =
|
|
|
19
19
|
cb10cae2: l.value ? "1" : "0"
|
|
20
20
|
}));
|
|
21
21
|
const l = c(o, "show"), s = c(o, "fullscreen"), f = _(() => s.value ? h : $);
|
|
22
|
-
return (t, e) => (g(), w("div",
|
|
22
|
+
return (t, e) => (g(), w("div", y, [
|
|
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)),
|
|
26
|
-
n("div",
|
|
26
|
+
n("div", B, [
|
|
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", E, [
|
|
31
31
|
r(t.$slots, "operations"),
|
|
32
32
|
u(a(d), {
|
|
33
33
|
size: "28",
|
|
@@ -51,10 +51,10 @@ const B = { class: "tr-container" }, N = { class: "tr-container__header" }, T =
|
|
|
51
51
|
}
|
|
52
52
|
}), i = /* @__PURE__ */ b(z, [["__scopeId", "data-v-81c9f59e"]]);
|
|
53
53
|
i.name = "TrContainer";
|
|
54
|
-
const
|
|
54
|
+
const I = function(o) {
|
|
55
55
|
o.component(i.name, i);
|
|
56
56
|
};
|
|
57
|
-
i.install =
|
|
57
|
+
i.install = I;
|
|
58
58
|
export {
|
|
59
59
|
i as default
|
|
60
60
|
};
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
4
|
-
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 T, toDisplayString as y, createVNode as b, unref as l, nextTick as O, createElementVNode as p, createBlock as d, withCtx as f, createTextVNode as W, resolveDynamicComponent as A } from "vue";
|
|
2
|
+
import { T as S, N as C, k as q, W as H, R as J, j as K } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { B as G } from "../index3.js";
|
|
4
|
+
import $, { ActionGroupItem as V } from "../action-group/index.js";
|
|
5
5
|
import Q from "../icon-button/index.js";
|
|
6
|
-
import { _ as
|
|
7
|
-
const U = { class: "tr-feedback__source-list" },
|
|
6
|
+
import { _ as P } from "../_plugin-vue_export-helper.js";
|
|
7
|
+
const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ X({
|
|
8
8
|
__name: "SourceList",
|
|
9
9
|
props: {
|
|
10
10
|
sources: {},
|
|
@@ -12,7 +12,7 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
12
12
|
},
|
|
13
13
|
setup(h) {
|
|
14
14
|
const _ = h, e = E(!1), L = E([]), c = E(null), g = () => {
|
|
15
|
-
|
|
15
|
+
O(() => {
|
|
16
16
|
const u = L.value.map((o) => (o == null ? void 0 : o.offsetTop) || 0), n = Array.from(new Set(u));
|
|
17
17
|
if (n.length > _.linesLimit) {
|
|
18
18
|
const o = n[_.linesLimit - 1], s = u.lastIndexOf(o);
|
|
@@ -20,13 +20,13 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
20
20
|
} else
|
|
21
21
|
c.value = null;
|
|
22
22
|
});
|
|
23
|
-
},
|
|
24
|
-
z(g),
|
|
23
|
+
}, x = j(() => _.sources.length - (c.value || 0));
|
|
24
|
+
z(g), D(() => _.sources, g);
|
|
25
25
|
const m = (u, n) => {
|
|
26
26
|
u && (L.value[n] = u);
|
|
27
27
|
};
|
|
28
28
|
return (u, n) => (t(), a("div", U, [
|
|
29
|
-
(t(!0), a(
|
|
29
|
+
(t(!0), a(I, null, T(_.sources, (o, s) => (t(), a(I, { key: s }, [
|
|
30
30
|
!c.value || e.value || s < c.value ? (t(), a("a", {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "pill",
|
|
@@ -34,26 +34,26 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
34
34
|
target: "_blank",
|
|
35
35
|
ref_for: !0,
|
|
36
36
|
ref: (r) => m(r, s)
|
|
37
|
-
}, y(o.label), 9,
|
|
37
|
+
}, y(o.label), 9, Y)) : 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
|
-
b(l(
|
|
49
|
+
b(l(S))
|
|
50
50
|
])) : k("", !0)
|
|
51
51
|
]));
|
|
52
52
|
}
|
|
53
|
-
}), ee = /* @__PURE__ */
|
|
53
|
+
}), ee = /* @__PURE__ */ P(Z, [["__scopeId", "data-v-5817f518"]]), te = { class: "tr-feedback" }, se = { class: "tr-feedback__operations" }, oe = { class: "tr-feedback__operations-left" }, ne = { key: 1 }, le = { class: "tr-feedback__operations-right" }, ae = {
|
|
54
54
|
key: 0,
|
|
55
55
|
class: "tr-feedback__footer"
|
|
56
|
-
}, re = { key: 0 }, ie = /* @__PURE__ */
|
|
56
|
+
}, re = { key: 0 }, ie = /* @__PURE__ */ X({
|
|
57
57
|
__name: "index",
|
|
58
58
|
props: {
|
|
59
59
|
operations: {},
|
|
@@ -69,22 +69,22 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
69
69
|
copy: K,
|
|
70
70
|
refresh: J,
|
|
71
71
|
like: H,
|
|
72
|
-
dislike:
|
|
72
|
+
dislike: q
|
|
73
73
|
}, c = _, g = (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
79
|
}, m = E(!1), u = () => {
|
|
80
80
|
m.value = !m.value;
|
|
81
81
|
};
|
|
82
82
|
return (n, o) => {
|
|
83
|
-
var s, r, v, w, B, F, M
|
|
83
|
+
var s, r, v, w, R, B, F, M;
|
|
84
84
|
return t(), a("div", te, [
|
|
85
85
|
p("div", se, [
|
|
86
86
|
p("div", oe, [
|
|
87
|
-
(s = e.operations) != null && s.length ? (t(), d(l(
|
|
87
|
+
(s = e.operations) != null && s.length ? (t(), d(l($), {
|
|
88
88
|
key: 0,
|
|
89
89
|
"max-num": e.operationsLimit,
|
|
90
90
|
"drop-down-show-label-only": !0,
|
|
@@ -92,7 +92,7 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__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,
|
|
@@ -100,25 +100,25 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
100
100
|
}, {
|
|
101
101
|
default: f(() => [
|
|
102
102
|
o[0] || (o[0] = p("span", null, "更多", -1)),
|
|
103
|
-
b(l(
|
|
103
|
+
b(l(C))
|
|
104
104
|
]),
|
|
105
105
|
_: 1
|
|
106
106
|
})
|
|
107
107
|
]),
|
|
108
108
|
default: f(() => [
|
|
109
|
-
(t(!0), a(
|
|
109
|
+
(t(!0), a(I, null, T(e.operations, (i) => (t(), d(l(V), {
|
|
110
110
|
key: i.name,
|
|
111
111
|
name: i.name,
|
|
112
112
|
label: i.label
|
|
113
113
|
}, {
|
|
114
114
|
default: f(() => [
|
|
115
|
-
b(l(
|
|
115
|
+
b(l(G), {
|
|
116
116
|
round: "",
|
|
117
117
|
"reset-time": 0,
|
|
118
118
|
size: "mini"
|
|
119
119
|
}, {
|
|
120
120
|
default: f(() => [
|
|
121
|
-
|
|
121
|
+
W(y(i.label), 1)
|
|
122
122
|
]),
|
|
123
123
|
_: 2
|
|
124
124
|
}, 1024)
|
|
@@ -133,18 +133,18 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
133
133
|
onClick: u
|
|
134
134
|
}, [
|
|
135
135
|
p("span", null, y((v = e.sources) == null ? void 0 : v.length) + "条来源", 1),
|
|
136
|
-
(t(), d(
|
|
136
|
+
(t(), d(A(m.value ? l(S) : l(C))))
|
|
137
137
|
])
|
|
138
138
|
])) : k("", !0)
|
|
139
139
|
]),
|
|
140
140
|
p("div", le, [
|
|
141
|
-
b(l(
|
|
141
|
+
b(l($), {
|
|
142
142
|
"max-num": e.actionsLimit,
|
|
143
143
|
"show-tooltip": !0,
|
|
144
|
-
onItemClick:
|
|
144
|
+
onItemClick: x
|
|
145
145
|
}, {
|
|
146
146
|
default: f(() => [
|
|
147
|
-
(t(!0), a(
|
|
147
|
+
(t(!0), a(I, null, T(e.actions, (i) => (t(), d(l(V), {
|
|
148
148
|
key: i.name,
|
|
149
149
|
name: i.name,
|
|
150
150
|
label: i.label
|
|
@@ -153,7 +153,7 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
153
153
|
typeof i.icon == "string" ? (t(), d(l(Q), {
|
|
154
154
|
key: 0,
|
|
155
155
|
icon: L[i.icon]
|
|
156
|
-
}, null, 8, ["icon"])) : (t(), d(
|
|
156
|
+
}, null, 8, ["icon"])) : (t(), d(A(i.icon), { key: 1 }))
|
|
157
157
|
]),
|
|
158
158
|
_: 2
|
|
159
159
|
}, 1032, ["name", "label"]))), 128))
|
|
@@ -162,14 +162,14 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
162
162
|
}, 8, ["max-num"])
|
|
163
163
|
])
|
|
164
164
|
]),
|
|
165
|
-
(w = e.operations) != null && w.length && ((
|
|
166
|
-
(
|
|
165
|
+
(w = e.operations) != null && w.length && ((R = e.sources) != null && R.length) || m.value && e.sources ? (t(), a("div", ae, [
|
|
166
|
+
(B = e.operations) != null && B.length && ((F = e.sources) != null && F.length) ? (t(), a("div", re, [
|
|
167
167
|
p("span", {
|
|
168
168
|
class: "tr-feedback__source",
|
|
169
169
|
onClick: u
|
|
170
170
|
}, [
|
|
171
|
-
p("span", null, y((
|
|
172
|
-
(t(), d(
|
|
171
|
+
p("span", null, y((M = e.sources) == null ? void 0 : M.length) + "条来源", 1),
|
|
172
|
+
(t(), d(A(m.value ? l(S) : l(C))))
|
|
173
173
|
])
|
|
174
174
|
])) : k("", !0),
|
|
175
175
|
m.value && e.sources ? (t(), d(l(ee), {
|
|
@@ -181,12 +181,12 @@ const U = { class: "tr-feedback__source-list" }, W = ["href"], Y = /* @__PURE__
|
|
|
181
181
|
]);
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
}),
|
|
185
|
-
|
|
184
|
+
}), N = /* @__PURE__ */ P(ie, [["__scopeId", "data-v-cc6ef316"]]);
|
|
185
|
+
N.name = "TrFeedback";
|
|
186
186
|
const ce = function(h) {
|
|
187
|
-
h.component(
|
|
187
|
+
h.component(N.name, N);
|
|
188
188
|
};
|
|
189
|
-
|
|
189
|
+
N.install = ce;
|
|
190
190
|
export {
|
|
191
|
-
|
|
191
|
+
N as default
|
|
192
192
|
};
|
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 X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as m, unref as e, ref as A, watchEffect as Y, nextTick as Z, mergeModels as G, useCssVars as q, computed as h, useModel as N, createCommentVNode as E, Fragment as T, renderList as $, createBlock as P, withDirectives as ee, mergeProps as te, withCtx as R, withModifiers as H, vModelText as re } from "vue";
|
|
2
|
+
import { Q as oe, U as se, M as ae, F as ne, y as ie } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { I as le } from "../index5.js";
|
|
4
|
-
import { T as
|
|
4
|
+
import { T as S } 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 Q } from "../_plugin-vue_export-helper.js";
|
|
8
|
+
const ue = /* @__PURE__ */ M({
|
|
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__ */ Q(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,7 +35,7 @@ const ue = /* @__PURE__ */ V({
|
|
|
35
35
|
p("span", he, k(t.text), 1)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
}), ye = /* @__PURE__ */
|
|
38
|
+
}), ye = /* @__PURE__ */ Q(me, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
|
|
39
39
|
const t = A(), a = (l) => {
|
|
40
40
|
t.value = {
|
|
41
41
|
id: l.id,
|
|
@@ -78,7 +78,7 @@ 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__ */ M({
|
|
82
82
|
__name: "index",
|
|
83
83
|
props: /* @__PURE__ */ G({
|
|
84
84
|
tabTitle: {},
|
|
@@ -106,20 +106,20 @@ const ue = /* @__PURE__ */ V({
|
|
|
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"), V = 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 ? V.value.map((o) => ({
|
|
113
113
|
...o,
|
|
114
114
|
items: o.items.filter((s) => a.searchFn(y.value || "", s))
|
|
115
|
-
})).filter((o) => o.items.length > 0) :
|
|
115
|
+
})).filter((o) => o.items.length > 0) : V.value), K = h(() => x.value.length === 0 ? !1 : x.value[0].group === w ? x.value[0].items.length > 0 : !0), L = (c) => {
|
|
116
116
|
var o;
|
|
117
117
|
c.id !== ((o = C.value) == null ? void 0 : o.id) && r("item-click", c);
|
|
118
118
|
}, z = () => {
|
|
119
119
|
r("close");
|
|
120
120
|
}, W = (c) => {
|
|
121
121
|
r("item-delete", c);
|
|
122
|
-
}, { editingItem: C, handleEdit:
|
|
122
|
+
}, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: O } = ve(r);
|
|
123
123
|
return (c, o) => (n(), u("div", fe, [
|
|
124
124
|
p("div", ke, [
|
|
125
125
|
(n(!0), u(T, null, $(v.value, (s) => (n(), u("div", {
|
|
@@ -138,7 +138,7 @@ const ue = /* @__PURE__ */ V({
|
|
|
138
138
|
}, null, 8, ["modelValue", "placeholder", "prefix-icon"])
|
|
139
139
|
])) : E("", !0),
|
|
140
140
|
p("div", xe, [
|
|
141
|
-
|
|
141
|
+
K.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 U;
|
|
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: (f) =>
|
|
153
|
+
onClick: (f) => L(d)
|
|
154
154
|
}, [
|
|
155
|
-
((
|
|
155
|
+
((U = e(C)) == null ? void 0 : U.id) !== d.id ? (n(), u(T, { key: 0 }, [
|
|
156
156
|
p("span", Ie, k(d.title), 1),
|
|
157
157
|
d.tag ? (n(), P(e(de), te({
|
|
158
158
|
key: 0,
|
|
@@ -160,7 +160,7 @@ 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(S), {
|
|
164
164
|
content: "编辑",
|
|
165
165
|
effect: "dark",
|
|
166
166
|
placement: "top",
|
|
@@ -169,12 +169,12 @@ const ue = /* @__PURE__ */ V({
|
|
|
169
169
|
default: R(() => [
|
|
170
170
|
m(e(B), {
|
|
171
171
|
icon: e(ae),
|
|
172
|
-
onClick: H((f) => e(
|
|
172
|
+
onClick: H((f) => e(j)(d), ["stop"])
|
|
173
173
|
}, null, 8, ["icon", "onClick"])
|
|
174
174
|
]),
|
|
175
175
|
_: 2
|
|
176
176
|
}, 1024),
|
|
177
|
-
m(e(
|
|
177
|
+
m(e(S), {
|
|
178
178
|
content: "删除",
|
|
179
179
|
effect: "dark",
|
|
180
180
|
placement: "top",
|
|
@@ -196,7 +196,7 @@ const ue = /* @__PURE__ */ V({
|
|
|
196
196
|
ref_for: !0,
|
|
197
197
|
ref: e(J),
|
|
198
198
|
onKeydown: o[2] || (o[2] = //@ts-ignore
|
|
199
|
-
(...f) => e(
|
|
199
|
+
(...f) => e(O) && e(O)(...f))
|
|
200
200
|
}, null, 544)), [
|
|
201
201
|
[re, e(C).title]
|
|
202
202
|
])
|
|
@@ -216,10 +216,10 @@ const ue = /* @__PURE__ */ V({
|
|
|
216
216
|
])
|
|
217
217
|
]));
|
|
218
218
|
}
|
|
219
|
-
}),
|
|
220
|
-
i.component("TrHistory",
|
|
219
|
+
}), F = /* @__PURE__ */ Q($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
|
|
220
|
+
i.component("TrHistory", F);
|
|
221
221
|
}, Ge = {
|
|
222
|
-
...
|
|
222
|
+
...F,
|
|
223
223
|
install: Be,
|
|
224
224
|
name: "TrHistory"
|
|
225
225
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ placeholder: string;
|
|
|
82
82
|
autoSize: AutoSize_2;
|
|
83
83
|
maxLength: number;
|
|
84
84
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
85
|
+
inputWrapperRef: HTMLDivElement;
|
|
85
86
|
templateEditorRef: CreateComponentPublicInstanceWithMixins<Readonly<TemplateEditorProps_2> & Readonly<{
|
|
86
87
|
onInput?: ((value: string) => any) | undefined;
|
|
87
88
|
"onUpdate:value"?: ((value: string) => any) | undefined;
|
|
@@ -561,6 +562,7 @@ textAlign: string;
|
|
|
561
562
|
showTooltip: boolean;
|
|
562
563
|
inputBoxType: string;
|
|
563
564
|
}> | null;
|
|
565
|
+
buttonsContainerRef: HTMLDivElement;
|
|
564
566
|
}, HTMLDivElement>;
|
|
565
567
|
|
|
566
568
|
declare const __VLS_component_4: DefineComponent<WelcomeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<WelcomeProps> & Readonly<{}>, {
|
|
@@ -786,10 +788,14 @@ declare function __VLS_template_3(): {
|
|
|
786
788
|
slots: {
|
|
787
789
|
header?(_: {}): any;
|
|
788
790
|
prefix?(_: {}): any;
|
|
791
|
+
decorativeContent?(_: {}): any;
|
|
789
792
|
actions?(_: {}): any;
|
|
793
|
+
'footer-left'?(_: {}): any;
|
|
794
|
+
'footer-right'?(_: {}): any;
|
|
790
795
|
footer?(_: {}): any;
|
|
791
796
|
};
|
|
792
797
|
refs: {
|
|
798
|
+
inputWrapperRef: HTMLDivElement;
|
|
793
799
|
templateEditorRef: CreateComponentPublicInstanceWithMixins<Readonly<TemplateEditorProps_2> & Readonly<{
|
|
794
800
|
onInput?: ((value: string) => any) | undefined;
|
|
795
801
|
"onUpdate:value"?: ((value: string) => any) | undefined;
|
|
@@ -1269,6 +1275,7 @@ declare function __VLS_template_3(): {
|
|
|
1269
1275
|
showTooltip: boolean;
|
|
1270
1276
|
inputBoxType: string;
|
|
1271
1277
|
}> | null;
|
|
1278
|
+
buttonsContainerRef: HTMLDivElement;
|
|
1272
1279
|
};
|
|
1273
1280
|
rootEl: HTMLDivElement;
|
|
1274
1281
|
};
|
|
@@ -1521,6 +1528,7 @@ export declare interface ActionButtonsProps {
|
|
|
1521
1528
|
allowFiles?: boolean;
|
|
1522
1529
|
submitType?: SubmitTrigger;
|
|
1523
1530
|
showShortcuts?: boolean;
|
|
1531
|
+
isOverLimit?: boolean;
|
|
1524
1532
|
}
|
|
1525
1533
|
|
|
1526
1534
|
export declare type AutoSize = boolean | {
|
|
@@ -1977,6 +1985,7 @@ export declare type SenderEmits = {
|
|
|
1977
1985
|
(e: 'escape-press'): void;
|
|
1978
1986
|
(e: 'cancel'): void;
|
|
1979
1987
|
(e: 'reset-template'): void;
|
|
1988
|
+
(e: 'fixed-link-click'): void;
|
|
1980
1989
|
};
|
|
1981
1990
|
|
|
1982
1991
|
export declare interface SenderProps {
|
|
@@ -1999,6 +2008,7 @@ export declare interface SenderProps {
|
|
|
1999
2008
|
theme?: ThemeType;
|
|
2000
2009
|
template?: string;
|
|
2001
2010
|
hasContent?: boolean;
|
|
2011
|
+
tipsMessage?: string;
|
|
2002
2012
|
}
|
|
2003
2013
|
|
|
2004
2014
|
export declare type SingleTabHistoryProps = {
|