@farris/ui-vue 1.8.5-beta.18 → 1.8.5-beta.19
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/components/batch-editor/index.esm.js +7183 -7160
- package/components/batch-editor/index.umd.cjs +19 -19
- package/components/button/index.esm.js +7187 -7164
- package/components/button/index.umd.cjs +19 -19
- package/components/data-grid/index.esm.js +415 -408
- package/components/data-grid/index.umd.cjs +2 -2
- package/components/data-view/index.esm.js +13150 -13108
- package/components/data-view/index.umd.cjs +21 -21
- package/components/mapping-editor/index.esm.js +897 -890
- package/components/mapping-editor/index.umd.cjs +2 -2
- package/components/tooltip/index.esm.js +241 -225
- package/components/tooltip/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +14440 -14398
- package/designer/data-grid/index.umd.cjs +27 -27
- package/designer/data-view/index.esm.js +4 -4
- package/designer/data-view/index.umd.cjs +4 -4
- package/designer/farris-designer.all.esm.js +5870 -5863
- package/designer/farris-designer.all.umd.cjs +14 -14
- package/farris.all.esm.js +13342 -13300
- package/farris.all.umd.cjs +40 -40
- package/package.json +1 -1
- package/themes/default/farris-variables.css +1 -1
- package/themes/mano/farris-variables.css +1 -1
- package/types/common/utils/measure-host.d.ts +18 -3
- package/types/data-view/composition/types.d.ts +7 -3
- package/types/data-view/composition/visualization/merge-cell-rule.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
1
|
+
import { ref as w, onMounted as Y, isRef as ot, computed as T, defineComponent as nt, watch as lt, createVNode as g, Fragment as it, Teleport as rt, nextTick as B, mergeProps as G, reactive as ct, createApp as st, onUnmounted as ut } from "vue";
|
|
2
|
+
const at = {
|
|
3
3
|
/**
|
|
4
4
|
* 提示内容,可以是字符串,可以是带 HTML 标签的字符串
|
|
5
5
|
*/
|
|
@@ -41,14 +41,14 @@ const dt = {
|
|
|
41
41
|
// 是否根据溢出自动显示提示
|
|
42
42
|
overflowShown: { type: Boolean, default: !1 }
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
const t =
|
|
46
|
-
return
|
|
44
|
+
function ft() {
|
|
45
|
+
const t = w(!1);
|
|
46
|
+
return Y(() => {
|
|
47
47
|
t.value = !0;
|
|
48
48
|
}), t;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const
|
|
50
|
+
function dt(t, e) {
|
|
51
|
+
const o = /* @__PURE__ */ new Map([
|
|
52
52
|
["top", "bottom"],
|
|
53
53
|
["bottom", "top"],
|
|
54
54
|
["left", "right"],
|
|
@@ -59,354 +59,370 @@ function vt(t, e) {
|
|
|
59
59
|
["left", "width"],
|
|
60
60
|
["right", "width"]
|
|
61
61
|
]);
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
return
|
|
62
|
+
function u(n, i) {
|
|
63
|
+
const a = o.get(i) || i;
|
|
64
|
+
return n.replace(i, a);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
let v =
|
|
68
|
-
const
|
|
69
|
-
return Math.abs(
|
|
66
|
+
function c(n, i, a, r, f) {
|
|
67
|
+
let v = n;
|
|
68
|
+
const d = n.split("-")[0], p = l.get(d), m = r[p] + f[p];
|
|
69
|
+
return Math.abs(a[d] - i[d]) < m && (v = u(n, d)), v;
|
|
70
70
|
}
|
|
71
|
-
return { adjustPlacement:
|
|
71
|
+
return { adjustPlacement: c };
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
function l(
|
|
75
|
-
let
|
|
76
|
-
return (
|
|
73
|
+
function pt(t, e) {
|
|
74
|
+
function l(c, n, i) {
|
|
75
|
+
let a = !1, r = i;
|
|
76
|
+
return (n === "left" || n === "top") && i <= c[n] && (a = !0, r = c[n] + 6), (n === "right" || n === "bottom") && i >= c[n] && (a = !0, r = c[n] - 6), { overBound: a, fixedValue: r };
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
let
|
|
80
|
-
const b =
|
|
78
|
+
function u(c, n, i, a, r, f, v) {
|
|
79
|
+
let d = n.tooltip.left, p = n.tooltip.top, m = n.arrow.left, y = n.arrow.top;
|
|
80
|
+
const b = c.split("-")[0];
|
|
81
81
|
if (["top", "bottom"].includes(b)) {
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const x = l(i, "left", n.tooltip.left), C = l(i, "right", n.tooltip.left + r.width);
|
|
83
|
+
d = x.overBound ? x.fixedValue : C.overBound ? C.fixedValue - r.width : n.tooltip.left, m = x.overBound ? r.width - (d + r.width - a.right) - v.width : C.overBound ? a.left - d : n.arrow.left;
|
|
84
84
|
}
|
|
85
|
-
const E = l(i, "top",
|
|
86
|
-
return p = E.overBound ? E.fixedValue :
|
|
85
|
+
const E = l(i, "top", n.tooltip.top), S = l(i, "bottom", n.tooltip.top + r.height);
|
|
86
|
+
return p = E.overBound ? E.fixedValue : S.overBound ? S.fixedValue - r.height : n.tooltip.top, y = E.overBound ? n.arrow.top : S.overBound ? r.height - (p + r.height - a.top) : n.arrow.top, { arrow: { left: m, top: y }, tooltip: { left: d, top: p } };
|
|
87
87
|
}
|
|
88
|
-
return { adjustPosition:
|
|
88
|
+
return { adjustPosition: u };
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
function l(
|
|
92
|
-
const v =
|
|
93
|
-
return { left:
|
|
90
|
+
function vt(t, e) {
|
|
91
|
+
function l(n, i, a, r, f) {
|
|
92
|
+
const v = n.split("-"), d = v[0], p = v[1] || "middle", m = ["top", "bottom"].includes(d) ? p === "middle" ? (r.width - f.width) / 2 : p === "right" ? r.width - f.width - 6 : 6 : 0, y = ["left", "right"].includes(d) ? p === "middle" ? (r.height - f.height) / 2 : p === "bottom" ? r.height - f.height - 6 : 6 : 0, L = d === "left" ? r.width + f.width : 0, b = d === "top" ? r.height + f.height : 0;
|
|
93
|
+
return { left: L + m, top: b + y, right: 0 };
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
const v =
|
|
97
|
-
return { left:
|
|
95
|
+
function u(n, i, a, r, f) {
|
|
96
|
+
const v = n.split("-"), d = v[0], p = v[1] || "middle", m = (a.width - r.width) / 2, y = (a.height - r.height) / 2, L = d === "right" ? i.right : i.left, b = d === "bottom" ? i.bottom : i.top, E = d === "top" ? 0 - y - r.height - f.height : d === "bottom" ? 0 - y + f.height : 0, S = ["left", "right"].includes(d) ? p === "middle" ? (i.height - r.height) / 2 : p === "bottom" ? i.height - r.height : 0 : 0, H = d === "left" ? 0 - m - r.width - f.width : d === "right" ? 0 - m + f.width : 0, j = ["top", "bottom"].includes(d) ? p === "middle" ? (i.width - r.width) / 2 : p === "right" ? i.width - r.width : 0 : 0, x = b + E + S;
|
|
97
|
+
return { left: L + H + j, top: x };
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const v =
|
|
101
|
-
return { arrow: l(
|
|
99
|
+
function c(n, i, a, r, f) {
|
|
100
|
+
const v = u(n, i, a, r, f);
|
|
101
|
+
return { arrow: l(n, i, a, r, f), tooltip: v };
|
|
102
102
|
}
|
|
103
|
-
return { calculate:
|
|
103
|
+
return { calculate: c };
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const e =
|
|
105
|
+
function ht(t) {
|
|
106
|
+
const e = ot(t) ? t.value : t;
|
|
107
107
|
return typeof e == "string" ? e === "body" || typeof document > "u" ? "body" : document.querySelector(e) || "body" : !!e && typeof e.getBoundingClientRect == "function" && typeof e.insertBefore == "function" ? e : "body";
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function mt(t) {
|
|
110
110
|
return typeof document > "u" ? null : t === "body" ? document.body : t;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
115
|
-
const
|
|
112
|
+
function gt(t, e) {
|
|
113
|
+
const o = mt(t);
|
|
114
|
+
if (!o) {
|
|
115
|
+
const f = typeof window < "u" ? window.innerHeight : 0;
|
|
116
116
|
return {
|
|
117
117
|
left: 0,
|
|
118
118
|
top: 0,
|
|
119
119
|
width: 0,
|
|
120
|
-
height:
|
|
121
|
-
bottom:
|
|
120
|
+
height: f,
|
|
121
|
+
bottom: f,
|
|
122
122
|
scrollLeft: 0,
|
|
123
123
|
scrollTop: 0
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
const l =
|
|
127
|
-
let { width:
|
|
126
|
+
const l = o.getBoundingClientRect(), u = t === "body" || o === document.body, c = typeof window < "u" ? window.innerHeight : l.height;
|
|
127
|
+
let { width: n } = l;
|
|
128
128
|
const { top: i } = l;
|
|
129
|
-
let { bottom:
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
132
|
-
|
|
129
|
+
let { bottom: a, height: r } = l;
|
|
130
|
+
if (u) {
|
|
131
|
+
const f = Math.max(l.top, 0), v = Math.min(l.bottom, c);
|
|
132
|
+
a = v, r = Math.max(v - f, 0) || c, a <= f && (a = c);
|
|
133
133
|
}
|
|
134
134
|
return {
|
|
135
135
|
left: l.left,
|
|
136
136
|
top: i,
|
|
137
|
-
width:
|
|
137
|
+
width: n,
|
|
138
138
|
height: r,
|
|
139
|
-
bottom:
|
|
140
|
-
scrollLeft:
|
|
141
|
-
scrollTop:
|
|
139
|
+
bottom: a,
|
|
140
|
+
scrollLeft: o.scrollLeft || 0,
|
|
141
|
+
scrollTop: o.scrollTop || 0
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const e =
|
|
144
|
+
function wt(t) {
|
|
145
|
+
const e = t.ownerDocument, o = t.offsetParent;
|
|
146
|
+
if (!o)
|
|
147
|
+
return null;
|
|
148
|
+
if (o === e.body || o === e.documentElement) {
|
|
149
|
+
const u = (e.defaultView || window).getComputedStyle(o), c = (i) => !!i && i !== "none";
|
|
150
|
+
if (!(u.position !== "static" || c(u.transform) || c(u.filter) || c(u.perspective)))
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
return o;
|
|
154
|
+
}
|
|
155
|
+
function yt(t, e, o) {
|
|
156
|
+
const l = wt(t);
|
|
157
|
+
if (!l) {
|
|
158
|
+
const c = t.ownerDocument, n = c.defaultView || window, i = c.documentElement, a = (n.scrollX ?? i.scrollLeft) || 0, r = (n.scrollY ?? i.scrollTop) || 0;
|
|
159
|
+
return { left: e + a, top: o + r };
|
|
160
|
+
}
|
|
161
|
+
const u = l.getBoundingClientRect();
|
|
146
162
|
return {
|
|
147
|
-
left: e.left -
|
|
148
|
-
top:
|
|
163
|
+
left: e - u.left - (l.clientLeft || 0) + (l.scrollLeft || 0),
|
|
164
|
+
top: o - u.top - (l.clientTop || 0) + (l.scrollTop || 0)
|
|
149
165
|
};
|
|
150
166
|
}
|
|
151
|
-
function
|
|
152
|
-
const
|
|
153
|
-
function
|
|
167
|
+
function bt(t, e) {
|
|
168
|
+
const o = w(t.horizontalRelative), l = w(t.verticalRelative);
|
|
169
|
+
function u(i) {
|
|
154
170
|
return typeof i == "string" ? document.querySelector(i) : i;
|
|
155
171
|
}
|
|
156
|
-
function
|
|
157
|
-
return
|
|
172
|
+
function c() {
|
|
173
|
+
return gt(ht("body"));
|
|
158
174
|
}
|
|
159
|
-
function
|
|
160
|
-
const i =
|
|
161
|
-
let
|
|
162
|
-
return
|
|
175
|
+
function n() {
|
|
176
|
+
const i = c(), a = document.documentElement.clientWidth, r = document.documentElement.clientHeight;
|
|
177
|
+
let f = Math.max(i.left, 0), v = Math.max(i.top, 0), d = Math.min(i.left + i.width, a), p = Math.min(i.bottom, r), m = f, y = v, L = d - f, b = p - v;
|
|
178
|
+
return o.value && ({ left: f, right: d, x: m, width: L } = u(o.value).getBoundingClientRect()), l.value && ({ bottom: p, top: v, y, height: b } = u(l.value).getBoundingClientRect()), { top: v, left: f, right: d, bottom: p, height: b, width: L, x: m, y };
|
|
163
179
|
}
|
|
164
|
-
return { getRelativeElementBound:
|
|
180
|
+
return { getRelativeElementBound: n };
|
|
165
181
|
}
|
|
166
|
-
function
|
|
167
|
-
const
|
|
182
|
+
function Tt(t, e, o, l, u, c) {
|
|
183
|
+
const n = w(t.placement), { getRelativeElementBound: i } = bt(t), { calculate: a } = vt(), { adjustPlacement: r } = dt(), { adjustPosition: f } = pt(), v = T(() => n.value.split("-")[0]), d = T(() => {
|
|
168
184
|
const p = i();
|
|
169
|
-
|
|
170
|
-
const m =
|
|
171
|
-
return
|
|
172
|
-
|
|
185
|
+
n.value = r(n.value, p, o, l, c);
|
|
186
|
+
const m = a(n.value, o, l, u, c);
|
|
187
|
+
return f(
|
|
188
|
+
n.value,
|
|
173
189
|
m,
|
|
174
190
|
p,
|
|
175
|
-
|
|
191
|
+
o,
|
|
176
192
|
l,
|
|
177
|
-
|
|
178
|
-
|
|
193
|
+
u,
|
|
194
|
+
c
|
|
179
195
|
);
|
|
180
196
|
});
|
|
181
|
-
return { tooltipPlacement: v, tooltipPosition:
|
|
197
|
+
return { tooltipPlacement: v, tooltipPosition: d };
|
|
182
198
|
}
|
|
183
|
-
function
|
|
184
|
-
const e =
|
|
185
|
-
display:
|
|
186
|
-
})),
|
|
187
|
-
var
|
|
188
|
-
const
|
|
189
|
-
return
|
|
199
|
+
function Et(t) {
|
|
200
|
+
const e = w(), o = w(!1), l = T(() => ({
|
|
201
|
+
display: o.value ? "block" : "none"
|
|
202
|
+
})), u = T(() => {
|
|
203
|
+
var n;
|
|
204
|
+
const c = (n = t.customClass) == null ? void 0 : n.split(" ");
|
|
205
|
+
return c == null ? void 0 : c.reduce((i, a) => (i[a] = !0, i), {});
|
|
190
206
|
});
|
|
191
|
-
return { showTooltip:
|
|
207
|
+
return { showTooltip: o, tooltipDisplayStyle: l, tooltipCustomClass: u, tooltipContainerRef: e };
|
|
192
208
|
}
|
|
193
|
-
const
|
|
209
|
+
const M = /* @__PURE__ */ nt({
|
|
194
210
|
name: "FTooltip",
|
|
195
|
-
props:
|
|
211
|
+
props: at,
|
|
196
212
|
emits: ["click"],
|
|
197
213
|
setup(t, e) {
|
|
198
|
-
const
|
|
214
|
+
const o = w(), l = w(), u = w(), c = w(), n = w(), i = w(t.placement.split("-")[0]), a = Et(t), {
|
|
199
215
|
showTooltip: r,
|
|
200
|
-
tooltipCustomClass:
|
|
201
|
-
} =
|
|
202
|
-
let
|
|
216
|
+
tooltipCustomClass: f
|
|
217
|
+
} = a, v = w(!1), d = ft(), p = T(() => {
|
|
218
|
+
let s = {
|
|
203
219
|
"fv-tooltip": !0,
|
|
204
220
|
tooltip: !0,
|
|
205
221
|
show: !0
|
|
206
222
|
};
|
|
207
223
|
const h = `bs-tooltip-${i.value}`;
|
|
208
|
-
return
|
|
209
|
-
...
|
|
210
|
-
...
|
|
211
|
-
}),
|
|
212
|
-
}), m = (
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
const
|
|
224
|
+
return s[h] = !0, e.slots.default && (s = {
|
|
225
|
+
...s,
|
|
226
|
+
...f.value
|
|
227
|
+
}), s;
|
|
228
|
+
}), m = (s) => {
|
|
229
|
+
s.target !== n.value && (s.stopPropagation(), document.body.removeEventListener("click", m), r.value = !1);
|
|
230
|
+
}, y = T(() => t.content && !t.contentTemplate), L = T(() => t.content), b = w("0px"), E = w("0px"), S = T(() => {
|
|
231
|
+
const s = {
|
|
216
232
|
left: b.value,
|
|
217
233
|
top: E.value
|
|
218
234
|
};
|
|
219
|
-
return e.slots.default,
|
|
220
|
-
}), H =
|
|
235
|
+
return e.slots.default, s;
|
|
236
|
+
}), H = w(""), j = w(""), x = T(() => ({
|
|
221
237
|
left: H.value,
|
|
222
|
-
top:
|
|
223
|
-
})),
|
|
238
|
+
top: j.value
|
|
239
|
+
})), C = T(() => ({
|
|
224
240
|
"tooltip-inner": !0,
|
|
225
|
-
"tooltip-inner-lg":
|
|
241
|
+
"tooltip-inner-lg": c.value && c.value && c.value.scrollHeight > c.value.clientHeight
|
|
226
242
|
})), D = T(() => {
|
|
227
|
-
const
|
|
228
|
-
return t.width && Object.assign(
|
|
243
|
+
const s = {};
|
|
244
|
+
return t.width && Object.assign(s, {
|
|
229
245
|
width: t.width,
|
|
230
246
|
"max-width": "none"
|
|
231
|
-
}),
|
|
232
|
-
}),
|
|
233
|
-
l.value &&
|
|
247
|
+
}), s;
|
|
248
|
+
}), z = (s) => {
|
|
249
|
+
l.value && u.value && c.value && (C.value, B(() => {
|
|
234
250
|
const {
|
|
235
251
|
tooltipPlacement: h,
|
|
236
|
-
tooltipPosition:
|
|
237
|
-
} =
|
|
238
|
-
b.value = `${
|
|
252
|
+
tooltipPosition: k
|
|
253
|
+
} = Tt(t, e, s.getBoundingClientRect(), u.value.getBoundingClientRect(), c.value.getBoundingClientRect(), l.value.getBoundingClientRect()), O = yt(u.value, k.value.tooltip.left, k.value.tooltip.top);
|
|
254
|
+
b.value = `${O.left}px`, E.value = `${O.top}px`, H.value = `${k.value.arrow.left}px`, j.value = `${k.value.arrow.top}px`, i.value = h.value;
|
|
239
255
|
}));
|
|
240
|
-
},
|
|
241
|
-
var
|
|
242
|
-
const h = (
|
|
243
|
-
h && (t.overflowShown && h.scrollWidth === h.clientWidth || (
|
|
244
|
-
|
|
256
|
+
}, A = (s) => {
|
|
257
|
+
var k;
|
|
258
|
+
const h = (k = o.value) == null ? void 0 : k.nextElementSibling;
|
|
259
|
+
h && (t.overflowShown && h.scrollWidth === h.clientWidth || (s.stopPropagation(), r.value = !0, B(() => {
|
|
260
|
+
z(h);
|
|
245
261
|
}), t.trigger === "click" && document.body.addEventListener("click", m)));
|
|
246
|
-
},
|
|
247
|
-
|
|
262
|
+
}, N = (s, h = !0) => {
|
|
263
|
+
s.removeEventListener("mouseenter", A), s.removeEventListener("mouseleave", m), h && (s.addEventListener("mouseenter", A), s.addEventListener("mouseleave", m));
|
|
248
264
|
};
|
|
249
|
-
function F(
|
|
250
|
-
|
|
265
|
+
function F(s, h = !0) {
|
|
266
|
+
s.removeEventListener("mouseenter", A), s.removeEventListener("mouseleave", m), h && s.addEventListener("click", A);
|
|
251
267
|
}
|
|
252
268
|
function R() {
|
|
253
269
|
var h;
|
|
254
270
|
if (!t.enable)
|
|
255
271
|
return;
|
|
256
|
-
const
|
|
257
|
-
|
|
272
|
+
const s = (h = o.value) == null ? void 0 : h.nextElementSibling;
|
|
273
|
+
s && (t.trigger === "click" && F(s), t.trigger === "hover" && N(s));
|
|
258
274
|
}
|
|
259
|
-
function
|
|
275
|
+
function _() {
|
|
260
276
|
var h;
|
|
261
|
-
const
|
|
262
|
-
|
|
277
|
+
const s = (h = o.value) == null ? void 0 : h.nextElementSibling;
|
|
278
|
+
s && (t.trigger === "click" && F(s, !1), t.trigger === "hover" && N(s, !1));
|
|
263
279
|
}
|
|
264
|
-
|
|
265
|
-
|
|
280
|
+
lt(() => t.enable, (s) => {
|
|
281
|
+
s ? R() : _();
|
|
266
282
|
});
|
|
267
|
-
function
|
|
268
|
-
|
|
283
|
+
function K() {
|
|
284
|
+
o.value && o.value.nodeName === "#text" && !o.value.nextElementSibling && (v.value = !0, B(() => {
|
|
269
285
|
R();
|
|
270
286
|
}));
|
|
271
287
|
}
|
|
272
|
-
|
|
273
|
-
|
|
288
|
+
Y(() => {
|
|
289
|
+
K(), R(), !y.value && t.contentTemplate && n.value && n.value.appendChild(t.contentTemplate), t.reference && z(t.reference);
|
|
274
290
|
});
|
|
275
|
-
function I(
|
|
276
|
-
e.emit("click",
|
|
291
|
+
function I(s) {
|
|
292
|
+
e.emit("click", s);
|
|
277
293
|
}
|
|
278
|
-
const
|
|
279
|
-
ref:
|
|
294
|
+
const Q = () => g("div", {
|
|
295
|
+
ref: u,
|
|
280
296
|
class: p.value,
|
|
281
|
-
style:
|
|
297
|
+
style: S.value,
|
|
282
298
|
onClick: I
|
|
283
299
|
}, [g("div", {
|
|
284
300
|
ref: l,
|
|
285
301
|
class: "arrow",
|
|
286
|
-
style:
|
|
302
|
+
style: x.value
|
|
287
303
|
}, null), g("div", {
|
|
288
|
-
ref:
|
|
289
|
-
class:
|
|
304
|
+
ref: c,
|
|
305
|
+
class: C.value,
|
|
290
306
|
style: D.value
|
|
291
307
|
}, [g("div", {
|
|
292
308
|
class: "tooltip-tmpl"
|
|
293
|
-
}, [
|
|
309
|
+
}, [y.value && g("div", {
|
|
294
310
|
class: "tooltip-text",
|
|
295
|
-
innerHTML:
|
|
296
|
-
}, null), !
|
|
311
|
+
innerHTML: L.value
|
|
312
|
+
}, null), !y.value && g("div", {
|
|
297
313
|
class: "tooltip-text",
|
|
298
|
-
ref:
|
|
314
|
+
ref: n
|
|
299
315
|
}, null)])])]);
|
|
300
|
-
function
|
|
301
|
-
const
|
|
316
|
+
function Z() {
|
|
317
|
+
const s = {
|
|
302
318
|
class: "tooltip-text",
|
|
303
|
-
ref:
|
|
319
|
+
ref: n
|
|
304
320
|
};
|
|
305
321
|
if (e.slots.contentTemplate)
|
|
306
|
-
return g("div",
|
|
322
|
+
return g("div", s, [e.slots.contentTemplate()]);
|
|
307
323
|
if (t.content) {
|
|
308
324
|
let h = t.content;
|
|
309
|
-
return typeof t.content == "function" && (h = t.content()), g("div",
|
|
325
|
+
return typeof t.content == "function" && (h = t.content()), g("div", G(s, {
|
|
310
326
|
innerHTML: h
|
|
311
327
|
}), null);
|
|
312
328
|
}
|
|
313
|
-
return g("div",
|
|
329
|
+
return g("div", s, null);
|
|
314
330
|
}
|
|
315
|
-
const
|
|
316
|
-
ref:
|
|
331
|
+
const tt = () => g("div", {
|
|
332
|
+
ref: u,
|
|
317
333
|
class: p.value,
|
|
318
|
-
style:
|
|
334
|
+
style: S.value,
|
|
319
335
|
onClick: I
|
|
320
336
|
}, [g("div", {
|
|
321
337
|
ref: l,
|
|
322
338
|
class: "arrow",
|
|
323
|
-
style:
|
|
339
|
+
style: x.value
|
|
324
340
|
}, null), g("div", {
|
|
325
|
-
ref:
|
|
326
|
-
class:
|
|
341
|
+
ref: c,
|
|
342
|
+
class: C.value,
|
|
327
343
|
style: D.value
|
|
328
344
|
}, [g("div", {
|
|
329
345
|
class: "tooltip-tmpl"
|
|
330
|
-
}, [
|
|
331
|
-
function
|
|
332
|
-
var
|
|
333
|
-
return v.value ? g("span", null, [(h = (
|
|
346
|
+
}, [Z()])])]);
|
|
347
|
+
function et() {
|
|
348
|
+
var s, h, k, O;
|
|
349
|
+
return v.value ? g("span", null, [(h = (s = e.slots).default) == null ? void 0 : h.call(s)]) : (O = (k = e.slots).default) == null ? void 0 : O.call(k);
|
|
334
350
|
}
|
|
335
|
-
return () => e.slots.default ? g(
|
|
336
|
-
ref:
|
|
337
|
-
}, [
|
|
351
|
+
return () => e.slots.default ? g(it, {
|
|
352
|
+
ref: o
|
|
353
|
+
}, [et(), d.value && g(rt, {
|
|
338
354
|
to: "body"
|
|
339
355
|
}, {
|
|
340
|
-
default: () => [r.value &&
|
|
341
|
-
})]) :
|
|
356
|
+
default: () => [r.value && tt()]
|
|
357
|
+
})]) : Q();
|
|
342
358
|
}
|
|
343
359
|
});
|
|
344
|
-
function
|
|
345
|
-
const
|
|
346
|
-
t.customClass && (
|
|
347
|
-
const l =
|
|
360
|
+
function kt(t, e) {
|
|
361
|
+
const o = document.createElement("div");
|
|
362
|
+
t.customClass && (o.className = t.customClass);
|
|
363
|
+
const l = st({
|
|
348
364
|
setup() {
|
|
349
|
-
function
|
|
365
|
+
function u() {
|
|
350
366
|
t.clickToHide && l.unmount();
|
|
351
367
|
}
|
|
352
|
-
return
|
|
353
|
-
document.body.removeChild(
|
|
354
|
-
}), () => g(
|
|
355
|
-
onClick:
|
|
368
|
+
return ut(() => {
|
|
369
|
+
document.body.removeChild(o);
|
|
370
|
+
}), () => g(M, G(t, {
|
|
371
|
+
onClick: u
|
|
356
372
|
}), null);
|
|
357
373
|
}
|
|
358
374
|
});
|
|
359
|
-
return document.body.appendChild(
|
|
375
|
+
return document.body.appendChild(o), l.mount(o), l;
|
|
360
376
|
}
|
|
361
|
-
function
|
|
362
|
-
const e =
|
|
377
|
+
function J(t) {
|
|
378
|
+
const e = ct({
|
|
363
379
|
...t
|
|
364
380
|
});
|
|
365
|
-
return
|
|
381
|
+
return kt(e);
|
|
366
382
|
}
|
|
367
|
-
const
|
|
368
|
-
function
|
|
383
|
+
const P = /* @__PURE__ */ new WeakMap();
|
|
384
|
+
function U(t) {
|
|
369
385
|
if (!t)
|
|
370
386
|
return;
|
|
371
|
-
const e =
|
|
372
|
-
e && (e.unmount(),
|
|
387
|
+
const e = P.get(t);
|
|
388
|
+
e && (e.unmount(), P.delete(t));
|
|
373
389
|
}
|
|
374
|
-
function
|
|
375
|
-
let
|
|
390
|
+
function Lt(t, e) {
|
|
391
|
+
let o;
|
|
376
392
|
t.addEventListener("mouseenter", (l) => {
|
|
377
|
-
if (e.value.enable !== !1 && !(e.value.overflowShown && t.scrollWidth === t.clientWidth) && (l.stopPropagation(), !
|
|
378
|
-
const
|
|
393
|
+
if (e.value.enable !== !1 && !(e.value.overflowShown && t.scrollWidth === t.clientWidth) && (l.stopPropagation(), !o)) {
|
|
394
|
+
const u = t.dataset.tooltip && JSON.parse(t.dataset.tooltip) || {}, c = Object.assign({
|
|
379
395
|
reference: t,
|
|
380
396
|
contentTemplate: e.value.contentTemplate
|
|
381
|
-
},
|
|
382
|
-
|
|
397
|
+
}, u);
|
|
398
|
+
o = J(c), P.set(t, o);
|
|
383
399
|
}
|
|
384
400
|
}), t.addEventListener("mouseleave", (l) => {
|
|
385
|
-
l.stopPropagation(),
|
|
401
|
+
l.stopPropagation(), o && (P.delete(t), o.unmount(), o = null);
|
|
386
402
|
});
|
|
387
403
|
}
|
|
388
404
|
let $ = null;
|
|
389
|
-
const
|
|
390
|
-
function
|
|
391
|
-
document.querySelectorAll(`.${
|
|
392
|
-
|
|
405
|
+
const V = "_farris-tooltip-directive_";
|
|
406
|
+
function W() {
|
|
407
|
+
document.querySelectorAll(`.${V}`).forEach((t) => {
|
|
408
|
+
U(t);
|
|
393
409
|
});
|
|
394
410
|
}
|
|
395
411
|
function St(t, e) {
|
|
396
|
-
t.addEventListener("click", (
|
|
412
|
+
t.addEventListener("click", (o) => {
|
|
397
413
|
if (e.value.enable === !1 || e.value.overflowShown === !0 && t.scrollWidth === t.clientWidth)
|
|
398
414
|
return;
|
|
399
|
-
|
|
400
|
-
let l =
|
|
415
|
+
o.stopPropagation();
|
|
416
|
+
let l = P.get(t);
|
|
401
417
|
if (l)
|
|
402
|
-
l.unmount(),
|
|
418
|
+
l.unmount(), P.delete(t);
|
|
403
419
|
else {
|
|
404
|
-
|
|
405
|
-
const
|
|
420
|
+
W();
|
|
421
|
+
const u = t.dataset.tooltip && JSON.parse(t.dataset.tooltip) || {}, c = Object.assign({
|
|
406
422
|
trigger: "hover",
|
|
407
423
|
reference: t
|
|
408
|
-
},
|
|
409
|
-
l =
|
|
424
|
+
}, u);
|
|
425
|
+
l = J(c), P.set(t, l);
|
|
410
426
|
}
|
|
411
427
|
});
|
|
412
428
|
}
|
|
@@ -415,47 +431,47 @@ function q(t, e) {
|
|
|
415
431
|
t.dataset.tooltip = "";
|
|
416
432
|
else {
|
|
417
433
|
const {
|
|
418
|
-
contentTemplate:
|
|
434
|
+
contentTemplate: o,
|
|
419
435
|
...l
|
|
420
436
|
} = e.value;
|
|
421
437
|
t.dataset.tooltip = JSON.stringify(l);
|
|
422
438
|
}
|
|
423
439
|
}
|
|
424
|
-
function
|
|
425
|
-
e.value.trigger === "click" ||
|
|
440
|
+
function X(t, e) {
|
|
441
|
+
e.value.trigger === "click" || U(t);
|
|
426
442
|
}
|
|
427
|
-
const
|
|
428
|
-
mounted: (t, e,
|
|
429
|
-
switch (t.classList.add(
|
|
443
|
+
const xt = {
|
|
444
|
+
mounted: (t, e, o) => {
|
|
445
|
+
switch (t.classList.add(V), q(t, e), e.value.trigger) {
|
|
430
446
|
case "click": {
|
|
431
447
|
St(t, e);
|
|
432
448
|
break;
|
|
433
449
|
}
|
|
434
450
|
default:
|
|
435
|
-
|
|
451
|
+
Lt(t, e);
|
|
436
452
|
}
|
|
437
453
|
},
|
|
438
|
-
beforeUnmount: (t, e,
|
|
439
|
-
|
|
454
|
+
beforeUnmount: (t, e, o) => {
|
|
455
|
+
X(t, e);
|
|
440
456
|
},
|
|
441
|
-
unmounted: (t, e,
|
|
442
|
-
|
|
457
|
+
unmounted: (t, e, o) => {
|
|
458
|
+
X(t, e);
|
|
443
459
|
},
|
|
444
460
|
beforeUpdate: (t, e) => {
|
|
445
461
|
q(t, e);
|
|
446
462
|
}
|
|
447
463
|
};
|
|
448
|
-
typeof window < "u" && (window.clearAllTooltips =
|
|
464
|
+
typeof window < "u" && (window.clearAllTooltips = W);
|
|
449
465
|
typeof document < "u" && document.body && (document.body.removeEventListener("click", $, !0), document.body.addEventListener("click", $ = (t) => {
|
|
450
|
-
const e = t.target,
|
|
451
|
-
|
|
466
|
+
const e = t.target, o = e.closest(`.${V}`);
|
|
467
|
+
o && P.has(o) || e.closest(".tooltip") || W();
|
|
452
468
|
}, !0));
|
|
453
|
-
|
|
454
|
-
t.component(
|
|
469
|
+
M.install = (t) => {
|
|
470
|
+
t.component(M.name, M), t.directive("tooltip", xt);
|
|
455
471
|
};
|
|
456
472
|
export {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
473
|
+
M as FTooltip,
|
|
474
|
+
xt as FTooltipDirective,
|
|
475
|
+
M as default,
|
|
476
|
+
at as tooltipProps
|
|
461
477
|
};
|