y-design-ssr 1.1.12 → 1.1.14
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/libs/index.css +1 -1
- package/libs/index.mjs +2111 -1887
- package/libs/index.umd.js +2 -2
- package/libs/list/index.css +1 -1
- package/libs/list/index.umd.js +1 -1
- package/libs/tooltip/index.css +1 -1
- package/libs/tooltip/index.d.ts +12 -3
- package/libs/tooltip/index.mjs +396 -172
- package/libs/tooltip/index.umd.js +2 -2
- package/libs/tooltip/src/constants.d.ts +5 -1
- package/libs/tooltip/src/popper.d.ts +22 -3
- package/libs/tooltip/src/tooltip.d.ts +12 -3
- package/package.json +1 -1
package/libs/tooltip/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
3
|
-
(
|
|
1
|
+
import { ref as V, reactive as S, defineComponent as Q, getCurrentInstance as Z, watch as U, nextTick as y, onMounted as z, onBeforeUnmount as ft, createVNode as w, Teleport as lt, onBeforeUpdate as ht, Fragment as pt, mergeProps as D, isVNode as ct, createApp as ut, h as mt } from "vue";
|
|
2
|
+
const N = (t, e) => e ? typeof e == "string" ? ` ${t}--${e}` : Array.isArray(e) ? e.reduce((s, o) => s + N(t, o), "") : Object.keys(e).reduce(
|
|
3
|
+
(s, o) => s + (e[o] ? N(t, o) : ""),
|
|
4
4
|
""
|
|
5
|
-
) : "",
|
|
6
|
-
let
|
|
7
|
-
return
|
|
8
|
-
},
|
|
5
|
+
) : "", dt = (t) => (e, s) => {
|
|
6
|
+
let o = e, n = s;
|
|
7
|
+
return o && typeof o != "string" && (n = o, o = ""), o = o ? `${t}__${o}` : t, `${o}${N(o, n)}`;
|
|
8
|
+
}, gt = () => (t, e) => e ? `${N(`y-${t}`, e)}` : `y-${t}`, wt = {
|
|
9
9
|
"pull-refresh": {
|
|
10
10
|
pulling: "下拉刷新...",
|
|
11
11
|
loosing: "释放刷新...",
|
|
@@ -17,16 +17,16 @@ const $ = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t)
|
|
|
17
17
|
validateMessage: "请输入正确内容"
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"zh-CN":
|
|
20
|
+
V("zh-CN");
|
|
21
|
+
S({
|
|
22
|
+
"zh-CN": wt
|
|
23
23
|
});
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
return [
|
|
24
|
+
const R = (t) => {
|
|
25
|
+
const e = `y-${t}`;
|
|
26
|
+
return [e, dt(e), gt()];
|
|
27
27
|
};
|
|
28
|
-
var
|
|
29
|
-
const
|
|
28
|
+
var tt = /* @__PURE__ */ ((t) => (t.Top = "top", t.TopStart = "top-start", t.TopEnd = "top-end", t.Right = "right", t.RightStart = "right-start", t.RightEnd = "right-end", t.Left = "left", t.LeftStart = "left-start", t.LeftEnd = "left-end", t.Bottom = "bottom", t.BottomStart = "bottom-start", t.BottomEnd = "bottom-end", t))(tt || {});
|
|
29
|
+
const L = (t) => isNaN(Number(t)) && typeof t == "string" ? t : `${t}px`, ot = {
|
|
30
30
|
// 是否显示
|
|
31
31
|
modelValue: {
|
|
32
32
|
type: Boolean,
|
|
@@ -70,7 +70,7 @@ const W = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, R = {
|
|
|
70
70
|
type: Object,
|
|
71
71
|
default: {}
|
|
72
72
|
},
|
|
73
|
-
//
|
|
73
|
+
// 自动查找最佳位置
|
|
74
74
|
autoFlipping: {
|
|
75
75
|
type: Boolean,
|
|
76
76
|
default: !0
|
|
@@ -78,208 +78,432 @@ const W = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, R = {
|
|
|
78
78
|
// 展示位置
|
|
79
79
|
position: {
|
|
80
80
|
type: String,
|
|
81
|
-
default:
|
|
81
|
+
default: tt.Top
|
|
82
|
+
},
|
|
83
|
+
marginToEdge: {
|
|
84
|
+
type: Number,
|
|
85
|
+
default: 8
|
|
86
|
+
}
|
|
87
|
+
}, [xt, _] = R("popper"), M = 12, et = (t) => t.parentElement ? getComputedStyle(t.parentElement).position !== "static" ? t.parentElement : et(t.parentElement) : t, nt = (t, e, s) => {
|
|
88
|
+
let o = e || t.offsetTop, n = s || t.offsetLeft;
|
|
89
|
+
return t.parentElement ? (getComputedStyle(t.parentElement).position !== "static" && (o += t.parentElement.offsetTop, n += t.parentElement.offsetLeft), nt(t.parentElement, o, n)) : {
|
|
90
|
+
offsetLeft: n,
|
|
91
|
+
offsetTop: o
|
|
92
|
+
};
|
|
93
|
+
}, bt = (t) => {
|
|
94
|
+
const e = t.getBoundingClientRect();
|
|
95
|
+
return {
|
|
96
|
+
top: e.top + window.pageYOffset,
|
|
97
|
+
left: e.left + window.pageXOffset,
|
|
98
|
+
width: e.width,
|
|
99
|
+
height: e.height,
|
|
100
|
+
bottom: e.bottom + window.pageYOffset,
|
|
101
|
+
right: e.right + window.pageXOffset
|
|
102
|
+
};
|
|
103
|
+
}, yt = (t) => {
|
|
104
|
+
switch (t) {
|
|
105
|
+
case "top":
|
|
106
|
+
return "bottom";
|
|
107
|
+
case "bottom":
|
|
108
|
+
return "top";
|
|
109
|
+
case "left":
|
|
110
|
+
return "right";
|
|
111
|
+
case "right":
|
|
112
|
+
return "left";
|
|
113
|
+
default:
|
|
114
|
+
return "bottom";
|
|
115
|
+
}
|
|
116
|
+
}, Mt = (t) => [t, yt(t), "top", "bottom", "left", "right"].filter((s, o, n) => n.indexOf(s) === o), $t = ({
|
|
117
|
+
referenceRect: t,
|
|
118
|
+
rectWidth: e,
|
|
119
|
+
rectHeight: s,
|
|
120
|
+
preferredPosition: o,
|
|
121
|
+
align: n,
|
|
122
|
+
marginToEdge: a
|
|
123
|
+
}) => ({
|
|
124
|
+
...Et(t, e, s, o, n, a)
|
|
125
|
+
}), Et = (t, e, s, o, n, a) => {
|
|
126
|
+
let i = 0, f = 0;
|
|
127
|
+
const m = window.pageXOffset + a, $ = window.pageXOffset + window.innerWidth - a;
|
|
128
|
+
switch (o) {
|
|
129
|
+
case "top":
|
|
130
|
+
f = t.top - s, n === "start" ? i = t.left : n === "end" ? i = t.right - e : i = Math.min(Math.max(t.left + t.width / 2 - e / 2, m), $);
|
|
131
|
+
break;
|
|
132
|
+
case "bottom":
|
|
133
|
+
f = t.bottom, n === "start" ? i = t.left : n === "end" ? i = t.right - e : i = Math.min(Math.max(t.left + t.width / 2 - e / 2, m), $);
|
|
134
|
+
break;
|
|
135
|
+
case "left":
|
|
136
|
+
i = Math.min(Math.max(t.left - e - M, m), $), n === "start" ? f = t.top : n === "end" ? f = t.bottom - s : f = t.top + t.height / 2 - s / 2;
|
|
137
|
+
break;
|
|
138
|
+
case "right":
|
|
139
|
+
i = t.right, n === "start" ? f = t.top : n === "end" ? f = t.bottom - s : f = t.top + t.height / 2 - s / 2;
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
f = t.bottom, n === "start" ? i = t.left : n === "end" ? i = t.right - e : i = t.left + t.width / 2 - e / 2;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
x: i,
|
|
147
|
+
y: f
|
|
148
|
+
};
|
|
149
|
+
}, H = (t, e, s, o) => {
|
|
150
|
+
if (s === "start")
|
|
151
|
+
return {
|
|
152
|
+
left: `${Math.max(o, Math.min(t.left + o, t.left + t.width - o))}px`
|
|
153
|
+
};
|
|
154
|
+
if (s === "end")
|
|
155
|
+
return {
|
|
156
|
+
right: `${Math.max(o, Math.min(e - t.left - t.width + o, t.width - o))}px`
|
|
157
|
+
};
|
|
158
|
+
const n = t.left + t.width / 2;
|
|
159
|
+
return {
|
|
160
|
+
left: `${Math.max(o, Math.min(n, e - o))}px`
|
|
161
|
+
};
|
|
162
|
+
}, G = (t, e, s, o) => {
|
|
163
|
+
if (s === "start")
|
|
164
|
+
return {
|
|
165
|
+
top: `${Math.max(o, Math.min(t.top + o, t.top + t.height - o))}px`
|
|
166
|
+
};
|
|
167
|
+
if (s === "end")
|
|
168
|
+
return {
|
|
169
|
+
bottom: `${Math.max(o, Math.min(e - t.top - t.height + o, t.height - o))}px`
|
|
170
|
+
};
|
|
171
|
+
const n = t.top + t.height / 2;
|
|
172
|
+
return {
|
|
173
|
+
top: `${Math.max(o, Math.min(n, e - o))}px`
|
|
174
|
+
};
|
|
175
|
+
}, Pt = (t, e, s, o) => {
|
|
176
|
+
const a = {};
|
|
177
|
+
let i = "";
|
|
178
|
+
const f = {
|
|
179
|
+
left: t.left - e.x,
|
|
180
|
+
top: t.top - e.y,
|
|
181
|
+
width: t.width,
|
|
182
|
+
height: t.height
|
|
183
|
+
};
|
|
184
|
+
switch (s) {
|
|
185
|
+
case "top":
|
|
186
|
+
Object.assign(a, {
|
|
187
|
+
bottom: "0px"
|
|
188
|
+
}), Object.assign(a, H(f, e.width, o, 12)), i = o ? `top-${o}` : "top";
|
|
189
|
+
break;
|
|
190
|
+
case "bottom":
|
|
191
|
+
Object.assign(a, {
|
|
192
|
+
top: "0px"
|
|
193
|
+
}), Object.assign(a, H(f, e.width, o, 12)), i = o ? `bottom-${o}` : "bottom";
|
|
194
|
+
break;
|
|
195
|
+
case "left":
|
|
196
|
+
Object.assign(a, {
|
|
197
|
+
right: "0px"
|
|
198
|
+
}), Object.assign(a, G(f, e.height, o, 12)), i = o ? `left-${o}` : "left";
|
|
199
|
+
break;
|
|
200
|
+
case "right":
|
|
201
|
+
Object.assign(a, {
|
|
202
|
+
left: "0px"
|
|
203
|
+
}), Object.assign(a, G(f, e.height, o, 12)), i = o ? `right-${o}` : "right";
|
|
204
|
+
break;
|
|
205
|
+
default:
|
|
206
|
+
Object.assign(a, {
|
|
207
|
+
top: "0px"
|
|
208
|
+
}), Object.assign(a, H(f, e.width, o || "center", 12)), i = "bottom";
|
|
209
|
+
break;
|
|
82
210
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
offsetLeft: o,
|
|
87
|
-
offsetTop: n
|
|
211
|
+
return {
|
|
212
|
+
arrowPositionInfo: a,
|
|
213
|
+
arrowClassName: i
|
|
88
214
|
};
|
|
89
|
-
}
|
|
90
|
-
|
|
215
|
+
};
|
|
216
|
+
function q(t, e, s, o) {
|
|
217
|
+
const n = window.pageXOffset + o, a = window.pageXOffset + window.innerWidth - o;
|
|
218
|
+
switch (e) {
|
|
219
|
+
case "top":
|
|
220
|
+
case "bottom":
|
|
221
|
+
return s === "start" ? Math.max(0, a - t.left) : s === "end" ? Math.max(0, t.right - n) : Math.max(0, a - n);
|
|
222
|
+
case "left":
|
|
223
|
+
return Math.max(0, t.left - M - n);
|
|
224
|
+
case "right":
|
|
225
|
+
return Math.max(0, a - t.right - M);
|
|
226
|
+
default:
|
|
227
|
+
return Math.max(0, a - n);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function J(t, e, s, o) {
|
|
231
|
+
const n = window.pageYOffset + o, a = window.pageYOffset + window.innerHeight - o;
|
|
232
|
+
switch (e) {
|
|
233
|
+
case "top":
|
|
234
|
+
return Math.max(0, t.top - M - n);
|
|
235
|
+
case "bottom":
|
|
236
|
+
return Math.max(0, a - t.bottom - M);
|
|
237
|
+
case "left":
|
|
238
|
+
case "right": {
|
|
239
|
+
if (s === "start")
|
|
240
|
+
return Math.max(0, a - t.top);
|
|
241
|
+
if (s === "end")
|
|
242
|
+
return Math.max(0, t.bottom - n);
|
|
243
|
+
const i = t.top + t.height / 2, f = i - n, m = a - i;
|
|
244
|
+
return Math.max(0, Math.min(f, m) * 2);
|
|
245
|
+
}
|
|
246
|
+
default:
|
|
247
|
+
return Math.max(0, a - n);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const W = /* @__PURE__ */ Q({
|
|
251
|
+
name: xt,
|
|
91
252
|
props: {
|
|
92
|
-
...
|
|
253
|
+
...ot,
|
|
93
254
|
reference: {
|
|
94
255
|
type: Object,
|
|
95
256
|
default: null
|
|
96
257
|
}
|
|
97
258
|
},
|
|
98
|
-
setup(
|
|
99
|
-
slots:
|
|
259
|
+
setup(t, {
|
|
260
|
+
slots: e
|
|
100
261
|
}) {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
align: ""
|
|
104
|
-
|
|
262
|
+
const s = Z(), o = V(t.modelValue), n = S({
|
|
263
|
+
position: "",
|
|
264
|
+
align: "",
|
|
265
|
+
maxWidth: 0,
|
|
266
|
+
maxHeight: 0
|
|
267
|
+
}), a = S({
|
|
268
|
+
position: {},
|
|
269
|
+
className: ""
|
|
270
|
+
}), i = S({
|
|
105
271
|
top: 0,
|
|
106
272
|
left: 0
|
|
107
|
-
}),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
x: 0,
|
|
129
|
-
y: 0,
|
|
130
|
-
newPlacement: h
|
|
131
|
-
};
|
|
132
|
-
e.autoFlipping && (h === "left" && u - d < pageXOffset ? l.newPlacement = "right" : h === "right" && u + p + d > pageXOffset + innerWidth ? l.newPlacement = "left" : h === "top" && s - g < pageYOffset ? l.newPlacement = "bottom" : h === "bottom" && s + i + g > pageYOffset + innerHeight && (l.newPlacement = "top"));
|
|
133
|
-
const z = l.newPlacement === "top" ? -g : i, D = l.newPlacement === "left" ? -d : p;
|
|
134
|
-
switch (l.newPlacement) {
|
|
135
|
-
case "top":
|
|
136
|
-
case "bottom":
|
|
137
|
-
l.y = s + z, v === "start" ? l.x = u : v === "end" ? l.x = u + p - d : l.x = u + p / 2 - d / 2;
|
|
138
|
-
break;
|
|
139
|
-
case "left":
|
|
140
|
-
case "right":
|
|
141
|
-
l.x = u + D, v === "start" ? l.y = s : v === "end" ? l.y = s + i - g : l.y = s + i / 2 - g / 2;
|
|
142
|
-
break;
|
|
273
|
+
}), {
|
|
274
|
+
marginToEdge: f
|
|
275
|
+
} = t, m = () => {
|
|
276
|
+
var l;
|
|
277
|
+
return ((l = s == null ? void 0 : s.proxy) == null ? void 0 : l.$refs.popper).getBoundingClientRect();
|
|
278
|
+
}, $ = ({
|
|
279
|
+
referenceRect: r,
|
|
280
|
+
position: h,
|
|
281
|
+
align: l,
|
|
282
|
+
tipWidth: c,
|
|
283
|
+
tipHeight: x,
|
|
284
|
+
autoFlipping: E
|
|
285
|
+
}) => {
|
|
286
|
+
let u = "", p = 0, d = 0;
|
|
287
|
+
if (E) {
|
|
288
|
+
const P = Mt(h);
|
|
289
|
+
for (const g of P)
|
|
290
|
+
if (p = q(r, g, l, f), d = J(r, g, l, f), c <= p && x <= d) {
|
|
291
|
+
u = g;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
143
294
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
|
|
295
|
+
return u || (p = q(r, h, l, f), d = J(r, h, l, f)), {
|
|
296
|
+
bestPosition: u,
|
|
297
|
+
maxWidth: p,
|
|
298
|
+
maxHeight: d
|
|
299
|
+
};
|
|
300
|
+
}, st = () => {
|
|
301
|
+
var F;
|
|
302
|
+
const r = t.reference, h = (F = s == null ? void 0 : s.proxy) == null ? void 0 : F.$refs.popper;
|
|
303
|
+
if (!r || !h)
|
|
304
|
+
return;
|
|
305
|
+
const l = bt(r), c = m(), x = c.width, E = c.height, {
|
|
306
|
+
position: u,
|
|
307
|
+
align: p
|
|
308
|
+
} = n, d = et(h), {
|
|
309
|
+
offsetLeft: P,
|
|
310
|
+
offsetTop: g
|
|
311
|
+
} = nt(d), {
|
|
312
|
+
bestPosition: b,
|
|
313
|
+
maxWidth: T,
|
|
314
|
+
maxHeight: X
|
|
315
|
+
} = $({
|
|
316
|
+
referenceRect: l,
|
|
317
|
+
position: u,
|
|
318
|
+
align: p,
|
|
319
|
+
tipWidth: x,
|
|
320
|
+
tipHeight: E,
|
|
321
|
+
autoFlipping: t.autoFlipping
|
|
322
|
+
});
|
|
323
|
+
b || (n.maxWidth = T, n.maxHeight = X), b && b !== u && (n.position = b), y(() => {
|
|
324
|
+
const {
|
|
325
|
+
width: v,
|
|
326
|
+
height: Y
|
|
327
|
+
} = m(), k = b || u, O = $t({
|
|
328
|
+
referenceRect: l,
|
|
329
|
+
rectWidth: v,
|
|
330
|
+
rectHeight: Y,
|
|
331
|
+
preferredPosition: k,
|
|
332
|
+
align: p,
|
|
333
|
+
marginToEdge: t.marginToEdge,
|
|
334
|
+
paddingToTarget: M
|
|
335
|
+
});
|
|
336
|
+
i.left = O.x - P, i.top = O.y - g, n.position = k, n.maxWidth = T, n.maxHeight = X;
|
|
337
|
+
const at = {
|
|
338
|
+
x: O.x,
|
|
339
|
+
y: O.y,
|
|
340
|
+
width: v,
|
|
341
|
+
height: Y
|
|
342
|
+
}, {
|
|
343
|
+
arrowPositionInfo: it,
|
|
344
|
+
arrowClassName: rt
|
|
345
|
+
} = Pt(l, at, k, p);
|
|
346
|
+
a.position = it, a.className = rt;
|
|
347
|
+
}).catch((v) => {
|
|
348
|
+
throw new Error(v);
|
|
349
|
+
});
|
|
350
|
+
}, A = (r) => {
|
|
351
|
+
var c;
|
|
352
|
+
const h = (c = s == null ? void 0 : s.proxy) == null ? void 0 : c.$refs.popper, l = t.reference;
|
|
353
|
+
l && h && !l.contains(r.target) && !h.contains(r.target) && (o.value = !1, C());
|
|
354
|
+
}, I = () => {
|
|
355
|
+
o.value = !o.value, o.value || C();
|
|
356
|
+
}, C = () => {
|
|
357
|
+
n.maxWidth = 0, n.maxHeight = 0, i.left = 0, i.top = 0;
|
|
358
|
+
}, j = () => {
|
|
359
|
+
C();
|
|
360
|
+
const [r, h] = t.position.split("-");
|
|
361
|
+
n.align = h, n.position = r;
|
|
151
362
|
}, B = () => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
e.manual && (n.value = e.modelValue), e.modelValue || n.value ? A(m).catch((a) => {
|
|
156
|
-
throw new Error(a);
|
|
157
|
-
}) : (c.left = 0, c.top = 0);
|
|
363
|
+
t.manual && (o.value = t.modelValue), t.modelValue || o.value ? y(st).catch((r) => {
|
|
364
|
+
throw new Error(r);
|
|
365
|
+
}) : (i.left = 0, i.top = 0);
|
|
158
366
|
};
|
|
159
|
-
return
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
367
|
+
return U(() => t.position, () => {
|
|
368
|
+
j(), y(() => {
|
|
369
|
+
B();
|
|
370
|
+
}).catch((r) => {
|
|
371
|
+
throw new Error(r);
|
|
372
|
+
});
|
|
373
|
+
}), U([() => o.value, () => t.modelValue, () => t.reference], () => {
|
|
374
|
+
j(), y(() => {
|
|
375
|
+
B();
|
|
376
|
+
}).catch((r) => {
|
|
377
|
+
throw new Error(r);
|
|
378
|
+
});
|
|
379
|
+
}), z(() => {
|
|
380
|
+
var r;
|
|
381
|
+
j(), y(() => B()).catch((h) => {
|
|
382
|
+
throw new Error(h);
|
|
383
|
+
}), t.manual || ((r = t.reference) == null || r.addEventListener("click", I), document.addEventListener("touchstart", A));
|
|
384
|
+
}), ft(() => {
|
|
385
|
+
var r;
|
|
386
|
+
t.manual || ((r = t.reference) == null || r.removeEventListener("click", I), document.removeEventListener("touchstart", A));
|
|
167
387
|
}), () => {
|
|
168
388
|
const {
|
|
169
|
-
left:
|
|
170
|
-
top:
|
|
171
|
-
} =
|
|
172
|
-
width:
|
|
173
|
-
color:
|
|
174
|
-
bgColor:
|
|
175
|
-
modelValue:
|
|
176
|
-
minWidth:
|
|
177
|
-
popperClass:
|
|
178
|
-
popperStyle:
|
|
179
|
-
text:
|
|
180
|
-
} =
|
|
181
|
-
return
|
|
182
|
-
to:
|
|
389
|
+
left: r,
|
|
390
|
+
top: h
|
|
391
|
+
} = i, {
|
|
392
|
+
width: l,
|
|
393
|
+
color: c,
|
|
394
|
+
bgColor: x,
|
|
395
|
+
modelValue: E,
|
|
396
|
+
minWidth: u,
|
|
397
|
+
popperClass: p,
|
|
398
|
+
popperStyle: d,
|
|
399
|
+
text: P
|
|
400
|
+
} = t;
|
|
401
|
+
return w(lt, {
|
|
402
|
+
to: t.teleport
|
|
183
403
|
}, {
|
|
184
404
|
default: () => {
|
|
185
|
-
var
|
|
186
|
-
return [
|
|
187
|
-
class: [
|
|
188
|
-
[
|
|
189
|
-
}),
|
|
405
|
+
var g;
|
|
406
|
+
return [w("div", {
|
|
407
|
+
class: [_({
|
|
408
|
+
[n.position]: n.position
|
|
409
|
+
}), p],
|
|
190
410
|
ref: "popper",
|
|
191
411
|
style: {
|
|
192
|
-
...
|
|
193
|
-
left: `${
|
|
194
|
-
top: `${
|
|
412
|
+
...d,
|
|
413
|
+
left: `${r}px`,
|
|
414
|
+
top: `${h}px`,
|
|
415
|
+
opacity: E || o.value ? 1 : 0
|
|
195
416
|
}
|
|
196
|
-
}, [
|
|
197
|
-
class:
|
|
417
|
+
}, [w("div", {
|
|
418
|
+
class: _("content"),
|
|
198
419
|
style: {
|
|
199
|
-
color:
|
|
200
|
-
width:
|
|
201
|
-
|
|
202
|
-
|
|
420
|
+
color: c,
|
|
421
|
+
width: l ? L(l) : "auto",
|
|
422
|
+
maxWidth: n.maxWidth ? L(n.maxWidth) : "",
|
|
423
|
+
maxHeight: n.maxHeight ? L(n.maxHeight) : "",
|
|
424
|
+
minWidth: L(u),
|
|
425
|
+
backgroundColor: x
|
|
203
426
|
}
|
|
204
|
-
}, [((
|
|
205
|
-
class:
|
|
427
|
+
}, [((g = e.default) == null ? void 0 : g.call(e)) || P]), w("div", {
|
|
428
|
+
class: _("arrow", [a.className]),
|
|
206
429
|
style: {
|
|
207
|
-
color:
|
|
430
|
+
color: x,
|
|
431
|
+
...a.position
|
|
208
432
|
}
|
|
209
|
-
}, null)])
|
|
433
|
+
}, null)])];
|
|
210
434
|
}
|
|
211
435
|
});
|
|
212
436
|
};
|
|
213
437
|
}
|
|
214
438
|
});
|
|
215
|
-
function
|
|
216
|
-
return typeof
|
|
439
|
+
function vt(t) {
|
|
440
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !ct(t);
|
|
217
441
|
}
|
|
218
|
-
const [
|
|
219
|
-
name:
|
|
220
|
-
props:
|
|
221
|
-
setup(
|
|
222
|
-
slots:
|
|
442
|
+
const [Ot] = R("tooltip"), Lt = /* @__PURE__ */ Q({
|
|
443
|
+
name: Ot,
|
|
444
|
+
props: ot,
|
|
445
|
+
setup(t, {
|
|
446
|
+
slots: e
|
|
223
447
|
}) {
|
|
224
|
-
const
|
|
225
|
-
var
|
|
226
|
-
const
|
|
227
|
-
return
|
|
448
|
+
const s = Z(), o = V(), n = () => {
|
|
449
|
+
var i;
|
|
450
|
+
const a = (i = s == null ? void 0 : s.proxy) == null ? void 0 : i.$el;
|
|
451
|
+
return a == null ? void 0 : a.nextElementSibling;
|
|
228
452
|
};
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
}),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}).catch((
|
|
235
|
-
throw Error(
|
|
453
|
+
return z(() => {
|
|
454
|
+
o.value = n();
|
|
455
|
+
}), ht(() => {
|
|
456
|
+
y(() => {
|
|
457
|
+
o.value = n();
|
|
458
|
+
}).catch((a) => {
|
|
459
|
+
throw Error(a);
|
|
236
460
|
});
|
|
237
461
|
}), () => {
|
|
238
|
-
var
|
|
239
|
-
let
|
|
240
|
-
return
|
|
241
|
-
reference:
|
|
242
|
-
}),
|
|
243
|
-
default: () => [
|
|
244
|
-
}) :
|
|
245
|
-
reference:
|
|
462
|
+
var i;
|
|
463
|
+
let a;
|
|
464
|
+
return w(pt, null, [(i = e.default) == null ? void 0 : i.call(e)[0], o.value && (e.popper ? w(W, D(t, {
|
|
465
|
+
reference: o.value
|
|
466
|
+
}), vt(a = e.popper()) ? a : {
|
|
467
|
+
default: () => [a]
|
|
468
|
+
}) : w(W, D(t, {
|
|
469
|
+
reference: o.value
|
|
246
470
|
}), null))]);
|
|
247
471
|
};
|
|
248
472
|
}
|
|
249
|
-
}),
|
|
250
|
-
|
|
251
|
-
},
|
|
252
|
-
install: (
|
|
253
|
-
|
|
473
|
+
}), K = (t, e) => {
|
|
474
|
+
e.value ? (t.classList.add("y-popper__wrap"), t.appendChild(t.instance.$el)) : (t.classList.remove("y-popper__wrap"), t.removeChild(t.instance.$el));
|
|
475
|
+
}, jt = {
|
|
476
|
+
install: (t) => {
|
|
477
|
+
t.directive("tooltip", St);
|
|
254
478
|
}
|
|
255
|
-
},
|
|
256
|
-
getSSRProps: (
|
|
479
|
+
}, St = {
|
|
480
|
+
getSSRProps: (t) => ({ ...t }),
|
|
257
481
|
// 指令是具有一组生命周期的钩子:
|
|
258
482
|
// 在绑定元素的 attribute 或事件监听器被应用之前调用
|
|
259
483
|
// 在绑定元素的父组件挂载之前调用
|
|
260
|
-
mounted: (
|
|
261
|
-
const
|
|
262
|
-
render: () =>
|
|
263
|
-
}),
|
|
264
|
-
|
|
484
|
+
mounted: (t, e) => {
|
|
485
|
+
const o = ut({
|
|
486
|
+
render: () => mt(W, { ...e.value, reference: t })
|
|
487
|
+
}), n = document.createElement("div");
|
|
488
|
+
t.instance = o.mount(n), e.value && K(t, e);
|
|
265
489
|
},
|
|
266
|
-
updated: (
|
|
267
|
-
|
|
490
|
+
updated: (t, e) => {
|
|
491
|
+
e.oldValue !== e.value && K(t, e);
|
|
268
492
|
},
|
|
269
|
-
unmounted: (
|
|
270
|
-
|
|
493
|
+
unmounted: (t) => {
|
|
494
|
+
t.instance && t.instance.$el.remove();
|
|
271
495
|
}
|
|
272
496
|
};
|
|
273
|
-
function
|
|
274
|
-
const
|
|
275
|
-
return
|
|
276
|
-
const { name:
|
|
277
|
-
|
|
278
|
-
},
|
|
497
|
+
function Nt(t) {
|
|
498
|
+
const e = t;
|
|
499
|
+
return e.install = (s) => {
|
|
500
|
+
const { name: o } = t;
|
|
501
|
+
o && s.component(o, t);
|
|
502
|
+
}, e;
|
|
279
503
|
}
|
|
280
|
-
const
|
|
504
|
+
const Bt = Nt(Lt);
|
|
281
505
|
export {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
506
|
+
Bt as default,
|
|
507
|
+
St as directive,
|
|
508
|
+
jt as tooltipDirective
|
|
285
509
|
};
|