@mobilon-dev/chotto 0.3.82 → 0.3.83
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 +66 -51
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +145 -131
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +30 -23
- package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +10 -0
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -0
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.d.ts +2 -0
- package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -0
- package/dist/types/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +1 -1
- 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-7691fdbe"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ot, inject as lt, ref as u, computed as S, onMounted as it, onUnmounted as rt, createElementBlock as g, openBlock as c, Fragment as O, createElementVNode as at, createBlock as nt, renderSlot as ut, Teleport as st, createVNode as ct, Transition as ft, withCtx as mt, createCommentVNode as ht, renderList as pt, normalizeStyle as vt, normalizeClass as dt, unref as M, toDisplayString as gt, nextTick as k } from "vue";
|
|
2
2
|
import "../../../hooks/useMessageDraft.js";
|
|
3
3
|
import "../../../hooks/useSearchModel.js";
|
|
4
|
-
import { useTheme as
|
|
4
|
+
import { useTheme as Tt } 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 yt = { key: 0 }, wt = ["data-theme"], xt = 6, _t = 120, Nt = /* @__PURE__ */ ot({
|
|
11
11
|
__name: "Tooltip",
|
|
12
12
|
props: {
|
|
13
13
|
text: {
|
|
@@ -40,21 +40,25 @@ const Tt = { key: 0 }, dt = ["data-theme"], yt = 6, wt = 120, Dt = /* @__PURE__
|
|
|
40
40
|
type: Number,
|
|
41
41
|
default: 600
|
|
42
42
|
},
|
|
43
|
+
hideOnClick: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
43
47
|
maxWidth: {
|
|
44
48
|
type: String,
|
|
45
49
|
default: ""
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
|
-
setup(
|
|
49
|
-
const
|
|
52
|
+
setup(P, { expose: $ }) {
|
|
53
|
+
const T = lt("chatAppId"), { getTheme: C } = Tt(T), y = u(), f = u([]), s = u(!1), m = u(null), n = u(null), i = u(null), h = u(!1), p = u(!1), e = P, W = S(() => ({
|
|
50
54
|
tooltip__text: !0,
|
|
51
55
|
[`tooltip--${e.position}`]: !0
|
|
52
|
-
})),
|
|
56
|
+
})), R = S(() => ({
|
|
53
57
|
maxWidth: e.maxWidth || void 0
|
|
54
|
-
})),
|
|
58
|
+
})), H = S(() => {
|
|
55
59
|
const t = Array.isArray(e.texts) ? e.texts.map((o) => String(o ?? "").trim()).filter(Boolean) : [];
|
|
56
60
|
return t.length > 0 ? t : e.text ? [e.text] : [];
|
|
57
|
-
}),
|
|
61
|
+
}), V = (t, o) => {
|
|
58
62
|
const l = o.left < 0 ? o.left : 0, r = o.top < 0 ? o.top : 0;
|
|
59
63
|
return {
|
|
60
64
|
left: {
|
|
@@ -87,76 +91,87 @@ const Tt = { key: 0 }, dt = ["data-theme"], yt = 6, wt = 120, Dt = /* @__PURE__
|
|
|
87
91
|
}
|
|
88
92
|
}[e.position];
|
|
89
93
|
}, L = () => {
|
|
90
|
-
if (!
|
|
91
|
-
const t =
|
|
92
|
-
f.value.forEach((
|
|
93
|
-
const
|
|
94
|
-
|
|
94
|
+
if (!y.value || f.value.length === 0) return;
|
|
95
|
+
const t = y.value.getBoundingClientRect(), o = e.position.startsWith("top"), l = 8, r = T ? document.getElementById(T) : null, a = r == null ? void 0 : r.getBoundingClientRect(), U = (a == null ? void 0 : a.top) ?? 0, X = (a == null ? void 0 : a.left) ?? 0, Y = (a == null ? void 0 : a.right) ?? window.innerWidth, J = (a == null ? void 0 : a.bottom) ?? window.innerHeight;
|
|
96
|
+
f.value.forEach((x, Q) => {
|
|
97
|
+
const d = x.getBoundingClientRect(), _ = V(t, d), D = Q * (d.height + xt), Z = o ? _.top - D : _.top + D, I = U + l, b = J - d.height - l, N = X + l, B = Y - d.width - l, tt = Math.min(Math.max(Z, I), Math.max(I, b)), et = Math.min(Math.max(_.left, N), Math.max(N, B));
|
|
98
|
+
x.style.top = `${tt}px`, x.style.left = `${et}px`;
|
|
95
99
|
});
|
|
96
|
-
},
|
|
100
|
+
}, q = () => {
|
|
97
101
|
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,
|
|
102
|
+
s.value = !0, k(() => {
|
|
99
103
|
L();
|
|
100
104
|
}), n.value = null;
|
|
101
105
|
}, e.delay));
|
|
102
|
-
},
|
|
103
|
-
e.trigger !== "auto" && (n.value && (clearTimeout(n.value), n.value = null), i.value && (clearTimeout(i.value), i.value = null), s.value = !1,
|
|
104
|
-
|
|
106
|
+
}, w = () => {
|
|
107
|
+
e.trigger !== "auto" && (n.value && (clearTimeout(n.value), n.value = null), i.value && (clearTimeout(i.value), i.value = null), s.value = !1, k(() => {
|
|
108
|
+
M(f).forEach((o) => {
|
|
105
109
|
o.style.top = "0", o.style.left = "0";
|
|
106
110
|
});
|
|
107
111
|
}));
|
|
108
|
-
},
|
|
112
|
+
}, A = () => {
|
|
109
113
|
e.trigger !== "auto" && (i.value && clearTimeout(i.value), i.value = setTimeout(() => {
|
|
110
|
-
!
|
|
111
|
-
},
|
|
114
|
+
!h.value && !p.value && w();
|
|
115
|
+
}, _t));
|
|
112
116
|
}, z = () => {
|
|
113
|
-
|
|
114
|
-
}, O = () => {
|
|
115
|
-
T.value = !1, k();
|
|
117
|
+
h.value = !0, q();
|
|
116
118
|
}, j = () => {
|
|
117
|
-
|
|
119
|
+
h.value = !1, A();
|
|
118
120
|
}, F = () => {
|
|
119
|
-
|
|
121
|
+
p.value = !0, i.value && (clearTimeout(i.value), i.value = null);
|
|
120
122
|
}, G = () => {
|
|
121
|
-
|
|
123
|
+
p.value = !1, A();
|
|
124
|
+
}, E = () => {
|
|
125
|
+
if (e.hideOnClick) {
|
|
126
|
+
if (h.value = !1, p.value = !1, e.trigger === "auto") {
|
|
127
|
+
v(), s.value = !1;
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
w();
|
|
131
|
+
}
|
|
132
|
+
}, K = () => {
|
|
133
|
+
v(), s.value = !0, k(() => {
|
|
122
134
|
L();
|
|
123
135
|
}), e.autoShowDuration > 0 && (m.value = setTimeout(() => {
|
|
124
136
|
s.value = !1;
|
|
125
137
|
}, e.autoShowDuration));
|
|
126
|
-
},
|
|
138
|
+
}, v = () => {
|
|
127
139
|
m.value && (clearTimeout(m.value), m.value = null);
|
|
128
140
|
};
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
}),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
return it(() => {
|
|
142
|
+
e.hideOnClick && document.addEventListener("mousedown", E, !0);
|
|
143
|
+
}), rt(() => {
|
|
144
|
+
e.hideOnClick && document.removeEventListener("mousedown", E, !0), n.value && clearTimeout(n.value), i.value && clearTimeout(i.value), v();
|
|
145
|
+
}), $({
|
|
146
|
+
startAutoShow: K,
|
|
147
|
+
clearAutoTimer: v,
|
|
148
|
+
hide: w
|
|
149
|
+
}), (t, o) => (c(), g(O, null, [
|
|
150
|
+
at("div", {
|
|
136
151
|
ref_key: "container",
|
|
137
|
-
ref:
|
|
152
|
+
ref: y,
|
|
138
153
|
class: "tooltip-wrapper",
|
|
139
154
|
onMouseenter: z,
|
|
140
|
-
onMouseleave:
|
|
155
|
+
onMouseleave: j
|
|
141
156
|
}, [
|
|
142
|
-
|
|
157
|
+
ut(t.$slots, "default", {}, void 0, !0)
|
|
143
158
|
], 544),
|
|
144
|
-
(c(),
|
|
145
|
-
|
|
146
|
-
default:
|
|
147
|
-
s.value ? (c(),
|
|
148
|
-
(c(!0),
|
|
159
|
+
(c(), nt(st, { to: "body" }, [
|
|
160
|
+
ct(ft, null, {
|
|
161
|
+
default: mt(() => [
|
|
162
|
+
s.value ? (c(), g("div", yt, [
|
|
163
|
+
(c(!0), g(O, null, pt(H.value, (l, r) => (c(), g("span", {
|
|
149
164
|
key: `${l}-${r}`,
|
|
150
165
|
ref_for: !0,
|
|
151
166
|
ref_key: "tooltipItems",
|
|
152
167
|
ref: f,
|
|
153
|
-
"data-theme":
|
|
154
|
-
class:
|
|
155
|
-
style:
|
|
156
|
-
onMouseenter:
|
|
157
|
-
onMouseleave:
|
|
158
|
-
},
|
|
159
|
-
])) :
|
|
168
|
+
"data-theme": M(C)().theme ? M(C)().theme : "light",
|
|
169
|
+
class: dt(W.value),
|
|
170
|
+
style: vt(R.value),
|
|
171
|
+
onMouseenter: F,
|
|
172
|
+
onMouseleave: G
|
|
173
|
+
}, gt(l), 47, wt))), 128))
|
|
174
|
+
])) : ht("", !0)
|
|
160
175
|
]),
|
|
161
176
|
_: 1
|
|
162
177
|
})
|
|
@@ -165,5 +180,5 @@ const Tt = { key: 0 }, dt = ["data-theme"], yt = 6, wt = 120, Dt = /* @__PURE__
|
|
|
165
180
|
}
|
|
166
181
|
});
|
|
167
182
|
export {
|
|
168
|
-
|
|
183
|
+
Nt as default
|
|
169
184
|
};
|