@opentiny/tiny-robot 0.5.2-alpha.8 → 1.0.0-beta.0

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/index8.js CHANGED
@@ -1,64 +1,50 @@
1
- import { onMounted as U, nextTick as B, h as C, render as R, onBeforeUnmount as D, defineComponent as _, Teleport as W, computed as h, ref as E, openBlock as g, createBlock as F, Transition as j, normalizeProps as q, guardReactiveProps as L, withCtx as Z, createElementBlock as G, renderSlot as J, createCommentVNode as K, useSlots as Q, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as S, mergeProps as k, createVNode as te } from "vue";
2
- import { a as oe, d as re, c as ne } from "./index4.js";
3
- import { t as u } from "./utils.js";
4
- import { _ as N } from "./_plugin-vue_export-helper.js";
1
+ import { onMounted as W, nextTick as P, h as k, render as B, onBeforeUnmount as j, defineComponent as h, Teleport as D, ref as E, openBlock as x, createBlock as C, Transition as M, normalizeProps as Z, guardReactiveProps as q, withCtx as G, createElementBlock as J, renderSlot as K, createCommentVNode as L, useSlots as Q, computed as d, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as T, mergeProps as R, createVNode as te } from "vue";
2
+ import { d as oe, c as re } from "./index4.js";
3
+ import { t as l } from "./utils.js";
4
+ import { _ as F } from "./_plugin-vue_export-helper.js";
5
5
  import { u as se } from "./useSlotRefs.js";
