@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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as T, useCssVars as D, unref as S, ref as u, computed as B, watch as M, createElementBlock as m, openBlock as n, renderSlot as R, createVNode as V, Transition as b, withCtx as E, createBlock as N, createCommentVNode as O, Teleport as W, createElementVNode as p, normalizeStyle as I, Fragment as z, renderList as F, toDisplayString as H } from "vue";
2
- import { c as f, o as L } from "../index2.js";
3
- import { t as o } from "../utils.js";
4
- import { _ as P } from "../_plugin-vue_export-helper.js";
5
- const U = { class: "tr-dropdown-menu__list" }, j = ["onClick"], q = /* @__PURE__ */ T({
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(s, { emit: _ }) {
14
- D((e) => ({
15
- fb65405a: S(o)(l.minWidth)
13
+ setup(l, { emit: w }) {
14
+ T((e) => ({
15
+ "90b2d29e": M(n)(a.minWidth)
16
16
  }));
17
- const l = s, t = u(!1), w = _, a = u(null), i = u(null), { x: h, y: v, update: k } = f(a), { width: g, height: x } = f(i), y = B(() => ({
18
- left: `min(${o(h.value)}, 100% - ${o(g.value)})`,
19
- top: `max(${o(v.value)} - ${o(x.value)} + ${o(l.topOffset)} - 8px, 0px)`
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
- L(i, (e) => {
22
- var d;
23
- (d = a.value) != null && d.contains(e.target) && e.stopPropagation(), t.value = !1;
24
- }), M(t, (e) => {
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 C = () => {
27
+ const $ = () => {
28
28
  t.value = !t.value;
29
- }, $ = (e) => {
30
- t.value = !1, w("item-click", e);
29
+ }, D = (e) => {
30
+ t.value = !1, h("item-click", e);
31
31
  };
32
- return (e, d) => (n(), m("div", {
33
- class: "tr-dropdown-menu__wrapper",
34
- ref_key: "dropDownTriggerRef",
35
- ref: a,
36
- onClick: C
37
- }, [
38
- R(e.$slots, "default", {}, void 0, !0),
39
- V(b, { name: "tr-dropdown-menu" }, {
40
- default: E(() => [
41
- t.value ? (n(), N(W, {
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
- to: "body"
45
+ class: "tr-dropdown-menu",
46
+ style: I(y.value),
47
+ ref_key: "dropdownMenuRef",
48
+ ref: d
44
49
  }, [
45
- p("div", {
46
- class: "tr-dropdown-menu",
47
- style: I(y.value),
48
- ref_key: "dropdownMenuRef",
49
- ref: i
50
- }, [
51
- p("ul", U, [
52
- (n(!0), m(z, null, F(l.items, (c) => (n(), m("li", {
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
- ], 512));
61
+ ], 64));
64
62
  }
65
- }), r = /* @__PURE__ */ P(q, [["__scopeId", "data-v-740d1b6f"]]);
66
- r.name = "TrDropdownMenu";
67
- const A = function(s) {
68
- s.component(r.name, r);
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
- r.install = A;
68
+ s.install = j;
71
69
  export {
72
- r as default
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
- }, HTMLDivElement>;
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
- }, HTMLDivElement>;
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: HTMLDivElement;
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: HTMLDivElement;
915
+ rootEl: any;
916
916
  };
917
917
 
918
918
  declare function __VLS_template_4(): {