@opentiny/tiny-robot 0.2.0-alpha.8 → 0.2.0-alpha.9
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/dropdown-menu/index.js +49 -51
- package/dist/index.d.ts +4 -4
- package/dist/sender/index.js +933 -844
- package/dist/style.css +1 -1
- package/dist/suggestion-popover/index.js +113 -117
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { c as
|
|
3
|
-
import { t as
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as S, useCssVars as T, unref as M, ref as m, computed as R, watch as V, createElementBlock as o, openBlock as r, Fragment as p, createElementVNode as f, createVNode as B, renderSlot as E, Transition as N, withCtx as O, createCommentVNode as W, normalizeStyle as I, renderList as b, toDisplayString as z } from "vue";
|
|
2
|
+
import { c as _, o as F } from "../index2.js";
|
|
3
|
+
import { t as n } from "../utils.js";
|
|
4
|
+
import { _ as H } from "../_plugin-vue_export-helper.js";
|
|
5
|
+
const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__ */ S({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
8
8
|
items: {},
|
|
@@ -10,64 +10,62 @@ const U = { class: "tr-dropdown-menu__list" }, j = ["onClick"], q = /* @__PURE__
|
|
|
10
10
|
topOffset: { default: 0 }
|
|
11
11
|
},
|
|
12
12
|
emits: ["item-click"],
|
|
13
|
-
setup(
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
setup(l, { emit: w }) {
|
|
14
|
+
T((e) => ({
|
|
15
|
+
"90b2d29e": M(n)(a.minWidth)
|
|
16
16
|
}));
|
|
17
|
-
const
|
|
18
|
-
left: `min(${
|
|
19
|
-
top: `max(${
|
|
17
|
+
const a = l, t = m(!1), h = w, i = m(null), d = m(null), { x: v, y: g, update: k } = _(i), { width: x, height: C } = _(d), y = R(() => ({
|
|
18
|
+
left: `min(${n(v.value)}, 100% - ${n(x.value)})`,
|
|
19
|
+
top: `max(${n(g.value)} - ${n(C.value)} + ${n(a.topOffset)} - 8px, 0px)`
|
|
20
20
|
}));
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
(
|
|
24
|
-
}),
|
|
21
|
+
F(d, (e) => {
|
|
22
|
+
var c;
|
|
23
|
+
(c = i.value) != null && c.contains(e.target) && e.stopPropagation(), t.value = !1;
|
|
24
|
+
}), V(t, (e) => {
|
|
25
25
|
e && k();
|
|
26
26
|
});
|
|
27
|
-
const
|
|
27
|
+
const $ = () => {
|
|
28
28
|
t.value = !t.value;
|
|
29
|
-
},
|
|
30
|
-
t.value = !1,
|
|
29
|
+
}, D = (e) => {
|
|
30
|
+
t.value = !1, h("item-click", e);
|
|
31
31
|
};
|
|
32
|
-
return (e,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
return (e, c) => (r(), o(p, null, [
|
|
33
|
+
f("div", {
|
|
34
|
+
class: "tr-dropdown-menu__wrapper",
|
|
35
|
+
ref_key: "dropDownTriggerRef",
|
|
36
|
+
ref: i,
|
|
37
|
+
onClick: $
|
|
38
|
+
}, [
|
|
39
|
+
E(e.$slots, "default", {}, void 0, !0)
|
|
40
|
+
], 512),
|
|
41
|
+
B(N, { name: "tr-dropdown-menu" }, {
|
|
42
|
+
default: O(() => [
|
|
43
|
+
t.value ? (r(), o("div", {
|
|
42
44
|
key: 0,
|
|
43
|
-
|
|
45
|
+
class: "tr-dropdown-menu",
|
|
46
|
+
style: I(y.value),
|
|
47
|
+
ref_key: "dropdownMenuRef",
|
|
48
|
+
ref: d
|
|
44
49
|
}, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class: "tr-dropdown-menu__list-item",
|
|
54
|
-
key: c.id,
|
|
55
|
-
onClick: (G) => $(c)
|
|
56
|
-
}, H(c.text), 9, j))), 128))
|
|
57
|
-
])
|
|
58
|
-
], 4)
|
|
59
|
-
])) : O("", !0)
|
|
50
|
+
f("ul", L, [
|
|
51
|
+
(r(!0), o(p, null, b(a.items, (u) => (r(), o("li", {
|
|
52
|
+
class: "tr-dropdown-menu__list-item",
|
|
53
|
+
key: u.id,
|
|
54
|
+
onClick: (q) => D(u)
|
|
55
|
+
}, z(u.text), 9, P))), 128))
|
|
56
|
+
])
|
|
57
|
+
], 4)) : W("", !0)
|
|
60
58
|
]),
|
|
61
59
|
_: 1
|
|
62
60
|
})
|
|
63
|
-
],
|
|
61
|
+
], 64));
|
|
64
62
|
}
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
63
|
+
}), s = /* @__PURE__ */ H(U, [["__scopeId", "data-v-ce90a07c"]]);
|
|
64
|
+
s.name = "TrDropdownMenu";
|
|
65
|
+
const j = function(l) {
|
|
66
|
+
l.component(s.name, s);
|
|
69
67
|
};
|
|
70
|
-
|
|
68
|
+
s.install = j;
|
|
71
69
|
export {
|
|
72
|
-
|
|
70
|
+
s as default
|
|
73
71
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ popoverHeight: string | number;
|
|
|
89
89
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
90
90
|
popoverTriggerRef: HTMLDivElement;
|
|
91
91
|
popoverRef: HTMLDivElement;
|
|
92
|
-
},
|
|
92
|
+
}, any>;
|
|
93
93
|
|
|
94
94
|
declare const __VLS_component_2: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
95
95
|
"update:show": (value: boolean) => any;
|
|
@@ -109,7 +109,7 @@ topOffset: string | number;
|
|
|
109
109
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
110
110
|
dropDownTriggerRef: HTMLDivElement;
|
|
111
111
|
dropdownMenuRef: HTMLDivElement;
|
|
112
|
-
},
|
|
112
|
+
}, any>;
|
|
113
113
|
|
|
114
114
|
declare const __VLS_component_4: DefineComponent<PromptsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
115
115
|
"item-click": (ev: MouseEvent, item: PromptProps) => any;
|
|
@@ -895,7 +895,7 @@ declare function __VLS_template_11(): {
|
|
|
895
895
|
popoverTriggerRef: HTMLDivElement;
|
|
896
896
|
popoverRef: HTMLDivElement;
|
|
897
897
|
};
|
|
898
|
-
rootEl:
|
|
898
|
+
rootEl: any;
|
|
899
899
|
};
|
|
900
900
|
|
|
901
901
|
declare function __VLS_template_2(): {
|
|
@@ -912,7 +912,7 @@ declare function __VLS_template_3(): {
|
|
|
912
912
|
dropDownTriggerRef: HTMLDivElement;
|
|
913
913
|
dropdownMenuRef: HTMLDivElement;
|
|
914
914
|
};
|
|
915
|
-
rootEl:
|
|
915
|
+
rootEl: any;
|
|
916
916
|
};
|
|
917
917
|
|
|
918
918
|
declare function __VLS_template_4(): {
|