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

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 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 L, 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 { V as Z } from "../tiny-robot-svgs.js";
3
- import { T as V } from "../index4.js";
4
- import { o as ee, a as te } from "../index2.js";
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
5
  import oe from "../icon-button/index.js";
6
6
  import { _ as ne } from "../_plugin-vue_export-helper.js";
7
- const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce = { class: "tr-action-group__dropdown-item-text" }, se = /* @__PURE__ */ $({
7
+ const re = { class: "tr-action-group" }, le = ["onClick"], ae = ["onClick"], ce = { class: "tr-action-group__dropdown-item-text" }, se = /* @__PURE__ */ L({
8
8
  __name: "ActionGroup",
9
9
  props: {
10
10
  maxNum: {},
@@ -12,13 +12,13 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
12
12
  dropDownShowLabelOnly: { type: Boolean }
13
13
  },
14
14
  emits: ["item-click"],
15
- setup(a, { emit: h }) {
16
- const l = a, F = W(), O = h, p = i(() => {
15
+ setup(l, { emit: h }) {
16
+ const a = l, O = W(), V = h, p = i(() => {
17
17
  var o, t;
18
- const e = F.default();
18
+ const e = O.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
20
  }), w = 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
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 = () => {
24
24
  r.value = !r.value;
@@ -28,7 +28,7 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
28
28
  (o = b.value) != null && o.contains(e.target) || (r.value = !1);
29
29
  });
30
30
  const S = (e) => {
31
- O("item-click", e), r.value = !1;
31
+ V("item-click", e), r.value = !1;
32
32
  }, A = R("placement-bottom"), { height: B } = te(), D = () => {
33
33
  if (!k.value || !b.value)
34
34
  return "placement-bottom";
@@ -44,13 +44,13 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
44
44
  }), (e, o) => (n(), m("div", re, [
45
45
  (n(!0), m(I, null, x(z.value, (t, y) => {
46
46
  var c;
47
- return n(), d(f(V), {
47
+ return n(), d(f($), {
48
48
  key: y,
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
- disabled: !l.showTooltip
53
+ disabled: !a.showTooltip
54
54
  }, {
55
55
  default: C(() => [
56
56
  _("span", {
@@ -61,18 +61,18 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
61
61
  }
62
62
  }, [
63
63
  (n(), d(E(t)))
64
- ], 8, ae)
64
+ ], 8, le)
65
65
  ]),
66
66
  _: 2
67
67
  }, 1032, ["content", "disabled"]);
68
68
  }), 128)),
69
- g.value ? (n(), d(f(V), {
69
+ g.value ? (n(), d(f($), {
70
70
  key: 0,
71
71
  content: "更多",
72
72
  effect: "dark",
73
73
  placement: "top",
74
74
  "open-delay": 500,
75
- disabled: !l.showTooltip
75
+ disabled: !a.showTooltip
76
76
  }, {
77
77
  default: C(() => [
78
78
  _("span", {
@@ -80,7 +80,7 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
80
80
  class: "tr-action-group__btn-wrapper",
81
81
  onClick: X
82
82
  }, [
83
- L(e.$slots, "moreBtn", {}, () => [
83
+ F(e.$slots, "moreBtn", {}, () => [
84
84
  M(f(oe), { icon: f(Z) }, null, 8, ["icon"])
85
85
  ], !0),
86
86
  M(q, { name: "tr-action-group-dropdown" }, {
@@ -99,9 +99,9 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
99
99
  return S((s = t.props) == null ? void 0 : s.name);
100
100
  }, ["stop"])
101
101
  }, [
102
- l.dropDownShowLabelOnly ? G("", !0) : (n(), d(E(t), { key: 0 })),
102
+ a.dropDownShowLabelOnly ? G("", !0) : (n(), d(E(t), { key: 0 })),
103
103
  _("span", ce, U((c = t.props) == null ? void 0 : c.label), 1)
104
- ], 8, le);
104
+ ], 8, ae);
105
105
  }), 128))
106
106
  ], 2), [
107
107
  [Y, r.value]
@@ -115,24 +115,24 @@ const re = { class: "tr-action-group" }, ae = ["onClick"], le = ["onClick"], ce
115
115
  }, 8, ["disabled"])) : G("", !0)
116
116
  ]));
117
117
  }
118
- }), v = /* @__PURE__ */ ne(se, [["__scopeId", "data-v-43d0f1ba"]]), u = /* @__PURE__ */ $({
118
+ }), v = /* @__PURE__ */ ne(se, [["__scopeId", "data-v-43d0f1ba"]]), u = /* @__PURE__ */ L({
119
119
  __name: "ActionGroupItem",
120
120
  props: {
121
121
  name: {},
122
122
  label: {}
123
123
  },
124
- setup(a) {
125
- return (h, l) => L(h.$slots, "default");
124
+ setup(l) {
125
+ return (h, a) => F(h.$slots, "default");
126
126
  }
127
127
  });
128
128
  v.name = "TrActionGroup";
129
- const ie = function(a) {
130
- a.component(v.name, v);
129
+ const ie = function(l) {
130
+ l.component(v.name, v);
131
131
  };
132
132
  v.install = ie;
133
133
  u.name = "TrActionGroupItem";
134
- const ue = function(a) {
135
- a.component(u.name, u);
134
+ const ue = function(l) {
135
+ l.component(u.name, u);
136
136
  };
137
137
  u.install = ue;
138
138
  const he = u;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as c0, useCssVars as L0, useSlots as P0, computed as au, createElementBlock as L, openBlock as S, normalizeClass as i0, createCommentVNode as _u, createElementVNode as Z, createBlock as yu, resolveDynamicComponent as o0, renderSlot as mu, toDisplayString as O0, useTemplateRef as N0, watch as $0, Fragment as j0, renderList as Ou, mergeProps as Nu, createSlots as U0, withCtx as Z0 } from "vue";
2
2
  import { _ as a0 } from "../_plugin-vue_export-helper.js";
3
- import { u as H0 } from "../index2.js";
3
+ import { d as H0 } from "../index3.js";
4
4
  const $u = {};
5
5
  function V0(u) {
6
6
  let e = $u[u];
package/dist/close.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l as o } from "./index6.js";
1
+ import { s as o } from "./index2.js";
2
2
  import { createElementBlock as n, openBlock as r, createElementVNode as t } from "vue";
3
3
  var c = {
4
4
  viewBox: "0 0 16 16",
@@ -1,8 +1,8 @@
1
- import { defineComponent as m, useCssVars as v, useModel as c, computed as _, createElementBlock as w, openBlock as g, createElementVNode as n, renderSlot as r, createVNode as u, unref as a } from "vue";
2
- import { Z as h, E as $, y as C } from "../tiny-robot-svgs.js";
1
+ import { defineComponent as m, useCssVars as v, useModel as c, computed as _, createElementBlock as $, openBlock as w, createElementVNode as n, renderSlot as r, createVNode as u, unref as a } from "vue";
2
+ import { $ as g, i as h, t as C } from "../tiny-robot-svgs.js";
3
3
  import d from "../icon-button/index.js";
4
4
  import { _ as b } from "../_plugin-vue_export-helper.js";
5
- const y = { class: "tr-container" }, B = { class: "tr-container__header" }, E = { class: "tr-container__header-operations" }, k = { class: "tr-container__footer" }, z = /* @__PURE__ */ m({
5
+ const B = { class: "tr-container" }, k = { class: "tr-container__header" }, z = { class: "tr-container__header-operations" }, y = { class: "tr-container__footer" }, E = /* @__PURE__ */ m({
6
6
  __name: "index",
7
7
  props: {
8
8
  show: { type: Boolean, required: !0 },
@@ -18,16 +18,16 @@ const y = { class: "tr-container" }, B = { class: "tr-container__header" }, E =
18
18
  "224ae4c1": l.value ? "100" : "-1",
19
19
  cb10cae2: l.value ? "1" : "0"
20
20
  }));
21
- const l = c(o, "show"), s = c(o, "fullscreen"), f = _(() => s.value ? h : $);
22
- return (t, e) => (g(), w("div", y, [
21
+ const l = c(o, "show"), s = c(o, "fullscreen"), f = _(() => s.value ? g : h);
22
+ return (t, e) => (w(), $("div", B, [
23
23
  e[3] || (e[3] = n("div", { class: "tr-container__dragging-bar-wrapper" }, [
24
24
  n("div", { class: "tr-container__dragging-bar" })
25
25
  ], -1)),
26
- n("div", B, [
26
+ n("div", k, [
27
27
  r(t.$slots, "title", {}, () => [
28
28
  e[2] || (e[2] = n("h3", { class: "tr-container__title" }, "OpenTiny NEXT", -1))
29
29
  ]),
30
- n("div", E, [
30
+ n("div", z, [
31
31
  r(t.$slots, "operations"),
32
32
  u(a(d), {
33
33
  size: "28",
@@ -44,12 +44,12 @@ const y = { class: "tr-container" }, B = { class: "tr-container__header" }, E =
44
44
  ])
45
45
  ]),
46
46
  r(t.$slots, "default"),
47
- n("div", k, [
47
+ n("div", y, [
48
48
  r(t.$slots, "footer")
49
49
  ])
50
50
  ]));
51
51
  }
52
- }), i = /* @__PURE__ */ b(z, [["__scopeId", "data-v-81c9f59e"]]);
52
+ }), i = /* @__PURE__ */ b(E, [["__scopeId", "data-v-81c9f59e"]]);
53
53
  i.name = "TrContainer";
54
54
  const I = function(o) {
55
55
  o.component(i.name, i);
@@ -0,0 +1,70 @@
1
+ import { defineComponent as $, useCssVars as T, unref as S, ref as B, useTemplateRef as u, computed as D, watch as V, createElementBlock as i, openBlock as n, renderSlot as b, createVNode as E, Transition as M, withCtx as N, createBlock as O, createCommentVNode as R, Teleport as W, createElementVNode as c, normalizeStyle as I, Fragment as z, renderList as F, toDisplayString as H } from "vue";
2
+ import { u as m, o as L } from "../index3.js";
3
+ import { toCssUnit as o } from "../shared/index.js";
4
+ import { _ as P } from "../_plugin-vue_export-helper.js";
5
+ const U = { class: "tr-dropdown-menu__list" }, j = ["onClick"], q = /* @__PURE__ */ $({
6
+ __name: "index",
7
+ props: {
8
+ items: {},
9
+ minWidth: { default: 160 },
10
+ topOffset: { default: 0 }
11
+ },
12
+ emits: ["item-click"],
13
+ setup(s, { emit: p }) {
14
+ T((e) => ({
15
+ 72795133: S(o)(l.minWidth)
16
+ }));
17
+ const l = s, t = B(!1), f = p, _ = u("dropdown-menu-trigger"), a = u("dropdown-menu"), { x: w, y: h, update: v } = m(_), { width: g, height: k } = m(a), x = D(() => ({
18
+ left: `min(${o(w.value)}, 100% - ${o(g.value)})`,
19
+ top: `max(${o(h.value)} - ${o(k.value)} + ${o(l.topOffset)} - 8px, 0px)`
20
+ }));
21
+ L(a, (e) => {
22
+ e.stopPropagation(), t.value = !1;
23
+ }), V(t, (e) => {
24
+ e && v();
25
+ });
26
+ const C = () => {
27
+ t.value = !t.value;
28
+ }, y = (e) => {
29
+ t.value = !1, f("item-click", e);
30
+ };
31
+ return (e, G) => (n(), i("div", {
32
+ class: "tr-dropdown-menu__wrapper",
33
+ ref: "dropdown-menu-trigger",
34
+ onClick: C
35
+ }, [
36
+ b(e.$slots, "default", {}, void 0, !0),
37
+ E(M, { name: "tr-dropdown-menu" }, {
38
+ default: N(() => [
39
+ t.value ? (n(), O(W, {
40
+ key: 0,
41
+ to: "body"
42
+ }, [
43
+ c("div", {
44
+ class: "tr-dropdown-menu",
45
+ style: I(x.value),
46
+ ref: "dropdown-menu"
47
+ }, [
48
+ c("ul", U, [
49
+ (n(!0), i(z, null, F(l.items, (d) => (n(), i("li", {
50
+ class: "tr-dropdown-menu__list-item",
51
+ key: d.id,
52
+ onClick: (J) => y(d)
53
+ }, H(d.text), 9, j))), 128))
54
+ ])
55
+ ], 4)
56
+ ])) : R("", !0)
57
+ ]),
58
+ _: 1
59
+ })
60
+ ], 512));
61
+ }
62
+ }), r = /* @__PURE__ */ P(q, [["__scopeId", "data-v-dbe4bc04"]]);
63
+ r.name = "TrDropdownMenu";
64
+ const A = function(s) {
65
+ s.component(r.name, r);
66
+ };
67
+ r.install = A;
68
+ export {
69
+ r as default
70
+ };
@@ -1,10 +1,10 @@
1
- import { defineComponent as X, ref as E, computed as j, onMounted as z, watch as D, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as I, renderList as T, toDisplayString as y, createVNode as b, unref as l, nextTick as O, createElementVNode as p, createBlock as d, withCtx as f, createTextVNode as W, resolveDynamicComponent as A } from "vue";
2
- import { T as S, N as C, k as q, W as H, R as J, j as K } from "../tiny-robot-svgs.js";
3
- import { B as G } from "../index3.js";
1
+ import { defineComponent as X, ref as E, computed as z, onMounted as D, watch as K, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as I, renderList as S, toDisplayString as y, createVNode as b, unref as l, nextTick as O, createElementVNode as p, createBlock as d, withCtx as f, createTextVNode as U, resolveDynamicComponent as C } from "vue";
2
+ import { K as T, U as N, d as q, s as j, p as H, e as J } from "../tiny-robot-svgs.js";
3
+ import { B as R } from "../index5.js";
4
4
  import $, { ActionGroupItem as V } from "../action-group/index.js";
5
5
  import Q from "../icon-button/index.js";
6
6
  import { _ as P } from "../_plugin-vue_export-helper.js";
7
- const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ X({
7
+ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ X({
8
8
  __name: "SourceList",
9
9
  props: {
10
10
  sources: {},
@@ -20,13 +20,13 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
20
20
  } else
21
21
  c.value = null;
22
22
  });
23
- }, x = j(() => _.sources.length - (c.value || 0));
24
- z(g), D(() => _.sources, g);
23
+ }, A = z(() => _.sources.length - (c.value || 0));
24
+ D(g), K(() => _.sources, g);
25
25
  const m = (u, n) => {
26
26
  u && (L.value[n] = u);
27
27
  };
28
- return (u, n) => (t(), a("div", U, [
29
- (t(!0), a(I, null, T(_.sources, (o, s) => (t(), a(I, { key: s }, [
28
+ return (u, n) => (t(), a("div", W, [
29
+ (t(!0), a(I, null, S(_.sources, (o, s) => (t(), a(I, { key: s }, [
30
30
  !c.value || e.value || s < c.value ? (t(), a("a", {
31
31
  key: 0,
32
32
  class: "pill",
@@ -39,14 +39,14 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
39
39
  key: 1,
40
40
  class: "pill",
41
41
  onClick: n[0] || (n[0] = (r) => e.value = !0)
42
- }, y(x.value) + "+ ", 1)) : k("", !0)
42
+ }, y(A.value) + "+ ", 1)) : k("", !0)
43
43
  ], 64))), 128)),
44
44
  e.value ? (t(), a("span", {
45
45
  key: 0,
46
46
  class: "pill collapse-pill",
47
47
  onClick: n[1] || (n[1] = (o) => e.value = !1)
48
48
  }, [
49
- b(l(S))
49
+ b(l(T))
50
50
  ])) : k("", !0)
51
51
  ]));
52
52
  }
@@ -66,21 +66,21 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
66
66
  emits: ["operation", "action"],
67
67
  setup(h, { emit: _ }) {
68
68
  const e = h, L = {
69
- copy: K,
70
- refresh: J,
71
- like: H,
69
+ copy: J,
70
+ refresh: H,
71
+ like: j,
72
72
  dislike: q
73
73
  }, c = _, g = (n) => {
74
74
  var o, s, r;
75
75
  (r = (s = (o = e.operations) == null ? void 0 : o.find((v) => v.name === n)) == null ? void 0 : s.onClick) == null || r.call(s), c("operation", n);
76
- }, x = (n) => {
76
+ }, A = (n) => {
77
77
  var o, s, r;
78
78
  (r = (s = (o = e.actions) == null ? void 0 : o.find((v) => v.name === n)) == null ? void 0 : s.onClick) == null || r.call(s), c("action", n);
79
79
  }, m = E(!1), u = () => {
80
80
  m.value = !m.value;
81
81
  };
82
82
  return (n, o) => {
83
- var s, r, v, w, R, B, F, M;
83
+ var s, r, v, w, B, F, M, G;
84
84
  return t(), a("div", te, [
85
85
  p("div", se, [
86
86
  p("div", oe, [
@@ -92,7 +92,7 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
92
92
  class: "tr-feedback__operations-left-action-group"
93
93
  }, {
94
94
  moreBtn: f(() => [
95
- b(l(G), {
95
+ b(l(R), {
96
96
  round: "",
97
97
  size: "mini",
98
98
  "reset-time": 0,
@@ -100,25 +100,25 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
100
100
  }, {
101
101
  default: f(() => [
102
102
  o[0] || (o[0] = p("span", null, "更多", -1)),
103
- b(l(C))
103
+ b(l(N))
104
104
  ]),
105
105
  _: 1
106
106
  })
107
107
  ]),
108
108
  default: f(() => [
109
- (t(!0), a(I, null, T(e.operations, (i) => (t(), d(l(V), {
109
+ (t(!0), a(I, null, S(e.operations, (i) => (t(), d(l(V), {
110
110
  key: i.name,
111
111
  name: i.name,
112
112
  label: i.label
113
113
  }, {
114
114
  default: f(() => [
115
- b(l(G), {
115
+ b(l(R), {
116
116
  round: "",
117
117
  "reset-time": 0,
118
118
  size: "mini"
119
119
  }, {
120
120
  default: f(() => [
121
- W(y(i.label), 1)
121
+ U(y(i.label), 1)
122
122
  ]),
123
123
  _: 2
124
124
  }, 1024)
@@ -133,7 +133,7 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
133
133
  onClick: u
134
134
  }, [
135
135
  p("span", null, y((v = e.sources) == null ? void 0 : v.length) + "条来源", 1),
136
- (t(), d(A(m.value ? l(S) : l(C))))
136
+ (t(), d(C(m.value ? l(T) : l(N))))
137
137
  ])
138
138
  ])) : k("", !0)
139
139
  ]),
@@ -141,10 +141,10 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
141
141
  b(l($), {
142
142
  "max-num": e.actionsLimit,
143
143
  "show-tooltip": !0,
144
- onItemClick: x
144
+ onItemClick: A
145
145
  }, {
146
146
  default: f(() => [
147
- (t(!0), a(I, null, T(e.actions, (i) => (t(), d(l(V), {
147
+ (t(!0), a(I, null, S(e.actions, (i) => (t(), d(l(V), {
148
148
  key: i.name,
149
149
  name: i.name,
150
150
  label: i.label
@@ -153,7 +153,7 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
153
153
  typeof i.icon == "string" ? (t(), d(l(Q), {
154
154
  key: 0,
155
155
  icon: L[i.icon]
156
- }, null, 8, ["icon"])) : (t(), d(A(i.icon), { key: 1 }))
156
+ }, null, 8, ["icon"])) : (t(), d(C(i.icon), { key: 1 }))
157
157
  ]),
158
158
  _: 2
159
159
  }, 1032, ["name", "label"]))), 128))
@@ -162,14 +162,14 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
162
162
  }, 8, ["max-num"])
163
163
  ])
164
164
  ]),
165
- (w = e.operations) != null && w.length && ((R = e.sources) != null && R.length) || m.value && e.sources ? (t(), a("div", ae, [
166
- (B = e.operations) != null && B.length && ((F = e.sources) != null && F.length) ? (t(), a("div", re, [
165
+ (w = e.operations) != null && w.length && ((B = e.sources) != null && B.length) || m.value && e.sources ? (t(), a("div", ae, [
166
+ (F = e.operations) != null && F.length && ((M = e.sources) != null && M.length) ? (t(), a("div", re, [
167
167
  p("span", {
168
168
  class: "tr-feedback__source",
169
169
  onClick: u
170
170
  }, [
171
- p("span", null, y((M = e.sources) == null ? void 0 : M.length) + "条来源", 1),
172
- (t(), d(A(m.value ? l(S) : l(C))))
171
+ p("span", null, y((G = e.sources) == null ? void 0 : G.length) + "条来源", 1),
172
+ (t(), d(C(m.value ? l(T) : l(N))))
173
173
  ])
174
174
  ])) : k("", !0),
175
175
  m.value && e.sources ? (t(), d(l(ee), {
@@ -181,12 +181,12 @@ const U = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
181
181
  ]);
182
182
  };
183
183
  }
184
- }), N = /* @__PURE__ */ P(ie, [["__scopeId", "data-v-cc6ef316"]]);
185
- N.name = "TrFeedback";
184
+ }), x = /* @__PURE__ */ P(ie, [["__scopeId", "data-v-cc6ef316"]]);
185
+ x.name = "TrFeedback";
186
186
  const ce = function(h) {
187
- h.component(N.name, N);
187
+ h.component(x.name, x);
188
188
  };
189
- N.install = ce;
189
+ x.install = ce;
190
190
  export {
191
- N as default
191
+ x as default
192
192
  };
@@ -0,0 +1,120 @@
1
+ import { defineComponent as q, mergeModels as $, useModel as G, watch as k, useTemplateRef as h, ref as v, computed as D, createElementBlock as a, openBlock as l, createElementVNode as M, Fragment as g, renderList as S, createCommentVNode as _, normalizeClass as b, createBlock as C, resolveDynamicComponent as I, toDisplayString as F, nextTick as H } from "vue";
2
+ import { U as X } from "../tiny-robot-svgs.js";
3
+ import { a as j, o as J } from "../index3.js";
4
+ import { _ as K } from "../_plugin-vue_export-helper.js";
5
+ const P = {
6
+ class: "tr-flow-layout",
7
+ ref: "container"
8
+ }, Q = ["onClick"], Y = {
9
+ key: 0,
10
+ class: "tr-flow-layout__item-label"
11
+ }, Z = { class: "tr-flow-layout__dropdown-wrapper" }, ee = {
12
+ key: 0,
13
+ class: "tr-flow-layout__dropdown",
14
+ ref: "dropDown"
15
+ }, te = ["onClick"], oe = { class: "tr-flow-layout__item-label" }, le = /* @__PURE__ */ q({
16
+ __name: "index",
17
+ props: /* @__PURE__ */ $({
18
+ items: {},
19
+ selected: {},
20
+ linesLimit: { default: Number.MAX_SAFE_INTEGER },
21
+ moreIcon: { default: X },
22
+ showMoreTrigger: { default: "click" }
23
+ }, {
24
+ selected: {},
25
+ selectedModifiers: {}
26
+ }),
27
+ emits: /* @__PURE__ */ $(["item-click"], ["update:selected"]),
28
+ setup(d, { emit: N }) {
29
+ const n = d, i = G(d, "selected");
30
+ k(
31
+ () => n.items,
32
+ (t) => {
33
+ !t.find((o) => o.id === i.value) && t.length && (i.value = t[0].id);
34
+ },
35
+ { immediate: !0 }
36
+ );
37
+ const A = N, x = h("container"), B = h("more-button"), L = h("dropDown"), w = v([]), s = v(null), f = v(!1), u = v(!1), W = (t, o) => {
38
+ t && (w.value[o] = t);
39
+ }, T = () => {
40
+ s.value = null, f.value = !1, H(() => {
41
+ const t = x.value, o = B.value;
42
+ if (!t || !o)
43
+ return;
44
+ const e = w.value.slice(0, n.items.length).filter((r) => !!r).map((r) => r.offsetTop), c = Array.from(new Set(e));
45
+ if (c.length > n.linesLimit) {
46
+ const r = c[n.linesLimit - 1], y = e.lastIndexOf(r), E = w.value[y];
47
+ t.clientWidth - E.offsetLeft - E.offsetWidth - 8 < o.offsetWidth ? s.value = y : s.value = y + 1, f.value = !1;
48
+ } else
49
+ s.value = null, f.value = !0;
50
+ });
51
+ };
52
+ k(() => n.items, T);
53
+ const { width: z } = j(x);
54
+ k(z, (t) => {
55
+ t > 0 && T();
56
+ });
57
+ const O = D(() => s.value !== null ? n.items.slice(s.value) : []), U = D(() => s.value === null ? !1 : n.items.findIndex((o) => o.id === i.value) >= s.value), R = (t) => {
58
+ i.value = t, u.value = !1, A("item-click", t);
59
+ }, V = () => {
60
+ n.showMoreTrigger === "click" && (u.value = !u.value);
61
+ }, m = (t) => {
62
+ n.showMoreTrigger === "hover" && (u.value = t);
63
+ };
64
+ return J(L, (t) => {
65
+ var o, e;
66
+ (o = L.value) != null && o.contains(t.target) || (e = B.value) != null && e.contains(t.target) || (u.value = !1);
67
+ }), (t, o) => (l(), a("div", P, [
68
+ (l(!0), a(g, null, S(n.items, (e, c) => (l(), a(g, {
69
+ key: e.id
70
+ }, [
71
+ s.value === null || c < s.value ? (l(), a("button", {
72
+ key: 0,
73
+ class: b(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === i.value }]),
74
+ ref_for: !0,
75
+ ref: (r) => W(r, c),
76
+ onClick: (r) => R(e.id)
77
+ }, [
78
+ (l(), C(I(e.icon), { class: "tr-flow-layout__item-icon" })),
79
+ e.label ? (l(), a("span", Y, F(e.label), 1)) : _("", !0)
80
+ ], 10, Q)) : _("", !0)
81
+ ], 64))), 128)),
82
+ M("div", Z, [
83
+ f.value ? _("", !0) : (l(), a("button", {
84
+ key: 0,
85
+ class: b(["tr-flow-layout__item", "icon-only", { selected: U.value }]),
86
+ ref: "more-button",
87
+ onClick: V,
88
+ onMouseenter: o[0] || (o[0] = (e) => m(!0)),
89
+ onMouseleave: o[1] || (o[1] = (e) => m(!1))
90
+ }, [
91
+ (l(), C(I(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
92
+ ], 34)),
93
+ M("div", {
94
+ class: "tr-flow-layout__dropdown-container",
95
+ onMouseenter: o[2] || (o[2] = (e) => m(!0)),
96
+ onMouseleave: o[3] || (o[3] = (e) => m(!1))
97
+ }, [
98
+ u.value ? (l(), a("div", ee, [
99
+ (l(!0), a(g, null, S(O.value, (e) => (l(), a("button", {
100
+ class: b(["tr-flow-layout__dropdown_item", { selected: e.id === i.value }]),
101
+ key: e.id,
102
+ onClick: (c) => R(e.id)
103
+ }, [
104
+ (l(), C(I(e.icon), { class: "tr-flow-layout__item-icon" })),
105
+ M("span", oe, F(e.label), 1)
106
+ ], 10, te))), 128))
107
+ ], 512)) : _("", !0)
108
+ ], 32)
109
+ ])
110
+ ], 512));
111
+ }
112
+ }), p = /* @__PURE__ */ K(le, [["__scopeId", "data-v-2718a5f2"]]);
113
+ p.name = "TrFlowLayout";
114
+ const ne = function(d) {
115
+ d.component(p.name, p);
116
+ };
117
+ p.install = ne;
118
+ export {
119
+ p as default
120
+ };