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

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
  };
@@ -1,4 +1,4 @@
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";
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, ref 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
3
  import { d as H0 } from "../index3.js";
4
4
  const $u = {};
@@ -3149,10 +3149,7 @@ const Tr = {
3149
3149
  ])
3150
3150
  ], 2));
3151
3151
  }
3152
- }), J = /* @__PURE__ */ a0(Or, [["__scopeId", "data-v-56d84731"]]), Nr = {
3153
- class: "tr-bubble-list",
3154
- ref: "scrollContainer"
3155
- }, $r = /* @__PURE__ */ c0({
3152
+ }), J = /* @__PURE__ */ a0(Or, [["__scopeId", "data-v-56d84731"]]), Nr = /* @__PURE__ */ c0({
3156
3153
  __name: "BubbleList",
3157
3154
  props: {
3158
3155
  items: {},
@@ -3160,7 +3157,7 @@ const Tr = {
3160
3157
  autoScroll: { type: Boolean }
3161
3158
  },
3162
3159
  setup(u) {
3163
- const e = u, t = N0("scrollContainer"), { y: n } = H0(t, {
3160
+ const e = u, t = N0(null), { y: n } = H0(t, {
3164
3161
  behavior: "smooth",
3165
3162
  throttle: 100
3166
3163
  }), r = au(() => e.items.at(-1));
@@ -3178,7 +3175,11 @@ const Tr = {
3178
3175
  var s;
3179
3176
  return { ...(i.role ? ((s = e.roles) == null ? void 0 : s[i.role]) || {} : {}).slots, ...i.slots };
3180
3177
  };
3181
- return (i, a) => (S(), L("div", Nr, [
3178
+ return (i, a) => (S(), L("div", {
3179
+ class: "tr-bubble-list",
3180
+ ref_key: "scrollContainerRef",
3181
+ ref: t
3182
+ }, [
3182
3183
  (S(!0), L(j0, null, Ou(e.items, (s, f) => (S(), yu(J, Nu({
3183
3184
  key: s.id || f,
3184
3185
  ref_for: !0
@@ -3192,20 +3193,20 @@ const Tr = {
3192
3193
  ]), 1040))), 128))
3193
3194
  ], 512));
3194
3195
  }
3195
- }), tu = /* @__PURE__ */ a0($r, [["__scopeId", "data-v-bd672305"]]);
3196
+ }), tu = /* @__PURE__ */ a0(Nr, [["__scopeId", "data-v-307d7ab0"]]);
3196
3197
  J.name = "TrBubble";
3197
- const jr = function(u) {
3198
+ const $r = function(u) {
3198
3199
  u.component(J.name, J);
3199
3200
  };
3200
- J.install = jr;
3201
- const Gr = J;
3201
+ J.install = $r;
3202
+ const Vr = J;
3202
3203
  tu.name = "TrBubbleList";
3203
- const Ur = function(u) {
3204
+ const jr = function(u) {
3204
3205
  u.component(tu.name, tu);
3205
3206
  };
3206
- tu.install = Ur;
3207
- const Wr = tu;
3207
+ tu.install = jr;
3208
+ const Gr = tu;
3208
3209
  export {
3209
- Gr as Bubble,
3210
- Wr as BubbleList
3210
+ Vr as Bubble,
3211
+ Gr as BubbleList
3211
3212
  };
@@ -1,8 +1,8 @@
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";
1
+ import { defineComponent as $, useCssVars as T, unref as D, ref as d, computed as S, watch as B, createElementBlock as u, openBlock as n, renderSlot as M, createVNode as R, Transition as V, withCtx as E, createBlock as N, createCommentVNode as O, Teleport as W, createElementVNode as m, normalizeStyle as I, Fragment as b, renderList as z, toDisplayString as F } from "vue";
2
+ import { u as p, o as H } from "../index3.js";
3
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__ */ $({
4
+ import { _ as L } from "../_plugin-vue_export-helper.js";
5
+ const P = { class: "tr-dropdown-menu__list" }, U = ["onClick"], j = /* @__PURE__ */ $({
6
6
  __name: "index",
7
7
  props: {
8
8
  items: {},
@@ -10,61 +10,63 @@ const U = { class: "tr-dropdown-menu__list" }, j = ["onClick"], q = /* @__PURE__
10
10
  topOffset: { default: 0 }
11
11
  },
12
12
  emits: ["item-click"],
13
- setup(s, { emit: p }) {
13
+ setup(s, { emit: f }) {
14
14
  T((e) => ({
15
- 72795133: S(o)(l.minWidth)
15
+ f8e23632: D(o)(l.minWidth)
16
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)`
17
+ const l = s, t = d(!1), _ = f, c = d(null), a = d(null), { x: w, y: h, update: v } = p(c), { width: k, height: g } = p(a), x = S(() => ({
18
+ left: `min(${o(w.value)}, 100% - ${o(k.value)})`,
19
+ top: `max(${o(h.value)} - ${o(g.value)} + ${o(l.topOffset)} - 8px, 0px)`
20
20
  }));
21
- L(a, (e) => {
21
+ H(a, (e) => {
22
22
  e.stopPropagation(), t.value = !1;
23
- }), V(t, (e) => {
23
+ }), B(t, (e) => {
24
24
  e && v();
25
25
  });
26
- const C = () => {
26
+ const y = () => {
27
27
  t.value = !t.value;
28
- }, y = (e) => {
29
- t.value = !1, f("item-click", e);
28
+ }, C = (e) => {
29
+ t.value = !1, _("item-click", e);
30
30
  };
31
- return (e, G) => (n(), i("div", {
31
+ return (e, A) => (n(), u("div", {
32
32
  class: "tr-dropdown-menu__wrapper",
33
- ref: "dropdown-menu-trigger",
34
- onClick: C
33
+ ref_key: "dropDownTriggerRef",
34
+ ref: c,
35
+ onClick: y
35
36
  }, [
36
- b(e.$slots, "default", {}, void 0, !0),
37
- E(M, { name: "tr-dropdown-menu" }, {
38
- default: N(() => [
39
- t.value ? (n(), O(W, {
37
+ M(e.$slots, "default", {}, void 0, !0),
38
+ R(V, { name: "tr-dropdown-menu" }, {
39
+ default: E(() => [
40
+ t.value ? (n(), N(W, {
40
41
  key: 0,
41
42
  to: "body"
42
43
  }, [
43
- c("div", {
44
+ m("div", {
44
45
  class: "tr-dropdown-menu",
45
46
  style: I(x.value),
46
- ref: "dropdown-menu"
47
+ ref_key: "dropdownMenuRef",
48
+ ref: a
47
49
  }, [
48
- c("ul", U, [
49
- (n(!0), i(z, null, F(l.items, (d) => (n(), i("li", {
50
+ m("ul", P, [
51
+ (n(!0), u(b, null, z(l.items, (i) => (n(), u("li", {
50
52
  class: "tr-dropdown-menu__list-item",
51
- key: d.id,
52
- onClick: (J) => y(d)
53
- }, H(d.text), 9, j))), 128))
53
+ key: i.id,
54
+ onClick: (G) => C(i)
55
+ }, F(i.text), 9, U))), 128))
54
56
  ])
55
57
  ], 4)
56
- ])) : R("", !0)
58
+ ])) : O("", !0)
57
59
  ]),
58
60
  _: 1
59
61
  })
60
62
  ], 512));
61
63
  }
62
- }), r = /* @__PURE__ */ P(q, [["__scopeId", "data-v-dbe4bc04"]]);
64
+ }), r = /* @__PURE__ */ L(j, [["__scopeId", "data-v-e4886a37"]]);
63
65
  r.name = "TrDropdownMenu";
64
- const A = function(s) {
66
+ const q = function(s) {
65
67
  s.component(r.name, r);
66
68
  };
67
- r.install = A;
69
+ r.install = q;
68
70
  export {
69
71
  r as default
70
72
  };
@@ -1,120 +1,123 @@
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 = {
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 x, createBlock as B, resolveDynamicComponent as b, toDisplayString as D, nextTick as G } from "vue";
2
+ import { U as H } from "../tiny-robot-svgs.js";
3
+ import { a as X, o as j } from "../index3.js";
4
+ import { _ as J } from "../_plugin-vue_export-helper.js";
5
+ const K = ["onClick"], P = {
9
6
  key: 0,
10
7
  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({
8
+ }, Q = { class: "tr-flow-layout__dropdown-wrapper" }, Y = ["onClick"], Z = { class: "tr-flow-layout__item-label" }, ee = /* @__PURE__ */ V({
16
9
  __name: "index",
17
- props: /* @__PURE__ */ $({
10
+ props: /* @__PURE__ */ E({
18
11
  items: {},
19
12
  selected: {},
20
13
  linesLimit: { default: Number.MAX_SAFE_INTEGER },
21
- moreIcon: { default: X },
14
+ moreIcon: { default: H },
22
15
  showMoreTrigger: { default: "click" }
23
16
  }, {
24
17
  selected: {},
25
18
  selectedModifiers: {}
26
19
  }),
27
- emits: /* @__PURE__ */ $(["item-click"], ["update:selected"]),
28
- setup(d, { emit: N }) {
29
- const n = d, i = G(d, "selected");
30
- k(
20
+ emits: /* @__PURE__ */ E(["item-click"], ["update:selected"]),
21
+ setup(d, { emit: F }) {
22
+ const n = d, u = q(d, "selected");
23
+ g(
31
24
  () => n.items,
32
25
  (t) => {
33
- !t.find((o) => o.id === i.value) && t.length && (i.value = t[0].id);
26
+ !t.find((o) => o.id === u.value) && t.length && (u.value = t[0].id);
34
27
  },
35
28
  { immediate: !0 }
36
29
  );
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;
30
+ const N = F, y = i(null), w = i(null), k = i(null), M = i([]), s = i(null), m = i(!1), c = i(!1), A = (t, o) => {
31
+ t && (M.value[o] = t);
32
+ }, L = () => {
33
+ s.value = null, m.value = !1, G(() => {
34
+ const t = y.value, o = w.value;
42
35
  if (!t || !o)
43
36
  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;
37
+ const e = M.value.slice(0, n.items.length).filter((r) => !!r).map((r) => r.offsetTop), f = Array.from(new Set(e));
38
+ if (f.length > n.linesLimit) {
39
+ const r = f[n.linesLimit - 1], h = e.lastIndexOf(r), T = M.value[h];
40
+ t.clientWidth - T.offsetLeft - T.offsetWidth - 8 < o.offsetWidth ? s.value = h : s.value = h + 1, m.value = !1;
48
41
  } else
49
- s.value = null, f.value = !0;
42
+ s.value = null, m.value = !0;
50
43
  });
51
44
  };
52
- k(() => n.items, T);
53
- const { width: z } = j(x);
54
- k(z, (t) => {
55
- t > 0 && T();
45
+ g(() => n.items, L);
46
+ const { width: W } = X(y);
47
+ g(W, (t) => {
48
+ t > 0 && L();
56
49
  });
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);
50
+ const z = $(() => s.value !== null ? n.items.slice(s.value) : []), O = $(() => s.value === null ? !1 : n.items.findIndex((o) => o.id === u.value) >= s.value), R = (t) => {
51
+ u.value = t, c.value = !1, N("item-click", t);
52
+ }, U = () => {
53
+ n.showMoreTrigger === "click" && (c.value = !c.value);
54
+ }, v = (t) => {
55
+ n.showMoreTrigger === "hover" && (c.value = t);
63
56
  };
64
- return J(L, (t) => {
57
+ return j(k, (t) => {
65
58
  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, {
59
+ (o = k.value) != null && o.contains(t.target) || (e = w.value) != null && e.contains(t.target) || (c.value = !1);
60
+ }), (t, o) => (l(), a("div", {
61
+ class: "tr-flow-layout",
62
+ ref_key: "containerRef",
63
+ ref: y
64
+ }, [
65
+ (l(!0), a(I, null, S(n.items, (e, f) => (l(), a(I, {
69
66
  key: e.id
70
67
  }, [
71
- s.value === null || c < s.value ? (l(), a("button", {
68
+ s.value === null || f < s.value ? (l(), a("button", {
72
69
  key: 0,
73
- class: b(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === i.value }]),
70
+ class: x(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
74
71
  ref_for: !0,
75
- ref: (r) => W(r, c),
72
+ ref: (r) => A(r, f),
76
73
  onClick: (r) => R(e.id)
77
74
  }, [
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)
75
+ (l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
76
+ e.label ? (l(), a("span", P, D(e.label), 1)) : _("", !0)
77
+ ], 10, K)) : _("", !0)
81
78
  ], 64))), 128)),
82
- M("div", Z, [
83
- f.value ? _("", !0) : (l(), a("button", {
79
+ C("div", Q, [
80
+ m.value ? _("", !0) : (l(), a("button", {
84
81
  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))
82
+ class: x(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
83
+ ref_key: "moreButtonRef",
84
+ ref: w,
85
+ onClick: U,
86
+ onMouseenter: o[0] || (o[0] = (e) => v(!0)),
87
+ onMouseleave: o[1] || (o[1] = (e) => v(!1))
90
88
  }, [
91
- (l(), C(I(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
89
+ (l(), B(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
92
90
  ], 34)),
93
- M("div", {
91
+ C("div", {
94
92
  class: "tr-flow-layout__dropdown-container",
95
- onMouseenter: o[2] || (o[2] = (e) => m(!0)),
96
- onMouseleave: o[3] || (o[3] = (e) => m(!1))
93
+ onMouseenter: o[2] || (o[2] = (e) => v(!0)),
94
+ onMouseleave: o[3] || (o[3] = (e) => v(!1))
97
95
  }, [
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 }]),
96
+ c.value ? (l(), a("div", {
97
+ key: 0,
98
+ class: "tr-flow-layout__dropdown",
99
+ ref_key: "dropDownRef",
100
+ ref: k
101
+ }, [
102
+ (l(!0), a(I, null, S(z.value, (e) => (l(), a("button", {
103
+ class: x(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
101
104
  key: e.id,
102
- onClick: (c) => R(e.id)
105
+ onClick: (f) => R(e.id)
103
106
  }, [
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
+ (l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
108
+ C("span", Z, D(e.label), 1)
109
+ ], 10, Y))), 128))
107
110
  ], 512)) : _("", !0)
108
111
  ], 32)
109
112
  ])
110
113
  ], 512));
111
114
  }
112
- }), p = /* @__PURE__ */ K(le, [["__scopeId", "data-v-2718a5f2"]]);
115
+ }), p = /* @__PURE__ */ J(ee, [["__scopeId", "data-v-5a28ac75"]]);
113
116
  p.name = "TrFlowLayout";
114
- const ne = function(d) {
117
+ const te = function(d) {
115
118
  d.component(p.name, p);
116
119
  };
117
- p.install = ne;
120
+ p.install = te;
118
121
  export {
119
122
  p as default
120
123
  };