@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.
- package/dist/action-group/index.js +39 -42
- package/dist/bubble/index.js +2003 -1229
- package/dist/container/index.js +4 -4
- package/dist/dropdown-menu/index.js +62 -77
- package/dist/feedback/index.js +42 -42
- package/dist/flow-layout-buttons/index.js +31 -34
- package/dist/history/index.js +42 -42
- package/dist/index.d.ts +350 -437
- package/dist/index.js +64 -57
- package/dist/index2.js +290 -358
- package/dist/loading.js +4 -0
- package/dist/question/index.js +54 -54
- package/dist/sender/index.js +1128 -935
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +74 -74
- package/dist/suggestion-pills/index.js +129 -179
- package/dist/suggestion-popover/index.js +177 -189
- package/dist/tiny-robot-svgs.js +197 -148
- package/dist/utils.js +15 -4
- package/package.json +4 -3
- package/dist/base-popper/index.js +0 -108
package/dist/container/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as m, useCssVars as v, useModel as d, computed as _, createElementBlock as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as m, useCssVars as v, useModel as d, computed as _, createElementBlock as w, openBlock as g, createElementVNode as n, renderSlot as r, createVNode as c, unref as a } from "vue";
|
|
2
|
+
import { l as h, w as $, s as C } from "../tiny-robot-svgs.js";
|
|
3
3
|
import u from "../icon-button/index.js";
|
|
4
4
|
import { _ as b } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k = { class: "tr-container__header-operations" }, y = { class: "tr-container__footer" }, E = /* @__PURE__ */ m({
|
|
@@ -18,8 +18,8 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
|
|
|
18
18
|
"234493b2": l.value ? "var(--tr-z-index-fixed)" : "-1",
|
|
19
19
|
"0c2ba509": l.value ? "1" : "0"
|
|
20
20
|
}));
|
|
21
|
-
const l = d(o, "show"), s = d(o, "fullscreen"), f = _(() => s.value ?
|
|
22
|
-
return (t, e) => (
|
|
21
|
+
const l = d(o, "show"), s = d(o, "fullscreen"), f = _(() => s.value ? h : $);
|
|
22
|
+
return (t, e) => (g(), w("div", z, [
|
|
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)),
|
|
@@ -1,87 +1,72 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as B, useCssVars as E, unref as f, useAttrs as N, computed as _, ref as m, watch as O, createElementBlock as o, openBlock as s, Fragment as w, createElementVNode as h, createVNode as W, normalizeStyle as v, normalizeClass as z, renderSlot as I, Transition as A, withCtx as F, createCommentVNode as H, renderList as L, toDisplayString as P } from "vue";
|
|
2
|
+
import { c as g, o as U } from "../index2.js";
|
|
3
|
+
import { t as n } from "../utils.js";
|
|
4
|
+
import { _ as b } from "../_plugin-vue_export-helper.js";
|
|
5
|
+
const j = { class: "tr-dropdown-menu__list" }, q = ["onClick"], G = /* @__PURE__ */ B({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
8
|
-
appendTo: {},
|
|
9
8
|
items: {},
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
minWidth: { default: 160 },
|
|
10
|
+
topOffset: { default: 0 }
|
|
12
11
|
},
|
|
13
|
-
emits: ["item-click"
|
|
14
|
-
setup(l, { emit:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
emits: ["item-click"],
|
|
13
|
+
setup(l, { emit: k }) {
|
|
14
|
+
E((e) => ({
|
|
15
|
+
d82a8430: f(n)(a.minWidth)
|
|
16
|
+
}));
|
|
17
|
+
const a = l, p = N(), y = _(() => p.style), t = m(!1), C = k, i = m(null), d = m(null), { x, y: $, update: S } = g(i), { width: D, height: T } = g(d), M = _(() => ({
|
|
18
|
+
left: `min(${n(x.value)}, 100% - ${n(D.value)})`,
|
|
19
|
+
top: `max(${n($.value)} - ${n(T.value)} + ${n(a.topOffset)} - 8px, 0px)`
|
|
20
|
+
}));
|
|
21
|
+
U(d, (e) => {
|
|
22
|
+
var u;
|
|
23
|
+
(u = i.value) != null && u.contains(e.target) && e.stopPropagation(), t.value = !1;
|
|
24
|
+
}), O(t, (e) => {
|
|
25
|
+
e && S();
|
|
26
26
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
c("click-outside", e), r.value = !1;
|
|
32
|
-
},
|
|
33
|
-
{ ignore: [u] }
|
|
34
|
-
);
|
|
35
|
-
else if (t.trigger === "hover") {
|
|
36
|
-
const e = k(
|
|
37
|
-
n(() => P(u.value)),
|
|
38
|
-
{ delayEnter: 100, delayLeave: 300 }
|
|
39
|
-
), m = k(d, { delayEnter: 100, delayLeave: 300 });
|
|
40
|
-
R(
|
|
41
|
-
() => [e.value, m.value],
|
|
42
|
-
([o, f]) => {
|
|
43
|
-
r.value = o || f;
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
const h = () => {
|
|
48
|
-
t.trigger === "click" && (r.value = !r.value);
|
|
49
|
-
}, y = (e) => {
|
|
50
|
-
r.value = !1, c("item-click", e);
|
|
27
|
+
const R = () => {
|
|
28
|
+
t.value = !t.value;
|
|
29
|
+
}, V = (e) => {
|
|
30
|
+
t.value = !1, C("item-click", e);
|
|
51
31
|
};
|
|
52
|
-
return (e,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
32
|
+
return (e, u) => (s(), o(w, null, [
|
|
33
|
+
h("div", {
|
|
34
|
+
class: z(["tr-dropdown-menu__wrapper", f(p).class]),
|
|
35
|
+
style: v(y.value),
|
|
36
|
+
ref_key: "dropDownTriggerRef",
|
|
37
|
+
ref: i,
|
|
38
|
+
onClick: R
|
|
39
|
+
}, [
|
|
40
|
+
I(e.$slots, "default", {}, void 0, !0)
|
|
41
|
+
], 6),
|
|
42
|
+
W(A, { name: "tr-dropdown-menu" }, {
|
|
43
|
+
default: F(() => [
|
|
44
|
+
t.value ? (s(), o("div", {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "tr-dropdown-menu",
|
|
47
|
+
style: v(M.value),
|
|
48
|
+
ref_key: "dropdownMenuRef",
|
|
49
|
+
ref: d
|
|
50
|
+
}, [
|
|
51
|
+
h("ul", j, [
|
|
52
|
+
(s(!0), o(w, null, L(a.items, (c) => (s(), o("li", {
|
|
53
|
+
class: "tr-dropdown-menu__list-item",
|
|
54
|
+
key: c.id,
|
|
55
|
+
onClick: (K) => V(c)
|
|
56
|
+
}, P(c.text), 9, q))), 128))
|
|
57
|
+
])
|
|
58
|
+
], 4)) : H("", !0)
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
})
|
|
62
|
+
], 64));
|
|
78
63
|
}
|
|
79
|
-
}),
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
l.component(
|
|
64
|
+
}), r = /* @__PURE__ */ b(G, [["__scopeId", "data-v-620f91f9"]]);
|
|
65
|
+
r.name = "TrDropdownMenu";
|
|
66
|
+
const J = function(l) {
|
|
67
|
+
l.component(r.name, r);
|
|
83
68
|
};
|
|
84
|
-
|
|
69
|
+
r.install = J;
|
|
85
70
|
export {
|
|
86
|
-
|
|
71
|
+
r as default
|
|
87
72
|
};
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as X, ref as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as X, ref as A, computed as z, onMounted as D, watch as O, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as E, renderList as S, toDisplayString as y, createVNode as h, unref as l, nextTick as q, createElementVNode as p, createBlock as d, withCtx as f, createTextVNode as j, resolveDynamicComponent as C } from "vue";
|
|
2
|
+
import { f as T, A as N, c as H, a as J, b as K, v as Q } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { B as R } from "../index3.js";
|
|
4
4
|
import $, { ActionGroupItem as V } from "../action-group/index.js";
|
|
5
|
-
import
|
|
5
|
+
import U from "../icon-button/index.js";
|
|
6
6
|
import { _ as P } from "../_plugin-vue_export-helper.js";
|
|
7
7
|
const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ X({
|
|
8
8
|
__name: "SourceList",
|
|
@@ -11,8 +11,8 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
11
11
|
linesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
12
12
|
},
|
|
13
13
|
setup(b) {
|
|
14
|
-
const m = b, e =
|
|
15
|
-
|
|
14
|
+
const m = b, e = A(!1), g = A([]), c = A(null), L = () => {
|
|
15
|
+
q(() => {
|
|
16
16
|
const u = g.value.slice(0, m.sources.length).map((o) => (o == null ? void 0 : o.offsetTop) || 0), n = Array.from(new Set(u));
|
|
17
17
|
if (n.length > m.linesLimit) {
|
|
18
18
|
const o = n[m.linesLimit - 1], s = u.lastIndexOf(o);
|
|
@@ -20,26 +20,26 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
20
20
|
} else
|
|
21
21
|
c.value = null;
|
|
22
22
|
});
|
|
23
|
-
},
|
|
24
|
-
D(L),
|
|
25
|
-
const
|
|
23
|
+
}, x = z(() => m.sources.length - (c.value || 0));
|
|
24
|
+
D(L), O(() => m.sources, L);
|
|
25
|
+
const _ = (u, n) => {
|
|
26
26
|
u && (g.value[n] = u);
|
|
27
27
|
};
|
|
28
28
|
return (u, n) => (t(), a("div", W, [
|
|
29
|
-
(t(!0), a(
|
|
29
|
+
(t(!0), a(E, null, S(m.sources, (o, s) => (t(), a(E, { key: s }, [
|
|
30
30
|
!c.value || e.value || s < c.value ? (t(), a("a", {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "pill",
|
|
33
33
|
href: o.link,
|
|
34
34
|
target: "_blank",
|
|
35
35
|
ref_for: !0,
|
|
36
|
-
ref: (r) =>
|
|
36
|
+
ref: (r) => _(r, s)
|
|
37
37
|
}, y(o.label), 9, Y)) : k("", !0),
|
|
38
38
|
c.value && !e.value && s === c.value ? (t(), a("span", {
|
|
39
39
|
key: 1,
|
|
40
40
|
class: "pill",
|
|
41
41
|
onClick: n[0] || (n[0] = (r) => e.value = !0)
|
|
42
|
-
}, y(
|
|
42
|
+
}, y(x.value) + "+ ", 1)) : k("", !0)
|
|
43
43
|
], 64))), 128)),
|
|
44
44
|
e.value ? (t(), a("span", {
|
|
45
45
|
key: 0,
|
|
@@ -66,25 +66,25 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
66
66
|
emits: ["operation", "action"],
|
|
67
67
|
setup(b, { emit: m }) {
|
|
68
68
|
const e = b, g = {
|
|
69
|
-
copy:
|
|
70
|
-
refresh:
|
|
71
|
-
like:
|
|
72
|
-
dislike:
|
|
69
|
+
copy: Q,
|
|
70
|
+
refresh: K,
|
|
71
|
+
like: J,
|
|
72
|
+
dislike: H
|
|
73
73
|
}, c = m, L = (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
|
-
},
|
|
76
|
+
}, x = (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
|
-
},
|
|
80
|
-
|
|
79
|
+
}, _ = A(!1), u = () => {
|
|
80
|
+
_.value = !_.value;
|
|
81
81
|
};
|
|
82
82
|
return (n, o) => {
|
|
83
83
|
var s, r, v, w, B, F, M, G;
|
|
84
84
|
return t(), a("div", te, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(s = e.operations) != null && s.length ? (t(),
|
|
85
|
+
p("div", se, [
|
|
86
|
+
p("div", oe, [
|
|
87
|
+
(s = e.operations) != null && s.length ? (t(), d(l($), {
|
|
88
88
|
key: 0,
|
|
89
89
|
"max-num": e.operationsLimit,
|
|
90
90
|
"drop-down-show-label-only": !0,
|
|
@@ -99,7 +99,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
99
99
|
class: "tr-feedback__operations-more-btn"
|
|
100
100
|
}, {
|
|
101
101
|
default: f(() => [
|
|
102
|
-
o[0] || (o[0] =
|
|
102
|
+
o[0] || (o[0] = p("span", null, "更多", -1)),
|
|
103
103
|
h(l(N))
|
|
104
104
|
]),
|
|
105
105
|
_: 1,
|
|
@@ -107,7 +107,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
107
107
|
})
|
|
108
108
|
]),
|
|
109
109
|
default: f(() => [
|
|
110
|
-
(t(!0), a(
|
|
110
|
+
(t(!0), a(E, null, S(e.operations, (i) => (t(), d(l(V), {
|
|
111
111
|
key: i.name,
|
|
112
112
|
name: i.name,
|
|
113
113
|
label: i.label
|
|
@@ -119,7 +119,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
119
119
|
size: "mini"
|
|
120
120
|
}, {
|
|
121
121
|
default: f(() => [
|
|
122
|
-
|
|
122
|
+
j(y(i.label), 1)
|
|
123
123
|
]),
|
|
124
124
|
_: 2
|
|
125
125
|
}, 1024)
|
|
@@ -129,32 +129,32 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
129
129
|
]),
|
|
130
130
|
_: 1
|
|
131
131
|
}, 8, ["max-num"])) : (r = e.sources) != null && r.length ? (t(), a("div", ne, [
|
|
132
|
-
|
|
132
|
+
p("span", {
|
|
133
133
|
class: "tr-feedback__source",
|
|
134
134
|
onClick: u
|
|
135
135
|
}, [
|
|
136
|
-
|
|
137
|
-
(t(),
|
|
136
|
+
p("span", null, y((v = e.sources) == null ? void 0 : v.length) + "条来源", 1),
|
|
137
|
+
(t(), d(C(_.value ? l(T) : l(N))))
|
|
138
138
|
])
|
|
139
139
|
])) : k("", !0)
|
|
140
140
|
]),
|
|
141
|
-
|
|
141
|
+
p("div", le, [
|
|
142
142
|
h(l($), {
|
|
143
143
|
"max-num": e.actionsLimit,
|
|
144
144
|
"show-tooltip": !0,
|
|
145
|
-
onItemClick:
|
|
145
|
+
onItemClick: x
|
|
146
146
|
}, {
|
|
147
147
|
default: f(() => [
|
|
148
|
-
(t(!0), a(
|
|
148
|
+
(t(!0), a(E, null, S(e.actions, (i) => (t(), d(l(V), {
|
|
149
149
|
key: i.name,
|
|
150
150
|
name: i.name,
|
|
151
151
|
label: i.label
|
|
152
152
|
}, {
|
|
153
153
|
default: f(() => [
|
|
154
|
-
typeof i.icon == "string" ? (t(),
|
|
154
|
+
typeof i.icon == "string" ? (t(), d(l(U), {
|
|
155
155
|
key: 0,
|
|
156
156
|
icon: g[i.icon]
|
|
157
|
-
}, null, 8, ["icon"])) : (t(),
|
|
157
|
+
}, null, 8, ["icon"])) : (t(), d(C(i.icon), { key: 1 }))
|
|
158
158
|
]),
|
|
159
159
|
_: 2
|
|
160
160
|
}, 1032, ["name", "label"]))), 128))
|
|
@@ -163,17 +163,17 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
163
163
|
}, 8, ["max-num"])
|
|
164
164
|
])
|
|
165
165
|
]),
|
|
166
|
-
(w = e.operations) != null && w.length && ((B = e.sources) != null && B.length) ||
|
|
166
|
+
(w = e.operations) != null && w.length && ((B = e.sources) != null && B.length) || _.value && e.sources ? (t(), a("div", ae, [
|
|
167
167
|
(F = e.operations) != null && F.length && ((M = e.sources) != null && M.length) ? (t(), a("div", re, [
|
|
168
|
-
|
|
168
|
+
p("span", {
|
|
169
169
|
class: "tr-feedback__source",
|
|
170
170
|
onClick: u
|
|
171
171
|
}, [
|
|
172
|
-
|
|
173
|
-
(t(),
|
|
172
|
+
p("span", null, y((G = e.sources) == null ? void 0 : G.length) + "条来源", 1),
|
|
173
|
+
(t(), d(C(_.value ? l(T) : l(N))))
|
|
174
174
|
])
|
|
175
175
|
])) : k("", !0),
|
|
176
|
-
|
|
176
|
+
_.value && e.sources ? (t(), d(l(ee), {
|
|
177
177
|
key: 1,
|
|
178
178
|
sources: e.sources,
|
|
179
179
|
"lines-limit": e.sourcesLinesLimit
|
|
@@ -182,12 +182,12 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
182
182
|
]);
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
}),
|
|
186
|
-
|
|
185
|
+
}), I = /* @__PURE__ */ P(ie, [["__scopeId", "data-v-cc6ef316"]]);
|
|
186
|
+
I.name = "TrFeedback";
|
|
187
187
|
const ce = function(b) {
|
|
188
|
-
b.component(
|
|
188
|
+
b.component(I.name, I);
|
|
189
189
|
};
|
|
190
|
-
|
|
190
|
+
I.install = ce;
|
|
191
191
|
export {
|
|
192
|
-
|
|
192
|
+
I as default
|
|
193
193
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { b as
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as C, Fragment as I, renderList as A, createCommentVNode as _, normalizeClass as b, createBlock as x, resolveDynamicComponent as B, toDisplayString as S, nextTick as H } from "vue";
|
|
2
|
+
import { A as X } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { b as j, o as J } from "../index2.js";
|
|
4
|
+
import { _ as K } from "../_plugin-vue_export-helper.js";
|
|
5
|
+
const P = ["onClick"], Q = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "tr-flow-layout__item-label"
|
|
8
|
-
},
|
|
8
|
+
}, U = { class: "tr-flow-layout__dropdown-wrapper" }, Y = ["onClick"], Z = { class: "tr-flow-layout__item-label" }, ee = /* @__PURE__ */ q({
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: /* @__PURE__ */ E({
|
|
11
11
|
items: {},
|
|
12
12
|
selected: {},
|
|
13
13
|
linesLimit: { default: Number.MAX_SAFE_INTEGER },
|
|
14
|
-
moreIcon: { default:
|
|
14
|
+
moreIcon: { default: X },
|
|
15
15
|
showMoreTrigger: { default: "click" }
|
|
16
16
|
}, {
|
|
17
17
|
selected: {},
|
|
18
18
|
selectedModifiers: {}
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ E(["item-click"], ["update:selected"]),
|
|
21
|
-
setup(d, { emit:
|
|
22
|
-
const n = d, u =
|
|
21
|
+
setup(d, { emit: D }) {
|
|
22
|
+
const n = d, u = G(d, "selected");
|
|
23
23
|
g(
|
|
24
24
|
() => n.items,
|
|
25
25
|
(t) => {
|
|
@@ -27,10 +27,10 @@ const K = ["onClick"], P = {
|
|
|
27
27
|
},
|
|
28
28
|
{ immediate: !0 }
|
|
29
29
|
);
|
|
30
|
-
const
|
|
30
|
+
const F = D, y = i(null), w = i(null), k = i(null), M = i([]), s = i(null), m = i(!1), c = i(!1), N = (t, o) => {
|
|
31
31
|
t && (M.value[o] = t);
|
|
32
32
|
}, L = () => {
|
|
33
|
-
s.value = null, m.value = !1,
|
|
33
|
+
s.value = null, m.value = !1, H(() => {
|
|
34
34
|
const t = y.value, o = w.value;
|
|
35
35
|
if (!t || !o)
|
|
36
36
|
return;
|
|
@@ -43,55 +43,52 @@ const K = ["onClick"], P = {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
g(() => n.items, L);
|
|
46
|
-
const { width: W } =
|
|
46
|
+
const { width: W } = j(y);
|
|
47
47
|
g(W, (t) => {
|
|
48
48
|
t > 0 && L();
|
|
49
49
|
});
|
|
50
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,
|
|
52
|
-
},
|
|
51
|
+
u.value = t, c.value = !1, F("item-click", t);
|
|
52
|
+
}, V = () => {
|
|
53
53
|
n.showMoreTrigger === "click" && (c.value = !c.value);
|
|
54
54
|
}, v = (t) => {
|
|
55
55
|
n.showMoreTrigger === "hover" && (c.value = t);
|
|
56
56
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
()
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
{ ignore: [k, w] }
|
|
63
|
-
), (t, o) => (l(), a("div", {
|
|
57
|
+
return J(k, (t) => {
|
|
58
|
+
var o, e;
|
|
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", {
|
|
64
61
|
class: "tr-flow-layout",
|
|
65
62
|
ref_key: "containerRef",
|
|
66
63
|
ref: y
|
|
67
64
|
}, [
|
|
68
|
-
(l(!0), a(
|
|
65
|
+
(l(!0), a(I, null, A(n.items, (e, f) => (l(), a(I, {
|
|
69
66
|
key: e.id
|
|
70
67
|
}, [
|
|
71
68
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
72
69
|
key: 0,
|
|
73
|
-
class:
|
|
70
|
+
class: b(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
74
71
|
ref_for: !0,
|
|
75
|
-
ref: (r) =>
|
|
72
|
+
ref: (r) => N(r, f),
|
|
76
73
|
onClick: (r) => R(e.id)
|
|
77
74
|
}, [
|
|
78
75
|
(l(), x(B(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
79
|
-
e.label ? (l(), a("span",
|
|
80
|
-
], 10,
|
|
76
|
+
e.label ? (l(), a("span", Q, S(e.label), 1)) : _("", !0)
|
|
77
|
+
], 10, P)) : _("", !0)
|
|
81
78
|
], 64))), 128)),
|
|
82
|
-
|
|
79
|
+
C("div", U, [
|
|
83
80
|
m.value ? _("", !0) : (l(), a("button", {
|
|
84
81
|
key: 0,
|
|
85
|
-
class:
|
|
82
|
+
class: b(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
|
|
86
83
|
ref_key: "moreButtonRef",
|
|
87
84
|
ref: w,
|
|
88
|
-
onClick:
|
|
85
|
+
onClick: V,
|
|
89
86
|
onMouseenter: o[0] || (o[0] = (e) => v(!0)),
|
|
90
87
|
onMouseleave: o[1] || (o[1] = (e) => v(!1))
|
|
91
88
|
}, [
|
|
92
89
|
(l(), x(B(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
93
90
|
], 34)),
|
|
94
|
-
|
|
91
|
+
C("div", {
|
|
95
92
|
class: "tr-flow-layout__dropdown-container",
|
|
96
93
|
onMouseenter: o[2] || (o[2] = (e) => v(!0)),
|
|
97
94
|
onMouseleave: o[3] || (o[3] = (e) => v(!1))
|
|
@@ -102,20 +99,20 @@ const K = ["onClick"], P = {
|
|
|
102
99
|
ref_key: "dropDownRef",
|
|
103
100
|
ref: k
|
|
104
101
|
}, [
|
|
105
|
-
(l(!0), a(
|
|
106
|
-
class:
|
|
102
|
+
(l(!0), a(I, null, A(z.value, (e) => (l(), a("button", {
|
|
103
|
+
class: b(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
|
|
107
104
|
key: e.id,
|
|
108
105
|
onClick: (f) => R(e.id)
|
|
109
106
|
}, [
|
|
110
107
|
(l(), x(B(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
111
|
-
|
|
108
|
+
C("span", Z, S(e.label), 1)
|
|
112
109
|
], 10, Y))), 128))
|
|
113
110
|
], 512)) : _("", !0)
|
|
114
111
|
], 32)
|
|
115
112
|
])
|
|
116
113
|
], 512));
|
|
117
114
|
}
|
|
118
|
-
}), p = /* @__PURE__ */
|
|
115
|
+
}), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-8d510691"]]);
|
|
119
116
|
p.name = "TrFlowLayout";
|
|
120
117
|
const te = function(d) {
|
|
121
118
|
d.component(p.name, p);
|