@opentiny/tiny-robot 0.3.0-alpha.5 → 0.3.0-alpha.7
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/base-popper/index.js +2 -121
- package/dist/close.js +1 -1
- package/dist/dropdown-menu/index.js +43 -43
- package/dist/feedback/index.js +1 -1
- package/dist/flow-layout-buttons/index.js +8 -8
- package/dist/history/index.js +2 -2
- package/dist/index.d.ts +1149 -119
- package/dist/index2.js +7 -6
- package/dist/index3.js +137 -306
- package/dist/index4.js +269 -591
- package/dist/index5.js +528 -2047
- package/dist/index6.js +2069 -4662
- package/dist/index7.js +4749 -0
- package/dist/question/index.js +1 -1
- package/dist/sender/index.js +3 -3
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +110 -184
- package/dist/suggestion-popover/index.js +224 -203
- package/dist/useSlotRefs.js +36 -0
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as N, nextTick as W, createElementBlock as _, openBlock as o, 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
2
|
import { c as Y } from "../tiny-robot-svgs.js";
|
|
3
|
-
import { T as M } from "../
|
|
4
|
-
import { o as Z,
|
|
3
|
+
import { T as M } from "../index5.js";
|
|
4
|
+
import { o as Z, b as ee } from "../index2.js";
|
|
5
5
|
import te from "../icon-button/index.js";
|
|
6
6
|
import { _ as oe } from "../_plugin-vue_export-helper.js";
|
|
7
7
|
const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae = { class: "tr-action-group__dropdown-item-text" }, ce = /* @__PURE__ */ $({
|
|
@@ -17,10 +17,10 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
|
|
|
17
17
|
var a, t;
|
|
18
18
|
const e = F.default();
|
|
19
19
|
return Array.isArray(e) ? e.length === 1 && ((a = e[0].type) == null ? void 0 : a.toString()) === "Symbol(v-fgt)" ? e[0].children : e : ((t = e.type) == null ? void 0 : t.toString()) === "Symbol(v-fgt)" ? e.children : [e];
|
|
20
|
-
}),
|
|
20
|
+
}), b = i(() => {
|
|
21
21
|
const e = l.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), n = f(!1), P = () => {
|
|
24
24
|
n.value = !n.value;
|
|
25
25
|
};
|
|
26
26
|
Z(
|
|
@@ -69,7 +69,7 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
|
|
|
69
69
|
_: 2
|
|
70
70
|
}, 1032, ["content", "disabled"]);
|
|
71
71
|
}), 128)),
|
|
72
|
-
|
|
72
|
+
y.value ? (o(), v(h(M), {
|
|
73
73
|
key: 0,
|
|
74
74
|
content: "更多",
|
|
75
75
|
effect: "dark",
|
|
@@ -1,123 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as te, e as oe, b as re } from "../index2.js";
|
|
3
|
-
import { t as m } from "../utils.js";
|
|
4
|
-
import { _ as ne } from "../_plugin-vue_export-helper.js";
|
|
5
|
-
function se(p, g) {
|
|
6
|
-
const o = u(() => {
|
|
7
|
-
const e = (p == null ? void 0 : p()) || [], a = e.find((d) => d.type === R);
|
|
8
|
-
return a && Array.isArray(a.children) ? a.children : e;
|
|
9
|
-
}), f = u(() => g ? o.value.length : 1), v = u(() => o.value.slice(0, f.value)), c = N([]), s = (e) => e && typeof e == "object" && "$el" in e || e instanceof HTMLElement || e instanceof SVGElement ? e : (console.warn("el must be an HTMLElement or SVGElement or Vue component instance. el:", e), null), A = (e) => {
|
|
10
|
-
c.value[0] = s(e);
|
|
11
|
-
}, b = (e, a) => {
|
|
12
|
-
c.value[a] = s(e);
|
|
13
|
-
};
|
|
14
|
-
return $(
|
|
15
|
-
f,
|
|
16
|
-
(e) => {
|
|
17
|
-
c.value.length = e;
|
|
18
|
-
},
|
|
19
|
-
{ flush: "post" }
|
|
20
|
-
), {
|
|
21
|
-
vnodes: v,
|
|
22
|
-
ref: u(() => c.value.at(0)),
|
|
23
|
-
refs: c,
|
|
24
|
-
setRef: A,
|
|
25
|
-
setRefs: b
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function ae(p, g) {
|
|
29
|
-
return u(() => {
|
|
30
|
-
var s;
|
|
31
|
-
const o = te(p), f = (s = o == null ? void 0 : o.getRootNode) == null ? void 0 : s.call(o);
|
|
32
|
-
return f instanceof ShadowRoot ? f : document.body;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
const le = /* @__PURE__ */ G({
|
|
36
|
-
inheritAttrs: !1,
|
|
37
|
-
__name: "index",
|
|
38
|
-
props: {
|
|
39
|
-
appendTo: {},
|
|
40
|
-
offset: {},
|
|
41
|
-
placement: { default: "top-center" },
|
|
42
|
-
preventOverflow: { type: Boolean },
|
|
43
|
-
renderAllTriggers: { type: Boolean },
|
|
44
|
-
show: { type: Boolean },
|
|
45
|
-
transitionProps: {},
|
|
46
|
-
triggerEvents: {}
|
|
47
|
-
},
|
|
48
|
-
setup(p, { expose: g }) {
|
|
49
|
-
const o = p, f = I(), {
|
|
50
|
-
vnodes: v,
|
|
51
|
-
refs: c,
|
|
52
|
-
ref: s,
|
|
53
|
-
setRefs: A
|
|
54
|
-
} = se(f.trigger, o.renderAllTriggers);
|
|
55
|
-
function b(t = {}, l) {
|
|
56
|
-
const n = {};
|
|
57
|
-
for (const [r, i] of Object.entries(t))
|
|
58
|
-
/^on[A-Z]/.test(r) && typeof i == "function" && (n[r] = (...h) => i(...h, l));
|
|
59
|
-
return n;
|
|
60
|
-
}
|
|
61
|
-
const e = u(
|
|
62
|
-
() => v.value.map((t, l) => b(o.triggerEvents, l))
|
|
63
|
-
), a = N(null), d = u(() => {
|
|
64
|
-
var t, l;
|
|
65
|
-
return typeof o.offset == "number" ? { mainAxis: o.offset, crossAxis: 0 } : {
|
|
66
|
-
mainAxis: ((t = o.offset) == null ? void 0 : t.mainAxis) ?? 0,
|
|
67
|
-
crossAxis: ((l = o.offset) == null ? void 0 : l.crossAxis) ?? 0
|
|
68
|
-
};
|
|
69
|
-
}), { top: P, bottom: O, left: T, right: C, width: H, update: M } = oe(s), { width: V, height: w } = re(a, void 0, { box: "border-box" }), z = u(() => {
|
|
70
|
-
const { placement: t, preventOverflow: l } = o, n = {}, r = (i, h) => {
|
|
71
|
-
if (!l) {
|
|
72
|
-
n[i] = h;
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const _ = i === "top" || i === "bottom", L = _ ? "100dvh" : "100dvw", j = m(_ ? w.value : V.value);
|
|
76
|
-
n[i] = `clamp(0px, ${h}, calc(${L} - ${j}))`;
|
|
77
|
-
};
|
|
78
|
-
return t.includes("top") && r("top", m(P.value - w.value - d.value.mainAxis)), t.includes("bottom") && r("bottom", `calc(100% - ${m(O.value + w.value + d.value.mainAxis)})`), t.includes("left") && r("left", m(T.value + d.value.crossAxis)), t.includes("right") && r("right", `calc(100% - ${m(C.value + d.value.crossAxis)})`), t.includes("center") && r("left", m(T.value + H.value / 2 - V.value / 2 + d.value.crossAxis)), n;
|
|
79
|
-
});
|
|
80
|
-
$(
|
|
81
|
-
() => o.show,
|
|
82
|
-
(t) => {
|
|
83
|
-
t && M();
|
|
84
|
-
},
|
|
85
|
-
{ flush: "post" }
|
|
86
|
-
);
|
|
87
|
-
const D = ae(s);
|
|
88
|
-
return g({
|
|
89
|
-
triggerRef: s,
|
|
90
|
-
triggerRefs: c,
|
|
91
|
-
popperRef: a
|
|
92
|
-
}), (t, l) => (y(), E(R, null, [
|
|
93
|
-
(y(!0), E(R, null, U(x(v), (n, r) => (y(), k(W(n), B({
|
|
94
|
-
key: Z(n) ? n.key : r,
|
|
95
|
-
ref_for: !0,
|
|
96
|
-
ref: (i) => x(A)(i, r)
|
|
97
|
-
}, { ref_for: !0 }, e.value[r]), null, 16))), 128)),
|
|
98
|
-
S(t.$slots, "backdrop", {}, void 0, !0),
|
|
99
|
-
F(q, J(K(t.transitionProps)), {
|
|
100
|
-
default: Q(() => [
|
|
101
|
-
t.show ? (y(), k(Y, {
|
|
102
|
-
key: 0,
|
|
103
|
-
to: o.appendTo || x(D)
|
|
104
|
-
}, [
|
|
105
|
-
ee("div", B({
|
|
106
|
-
class: "tr-base-popper",
|
|
107
|
-
ref_key: "popperRef",
|
|
108
|
-
ref: a,
|
|
109
|
-
style: z.value
|
|
110
|
-
}, t.$attrs), [
|
|
111
|
-
S(t.$slots, "content", {}, void 0, !0)
|
|
112
|
-
], 16)
|
|
113
|
-
], 8, ["to"])) : X("", !0)
|
|
114
|
-
]),
|
|
115
|
-
_: 3
|
|
116
|
-
}, 16)
|
|
117
|
-
], 64));
|
|
118
|
-
}
|
|
119
|
-
}), ie = /* @__PURE__ */ ne(le, [["__scopeId", "data-v-8baa02e5"]]);
|
|
120
|
-
ie.name = "TrBasePopper";
|
|
1
|
+
import { B as f } from "../index3.js";
|
|
121
2
|
export {
|
|
122
|
-
|
|
3
|
+
f as default
|
|
123
4
|
};
|
package/dist/close.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { defineComponent as C,
|
|
2
|
-
import { o as
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as C, mergeModels as f, useModel as M, computed as i, ref as B, watch as R, createBlock as x, openBlock as a, unref as E, withCtx as v, createElementVNode as T, createElementBlock as w, Fragment as D, renderList as b, toDisplayString as H, renderSlot as L } from "vue";
|
|
2
|
+
import { o as P, a as h } from "../index2.js";
|
|
3
|
+
import { B as I } from "../index3.js";
|
|
4
|
+
import { _ as S } from "../_plugin-vue_export-helper.js";
|
|
5
|
+
const $ = { class: "tr-dropdown-menu__list" }, F = ["onClick"], N = /* @__PURE__ */ C({
|
|
6
6
|
__name: "index",
|
|
7
|
-
props: {
|
|
7
|
+
props: /* @__PURE__ */ f({
|
|
8
8
|
appendTo: {},
|
|
9
9
|
items: {},
|
|
10
10
|
show: { type: Boolean },
|
|
11
11
|
trigger: { default: "click" }
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
}, {
|
|
13
|
+
show: { type: Boolean, default: !1 },
|
|
14
|
+
showModifiers: {}
|
|
15
|
+
}),
|
|
16
|
+
emits: /* @__PURE__ */ f(["item-click", "click-outside"], ["update:show"]),
|
|
17
|
+
setup(n, { emit: k }) {
|
|
18
|
+
const t = n, c = k, d = M(n, "show"), o = i({
|
|
19
|
+
get: () => t.trigger === "manual" ? t.show : d.value,
|
|
17
20
|
set: (e) => {
|
|
18
|
-
t.trigger !== "manual" && (
|
|
21
|
+
t.trigger !== "manual" && (d.value = e);
|
|
19
22
|
}
|
|
20
|
-
}),
|
|
23
|
+
}), l = B(null), p = i(() => {
|
|
21
24
|
var e;
|
|
22
|
-
return (e =
|
|
23
|
-
}),
|
|
25
|
+
return (e = l.value) == null ? void 0 : e.triggerRef;
|
|
26
|
+
}), u = i(() => {
|
|
24
27
|
var e;
|
|
25
|
-
return (e =
|
|
28
|
+
return (e = l.value) == null ? void 0 : e.popperRef;
|
|
26
29
|
});
|
|
27
30
|
if (t.trigger === "click" || t.trigger === "manual")
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
P(
|
|
32
|
+
u,
|
|
30
33
|
(e) => {
|
|
31
|
-
c("click-outside", e),
|
|
34
|
+
c("click-outside", e), o.value = !1;
|
|
32
35
|
},
|
|
33
|
-
{ ignore: [
|
|
36
|
+
{ ignore: [p] }
|
|
34
37
|
);
|
|
35
38
|
else if (t.trigger === "hover") {
|
|
36
|
-
const e =
|
|
37
|
-
n(() => P(u.value)),
|
|
38
|
-
{ delayEnter: 100, delayLeave: 300 }
|
|
39
|
-
), m = k(d, { delayEnter: 100, delayLeave: 300 });
|
|
39
|
+
const e = h(p, { delayEnter: 100, delayLeave: 300 }), m = h(u, { delayEnter: 100, delayLeave: 300 });
|
|
40
40
|
R(
|
|
41
41
|
() => [e.value, m.value],
|
|
42
|
-
([
|
|
43
|
-
|
|
42
|
+
([r, g]) => {
|
|
43
|
+
o.value = r || g;
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
t.trigger === "click" && (
|
|
47
|
+
const _ = () => {
|
|
48
|
+
t.trigger === "click" && (o.value = !o.value);
|
|
49
49
|
}, y = (e) => {
|
|
50
|
-
|
|
50
|
+
o.value = !1, c("item-click", e);
|
|
51
51
|
};
|
|
52
|
-
return (e, m) => (a(), E(
|
|
53
|
-
show:
|
|
52
|
+
return (e, m) => (a(), x(E(I), {
|
|
53
|
+
show: o.value,
|
|
54
54
|
class: "tr-dropdown-menu",
|
|
55
55
|
ref_key: "basePopperRef",
|
|
56
|
-
ref:
|
|
56
|
+
ref: l,
|
|
57
57
|
placement: "top-left",
|
|
58
58
|
"append-to": t.appendTo,
|
|
59
59
|
offset: 8,
|
|
60
60
|
"transition-props": { name: "tr-dropdown-menu" },
|
|
61
61
|
"prevent-overflow": !0,
|
|
62
|
-
"trigger-events": { onClick:
|
|
62
|
+
"trigger-events": { onClick: _ }
|
|
63
63
|
}, {
|
|
64
64
|
trigger: v(() => [
|
|
65
|
-
|
|
65
|
+
L(e.$slots, "trigger", {}, void 0, !0)
|
|
66
66
|
]),
|
|
67
67
|
content: v(() => [
|
|
68
|
-
|
|
69
|
-
(a(!0),
|
|
68
|
+
T("ul", $, [
|
|
69
|
+
(a(!0), w(D, null, b(t.items, (r) => (a(), w("li", {
|
|
70
70
|
class: "tr-dropdown-menu__list-item",
|
|
71
|
-
key:
|
|
72
|
-
onClick: (
|
|
73
|
-
},
|
|
71
|
+
key: r.id,
|
|
72
|
+
onClick: (g) => y(r)
|
|
73
|
+
}, H(r.text), 9, F))), 128))
|
|
74
74
|
])
|
|
75
75
|
]),
|
|
76
76
|
_: 3
|
|
77
77
|
}, 8, ["show", "append-to", "trigger-events"]));
|
|
78
78
|
}
|
|
79
|
-
}), s = /* @__PURE__ */
|
|
79
|
+
}), s = /* @__PURE__ */ S(N, [["__scopeId", "data-v-cb0454c9"]]);
|
|
80
80
|
s.name = "TrDropdownMenu";
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const O = function(n) {
|
|
82
|
+
n.component(s.name, s);
|
|
83
83
|
};
|
|
84
|
-
s.install =
|
|
84
|
+
s.install = O;
|
|
85
85
|
export {
|
|
86
86
|
s as default
|
|
87
87
|
};
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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 h, unref as l, nextTick as O, createElementVNode as d, createBlock as _, withCtx as f, createTextVNode as U, resolveDynamicComponent as C } from "vue";
|
|
2
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 "../
|
|
3
|
+
import { B as R } from "../index4.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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as V, mergeModels as E, useModel as q, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as C, Fragment as I, renderList as S, createCommentVNode as _, normalizeClass as
|
|
1
|
+
import { defineComponent as V, mergeModels as E, useModel as q, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as C, Fragment as I, renderList as S, createCommentVNode as _, normalizeClass as x, createBlock as B, resolveDynamicComponent as b, toDisplayString as D, nextTick as G } from "vue";
|
|
2
2
|
import { U as H } from "../tiny-robot-svgs.js";
|
|
3
|
-
import {
|
|
3
|
+
import { c as X, o as j } from "../index2.js";
|
|
4
4
|
import { _ as J } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const K = ["onClick"], P = {
|
|
6
6
|
key: 0,
|
|
@@ -70,26 +70,26 @@ const K = ["onClick"], P = {
|
|
|
70
70
|
}, [
|
|
71
71
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
72
72
|
key: 0,
|
|
73
|
-
class:
|
|
73
|
+
class: x(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
74
74
|
ref_for: !0,
|
|
75
75
|
ref: (r) => A(r, f),
|
|
76
76
|
onClick: (r) => R(e.id)
|
|
77
77
|
}, [
|
|
78
|
-
(l(),
|
|
78
|
+
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
79
79
|
e.label ? (l(), a("span", P, D(e.label), 1)) : _("", !0)
|
|
80
80
|
], 10, K)) : _("", !0)
|
|
81
81
|
], 64))), 128)),
|
|
82
82
|
C("div", Q, [
|
|
83
83
|
m.value ? _("", !0) : (l(), a("button", {
|
|
84
84
|
key: 0,
|
|
85
|
-
class:
|
|
85
|
+
class: x(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
|
|
86
86
|
ref_key: "moreButtonRef",
|
|
87
87
|
ref: w,
|
|
88
88
|
onClick: U,
|
|
89
89
|
onMouseenter: o[0] || (o[0] = (e) => v(!0)),
|
|
90
90
|
onMouseleave: o[1] || (o[1] = (e) => v(!1))
|
|
91
91
|
}, [
|
|
92
|
-
(l(),
|
|
92
|
+
(l(), B(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
93
93
|
], 34)),
|
|
94
94
|
C("div", {
|
|
95
95
|
class: "tr-flow-layout__dropdown-container",
|
|
@@ -103,11 +103,11 @@ const K = ["onClick"], P = {
|
|
|
103
103
|
ref: k
|
|
104
104
|
}, [
|
|
105
105
|
(l(!0), a(I, null, S(z.value, (e) => (l(), a("button", {
|
|
106
|
-
class:
|
|
106
|
+
class: x(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
|
|
107
107
|
key: e.id,
|
|
108
108
|
onClick: (f) => R(e.id)
|
|
109
109
|
}, [
|
|
110
|
-
(l(),
|
|
110
|
+
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
111
111
|
C("span", Z, D(e.label), 1)
|
|
112
112
|
], 10, Y))), 128))
|
|
113
113
|
], 512)) : _("", !0)
|
package/dist/history/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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
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 "../
|
|
4
|
-
import { T as S } from "../
|
|
3
|
+
import { I as le } from "../index6.js";
|
|
4
|
+
import { T as S } from "../index5.js";
|
|
5
5
|
import B from "../icon-button/index.js";
|
|
6
6
|
import { o as ce } from "../index2.js";
|
|
7
7
|
import { _ as M } from "../_plugin-vue_export-helper.js";
|