st-comp 0.0.178 → 0.0.180

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 (185) hide show
  1. package/es/ChartLayout.cjs +1 -1
  2. package/es/ChartLayout.js +3 -3
  3. package/es/FactorWarning.cjs +1 -1
  4. package/es/FactorWarning.js +29 -33
  5. package/es/Kline.cjs +1 -1
  6. package/es/Kline.js +14 -18
  7. package/es/KlineBasic.cjs +1 -1
  8. package/es/KlineBasic.js +25 -30
  9. package/es/KlineConfig.cjs +1 -1
  10. package/es/KlineConfig.js +457 -419
  11. package/es/KlineNew.cjs +1 -1
  12. package/es/KlineNew.js +13 -16
  13. package/es/KlinePlus.cjs +3 -3
  14. package/es/KlinePlus.js +140 -142
  15. package/es/Pagination.cjs +1 -1
  16. package/es/Pagination.js +274 -276
  17. package/es/PasswordPrompt.cjs +1 -1
  18. package/es/PasswordPrompt.js +3 -3
  19. package/es/Table.cjs +1 -1
  20. package/es/Table.js +21 -23
  21. package/es/User.cjs +1 -1
  22. package/es/User.js +472 -482
  23. package/es/VarSelectDialog.cjs +3 -3
  24. package/es/VarSelectDialog.js +440 -2878
  25. package/es/VarietySearch.cjs +12 -12
  26. package/es/VarietySearch.js +1199 -1176
  27. package/es/VirtualTable.cjs +1 -13
  28. package/es/VirtualTable.js +1547 -1567
  29. package/es/{_initCloneObject-da90eef0.js → _initCloneObject-346b7ee2.js} +25 -26
  30. package/es/_initCloneObject-e2f0deb9.cjs +1 -0
  31. package/es/base-62a70f61.js +288 -0
  32. package/es/base-ef747d02.cjs +5 -0
  33. package/es/config-provider-178bb43c.cjs +1 -0
  34. package/es/config-provider-2e733cae.js +58 -0
  35. package/es/dayjs.min-2c20abe6.cjs +1 -0
  36. package/es/{dayjs.min-54a4e095.js → dayjs.min-8313b006.js} +96 -93
  37. package/es/{debounce-9e323221.cjs → debounce-0b77a317.cjs} +1 -1
  38. package/es/{debounce-3cec4646.js → debounce-5f2ec4be.js} +19 -19
  39. package/es/{dropdown-82b80e8b.js → dropdown-d06edf54.js} +49 -39
  40. package/es/dropdown-f2fec683.cjs +1 -0
  41. package/es/el-button-5b08c08a.js +272 -0
  42. package/es/el-button-fc46a173.cjs +1 -0
  43. package/es/el-dialog-0b7166c9.cjs +1 -0
  44. package/es/el-dialog-d8d0da7a.js +276 -0
  45. package/es/{el-divider-fd2b4e2e.js → el-divider-2f300113.js} +1 -1
  46. package/es/{el-divider-40c50ce7.cjs → el-divider-4713d74c.cjs} +1 -1
  47. package/es/{el-empty-412fc297.js → el-empty-87a86f30.js} +57 -80
  48. package/es/el-empty-bb2b0235.cjs +1 -0
  49. package/es/el-form-item-caffd133.cjs +12 -0
  50. package/es/el-form-item-ff9c7d98.js +1267 -0
  51. package/es/el-input-6db30c8c.js +531 -0
  52. package/es/el-input-9c912678.cjs +1 -0
  53. package/es/el-input-number-05f150e5.js +311 -0
  54. package/es/el-input-number-6fe73563.cjs +1 -0
  55. package/es/el-loading-8514feaa.cjs +1 -0
  56. package/es/el-loading-93842445.js +203 -0
  57. package/es/el-menu-item-7a57c1be.cjs +1 -0
  58. package/es/el-menu-item-a886fbdd.js +768 -0
  59. package/es/el-message-8aa674f2.js +406 -0
  60. package/es/el-message-aad5b42b.cjs +1 -0
  61. package/es/el-message-box-2b6b2b68.js +550 -0
  62. package/es/el-message-box-53f355d7.cjs +1 -0
  63. package/es/el-overlay-540b2a02.js +324 -0
  64. package/es/el-overlay-96630a2e.cjs +1 -0
  65. package/es/el-popconfirm-2afdf6fb.cjs +1 -0
  66. package/es/el-popconfirm-c18d8035.js +162 -0
  67. package/es/el-popper-544fd77e.js +2412 -0
  68. package/es/el-popper-73466d7a.cjs +1 -0
  69. package/es/el-scrollbar-691cfc11.cjs +1 -0
  70. package/es/el-scrollbar-fae984e3.js +763 -0
  71. package/es/el-segmented-a7493831.js +142 -0
  72. package/es/el-segmented-b6bd3c0e.cjs +1 -0
  73. package/es/el-select-5959e837.cjs +1 -0
  74. package/es/el-select-ea8feecf.js +1251 -0
  75. package/es/el-table-column-9ef52443.js +3878 -0
  76. package/es/el-table-column-b824ac5c.cjs +14 -0
  77. package/es/el-tag-2fc9b9eb.js +116 -0
  78. package/es/el-tag-ecad6d02.cjs +1 -0
  79. package/es/index-2e331d74.js +10 -0
  80. package/es/{index-a8e9ec0f.js → index-34592e82.js} +176 -182
  81. package/es/index-3a74eae4.cjs +1 -0
  82. package/es/{index-1c41bd56.js → index-5d4e5c51.js} +3 -3
  83. package/es/{index-e348d5e8.cjs → index-694bb944.cjs} +1 -1
  84. package/es/{index-ee1cebbc.js → index-74fb90c7.js} +5 -5
  85. package/es/{index-d577b81b.js → index-8d7ae5dc.js} +2 -2
  86. package/es/index-a9095b4a.js +163 -0
  87. package/es/index-a93dd9c4.cjs +1 -0
  88. package/es/index-ebd2fd7e.cjs +1 -0
  89. package/es/index-f1c702f6.cjs +1 -0
  90. package/es/{index-19fa1fcf.cjs → index-f6afafaa.cjs} +1 -1
  91. package/es/{raf-bfbf42e4.js → raf-41aed4d4.js} +1 -1
  92. package/es/{raf-07cb6953.cjs → raf-8249652f.cjs} +1 -1
  93. package/es/{scroll-e3cb691f.js → scroll-7d352c1f.js} +2 -2
  94. package/es/{scroll-4769a65d.cjs → scroll-b108dabd.cjs} +1 -1
  95. package/es/style.css +1 -1
  96. package/es/use-global-config-03735617.cjs +1 -0
  97. package/es/use-global-config-4b185eb5.js +71 -0
  98. package/es/validator-0e688e4e.cjs +1 -0
  99. package/es/validator-d12a8f8c.js +5 -0
  100. package/es/vnode-4db20540.cjs +1 -0
  101. package/es/vnode-a0795a4b.js +70 -0
  102. package/es/{zh-cn-d883afa8.js → zh-cn-0ff32188.js} +5 -4
  103. package/es/{zh-cn-b24a7dc9.cjs → zh-cn-adf19c4b.cjs} +1 -1
  104. package/lib/bundle.js +1 -1
  105. package/lib/bundle.umd.cjs +226 -245
  106. package/lib/{index-0f16f8b0.js → index-9341884f.js} +44358 -46367
  107. package/lib/{python-e9c32bc9.js → python-5c9b3e4e.js} +1 -1
  108. package/lib/style.css +1 -1
  109. package/package.json +2 -2
  110. package/packages/KlinePlus/index.vue +2 -1
  111. package/packages/VarSelectDialog/index.vue +43 -67
  112. package/packages/VarietySearch/components/FactorScreen/FactorDescription.vue +4 -2
  113. package/packages/VarietySearch/components/FactorScreen/index.vue +6 -4
  114. package/packages/index.ts +0 -2
  115. package/src/pages/VarSelectDialog/index.vue +1 -1
  116. package/src/router/routes.ts +0 -5
  117. package/es/Dialog.cjs +0 -1
  118. package/es/Dialog.js +0 -95
  119. package/es/_commonjsHelpers-10dfc225.js +0 -8
  120. package/es/_commonjsHelpers-87b0abe8.cjs +0 -1
  121. package/es/_initCloneObject-9ccbb113.cjs +0 -1
  122. package/es/base-bdc10baa.cjs +0 -5
  123. package/es/base-d9284bf0.js +0 -304
  124. package/es/castArray-37eb9980.cjs +0 -1
  125. package/es/castArray-b0ab0165.js +0 -10
  126. package/es/config-provider-ec6b09df.cjs +0 -1
  127. package/es/config-provider-f0151e9f.js +0 -47
  128. package/es/dayjs.min-19fb125f.cjs +0 -1
  129. package/es/dropdown-b2dab5bb.cjs +0 -1
  130. package/es/el-button-34665425.js +0 -237
  131. package/es/el-button-960edd49.cjs +0 -1
  132. package/es/el-dialog-a412484e.js +0 -267
  133. package/es/el-dialog-cd484c1f.cjs +0 -1
  134. package/es/el-empty-627ec09e.cjs +0 -1
  135. package/es/el-form-item-668ba024.js +0 -1263
  136. package/es/el-form-item-e1c3104b.cjs +0 -12
  137. package/es/el-input-22e66e37.js +0 -523
  138. package/es/el-input-5163bda3.cjs +0 -1
  139. package/es/el-input-number-481e21c5.js +0 -284
  140. package/es/el-input-number-eb54cde4.cjs +0 -1
  141. package/es/el-loading-15a5501c.cjs +0 -1
  142. package/es/el-loading-d4e403ab.js +0 -187
  143. package/es/el-menu-item-404c10e5.js +0 -772
  144. package/es/el-menu-item-ac89e804.cjs +0 -1
  145. package/es/el-message-ad87b9dd.cjs +0 -1
  146. package/es/el-message-box-41f39f6d.js +0 -558
  147. package/es/el-message-box-6694f827.cjs +0 -1
  148. package/es/el-message-ef506caa.js +0 -375
  149. package/es/el-overlay-4a9fa4e1.js +0 -269
  150. package/es/el-overlay-e5d318c3.cjs +0 -1
  151. package/es/el-popconfirm-7b9183aa.js +0 -140
  152. package/es/el-popconfirm-a497b279.cjs +0 -1
  153. package/es/el-popper-14a9d493.cjs +0 -1
  154. package/es/el-popper-e73466eb.js +0 -2263
  155. package/es/el-scrollbar-45318df0.js +0 -201
  156. package/es/el-scrollbar-8bf765f2.cjs +0 -1
  157. package/es/el-segmented-3ba6d664.cjs +0 -1
  158. package/es/el-segmented-41820018.js +0 -135
  159. package/es/el-select-1d2309a1.cjs +0 -1
  160. package/es/el-select-d7a00294.js +0 -1130
  161. package/es/el-table-column-a2d0c635.js +0 -3805
  162. package/es/el-table-column-be9a76bb.cjs +0 -14
  163. package/es/el-tag-7f391090.js +0 -280
  164. package/es/el-tag-8d49d4d2.cjs +0 -1
  165. package/es/index-02ca0096.cjs +0 -5
  166. package/es/index-3120be08.js +0 -14
  167. package/es/index-5b81f4da.cjs +0 -1
  168. package/es/index-85a32a00.js +0 -59
  169. package/es/index-8d3c5e96.cjs +0 -3
  170. package/es/index-94f38460.js +0 -306
  171. package/es/index-a99a5307.cjs +0 -1
  172. package/es/index-b90c746b.cjs +0 -1
  173. package/es/index-d94bae37.cjs +0 -1
  174. package/es/index-d99fdc6d.js +0 -159
  175. package/es/use-form-common-props-592797e2.cjs +0 -2
  176. package/es/use-form-common-props-cc347a83.js +0 -171
  177. package/es/use-global-config-584b62f1.cjs +0 -1
  178. package/es/use-global-config-c7f0a7e3.js +0 -73
  179. package/es/validator-10fa54fe.js +0 -5
  180. package/es/validator-af488a9a.cjs +0 -1
  181. package/es/vnode-1b827c99.cjs +0 -1
  182. package/es/vnode-6be33bb1.js +0 -14
  183. package/packages/Dialog/index.ts +0 -8
  184. package/packages/Dialog/index.vue +0 -54
  185. package/src/pages/Dialog/index.vue +0 -16
