@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.
@@ -1,18 +1,18 @@
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";
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(f, g) {
6
- const t = u(() => {
7
- const e = (f == null ? void 0 : f()) || [], a = e.find((d) => d.type === R);
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
- }), 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) => {
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
- }, A = (e, a) => {
11
+ }, b = (e, a) => {
12
12
  c.value[a] = s(e);
13
13
  };
14
- return k(
15
- p,
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: x,
25
- setRefs: A
24
+ setRef: A,
25
+ setRefs: b
26
26
  };
27
27
  }
28
- function ae(f, g) {
28
+ function ae(p, g) {
29
29
  return u(() => {
30
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;
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__ */ j({
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(f, { expose: g }) {
49
- const t = f, p = G(), {
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: x
54
- } = se(p.trigger, t.renderAllTriggers);
55
- function A(o = {}, l) {
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(o))
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((o, l) => A(t.triggerEvents, l))
62
+ () => v.value.map((t, l) => b(o.triggerEvents, l))
63
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
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: $, 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) => {
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 V = i === "top" || i === "bottom", D = V ? "100dvh" : "100dvw", L = m(V ? w.value : _.value);
76
- n[i] = `clamp(0px, ${h}, calc(${D} - ${L}))`;
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 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;
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
- k(
81
- () => t.show,
82
- (o) => {
83
- o && H();
80
+ $(
81
+ () => o.show,
82
+ (t) => {
83
+ t && M();
84
84
  },
85
85
  { flush: "post" }
86
86
  );
87
- const z = ae(s);
87
+ const D = ae(s);
88
88
  return g({
89
89
  triggerRef: s,
90
90
  triggerRefs: c,
91
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,
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) => b(x)(i, r)
96
+ ref: (i) => x(A)(i, r)
97
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, {
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: t.appendTo || b(z)
103
+ to: o.appendTo || x(D)
103
104
  }, [
104
- Y("div", B({
105
+ ee("div", B({
105
106
  class: "tr-base-popper",
106
107
  ref_key: "popperRef",
107
108
  ref: a,
108
- style: M.value
109
- }, o.$attrs), [
110
- ee(o.$slots, "content", {}, void 0, !0)
109
+ style: z.value
110
+ }, t.$attrs), [
111
+ S(t.$slots, "content", {}, void 0, !0)
111
112
  ], 16)
112
- ], 8, ["to"])) : Q("", !0)
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-335d147d"]]);
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 b, Fragment as C, renderList as S, createCommentVNode as _, normalizeClass as I, createBlock as x, resolveDynamicComponent as B, toDisplayString as D, nextTick as G } from "vue";
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(C, null, S(n.items, (e, f) => (l(), a(C, {
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: I(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
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
- b("div", Q, [
82
+ C("div", Q, [
83
83
  m.value ? _("", !0) : (l(), a("button", {
84
84
  key: 0,
85
- class: I(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
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
- b("div", {
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(C, null, S(z.value, (e) => (l(), a("button", {
106
- class: I(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
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
- b("span", Z, D(e.label), 1)
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-3b70ef9f"]]);
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 p, useCssVars as l, computed as n, createElementBlock as u, openBlock as s, normalizeClass as m, createBlock as d, resolveDynamicComponent as _ } from "vue";
2
- import { t as c } from "../utils.js";
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 v = /* @__PURE__ */ p({
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(t) {
13
- l((i) => ({
14
- "72b46ad2": a.value,
15
- 66777814: r.value
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
- (s(), d(_(o.icon)))
22
- ], 2));
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
- }), e = /* @__PURE__ */ f(v, [["__scopeId", "data-v-fe8553bc"]]);
25
- e.name = "TrIconButton";
26
- const x = function(t) {
27
- t.component(e.name, e);
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
- e.install = x;
28
+ t.install = v;
30
29
  export {
31
- e as default
30
+ t as default
32
31
  };