@opentiny/tiny-robot 0.2.0-alpha.4 → 0.2.0-alpha.6
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 +70 -68
- package/dist/bubble/index.js +18 -17
- package/dist/close.js +1 -1
- package/dist/container/index.js +9 -9
- package/dist/dropdown-menu/index.js +72 -0
- package/dist/feedback/index.js +33 -33
- package/dist/flow-layout-buttons/index.js +123 -0
- package/dist/history/index.js +44 -44
- package/dist/icon-button/index.js +17 -16
- package/dist/index.d.ts +380 -68
- package/dist/index.js +55 -40
- package/dist/index2.js +4588 -341
- package/dist/index3.js +457 -3847
- package/dist/index4.js +1 -1
- package/dist/index5.js +3727 -3069
- package/dist/index6.js +3107 -4493
- package/dist/question/index.js +109 -109
- package/dist/sender/index.js +892 -562
- package/dist/shared/index.js +8 -0
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +76 -76
- package/dist/suggestion-pills/index.js +120 -0
- package/dist/suggestion-popover/index.js +178 -0
- package/dist/tiny-robot-svgs.js +300 -145
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as $, useSlots as
|
|
2
|
-
import {
|
|
3
|
-
import { T as
|
|
4
|
-
import { o as
|
|
5
|
-
import
|
|
6
|
-
import { _ as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as N, nextTick as W, createElementBlock as _, openBlock as n, createBlock as v, createCommentVNode as R, Fragment as G, renderList as I, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as x, renderSlot as L, createVNode as E, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, toDisplayString as Q, vShow as U } from "vue";
|
|
2
|
+
import { o as Y } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { T as M } from "../index4.js";
|
|
4
|
+
import { o as Z, b as ee } from "../index3.js";
|
|
5
|
+
import te from "../icon-button/index.js";
|
|
6
|
+
import { _ as oe } from "../_plugin-vue_export-helper.js";
|
|
7
|
+
const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae = { class: "tr-action-group__dropdown-item-text" }, ce = /* @__PURE__ */ $({
|
|
8
8
|
__name: "ActionGroup",
|
|
9
9
|
props: {
|
|
10
10
|
maxNum: {},
|
|
@@ -12,99 +12,101 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
12
12
|
dropDownShowLabelOnly: { type: Boolean }
|
|
13
13
|
},
|
|
14
14
|
emits: ["item-click"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
15
|
+
setup(l, { emit: k }) {
|
|
16
|
+
const a = l, F = H(), O = k, p = i(() => {
|
|
17
17
|
var o, t;
|
|
18
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
|
-
}),
|
|
21
|
-
const e =
|
|
20
|
+
}), b = i(() => {
|
|
21
|
+
const e = a.maxNum ?? Number.MAX_SAFE_INTEGER;
|
|
22
22
|
return e > 0 ? e : Number.MAX_SAFE_INTEGER;
|
|
23
|
-
}),
|
|
23
|
+
}), y = i(() => p.value.length > b.value), V = i(() => y.value ? p.value.slice(0, b.value) : p.value), z = i(() => y.value ? p.value.slice(b.value) : []), m = f(null), d = f(null), r = f(!1), P = () => {
|
|
24
24
|
r.value = !r.value;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
Z(d, (e) => {
|
|
27
27
|
var o;
|
|
28
|
-
(o =
|
|
28
|
+
(o = m.value) != null && o.contains(e.target) || (r.value = !1);
|
|
29
29
|
});
|
|
30
|
-
const
|
|
30
|
+
const A = (e) => {
|
|
31
31
|
O("item-click", e), r.value = !1;
|
|
32
|
-
},
|
|
33
|
-
if (!
|
|
32
|
+
}, B = f("placement-bottom"), { height: D } = ee(), T = () => {
|
|
33
|
+
if (!d.value || !m.value)
|
|
34
34
|
return "placement-bottom";
|
|
35
|
-
const e =
|
|
36
|
-
|
|
35
|
+
const e = d.value.getBoundingClientRect(), o = m.value.getBoundingClientRect();
|
|
36
|
+
B.value = o.bottom + e.height + 16 > D.value ? "placement-top" : "placement-bottom";
|
|
37
37
|
};
|
|
38
38
|
return N(r, (e) => {
|
|
39
|
-
e &&
|
|
40
|
-
|
|
39
|
+
e && W(() => {
|
|
40
|
+
T();
|
|
41
41
|
});
|
|
42
|
-
}), N(
|
|
43
|
-
r.value &&
|
|
44
|
-
}), (e, o) => (n(),
|
|
45
|
-
(n(!0),
|
|
42
|
+
}), N(D, () => {
|
|
43
|
+
r.value && T();
|
|
44
|
+
}), (e, o) => (n(), _("div", ne, [
|
|
45
|
+
(n(!0), _(G, null, I(V.value, (t, C) => {
|
|
46
46
|
var c;
|
|
47
|
-
return n(),
|
|
48
|
-
key:
|
|
47
|
+
return n(), v(h(M), {
|
|
48
|
+
key: C,
|
|
49
49
|
content: (c = t.props) == null ? void 0 : c.label,
|
|
50
50
|
effect: "dark",
|
|
51
51
|
placement: "top",
|
|
52
52
|
"open-delay": 500,
|
|
53
|
-
disabled: !
|
|
53
|
+
disabled: !a.showTooltip
|
|
54
54
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
|
|
55
|
+
default: S(() => [
|
|
56
|
+
w("span", {
|
|
57
57
|
class: "tr-action-group__btn-wrapper",
|
|
58
|
-
onClick: (
|
|
58
|
+
onClick: (X) => {
|
|
59
59
|
var s;
|
|
60
|
-
return
|
|
60
|
+
return A((s = t.props) == null ? void 0 : s.name);
|
|
61
61
|
}
|
|
62
62
|
}, [
|
|
63
|
-
(n(),
|
|
64
|
-
], 8,
|
|
63
|
+
(n(), v(x(t)))
|
|
64
|
+
], 8, re)
|
|
65
65
|
]),
|
|
66
66
|
_: 2
|
|
67
67
|
}, 1032, ["content", "disabled"]);
|
|
68
68
|
}), 128)),
|
|
69
|
-
|
|
69
|
+
y.value ? (n(), v(h(M), {
|
|
70
70
|
key: 0,
|
|
71
71
|
content: "更多",
|
|
72
72
|
effect: "dark",
|
|
73
73
|
placement: "top",
|
|
74
74
|
"open-delay": 500,
|
|
75
|
-
disabled: !
|
|
75
|
+
disabled: !a.showTooltip
|
|
76
76
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
default: S(() => [
|
|
78
|
+
w("span", {
|
|
79
|
+
ref_key: "moreBtnRef",
|
|
80
|
+
ref: m,
|
|
80
81
|
class: "tr-action-group__btn-wrapper",
|
|
81
|
-
onClick:
|
|
82
|
+
onClick: P
|
|
82
83
|
}, [
|
|
83
84
|
L(e.$slots, "moreBtn", {}, () => [
|
|
84
|
-
|
|
85
|
+
E(h(te), { icon: h(Y) }, null, 8, ["icon"])
|
|
85
86
|
], !0),
|
|
86
|
-
|
|
87
|
-
default:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
E(j, { name: "tr-action-group-dropdown" }, {
|
|
88
|
+
default: S(() => [
|
|
89
|
+
q(w("ul", {
|
|
90
|
+
ref_key: "dropDownRef",
|
|
91
|
+
ref: d,
|
|
92
|
+
class: J(["tr-action-group__dropdown", B.value])
|
|
91
93
|
}, [
|
|
92
|
-
(n(!0),
|
|
94
|
+
(n(!0), _(G, null, I(z.value, (t, C) => {
|
|
93
95
|
var c;
|
|
94
|
-
return n(),
|
|
96
|
+
return n(), _("li", {
|
|
95
97
|
class: "tr-action-group__dropdown-item",
|
|
96
|
-
key:
|
|
97
|
-
onClick:
|
|
98
|
+
key: C,
|
|
99
|
+
onClick: K((X) => {
|
|
98
100
|
var s;
|
|
99
|
-
return
|
|
101
|
+
return A((s = t.props) == null ? void 0 : s.name);
|
|
100
102
|
}, ["stop"])
|
|
101
103
|
}, [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
a.dropDownShowLabelOnly ? R("", !0) : (n(), v(x(t), { key: 0 })),
|
|
105
|
+
w("span", ae, Q((c = t.props) == null ? void 0 : c.label), 1)
|
|
104
106
|
], 8, le);
|
|
105
107
|
}), 128))
|
|
106
108
|
], 2), [
|
|
107
|
-
[
|
|
109
|
+
[U, r.value]
|
|
108
110
|
])
|
|
109
111
|
]),
|
|
110
112
|
_: 1
|
|
@@ -112,31 +114,31 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
|
|
|
112
114
|
], 512)
|
|
113
115
|
]),
|
|
114
116
|
_: 3
|
|
115
|
-
}, 8, ["disabled"])) :
|
|
117
|
+
}, 8, ["disabled"])) : R("", !0)
|
|
116
118
|
]));
|
|
117
119
|
}
|
|
118
|
-
}),
|
|
120
|
+
}), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-afd2130f"]]), u = /* @__PURE__ */ $({
|
|
119
121
|
__name: "ActionGroupItem",
|
|
120
122
|
props: {
|
|
121
123
|
name: {},
|
|
122
124
|
label: {}
|
|
123
125
|
},
|
|
124
|
-
setup(
|
|
125
|
-
return (
|
|
126
|
+
setup(l) {
|
|
127
|
+
return (k, a) => L(k.$slots, "default");
|
|
126
128
|
}
|
|
127
129
|
});
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
130
|
+
g.name = "TrActionGroup";
|
|
131
|
+
const se = function(l) {
|
|
132
|
+
l.component(g.name, g);
|
|
131
133
|
};
|
|
132
|
-
|
|
134
|
+
g.install = se;
|
|
133
135
|
u.name = "TrActionGroupItem";
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
+
const ie = function(l) {
|
|
137
|
+
l.component(u.name, u);
|
|
136
138
|
};
|
|
137
|
-
u.install =
|
|
138
|
-
const
|
|
139
|
+
u.install = ie;
|
|
140
|
+
const ve = u;
|
|
139
141
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
ve as ActionGroupItem,
|
|
143
|
+
g as default
|
|
142
144
|
};
|
package/dist/bubble/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as c0, useCssVars as L0, useSlots as P0, computed as au, createElementBlock as L, openBlock as S, normalizeClass as i0, createCommentVNode as _u, createElementVNode as Z, createBlock as yu, resolveDynamicComponent as o0, renderSlot as mu, toDisplayString as O0,
|
|
1
|
+
import { defineComponent as c0, useCssVars as L0, useSlots as P0, computed as au, createElementBlock as L, openBlock as S, normalizeClass as i0, createCommentVNode as _u, createElementVNode as Z, createBlock as yu, resolveDynamicComponent as o0, renderSlot as mu, toDisplayString as O0, ref as N0, watch as $0, Fragment as j0, renderList as Ou, mergeProps as Nu, createSlots as U0, withCtx as Z0 } from "vue";
|
|
2
2
|
import { _ as a0 } from "../_plugin-vue_export-helper.js";
|
|
3
|
-
import {
|
|
3
|
+
import { d as H0 } from "../index3.js";
|
|
4
4
|
const $u = {};
|
|
5
5
|
function V0(u) {
|
|
6
6
|
let e = $u[u];
|
|
@@ -3149,10 +3149,7 @@ const Tr = {
|
|
|
3149
3149
|
])
|
|
3150
3150
|
], 2));
|
|
3151
3151
|
}
|
|
3152
|
-
}), J = /* @__PURE__ */ a0(Or, [["__scopeId", "data-v-56d84731"]]), Nr = {
|
|
3153
|
-
class: "tr-bubble-list",
|
|
3154
|
-
ref: "scrollContainer"
|
|
3155
|
-
}, $r = /* @__PURE__ */ c0({
|
|
3152
|
+
}), J = /* @__PURE__ */ a0(Or, [["__scopeId", "data-v-56d84731"]]), Nr = /* @__PURE__ */ c0({
|
|
3156
3153
|
__name: "BubbleList",
|
|
3157
3154
|
props: {
|
|
3158
3155
|
items: {},
|
|
@@ -3160,7 +3157,7 @@ const Tr = {
|
|
|
3160
3157
|
autoScroll: { type: Boolean }
|
|
3161
3158
|
},
|
|
3162
3159
|
setup(u) {
|
|
3163
|
-
const e = u, t = N0(
|
|
3160
|
+
const e = u, t = N0(null), { y: n } = H0(t, {
|
|
3164
3161
|
behavior: "smooth",
|
|
3165
3162
|
throttle: 100
|
|
3166
3163
|
}), r = au(() => e.items.at(-1));
|
|
@@ -3178,7 +3175,11 @@ const Tr = {
|
|
|
3178
3175
|
var s;
|
|
3179
3176
|
return { ...(i.role ? ((s = e.roles) == null ? void 0 : s[i.role]) || {} : {}).slots, ...i.slots };
|
|
3180
3177
|
};
|
|
3181
|
-
return (i, a) => (S(), L("div",
|
|
3178
|
+
return (i, a) => (S(), L("div", {
|
|
3179
|
+
class: "tr-bubble-list",
|
|
3180
|
+
ref_key: "scrollContainerRef",
|
|
3181
|
+
ref: t
|
|
3182
|
+
}, [
|
|
3182
3183
|
(S(!0), L(j0, null, Ou(e.items, (s, f) => (S(), yu(J, Nu({
|
|
3183
3184
|
key: s.id || f,
|
|
3184
3185
|
ref_for: !0
|
|
@@ -3192,20 +3193,20 @@ const Tr = {
|
|
|
3192
3193
|
]), 1040))), 128))
|
|
3193
3194
|
], 512));
|
|
3194
3195
|
}
|
|
3195
|
-
}), tu = /* @__PURE__ */ a0(
|
|
3196
|
+
}), tu = /* @__PURE__ */ a0(Nr, [["__scopeId", "data-v-307d7ab0"]]);
|
|
3196
3197
|
J.name = "TrBubble";
|
|
3197
|
-
const
|
|
3198
|
+
const $r = function(u) {
|
|
3198
3199
|
u.component(J.name, J);
|
|
3199
3200
|
};
|
|
3200
|
-
J.install =
|
|
3201
|
-
const
|
|
3201
|
+
J.install = $r;
|
|
3202
|
+
const Vr = J;
|
|
3202
3203
|
tu.name = "TrBubbleList";
|
|
3203
|
-
const
|
|
3204
|
+
const jr = function(u) {
|
|
3204
3205
|
u.component(tu.name, tu);
|
|
3205
3206
|
};
|
|
3206
|
-
tu.install =
|
|
3207
|
-
const
|
|
3207
|
+
tu.install = jr;
|
|
3208
|
+
const Gr = tu;
|
|
3208
3209
|
export {
|
|
3209
|
-
|
|
3210
|
-
|
|
3210
|
+
Vr as Bubble,
|
|
3211
|
+
Gr as BubbleList
|
|
3211
3212
|
};
|
package/dist/close.js
CHANGED
package/dist/container/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as m, useCssVars as v, useModel as c, computed as _, createElementBlock as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as m, useCssVars as v, useModel as c, computed as _, createElementBlock as $, openBlock as w, createElementVNode as n, renderSlot as r, createVNode as u, unref as a } from "vue";
|
|
2
|
+
import { $ as g, i as h, t 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 B = { class: "tr-container" }, k = { class: "tr-container__header" }, z = { class: "tr-container__header-operations" }, y = { class: "tr-container__footer" }, E = /* @__PURE__ */ m({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
8
8
|
show: { type: Boolean, required: !0 },
|
|
@@ -18,16 +18,16 @@ const y = { class: "tr-container" }, B = { class: "tr-container__header" }, E =
|
|
|
18
18
|
"224ae4c1": l.value ? "100" : "-1",
|
|
19
19
|
cb10cae2: l.value ? "1" : "0"
|
|
20
20
|
}));
|
|
21
|
-
const l = c(o, "show"), s = c(o, "fullscreen"), f = _(() => s.value ?
|
|
22
|
-
return (t, e) => (
|
|
21
|
+
const l = c(o, "show"), s = c(o, "fullscreen"), f = _(() => s.value ? g : h);
|
|
22
|
+
return (t, e) => (w(), $("div", B, [
|
|
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", 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", z, [
|
|
31
31
|
r(t.$slots, "operations"),
|
|
32
32
|
u(a(d), {
|
|
33
33
|
size: "28",
|
|
@@ -44,12 +44,12 @@ const y = { class: "tr-container" }, B = { class: "tr-container__header" }, E =
|
|
|
44
44
|
])
|
|
45
45
|
]),
|
|
46
46
|
r(t.$slots, "default"),
|
|
47
|
-
n("div",
|
|
47
|
+
n("div", y, [
|
|
48
48
|
r(t.$slots, "footer")
|
|
49
49
|
])
|
|
50
50
|
]));
|
|
51
51
|
}
|
|
52
|
-
}), i = /* @__PURE__ */ b(
|
|
52
|
+
}), i = /* @__PURE__ */ b(E, [["__scopeId", "data-v-81c9f59e"]]);
|
|
53
53
|
i.name = "TrContainer";
|
|
54
54
|
const I = function(o) {
|
|
55
55
|
o.component(i.name, i);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { defineComponent as $, useCssVars as T, unref as D, ref as d, computed as S, watch as B, createElementBlock as u, openBlock as n, renderSlot as M, createVNode as R, Transition as V, withCtx as E, createBlock as N, createCommentVNode as O, Teleport as W, createElementVNode as m, normalizeStyle as I, Fragment as b, renderList as z, toDisplayString as F } from "vue";
|
|
2
|
+
import { u as p, o as H } from "../index3.js";
|
|
3
|
+
import { toCssUnit as o } from "../shared/index.js";
|
|
4
|
+
import { _ as L } from "../_plugin-vue_export-helper.js";
|
|
5
|
+
const P = { class: "tr-dropdown-menu__list" }, U = ["onClick"], j = /* @__PURE__ */ $({
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
items: {},
|
|
9
|
+
minWidth: { default: 160 },
|
|
10
|
+
topOffset: { default: 0 }
|
|
11
|
+
},
|
|
12
|
+
emits: ["item-click"],
|
|
13
|
+
setup(s, { emit: f }) {
|
|
14
|
+
T((e) => ({
|
|
15
|
+
f8e23632: D(o)(l.minWidth)
|
|
16
|
+
}));
|
|
17
|
+
const l = s, t = d(!1), _ = f, c = d(null), a = d(null), { x: w, y: h, update: v } = p(c), { width: k, height: g } = p(a), x = S(() => ({
|
|
18
|
+
left: `min(${o(w.value)}, 100% - ${o(k.value)})`,
|
|
19
|
+
top: `max(${o(h.value)} - ${o(g.value)} + ${o(l.topOffset)} - 8px, 0px)`
|
|
20
|
+
}));
|
|
21
|
+
H(a, (e) => {
|
|
22
|
+
e.stopPropagation(), t.value = !1;
|
|
23
|
+
}), B(t, (e) => {
|
|
24
|
+
e && v();
|
|
25
|
+
});
|
|
26
|
+
const y = () => {
|
|
27
|
+
t.value = !t.value;
|
|
28
|
+
}, C = (e) => {
|
|
29
|
+
t.value = !1, _("item-click", e);
|
|
30
|
+
};
|
|
31
|
+
return (e, A) => (n(), u("div", {
|
|
32
|
+
class: "tr-dropdown-menu__wrapper",
|
|
33
|
+
ref_key: "dropDownTriggerRef",
|
|
34
|
+
ref: c,
|
|
35
|
+
onClick: y
|
|
36
|
+
}, [
|
|
37
|
+
M(e.$slots, "default", {}, void 0, !0),
|
|
38
|
+
R(V, { name: "tr-dropdown-menu" }, {
|
|
39
|
+
default: E(() => [
|
|
40
|
+
t.value ? (n(), N(W, {
|
|
41
|
+
key: 0,
|
|
42
|
+
to: "body"
|
|
43
|
+
}, [
|
|
44
|
+
m("div", {
|
|
45
|
+
class: "tr-dropdown-menu",
|
|
46
|
+
style: I(x.value),
|
|
47
|
+
ref_key: "dropdownMenuRef",
|
|
48
|
+
ref: a
|
|
49
|
+
}, [
|
|
50
|
+
m("ul", P, [
|
|
51
|
+
(n(!0), u(b, null, z(l.items, (i) => (n(), u("li", {
|
|
52
|
+
class: "tr-dropdown-menu__list-item",
|
|
53
|
+
key: i.id,
|
|
54
|
+
onClick: (G) => C(i)
|
|
55
|
+
}, F(i.text), 9, U))), 128))
|
|
56
|
+
])
|
|
57
|
+
], 4)
|
|
58
|
+
])) : O("", !0)
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
})
|
|
62
|
+
], 512));
|
|
63
|
+
}
|
|
64
|
+
}), r = /* @__PURE__ */ L(j, [["__scopeId", "data-v-e4886a37"]]);
|
|
65
|
+
r.name = "TrDropdownMenu";
|
|
66
|
+
const q = function(s) {
|
|
67
|
+
s.component(r.name, r);
|
|
68
|
+
};
|
|
69
|
+
r.install = q;
|
|
70
|
+
export {
|
|
71
|
+
r as default
|
|
72
|
+
};
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as X, ref as E, computed as
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
1
|
+
import { defineComponent as X, ref as E, computed as z, onMounted as D, watch as K, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as I, renderList as S, toDisplayString as y, createVNode as b, unref as l, nextTick as O, createElementVNode as p, createBlock as d, withCtx as f, createTextVNode as U, resolveDynamicComponent as C } from "vue";
|
|
2
|
+
import { K as T, U as N, d as q, s as j, p as H, e as J } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { B as R } from "../index5.js";
|
|
4
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
|
|
7
|
+
const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ X({
|
|
8
8
|
__name: "SourceList",
|
|
9
9
|
props: {
|
|
10
10
|
sources: {},
|
|
@@ -20,13 +20,13 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
20
20
|
} else
|
|
21
21
|
c.value = null;
|
|
22
22
|
});
|
|
23
|
-
},
|
|
24
|
-
|
|
23
|
+
}, A = z(() => _.sources.length - (c.value || 0));
|
|
24
|
+
D(g), K(() => _.sources, g);
|
|
25
25
|
const m = (u, n) => {
|
|
26
26
|
u && (L.value[n] = u);
|
|
27
27
|
};
|
|
28
|
-
return (u, n) => (t(), a("div",
|
|
29
|
-
(t(!0), a(I, null,
|
|
28
|
+
return (u, n) => (t(), a("div", W, [
|
|
29
|
+
(t(!0), a(I, null, S(_.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",
|
|
@@ -39,14 +39,14 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
39
39
|
key: 1,
|
|
40
40
|
class: "pill",
|
|
41
41
|
onClick: n[0] || (n[0] = (r) => e.value = !0)
|
|
42
|
-
}, y(
|
|
42
|
+
}, y(A.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(T))
|
|
50
50
|
])) : k("", !0)
|
|
51
51
|
]));
|
|
52
52
|
}
|
|
@@ -66,21 +66,21 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
66
66
|
emits: ["operation", "action"],
|
|
67
67
|
setup(h, { emit: _ }) {
|
|
68
68
|
const e = h, L = {
|
|
69
|
-
copy:
|
|
70
|
-
refresh:
|
|
71
|
-
like:
|
|
69
|
+
copy: J,
|
|
70
|
+
refresh: H,
|
|
71
|
+
like: j,
|
|
72
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
|
+
}, A = (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,
|
|
83
|
+
var s, r, v, w, B, F, M, G;
|
|
84
84
|
return t(), a("div", te, [
|
|
85
85
|
p("div", se, [
|
|
86
86
|
p("div", oe, [
|
|
@@ -92,7 +92,7 @@ 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
|
-
b(l(
|
|
95
|
+
b(l(R), {
|
|
96
96
|
round: "",
|
|
97
97
|
size: "mini",
|
|
98
98
|
"reset-time": 0,
|
|
@@ -100,25 +100,25 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
100
100
|
}, {
|
|
101
101
|
default: f(() => [
|
|
102
102
|
o[0] || (o[0] = p("span", null, "更多", -1)),
|
|
103
|
-
b(l(
|
|
103
|
+
b(l(N))
|
|
104
104
|
]),
|
|
105
105
|
_: 1
|
|
106
106
|
})
|
|
107
107
|
]),
|
|
108
108
|
default: f(() => [
|
|
109
|
-
(t(!0), a(I, null,
|
|
109
|
+
(t(!0), a(I, null, S(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(R), {
|
|
116
116
|
round: "",
|
|
117
117
|
"reset-time": 0,
|
|
118
118
|
size: "mini"
|
|
119
119
|
}, {
|
|
120
120
|
default: f(() => [
|
|
121
|
-
|
|
121
|
+
U(y(i.label), 1)
|
|
122
122
|
]),
|
|
123
123
|
_: 2
|
|
124
124
|
}, 1024)
|
|
@@ -133,7 +133,7 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__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(C(m.value ? l(T) : l(N))))
|
|
137
137
|
])
|
|
138
138
|
])) : k("", !0)
|
|
139
139
|
]),
|
|
@@ -141,10 +141,10 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
141
141
|
b(l($), {
|
|
142
142
|
"max-num": e.actionsLimit,
|
|
143
143
|
"show-tooltip": !0,
|
|
144
|
-
onItemClick:
|
|
144
|
+
onItemClick: A
|
|
145
145
|
}, {
|
|
146
146
|
default: f(() => [
|
|
147
|
-
(t(!0), a(I, null,
|
|
147
|
+
(t(!0), a(I, null, S(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" }, Y = ["href"], Z = /* @__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(C(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" }, Y = ["href"], Z = /* @__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 && ((B = e.sources) != null && B.length) || m.value && e.sources ? (t(), a("div", ae, [
|
|
166
|
+
(F = e.operations) != null && F.length && ((M = e.sources) != null && M.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((G = e.sources) == null ? void 0 : G.length) + "条来源", 1),
|
|
172
|
+
(t(), d(C(m.value ? l(T) : l(N))))
|
|
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" }, Y = ["href"], Z = /* @__PURE__
|
|
|
181
181
|
]);
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
}),
|
|
185
|
-
|
|
184
|
+
}), x = /* @__PURE__ */ P(ie, [["__scopeId", "data-v-cc6ef316"]]);
|
|
185
|
+
x.name = "TrFeedback";
|
|
186
186
|
const ce = function(h) {
|
|
187
|
-
h.component(
|
|
187
|
+
h.component(x.name, x);
|
|
188
188
|
};
|
|
189
|
-
|
|
189
|
+
x.install = ce;
|
|
190
190
|
export {
|
|
191
|
-
|
|
191
|
+
x as default
|
|
192
192
|
};
|