st-comp 0.0.146 → 0.0.147

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 (148) hide show
  1. package/components.d.ts +0 -3
  2. package/es/ChartLayout.cjs +1 -1
  3. package/es/ChartLayout.js +2 -2
  4. package/es/Dialog.cjs +1 -1
  5. package/es/Dialog.js +22 -26
  6. package/es/FactorWarning.cjs +1 -1
  7. package/es/FactorWarning.js +103 -112
  8. package/es/KlineBasic.cjs +1 -1
  9. package/es/KlineBasic.js +1426 -671
  10. package/es/KlineNew.cjs +3 -1
  11. package/es/KlineNew.js +2736 -314
  12. package/es/Pagination.cjs +1 -1
  13. package/es/Pagination.js +96 -102
  14. package/es/Table.cjs +1 -1
  15. package/es/Table.js +60 -66
  16. package/es/User.cjs +1 -1
  17. package/es/User.js +96 -103
  18. package/es/VarietySearch.cjs +1 -1
  19. package/es/VarietySearch.js +32 -41
  20. package/es/VirtualTable.cjs +1 -13
  21. package/es/VirtualTable.js +1 -2801
  22. package/es/_initCloneObject-7493ecd5.cjs +1 -0
  23. package/es/{_initCloneObject-14b53c6f.js → _initCloneObject-a8dcd058.js} +26 -26
  24. package/es/{base-ec05f348.cjs → base-00ce90ec.cjs} +3 -3
  25. package/es/{base-437d17f3.js → base-674a354a.js} +63 -64
  26. package/es/config-provider-419ffbf2.js +120 -0
  27. package/es/config-provider-68414290.cjs +3 -0
  28. package/es/dropdown-127a8c0d.cjs +1 -0
  29. package/es/{dropdown-634b5e27.js → dropdown-ce30ada6.js} +30 -31
  30. package/es/el-button-7b9f5933.js +745 -0
  31. package/es/el-button-c00975e1.cjs +1 -0
  32. package/es/{el-checkbox-group-e8fece80.js → el-checkbox-group-0554b352.js} +10 -10
  33. package/es/el-checkbox-group-7a313d34.cjs +1 -0
  34. package/es/{el-empty-bacc6613.js → el-empty-39b3aed7.js} +5 -5
  35. package/es/{el-empty-19ea04f4.cjs → el-empty-87154b6d.cjs} +1 -1
  36. package/es/el-form-item-7867f64d.cjs +12 -0
  37. package/es/{el-form-item-af1855f0.js → el-form-item-fc6f80ab.js} +78 -79
  38. package/es/el-input-2ff1628c.cjs +1 -0
  39. package/es/{el-input-4961b99f.js → el-input-d249ac86.js} +82 -84
  40. package/es/{el-input-number-610fc8ba.js → el-input-number-2066fbb7.js} +35 -36
  41. package/es/el-input-number-d6801a5c.cjs +1 -0
  42. package/es/{el-message-c3b3ac96.js → el-message-9859835d.js} +79 -81
  43. package/es/el-message-ffcf690c.cjs +1 -0
  44. package/es/el-overlay-91784be2.cjs +1 -0
  45. package/es/el-overlay-f0757cc4.js +525 -0
  46. package/es/el-popover-4db657e2.cjs +1 -0
  47. package/es/{el-popover-0aa071f2.js → el-popover-b7b43c1f.js} +18 -18
  48. package/es/el-scrollbar-35bac6b3.js +2452 -0
  49. package/es/el-scrollbar-ec09bbd3.cjs +1 -0
  50. package/es/el-select-0785c35a.cjs +1 -0
  51. package/es/{el-select-9381b156.js → el-select-bcbb7e55.js} +329 -333
  52. package/es/el-table-column-2478adf8.cjs +14 -0
  53. package/es/{el-table-column-55bffba5.js → el-table-column-c1e1a206.js} +346 -350
  54. package/es/el-tag-13ee17b3.cjs +1 -0
  55. package/es/el-tag-73372c6c.js +359 -0
  56. package/es/index-07b61d12.cjs +1 -0
  57. package/es/{index-39ec9741.js → index-45de4a12.js} +7 -7
  58. package/es/index-65b719a4.cjs +1 -0
  59. package/es/index-8b5fbc11.js +66 -0
  60. package/es/index-8c85d7c5.js +858 -0
  61. package/es/index-a49f4743.cjs +2 -0
  62. package/es/{scroll-387fcfdb.js → scroll-cb696ed2.js} +1 -1
  63. package/es/{scroll-41224831.cjs → scroll-cca17da0.cjs} +1 -1
  64. package/es/style.css +1 -1
  65. package/es/{zh-cn-ab9a583d.cjs → zh-cn-37af467d.cjs} +1 -1
  66. package/es/{zh-cn-eb9c2820.js → zh-cn-ef7d7220.js} +2 -2
  67. package/lib/bundle.js +1 -1
  68. package/lib/bundle.umd.cjs +206 -206
  69. package/lib/{index-9b8ff62a.js → index-24f8572c.js} +31450 -33319
  70. package/lib/{python-a9c3d9e5.js → python-2143eee4.js} +1 -1
  71. package/lib/style.css +1 -1
  72. package/package.json +1 -1
  73. package/packages/KlineBasic/components/KlineSub/index.vue +17 -3
  74. package/packages/KlineBasic/index.vue +2 -1
  75. package/packages/KlineBasic/utils.js +20 -2
  76. package/packages/index.ts +0 -2
  77. package/src/pages/KlineBasic/api.js +1 -1
  78. package/src/router/routes.ts +0 -5
  79. package/es/Kline.cjs +0 -1
  80. package/es/Kline.js +0 -1901
  81. package/es/_initCloneObject-441db749.cjs +0 -1
  82. package/es/castArray-4251bbe4.js +0 -10
  83. package/es/castArray-a45823fe.cjs +0 -1
  84. package/es/config-provider-55482a43.js +0 -47
  85. package/es/config-provider-7cdfca4d.cjs +0 -1
  86. package/es/debounce-ac30be50.js +0 -83
  87. package/es/debounce-b2ff12bd.cjs +0 -1
  88. package/es/dropdown-d7c59a21.cjs +0 -1
  89. package/es/el-button-196807af.cjs +0 -1
  90. package/es/el-button-e1665717.js +0 -235
  91. package/es/el-checkbox-group-492b95cc.cjs +0 -1
  92. package/es/el-form-item-5bdffd07.cjs +0 -12
  93. package/es/el-input-23e2bac3.cjs +0 -1
  94. package/es/el-input-number-40a81eb5.cjs +0 -1
  95. package/es/el-menu-item-78b858f2.cjs +0 -1
  96. package/es/el-menu-item-7d04c11a.js +0 -771
  97. package/es/el-message-d4df8136.cjs +0 -1
  98. package/es/el-overlay-12dd9b35.js +0 -519
  99. package/es/el-overlay-bc0790a2.cjs +0 -1
  100. package/es/el-popover-8a77e015.cjs +0 -1
  101. package/es/el-popper-50100766.js +0 -2262
  102. package/es/el-popper-746070ba.cjs +0 -1
  103. package/es/el-scrollbar-562d0595.js +0 -201
  104. package/es/el-scrollbar-d1c3e7f7.cjs +0 -1
  105. package/es/el-select-b162dffc.cjs +0 -1
  106. package/es/el-table-column-6d761fce.cjs +0 -14
  107. package/es/el-tag-985d9aff.js +0 -279
  108. package/es/el-tag-c51a6490.cjs +0 -1
  109. package/es/index-09e01b1d.js +0 -81
  110. package/es/index-0cb48e01.js +0 -306
  111. package/es/index-3bf8d597.cjs +0 -1
  112. package/es/index-657047bb.js +0 -513
  113. package/es/index-8a0b1c53.cjs +0 -3
  114. package/es/index-a387515d.cjs +0 -1
  115. package/es/index-a902a0d9.js +0 -59
  116. package/es/index-deb8de52.cjs +0 -1
  117. package/es/index-eea0bcb3.cjs +0 -1
  118. package/es/index.esm-8d9a2abe.js +0 -2432
  119. package/es/index.esm-94a95a2a.cjs +0 -3
  120. package/es/raf-8fc301fd.cjs +0 -1
  121. package/es/raf-b128c7b7.js +0 -6
  122. package/es/typescript-7ae59c4c.js +0 -4
  123. package/es/typescript-b63f8e83.cjs +0 -1
  124. package/es/use-form-common-props-1b84d8f4.cjs +0 -2
  125. package/es/use-form-common-props-f377e500.js +0 -587
  126. package/es/vnode-7dfd4ed5.js +0 -14
  127. package/es/vnode-7fbc61e1.cjs +0 -1
  128. package/packages/Kline/components/Contextmenu/index.vue +0 -110
  129. package/packages/Kline/components/Tips/index.vue +0 -40
  130. package/packages/Kline/componentsNew/KlineSlide/index.vue +0 -155
  131. package/packages/Kline/componentsNew/KlineSub/index.vue +0 -297
  132. package/packages/Kline/componentsNew/KlineTips/index.vue +0 -66
  133. package/packages/Kline/componentsNew/KlineUtils/index.vue +0 -84
  134. package/packages/Kline/componentsNew/Tips/index.vue +0 -33
  135. package/packages/Kline/formatKlineData.ts +0 -109
  136. package/packages/Kline/images/buy.svg +0 -1
  137. package/packages/Kline/images/pen.png +0 -0
  138. package/packages/Kline/images/sell.svg +0 -1
  139. package/packages/Kline/images/t.svg +0 -1
  140. package/packages/Kline/index.ts +0 -16
  141. package/packages/Kline/index.vue +0 -891
  142. package/packages/Kline/option.ts +0 -539
  143. package/packages/Kline/type.d.ts +0 -219
  144. package/packages/Kline/utils.ts +0 -682
  145. package/src/pages/Kline/api.ts +0 -127
  146. package/src/pages/Kline/components/MultiCycleSingleVariety.vue +0 -701
  147. package/src/pages/Kline/components/SingleCycleSingleVariety.vue +0 -924
  148. package/src/pages/Kline/index.vue +0 -90
@@ -1,771 +0,0 @@
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-562d0595.js";
3
- import { g as Ue, h as Ze, E as ke, j as F, m as Je } from "./use-form-common-props-f377e500.js";
4
- import { E as T, t as K } from "./index-0cb48e01.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-437d17f3.js";
6
- import { E as _e } from "./el-popper-50100766.js";
7
- import { T as Xe } from "./index-657047bb.js";
8
- import { C as Ye } from "./el-tag-985d9aff.js";
9
- import { m as et } from "./typescript-7ae59c4c.js";
10
- import { f as tt } from "./vnode-7dfd4ed5.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
- };