@opentiny/tiny-robot 0.2.13 → 0.2.14
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 +88 -74
- package/dist/index.d.ts +152 -715
- package/dist/index.js +33 -41
- package/dist/sender/index.js +674 -676
- package/dist/style.css +1 -1
- 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 k, defineComponent as j, useSlots as G, createElementBlock as E, openBlock as y, createVNode as I, renderList as F, unref as b, createBlock as S, resolveDynamicComponent as U, mergeProps as B, isVNode as W, Transition as Z, normalizeProps as q, guardReactiveProps as J, withCtx as K, createCommentVNode as Q, Teleport as X, createElementVNode as Y, renderSlot 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(f, g) {
|
|
6
|
+
const t = u(() => {
|
|
7
|
+
const e = (f == null ? void 0 : f()) || [], a = e.find((d) => d.type === R);
|
|
8
|
+
return a && Array.isArray(a.children) ? a.children : e;
|
|
9
|
+
}), p = u(() => g ? t.value.length : 1), v = u(() => t.value.slice(0, p.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), x = (e) => {
|
|
10
|
+
c.value[0] = s(e);
|
|
11
|
+
}, A = (e, a) => {
|
|
12
|
+
c.value[a] = s(e);
|
|
13
|
+
};
|
|
14
|
+
return k(
|
|
15
|
+
p,
|
|
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: x,
|
|
25
|
+
setRefs: A
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function ae(f, g) {
|
|
29
|
+
return u(() => {
|
|
30
|
+
var s;
|
|
31
|
+
const t = te(f), p = (s = t == null ? void 0 : t.getRootNode) == null ? void 0 : s.call(t);
|
|
32
|
+
return p instanceof ShadowRoot ? p : document.body;
|
|
10
33
|
});
|
|
11
34
|
}
|
|
12
|
-
const
|
|
35
|
+
const le = /* @__PURE__ */ j({
|
|
13
36
|
inheritAttrs: !1,
|
|
14
37
|
__name: "index",
|
|
15
38
|
props: {
|
|
@@ -22,87 +45,78 @@ const ce = /* @__PURE__ */ j({
|
|
|
22
45
|
transitionProps: {},
|
|
23
46
|
triggerEvents: {}
|
|
24
47
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
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(f, { expose: g }) {
|
|
49
|
+
const t = f, p = G(), {
|
|
50
|
+
vnodes: v,
|
|
51
|
+
refs: c,
|
|
52
|
+
ref: s,
|
|
53
|
+
setRefs: x
|
|
54
|
+
} = se(p.trigger, t.renderAllTriggers);
|
|
55
|
+
function A(o = {}, l) {
|
|
56
|
+
const n = {};
|
|
57
|
+
for (const [r, i] of Object.entries(o))
|
|
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
|
|
50
|
-
return typeof
|
|
51
|
-
mainAxis: ((
|
|
52
|
-
crossAxis: ((
|
|
61
|
+
const e = u(
|
|
62
|
+
() => v.value.map((o, l) => A(t.triggerEvents, l))
|
|
63
|
+
), a = N(null), d = u(() => {
|
|
64
|
+
var o, l;
|
|
65
|
+
return typeof t.offset == "number" ? { mainAxis: t.offset, crossAxis: 0 } : {
|
|
66
|
+
mainAxis: ((o = t.offset) == null ? void 0 : o.mainAxis) ?? 0,
|
|
67
|
+
crossAxis: ((l = t.offset) == null ? void 0 : l.crossAxis) ?? 0
|
|
53
68
|
};
|
|
54
|
-
}), { top:
|
|
55
|
-
const { placement:
|
|
56
|
-
if (!
|
|
57
|
-
|
|
69
|
+
}), { top: $, bottom: P, left: T, right: O, width: C, update: H } = oe(s), { width: _, height: w } = re(a, void 0, { box: "border-box" }), M = u(() => {
|
|
70
|
+
const { placement: o, preventOverflow: l } = t, n = {}, r = (i, h) => {
|
|
71
|
+
if (!l) {
|
|
72
|
+
n[i] = h;
|
|
58
73
|
return;
|
|
59
74
|
}
|
|
60
|
-
const
|
|
61
|
-
|
|
75
|
+
const V = i === "top" || i === "bottom", D = V ? "100dvh" : "100dvw", L = m(V ? w.value : _.value);
|
|
76
|
+
n[i] = `clamp(0px, ${h}, calc(${D} - ${L}))`;
|
|
62
77
|
};
|
|
63
|
-
return
|
|
78
|
+
return o.includes("top") && r("top", m($.value - w.value - d.value.mainAxis)), o.includes("bottom") && r("bottom", `calc(100% - ${m(P.value + w.value + d.value.mainAxis)})`), o.includes("left") && r("left", m(T.value + d.value.crossAxis)), o.includes("right") && r("right", `calc(100% - ${m(O.value + d.value.crossAxis)})`), o.includes("center") && r("left", m(T.value + C.value / 2 - _.value / 2 + d.value.crossAxis)), n;
|
|
64
79
|
});
|
|
65
|
-
|
|
66
|
-
() =>
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
80
|
+
k(
|
|
81
|
+
() => t.show,
|
|
82
|
+
(o) => {
|
|
83
|
+
o && H();
|
|
84
|
+
},
|
|
85
|
+
{ flush: "post" }
|
|
72
86
|
);
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
-
triggerRef:
|
|
76
|
-
triggerRefs:
|
|
77
|
-
popperRef:
|
|
78
|
-
}), (
|
|
79
|
-
(
|
|
80
|
-
key:
|
|
87
|
+
const z = ae(s);
|
|
88
|
+
return g({
|
|
89
|
+
triggerRef: s,
|
|
90
|
+
triggerRefs: c,
|
|
91
|
+
popperRef: a
|
|
92
|
+
}), (o, l) => (y(), E(R, null, [
|
|
93
|
+
(y(!0), E(R, null, F(b(v), (n, r) => (y(), S(U(n), B({
|
|
94
|
+
key: W(n) ? n.key : r,
|
|
81
95
|
ref_for: !0,
|
|
82
|
-
ref: (
|
|
83
|
-
}, { ref_for: !0 },
|
|
84
|
-
|
|
85
|
-
default:
|
|
86
|
-
|
|
96
|
+
ref: (i) => b(x)(i, r)
|
|
97
|
+
}, { ref_for: !0 }, e.value[r]), null, 16))), 128)),
|
|
98
|
+
I(Z, q(J(o.transitionProps)), {
|
|
99
|
+
default: K(() => [
|
|
100
|
+
o.show ? (y(), S(X, {
|
|
87
101
|
key: 0,
|
|
88
|
-
to:
|
|
102
|
+
to: t.appendTo || b(z)
|
|
89
103
|
}, [
|
|
90
|
-
|
|
104
|
+
Y("div", B({
|
|
91
105
|
class: "tr-base-popper",
|
|
92
106
|
ref_key: "popperRef",
|
|
93
|
-
ref:
|
|
94
|
-
style:
|
|
95
|
-
},
|
|
96
|
-
|
|
107
|
+
ref: a,
|
|
108
|
+
style: M.value
|
|
109
|
+
}, o.$attrs), [
|
|
110
|
+
ee(o.$slots, "content", {}, void 0, !0)
|
|
97
111
|
], 16)
|
|
98
|
-
], 8, ["to"])) :
|
|
112
|
+
], 8, ["to"])) : Q("", !0)
|
|
99
113
|
]),
|
|
100
114
|
_: 3
|
|
101
115
|
}, 16)
|
|
102
116
|
], 64));
|
|
103
117
|
}
|
|
104
|
-
}),
|
|
105
|
-
|
|
118
|
+
}), ie = /* @__PURE__ */ ne(le, [["__scopeId", "data-v-335d147d"]]);
|
|
119
|
+
ie.name = "TrBasePopper";
|
|
106
120
|
export {
|
|
107
|
-
|
|
121
|
+
ie as default
|
|
108
122
|
};
|