@opentiny/tiny-robot 0.3.0-alpha.3 → 0.3.0-alpha.4

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,7 +1,7 @@
1
- import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as x, nextTick as W, createElementBlock as _, openBlock as n, createBlock as v, createCommentVNode as N, Fragment as R, renderList as G, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as I, renderSlot as L, createVNode as E, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, toDisplayString as Q, vShow as U } from "vue";
2
- import { x as Y } from "../tiny-robot-svgs.js";
3
- import { T as M } from "../index4.js";
4
- import { o as Z, a as ee } from "../index2.js";
1
+ import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as N, nextTick as W, createElementBlock as _, openBlock as o, createBlock as v, createCommentVNode as R, Fragment as G, renderList as I, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as x, renderSlot as L, createVNode as E, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, toDisplayString as Q, vShow as U } from "vue";
2
+ import { c as Y } from "../tiny-robot-svgs.js";
3
+ import { T as M } from "../index5.js";
4
+ import { o as Z, b as ee } from "../index2.js";
5
5
  import te from "../icon-button/index.js";
6
6
  import { _ as oe } from "../_plugin-vue_export-helper.js";
7
7
  const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae = { class: "tr-action-group__dropdown-item-text" }, ce = /* @__PURE__ */ $({
@@ -12,45 +12,48 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
12
12
  dropDownShowLabelOnly: { type: Boolean }
13
13
  },
14
14
  emits: ["item-click"],
15
- setup(l, { emit: k }) {
16
- const a = l, F = H(), O = k, p = i(() => {
17
- var o, t;
15
+ setup(r, { emit: k }) {
16
+ const l = r, F = H(), O = k, p = i(() => {
17
+ var a, t;
18
18
  const e = F.default();
19
- return Array.isArray(e) ? e.length === 1 && ((o = e[0].type) == null ? void 0 : o.toString()) === "Symbol(v-fgt)" ? e[0].children : e : ((t = e.type) == null ? void 0 : t.toString()) === "Symbol(v-fgt)" ? e.children : [e];
20
- }), y = i(() => {
21
- const e = a.maxNum ?? Number.MAX_SAFE_INTEGER;
19
+ return Array.isArray(e) ? e.length === 1 && ((a = e[0].type) == null ? void 0 : a.toString()) === "Symbol(v-fgt)" ? e[0].children : e : ((t = e.type) == null ? void 0 : t.toString()) === "Symbol(v-fgt)" ? e.children : [e];
20
+ }), b = i(() => {
21
+ const e = l.maxNum ?? Number.MAX_SAFE_INTEGER;
22
22
  return e > 0 ? e : Number.MAX_SAFE_INTEGER;
23
- }), b = i(() => p.value.length > y.value), V = i(() => b.value ? p.value.slice(0, y.value) : p.value), z = i(() => b.value ? p.value.slice(y.value) : []), m = f(null), d = f(null), r = f(!1), P = () => {
24
- r.value = !r.value;
23
+ }), y = i(() => p.value.length > b.value), V = i(() => y.value ? p.value.slice(0, b.value) : p.value), z = i(() => y.value ? p.value.slice(b.value) : []), m = f(null), d = f(null), n = f(!1), P = () => {
24
+ n.value = !n.value;
25
25
  };
26
- Z(d, (e) => {
27
- var o;
28
- (o = m.value) != null && o.contains(e.target) || (r.value = !1);
29
- });
26
+ Z(
27
+ d,
28
+ () => {
29
+ n.value = !1;
30
+ },
31
+ { ignore: [m] }
32
+ );
30
33
  const A = (e) => {
31
- O("item-click", e), r.value = !1;
34
+ O("item-click", e), n.value = !1;
32
35
  }, B = f("placement-bottom"), { height: D } = ee(), T = () => {
33
36
  if (!d.value || !m.value)
34
37
  return "placement-bottom";
35
- const e = d.value.getBoundingClientRect(), o = m.value.getBoundingClientRect();
36
- B.value = o.bottom + e.height + 16 > D.value ? "placement-top" : "placement-bottom";
38
+ const e = d.value.getBoundingClientRect(), a = m.value.getBoundingClientRect();
39
+ B.value = a.bottom + e.height + 16 > D.value ? "placement-top" : "placement-bottom";
37
40
  };
38
- return x(r, (e) => {
41
+ return N(n, (e) => {
39
42
  e && W(() => {
40
43
  T();
41
44
  });
42
- }), x(D, () => {
43
- r.value && T();
44
- }), (e, o) => (n(), _("div", ne, [
45
- (n(!0), _(R, null, G(V.value, (t, C) => {
45
+ }), N(D, () => {
46
+ n.value && T();
47
+ }), (e, a) => (o(), _("div", ne, [
48
+ (o(!0), _(G, null, I(V.value, (t, C) => {
46
49
  var c;
47
- return n(), v(h(M), {
50
+ return o(), v(h(M), {
48
51
  key: C,
49
52
  content: (c = t.props) == null ? void 0 : c.label,
50
53
  effect: "dark",
51
54
  placement: "top",
52
55
  "open-delay": 500,
53
- disabled: !a.showTooltip
56
+ disabled: !l.showTooltip
54
57
  }, {
55
58
  default: S(() => [
56
59
  w("span", {
@@ -60,19 +63,19 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
60
63
  return A((s = t.props) == null ? void 0 : s.name);
61
64
  }
62
65
  }, [
63
- (n(), v(I(t)))
66
+ (o(), v(x(t)))
64
67
  ], 8, re)
65
68
  ]),
66
69
  _: 2
67
70
  }, 1032, ["content", "disabled"]);
68
71
  }), 128)),
69
- b.value ? (n(), v(h(M), {
72
+ y.value ? (o(), v(h(M), {
70
73
  key: 0,
71
74
  content: "更多",
72
75
  effect: "dark",
73
76
  placement: "top",
74
77
  "open-delay": 500,
75
- disabled: !a.showTooltip
78
+ disabled: !l.showTooltip
76
79
  }, {
77
80
  default: S(() => [
78
81
  w("span", {
@@ -91,9 +94,9 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
91
94
  ref: d,
92
95
  class: J(["tr-action-group__dropdown", B.value])
93
96
  }, [
94
- (n(!0), _(R, null, G(z.value, (t, C) => {
97
+ (o(!0), _(G, null, I(z.value, (t, C) => {
95
98
  var c;
96
- return n(), _("li", {
99
+ return o(), _("li", {
97
100
  class: "tr-action-group__dropdown-item",
98
101
  key: C,
99
102
  onClick: K((X) => {
@@ -101,12 +104,12 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
101
104
  return A((s = t.props) == null ? void 0 : s.name);
102
105
  }, ["stop"])
103
106
  }, [
104
- a.dropDownShowLabelOnly ? N("", !0) : (n(), v(I(t), { key: 0 })),
107
+ l.dropDownShowLabelOnly ? R("", !0) : (o(), v(x(t), { key: 0 })),
105
108
  w("span", ae, Q((c = t.props) == null ? void 0 : c.label), 1)
106
109
  ], 8, le);
107
110
  }), 128))
108
111
  ], 2), [
109
- [U, r.value]
112
+ [U, n.value]
110
113
  ])
111
114
  ]),
112
115
  _: 1
@@ -114,27 +117,27 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
114
117
  ], 512)
115
118
  ]),
116
119
  _: 3
117
- }, 8, ["disabled"])) : N("", !0)
120
+ }, 8, ["disabled"])) : R("", !0)
118
121
  ]));
119
122
  }
120
- }), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-f3138789"]]), u = /* @__PURE__ */ $({
123
+ }), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-f8531261"]]), u = /* @__PURE__ */ $({
121
124
  __name: "ActionGroupItem",
122
125
  props: {
123
126
  name: {},
124
127
  label: {}
125
128
  },
126
- setup(l) {
127
- return (k, a) => L(k.$slots, "default");
129
+ setup(r) {
130
+ return (k, l) => L(k.$slots, "default");
128
131
  }
129
132
  });
130
133
  g.name = "TrActionGroup";
131
- const se = function(l) {
132
- l.component(g.name, g);
134
+ const se = function(r) {
135
+ r.component(g.name, g);
133
136
  };
134
137
  g.install = se;
135
138
  u.name = "TrActionGroupItem";
136
- const ie = function(l) {
137
- l.component(u.name, u);
139
+ const ie = function(r) {
140
+ r.component(u.name, u);
138
141
  };
139
142
  u.install = ie;
140
143
  const ve = u;
@@ -0,0 +1,4 @@
1
+ import { B as f } from "../index3.js";
2
+ export {
3
+ f as default
4
+ };