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.
@@ -1,11 +1,11 @@
1
- import { ref as N, reactive as x, defineComponent as k, getCurrentInstance as H, watch as V, onMounted as T, onBeforeUnmount as X, createVNode as y, Teleport as Y, withDirectives as G, vShow as q, nextTick as A, onBeforeUpdate as J, Fragment as K, mergeProps as P, isVNode as Q, createApp as Z, h as ee } from "vue";
2
- const $ = (e, t) => t ? typeof t == "string" ? ` ${e}--${t}` : Array.isArray(t) ? t.reduce((r, n) => r + $(e, n), "") : Object.keys(t).reduce(
3
- (r, n) => r + (t[n] ? $(e, n) : ""),
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
- ) : "", te = (e) => (t, r) => {
6
- let n = t, o = r;
7
- return n && typeof n != "string" && (o = n, n = ""), n = n ? `${e}__${n}` : e, `${n}${$(n, o)}`;
8
- }, ne = () => (e, t) => t ? `${$(`y-${e}`, t)}` : `y-${e}`, re = {
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
- N("zh-CN");
21
- x({
22
- "zh-CN": re
20
+ V("zh-CN");
21
+ S({
22
+ "zh-CN": wt
23
23
  });
24
- const I = (e) => {
25
- const t = `y-${e}`;
26
- return [t, te(t), ne()];
24
+ const R = (t) => {
25
+ const e = `y-${t}`;
26
+ return [e, dt(e), gt()];
27
27
  };
28
- var M = /* @__PURE__ */ ((e) => (e.Top = "top", e.TopStart = "top-start", e.TopEnd = "top-end", e.Right = "right", e.RightStart = "right-start", e.RightEnd = "right-end", e.Left = "left", e.LeftStart = "left-start", e.LeftEnd = "left-end", e.Bottom = "bottom", e.BottomStart = "bottom-start", e.BottomEnd = "bottom-end", e))(M || {});
29
- const W = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, R = {
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
- // 当tooltip显示超出视窗时会自动在另一侧渲染
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: M.Top
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
- }, [oe, b] = I("popper"), F = (e) => e.parentElement ? getComputedStyle(e.parentElement).position !== "static" ? e.parentElement : F(e.parentElement) : e, L = (e, t, r) => {
84
- let n = t || e.offsetTop, o = r || e.offsetLeft;
85
- return e.parentElement ? (getComputedStyle(e.parentElement).position !== "static" && (n += e.parentElement.offsetTop, o += e.parentElement.offsetLeft), L(e.parentElement, n, o)) : {
86
- offsetLeft: o,
87
- offsetTop: n
211
+ return {
212
+ arrowPositionInfo: a,
213
+ arrowClassName: i
88
214
  };
89
- }, C = /* @__PURE__ */ k({
90
- name: oe,
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
- ...R,
253
+ ...ot,
93
254
  reference: {
94
255
  type: Object,
95
256
  default: null
96
257
  }
97
258
  },
98
- setup(e, {
99
- slots: t
259
+ setup(t, {
260
+ slots: e
100
261
  }) {
101
- const r = H(), n = N(e.modelValue), o = x({
102
- placement: "",
103
- align: ""
104
- }), c = x({
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
- }), m = () => {
108
- var O;
109
- const a = e.reference, f = (O = r == null ? void 0 : r.proxy) == null ? void 0 : O.$refs.popper;
110
- if (!a || !f)
111
- return;
112
- const {
113
- offsetWidth: p,
114
- offsetHeight: i
115
- } = a, {
116
- offsetTop: s,
117
- offsetLeft: u
118
- } = L(a), {
119
- offsetWidth: d,
120
- offsetHeight: g
121
- } = f, {
122
- placement: h,
123
- align: v
124
- } = o, {
125
- offsetLeft: E,
126
- offsetTop: U
127
- } = L(F(f)), l = {
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
- c.left = l.x - E, c.top = l.y - U, o.placement = l.newPlacement;
145
- }, w = (a) => {
146
- var i;
147
- const f = (i = r == null ? void 0 : r.proxy) == null ? void 0 : i.$refs.popper, p = e.reference;
148
- p && f && !p.contains(a.target) && !f.contains(a.target) && (n.value = !1);
149
- }, _ = () => {
150
- n.value = !n.value;
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
- const [a, f] = e.position.split("-");
153
- o.align = f, o.placement = a;
154
- }, S = () => {
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 V(() => e.position, () => {
160
- B(), S();
161
- }), V([() => n.value, () => e.modelValue, () => e.reference], S), T(() => {
162
- var a;
163
- B(), S(), e.manual || ((a = e.reference) == null || a.addEventListener("click", _), document.addEventListener("touchstart", w), document.addEventListener("mousedown", w));
164
- }), X(() => {
165
- var a;
166
- e.manual || ((a = e.reference) == null || a.removeEventListener("click", _), document.removeEventListener("touchstart", w), document.removeEventListener("mousedown", w));
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: a,
170
- top: f
171
- } = c, {
172
- width: p,
173
- color: i,
174
- bgColor: s,
175
- modelValue: u,
176
- minWidth: d,
177
- popperClass: g,
178
- popperStyle: h,
179
- text: v
180
- } = e;
181
- return y(Y, {
182
- to: e.teleport
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 E;
186
- return [G(y("div", {
187
- class: [b({
188
- [o.placement]: o.placement
189
- }), g],
405
+ var g;
406
+ return [w("div", {
407
+ class: [_({
408
+ [n.position]: n.position
409
+ }), p],
190
410
  ref: "popper",
191
411
  style: {
192
- ...h,
193
- left: `${a}px`,
194
- top: `${f}px`
412
+ ...d,
413
+ left: `${r}px`,
414
+ top: `${h}px`,
415
+ opacity: E || o.value ? 1 : 0
195
416
  }
196
- }, [y("div", {
197
- class: b("content"),
417
+ }, [w("div", {
418
+ class: _("content"),
198
419
  style: {
199
- color: i,
200
- width: W(p),
201
- minWidth: W(d),
202
- backgroundColor: s
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
- }, [((E = t.default) == null ? void 0 : E.call(t)) || v]), y("div", {
205
- class: b("arrow", [`${o.placement}${o.align ? `-${o.align}` : ""}`]),
427
+ }, [((g = e.default) == null ? void 0 : g.call(e)) || P]), w("div", {
428
+ class: _("arrow", [a.className]),
206
429
  style: {
207
- color: s
430
+ color: x,
431
+ ...a.position
208
432
  }
209
- }, null)]), [[q, u || n.value]])];
433
+ }, null)])];
210
434
  }
211
435
  });
212
436
  };
213
437
  }
214
438
  });
215
- function ae(e) {
216
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Q(e);
439
+ function vt(t) {
440
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !ct(t);
217
441
  }
218
- const [le] = I("tooltip"), ce = /* @__PURE__ */ k({
219
- name: le,
220
- props: R,
221
- setup(e, {
222
- slots: t
442
+ const [Ot] = R("tooltip"), Lt = /* @__PURE__ */ Q({
443
+ name: Ot,
444
+ props: ot,
445
+ setup(t, {
446
+ slots: e
223
447
  }) {
224
- const r = H(), n = N(), o = () => {
225
- var m;
226
- const c = (m = r == null ? void 0 : r.proxy) == null ? void 0 : m.$el;
227
- return c == null ? void 0 : c.nextElementSibling;
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 T(() => {
230
- n.value = o();
231
- }), J(() => {
232
- A(() => {
233
- n.value = o();
234
- }).catch((c) => {
235
- throw Error(c);
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 m;
239
- let c;
240
- return y(K, null, [(m = t.default) == null ? void 0 : m.call(t)[0], n.value && (t.popper ? y(C, P(e, {
241
- reference: n.value
242
- }), ae(c = t.popper()) ? c : {
243
- default: () => [c]
244
- }) : y(C, P(e, {
245
- reference: n.value
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
- }), j = (e, t) => {
250
- t.value ? (e.classList.add("y-popper__wrap"), e.appendChild(e.instance.$el)) : (e.classList.remove("y-popper__wrap"), e.removeChild(e.instance.$el));
251
- }, se = {
252
- install: (e) => {
253
- e.directive("tooltip", fe);
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
- }, fe = {
256
- getSSRProps: (e) => ({ ...e }),
479
+ }, St = {
480
+ getSSRProps: (t) => ({ ...t }),
257
481
  // 指令是具有一组生命周期的钩子:
258
482
  // 在绑定元素的 attribute 或事件监听器被应用之前调用
259
483
  // 在绑定元素的父组件挂载之前调用
260
- mounted: (e, t) => {
261
- const n = Z({
262
- render: () => ee(C, { ...t.value, reference: e })
263
- }), o = document.createElement("div");
264
- e.instance = n.mount(o), t.value && j(e, t);
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: (e, t) => {
267
- t.oldValue !== t.value && j(e, t);
490
+ updated: (t, e) => {
491
+ e.oldValue !== e.value && K(t, e);
268
492
  },
269
- unmounted: (e) => {
270
- e.instance && e.instance.$el.remove();
493
+ unmounted: (t) => {
494
+ t.instance && t.instance.$el.remove();
271
495
  }
272
496
  };
273
- function pe(e) {
274
- const t = e;
275
- return t.install = (r) => {
276
- const { name: n } = e;
277
- n && r.component(n, e);
278
- }, t;
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 ue = pe(ce);
504
+ const Bt = Nt(Lt);
281
505
  export {
282
- ue as default,
283
- fe as directive,
284
- se as tooltipDirective
506
+ Bt as default,
507
+ St as directive,
508
+ jt as tooltipDirective
285
509
  };