@@ -1,772 +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 Fe, createElementBlock as Y, normalizeClass as ee, createElementVNode as pe, createTextVNode as qe, toDisplayString as Ve } from "vue";
2
- import { u as Ge } from "./el-scrollbar-45318df0.js";
3
- import { a as Ue, b as Ze, E as ke, m as Je } from "./index-ee1cebbc.js";
4
- import { E as T, t as K } from "./index-94f38460.js";
5
- import { u as w, _ as oe, w as $e, a as Z, r as ie, h as Ke, b as Me, t as te, i as R, c as Ce, d as ne, e as Qe, f as xe, g as Oe, j as ye } from "./base-d9284bf0.js";
6
- import { E as _e } from "./el-popper-e73466eb.js";
7
- import { T as Xe } from "./index-657047bb.js";
8
- import { i as q } from "./use-form-common-props-cc347a83.js";
9
- import { C as Ye } from "./el-tag-7f391090.js";
10
- import { m as et } from "./typescript-7ae59c4c.js";
11
- import { f as tt } from "./vnode-6be33bb1.js";
12
- const nt = z({
13
- name: "ElCollapseTransition"
14
- }), ot = /* @__PURE__ */ z({
15
- ...nt,
16
- setup(e) {
17
- const o = w("collapse-transition"), n = (t) => {
18
- t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow, t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom;
19
- }, r = {
20
- beforeEnter(t) {
21
- 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;
22
- },
23
- enter(t) {
24
- requestAnimationFrame(() => {
25
- 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";
26
- });
27
- },
28
- afterEnter(t) {
29
- t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow;
30
- },
31
- enterCancelled(t) {
32
- n(t);
33
- },
34
- beforeLeave(t) {
35
- 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";
36
- },
37
- leave(t) {
38
- t.scrollHeight !== 0 && (t.style.maxHeight = 0, t.style.paddingTop = 0, t.style.paddingBottom = 0);
39
- },
40
- afterLeave(t) {
41
- n(t);
42
- },
43
- leaveCancelled(t) {
44
- n(t);
45
- }
46
- };
47
- return (t, I) => (B(), ve(Ee, Te({
48
- name: He(o).b()
49
- }, Le(r)), {
50
- default: Q(() => [
51
- $(t.$slots, "default")
52
- ]),
53
- _: 3
54
- }, 16, ["name"]));
55
- }
56
- });
57
- var at = /* @__PURE__ */ oe(ot, [["__file", "collapse-transition.vue"]]);
58
- const st = $e(at);
59
- let lt = class {
60
- constructor(o, n) {
61
- this.parent = o, this.domNode = n, this.subIndex = 0, this.subIndex = 0, this.init();
62
- }
63
- init() {
64
- this.subMenuItems = this.domNode.querySelectorAll("li"), this.addListeners();
65
- }
66
- gotoSubIndex(o) {
67
- o === this.subMenuItems.length ? o = 0 : o < 0 && (o = this.subMenuItems.length - 1), this.subMenuItems[o].focus(), this.subIndex = o;
68
- }
69
- addListeners() {
70
- const o = this.parent.domNode;
71
- Array.prototype.forEach.call(this.subMenuItems, (n) => {
72
- n.addEventListener("keydown", (r) => {
73
- let t = !1;
74
- switch (r.code) {
75
- case T.down: {
76
- this.gotoSubIndex(this.subIndex + 1), t = !0;
77
- break;
78
- }
79
- case T.up: {
80
- this.gotoSubIndex(this.subIndex - 1), t = !0;
81
- break;
82
- }
83
- case T.tab: {
84
- K(o, "mouseleave");
85
- break;
86
- }
87
- case T.enter:
88
- case T.numpadEnter:
89
- case T.space: {
90
- t = !0, r.currentTarget.click();
91
- break;
92
- }
93
- }
94
- return t && (r.preventDefault(), r.stopPropagation()), !1;
95
- });
96
- });
97
- }
98
- }, ut = class {
99
- constructor(o, n) {
100
- this.domNode = o, this.submenu = null, this.submenu = null, this.init(n);
101
- }
102
- init(o) {
103
- this.domNode.setAttribute("tabindex", "0");
104
- const n = this.domNode.querySelector(`.${o}-menu`);
105
- n && (this.submenu = new lt(this, n)), this.addListeners();
106
- }
107
- addListeners() {
108
- this.domNode.addEventListener("keydown", (o) => {
109
- let n = !1;
110
- switch (o.code) {
111
- case T.down: {
112
- K(o.currentTarget, "mouseenter"), this.submenu && this.submenu.gotoSubIndex(0), n = !0;
113
- break;
114
- }
115
- case T.up: {
116
- K(o.currentTarget, "mouseenter"), this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1), n = !0;
117
- break;
118
- }
119
- case T.tab: {
120
- K(o.currentTarget, "mouseleave");
121
- break;
122
- }
123
- case T.enter:
124
- case T.numpadEnter:
125
- case T.space: {
126
- n = !0, o.currentTarget.click();
127
- break;
128
- }
129
- }
130
- n && o.preventDefault();
131
- });
132
- }
133
- }, it = class {
134
- constructor(o, n) {
135
- this.domNode = o, this.init(n);
136
- }
137
- init(o) {
138
- const n = this.domNode.childNodes;
139
- Array.from(n).forEach((r) => {
140
- r.nodeType === 1 && new ut(r, o);
141
- });
142
- }
143
- };
144
- const rt = z({
145
- name: "ElMenuCollapseTransition",
146
- setup() {
147
- const e = w("menu");
148
- return {
149
- listeners: {
150
- onBeforeEnter: (n) => n.style.opacity = "0.2",
151
- onEnter(n, r) {
152
- Z(n, `${e.namespace.value}-opacity-transition`), n.style.opacity = "1", r();
153
- },
154
- onAfterEnter(n) {
155
- ie(n, `${e.namespace.value}-opacity-transition`), n.style.opacity = "";
156
- },
157
- onBeforeLeave(n) {
158
- 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";
159
- },
160
- onLeave(n) {
161
- Z(n, "horizontal-collapse-transition"), n.style.width = `${n.dataset.scrollWidth}px`;
162
- }
163
- }
164
- };
165
- }
166
- });
167
- function ct(e, o, n, r, t, I) {
168
- return B(), ve(Ee, Te({ mode: "out-in" }, e.listeners), {
169
- default: Q(() => [
170
- $(e.$slots, "default")
171
- ]),
172
- _: 3
173
- }, 16);
174
- }
175
- var dt = /* @__PURE__ */ oe(rt, [["render", ct], ["__file", "menu-collapse-transition.vue"]]);
176
- function Pe(e, o) {
177
- const n = h(() => {
178
- let t = e.parent;
179
- const I = [o.value];
180
- for (; t.type.name !== "ElMenu"; )
181
- t.props.index && I.unshift(t.props.index), t = t.parent;
182
- return I;
183
- });
184
- return {
185
- parentMenu: h(() => {
186
- let t = e.parent;
187
- for (; t && !["ElMenu", "ElSubMenu"].includes(t.type.name); )
188
- t = t.parent;
189
- return t;
190
- }),
191
- indexPath: n
192
- };
193
- }
194
- function mt(e) {
195
- return h(() => {
196
- const n = e.backgroundColor;
197
- return n ? new Xe(n).shade(20).toString() : "";
198
- });
199
- }
200
- const Ne = (e, o) => {
201
- const n = w("menu");
202
- return h(() => n.cssVarBlock({
203
- "text-color": e.textColor || "",
204
- "hover-text-color": e.textColor || "",
205
- "bg-color": e.backgroundColor || "",
206
- "hover-bg-color": mt(e).value || "",
207
- "active-color": e.activeTextColor || "",
208
- level: `${o}`
209
- }));
210
- }, pt = Me({
211
- index: {
212
- type: String,
213
- required: !0
214
- },
215
- showTimeout: Number,
216
- hideTimeout: Number,
217
- popperClass: String,
218
- disabled: Boolean,
219
- teleported: {
220
- type: Boolean,
221
- default: void 0
222
- },
223
- popperOffset: Number,
224
- expandCloseIcon: {
225
- type: q
226
- },
227
- expandOpenIcon: {
228
- type: q
229
- },
230
- collapseCloseIcon: {
231
- type: q
232
- },
233
- collapseOpenIcon: {
234
- type: q
235
- }
236
- }), re = "ElSubMenu";
237
- var Ie = z({
238
- name: re,
239
- props: pt,
240
- setup(e, { slots: o, expose: n }) {
241
- const r = fe(), { indexPath: t, parentMenu: I } = Pe(r, h(() => e.index)), m = w("menu"), y = w("sub-menu"), u = X("rootMenu");
242
- u || te(re, "can not inject root menu");
243
- const d = X(`subMenu:${I.value.uid}`);
244
- d || te(re, "can not inject sub menu");
245
- const p = E({}), g = E({});
246
- let C;
247
- const k = E(!1), ae = 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(() => {
248
- const l = e.teleported;
249
- return l === void 0 ? _.value : l;
250
- }), se = h(() => u.props.collapse ? `${m.namespace.value}-zoom-in-left` : `${m.namespace.value}-zoom-in-top`), le = h(() => P.value === "horizontal" && _.value ? [
251
- "bottom-start",
252
- "bottom-end",
253
- "top-start",
254
- "top-end",
255
- "right-start",
256
- "left-start"
257
- ] : [
258
- "right-start",
259
- "right",
260
- "right-end",
261
- "left-start",
262
- "bottom-start",
263
- "bottom-end",
264
- "top-start",
265
- "top-end"
266
- ]), S = h(() => u.openedMenus.includes(e.index)), H = h(() => {
267
- let l = !1;
268
- return Object.values(p.value).forEach((c) => {
269
- c.active && (l = !0);
270
- }), Object.values(g.value).forEach((c) => {
271
- c.active && (l = !0);
272
- }), l;
273
- }), P = h(() => u.props.mode), L = he({
274
- index: e.index,
275
- indexPath: t,
276
- active: H
277
- }), D = Ne(u.props, d.level + 1), G = h(() => {
278
- var l;
279
- return (l = e.popperOffset) != null ? l : u.props.popperOffset;
280
- }), W = h(() => {
281
- var l;
282
- return (l = e.popperClass) != null ? l : u.props.popperClass;
283
- }), U = h(() => {
284
- var l;
285
- return (l = e.showTimeout) != null ? l : u.props.showTimeout;
286
- }), ue = h(() => {
287
- var l;
288
- return (l = e.hideTimeout) != null ? l : u.props.hideTimeout;
289
- }), a = () => {
290
- var l, c, M;
291
- return (M = (c = (l = V.value) == null ? void 0 : l.popperRef) == null ? void 0 : c.popperInstanceRef) == null ? void 0 : M.destroy();
292
- }, s = (l) => {
293
- l || a();
294
- }, i = () => {
295
- u.props.menuTrigger === "hover" && u.props.mode === "horizontal" || u.props.collapse && u.props.mode === "vertical" || e.disabled || u.handleSubMenuClick({
296
- index: e.index,
297
- indexPath: t.value,
298
- active: H.value
299
- });
300
- }, v = (l, c = U.value) => {
301
- var M;
302
- if (l.type !== "focus") {
303
- if (u.props.menuTrigger === "click" && u.props.mode === "horizontal" || !u.props.collapse && u.props.mode === "vertical" || e.disabled) {
304
- d.mouseInChild.value = !0;
305
- return;
306
- }
307
- d.mouseInChild.value = !0, C == null || C(), { stop: C } = Ce(() => {
308
- u.openMenu(e.index, t.value);
309
- }, c), j.value && ((M = I.value.vnode.el) == null || M.dispatchEvent(new MouseEvent("mouseenter")));
310
- }
311
- }, f = (l = !1) => {
312
- var c;
313
- if (u.props.menuTrigger === "click" && u.props.mode === "horizontal" || !u.props.collapse && u.props.mode === "vertical") {
314
- d.mouseInChild.value = !1;
315
- return;
316
- }
317
- 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));
318
- };
319
- J(() => u.props.collapse, (l) => s(!!l));
320
- {
321
- const l = (M) => {
322
- g.value[M.index] = M;
323
- }, c = (M) => {
324
- delete g.value[M.index];
325
- };
326
- me(`subMenu:${r.uid}`, {
327
- addSubMenu: l,
328
- removeSubMenu: c,
329
- handleMouseleave: f,
330
- mouseInChild: k,
331
- level: d.level + 1
332
- });
333
- }
334
- return n({
335
- opened: S
336
- }), be(() => {
337
- u.addSubMenu(L), d.addSubMenu(L);
338
- }), Se(() => {
339
- d.removeSubMenu(L), u.removeSubMenu(L);
340
- }), () => {
341
- var l;
342
- const c = [
343
- (l = o.title) == null ? void 0 : l.call(o),
344
- b(ke, {
345
- class: y.e("icon-arrow"),
346
- style: {
347
- transform: S.value ? e.expandCloseIcon && e.expandOpenIcon || e.collapseCloseIcon && e.collapseOpenIcon && u.props.collapse ? "none" : "rotateZ(180deg)" : "none"
348
- }
349
- }, {
350
- default: () => R(A.value) ? b(r.appContext.components[A.value]) : b(A.value)
351
- })
352
- ], M = u.isMenuPopup ? b(_e, {
353
- ref: V,
354
- visible: S.value,
355
- effect: "light",
356
- pure: !0,
357
- offset: G.value,
358
- showArrow: !1,
359
- persistent: !0,
360
- popperClass: W.value,
361
- placement: O.value,
362
- teleported: j.value,
363
- fallbackPlacements: le.value,
364
- transition: se.value,
365
- gpuAcceleration: !1
366
- }, {
367
- content: () => {
368
- var x;
369
- return b("div", {
370
- class: [
371
- m.m(P.value),
372
- m.m("popup-container"),
373
- W.value
374
- ],
375
- onMouseenter: (N) => v(N, 100),
376
- onMouseleave: () => f(!0),
377
- onFocus: (N) => v(N, 100)
378
- }, [
379
- b("ul", {
380
- class: [
381
- m.b(),
382
- m.m("popup"),
383
- m.m(`popup-${O.value}`)
384
- ],
385
- style: D.value
386
- }, [(x = o.default) == null ? void 0 : x.call(o)])
387
- ]);
388
- },
389
- default: () => b("div", {
390
- class: y.e("title"),
391
- onClick: i
392
- }, c)
393
- }) : b(ge, {}, [
394
- b("div", {
395
- class: y.e("title"),
396
- ref: ae,
397
- onClick: i
398
- }, c),
399
- b(st, {}, {
400
- default: () => {
401
- var x;
402
- return we(b("ul", {
403
- role: "menu",
404
- class: [m.b(), m.m("inline")],
405
- style: D.value
406
- }, [(x = o.default) == null ? void 0 : x.call(o)]), [[We, S.value]]);
407
- }
408
- })
409
- ]);
410
- return b("li", {
411
- class: [
412
- y.b(),
413
- y.is("active", H.value),
414
- y.is("opened", S.value),
415
- y.is("disabled", e.disabled)
416
- ],
417
- role: "menuitem",
418
- ariaHaspopup: !0,
419
- ariaExpanded: S.value,
420
- onMouseenter: v,
421
- onMouseleave: () => f(),
422
- onFocus: v
423
- }, [M]);
424
- };
425
- }
426
- });
427
- const vt = Me({
428
- mode: {
429
- type: String,
430
- values: ["horizontal", "vertical"],
431
- default: "vertical"
432
- },
433
- defaultActive: {
434
- type: String,
435
- default: ""
436
- },
437
- defaultOpeneds: {
438
- type: ne(Array),
439
- default: () => et([])
440
- },
441
- uniqueOpened: Boolean,
442
- router: Boolean,
443
- menuTrigger: {
444
- type: String,
445
- values: ["hover", "click"],
446
- default: "hover"
447
- },
448
- collapse: Boolean,
449
- backgroundColor: String,
450
- textColor: String,
451
- activeTextColor: String,
452
- closeOnClickOutside: Boolean,
453
- collapseTransition: {
454
- type: Boolean,
455
- default: !0
456
- },
457
- ellipsis: {
458
- type: Boolean,
459
- default: !0
460
- },
461
- popperOffset: {
462
- type: Number,
463
- default: 6
464
- },
465
- ellipsisIcon: {
466
- type: q,
467
- default: () => Je
468
- },
469
- popperEffect: {
470
- type: ne(String),
471
- default: "dark"
472
- },
473
- popperClass: String,
474
- showTimeout: {
475
- type: Number,
476
- default: 300
477
- },
478
- hideTimeout: {
479
- type: Number,
480
- default: 300
481
- }
482
- }), ce = (e) => Oe(e) && e.every((o) => R(o)), ft = {
483
- close: (e, o) => R(e) && ce(o),
484
- open: (e, o) => R(e) && ce(o),
485
- select: (e, o, n, r) => R(e) && ce(o) && Qe(n) && (r === void 0 || r instanceof Promise)
486
- };
487
- var ht = z({
488
- name: "ElMenu",
489
- props: vt,
490
- emits: ft,
491
- setup(e, { emit: o, slots: n, expose: r }) {
492
- 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({}), ae = h(() => e.mode === "horizontal" || e.mode === "vertical" && e.collapse), V = () => {
493
- const a = g.value && C.value[g.value];
494
- if (!a || e.mode === "horizontal" || e.collapse)
495
- return;
496
- a.indexPath.forEach((i) => {
497
- const v = k.value[i];
498
- v && O(i, v.indexPath);
499
- });
500
- }, O = (a, s) => {
501
- p.value.includes(a) || (e.uniqueOpened && (p.value = p.value.filter((i) => s.includes(i))), p.value.push(a), o("open", a, s));
502
- }, A = (a) => {
503
- const s = p.value.indexOf(a);
504
- s !== -1 && p.value.splice(s, 1);
505
- }, _ = (a, s) => {
506
- A(a), o("close", a, s);
507
- }, j = ({
508
- index: a,
509
- indexPath: s
510
- }) => {
511
- p.value.includes(a) ? _(a, s) : O(a, s);
512
- }, se = (a) => {
513
- (e.mode === "horizontal" || e.collapse) && (p.value = []);
514
- const { index: s, indexPath: i } = a;
515
- if (!(xe(s) || xe(i)))
516
- if (e.router && I) {
517
- const v = a.route || s, f = I.push(v).then((l) => (l || (g.value = s), l));
518
- o("select", s, i, { index: s, indexPath: i, route: v }, f);
519
- } else
520
- g.value = s, o("select", s, i, { index: s, indexPath: i });
521
- }, le = (a) => {
522
- const s = C.value, i = s[a] || g.value && s[g.value] || s[e.defaultActive];
523
- i ? g.value = i.index : g.value = a;
524
- }, S = (a) => {
525
- const s = getComputedStyle(a), i = Number.parseInt(s.marginLeft, 10), v = Number.parseInt(s.marginRight, 10);
526
- return a.offsetWidth + i + v || 0;
527
- }, H = () => {
528
- var a, s;
529
- if (!m.value)
530
- return -1;
531
- const i = Array.from((s = (a = m.value) == null ? void 0 : a.childNodes) != null ? s : []).filter((F) => F.nodeName !== "#text" || F.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;
532
- let x = 0, N = 0;
533
- return i.forEach((F, Ae) => {
534
- F.nodeName !== "#comment" && (x += S(F), x <= M - v && (N = Ae + 1));
535
- }), N === i.length ? -1 : N;
536
- }, P = (a) => k.value[a].indexPath, L = (a, s = 33.34) => {
537
- let i;
538
- return () => {
539
- i && clearTimeout(i), i = setTimeout(() => {
540
- a();
541
- }, s);
542
- };
543
- };
544
- let D = !0;
545
- const G = () => {
546
- if (d.value === H())
547
- return;
548
- const a = () => {
549
- d.value = -1, je(() => {
550
- d.value = H();
551
- });
552
- };
553
- D ? a() : L(a)(), D = !1;
554
- };
555
- J(() => e.defaultActive, (a) => {
556
- C.value[a] || (g.value = ""), le(a);
557
- }), J(() => e.collapse, (a) => {
558
- a && (p.value = []);
559
- }), J(C.value, V);
560
- let W;
561
- Re(() => {
562
- e.mode === "horizontal" && e.ellipsis ? W = Ge(m, G).stop : W == null || W();
563
- });
564
- const U = E(!1);
565
- {
566
- const a = (f) => {
567
- k.value[f.index] = f;
568
- }, s = (f) => {
569
- delete k.value[f.index];
570
- };
571
- me("rootMenu", he({
572
- props: e,
573
- openedMenus: p,
574
- items: C,
575
- subMenus: k,
576
- activeIndex: g,
577
- isMenuPopup: ae,
578
- addMenuItem: (f) => {
579
- C.value[f.index] = f;
580
- },
581
- removeMenuItem: (f) => {
582
- delete C.value[f.index];
583
- },
584
- addSubMenu: a,
585
- removeSubMenu: s,
586
- openMenu: O,
587
- closeMenu: _,
588
- handleMenuItemClick: se,
589
- handleSubMenuClick: j
590
- })), me(`subMenu:${t.uid}`, {
591
- addSubMenu: a,
592
- removeSubMenu: s,
593
- mouseInChild: U,
594
- level: 0
595
- });
596
- }
597
- be(() => {
598
- e.mode === "horizontal" && new it(t.vnode.el, y.namespace.value);
599
- }), r({
600
- open: (s) => {
601
- const { indexPath: i } = k.value[s];
602
- i.forEach((v) => O(v, i));
603
- },
604
- close: A,
605
- handleResize: G
606
- });
607
- const ue = Ne(e, 0);
608
- return () => {
609
- var a, s;
610
- let i = (s = (a = n.default) == null ? void 0 : a.call(n)) != null ? s : [];
611
- const v = [];
612
- if (e.mode === "horizontal" && m.value) {
613
- const c = tt(i), M = d.value === -1 ? c : c.slice(0, d.value), x = d.value === -1 ? [] : c.slice(d.value);
614
- x != null && x.length && e.ellipsis && (i = M, v.push(b(Ie, {
615
- index: "sub-menu-more",
616
- class: u.e("hide-arrow"),
617
- popperOffset: e.popperOffset
618
- }, {
619
- title: () => b(ke, {
620
- class: u.e("icon-more")
621
- }, {
622
- default: () => b(e.ellipsisIcon)
623
- }),
624
- default: () => x
625
- })));
626
- }
627
- const f = e.closeOnClickOutside ? [
628
- [
629
- Ye,
630
- () => {
631
- p.value.length && (U.value || (p.value.forEach((c) => o("close", c, P(c))), p.value = []));
632
- }
633
- ]
634
- ] : [], l = we(b("ul", {
635
- key: String(e.collapse),
636
- role: "menubar",
637
- ref: m,
638
- style: ue.value,
639
- class: {
640
- [y.b()]: !0,
641
- [y.m(e.mode)]: !0,
642
- [y.m("collapse")]: e.collapse
643
- }
644
- }, [...i, ...v]), f);
645
- return e.collapseTransition && e.mode === "vertical" ? b(dt, () => l) : l;
646
- };
647
- }
648
- });
649
- const bt = Me({
650
- index: {
651
- type: ne([String, null]),
652
- default: null
653
- },
654
- route: {
655
- type: ne([String, Object])
656
- },
657
- disabled: Boolean
658
- }), gt = {
659
- click: (e) => R(e.index) && Oe(e.indexPath)
660
- }, de = "ElMenuItem", Mt = z({
661
- name: de,
662
- components: {
663
- ElTooltip: _e
664
- },
665
- props: bt,
666
- emits: gt,
667
- setup(e, { emit: o }) {
668
- const n = fe(), r = X("rootMenu"), t = w("menu"), I = w("menu-item");
669
- r || te(de, "can not inject root menu");
670
- const { parentMenu: m, indexPath: y } = Pe(n, De(e, "index")), u = X(`subMenu:${m.value.uid}`);
671
- u || te(de, "can not inject sub menu");
672
- const d = h(() => e.index === r.activeIndex), p = he({
673
- index: e.index,
674
- indexPath: y,
675
- active: d
676
- }), g = () => {
677
- e.disabled || (r.handleMenuItemClick({
678
- index: e.index,
679
- indexPath: y.value,
680
- route: e.route
681
- }), o("click", p));
682
- };
683
- return be(() => {
684
- u.addSubMenu(p), r.addMenuItem(p);
685
- }), Se(() => {
686
- u.removeSubMenu(p), r.removeMenuItem(p);
687
- }), {
688
- parentMenu: m,
689
- rootMenu: r,
690
- active: d,
691
- nsMenu: t,
692
- nsMenuItem: I,
693
- handleClick: g
694
- };
695
- }
696
- });
697
- function yt(e, o, n, r, t, I) {
698
- const m = Fe("el-tooltip");
699
- return B(), Y("li", {
700
- class: ee([
701
- e.nsMenuItem.b(),
702
- e.nsMenuItem.is("active", e.active),
703
- e.nsMenuItem.is("disabled", e.disabled)
704
- ]),
705
- role: "menuitem",
706
- tabindex: "-1",
707
- onClick: e.handleClick
708
- }, [
709
- e.parentMenu.type.name === "ElMenu" && e.rootMenu.props.collapse && e.$slots.title ? (B(), ve(m, {
710
- key: 0,
711
- effect: e.rootMenu.props.popperEffect,
712
- placement: "right",
713
- "fallback-placements": ["left"],
714
- persistent: ""
715
- }, {
716
- content: Q(() => [
717
- $(e.$slots, "title")
718
- ]),
719
- default: Q(() => [
720
- pe("div", {
721
- class: ee(e.nsMenu.be("tooltip", "trigger"))
722
- }, [
723
- $(e.$slots, "default")
724
- ], 2)
725
- ]),
726
- _: 3
727
- }, 8, ["effect"])) : (B(), Y(ge, { key: 1 }, [
728
- $(e.$slots, "default"),
729
- $(e.$slots, "title")
730
- ], 64))
731
- ], 10, ["onClick"]);
732
- }
733
- var Be = /* @__PURE__ */ oe(Mt, [["render", yt], ["__file", "menu-item.vue"]]);
734
- const It = {
735
- title: String
736
- }, Ct = "ElMenuItemGroup", xt = z({
737
- name: Ct,
738
- props: It,
739
- setup() {
740
- return {
741
- ns: w("menu-item-group")
742
- };
743
- }
744
- });
745
- function Et(e, o, n, r, t, I) {
746
- return B(), Y("li", {
747
- class: ee(e.ns.b())
748
- }, [
749
- pe("div", {
750
- class: ee(e.ns.e("title"))
751
- }, [
752
- e.$slots.title ? $(e.$slots, "title", { key: 1 }) : (B(), Y(ge, { key: 0 }, [
753
- qe(Ve(e.title), 1)
754
- ], 64))
755
- ], 2),
756
- pe("ul", null, [
757
- $(e.$slots, "default")
758
- ])
759
- ], 2);
760
- }
761
- var ze = /* @__PURE__ */ oe(xt, [["render", Et], ["__file", "menu-item-group.vue"]]);
762
- const Wt = $e(ht, {
763
- MenuItem: Be,
764
- MenuItemGroup: ze,
765
- SubMenu: Ie
766
- }), Rt = ye(Be);
767
- ye(ze);
768
- ye(Ie);
769
- export {
770
- Rt as E,
771
- Wt as a
772
- };