st-comp 0.0.122 → 0.0.124

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.
Files changed (92) hide show
  1. package/es/ChartLayout.js +2 -2
  2. package/es/Dialog.cjs +1 -1
  3. package/es/Dialog.js +14 -13
  4. package/es/FactorWarning.cjs +1 -1
  5. package/es/FactorWarning.js +26 -25
  6. package/es/Kline.cjs +1 -1
  7. package/es/Kline.js +849 -1605
  8. package/es/KlineBasic.cjs +6 -0
  9. package/es/KlineBasic.js +2888 -0
  10. package/es/KlineNew.cjs +1 -1
  11. package/es/KlineNew.js +12 -12
  12. package/es/Pagination.cjs +1 -1
  13. package/es/Pagination.js +18 -17
  14. package/es/Pie.cjs +1 -1
  15. package/es/Pie.js +1 -1
  16. package/es/Table.cjs +1 -1
  17. package/es/Table.js +18 -17
  18. package/es/User.cjs +1 -1
  19. package/es/User.js +75 -74
  20. package/es/VarietySearch.cjs +1 -1
  21. package/es/VarietySearch.js +903 -1253
  22. package/es/VirtualTable.cjs +1 -1
  23. package/es/VirtualTable.js +13 -12
  24. package/es/{base-f7877059.js → base-a8f938bd.js} +6 -6
  25. package/es/{castArray-18f43497.js → castArray-5c01dae1.js} +1 -1
  26. package/es/config-provider-4954003d.cjs +1 -0
  27. package/es/{config-provider-6479d795.js → config-provider-d3edea8a.js} +3 -3
  28. package/es/{debounce-2336e546.js → debounce-edbff018.js} +10 -10
  29. package/es/{dropdown-46daf582.js → dropdown-7e381525.js} +4 -4
  30. package/es/el-button-c7b375c4.cjs +1 -0
  31. package/es/{el-button-802f579a.js → el-button-ce99c64e.js} +6 -5
  32. package/es/{el-empty-3c5ec277.js → el-empty-ed6c115b.js} +1 -1
  33. package/es/{el-form-item-84099d46.js → el-form-item-b686a8bb.js} +9 -9
  34. package/es/{el-form-item-c39f717e.cjs → el-form-item-ff0d8d07.cjs} +1 -1
  35. package/es/{el-input-fac5b401.js → el-input-21e079e4.js} +5 -5
  36. package/es/el-menu-item-9369a2ad.js +771 -0
  37. package/es/el-menu-item-dc904a35.cjs +1 -0
  38. package/es/el-message-e97bdea1.cjs +1 -0
  39. package/es/el-message-fd827012.js +374 -0
  40. package/es/el-overlay-7b90d61c.cjs +1 -0
  41. package/es/{el-overlay-69e9ae49.js → el-overlay-9245ec1e.js} +77 -76
  42. package/es/{el-popover-694ded47.js → el-popover-6f075cee.js} +4 -4
  43. package/es/{el-popover-8735b1fa.cjs → el-popover-6f48d00b.cjs} +1 -1
  44. package/es/{el-popper-6126b1f6.js → el-popper-8dca8dd4.js} +4 -4
  45. package/es/{el-scrollbar-e0493906.js → el-scrollbar-906103f8.js} +1 -1
  46. package/es/{el-select-513126a5.js → el-select-6d6093eb.js} +10 -10
  47. package/es/el-table-column-26e7f13f.cjs +14 -0
  48. package/es/{el-table-column-3c920bdd.js → el-table-column-3f388c44.js} +15 -14
  49. package/es/{el-tag-5becabc9.js → el-tag-cdf0019e.js} +19 -19
  50. package/es/{index-7e40be25.js → index-53bce290.js} +3 -3
  51. package/es/index-669a0983.js +14 -0
  52. package/es/{index-048dca7e.js → index-6ced00c4.js} +1 -1
  53. package/es/index-c4649a37.cjs +3 -0
  54. package/es/{index-dc273ea2.cjs → index-d1b7c61e.cjs} +39 -39
  55. package/es/{index-57f8f7b9.js → index-f8e448bc.js} +5893 -5856
  56. package/es/{raf-07da7cdf.js → raf-b584bce8.js} +1 -1
  57. package/es/{refs-1b1fe6ca.js → refs-e1675167.js} +1 -1
  58. package/es/{scroll-3b521d81.js → scroll-25ec9230.js} +1 -1
  59. package/es/style.css +1 -1
  60. package/es/{use-form-common-props-f3a520d0.js → use-form-common-props-f7d2e83c.js} +18 -18
  61. package/es/use-global-config-8429db7d.js +72 -0
  62. package/es/{index-8a0b1c53.cjs → use-global-config-ac2dad80.cjs} +1 -3
  63. package/es/{vnode-25d7c2f5.js → vnode-699e61cb.js} +1 -1
  64. package/es/{zh-cn-74781bbd.js → zh-cn-61ca7f91.js} +2 -2
  65. package/es/{zh-cn-ab9a583d.cjs → zh-cn-a20960b5.cjs} +1 -1
  66. package/lib/bundle.js +1 -1
  67. package/lib/bundle.umd.cjs +213 -208
  68. package/lib/{index-62c62885.js → index-741ecbcc.js} +38391 -35484
  69. package/lib/{python-6cdad7a6.js → python-5a672b35.js} +1 -1
  70. package/lib/style.css +1 -1
  71. package/package.json +2 -2
  72. package/packages/KlineBasic/api.js +60 -0
  73. package/packages/KlineBasic/components/Contextmenu/index.vue +105 -0
  74. package/packages/KlineBasic/components/KlineSub/index.vue +297 -0
  75. package/packages/KlineBasic/components/KlineTips/index.vue +66 -0
  76. package/packages/KlineBasic/components/Tips/index.vue +33 -0
  77. package/packages/KlineBasic/index.ts +8 -0
  78. package/packages/KlineBasic/index.vue +565 -0
  79. package/packages/KlineBasic/utils.js +86 -0
  80. package/packages/VarietySearch/components/FactorScreen/index.vue +7 -7
  81. package/packages/index.ts +2 -0
  82. package/src/main.ts +2 -0
  83. package/src/pages/KlineBasic/api.js +45 -0
  84. package/src/pages/KlineBasic/index.vue +74 -0
  85. package/src/pages/KlineBasic/indicator.js +114 -0
  86. package/src/pages/VarietySearch/index.vue +3 -2
  87. package/src/router/routes.ts +5 -0
  88. package/es/config-provider-7cdfca4d.cjs +0 -1
  89. package/es/el-button-196807af.cjs +0 -1
  90. package/es/el-overlay-891dcc40.cjs +0 -1
  91. package/es/el-table-column-dd8b62aa.cjs +0 -14
  92. package/es/index-35117549.js +0 -81
