@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.
- package/dist/action-group/index.js +69 -67
- package/dist/bubble/index.js +17 -16
- package/dist/dropdown-menu/index.js +34 -32
- package/dist/flow-layout-buttons/index.js +74 -71
- package/dist/index.d.ts +11 -11
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +36 -35
- package/dist/suggestion-popover/index.js +66 -64
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { o as
|
|
3
|
-
import { T as
|
|
4
|
-
import { o as
|
|
5
|
-
import
|
|
6
|
-
import { _ as
|
|
7
|
-
const
|
|
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:
|
|
16
|
-
const a = l,
|
|
15
|
+
setup(l, { emit: k }) {
|
|
16
|
+
const a = l, F = H(), O = k, p = i(() => {
|
|
17
17
|
var o, t;
|
|
18
|
-
const e =
|
|
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
|
-
}),
|
|
20
|
+
}), b = i(() => {
|
|
21
21
|
const e = a.maxNum ?? Number.MAX_SAFE_INTEGER;
|
|
22
22
|
return e > 0 ? e : Number.MAX_SAFE_INTEGER;
|
|
23
|
-
}),
|
|
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
|
-
|
|
26
|
+
Z(d, (e) => {
|
|
27
27
|
var o;
|
|
28
|
-
(o =
|
|
28
|
+
(o = m.value) != null && o.contains(e.target) || (r.value = !1);
|
|
29
29
|
});
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
if (!
|
|
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 =
|
|
36
|
-
|
|
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 &&
|
|
40
|
-
|
|
39
|
+
e && W(() => {
|
|
40
|
+
T();
|
|
41
41
|
});
|
|
42
|
-
}), N(
|
|
43
|
-
r.value &&
|
|
44
|
-
}), (e, o) => (n(),
|
|
45
|
-
(n(!0),
|
|
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(),
|
|
48
|
-
key:
|
|
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:
|
|
56
|
-
|
|
55
|
+
default: S(() => [
|
|
56
|
+
w("span", {
|
|
57
57
|
class: "tr-action-group__btn-wrapper",
|
|
58
|
-
onClick: (
|
|
58
|
+
onClick: (X) => {
|
|
59
59
|
var s;
|
|
60
|
-
return
|
|
60
|
+
return A((s = t.props) == null ? void 0 : s.name);
|
|
61
61
|
}
|
|
62
62
|
}, [
|
|
63
|
-
(n(),
|
|
64
|
-
], 8,
|
|
63
|
+
(n(), v(x(t)))
|
|
64
|
+
], 8, re)
|
|
65
65
|
]),
|
|
66
66
|
_: 2
|
|
67
67
|
}, 1032, ["content", "disabled"]);
|
|
68
68
|
}), 128)),
|
|
69
|
-
|
|
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:
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
default: S(() => [
|
|
78
|
+
w("span", {
|
|
79
|
+
ref_key: "moreBtnRef",
|
|
80
|
+
ref: m,
|
|
80
81
|
class: "tr-action-group__btn-wrapper",
|
|
81
|
-
onClick:
|
|
82
|
+
onClick: P
|
|
82
83
|
}, [
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
L(e.$slots, "moreBtn", {}, () => [
|
|
85
|
+
E(h(te), { icon: h(Y) }, null, 8, ["icon"])
|
|
85
86
|
], !0),
|
|
86
|
-
|
|
87
|
-
default:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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),
|
|
94
|
+
(n(!0), _(G, null, I(z.value, (t, C) => {
|
|
93
95
|
var c;
|
|
94
|
-
return n(),
|
|
96
|
+
return n(), _("li", {
|
|
95
97
|
class: "tr-action-group__dropdown-item",
|
|
96
|
-
key:
|
|
97
|
-
onClick:
|
|
98
|
+
key: C,
|
|
99
|
+
onClick: K((X) => {
|
|
98
100
|
var s;
|
|
99
|
-
return
|
|
101
|
+
return A((s = t.props) == null ? void 0 : s.name);
|
|
100
102
|
}, ["stop"])
|
|
101
103
|
}, [
|
|
102
|
-
a.dropDownShowLabelOnly ?
|
|
103
|
-
|
|
104
|
-
], 8,
|
|
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
|
-
[
|
|
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"])) :
|
|
117
|
+
}, 8, ["disabled"])) : R("", !0)
|
|
116
118
|
]));
|
|
117
119
|
}
|
|
118
|
-
}),
|
|
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 (
|
|
127
|
+
return (k, a) => L(k.$slots, "default");
|
|
126
128
|
}
|
|
127
129
|
});
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
l.component(
|
|
130
|
+
g.name = "TrActionGroup";
|
|
131
|
+
const se = function(l) {
|
|
132
|
+
l.component(g.name, g);
|
|
131
133
|
};
|
|
132
|
-
|
|
134
|
+
g.install = se;
|
|
133
135
|
u.name = "TrActionGroupItem";
|
|
134
|
-
const
|
|
136
|
+
const ie = function(l) {
|
|
135
137
|
l.component(u.name, u);
|
|
136
138
|
};
|
|
137
|
-
u.install =
|
|
138
|
-
const
|
|
139
|
+
u.install = ie;
|
|
140
|
+
const ve = u;
|
|
139
141
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
ve as ActionGroupItem,
|
|
143
|
+
g as default
|
|
142
144
|
};
|
package/dist/bubble/index.js
CHANGED
|
@@ -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,
|
|
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(
|
|
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",
|
|
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(
|
|
3196
|
+
}), tu = /* @__PURE__ */ a0(Nr, [["__scopeId", "data-v-307d7ab0"]]);
|
|
3196
3197
|
J.name = "TrBubble";
|
|
3197
|
-
const
|
|
3198
|
+
const $r = function(u) {
|
|
3198
3199
|
u.component(J.name, J);
|
|
3199
3200
|
};
|
|
3200
|
-
J.install =
|
|
3201
|
-
const
|
|
3201
|
+
J.install = $r;
|
|
3202
|
+
const Vr = J;
|
|
3202
3203
|
tu.name = "TrBubbleList";
|
|
3203
|
-
const
|
|
3204
|
+
const jr = function(u) {
|
|
3204
3205
|
u.component(tu.name, tu);
|
|
3205
3206
|
};
|
|
3206
|
-
tu.install =
|
|
3207
|
-
const
|
|
3207
|
+
tu.install = jr;
|
|
3208
|
+
const Gr = tu;
|
|
3208
3209
|
export {
|
|
3209
|
-
|
|
3210
|
-
|
|
3210
|
+
Vr as Bubble,
|
|
3211
|
+
Gr as BubbleList
|
|
3211
3212
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as $, useCssVars as T, unref as
|
|
2
|
-
import { u as
|
|
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
|
|
5
|
-
const
|
|
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:
|
|
13
|
+
setup(s, { emit: f }) {
|
|
14
14
|
T((e) => ({
|
|
15
|
-
|
|
15
|
+
f8e23632: D(o)(l.minWidth)
|
|
16
16
|
}));
|
|
17
|
-
const l = s, t =
|
|
18
|
-
left: `min(${o(w.value)}, 100% - ${o(
|
|
19
|
-
top: `max(${o(h.value)} - ${o(
|
|
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
|
-
|
|
21
|
+
H(a, (e) => {
|
|
22
22
|
e.stopPropagation(), t.value = !1;
|
|
23
|
-
}),
|
|
23
|
+
}), B(t, (e) => {
|
|
24
24
|
e && v();
|
|
25
25
|
});
|
|
26
|
-
const
|
|
26
|
+
const y = () => {
|
|
27
27
|
t.value = !t.value;
|
|
28
|
-
},
|
|
29
|
-
t.value = !1,
|
|
28
|
+
}, C = (e) => {
|
|
29
|
+
t.value = !1, _("item-click", e);
|
|
30
30
|
};
|
|
31
|
-
return (e,
|
|
31
|
+
return (e, A) => (n(), u("div", {
|
|
32
32
|
class: "tr-dropdown-menu__wrapper",
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
ref_key: "dropDownTriggerRef",
|
|
34
|
+
ref: c,
|
|
35
|
+
onClick: y
|
|
35
36
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
default:
|
|
39
|
-
t.value ? (n(),
|
|
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
|
-
|
|
44
|
+
m("div", {
|
|
44
45
|
class: "tr-dropdown-menu",
|
|
45
46
|
style: I(x.value),
|
|
46
|
-
|
|
47
|
+
ref_key: "dropdownMenuRef",
|
|
48
|
+
ref: a
|
|
47
49
|
}, [
|
|
48
|
-
|
|
49
|
-
(n(!0),
|
|
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:
|
|
52
|
-
onClick: (
|
|
53
|
-
},
|
|
53
|
+
key: i.id,
|
|
54
|
+
onClick: (G) => C(i)
|
|
55
|
+
}, F(i.text), 9, U))), 128))
|
|
54
56
|
])
|
|
55
57
|
], 4)
|
|
56
|
-
])) :
|
|
58
|
+
])) : O("", !0)
|
|
57
59
|
]),
|
|
58
60
|
_: 1
|
|
59
61
|
})
|
|
60
62
|
], 512));
|
|
61
63
|
}
|
|
62
|
-
}), r = /* @__PURE__ */
|
|
64
|
+
}), r = /* @__PURE__ */ L(j, [["__scopeId", "data-v-e4886a37"]]);
|
|
63
65
|
r.name = "TrDropdownMenu";
|
|
64
|
-
const
|
|
66
|
+
const q = function(s) {
|
|
65
67
|
s.component(r.name, r);
|
|
66
68
|
};
|
|
67
|
-
r.install =
|
|
69
|
+
r.install = q;
|
|
68
70
|
export {
|
|
69
71
|
r as default
|
|
70
72
|
};
|
|
@@ -1,120 +1,123 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { U as
|
|
3
|
-
import { a as
|
|
4
|
-
import { _ as
|
|
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
|
-
},
|
|
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:
|
|
14
|
+
moreIcon: { default: H },
|
|
22
15
|
showMoreTrigger: { default: "click" }
|
|
23
16
|
}, {
|
|
24
17
|
selected: {},
|
|
25
18
|
selectedModifiers: {}
|
|
26
19
|
}),
|
|
27
|
-
emits: /* @__PURE__ */
|
|
28
|
-
setup(d, { emit:
|
|
29
|
-
const n = d,
|
|
30
|
-
|
|
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 ===
|
|
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
|
|
38
|
-
t && (
|
|
39
|
-
},
|
|
40
|
-
s.value = null,
|
|
41
|
-
const t =
|
|
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 =
|
|
45
|
-
if (
|
|
46
|
-
const r =
|
|
47
|
-
t.clientWidth -
|
|
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,
|
|
42
|
+
s.value = null, m.value = !0;
|
|
50
43
|
});
|
|
51
44
|
};
|
|
52
|
-
|
|
53
|
-
const { width:
|
|
54
|
-
|
|
55
|
-
t > 0 &&
|
|
45
|
+
g(() => n.items, L);
|
|
46
|
+
const { width: W } = X(y);
|
|
47
|
+
g(W, (t) => {
|
|
48
|
+
t > 0 && L();
|
|
56
49
|
});
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
n.showMoreTrigger === "click" && (
|
|
61
|
-
},
|
|
62
|
-
n.showMoreTrigger === "hover" && (
|
|
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
|
|
57
|
+
return j(k, (t) => {
|
|
65
58
|
var o, e;
|
|
66
|
-
(o =
|
|
67
|
-
}), (t, o) => (l(), a("div",
|
|
68
|
-
|
|
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 ||
|
|
68
|
+
s.value === null || f < s.value ? (l(), a("button", {
|
|
72
69
|
key: 0,
|
|
73
|
-
class:
|
|
70
|
+
class: x(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
74
71
|
ref_for: !0,
|
|
75
|
-
ref: (r) =>
|
|
72
|
+
ref: (r) => A(r, f),
|
|
76
73
|
onClick: (r) => R(e.id)
|
|
77
74
|
}, [
|
|
78
|
-
(l(),
|
|
79
|
-
e.label ? (l(), a("span",
|
|
80
|
-
], 10,
|
|
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
|
-
|
|
83
|
-
|
|
79
|
+
C("div", Q, [
|
|
80
|
+
m.value ? _("", !0) : (l(), a("button", {
|
|
84
81
|
key: 0,
|
|
85
|
-
class:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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(),
|
|
89
|
+
(l(), B(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
92
90
|
], 34)),
|
|
93
|
-
|
|
91
|
+
C("div", {
|
|
94
92
|
class: "tr-flow-layout__dropdown-container",
|
|
95
|
-
onMouseenter: o[2] || (o[2] = (e) =>
|
|
96
|
-
onMouseleave: o[3] || (o[3] = (e) =>
|
|
93
|
+
onMouseenter: o[2] || (o[2] = (e) => v(!0)),
|
|
94
|
+
onMouseleave: o[3] || (o[3] = (e) => v(!1))
|
|
97
95
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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: (
|
|
105
|
+
onClick: (f) => R(e.id)
|
|
103
106
|
}, [
|
|
104
|
-
(l(),
|
|
105
|
-
|
|
106
|
-
], 10,
|
|
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__ */
|
|
115
|
+
}), p = /* @__PURE__ */ J(ee, [["__scopeId", "data-v-5a28ac75"]]);
|
|
113
116
|
p.name = "TrFlowLayout";
|
|
114
|
-
const
|
|
117
|
+
const te = function(d) {
|
|
115
118
|
d.component(p.name, p);
|
|
116
119
|
};
|
|
117
|
-
p.install =
|
|
120
|
+
p.install = te;
|
|
118
121
|
export {
|
|
119
122
|
p as default
|
|
120
123
|
};
|