@opentiny/tiny-robot 0.3.0-alpha.0 → 0.3.0-alpha.2
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 +13 -13
- package/dist/bubble/index.js +2141 -1360
- package/dist/close.js +1 -1
- package/dist/container/index.js +7 -7
- package/dist/dropdown-menu/index.js +38 -37
- package/dist/feedback/index.js +46 -45
- package/dist/flow-layout-buttons/index.js +20 -20
- package/dist/history/index.js +34 -35
- package/dist/index.d.ts +329 -290
- package/dist/index.js +62 -59
- package/dist/index2.js +343 -394
- package/dist/index3.js +129 -3717
- package/dist/index4.js +7 -7
- package/dist/index5.js +931 -2011
- package/dist/index6.js +1020 -891
- package/dist/loading.js +4 -0
- package/dist/prompts/index.js +2 -3
- package/dist/question/index.js +59 -59
- package/dist/sender/index.js +1017 -1025
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +95 -95
- package/dist/suggestion-pills/index.js +130 -109
- package/dist/suggestion-popover/index.js +243 -127
- package/dist/tiny-robot-svgs.js +211 -488
- package/dist/utils.js +15 -4
- package/package.json +4 -3
- package/dist/attachments/index.js +0 -602
|
@@ -1,180 +1,201 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { _ as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as T, useSlots as H, computed as k, createElementBlock as f, openBlock as n, normalizeClass as A, renderSlot as $, createBlock as v, resolveDynamicComponent as N, createCommentVNode as b, toDisplayString as j, unref as h, mergeProps as D, createSlots as q, withCtx as B, createVNode as I, renderList as M, normalizeStyle as O, mergeModels as E, ref as P, useModel as J, watch as K, createElementVNode as R, Fragment as z, Transition as Q, nextTick as U } from "vue";
|
|
2
|
+
import { f as X } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { b as Y, w as Z, o as x } from "../index2.js";
|
|
4
|
+
import ee from "../dropdown-menu/index.js";
|
|
5
|
+
import te from "../suggestion-popover/index.js";
|
|
6
|
+
import { _ as V } from "../_plugin-vue_export-helper.js";
|
|
7
|
+
const oe = { key: 0 }, ne = /* @__PURE__ */ T({
|
|
8
8
|
__name: "PillButton",
|
|
9
9
|
props: {
|
|
10
10
|
item: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
var
|
|
15
|
-
return !!(
|
|
16
|
-
}),
|
|
17
|
-
var
|
|
18
|
-
return !!(
|
|
19
|
-
}),
|
|
20
|
-
return (
|
|
21
|
-
class:
|
|
12
|
+
setup(u) {
|
|
13
|
+
const g = u, l = H(), e = k(() => {
|
|
14
|
+
var o;
|
|
15
|
+
return !!(l.icon || (o = g.item) != null && o.icon);
|
|
16
|
+
}), r = k(() => {
|
|
17
|
+
var o;
|
|
18
|
+
return !!(l.default || (o = g.item) != null && o.text);
|
|
19
|
+
}), m = k(() => e.value && !r.value);
|
|
20
|
+
return (o, c) => (n(), f("button", {
|
|
21
|
+
class: A(["tr-suggestion-pills__item", { "only-icon": m.value }])
|
|
22
22
|
}, [
|
|
23
|
-
|
|
24
|
-
var
|
|
23
|
+
$(o.$slots, "icon", {}, () => {
|
|
24
|
+
var i;
|
|
25
25
|
return [
|
|
26
|
-
(n(),
|
|
26
|
+
(n(), v(N((i = o.item) == null ? void 0 : i.icon), { class: "tr-suggestion-pills__item_icon" }))
|
|
27
27
|
];
|
|
28
28
|
}, !0),
|
|
29
|
-
|
|
30
|
-
var
|
|
29
|
+
$(o.$slots, "default", {}, () => {
|
|
30
|
+
var i;
|
|
31
31
|
return [
|
|
32
|
-
(
|
|
32
|
+
(i = o.item) != null && i.text ? (n(), f("span", oe, j(o.item.text), 1)) : b("", !0)
|
|
33
33
|
];
|
|
34
34
|
}, !0)
|
|
35
35
|
], 2));
|
|
36
36
|
}
|
|
37
|
-
}),
|
|
37
|
+
}), d = /* @__PURE__ */ V(ne, [["__scopeId", "data-v-5c113fe1"]]), L = /* @__PURE__ */ T({
|
|
38
38
|
__name: "PillButtonWrapper",
|
|
39
39
|
props: {
|
|
40
|
-
item: {}
|
|
40
|
+
item: {},
|
|
41
|
+
style: {}
|
|
41
42
|
},
|
|
42
43
|
emits: ["click"],
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
45
|
-
return (e,
|
|
46
|
-
var
|
|
47
|
-
return ((
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
setup(u, { emit: g }) {
|
|
45
|
+
const l = g;
|
|
46
|
+
return (e, r) => {
|
|
47
|
+
var m, o, c, i, p, y;
|
|
48
|
+
return ((m = e.item.action) == null ? void 0 : m.type) === "popover" ? (n(), v(h(te), D({
|
|
49
|
+
key: 0,
|
|
50
|
+
style: e.style
|
|
51
|
+
}, e.item.action.props, {
|
|
52
|
+
onItemClick: (o = e.item.action.events) == null ? void 0 : o.itemClick,
|
|
53
|
+
onGroupClick: (c = e.item.action.events) == null ? void 0 : c.groupClick,
|
|
54
|
+
onClose: (i = e.item.action.events) == null ? void 0 : i.close
|
|
55
|
+
}), q({
|
|
56
|
+
default: B(() => [
|
|
57
|
+
I(d, {
|
|
54
58
|
item: e.item,
|
|
55
|
-
onClick:
|
|
59
|
+
onClick: r[0] || (r[0] = (a) => l("click", a, e.item))
|
|
56
60
|
}, null, 8, ["item"])
|
|
57
61
|
]),
|
|
58
62
|
_: 2
|
|
59
63
|
}, [
|
|
60
|
-
|
|
64
|
+
M(e.item.action.slots, (a, C) => ({
|
|
61
65
|
name: C,
|
|
62
|
-
fn:
|
|
63
|
-
(n(),
|
|
66
|
+
fn: B(() => [
|
|
67
|
+
(n(), v(N(a)))
|
|
64
68
|
])
|
|
65
69
|
}))
|
|
66
|
-
]), 1040, ["onItemClick", "onGroupClick", "onClose"])) : ((
|
|
67
|
-
|
|
70
|
+
]), 1040, ["style", "onItemClick", "onGroupClick", "onClose"])) : ((p = e.item.action) == null ? void 0 : p.type) === "menu" ? (n(), v(h(ee), D({
|
|
71
|
+
key: 1,
|
|
72
|
+
style: e.style
|
|
73
|
+
}, e.item.action.props, {
|
|
74
|
+
onItemClick: (y = e.item.action.events) == null ? void 0 : y.itemClick
|
|
68
75
|
}), {
|
|
69
|
-
default:
|
|
70
|
-
|
|
76
|
+
default: B(() => [
|
|
77
|
+
I(d, {
|
|
71
78
|
item: e.item,
|
|
72
|
-
onClick:
|
|
79
|
+
onClick: r[1] || (r[1] = (a) => l("click", a, e.item))
|
|
73
80
|
}, null, 8, ["item"])
|
|
74
81
|
]),
|
|
75
82
|
_: 1
|
|
76
|
-
}, 16, ["onItemClick"])) : (n(),
|
|
83
|
+
}, 16, ["style", "onItemClick"])) : (n(), v(d, {
|
|
77
84
|
key: 2,
|
|
78
85
|
item: e.item,
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
style: O(e.style),
|
|
87
|
+
onClick: r[2] || (r[2] = (a) => l("click", a, e.item))
|
|
88
|
+
}, null, 8, ["item", "style"]));
|
|
81
89
|
};
|
|
82
90
|
}
|
|
83
|
-
}),
|
|
91
|
+
}), le = { class: "tr-suggestion-pills__more-wrapper" }, ie = {
|
|
84
92
|
key: 0,
|
|
85
93
|
class: "tr-suggestion-pills__more"
|
|
86
|
-
}, se = /* @__PURE__ */
|
|
94
|
+
}, se = /* @__PURE__ */ T({
|
|
87
95
|
__name: "index",
|
|
88
|
-
props: /* @__PURE__ */
|
|
96
|
+
props: /* @__PURE__ */ E({
|
|
89
97
|
items: {},
|
|
90
|
-
showAll: { type: Boolean }
|
|
98
|
+
showAll: { type: Boolean },
|
|
99
|
+
showAllButtonOn: { default: "hover" }
|
|
91
100
|
}, {
|
|
92
101
|
showAll: { type: Boolean, default: !1 },
|
|
93
102
|
showAllModifiers: {}
|
|
94
103
|
}),
|
|
95
|
-
emits: /* @__PURE__ */
|
|
96
|
-
setup(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
if (!
|
|
104
|
+
emits: /* @__PURE__ */ E(["item-click", "click-outside"], ["update:showAll"]),
|
|
105
|
+
setup(u, { emit: g }) {
|
|
106
|
+
const l = u, e = g, r = P(null), m = P(null), { width: o } = Y(m), c = P(-1), i = k(() => c.value !== -1), p = J(u, "showAll"), y = k(() => {
|
|
107
|
+
var t;
|
|
108
|
+
return !i.value || !p.value ? ((t = l.items) == null ? void 0 : t.length) || 0 : c.value;
|
|
109
|
+
}), a = k(() => !i.value || !p.value ? [] : (l.items || []).slice(c.value)), C = () => {
|
|
110
|
+
U(() => {
|
|
111
|
+
const t = m.value;
|
|
112
|
+
if (!t)
|
|
104
113
|
return;
|
|
105
|
-
const
|
|
106
|
-
|
|
114
|
+
const _ = Array.from(t.children);
|
|
115
|
+
c.value = _.findIndex((s) => s.offsetLeft + s.offsetWidth > t.clientWidth);
|
|
107
116
|
});
|
|
108
117
|
};
|
|
109
118
|
K(() => {
|
|
110
|
-
var
|
|
111
|
-
return [
|
|
119
|
+
var t;
|
|
120
|
+
return [l.items, (t = l.items) == null ? void 0 : t.length];
|
|
112
121
|
}, C), Z(
|
|
113
|
-
|
|
114
|
-
(
|
|
115
|
-
|
|
122
|
+
o,
|
|
123
|
+
(t) => {
|
|
124
|
+
t > 0 && C();
|
|
116
125
|
},
|
|
117
126
|
{ debounce: 100 }
|
|
118
127
|
);
|
|
119
|
-
const G = (
|
|
120
|
-
if (
|
|
121
|
-
|
|
128
|
+
const G = (t, _, s) => {
|
|
129
|
+
if (i.value && s >= c.value) {
|
|
130
|
+
t.stopPropagation(), W();
|
|
122
131
|
return;
|
|
123
132
|
}
|
|
124
|
-
e("item-click",
|
|
125
|
-
},
|
|
126
|
-
|
|
133
|
+
e("item-click", _);
|
|
134
|
+
}, W = () => {
|
|
135
|
+
p.value = !p.value;
|
|
127
136
|
};
|
|
128
|
-
return (
|
|
129
|
-
|
|
137
|
+
return x(r, (t) => {
|
|
138
|
+
e("click-outside", t);
|
|
139
|
+
}), (t, _) => (n(), f("div", {
|
|
140
|
+
class: "tr-suggestion-pills__wrapper",
|
|
141
|
+
ref_key: "containerWrapperRef",
|
|
142
|
+
ref: r
|
|
143
|
+
}, [
|
|
144
|
+
R("div", {
|
|
130
145
|
class: "tr-suggestion-pills__container",
|
|
131
146
|
ref_key: "containerRef",
|
|
132
|
-
ref:
|
|
147
|
+
ref: m
|
|
133
148
|
}, [
|
|
134
|
-
|
|
135
|
-
(n(!0),
|
|
136
|
-
key:
|
|
137
|
-
item:
|
|
138
|
-
|
|
139
|
-
|
|
149
|
+
$(t.$slots, "default", {}, () => [
|
|
150
|
+
(n(!0), f(z, null, M(l.items, (s, w) => (n(), v(h(L), {
|
|
151
|
+
key: s.id,
|
|
152
|
+
item: s,
|
|
153
|
+
style: O({
|
|
154
|
+
visibility: w < y.value ? void 0 : "hidden",
|
|
155
|
+
pointerEvents: w < y.value ? void 0 : "none"
|
|
156
|
+
}),
|
|
157
|
+
onClick: (F) => G(F, s, w)
|
|
158
|
+
}, null, 8, ["item", "style", "onClick"]))), 128))
|
|
140
159
|
], !0)
|
|
141
160
|
], 512),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
default:
|
|
145
|
-
|
|
146
|
-
(n(!0),
|
|
147
|
-
key:
|
|
148
|
-
item:
|
|
149
|
-
onClick: (
|
|
161
|
+
R("div", le, [
|
|
162
|
+
I(Q, { name: "tr-suggestion-pills__more" }, {
|
|
163
|
+
default: B(() => [
|
|
164
|
+
a.value.length ? (n(), f("div", ie, [
|
|
165
|
+
(n(!0), f(z, null, M(a.value, (s) => (n(), v(h(L), {
|
|
166
|
+
key: s.id,
|
|
167
|
+
item: s,
|
|
168
|
+
onClick: (w) => e("item-click", s)
|
|
150
169
|
}, null, 8, ["item", "onClick"]))), 128))
|
|
151
|
-
])) :
|
|
170
|
+
])) : b("", !0)
|
|
152
171
|
]),
|
|
153
172
|
_: 1
|
|
154
173
|
})
|
|
155
174
|
]),
|
|
156
|
-
|
|
175
|
+
i.value ? (n(), f("button", {
|
|
157
176
|
key: 0,
|
|
158
|
-
class: "tr-suggestion-pills__expand",
|
|
159
|
-
onClick:
|
|
177
|
+
class: A(["tr-suggestion-pills__expand", { "show-on-hover": l.showAllButtonOn === "hover" }]),
|
|
178
|
+
onClick: W
|
|
160
179
|
}, [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
180
|
+
I(h(X), {
|
|
181
|
+
class: A(["tr-suggestion-pills__expand-icon", { rotate: p.value }])
|
|
182
|
+
}, null, 8, ["class"])
|
|
183
|
+
], 2)) : b("", !0)
|
|
184
|
+
], 512));
|
|
164
185
|
}
|
|
165
|
-
}),
|
|
166
|
-
|
|
167
|
-
const re = function(
|
|
168
|
-
|
|
186
|
+
}), S = /* @__PURE__ */ V(se, [["__scopeId", "data-v-43d06a90"]]);
|
|
187
|
+
S.name = "TrSuggestionPills";
|
|
188
|
+
const re = function(u) {
|
|
189
|
+
u.component(S.name, S);
|
|
169
190
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const ae = function(
|
|
173
|
-
|
|
191
|
+
S.install = re;
|
|
192
|
+
d.name = "TrSuggestionPillButton";
|
|
193
|
+
const ae = function(u) {
|
|
194
|
+
u.component(d.name, d);
|
|
174
195
|
};
|
|
175
|
-
|
|
176
|
-
const ve =
|
|
196
|
+
d.install = ae;
|
|
197
|
+
const ve = d;
|
|
177
198
|
export {
|
|
178
199
|
ve as SuggestionPillButton,
|
|
179
|
-
|
|
200
|
+
S as default
|
|
180
201
|
};
|