6
- const pe = _({
7
- setup: (r) => () => C(W, r.propsFactory(), r.vnodeFactory()),
6
+ import { u as ne } from "./useTeleportTarget.js";
7
+ const pe = h({
8
+ setup: (r) => () => k(D, r.propsFactory(), r.vnodeFactory()),
8
9
  props: ["propsFactory", "vnodeFactory"]
9
10
  });
10
- function ae(r, n) {
11
- let e = null, t = null, s = !1;
12
- U(() => {
13
- B(() => {
14
- s || (t = document.createElement("div"), e = C(pe, { propsFactory: r, vnodeFactory: n }), R(e, t));
11
+ function ae(r, i) {
12
+ let t = null, o = null, c = !1;
13
+ W(() => {
14
+ P(() => {
15
+ c || (o = document.createElement("div"), t = k(pe, { propsFactory: r, vnodeFactory: i }), B(t, o));
15
16
  });
16
- }), D(() => {
17
- s = !0, B(() => {
18
- t && (R(null, t), t.remove(), e = null, t = null);
17
+ }), j(() => {
18
+ c = !0, P(() => {
19
+ o && (B(null, o), o.remove(), t = null, o = null);
19
20
  });
20
21
  });
21
22
  }
22
- function ce(r, n) {
23
- return h(() => {
24
- var v;
25
- if (n instanceof HTMLElement)
26
- return n;
27
- const e = n, t = oe(r), s = (v = t == null ? void 0 : t.getRootNode) == null ? void 0 : v.call(t), i = s instanceof ShadowRoot, d = i ? s : document.body;
28
- if (e) {
29
- if (!i && e === "body")
30
- return document.body;
31
- const f = d.querySelector(e);
32
- if (f instanceof Node) return f;
33
- }
34
- return d;
35
- });
36
- }
37
- const ie = /* @__PURE__ */ _({
23
+ const le = /* @__PURE__ */ h({
38
24
  __name: "Popper",
39
25
  props: {
40
26
  show: { type: Boolean },
41
27
  transitionProps: {}
42
28
  },
43
- setup(r, { expose: n }) {
44
- const e = E(null);
45
- return n({
46
- popperRef: e
47
- }), (t, s) => (g(), F(j, q(L(r.transitionProps)), {
48
- default: Z(() => [
49
- r.show ? (g(), G("div", {
29
+ setup(r, { expose: i }) {
30
+ const t = E(null);
31
+ return i({
32
+ popperRef: t
33
+ }), (o, c) => (x(), C(M, Z(q(r.transitionProps)), {
34
+ default: G(() => [
35
+ r.show ? (x(), J("div", {
50
36
  key: 0,
51
37
  class: "tr-base-popper",
52
38
  ref_key: "popperRef",
53
- ref: e
39
+ ref: t
54
40
  }, [
55
- J(t.$slots, "default", {}, void 0, !0)
56
- ], 512)) : K("", !0)
41
+ K(o.$slots, "default", {}, void 0, !0)
42
+ ], 512)) : L("", !0)
57
43
  ]),
58
44
  _: 3
59
45
  }, 16));
60
46
  }
61
- }), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */ _({
47
+ }), ie = /* @__PURE__ */ F(le, [["__scopeId", "data-v-25c13ab7"]]), ce = /* @__PURE__ */ h({
62
48
  inheritAttrs: !1,
63
49
  __name: "index",
64
50
  props: {
@@ -77,85 +63,84 @@ const ie = /* @__PURE__ */ _({
77
63
  triggerEvents: {}
78
64
  },
79
65
  setup(r, {
80
- expose: n
66
+ expose: i
81
67
  }) {
82
- const e = r, t = Q(), {
83
- vnodes: s,
84
- ref: i,
85
- setRef: d
86
- } = se(t.trigger), v = (o = {}) => {
87
- const p = {};
88
- for (const [c, a] of Object.entries(o))
89
- /^on[A-Z]/.test(c) && typeof a == "function" && (p[c] = a);
90
- return p;
91
- }, f = E(null), b = h(() => {
92
- var o;
93
- return ((o = f.value) == null ? void 0 : o.popperRef) || null;
94
- }), m = h(() => {
95
- var o, p;
96
- return typeof e.offset == "number" ? {
97
- mainAxis: e.offset,
68
+ const t = r, o = Q(), {
69
+ vnodes: c,
70
+ ref: f,
71
+ setRef: $
72
+ } = se(o.trigger), S = (e = {}) => {
73
+ const s = {};
74
+ for (const [p, n] of Object.entries(e))
75
+ /^on[A-Z]/.test(p) && typeof n == "function" && (s[p] = n);
76
+ return s;
77
+ }, g = E(null), y = d(() => {
78
+ var e;
79
+ return ((e = g.value) == null ? void 0 : e.popperRef) || null;
80
+ }), u = d(() => {
81
+ var e, s;
82
+ return typeof t.offset == "number" ? {
83
+ mainAxis: t.offset,
98
84
  crossAxis: 0
99
85
  } : {
100
- mainAxis: ((o = e.offset) == null ? void 0 : o.mainAxis) ?? 0,
101
- crossAxis: ((p = e.offset) == null ? void 0 : p.crossAxis) ?? 0
86
+ mainAxis: ((e = t.offset) == null ? void 0 : e.mainAxis) ?? 0,
87
+ crossAxis: ((s = t.offset) == null ? void 0 : s.crossAxis) ?? 0
102
88
  };
103
89
  }), {
104
- top: $,
90
+ top: V,
105
91
  bottom: O,
106
- left: w,
107
- right: V,
108
- width: z,
109
- update: A
110
- } = re(i), {
111
- width: x,
112
- height: P
113
- } = ne(b, void 0, {
92
+ left: _,
93
+ right: z,
94
+ width: I,
95
+ update: b
96
+ } = oe(f), {
97
+ width: m,
98
+ height: A
99
+ } = re(y, void 0, {
114
100
  box: "border-box"
115
- }), H = h(() => {
101
+ }), N = d(() => {
116
102
  const {
117
- placement: o,
118
- preventOverflow: p
119
- } = e, c = {}, a = (l, y) => {
120
- if (!p) {
121
- c[l] = y;
103
+ placement: e,
104
+ preventOverflow: s
105
+ } = t, p = {}, n = (a, v) => {
106
+ if (!s) {
107
+ p[a] = v;
122
108
  return;
123
109
  }
124
- const T = u(l === "top" ? P.value : x.value);
125
- l === "top" ? c[l] = `clamp(var(--tr-base-popper-min-top), ${y}, calc(var(--tr-base-popper-max-bottom) - ${T}))` : l === "left" && (c[l] = `clamp(var(--tr-base-popper-min-left), ${y}, calc(var(--tr-base-popper-max-right) - ${T}))`);
110
+ const w = l(a === "top" ? A.value : m.value);
111
+ a === "top" ? p[a] = `clamp(var(--tr-base-popper-min-top), ${v}, calc(var(--tr-base-popper-max-bottom) - ${w}))` : a === "left" && (p[a] = `clamp(var(--tr-base-popper-min-left), ${v}, calc(var(--tr-base-popper-max-right) - ${w}))`);
126
112
  };
127
- return o.includes("top") && a("top", u($.value - P.value - m.value.mainAxis)), o.includes("bottom") && a("top", u(O.value + m.value.mainAxis)), o.includes("left") && a("left", u(w.value + m.value.crossAxis)), o.includes("right") && a("left", u(V.value - x.value + m.value.crossAxis)), o.includes("center") && a("left", u(w.value + z.value / 2 - x.value / 2 + m.value.crossAxis)), c;
113
+ return e.includes("top") && n("top", l(V.value - A.value - u.value.mainAxis)), e.includes("bottom") && n("top", l(O.value + u.value.mainAxis)), e.includes("left") && n("left", l(_.value + u.value.crossAxis)), e.includes("right") && n("left", l(z.value - m.value + u.value.crossAxis)), e.includes("center") && n("left", l(_.value + I.value / 2 - m.value / 2 + u.value.crossAxis)), p;
128
114
  });
129
- X(() => e.show, (o) => {
130
- o && A();
115
+ X(() => t.show, (e) => {
116
+ e && b();
131
117
  }, {
132
118
  flush: "post"
133
119
  });
134
- const I = ce(i, e.appendTo), M = Y();
120
+ const U = ne(f, t.appendTo), H = Y();
135
121
  return ae(() => ({
136
- to: I.value
137
- }), () => te(le, k({
138
- ref: f,
139
- show: e.show,
140
- transitionProps: e.transitionProps,
141
- style: H.value
142
- }, M), {
122
+ to: U.value
123
+ }), () => te(ie, R({
124
+ ref: g,
125
+ show: t.show,
126
+ transitionProps: t.transitionProps,
127
+ style: N.value
128
+ }, H), {
143
129
  default: () => {
144
- var o;
145
- return [(o = t.content) == null ? void 0 : o.call(t)];
130
+ var e;
131
+ return [(e = o.content) == null ? void 0 : e.call(o)];
146
132
  }
147
- })), n({
148
- triggerRef: i,
149
- popperRef: b,
150
- update: A
151
- }), (o, p) => (g(), F(ee(S(s)[0]), k({
152
- ref: S(d)
153
- }, v(e.triggerEvents)), null, 16));
133
+ })), i({
134
+ triggerRef: f,
135
+ popperRef: y,
136
+ update: b
137
+ }), (e, s) => (x(), C(ee(T(c)[0]), R({
138
+ ref: T($)
139
+ }, S(t.triggerEvents)), null, 16));
154
140
  }
155
- }), fe = /* @__PURE__ */ N(ue, [["__scopeId", "data-v-f1e25842"]]);
156
- fe.name = "TrBasePopper";
141
+ }), ue = /* @__PURE__ */ F(ce, [["__scopeId", "data-v-f1e25842"]]);
142
+ ue.name = "TrBasePopper";
157
143
  export {
158
- fe as B,
159
- ae as c,
160
- ce as u
144
+ ue as B,
145
+ ae as c
161
146
  };
@@ -1,5 +1,5 @@
1
1
  import { toValue as q, shallowRef as A, computed as c, provide as ke, inject as Pe, defineComponent as k, openBlock as E, createElementBlock as I, normalizeClass as K, createElementVNode as B, ref as te, createBlock as G, createCommentVNode as N, renderSlot as $, Fragment as Me, renderList as Ne, useAttrs as $e, watch as _e, Teleport as Be, mergeProps as Ye, unref as Z, createVNode as Xe, useSlots as Ve, isRef as Ge, normalizeStyle as be, withCtx as pe, normalizeProps as Ue, guardReactiveProps as qe, createTextVNode as Ze, toDisplayString as je, onBeforeUnmount as Ke } from "vue";
2
- import { g as V, t as Je, m as Qe, b as et, a as tt, j as Se, n as nt } from "../index4.js";
2
+ import { g as V, t as Je, m as Qe, b as et, u as tt, j as Se, n as nt } from "../index4.js";
3
3
  import { _ as Y } from "../_plugin-vue_export-helper.js";
4
4
  function ze(e) {
5
5
  const t = q(e.value) !== void 0, n = A(q(e.defaultValue));