@opentiny/tiny-robot 0.2.14 → 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 +50 -49
- package/dist/flow-layout-buttons/index.js +10 -10
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +223 -1060
- package/dist/index3.js +33 -25
- package/dist/index5.js +179 -180
- package/dist/index6.js +610 -613
- package/dist/sender/index.js +761 -756
- 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,18 +1,18 @@
|
|
|
1
|
-
import { computed as u, Fragment as R, ref as N, watch as
|
|
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
2
|
import { d as te, e as oe, b as re } from "../index2.js";
|
|
3
3
|
import { t as m } from "../utils.js";
|
|
4
4
|
import { _ as ne } from "../_plugin-vue_export-helper.js";
|
|
5
|
-
function se(
|
|
6
|
-
const
|
|
7
|
-
const e = (
|
|
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
8
|
return a && Array.isArray(a.children) ? a.children : e;
|
|
9
|
-
}),
|
|
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
10
|
c.value[0] = s(e);
|
|
11
|
-
},
|
|
11
|
+
}, b = (e, a) => {
|
|
12
12
|
c.value[a] = s(e);
|
|
13
13
|
};
|
|
14
|
-
return
|
|
15
|
-
|
|
14
|
+
return $(
|
|
15
|
+
f,
|
|
16
16
|
(e) => {
|
|
17
17
|
c.value.length = e;
|
|
18
18
|
},
|
|
@@ -21,18 +21,18 @@ function se(f, g) {
|
|
|
21
21
|
vnodes: v,
|
|
22
22
|
ref: u(() => c.value.at(0)),
|
|
23
23
|
refs: c,
|
|
24
|
-
setRef:
|
|
25
|
-
setRefs:
|
|
24
|
+
setRef: A,
|
|
25
|
+
setRefs: b
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
function ae(
|
|
28
|
+
function ae(p, g) {
|
|
29
29
|
return u(() => {
|
|
30
30
|
var s;
|
|
31
|
-
const
|
|
32
|
-
return
|
|
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
33
|
});
|
|
34
34
|
}
|
|
35
|
-
const le = /* @__PURE__ */
|
|
35
|
+
const le = /* @__PURE__ */ G({
|
|
36
36
|
inheritAttrs: !1,
|
|
37
37
|
__name: "index",
|
|
38
38
|
props: {
|
|
@@ -45,77 +45,78 @@ const le = /* @__PURE__ */ j({
|
|
|
45
45
|
transitionProps: {},
|
|
46
46
|
triggerEvents: {}
|
|
47
47
|
},
|
|
48
|
-
setup(
|
|
49
|
-
const
|
|
48
|
+
setup(p, { expose: g }) {
|
|
49
|
+
const o = p, f = I(), {
|
|
50
50
|
vnodes: v,
|
|
51
51
|
refs: c,
|
|
52
52
|
ref: s,
|
|
53
|
-
setRefs:
|
|
54
|
-
} = se(
|
|
55
|
-
function
|
|
53
|
+
setRefs: A
|
|
54
|
+
} = se(f.trigger, o.renderAllTriggers);
|
|
55
|
+
function b(t = {}, l) {
|
|
56
56
|
const n = {};
|
|
57
|
-
for (const [r, i] of Object.entries(
|
|
57
|
+
for (const [r, i] of Object.entries(t))
|
|
58
58
|
/^on[A-Z]/.test(r) && typeof i == "function" && (n[r] = (...h) => i(...h, l));
|
|
59
59
|
return n;
|
|
60
60
|
}
|
|
61
61
|
const e = u(
|
|
62
|
-
() => v.value.map((
|
|
62
|
+
() => v.value.map((t, l) => b(o.triggerEvents, l))
|
|
63
63
|
), a = N(null), d = u(() => {
|
|
64
|
-
var
|
|
65
|
-
return typeof
|
|
66
|
-
mainAxis: ((
|
|
67
|
-
crossAxis: ((l =
|
|
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
68
|
};
|
|
69
|
-
}), { top:
|
|
70
|
-
const { placement:
|
|
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
71
|
if (!l) {
|
|
72
72
|
n[i] = h;
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
n[i] = `clamp(0px, ${h}, calc(${
|
|
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
77
|
};
|
|
78
|
-
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;
|
|
79
79
|
});
|
|
80
|
-
|
|
81
|
-
() =>
|
|
82
|
-
(
|
|
83
|
-
|
|
80
|
+
$(
|
|
81
|
+
() => o.show,
|
|
82
|
+
(t) => {
|
|
83
|
+
t && M();
|
|
84
84
|
},
|
|
85
85
|
{ flush: "post" }
|
|
86
86
|
);
|
|
87
|
-
const
|
|
87
|
+
const D = ae(s);
|
|
88
88
|
return g({
|
|
89
89
|
triggerRef: s,
|
|
90
90
|
triggerRefs: c,
|
|
91
91
|
popperRef: a
|
|
92
|
-
}), (
|
|
93
|
-
(y(!0), E(R, null,
|
|
94
|
-
key:
|
|
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
95
|
ref_for: !0,
|
|
96
|
-
ref: (i) =>
|
|
96
|
+
ref: (i) => x(A)(i, r)
|
|
97
97
|
}, { ref_for: !0 }, e.value[r]), null, 16))), 128)),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
S(t.$slots, "backdrop", {}, void 0, !0),
|
|
99
|
+
F(q, J(K(t.transitionProps)), {
|
|
100
|
+
default: Q(() => [
|
|
101
|
+
t.show ? (y(), k(Y, {
|
|
101
102
|
key: 0,
|
|
102
|
-
to:
|
|
103
|
+
to: o.appendTo || x(D)
|
|
103
104
|
}, [
|
|
104
|
-
|
|
105
|
+
ee("div", B({
|
|
105
106
|
class: "tr-base-popper",
|
|
106
107
|
ref_key: "popperRef",
|
|
107
108
|
ref: a,
|
|
108
|
-
style:
|
|
109
|
-
},
|
|
110
|
-
|
|
109
|
+
style: z.value
|
|
110
|
+
}, t.$attrs), [
|
|
111
|
+
S(t.$slots, "content", {}, void 0, !0)
|
|
111
112
|
], 16)
|
|
112
|
-
], 8, ["to"])) :
|
|
113
|
+
], 8, ["to"])) : X("", !0)
|
|
113
114
|
]),
|
|
114
115
|
_: 3
|
|
115
116
|
}, 16)
|
|
116
117
|
], 64));
|
|
117
118
|
}
|
|
118
|
-
}), ie = /* @__PURE__ */ ne(le, [["__scopeId", "data-v-
|
|
119
|
+
}), ie = /* @__PURE__ */ ne(le, [["__scopeId", "data-v-8baa02e5"]]);
|
|
119
120
|
ie.name = "TrBasePopper";
|
|
120
121
|
export {
|
|
121
122
|
ie as default
|
|
@@ -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
|
};
|