element-like 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,696 @@
1
+ import { library as e } from "@fortawesome/fontawesome-svg-core";
2
+ import { faSpinner as t, fas as n } from "@fortawesome/free-solid-svg-icons";
3
+ import { FontAwesomeIcon as r } from "@fortawesome/vue-fontawesome";
4
+ import { Fragment as i, Teleport as a, Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, guardReactiveProps as h, inject as g, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as ee, openBlock as x, provide as S, ref as C, renderList as w, renderSlot as T, resolveComponent as E, toDisplayString as D, unref as O, useId as k, useTemplateRef as A, vShow as j, watch as M, withCtx as N, withDirectives as P, withModifiers as F } from "vue";
5
+ //#region src/components/withInstall.ts
6
+ function I(e, t = {}) {
7
+ let n = e;
8
+ return n.install = (n) => {
9
+ t.setup?.(n), e.name && (n.component(e.name, e), n.component(e.name.replace(/-/g, ""), e));
10
+ }, n;
11
+ }
12
+ //#endregion
13
+ //#region src/components/Icon/Icon.vue?vue&type=script&setup=true&lang.ts
14
+ var L = /*@__PURE__*/ m({
15
+ name: "ElLike-Icon",
16
+ __name: "Icon",
17
+ props: {
18
+ icon: {
19
+ type: String,
20
+ required: !0
21
+ },
22
+ type: {
23
+ type: String,
24
+ default: ""
25
+ },
26
+ size: { type: String },
27
+ rotation: { type: [Number, String] },
28
+ flip: { type: [String, Boolean] },
29
+ spin: Boolean,
30
+ spinReverse: Boolean,
31
+ spinPulse: Boolean,
32
+ pulse: Boolean,
33
+ bounce: Boolean,
34
+ shake: Boolean,
35
+ beat: Boolean,
36
+ fade: Boolean,
37
+ beatFade: Boolean,
38
+ flash: Boolean,
39
+ color: {
40
+ type: String,
41
+ default: ""
42
+ }
43
+ },
44
+ setup(e) {
45
+ let t = e, n = s(() => `fa-solid fa-${t.icon}`), r = s(() => {
46
+ let e = { ...t };
47
+ return delete e.icon, delete e.type, delete e.color, {
48
+ ...e,
49
+ icon: n.value
50
+ };
51
+ });
52
+ return (e, t) => {
53
+ let n = E("font-awesome-icon");
54
+ return x(), u("i", {
55
+ class: v(["el-like-icon", { [`el-like-icon--${e.type}`]: e.type }]),
56
+ style: b({ color: e.color })
57
+ }, [p(n, y(h(r.value)), null, 16)], 6);
58
+ };
59
+ }
60
+ }), R = (e, t) => {
61
+ let n = e.__vccOpts || e;
62
+ for (let [e, r] of t) n[e] = r;
63
+ return n;
64
+ }, z = /*#__PURE__*/ R(L, [["__scopeId", "data-v-0b563ca1"]]), B = /* @__PURE__ */ I(z, { setup(t) {
65
+ e.add(n), t.component("font-awesome-icon") || t.component("font-awesome-icon", r);
66
+ } }), te = {
67
+ type: {
68
+ type: String,
69
+ default: "default"
70
+ },
71
+ size: { type: String },
72
+ plain: Boolean,
73
+ round: Boolean,
74
+ circle: Boolean,
75
+ disabled: Boolean,
76
+ loading: Boolean,
77
+ icon: {
78
+ type: String,
79
+ default: ""
80
+ }
81
+ }, ne = ["disabled", "aria-busy"], re = {
82
+ key: 2,
83
+ class: "el-like-button__content"
84
+ }, V = /* @__PURE__ */ I(/* @__PURE__ */ R(/* @__PURE__ */ m({
85
+ name: "ElLike-Button",
86
+ __name: "Button",
87
+ props: te,
88
+ emits: ["click"],
89
+ setup(e, { expose: t, emit: n }) {
90
+ let r = e, i = n, a = C(null), o = (e) => {
91
+ r.disabled || r.loading || i("click", e);
92
+ };
93
+ return t({ ref: a }), (e, t) => (x(), u("button", {
94
+ ref_key: "buttonRef",
95
+ ref: a,
96
+ class: v(["el-like-button", [
97
+ `el-like-button--${e.type}`,
98
+ e.size && e.size !== "default" ? `el-like-button--${e.size}` : "",
99
+ {
100
+ "is-plain": e.plain,
101
+ "is-round": e.round,
102
+ "is-circle": e.circle,
103
+ "is-disabled": e.disabled,
104
+ "is-loading": e.loading
105
+ }
106
+ ]]),
107
+ type: "button",
108
+ disabled: e.disabled || e.loading,
109
+ "aria-busy": e.loading,
110
+ onClick: o
111
+ }, [e.loading ? (x(), c(z, {
112
+ key: 0,
113
+ class: "el-like-button__icon",
114
+ icon: "spinner",
115
+ spin: "",
116
+ "aria-hidden": "true"
117
+ })) : e.icon ? (x(), c(z, {
118
+ key: 1,
119
+ class: "el-like-button__icon",
120
+ icon: e.icon,
121
+ "aria-hidden": "true"
122
+ }, null, 8, ["icon"])) : l("", !0), e.$slots.default ? (x(), u("span", re, [T(e.$slots, "default", {}, void 0, !0)])) : l("", !0)], 10, ne));
123
+ }
124
+ }), [["__scopeId", "data-v-ab0fd185"]]), { setup(n) {
125
+ e.add(t), n.component("font-awesome-icon") || n.component("font-awesome-icon", r);
126
+ } }), H = {
127
+ width: { type: Number },
128
+ imgSrc: {
129
+ type: String,
130
+ required: !0
131
+ },
132
+ imgHeight: { type: Number },
133
+ summary: { type: String }
134
+ }, ie = ["src"], ae = {
135
+ key: 0,
136
+ class: "el-like-card__summary"
137
+ }, oe = {
138
+ key: 1,
139
+ class: "el-like-card__footer"
140
+ }, U = /* @__PURE__ */ I(/* @__PURE__ */ R(/* @__PURE__ */ m({
141
+ name: "ElLike-Card",
142
+ __name: "Card",
143
+ props: H,
144
+ setup(e) {
145
+ let t = e, n = (e) => e === void 0 ? void 0 : `${e}px`, r = s(() => ({ width: n(t.width) })), a = s(() => ({ height: n(t.imgHeight) }));
146
+ return (e, t) => (x(), u("div", {
147
+ class: "el-like-card",
148
+ style: b(r.value)
149
+ }, [
150
+ d("img", {
151
+ class: "el-like-card__image",
152
+ src: e.imgSrc,
153
+ style: b(a.value),
154
+ alt: ""
155
+ }, null, 12, ie),
156
+ e.summary || e.$slots.default ? (x(), u("div", ae, [e.summary ? (x(), u(i, { key: 0 }, [f(D(e.summary), 1)], 64)) : T(e.$slots, "default", {}, void 0, !0, 1)])) : l("", !0),
157
+ e.$slots.footer ? (x(), u("div", oe, [T(e.$slots, "footer", {}, void 0, !0)])) : l("", !0)
158
+ ], 4));
159
+ }
160
+ }), [["__scopeId", "data-v-ff3577ba"]])), W = {
161
+ title: {
162
+ type: String,
163
+ default: "提示"
164
+ },
165
+ width: {
166
+ type: String,
167
+ default: "50%"
168
+ },
169
+ top: {
170
+ type: String,
171
+ default: "15vh"
172
+ },
173
+ visible: {
174
+ type: Boolean,
175
+ default: !1
176
+ },
177
+ closeOnClickModal: {
178
+ type: Boolean,
179
+ default: !0
180
+ }
181
+ }, se = ["aria-labelledby"], G = { class: "el-like-dialog__header" }, ce = ["id"], K = {
182
+ key: 0,
183
+ class: "el-like-dialog__body"
184
+ }, q = {
185
+ key: 1,
186
+ class: "el-like-dialog__footer"
187
+ }, J = /* @__PURE__ */ I(/* @__PURE__ */ R(/* @__PURE__ */ m({
188
+ name: "ElLike-Dialog",
189
+ __name: "Dialog",
190
+ props: W,
191
+ emits: ["close"],
192
+ setup(e, { emit: t }) {
193
+ let n = e, r = t, i = k(), m = s(() => ({
194
+ width: n.width,
195
+ marginTop: n.top
196
+ })), h = () => {
197
+ r("close");
198
+ }, g = () => {
199
+ n.closeOnClickModal && h();
200
+ }, _ = (e) => {
201
+ e.key === "Escape" && !e.defaultPrevented && h();
202
+ }, v = () => {
203
+ typeof document < "u" && document.removeEventListener("keydown", _);
204
+ };
205
+ return M(() => n.visible, (e) => {
206
+ typeof document < "u" && (v(), e && document.addEventListener("keydown", _));
207
+ }, { immediate: !0 }), ee(v), (e, t) => (x(), c(a, { to: "body" }, [p(o, { name: "el-like-dialog-fade" }, {
208
+ default: N(() => [e.visible ? (x(), u("div", {
209
+ key: 0,
210
+ class: "el-like-dialog__overlay",
211
+ onClick: F(g, ["self"])
212
+ }, [d("div", {
213
+ class: "el-like-dialog",
214
+ role: "dialog",
215
+ "aria-modal": "true",
216
+ "aria-labelledby": O(i),
217
+ style: b(m.value)
218
+ }, [
219
+ d("div", G, [d("h2", {
220
+ id: O(i),
221
+ class: "el-like-dialog__title"
222
+ }, [T(e.$slots, "title", {}, () => [f(D(e.title), 1)], !0)], 8, ce), d("button", {
223
+ class: "el-like-dialog__close",
224
+ type: "button",
225
+ "aria-label": "关闭对话框",
226
+ onClick: h
227
+ }, [...t[0] ||= [d("span", { "aria-hidden": "true" }, "×", -1)]])]),
228
+ e.$slots.default ? (x(), u("div", K, [T(e.$slots, "default", {}, void 0, !0)])) : l("", !0),
229
+ e.$slots.footer ? (x(), u("div", q, [T(e.$slots, "footer", {}, void 0, !0)])) : l("", !0)
230
+ ], 12, se)])) : l("", !0)]),
231
+ _: 3
232
+ })]));
233
+ }
234
+ }), [["__scopeId", "data-v-5eb9bb77"]])), le = {
235
+ total: {
236
+ type: Number,
237
+ default: 0
238
+ },
239
+ currentPage: {
240
+ type: Number,
241
+ default: 1
242
+ },
243
+ pageCount: {
244
+ type: Number,
245
+ default: 10
246
+ },
247
+ type: { type: String },
248
+ size: { type: String }
249
+ }, ue = { class: "el-like-pager__list" }, de = [
250
+ "aria-label",
251
+ "aria-current",
252
+ "onClick"
253
+ ], fe = ["aria-label", "onClick"], Y = /* @__PURE__ */ I(/* @__PURE__ */ R(/* @__PURE__ */ m({
254
+ name: "ElLike-Pager",
255
+ __name: "Pager",
256
+ props: le,
257
+ emits: ["current-change"],
258
+ setup(e, { emit: t }) {
259
+ let n = e, r = t, a = (e, t) => Number.isFinite(e) ? Math.trunc(e) : t, o = s(() => Math.max(0, a(n.total, 0))), c = s(() => Math.max(1, a(n.pageCount, 10))), l = s(() => o.value === 0 ? 1 : Math.min(Math.max(a(n.currentPage, 1), 1), o.value)), f = (e, t) => Array.from({ length: t - e + 1 }, (t, n) => e + n), p = s(() => {
260
+ let e = o.value;
261
+ if (e === 0) return [];
262
+ let t = Math.min(c.value, e);
263
+ if (t === e) return f(1, e);
264
+ if (t < 3) {
265
+ let n = Math.min(Math.max(l.value - Math.floor((t - 1) / 2), 1), e - t + 1);
266
+ return f(n, n + t - 1);
267
+ }
268
+ let n = t - 2, r = Math.min(Math.max(l.value, 2), e - 1), i = e - n, a = Math.min(Math.max(r - Math.floor((n - 1) / 2), 2), i);
269
+ return [
270
+ 1,
271
+ ...f(a, a + n - 1),
272
+ e
273
+ ];
274
+ }), m = s(() => {
275
+ let e = [], t = p.value, n = t[0], r = t[t.length - 1], i = (e) => ({
276
+ kind: "ellipsis",
277
+ key: `ellipsis-${e}`,
278
+ direction: e,
279
+ target: e === "previous" ? Math.max(1, l.value - c.value) : Math.min(o.value, l.value + c.value)
280
+ });
281
+ n !== void 0 && n > 1 && e.push(i("previous"));
282
+ let a;
283
+ for (let n of t) a !== void 0 && n - a > 1 && e.push(i(n <= l.value ? "previous" : "next")), e.push({
284
+ kind: "page",
285
+ key: `page-${n}`,
286
+ page: n
287
+ }), a = n;
288
+ return r !== void 0 && r < o.value && e.push(i("next")), e;
289
+ }), h = (e) => {
290
+ if (o.value === 0) return;
291
+ let t = Math.min(Math.max(e, 1), o.value);
292
+ t !== l.value && r("current-change", t);
293
+ };
294
+ return (e, t) => (x(), u("nav", {
295
+ class: v(["el-like-pager", [e.type ? `el-like-pager--${e.type}` : "", e.size && e.size !== "default" ? `el-like-pager--${e.size}` : ""]]),
296
+ "aria-label": "分页导航"
297
+ }, [d("ul", ue, [(x(!0), u(i, null, w(m.value, (e) => (x(), u("li", {
298
+ key: e.key,
299
+ class: "el-like-pager__item"
300
+ }, [e.kind === "page" ? (x(), u("button", {
301
+ key: 0,
302
+ class: v(["el-like-pager__button el-like-pager__page", { "is-active": e.page === l.value }]),
303
+ type: "button",
304
+ "aria-label": `第 ${e.page} 页`,
305
+ "aria-current": e.page === l.value ? "page" : void 0,
306
+ onClick: (t) => h(e.page)
307
+ }, D(e.page), 11, de)) : (x(), u("button", {
308
+ key: 1,
309
+ class: v(["el-like-pager__button el-like-pager__ellipsis", `el-like-pager__ellipsis--${e.direction}`]),
310
+ type: "button",
311
+ "aria-label": `${e.direction === "previous" ? "向前" : "向后"}跳转到第 ${e.target} 页`,
312
+ onClick: (t) => h(e.target)
313
+ }, [...t[0] ||= [d("span", { "aria-hidden": "true" }, "…", -1)]], 10, fe))]))), 128))])], 2));
314
+ }
315
+ }), [["__scopeId", "data-v-1a7620bc"]])), pe = {
316
+ modelValue: {
317
+ type: Array,
318
+ default: () => []
319
+ },
320
+ accordion: {
321
+ type: Boolean,
322
+ default: !1
323
+ }
324
+ }, me = Symbol("collapseContextKey"), he = { class: "el-like-collapse" }, X = /* @__PURE__ */ I(/* @__PURE__ */ R(/* @__PURE__ */ m({
325
+ name: "ElLike-Collapse",
326
+ __name: "Collapse",
327
+ props: pe,
328
+ emits: ["update:modelValue", "change"],
329
+ setup(e, { emit: t }) {
330
+ let n = e, r = t, i = C([...n.modelValue]);
331
+ return M(() => n.modelValue, (e) => {
332
+ i.value = [...e];
333
+ }), S(me, {
334
+ activeNames: i,
335
+ handleItemClick: (e) => {
336
+ if (n.accordion) i.value = i.value[0] === e ? [] : [e];
337
+ else {
338
+ let t = i.value.indexOf(e);
339
+ t > -1 ? i.value.splice(t, 1) : i.value.push(e);
340
+ }
341
+ let t = [...i.value];
342
+ r("update:modelValue", t), r("change", t);
343
+ }
344
+ }), (e, t) => (x(), u("div", he, [T(e.$slots, "default", {}, void 0, !0)]));
345
+ }
346
+ }), [["__scopeId", "data-v-c1ccd149"]])), ge = {
347
+ name: {
348
+ type: String,
349
+ required: !0
350
+ },
351
+ title: {
352
+ type: String,
353
+ default: ""
354
+ },
355
+ disabled: {
356
+ type: Boolean,
357
+ default: !1
358
+ }
359
+ }, _e = [
360
+ "disabled",
361
+ "aria-expanded",
362
+ "aria-controls"
363
+ ], ve = { class: "el-like-collapse-item__title" }, ye = ["id"], be = { class: "el-like-collapse-item__content" }, Z = /* @__PURE__ */ I(/* @__PURE__ */ R(/* @__PURE__ */ m({
364
+ name: "ElLike-CollapseItem",
365
+ __name: "CollapseItem",
366
+ props: ge,
367
+ setup(e) {
368
+ let t = e, n = g(me), r = s(() => n?.activeNames.value.includes(t.name) ?? !1), i = k(), a = () => {
369
+ t.disabled || n?.handleItemClick(t.name);
370
+ }, c = (e) => {
371
+ typeof requestAnimationFrame == "function" ? requestAnimationFrame(e) : e();
372
+ }, l = (e) => {
373
+ let t = e;
374
+ t.style.height = "0";
375
+ }, f = (e) => {
376
+ let t = e;
377
+ t.offsetHeight, c(() => {
378
+ t.style.height = `${t.scrollHeight}px`;
379
+ });
380
+ }, m = (e) => {
381
+ let t = e;
382
+ t.style.height = "";
383
+ }, h = (e) => {
384
+ let t = e;
385
+ t.style.height = `${t.scrollHeight}px`, t.offsetHeight, c(() => {
386
+ t.style.height = "0";
387
+ });
388
+ };
389
+ return (e, t) => (x(), u("div", { class: v(["el-like-collapse-item", {
390
+ "is-active": r.value,
391
+ "is-disabled": e.disabled
392
+ }]) }, [d("button", {
393
+ class: v(["el-like-collapse-item__header", { "is-active": r.value }]),
394
+ type: "button",
395
+ disabled: e.disabled,
396
+ "aria-expanded": r.value,
397
+ "aria-controls": O(i),
398
+ onClick: a
399
+ }, [T(e.$slots, "title", {}, () => [d("span", ve, D(e.title || e.name), 1)], !0), d("span", {
400
+ class: v(["el-like-collapse-item__arrow", { "is-active": r.value }]),
401
+ "aria-hidden": "true"
402
+ }, null, 2)], 10, _e), p(o, {
403
+ onBeforeEnter: l,
404
+ onEnter: f,
405
+ onAfterEnter: m,
406
+ onLeave: h,
407
+ persisted: ""
408
+ }, {
409
+ default: N(() => [P(d("div", {
410
+ id: O(i),
411
+ class: "el-like-collapse-item__wrap"
412
+ }, [d("div", be, [T(e.$slots, "default", {}, void 0, !0)])], 8, ye), [[j, r.value]])]),
413
+ _: 3
414
+ })], 2));
415
+ }
416
+ }), [["__scopeId", "data-v-aa284808"]])), xe = {
417
+ content: {
418
+ type: String,
419
+ default: ""
420
+ },
421
+ trigger: {
422
+ type: String,
423
+ default: "hover",
424
+ validator: (e) => [
425
+ "hover",
426
+ "click",
427
+ "focus"
428
+ ].includes(e)
429
+ },
430
+ placement: {
431
+ type: String,
432
+ default: "left",
433
+ validator: (e) => [
434
+ "top",
435
+ "bottom",
436
+ "left",
437
+ "right"
438
+ ].includes(e)
439
+ },
440
+ manual: {
441
+ type: Boolean,
442
+ default: !1
443
+ },
444
+ openDelay: {
445
+ type: Number,
446
+ default: 100
447
+ },
448
+ closeDelay: {
449
+ type: Number,
450
+ default: 100
451
+ },
452
+ visible: {
453
+ type: Boolean,
454
+ default: void 0
455
+ },
456
+ popperClass: {
457
+ type: String,
458
+ default: ""
459
+ }
460
+ }, Se = ["id"], Q = 8, $ = 8, Ce = /*#__PURE__*/ R(/* @__PURE__ */ m({
461
+ name: "ElLike-Tooltip",
462
+ __name: "Tooltip",
463
+ props: xe,
464
+ emits: ["visible-change", "update:visible"],
465
+ setup(e, { expose: t, emit: n }) {
466
+ let r = e, s = n, m = C(!1), h = C(r.placement), g = k(), y = A("triggerRef"), b = A("popperRef"), S, w, E, j = () => {
467
+ clearTimeout(S), clearTimeout(w), S = void 0, w = void 0;
468
+ }, P = async () => {
469
+ m.value || (m.value = !0, await _(), W(), q(!0), ce(), s("visible-change", !0), s("update:visible", !0));
470
+ }, F = () => {
471
+ m.value && (m.value = !1, q(!1), K(), s("visible-change", !1), s("update:visible", !1));
472
+ }, I = (e) => {
473
+ j(), e && r.openDelay > 0 ? S = setTimeout(() => {
474
+ P();
475
+ }, r.openDelay) : P();
476
+ }, L = (e) => {
477
+ j(), e && r.closeDelay > 0 ? w = setTimeout(() => {
478
+ F();
479
+ }, r.closeDelay) : F();
480
+ }, R = () => {
481
+ r.manual || r.trigger !== "hover" || I(!0);
482
+ }, z = () => {
483
+ r.manual || r.trigger !== "hover" || L(!0);
484
+ }, B = () => {
485
+ r.manual || r.trigger !== "click" || (m.value ? L(!1) : I(!1));
486
+ }, te = () => {
487
+ r.manual || r.trigger !== "focus" || I(!1);
488
+ }, ne = () => {
489
+ r.manual || r.trigger !== "focus" || L(!1);
490
+ }, re = () => {
491
+ r.manual || r.trigger !== "hover" || j();
492
+ }, V = () => {
493
+ r.manual || r.trigger !== "hover" || L(!0);
494
+ }, H = (e) => {
495
+ let t = e.target;
496
+ t && (y.value?.contains(t) || b.value?.contains(t) || L(!1));
497
+ }, ie = {
498
+ top: "bottom",
499
+ bottom: "top",
500
+ left: "right",
501
+ right: "left"
502
+ }, ae = (e, t, n) => {
503
+ let r = t.left + t.width / 2, i = t.top + t.height / 2;
504
+ switch (e) {
505
+ case "top": return {
506
+ left: r - n.width / 2,
507
+ top: t.top - Q - n.height
508
+ };
509
+ case "bottom": return {
510
+ left: r - n.width / 2,
511
+ top: t.bottom + Q
512
+ };
513
+ case "left": return {
514
+ left: t.left - Q - n.width,
515
+ top: i - n.height / 2
516
+ };
517
+ case "right": return {
518
+ left: t.right + Q,
519
+ top: i - n.height / 2
520
+ };
521
+ }
522
+ }, oe = (e, t, n, r) => e.left >= $ && e.top >= $ && e.left + t.width <= n - $ && e.top + t.height <= r - $, U = (e, t, n) => Math.min(Math.max(e, t), n), W = () => {
523
+ let e = y.value, t = b.value;
524
+ if (!e || !t) return;
525
+ let n = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = r.placement, o = ae(a, n, i);
526
+ oe(o, i, window.innerWidth, window.innerHeight) || (a = ie[a], o = ae(a, n, i)), o = {
527
+ left: U(o.left, $, window.innerWidth - i.width - $),
528
+ top: U(o.top, $, window.innerHeight - i.height - $)
529
+ }, h.value = a, t.style.left = `${o.left}px`, t.style.top = `${o.top}px`;
530
+ }, se = () => {
531
+ E === void 0 && (typeof requestAnimationFrame == "function" ? E = requestAnimationFrame(() => {
532
+ E = void 0, W();
533
+ }) : W());
534
+ }, G = () => se(), ce = () => {
535
+ typeof window < "u" && (window.addEventListener("scroll", G, !0), window.addEventListener("resize", G), r.trigger === "click" && !r.manual && document.addEventListener("click", H));
536
+ }, K = () => {
537
+ typeof window < "u" && (window.removeEventListener("scroll", G, !0), window.removeEventListener("resize", G), document.removeEventListener("click", H));
538
+ }, q = (e) => {
539
+ let t = y.value?.firstElementChild;
540
+ t instanceof HTMLElement && (e ? t.setAttribute("aria-describedby", g) : t.removeAttribute("aria-describedby"));
541
+ };
542
+ return M(() => r.visible, (e) => {
543
+ e !== void 0 && e !== m.value && (e ? I(!1) : L(!1));
544
+ }, { immediate: !0 }), M(() => r.placement, (e) => {
545
+ h.value = e, m.value && W();
546
+ }), ee(() => {
547
+ j(), K(), q(!1);
548
+ }), t({
549
+ open: () => I(!1),
550
+ close: () => L(!1),
551
+ toggle: () => {
552
+ m.value ? L(!1) : I(!1);
553
+ }
554
+ }), (e, t) => (x(), u(i, null, [d("span", {
555
+ ref_key: "triggerRef",
556
+ ref: y,
557
+ class: "el-like-tooltip__trigger",
558
+ onMouseenter: R,
559
+ onMouseleave: z,
560
+ onClick: B,
561
+ onFocusin: te,
562
+ onFocusout: ne
563
+ }, [T(e.$slots, "default", {}, void 0, !0)], 544), (x(), c(a, { to: "body" }, [p(o, { name: "el-like-tooltip-fade" }, {
564
+ default: N(() => [m.value ? (x(), u("div", {
565
+ key: 0,
566
+ id: O(g),
567
+ ref_key: "popperRef",
568
+ ref: b,
569
+ class: v(["el-like-tooltip", e.popperClass]),
570
+ role: "tooltip",
571
+ onMouseenter: re,
572
+ onMouseleave: V
573
+ }, [T(e.$slots, "content", {}, () => [f(D(e.content), 1)], !0), d("span", {
574
+ class: v(["el-like-tooltip__arrow", `is-${h.value}`]),
575
+ "aria-hidden": "true"
576
+ }, null, 2)], 42, Se)) : l("", !0)]),
577
+ _: 3
578
+ })]))], 64));
579
+ }
580
+ }), [["__scopeId", "data-v-65f57a5a"]]), we = /* @__PURE__ */ I(Ce), Te = {
581
+ ...xe,
582
+ trigger: {
583
+ type: String,
584
+ default: "click",
585
+ validator: (e) => [
586
+ "hover",
587
+ "click",
588
+ "focus"
589
+ ].includes(e)
590
+ },
591
+ placement: {
592
+ type: String,
593
+ default: "bottom",
594
+ validator: (e) => [
595
+ "top",
596
+ "bottom",
597
+ "left",
598
+ "right"
599
+ ].includes(e)
600
+ },
601
+ menuOptions: {
602
+ type: Array,
603
+ required: !0
604
+ },
605
+ hideAfterClick: {
606
+ type: Boolean,
607
+ default: !1
608
+ }
609
+ }, Ee = {
610
+ class: "el-like-dropdown-menu",
611
+ role: "menu"
612
+ }, De = ["disabled", "onClick"], Oe = { class: "el-like-dropdown-menu__label" }, ke = /* @__PURE__ */ I(/* @__PURE__ */ R(/* @__PURE__ */ m({
613
+ name: "ElLike-Dropdown",
614
+ __name: "Dropdown",
615
+ props: Te,
616
+ emits: [
617
+ "visible-change",
618
+ "update:visible",
619
+ "select"
620
+ ],
621
+ setup(e, { emit: t }) {
622
+ let n = e, r = t, a = A("tooltipRef"), o = s(() => ["el-like-dropdown", n.popperClass].filter(Boolean).join(" ")), f = (e) => {
623
+ r("visible-change", e);
624
+ }, p = (e) => {
625
+ r("update:visible", e);
626
+ }, m = (e) => {
627
+ e.disabled || (r("select", e), n.hideAfterClick && a.value?.close());
628
+ };
629
+ return (e, t) => (x(), c(Ce, {
630
+ ref_key: "tooltipRef",
631
+ ref: a,
632
+ content: n.content,
633
+ trigger: n.trigger,
634
+ placement: n.placement,
635
+ manual: n.manual,
636
+ "open-delay": n.openDelay,
637
+ "close-delay": n.closeDelay,
638
+ visible: n.visible,
639
+ "popper-class": o.value,
640
+ onVisibleChange: f,
641
+ "onUpdate:visible": p
642
+ }, {
643
+ content: N(() => [d("ul", Ee, [(x(!0), u(i, null, w(n.menuOptions, (e, t) => (x(), u("li", {
644
+ key: t,
645
+ class: v(["el-like-dropdown-menu__item", { "is-divided": e.divided }])
646
+ }, [d("button", {
647
+ type: "button",
648
+ class: "el-like-dropdown-menu__action",
649
+ role: "menuitem",
650
+ disabled: e.disabled,
651
+ onClick: (t) => m(e)
652
+ }, [e.icon ? (x(), c(z, {
653
+ key: 0,
654
+ icon: e.icon,
655
+ class: "el-like-dropdown-menu__icon",
656
+ "aria-hidden": "true"
657
+ }, null, 8, ["icon"])) : l("", !0), d("span", Oe, D(e.label), 1)], 8, De)], 2))), 128))])]),
658
+ default: N(() => [T(e.$slots, "default", {}, void 0, !0)]),
659
+ _: 3
660
+ }, 8, [
661
+ "content",
662
+ "trigger",
663
+ "placement",
664
+ "manual",
665
+ "open-delay",
666
+ "close-delay",
667
+ "visible",
668
+ "popper-class"
669
+ ]));
670
+ }
671
+ }), [["__scopeId", "data-v-39514355"]])), Ae = [
672
+ B,
673
+ V,
674
+ U,
675
+ J,
676
+ Y,
677
+ X,
678
+ Z,
679
+ we,
680
+ ke
681
+ ], je = (e) => {
682
+ Ae.forEach((t) => t.install(e));
683
+ }, Me = {
684
+ install: je,
685
+ ElLikeIcon: B,
686
+ ElLikeButton: V,
687
+ ElLikeCard: U,
688
+ ElLikeDialog: J,
689
+ ElLikePager: Y,
690
+ ElLikeCollapse: X,
691
+ ElLikeCollapseItem: Z,
692
+ ElLikeTooltip: we,
693
+ ElLikeDropdown: ke
694
+ };
695
+ //#endregion
696
+ export { V as ElLikeButton, U as ElLikeCard, X as ElLikeCollapse, Z as ElLikeCollapseItem, J as ElLikeDialog, ke as ElLikeDropdown, B as ElLikeIcon, Y as ElLikePager, we as ElLikeTooltip, Me as default, je as install };