@opentiny/tiny-robot 0.2.13 → 0.3.0-alpha.1

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