st-comp 0.0.262 → 0.0.263

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