@mobilon-dev/chotto 0.3.66 → 0.3.68
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/chotto.css +1 -1
- package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +1 -1
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +120 -69
- package/dist/components/3_compounds/SideBar/SideBar.vue.js +213 -128
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +25 -2
- package/dist/types/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +1 -1
- package/dist/types/components/3_compounds/SideBar/SideBar.vue.d.ts +8 -0
- package/dist/types/components/3_compounds/SideBar/styles/types.d.ts +24 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Tooltip.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0487e8ee"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as et, inject as ot, ref as u, computed as _, onUnmounted as lt, createElementBlock as h, openBlock as c, Fragment as I, createElementVNode as it, createBlock as rt, renderSlot as at, Teleport as nt, createVNode as ut, Transition as st, withCtx as ct, createCommentVNode as ft, renderList as mt, normalizeStyle as pt, normalizeClass as ht, unref as S, toDisplayString as vt, nextTick as M } from "vue";
|
|
2
2
|
import "../../../hooks/useMessageDraft.js";
|
|
3
3
|
import "../../../hooks/useSearchModel.js";
|
|
4
|
-
import { useTheme as
|
|
4
|
+
import { useTheme as gt } from "../../../hooks/useTheme.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
8
8
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
9
9
|
import "../../../functions/parseMarkdown.js";
|
|
10
|
-
const
|
|
10
|
+
const Tt = { key: 0 }, dt = ["data-theme"], yt = 6, wt = 120, Dt = /* @__PURE__ */ et({
|
|
11
11
|
__name: "Tooltip",
|
|
12
12
|
props: {
|
|
13
13
|
text: {
|
|
14
14
|
type: String,
|
|
15
|
-
required: !
|
|
15
|
+
required: !1,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
texts: {
|
|
19
|
+
type: Array,
|
|
20
|
+
required: !1,
|
|
21
|
+
default: () => []
|
|
16
22
|
},
|
|
17
23
|
position: {
|
|
18
24
|
type: String,
|
|
@@ -33,79 +39,124 @@ const U = ["data-theme"], Z = /* @__PURE__ */ k({
|
|
|
33
39
|
delay: {
|
|
34
40
|
type: Number,
|
|
35
41
|
default: 600
|
|
42
|
+
},
|
|
43
|
+
maxWidth: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
36
46
|
}
|
|
37
47
|
},
|
|
38
|
-
setup(
|
|
39
|
-
const
|
|
48
|
+
setup(N, { expose: P }) {
|
|
49
|
+
const v = ot("chatAppId"), { getTheme: A } = gt(v), g = u(), f = u([]), s = u(!1), m = u(null), n = u(null), i = u(null), T = u(!1), d = u(!1), e = N, $ = _(() => ({
|
|
40
50
|
tooltip__text: !0,
|
|
41
|
-
[`tooltip--${
|
|
42
|
-
})),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
51
|
+
[`tooltip--${e.position}`]: !0
|
|
52
|
+
})), W = _(() => ({
|
|
53
|
+
maxWidth: e.maxWidth || void 0
|
|
54
|
+
})), R = _(() => {
|
|
55
|
+
const t = Array.isArray(e.texts) ? e.texts.map((o) => String(o ?? "").trim()).filter(Boolean) : [];
|
|
56
|
+
return t.length > 0 ? t : e.text ? [e.text] : [];
|
|
57
|
+
}), H = (t, o) => {
|
|
58
|
+
const l = o.left < 0 ? o.left : 0, r = o.top < 0 ? o.top : 0;
|
|
59
|
+
return {
|
|
60
|
+
left: {
|
|
61
|
+
top: t.top - (o.height - t.height) / 2 - r,
|
|
62
|
+
left: t.left - o.width - l - e.offset
|
|
63
|
+
},
|
|
64
|
+
right: {
|
|
65
|
+
top: t.top - (o.height - t.height) / 2 - r,
|
|
66
|
+
left: t.left + t.width - l + e.offset
|
|
67
|
+
},
|
|
68
|
+
bottom: {
|
|
69
|
+
top: t.bottom - r + e.offset,
|
|
70
|
+
left: t.left - l
|
|
71
|
+
},
|
|
72
|
+
"bottom-center": {
|
|
73
|
+
top: t.bottom - r + e.offset,
|
|
74
|
+
left: t.left + t.width / 2 - o.width / 2 - l
|
|
75
|
+
},
|
|
76
|
+
top: {
|
|
77
|
+
top: t.top - o.height - e.offset - r,
|
|
78
|
+
left: t.left - l
|
|
79
|
+
},
|
|
80
|
+
"top-center": {
|
|
81
|
+
top: t.top - o.height - e.offset - r,
|
|
82
|
+
left: t.left + t.width / 2 - o.width / 2 - l
|
|
83
|
+
},
|
|
84
|
+
"bottom-left": {
|
|
85
|
+
top: t.bottom - r + e.offset,
|
|
86
|
+
left: t.left + t.width - o.width - l
|
|
77
87
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
}[e.position];
|
|
89
|
+
}, L = () => {
|
|
90
|
+
if (!g.value || f.value.length === 0) return;
|
|
91
|
+
const t = g.value.getBoundingClientRect(), o = e.position.startsWith("top"), l = 8, r = v ? document.getElementById(v) : null, a = r == null ? void 0 : r.getBoundingClientRect(), K = (a == null ? void 0 : a.top) ?? 0, U = (a == null ? void 0 : a.left) ?? 0, X = (a == null ? void 0 : a.right) ?? window.innerWidth, Y = (a == null ? void 0 : a.bottom) ?? window.innerHeight;
|
|
92
|
+
f.value.forEach((w, J) => {
|
|
93
|
+
const p = w.getBoundingClientRect(), x = H(t, p), C = J * (p.height + yt), Q = o ? x.top - C : x.top + C, E = K + l, Z = Y - p.height - l, D = U + l, b = X - p.width - l, B = Math.min(Math.max(Q, E), Math.max(E, Z)), tt = Math.min(Math.max(x.left, D), Math.max(D, b));
|
|
94
|
+
w.style.top = `${B}px`, w.style.left = `${tt}px`;
|
|
95
|
+
});
|
|
96
|
+
}, V = () => {
|
|
97
|
+
e.trigger !== "auto" && (n.value && (clearTimeout(n.value), n.value = null), i.value && (clearTimeout(i.value), i.value = null), n.value = setTimeout(() => {
|
|
98
|
+
s.value = !0, M(() => {
|
|
99
|
+
L();
|
|
100
|
+
}), n.value = null;
|
|
101
|
+
}, e.delay));
|
|
102
|
+
}, q = () => {
|
|
103
|
+
e.trigger !== "auto" && (n.value && (clearTimeout(n.value), n.value = null), i.value && (clearTimeout(i.value), i.value = null), s.value = !1, M(() => {
|
|
104
|
+
S(f).forEach((o) => {
|
|
105
|
+
o.style.top = "0", o.style.left = "0";
|
|
106
|
+
});
|
|
107
|
+
}));
|
|
108
|
+
}, k = () => {
|
|
109
|
+
e.trigger !== "auto" && (i.value && clearTimeout(i.value), i.value = setTimeout(() => {
|
|
110
|
+
!T.value && !d.value && q();
|
|
111
|
+
}, wt));
|
|
112
|
+
}, z = () => {
|
|
113
|
+
T.value = !0, V();
|
|
114
|
+
}, O = () => {
|
|
115
|
+
T.value = !1, k();
|
|
116
|
+
}, j = () => {
|
|
117
|
+
d.value = !0, i.value && (clearTimeout(i.value), i.value = null);
|
|
118
|
+
}, F = () => {
|
|
119
|
+
d.value = !1, k();
|
|
120
|
+
}, G = () => {
|
|
121
|
+
y(), s.value = !0, M(() => {
|
|
122
|
+
L();
|
|
123
|
+
}), e.autoShowDuration > 0 && (m.value = setTimeout(() => {
|
|
124
|
+
s.value = !1;
|
|
125
|
+
}, e.autoShowDuration));
|
|
126
|
+
}, y = () => {
|
|
127
|
+
m.value && (clearTimeout(m.value), m.value = null);
|
|
83
128
|
};
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
}),
|
|
87
|
-
startAutoShow:
|
|
88
|
-
clearAutoTimer:
|
|
89
|
-
}), (
|
|
90
|
-
|
|
129
|
+
return lt(() => {
|
|
130
|
+
n.value && clearTimeout(n.value), i.value && clearTimeout(i.value), y();
|
|
131
|
+
}), P({
|
|
132
|
+
startAutoShow: G,
|
|
133
|
+
clearAutoTimer: y
|
|
134
|
+
}), (t, o) => (c(), h(I, null, [
|
|
135
|
+
it("div", {
|
|
91
136
|
ref_key: "container",
|
|
92
|
-
ref:
|
|
137
|
+
ref: g,
|
|
93
138
|
class: "tooltip-wrapper",
|
|
94
|
-
|
|
95
|
-
|
|
139
|
+
onMouseenter: z,
|
|
140
|
+
onMouseleave: O
|
|
96
141
|
}, [
|
|
97
|
-
|
|
142
|
+
at(t.$slots, "default", {}, void 0, !0)
|
|
98
143
|
], 544),
|
|
99
|
-
(
|
|
100
|
-
|
|
101
|
-
default:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
144
|
+
(c(), rt(nt, { to: "body" }, [
|
|
145
|
+
ut(st, null, {
|
|
146
|
+
default: ct(() => [
|
|
147
|
+
s.value ? (c(), h("div", Tt, [
|
|
148
|
+
(c(!0), h(I, null, mt(R.value, (l, r) => (c(), h("span", {
|
|
149
|
+
key: `${l}-${r}`,
|
|
150
|
+
ref_for: !0,
|
|
151
|
+
ref_key: "tooltipItems",
|
|
152
|
+
ref: f,
|
|
153
|
+
"data-theme": S(A)().theme ? S(A)().theme : "light",
|
|
154
|
+
class: ht($.value),
|
|
155
|
+
style: pt(W.value),
|
|
156
|
+
onMouseenter: j,
|
|
157
|
+
onMouseleave: F
|
|
158
|
+
}, vt(l), 47, dt))), 128))
|
|
159
|
+
])) : ft("", !0)
|
|
109
160
|
]),
|
|
110
161
|
_: 1
|
|
111
162
|
})
|
|
@@ -114,5 +165,5 @@ const U = ["data-theme"], Z = /* @__PURE__ */ k({
|
|
|
114
165
|
}
|
|
115
166
|
});
|
|
116
167
|
export {
|
|
117
|
-
|
|
168
|
+
Dt as default
|
|
118
169
|
};
|