@opentiny/tiny-robot 0.2.13 → 0.2.15
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/base-popper/index.js +86 -71
- package/dist/flow-layout-buttons/index.js +10 -10
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +279 -1679
- package/dist/index.js +33 -41
- package/dist/index3.js +33 -25
- package/dist/index5.js +179 -180
- package/dist/index6.js +610 -613
- package/dist/sender/index.js +805 -802
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +23 -23
- package/dist/suggestion-popover/index.js +198 -207
- package/dist/tiny-robot-svgs.js +11 -15
- package/package.json +3 -3
|
@@ -1,15 +1,38 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { d as
|
|
3
|
-
import { t as
|
|
4
|
-
import { _ as
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { computed as u, Fragment as R, ref as N, watch as $, defineComponent as G, useSlots as I, createElementBlock as E, openBlock as y, renderSlot as S, createVNode as F, renderList as U, unref as x, createBlock as k, resolveDynamicComponent as W, mergeProps as B, isVNode as Z, Transition as q, normalizeProps as J, guardReactiveProps as K, withCtx as Q, createCommentVNode as X, Teleport as Y, createElementVNode as ee } from "vue";
|
|
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;
|
|
10
33
|
});
|
|
11
34
|
}
|
|
12
|
-
const
|
|
35
|
+
const le = /* @__PURE__ */ G({
|
|
13
36
|
inheritAttrs: !1,
|
|
14
37
|
__name: "index",
|
|
15
38
|
props: {
|
|
@@ -22,87 +45,79 @@ const ce = /* @__PURE__ */ j({
|
|
|
22
45
|
transitionProps: {},
|
|
23
46
|
triggerEvents: {}
|
|
24
47
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const o =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
{ flush: "post" }
|
|
39
|
-
);
|
|
40
|
-
function N(e = {}, t) {
|
|
41
|
-
const r = {};
|
|
42
|
-
for (const [n, s] of Object.entries(e))
|
|
43
|
-
/^on[A-Z]/.test(n) && typeof s == "function" && (r[n] = (...f) => s(...f, t));
|
|
44
|
-
return r;
|
|
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;
|
|
45
60
|
}
|
|
46
|
-
const
|
|
47
|
-
() =>
|
|
48
|
-
),
|
|
49
|
-
var
|
|
61
|
+
const e = u(
|
|
62
|
+
() => v.value.map((t, l) => b(o.triggerEvents, l))
|
|
63
|
+
), a = N(null), d = u(() => {
|
|
64
|
+
var t, l;
|
|
50
65
|
return typeof o.offset == "number" ? { mainAxis: o.offset, crossAxis: 0 } : {
|
|
51
|
-
mainAxis: ((
|
|
52
|
-
crossAxis: ((
|
|
66
|
+
mainAxis: ((t = o.offset) == null ? void 0 : t.mainAxis) ?? 0,
|
|
67
|
+
crossAxis: ((l = o.offset) == null ? void 0 : l.crossAxis) ?? 0
|
|
53
68
|
};
|
|
54
|
-
}), { top:
|
|
55
|
-
const { placement:
|
|
56
|
-
if (!
|
|
57
|
-
|
|
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;
|
|
58
73
|
return;
|
|
59
74
|
}
|
|
60
|
-
const _ =
|
|
61
|
-
|
|
75
|
+
const _ = i === "top" || i === "bottom", L = _ ? "100dvh" : "100dvw", j = m(_ ? w.value : V.value);
|
|
76
|
+
n[i] = `clamp(0px, ${h}, calc(${L} - ${j}))`;
|
|
62
77
|
};
|
|
63
|
-
return
|
|
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;
|
|
64
79
|
});
|
|
65
|
-
|
|
80
|
+
$(
|
|
66
81
|
() => o.show,
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
82
|
+
(t) => {
|
|
83
|
+
t && M();
|
|
84
|
+
},
|
|
85
|
+
{ flush: "post" }
|
|
72
86
|
);
|
|
73
|
-
const D =
|
|
74
|
-
return
|
|
75
|
-
triggerRef:
|
|
76
|
-
triggerRefs:
|
|
77
|
-
popperRef:
|
|
78
|
-
}), (
|
|
79
|
-
(
|
|
80
|
-
key:
|
|
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,
|
|
81
95
|
ref_for: !0,
|
|
82
|
-
ref: (
|
|
83
|
-
}, { ref_for: !0 },
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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, {
|
|
87
102
|
key: 0,
|
|
88
|
-
to: o.appendTo ||
|
|
103
|
+
to: o.appendTo || x(D)
|
|
89
104
|
}, [
|
|
90
|
-
|
|
105
|
+
ee("div", B({
|
|
91
106
|
class: "tr-base-popper",
|
|
92
107
|
ref_key: "popperRef",
|
|
93
|
-
ref:
|
|
108
|
+
ref: a,
|
|
94
109
|
style: z.value
|
|
95
|
-
},
|
|
96
|
-
|
|
110
|
+
}, t.$attrs), [
|
|
111
|
+
S(t.$slots, "content", {}, void 0, !0)
|
|
97
112
|
], 16)
|
|
98
|
-
], 8, ["to"])) :
|
|
113
|
+
], 8, ["to"])) : X("", !0)
|
|
99
114
|
]),
|
|
100
115
|
_: 3
|
|
101
116
|
}, 16)
|
|
102
117
|
], 64));
|
|
103
118
|
}
|
|
104
|
-
}),
|
|
105
|
-
|
|
119
|
+
}), ie = /* @__PURE__ */ ne(le, [["__scopeId", "data-v-8baa02e5"]]);
|
|
120
|
+
ie.name = "TrBasePopper";
|
|
106
121
|
export {
|
|
107
|
-
|
|
122
|
+
ie as default
|
|
108
123
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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 b, createBlock as x, resolveDynamicComponent as B, toDisplayString as D, nextTick as G } from "vue";
|
|
2
2
|
import { U as H } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { b as X, o as j } from "../index2.js";
|
|
4
4
|
import { _ as J } from "../_plugin-vue_export-helper.js";
|
|
@@ -65,12 +65,12 @@ const K = ["onClick"], P = {
|
|
|
65
65
|
ref_key: "containerRef",
|
|
66
66
|
ref: y
|
|
67
67
|
}, [
|
|
68
|
-
(l(!0), a(
|
|
68
|
+
(l(!0), a(I, null, S(n.items, (e, f) => (l(), a(I, {
|
|
69
69
|
key: e.id
|
|
70
70
|
}, [
|
|
71
71
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
72
72
|
key: 0,
|
|
73
|
-
class:
|
|
73
|
+
class: b(["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)
|
|
@@ -79,10 +79,10 @@ const K = ["onClick"], P = {
|
|
|
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: b(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
|
|
86
86
|
ref_key: "moreButtonRef",
|
|
87
87
|
ref: w,
|
|
88
88
|
onClick: U,
|
|
@@ -91,7 +91,7 @@ const K = ["onClick"], P = {
|
|
|
91
91
|
}, [
|
|
92
92
|
(l(), x(B(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
93
93
|
], 34)),
|
|
94
|
-
|
|
94
|
+
C("div", {
|
|
95
95
|
class: "tr-flow-layout__dropdown-container",
|
|
96
96
|
onMouseenter: o[2] || (o[2] = (e) => v(!0)),
|
|
97
97
|
onMouseleave: o[3] || (o[3] = (e) => v(!1))
|
|
@@ -102,20 +102,20 @@ const K = ["onClick"], P = {
|
|
|
102
102
|
ref_key: "dropDownRef",
|
|
103
103
|
ref: k
|
|
104
104
|
}, [
|
|
105
|
-
(l(!0), a(
|
|
106
|
-
class:
|
|
105
|
+
(l(!0), a(I, null, S(z.value, (e) => (l(), a("button", {
|
|
106
|
+
class: b(["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
110
|
(l(), x(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)
|
|
114
114
|
], 32)
|
|
115
115
|
])
|
|
116
116
|
], 512));
|
|
117
117
|
}
|
|
118
|
-
}), p = /* @__PURE__ */ J(ee, [["__scopeId", "data-v-
|
|
118
|
+
}), p = /* @__PURE__ */ J(ee, [["__scopeId", "data-v-f82cf3dc"]]);
|
|
119
119
|
p.name = "TrFlowLayout";
|
|
120
120
|
const te = function(d) {
|
|
121
121
|
d.component(p.name, p);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { t as
|
|
1
|
+
import { defineComponent as r, computed as a, createElementBlock as u, openBlock as l, normalizeStyle as c, normalizeClass as p, createBlock as m, resolveDynamicComponent as d } from "vue";
|
|
2
|
+
import { t as i } from "../utils.js";
|
|
3
3
|
import { _ as f } from "../_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ r({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
7
|
icon: {},
|
|
@@ -9,24 +9,23 @@ const v = /* @__PURE__ */ p({
|
|
|
9
9
|
svgSize: { default: "16px" },
|
|
10
10
|
rounded: { type: Boolean }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const o = t, a = n(() => c(o.size)), r = n(() => c(o.svgSize));
|
|
18
|
-
return (i, z) => (s(), u("button", {
|
|
19
|
-
class: m(["tr-icon-button", { rounded: o.rounded }])
|
|
12
|
+
setup(o) {
|
|
13
|
+
const e = o, s = a(() => i(e.size)), n = a(() => i(e.svgSize));
|
|
14
|
+
return (z, h) => (l(), u("button", {
|
|
15
|
+
class: p(["tr-icon-button", { rounded: e.rounded }]),
|
|
16
|
+
style: c({ width: s.value, height: s.value })
|
|
20
17
|
}, [
|
|
21
|
-
(
|
|
22
|
-
|
|
18
|
+
(l(), m(d(e.icon), {
|
|
19
|
+
style: c({ width: n.value, height: n.value, fontSize: n.value })
|
|
20
|
+
}, null, 8, ["style"]))
|
|
21
|
+
], 6));
|
|
23
22
|
}
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
23
|
+
}), t = /* @__PURE__ */ f(_, [["__scopeId", "data-v-159698f7"]]);
|
|
24
|
+
t.name = "TrIconButton";
|
|
25
|
+
const v = function(o) {
|
|
26
|
+
o.component(t.name, t);
|
|
28
27
|
};
|
|
29
|
-
|
|
28
|
+
t.install = v;
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
t as default
|
|
32
31
|
};
|