@opentiny/tiny-robot 0.2.0-alpha.5 → 0.2.0-alpha.7

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