@opentiny/tiny-robot 0.2.0-alpha.4 → 0.2.0-alpha.5
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 +25 -25
- package/dist/bubble/index.js +1 -1
- package/dist/close.js +1 -1
- package/dist/container/index.js +9 -9
- package/dist/dropdown-menu/index.js +70 -0
- package/dist/feedback/index.js +33 -33
- package/dist/flow-layout-buttons/index.js +120 -0
- package/dist/history/index.js +44 -44
- package/dist/icon-button/index.js +17 -16
- package/dist/index.d.ts +379 -67
- 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 +119 -0
- package/dist/suggestion-popover/index.js +176 -0
- package/dist/tiny-robot-svgs.js +300 -145
- package/package.json +3 -3
package/dist/history/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { I as le } from "../
|
|
1
|
+
import { defineComponent as V, createElementBlock as u, openBlock as n, normalizeStyle as X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as m, unref as e, ref as G, watchEffect as Y, nextTick as Z, mergeModels as N, useCssVars as q, computed as h, useModel as P, createCommentVNode as E, Fragment as T, renderList as $, createBlock as R, withDirectives as ee, mergeProps as te, withCtx as z, withModifiers as H, vModelText as re } from "vue";
|
|
2
|
+
import { f as oe, z as se, r as ae, n as ne, t as ie } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { I as le } from "../index6.js";
|
|
4
4
|
import { T as S } from "../index4.js";
|
|
5
5
|
import B from "../icon-button/index.js";
|
|
6
|
-
import { o as ce } from "../
|
|
7
|
-
import { _ as
|
|
8
|
-
const ue = /* @__PURE__ */
|
|
6
|
+
import { o as ce } from "../index3.js";
|
|
7
|
+
import { _ as M } from "../_plugin-vue_export-helper.js";
|
|
8
|
+
const ue = /* @__PURE__ */ V({
|
|
9
9
|
__name: "item-tag",
|
|
10
10
|
props: {
|
|
11
11
|
text: {},
|
|
@@ -21,7 +21,7 @@ const ue = /* @__PURE__ */ M({
|
|
|
21
21
|
p("span", null, k(t.text), 1)
|
|
22
22
|
], 6));
|
|
23
23
|
}
|
|
24
|
-
}), de = /* @__PURE__ */
|
|
24
|
+
}), de = /* @__PURE__ */ M(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
25
|
__name: "search-empty",
|
|
26
26
|
props: {
|
|
27
27
|
text: { default: "暂无内容" }
|
|
@@ -35,14 +35,14 @@ const ue = /* @__PURE__ */ M({
|
|
|
35
35
|
p("span", he, k(t.text), 1)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
39
|
-
const t =
|
|
38
|
+
}), fe = /* @__PURE__ */ M(me, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
|
|
39
|
+
const t = G(), a = (l) => {
|
|
40
40
|
t.value = {
|
|
41
41
|
id: l.id,
|
|
42
42
|
title: l.title,
|
|
43
43
|
rawData: l
|
|
44
44
|
};
|
|
45
|
-
}, _ =
|
|
45
|
+
}, _ = G(null), f = (l) => {
|
|
46
46
|
l && Z(() => {
|
|
47
47
|
_.value = l, _.value.focus();
|
|
48
48
|
});
|
|
@@ -69,18 +69,18 @@ const ue = /* @__PURE__ */ M({
|
|
|
69
69
|
}), {
|
|
70
70
|
editingItem: t,
|
|
71
71
|
handleEdit: a,
|
|
72
|
-
handleEditorInputRef:
|
|
72
|
+
handleEditorInputRef: f,
|
|
73
73
|
handleKeyDown: b
|
|
74
74
|
};
|
|
75
|
-
},
|
|
75
|
+
}, ye = { 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__ */ V({
|
|
82
82
|
__name: "index",
|
|
83
|
-
props: /* @__PURE__ */
|
|
83
|
+
props: /* @__PURE__ */ N({
|
|
84
84
|
tabTitle: {},
|
|
85
85
|
data: {},
|
|
86
86
|
activeTab: {},
|
|
@@ -96,31 +96,31 @@ const ue = /* @__PURE__ */ M({
|
|
|
96
96
|
searchQuery: {},
|
|
97
97
|
searchQueryModifiers: {}
|
|
98
98
|
}),
|
|
99
|
-
emits: /* @__PURE__ */
|
|
99
|
+
emits: /* @__PURE__ */ N(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
|
|
100
100
|
setup(i, { emit: t }) {
|
|
101
101
|
q((c) => ({
|
|
102
102
|
d4b77bae: b.value ? "1px solid rgb(240, 240, 240)" : "none",
|
|
103
103
|
"659130e6": b.value ? "2px solid rgb(25, 25, 25)" : "none"
|
|
104
104
|
}));
|
|
105
|
-
const a = i, _ =
|
|
105
|
+
const a = i, _ = P(i, "activeTab"), 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
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"), O = 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 ? O.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(f.value || "", s))
|
|
115
|
+
})).filter((o) => o.items.length > 0) : O.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
|
+
}, W = () => {
|
|
119
119
|
r("close");
|
|
120
|
-
},
|
|
120
|
+
}, F = (c) => {
|
|
121
121
|
r("item-delete", c);
|
|
122
|
-
}, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown:
|
|
123
|
-
return (c, o) => (n(), u("div",
|
|
122
|
+
}, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: Q } = ve(r);
|
|
123
|
+
return (c, o) => (n(), u("div", ye, [
|
|
124
124
|
p("div", ke, [
|
|
125
125
|
(n(!0), u(T, null, $(v.value, (s) => (n(), u("div", {
|
|
126
126
|
key: s.id,
|
|
@@ -130,8 +130,8 @@ const ue = /* @__PURE__ */ M({
|
|
|
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: f.value,
|
|
134
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => f.value = s),
|
|
135
135
|
placeholder: a.searchPlaceholder || "搜索对话名称",
|
|
136
136
|
"prefix-icon": e(se),
|
|
137
137
|
clearable: ""
|
|
@@ -146,15 +146,15 @@ const ue = /* @__PURE__ */ M({
|
|
|
146
146
|
p("span", null, k(s.group), 1)
|
|
147
147
|
])) : E("", !0),
|
|
148
148
|
(n(!0), u(T, null, $(s.items, (d) => {
|
|
149
|
-
var
|
|
149
|
+
var A;
|
|
150
150
|
return n(), u("div", {
|
|
151
151
|
key: `${d.id}-${d.title}`,
|
|
152
152
|
class: D(["tr-history__item", { selected: a.selected === d.id }]),
|
|
153
|
-
onClick: (
|
|
153
|
+
onClick: (y) => L(d)
|
|
154
154
|
}, [
|
|
155
|
-
((
|
|
155
|
+
((A = e(C)) == null ? void 0 : A.id) !== d.id ? (n(), u(T, { key: 0 }, [
|
|
156
156
|
p("span", Ie, k(d.title), 1),
|
|
157
|
-
d.tag ? (n(),
|
|
157
|
+
d.tag ? (n(), R(e(de), te({
|
|
158
158
|
key: 0,
|
|
159
159
|
class: "tr-history__item-tag",
|
|
160
160
|
ref_for: !0
|
|
@@ -166,10 +166,10 @@ const ue = /* @__PURE__ */ M({
|
|
|
166
166
|
placement: "top",
|
|
167
167
|
"open-delay": 500
|
|
168
168
|
}, {
|
|
169
|
-
default:
|
|
169
|
+
default: z(() => [
|
|
170
170
|
m(e(B), {
|
|
171
171
|
icon: e(ae),
|
|
172
|
-
onClick: H((
|
|
172
|
+
onClick: H((y) => e(j)(d), ["stop"])
|
|
173
173
|
}, null, 8, ["icon", "onClick"])
|
|
174
174
|
]),
|
|
175
175
|
_: 2
|
|
@@ -180,10 +180,10 @@ const ue = /* @__PURE__ */ M({
|
|
|
180
180
|
placement: "top",
|
|
181
181
|
"open-delay": 500
|
|
182
182
|
}, {
|
|
183
|
-
default:
|
|
183
|
+
default: z(() => [
|
|
184
184
|
m(e(B), {
|
|
185
185
|
icon: e(ne),
|
|
186
|
-
onClick: H((
|
|
186
|
+
onClick: H((y) => F(d), ["stop"])
|
|
187
187
|
}, null, 8, ["icon", "onClick"])
|
|
188
188
|
]),
|
|
189
189
|
_: 2
|
|
@@ -191,38 +191,38 @@ const ue = /* @__PURE__ */ M({
|
|
|
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] = (y) => e(C).title = y),
|
|
195
195
|
class: "tr-history__item-edit",
|
|
196
196
|
ref_for: !0,
|
|
197
197
|
ref: e(J),
|
|
198
198
|
onKeydown: o[2] || (o[2] = //@ts-ignore
|
|
199
|
-
(...
|
|
199
|
+
(...y) => e(Q) && e(Q)(...y))
|
|
200
200
|
}, null, 544)), [
|
|
201
201
|
[re, e(C).title]
|
|
202
202
|
])
|
|
203
203
|
], 10, Te);
|
|
204
204
|
}), 128))
|
|
205
|
-
]))), 128)) : (n(),
|
|
205
|
+
]))), 128)) : (n(), R(e(fe), {
|
|
206
206
|
key: 1,
|
|
207
|
-
text:
|
|
207
|
+
text: f.value ? "暂无搜索结果" : "暂无内容"
|
|
208
208
|
}, null, 8, ["text"]))
|
|
209
209
|
]),
|
|
210
210
|
p("div", Ee, [
|
|
211
211
|
m(e(B), {
|
|
212
212
|
icon: e(ie),
|
|
213
213
|
rounded: "",
|
|
214
|
-
onClick:
|
|
214
|
+
onClick: W
|
|
215
215
|
}, null, 8, ["icon"])
|
|
216
216
|
])
|
|
217
217
|
]));
|
|
218
218
|
}
|
|
219
|
-
}),
|
|
220
|
-
i.component("TrHistory",
|
|
221
|
-
},
|
|
222
|
-
...
|
|
219
|
+
}), U = /* @__PURE__ */ M($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
|
|
220
|
+
i.component("TrHistory", U);
|
|
221
|
+
}, Ne = {
|
|
222
|
+
...U,
|
|
223
223
|
install: Be,
|
|
224
224
|
name: "TrHistory"
|
|
225
225
|
};
|
|
226
226
|
export {
|
|
227
|
-
|
|
227
|
+
Ne as default
|
|
228
228
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { defineComponent as p, useCssVars as l, computed as t, createElementBlock as u, openBlock as s, normalizeClass as m, createBlock as d, resolveDynamicComponent as _ } from "vue";
|
|
2
|
+
import { toCssUnit as c } from "../shared/index.js";
|
|
3
|
+
import { _ as f } from "../_plugin-vue_export-helper.js";
|
|
4
|
+
const v = /* @__PURE__ */ p({
|
|
4
5
|
__name: "index",
|
|
5
6
|
props: {
|
|
6
7
|
icon: {},
|
|
@@ -8,24 +9,24 @@ const x = /* @__PURE__ */ i({
|
|
|
8
9
|
svgSize: { default: "16px" },
|
|
9
10
|
rounded: { type: Boolean }
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
12
|
+
setup(n) {
|
|
13
|
+
l((i) => ({
|
|
14
|
+
"72b46ad2": a.value,
|
|
15
|
+
66777814: r.value
|
|
15
16
|
}));
|
|
16
|
-
const o =
|
|
17
|
-
return (
|
|
17
|
+
const o = n, a = t(() => c(o.size)), r = t(() => c(o.svgSize));
|
|
18
|
+
return (i, z) => (s(), u("button", {
|
|
18
19
|
class: m(["tr-icon-button", { rounded: o.rounded }])
|
|
19
20
|
}, [
|
|
20
|
-
(
|
|
21
|
+
(s(), d(_(o.icon)))
|
|
21
22
|
], 2));
|
|
22
23
|
}
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
}), e = /* @__PURE__ */ f(v, [["__scopeId", "data-v-fe8553bc"]]);
|
|
25
|
+
e.name = "TrIconButton";
|
|
26
|
+
const x = function(n) {
|
|
27
|
+
n.component(e.name, e);
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
+
e.install = x;
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
e as default
|
|
31
32
|
};
|