@@ -0,0 +1,771 @@
1
+ import { defineComponent as z, openBlock as B, createBlock as ve, Transition as Ee, mergeProps as Te, unref as He, toHandlers as Le, withCtx as Q, renderSlot as $, computed as h, getCurrentInstance as fe, inject as X, ref as E, reactive as he, watch as J, provide as me, onMounted as be, onBeforeUnmount as Se, h as b, Fragment as ge, withDirectives as we, vShow as We, watchEffect as Re, nextTick as je, toRef as De, resolveComponent as qe, createElementBlock as Y, normalizeClass as ee, createElementVNode as pe, createTextVNode as Fe, toDisplayString as Ve } from "vue";
2
+ import { a as Ge } from "./el-scrollbar-906103f8.js";
3
+ import { g as Ue, h as Ze, E as ke, j as F, m as Je } from "./use-form-common-props-f7d2e83c.js";
4
+ import { E as T, t as K } from "./index-6ced00c4.js";
5
+ import { u as w, _ as oe, w as $e, n as Z, r as ie, o as Ke, b as Me, t as te, i as R, p as Ce, d as ne, g as Qe, q as xe, s as Oe, v as ye } from "./base-a8f938bd.js";
6
+ import { E as _e } from "./el-popper-8dca8dd4.js";
7
+ import { T as Xe } from "./index-657047bb.js";
8
+ import { C as Ye } from "./el-tag-cdf0019e.js";
9
+ import { m as et } from "./typescript-7ae59c4c.js";
10
+ import { f as tt } from "./vnode-699e61cb.js";
11
+ const nt = z({
12
+ name: "ElCollapseTransition"
13
+ }), ot = /* @__PURE__ */ z({
14
+ ...nt,
15
+ setup(e) {
16
+ const o = w("collapse-transition"), n = (t) => {
17
+ t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow, t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom;
18
+ }, r = {
19
+ beforeEnter(t) {
20
+ t.dataset || (t.dataset = {}), t.dataset.oldPaddingTop = t.style.paddingTop, t.dataset.oldPaddingBottom = t.style.paddingBottom, t.style.height && (t.dataset.elExistsHeight = t.style.height), t.style.maxHeight = 0, t.style.paddingTop = 0, t.style.paddingBottom = 0;
21
+ },
22
+ enter(t) {
23
+ requestAnimationFrame(() => {
24
+ t.dataset.oldOverflow = t.style.overflow, t.dataset.elExistsHeight ? t.style.maxHeight = t.dataset.elExistsHeight : t.scrollHeight !== 0 ? t.style.maxHeight = `${t.scrollHeight}px` : t.style.maxHeight = 0, t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom, t.style.overflow = "hidden";
25
+ });
26
+ },
27
+ afterEnter(t) {
28
+ t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow;
29
+ },
30
+ enterCancelled(t) {
31
+ n(t);
32
+ },
33
+ beforeLeave(t) {
34
+ t.dataset || (t.dataset = {}), t.dataset.oldPaddingTop = t.style.paddingTop, t.dataset.oldPaddingBottom = t.style.paddingBottom, t.dataset.oldOverflow = t.style.overflow, t.style.maxHeight = `${t.scrollHeight}px`, t.style.overflow = "hidden";
35
+ },
36
+ leave(t) {
37
+ t.scrollHeight !== 0 && (t.style.maxHeight = 0, t.style.paddingTop = 0, t.style.paddingBottom = 0);
38
+ },
39
+ afterLeave(t) {
40
+ n(t);
41
+ },
42
+ leaveCancelled(t) {
43
+ n(t);
44
+ }
45
+ };
46
+ return (t, I) => (B(), ve(Ee, Te({
47
+ name: He(o).b()
48
+ }, Le(r)), {
49
+ default: Q(() => [
50
+ $(t.$slots, "default")
51
+ ]),
52
+ _: 3
53
+ }, 16, ["name"]));
54
+ }
55
+ });
56
+ var st = /* @__PURE__ */ oe(ot, [["__file", "collapse-transition.vue"]]);
57
+ const at = $e(st);
58
+ let lt = class {
59
+ constructor(o, n) {
60
+ this.parent = o, this.domNode = n, this.subIndex = 0, this.subIndex = 0, this.init();
61
+ }
62
+ init() {
63
+ this.subMenuItems = this.domNode.querySelectorAll("li"), this.addListeners();
64
+ }
65
+ gotoSubIndex(o) {
66
+ o === this.subMenuItems.length ? o = 0 : o < 0 && (o = this.subMenuItems.length - 1), this.subMenuItems[o].focus(), this.subIndex = o;
67
+ }
68
+ addListeners() {
69
+ const o = this.parent.domNode;
70
+ Array.prototype.forEach.call(this.subMenuItems, (n) => {
71
+ n.addEventListener("keydown", (r) => {
72
+ let t = !1;
73
+ switch (r.code) {
74
+ case T.down: {
75
+ this.gotoSubIndex(this.subIndex + 1), t = !0;
76
+ break;
77
+ }
78
+ case T.up: {
79
+ this.gotoSubIndex(this.subIndex - 1), t = !0;
80
+ break;
81
+ }
82
+ case T.tab: {
83
+ K(o, "mouseleave");
84
+ break;
85
+ }
86
+ case T.enter:
87
+ case T.numpadEnter:
88
+ case T.space: {
89
+ t = !0, r.currentTarget.click();
90
+ break;
91
+ }
92
+ }
93
+ return t && (r.preventDefault(), r.stopPropagation()), !1;
94
+ });
95
+ });
96
+ }
97
+ }, ut = class {
98
+ constructor(o, n) {
99
+ this.domNode = o, this.submenu = null, this.submenu = null, this.init(n);
100
+ }
101
+ init(o) {
102
+ this.domNode.setAttribute("tabindex", "0");
103
+ const n = this.domNode.querySelector(`.${o}-menu`);
104
+ n && (this.submenu = new lt(this, n)), this.addListeners();
105
+ }
106
+ addListeners() {
107
+ this.domNode.addEventListener("keydown", (o) => {
108
+ let n = !1;
109
+ switch (o.code) {
110
+ case T.down: {
111
+ K(o.currentTarget, "mouseenter"), this.submenu && this.submenu.gotoSubIndex(0), n = !0;
112
+ break;
113
+ }
114
+ case T.up: {
115
+ K(o.currentTarget, "mouseenter"), this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1), n = !0;
116
+ break;
117
+ }
118
+ case T.tab: {
119
+ K(o.currentTarget, "mouseleave");
120
+ break;
121
+ }
122
+ case T.enter:
123
+ case T.numpadEnter:
124
+ case T.space: {
125
+ n = !0, o.currentTarget.click();
126
+ break;
127
+ }
128
+ }
129
+ n && o.preventDefault();
130
+ });
131
+ }
132
+ }, it = class {
133
+ constructor(o, n) {
134
+ this.domNode = o, this.init(n);
135
+ }
136
+ init(o) {
137
+ const n = this.domNode.childNodes;
138
+ Array.from(n).forEach((r) => {
139
+ r.nodeType === 1 && new ut(r, o);
140
+ });
141
+ }
142
+ };
143
+ const rt = z({
144
+ name: "ElMenuCollapseTransition",
145
+ setup() {
146
+ const e = w("menu");
147
+ return {
148
+ listeners: {
149
+ onBeforeEnter: (n) => n.style.opacity = "0.2",
150
+ onEnter(n, r) {
151
+ Z(n, `${e.namespace.value}-opacity-transition`), n.style.opacity = "1", r();
152
+ },
153
+ onAfterEnter(n) {
154
+ ie(n, `${e.namespace.value}-opacity-transition`), n.style.opacity = "";
155
+ },
156
+ onBeforeLeave(n) {
157
+ n.dataset || (n.dataset = {}), Ke(n, e.m("collapse")) ? (ie(n, e.m("collapse")), n.dataset.oldOverflow = n.style.overflow, n.dataset.scrollWidth = n.clientWidth.toString(), Z(n, e.m("collapse"))) : (Z(n, e.m("collapse")), n.dataset.oldOverflow = n.style.overflow, n.dataset.scrollWidth = n.clientWidth.toString(), ie(n, e.m("collapse"))), n.style.width = `${n.scrollWidth}px`, n.style.overflow = "hidden";
158
+ },
159
+ onLeave(n) {
160
+ Z(n, "horizontal-collapse-transition"), n.style.width = `${n.dataset.scrollWidth}px`;
161
+ }
162
+ }
163
+ };
164
+ }
165
+ });
166
+ function ct(e, o, n, r, t, I) {
167
+ return B(), ve(Ee, Te({ mode: "out-in" }, e.listeners), {
168
+ default: Q(() => [
169
+ $(e.$slots, "default")
170
+ ]),
171
+ _: 3
172
+ }, 16);
173
+ }
174
+ var dt = /* @__PURE__ */ oe(rt, [["render", ct], ["__file", "menu-collapse-transition.vue"]]);
175
+ function Pe(e, o) {
176
+ const n = h(() => {
177
+ let t = e.parent;
178
+ const I = [o.value];
179
+ for (; t.type.name !== "ElMenu"; )
180
+ t.props.index && I.unshift(t.props.index), t = t.parent;
181
+ return I;
182
+ });
183
+ return {
184
+ parentMenu: h(() => {
185
+ let t = e.parent;
186
+ for (; t && !["ElMenu", "ElSubMenu"].includes(t.type.name); )
187
+ t = t.parent;
188
+ return t;
189
+ }),
190
+ indexPath: n
191
+ };
192
+ }
193
+ function mt(e) {
194
+ return h(() => {
195
+ const n = e.backgroundColor;
196
+ return n ? new Xe(n).shade(20).toString() : "";
197
+ });
198
+ }
199
+ const Ne = (e, o) => {
200
+ const n = w("menu");
201
+ return h(() => n.cssVarBlock({
202
+ "text-color": e.textColor || "",
203
+ "hover-text-color": e.textColor || "",
204
+ "bg-color": e.backgroundColor || "",
205
+ "hover-bg-color": mt(e).value || "",
206
+ "active-color": e.activeTextColor || "",
207
+ level: `${o}`
208
+ }));
209
+ }, pt = Me({
210
+ index: {
211
+ type: String,
212
+ required: !0
213
+ },
214
+ showTimeout: Number,
215
+ hideTimeout: Number,
216
+ popperClass: String,
217
+ disabled: Boolean,
218
+ teleported: {
219
+ type: Boolean,
220
+ default: void 0
221
+ },
222
+ popperOffset: Number,
223
+ expandCloseIcon: {
224
+ type: F
225
+ },
226
+ expandOpenIcon: {
227
+ type: F
228
+ },
229
+ collapseCloseIcon: {
230
+ type: F
231
+ },
232
+ collapseOpenIcon: {
233
+ type: F
234
+ }
235
+ }), re = "ElSubMenu";
236
+ var Ie = z({
237
+ name: re,
238
+ props: pt,
239
+ setup(e, { slots: o, expose: n }) {
240
+ const r = fe(), { indexPath: t, parentMenu: I } = Pe(r, h(() => e.index)), m = w("menu"), y = w("sub-menu"), u = X("rootMenu");
241
+ u || te(re, "can not inject root menu");
242
+ const d = X(`subMenu:${I.value.uid}`);
243
+ d || te(re, "can not inject sub menu");
244
+ const p = E({}), g = E({});
245
+ let C;
246
+ const k = E(!1), se = E(), V = E(null), O = h(() => P.value === "horizontal" && _.value ? "bottom-start" : "right-start"), A = h(() => P.value === "horizontal" && _.value || P.value === "vertical" && !u.props.collapse ? e.expandCloseIcon && e.expandOpenIcon ? S.value ? e.expandOpenIcon : e.expandCloseIcon : Ue : e.collapseCloseIcon && e.collapseOpenIcon ? S.value ? e.collapseOpenIcon : e.collapseCloseIcon : Ze), _ = h(() => d.level === 0), j = h(() => {
247
+ const l = e.teleported;
248
+ return l === void 0 ? _.value : l;
249
+ }), ae = h(() => u.props.collapse ? `${m.namespace.value}-zoom-in-left` : `${m.namespace.value}-zoom-in-top`), le = h(() => P.value === "horizontal" && _.value ? [
250
+ "bottom-start",
251
+ "bottom-end",
252
+ "top-start",
253
+ "top-end",
254
+ "right-start",
255
+ "left-start"
256
+ ] : [
257
+ "right-start",
258
+ "right",
259
+ "right-end",
260
+ "left-start",
261
+ "bottom-start",
262
+ "bottom-end",
263
+ "top-start",
264
+ "top-end"
265
+ ]), S = h(() => u.openedMenus.includes(e.index)), H = h(() => {
266
+ let l = !1;
267
+ return Object.values(p.value).forEach((c) => {
268
+ c.active && (l = !0);
269
+ }), Object.values(g.value).forEach((c) => {
270
+ c.active && (l = !0);
271
+ }), l;
272
+ }), P = h(() => u.props.mode), L = he({
273
+ index: e.index,
274
+ indexPath: t,
275
+ active: H
276
+ }), D = Ne(u.props, d.level + 1), G = h(() => {
277
+ var l;
278
+ return (l = e.popperOffset) != null ? l : u.props.popperOffset;
279
+ }), W = h(() => {
280
+ var l;
281
+ return (l = e.popperClass) != null ? l : u.props.popperClass;
282
+ }), U = h(() => {
283
+ var l;
284
+ return (l = e.showTimeout) != null ? l : u.props.showTimeout;
285
+ }), ue = h(() => {
286
+ var l;
287
+ return (l = e.hideTimeout) != null ? l : u.props.hideTimeout;
288
+ }), s = () => {
289
+ var l, c, M;
290
+ return (M = (c = (l = V.value) == null ? void 0 : l.popperRef) == null ? void 0 : c.popperInstanceRef) == null ? void 0 : M.destroy();
291
+ }, a = (l) => {
292
+ l || s();
293
+ }, i = () => {
294
+ u.props.menuTrigger === "hover" && u.props.mode === "horizontal" || u.props.collapse && u.props.mode === "vertical" || e.disabled || u.handleSubMenuClick({
295
+ index: e.index,
296
+ indexPath: t.value,
297
+ active: H.value
298
+ });
299
+ }, v = (l, c = U.value) => {
300
+ var M;
301
+ if (l.type !== "focus") {
302
+ if (u.props.menuTrigger === "click" && u.props.mode === "horizontal" || !u.props.collapse && u.props.mode === "vertical" || e.disabled) {
303
+ d.mouseInChild.value = !0;
304
+ return;
305
+ }
306
+ d.mouseInChild.value = !0, C == null || C(), { stop: C } = Ce(() => {
307
+ u.openMenu(e.index, t.value);
308
+ }, c), j.value && ((M = I.value.vnode.el) == null || M.dispatchEvent(new MouseEvent("mouseenter")));
309
+ }
310
+ }, f = (l = !1) => {
311
+ var c;
312
+ if (u.props.menuTrigger === "click" && u.props.mode === "horizontal" || !u.props.collapse && u.props.mode === "vertical") {
313
+ d.mouseInChild.value = !1;
314
+ return;
315
+ }
316
+ C == null || C(), d.mouseInChild.value = !1, { stop: C } = Ce(() => !k.value && u.closeMenu(e.index, t.value), ue.value), j.value && l && ((c = d.handleMouseleave) == null || c.call(d, !0));
317
+ };
318
+ J(() => u.props.collapse, (l) => a(!!l));
319
+ {
320
+ const l = (M) => {
321
+ g.value[M.index] = M;
322
+ }, c = (M) => {
323
+ delete g.value[M.index];
324
+ };
325
+ me(`subMenu:${r.uid}`, {
326
+ addSubMenu: l,
327
+ removeSubMenu: c,
328
+ handleMouseleave: f,
329
+ mouseInChild: k,
330
+ level: d.level + 1
331
+ });
332
+ }
333
+ return n({
334
+ opened: S
335
+ }), be(() => {
336
+ u.addSubMenu(L), d.addSubMenu(L);
337
+ }), Se(() => {
338
+ d.removeSubMenu(L), u.removeSubMenu(L);
339
+ }), () => {
340
+ var l;
341
+ const c = [
342
+ (l = o.title) == null ? void 0 : l.call(o),
343
+ b(ke, {
344
+ class: y.e("icon-arrow"),
345
+ style: {
346
+ transform: S.value ? e.expandCloseIcon && e.expandOpenIcon || e.collapseCloseIcon && e.collapseOpenIcon && u.props.collapse ? "none" : "rotateZ(180deg)" : "none"
347
+ }
348
+ }, {
349
+ default: () => R(A.value) ? b(r.appContext.components[A.value]) : b(A.value)
350
+ })
351
+ ], M = u.isMenuPopup ? b(_e, {
352
+ ref: V,
353
+ visible: S.value,
354
+ effect: "light",
355
+ pure: !0,
356
+ offset: G.value,
357
+ showArrow: !1,
358
+ persistent: !0,
359
+ popperClass: W.value,
360
+ placement: O.value,
361
+ teleported: j.value,
362
+ fallbackPlacements: le.value,
363
+ transition: ae.value,
364
+ gpuAcceleration: !1
365
+ }, {
366
+ content: () => {
367
+ var x;
368
+ return b("div", {
369
+ class: [
370
+ m.m(P.value),
371
+ m.m("popup-container"),
372
+ W.value
373
+ ],
374
+ onMouseenter: (N) => v(N, 100),
375
+ onMouseleave: () => f(!0),
376
+ onFocus: (N) => v(N, 100)
377
+ }, [
378
+ b("ul", {
379
+ class: [
380
+ m.b(),
381
+ m.m("popup"),
382
+ m.m(`popup-${O.value}`)
383
+ ],
384
+ style: D.value
385
+ }, [(x = o.default) == null ? void 0 : x.call(o)])
386
+ ]);
387
+ },
388
+ default: () => b("div", {
389
+ class: y.e("title"),
390
+ onClick: i
391
+ }, c)
392
+ }) : b(ge, {}, [
393
+ b("div", {
394
+ class: y.e("title"),
395
+ ref: se,
396
+ onClick: i
397
+ }, c),
398
+ b(at, {}, {
399
+ default: () => {
400
+ var x;
401
+ return we(b("ul", {
402
+ role: "menu",
403
+ class: [m.b(), m.m("inline")],
404
+ style: D.value
405
+ }, [(x = o.default) == null ? void 0 : x.call(o)]), [[We, S.value]]);
406
+ }
407
+ })
408
+ ]);
409
+ return b("li", {
410
+ class: [
411
+ y.b(),
412
+ y.is("active", H.value),
413
+ y.is("opened", S.value),
414
+ y.is("disabled", e.disabled)
415
+ ],
416
+ role: "menuitem",
417
+ ariaHaspopup: !0,
418
+ ariaExpanded: S.value,
419
+ onMouseenter: v,
420
+ onMouseleave: () => f(),
421
+ onFocus: v
422
+ }, [M]);
423
+ };
424
+ }
425
+ });
426
+ const vt = Me({
427
+ mode: {
428
+ type: String,
429
+ values: ["horizontal", "vertical"],
430
+ default: "vertical"
431
+ },
432
+ defaultActive: {
433
+ type: String,
434
+ default: ""
435
+ },
436
+ defaultOpeneds: {
437
+ type: ne(Array),
438
+ default: () => et([])
439
+ },
440
+ uniqueOpened: Boolean,
441
+ router: Boolean,
442
+ menuTrigger: {
443
+ type: String,
444
+ values: ["hover", "click"],
445
+ default: "hover"
446
+ },
447
+ collapse: Boolean,
448
+ backgroundColor: String,
449
+ textColor: String,
450
+ activeTextColor: String,
451
+ closeOnClickOutside: Boolean,
452
+ collapseTransition: {
453
+ type: Boolean,
454
+ default: !0
455
+ },
456
+ ellipsis: {
457
+ type: Boolean,
458
+ default: !0
459
+ },
460
+ popperOffset: {
461
+ type: Number,
462
+ default: 6
463
+ },
464
+ ellipsisIcon: {
465
+ type: F,
466
+ default: () => Je
467
+ },
468
+ popperEffect: {
469
+ type: ne(String),
470
+ default: "dark"
471
+ },
472
+ popperClass: String,
473
+ showTimeout: {
474
+ type: Number,
475
+ default: 300
476
+ },
477
+ hideTimeout: {
478
+ type: Number,
479
+ default: 300
480
+ }
481
+ }), ce = (e) => Oe(e) && e.every((o) => R(o)), ft = {
482
+ close: (e, o) => R(e) && ce(o),
483
+ open: (e, o) => R(e) && ce(o),
484
+ select: (e, o, n, r) => R(e) && ce(o) && Qe(n) && (r === void 0 || r instanceof Promise)
485
+ };
486
+ var ht = z({
487
+ name: "ElMenu",
488
+ props: vt,
489
+ emits: ft,
490
+ setup(e, { emit: o, slots: n, expose: r }) {
491
+ const t = fe(), I = t.appContext.config.globalProperties.$router, m = E(), y = w("menu"), u = w("sub-menu"), d = E(-1), p = E(e.defaultOpeneds && !e.collapse ? e.defaultOpeneds.slice(0) : []), g = E(e.defaultActive), C = E({}), k = E({}), se = h(() => e.mode === "horizontal" || e.mode === "vertical" && e.collapse), V = () => {
492
+ const s = g.value && C.value[g.value];
493
+ if (!s || e.mode === "horizontal" || e.collapse)
494
+ return;
495
+ s.indexPath.forEach((i) => {
496
+ const v = k.value[i];
497
+ v && O(i, v.indexPath);
498
+ });
499
+ }, O = (s, a) => {
500
+ p.value.includes(s) || (e.uniqueOpened && (p.value = p.value.filter((i) => a.includes(i))), p.value.push(s), o("open", s, a));
501
+ }, A = (s) => {
502
+ const a = p.value.indexOf(s);
503
+ a !== -1 && p.value.splice(a, 1);
504
+ }, _ = (s, a) => {
505
+ A(s), o("close", s, a);
506
+ }, j = ({
507
+ index: s,
508
+ indexPath: a
509
+ }) => {
510
+ p.value.includes(s) ? _(s, a) : O(s, a);
511
+ }, ae = (s) => {
512
+ (e.mode === "horizontal" || e.collapse) && (p.value = []);
513
+ const { index: a, indexPath: i } = s;
514
+ if (!(xe(a) || xe(i)))
515
+ if (e.router && I) {
516
+ const v = s.route || a, f = I.push(v).then((l) => (l || (g.value = a), l));
517
+ o("select", a, i, { index: a, indexPath: i, route: v }, f);
518
+ } else
519
+ g.value = a, o("select", a, i, { index: a, indexPath: i });
520
+ }, le = (s) => {
521
+ const a = C.value, i = a[s] || g.value && a[g.value] || a[e.defaultActive];
522
+ i ? g.value = i.index : g.value = s;
523
+ }, S = (s) => {
524
+ const a = getComputedStyle(s), i = Number.parseInt(a.marginLeft, 10), v = Number.parseInt(a.marginRight, 10);
525
+ return s.offsetWidth + i + v || 0;
526
+ }, H = () => {
527
+ var s, a;
528
+ if (!m.value)
529
+ return -1;
530
+ const i = Array.from((a = (s = m.value) == null ? void 0 : s.childNodes) != null ? a : []).filter((q) => q.nodeName !== "#text" || q.nodeValue), v = 64, f = getComputedStyle(m.value), l = Number.parseInt(f.paddingLeft, 10), c = Number.parseInt(f.paddingRight, 10), M = m.value.clientWidth - l - c;
531
+ let x = 0, N = 0;
532
+ return i.forEach((q, Ae) => {
533
+ q.nodeName !== "#comment" && (x += S(q), x <= M - v && (N = Ae + 1));
534
+ }), N === i.length ? -1 : N;
535
+ }, P = (s) => k.value[s].indexPath, L = (s, a = 33.34) => {
536
+ let i;
537
+ return () => {
538
+ i && clearTimeout(i), i = setTimeout(() => {
539
+ s();
540
+ }, a);
541
+ };
542
+ };
543
+ let D = !0;
544
+ const G = () => {
545
+ if (d.value === H())
546
+ return;
547
+ const s = () => {
548
+ d.value = -1, je(() => {
549
+ d.value = H();
550
+ });
551
+ };
552
+ D ? s() : L(s)(), D = !1;
553
+ };
554
+ J(() => e.defaultActive, (s) => {
555
+ C.value[s] || (g.value = ""), le(s);
556
+ }), J(() => e.collapse, (s) => {
557
+ s && (p.value = []);
558
+ }), J(C.value, V);
559
+ let W;
560
+ Re(() => {
561
+ e.mode === "horizontal" && e.ellipsis ? W = Ge(m, G).stop : W == null || W();
562
+ });
563
+ const U = E(!1);
564
+ {
565
+ const s = (f) => {
566
+ k.value[f.index] = f;
567
+ }, a = (f) => {
568
+ delete k.value[f.index];
569
+ };
570
+ me("rootMenu", he({
571
+ props: e,
572
+ openedMenus: p,
573
+ items: C,
574
+ subMenus: k,
575
+ activeIndex: g,
576
+ isMenuPopup: se,
577
+ addMenuItem: (f) => {
578
+ C.value[f.index] = f;
579
+ },
580
+ removeMenuItem: (f) => {
581
+ delete C.value[f.index];
582
+ },
583
+ addSubMenu: s,
584
+ removeSubMenu: a,
585
+ openMenu: O,
586
+ closeMenu: _,
587
+ handleMenuItemClick: ae,
588
+ handleSubMenuClick: j
589
+ })), me(`subMenu:${t.uid}`, {
590
+ addSubMenu: s,
591
+ removeSubMenu: a,
592
+ mouseInChild: U,
593
+ level: 0
594
+ });
595
+ }
596
+ be(() => {
597
+ e.mode === "horizontal" && new it(t.vnode.el, y.namespace.value);
598
+ }), r({
599
+ open: (a) => {
600
+ const { indexPath: i } = k.value[a];
601
+ i.forEach((v) => O(v, i));
602
+ },
603
+ close: A,
604
+ handleResize: G
605
+ });
606
+ const ue = Ne(e, 0);
607
+ return () => {
608
+ var s, a;
609
+ let i = (a = (s = n.default) == null ? void 0 : s.call(n)) != null ? a : [];
610
+ const v = [];
611
+ if (e.mode === "horizontal" && m.value) {
612
+ const c = tt(i), M = d.value === -1 ? c : c.slice(0, d.value), x = d.value === -1 ? [] : c.slice(d.value);
613
+ x != null && x.length && e.ellipsis && (i = M, v.push(b(Ie, {
614
+ index: "sub-menu-more",
615
+ class: u.e("hide-arrow"),
616
+ popperOffset: e.popperOffset
617
+ }, {
618
+ title: () => b(ke, {
619
+ class: u.e("icon-more")
620
+ }, {
621
+ default: () => b(e.ellipsisIcon)
622
+ }),
623
+ default: () => x
624
+ })));
625
+ }
626
+ const f = e.closeOnClickOutside ? [
627
+ [
628
+ Ye,
629
+ () => {
630
+ p.value.length && (U.value || (p.value.forEach((c) => o("close", c, P(c))), p.value = []));
631
+ }
632
+ ]
633
+ ] : [], l = we(b("ul", {
634
+ key: String(e.collapse),
635
+ role: "menubar",
636
+ ref: m,
637
+ style: ue.value,
638
+ class: {
639
+ [y.b()]: !0,
640
+ [y.m(e.mode)]: !0,
641
+ [y.m("collapse")]: e.collapse
642
+ }
643
+ }, [...i, ...v]), f);
644
+ return e.collapseTransition && e.mode === "vertical" ? b(dt, () => l) : l;
645
+ };
646
+ }
647
+ });
648
+ const bt = Me({
649
+ index: {
650
+ type: ne([String, null]),
651
+ default: null
652
+ },
653
+ route: {
654
+ type: ne([String, Object])
655
+ },
656
+ disabled: Boolean
657
+ }), gt = {
658
+ click: (e) => R(e.index) && Oe(e.indexPath)
659
+ }, de = "ElMenuItem", Mt = z({
660
+ name: de,
661
+ components: {
662
+ ElTooltip: _e
663
+ },
664
+ props: bt,
665
+ emits: gt,
666
+ setup(e, { emit: o }) {
667
+ const n = fe(), r = X("rootMenu"), t = w("menu"), I = w("menu-item");
668
+ r || te(de, "can not inject root menu");
669
+ const { parentMenu: m, indexPath: y } = Pe(n, De(e, "index")), u = X(`subMenu:${m.value.uid}`);
670
+ u || te(de, "can not inject sub menu");
671
+ const d = h(() => e.index === r.activeIndex), p = he({
672
+ index: e.index,
673
+ indexPath: y,
674
+ active: d
675
+ }), g = () => {
676
+ e.disabled || (r.handleMenuItemClick({
677
+ index: e.index,
678
+ indexPath: y.value,
679
+ route: e.route
680
+ }), o("click", p));
681
+ };
682
+ return be(() => {
683
+ u.addSubMenu(p), r.addMenuItem(p);
684
+ }), Se(() => {
685
+ u.removeSubMenu(p), r.removeMenuItem(p);
686
+ }), {
687
+ parentMenu: m,
688
+ rootMenu: r,
689
+ active: d,
690
+ nsMenu: t,
691
+ nsMenuItem: I,
692
+ handleClick: g
693
+ };
694
+ }
695
+ });
696
+ function yt(e, o, n, r, t, I) {
697
+ const m = qe("el-tooltip");
698
+ return B(), Y("li", {
699
+ class: ee([
700
+ e.nsMenuItem.b(),
701
+ e.nsMenuItem.is("active", e.active),
702
+ e.nsMenuItem.is("disabled", e.disabled)
703
+ ]),
704
+ role: "menuitem",
705
+ tabindex: "-1",
706
+ onClick: e.handleClick
707
+ }, [
708
+ e.parentMenu.type.name === "ElMenu" && e.rootMenu.props.collapse && e.$slots.title ? (B(), ve(m, {
709
+ key: 0,
710
+ effect: e.rootMenu.props.popperEffect,
711
+ placement: "right",
712
+ "fallback-placements": ["left"],
713
+ persistent: ""
714
+ }, {
715
+ content: Q(() => [
716
+ $(e.$slots, "title")
717
+ ]),
718
+ default: Q(() => [
719
+ pe("div", {
720
+ class: ee(e.nsMenu.be("tooltip", "trigger"))
721
+ }, [
722
+ $(e.$slots, "default")
723
+ ], 2)
724
+ ]),
725
+ _: 3
726
+ }, 8, ["effect"])) : (B(), Y(ge, { key: 1 }, [
727
+ $(e.$slots, "default"),
728
+ $(e.$slots, "title")
729
+ ], 64))
730
+ ], 10, ["onClick"]);
731
+ }
732
+ var Be = /* @__PURE__ */ oe(Mt, [["render", yt], ["__file", "menu-item.vue"]]);
733
+ const It = {
734
+ title: String
735
+ }, Ct = "ElMenuItemGroup", xt = z({
736
+ name: Ct,
737
+ props: It,
738
+ setup() {
739
+ return {
740
+ ns: w("menu-item-group")
741
+ };
742
+ }
743
+ });
744
+ function Et(e, o, n, r, t, I) {
745
+ return B(), Y("li", {
746
+ class: ee(e.ns.b())
747
+ }, [
748
+ pe("div", {
749
+ class: ee(e.ns.e("title"))
750
+ }, [
751
+ e.$slots.title ? $(e.$slots, "title", { key: 1 }) : (B(), Y(ge, { key: 0 }, [
752
+ Fe(Ve(e.title), 1)
753
+ ], 64))
754
+ ], 2),
755
+ pe("ul", null, [
756
+ $(e.$slots, "default")
757
+ ])
758
+ ], 2);
759
+ }
760
+ var ze = /* @__PURE__ */ oe(xt, [["render", Et], ["__file", "menu-item-group.vue"]]);
761
+ const Lt = $e(ht, {
762
+ MenuItem: Be,
763
+ MenuItemGroup: ze,
764
+ SubMenu: Ie
765
+ }), Wt = ye(Be);
766
+ ye(ze);
767
+ ye(Ie);
768
+ export {
769
+ Wt as E,
770
+ Lt as a
771
+ };