st-comp 0.0.279 → 0.0.280

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 (229) hide show
  1. package/es/ChartLayout.cjs +1 -1
  2. package/es/ChartLayout.js +13 -14
  3. package/es/CustomFunction.cjs +2 -2
  4. package/es/CustomFunction.js +342 -547
  5. package/es/FactorWarning.cjs +1 -1
  6. package/es/FactorWarning.js +294 -294
  7. package/es/Kline.cjs +1 -1
  8. package/es/Kline.js +19 -19
  9. package/es/KlineBasic.cjs +1 -1
  10. package/es/KlineBasic.js +253 -253
  11. package/es/KlineConfig.cjs +1 -1
  12. package/es/KlineConfig.js +579 -553
  13. package/es/KlineNew.cjs +1 -1
  14. package/es/KlineNew.js +17 -17
  15. package/es/KlinePlus.cjs +2 -2
  16. package/es/KlinePlus.js +23 -24
  17. package/es/MonacoEditor.cjs +1 -1
  18. package/es/MonacoEditor.js +30 -29
  19. package/es/Pagination.cjs +1 -1
  20. package/es/Pagination.js +517 -425
  21. package/es/PasswordPrompt.cjs +1 -1
  22. package/es/PasswordPrompt.js +3 -3
  23. package/es/Table.cjs +1 -1
  24. package/es/Table.js +46 -46
  25. package/es/User.cjs +1 -1
  26. package/es/User.js +898 -866
  27. package/es/VarSelectDialog.cjs +3 -3
  28. package/es/VarSelectDialog.js +110 -109
  29. package/es/VarietyAiHelper.cjs +7 -7
  30. package/es/VarietyAiHelper.js +605 -443
  31. package/es/VarietyAutoComplete.cjs +1 -1
  32. package/es/VarietyAutoComplete.js +11 -11
  33. package/es/VarietySearch.cjs +18 -18
  34. package/es/VarietySearch.js +3079 -2913
  35. package/es/{VarietySelect-d58eee29.cjs → VarietySelect-aa082a9c.cjs} +1 -1
  36. package/es/{VarietySelect-41daac7b.js → VarietySelect-c402bade.js} +5 -5
  37. package/es/VarietyTextCopy.cjs +3 -3
  38. package/es/VarietyTextCopy.js +51 -51
  39. package/es/VirtualTable.cjs +13 -1
  40. package/es/VirtualTable.js +1929 -2261
  41. package/es/_baseClone-10bdb989.cjs +1 -0
  42. package/es/_baseClone-98af8b33.js +210 -0
  43. package/es/base-d987e5c9.cjs +5 -0
  44. package/es/base-dd156b8e.js +790 -0
  45. package/es/{castArray-7741a212.js → castArray-18eb6a41.js} +1 -1
  46. package/es/{castArray-35947698.cjs → castArray-d9ffe84a.cjs} +1 -1
  47. package/es/clamp-17c4d8aa.cjs +1 -0
  48. package/es/clamp-c7512966.js +10 -0
  49. package/es/config-provider-33a127c4.cjs +1 -0
  50. package/es/config-provider-563023c9.js +86 -0
  51. package/es/debounce-0a98a9c6.js +57 -0
  52. package/es/debounce-37b17615.cjs +1 -0
  53. package/es/dropdown-ce7496c7.cjs +1 -0
  54. package/es/dropdown-feea8702.js +178 -0
  55. package/es/el-autocomplete-d9253bba.cjs +1 -0
  56. package/es/el-autocomplete-eac54f9f.js +434 -0
  57. package/es/el-button-8259594b.cjs +1 -0
  58. package/es/el-button-8a9721f8.js +343 -0
  59. package/es/el-checkbox-6303fc92.cjs +1 -0
  60. package/es/el-checkbox-c328b097.js +566 -0
  61. package/es/el-dialog-67536fac.js +252 -0
  62. package/es/el-dialog-8788bcc1.cjs +1 -0
  63. package/es/el-divider-3f0320be.cjs +1 -0
  64. package/es/el-divider-c5d72961.js +51 -0
  65. package/es/el-empty-552baf04.js +159 -0
  66. package/es/el-empty-58bc2a10.cjs +1 -0
  67. package/es/el-form-item-8efcf2c3.js +1265 -0
  68. package/es/el-form-item-95e68669.cjs +12 -0
  69. package/es/el-input-c8a9bb71.cjs +1 -0
  70. package/es/el-input-e66500b7.js +761 -0
  71. package/es/el-input-number-68ee0d65.js +390 -0
  72. package/es/el-input-number-d7a81922.cjs +1 -0
  73. package/es/el-loading-62132db2.cjs +1 -0
  74. package/es/el-loading-db4c6d13.js +190 -0
  75. package/es/el-menu-item-4b8e7794.cjs +1 -0
  76. package/es/el-menu-item-c2523d82.js +824 -0
  77. package/es/el-message-box-7c13546c.js +481 -0
  78. package/es/el-message-box-fed174f0.cjs +1 -0
  79. package/es/el-overlay-17299785.cjs +1 -0
  80. package/es/el-overlay-36f223e9.js +444 -0
  81. package/es/el-popconfirm-520b2928.cjs +1 -0
  82. package/es/el-popconfirm-a857c54a.js +190 -0
  83. package/es/el-popper-852446fd.js +2235 -0
  84. package/es/el-popper-f824c63b.cjs +1 -0
  85. package/es/{el-scrollbar-323542e7.js → el-scrollbar-0a42c1d0.js} +4 -9
  86. package/es/{el-scrollbar-bc3f790d.cjs → el-scrollbar-225c6c9e.cjs} +1 -1
  87. package/es/el-segmented-45dcc036.cjs +1 -0
  88. package/es/el-segmented-bf08279f.js +168 -0
  89. package/es/el-select-a34348e1.js +1535 -0
  90. package/es/el-select-d2958ae8.cjs +1 -0
  91. package/es/el-table-column-ad70ee0e.cjs +14 -0
  92. package/es/el-table-column-e2be313e.js +3651 -0
  93. package/es/el-tag-527f06f0.cjs +1 -0
  94. package/es/el-tag-9bcfae32.js +77 -0
  95. package/es/el-text-f9379288.js +84 -0
  96. package/es/el-text-fc345ffd.cjs +1 -0
  97. package/es/index-2419d69a.js +468 -0
  98. package/es/index-3806160e.js +710 -0
  99. package/es/index-3a0a7c36.cjs +1 -0
  100. package/es/index-3e7d5ffb.cjs +1 -0
  101. package/es/index-3ed0c678.cjs +1 -0
  102. package/es/index-47d30a52.js +372 -0
  103. package/es/index-5dec535a.cjs +1 -0
  104. package/es/index-5e76a22d.cjs +1 -0
  105. package/es/{index-eb96e074.js → index-60900c6c.js} +223 -254
  106. package/es/{index-a33b2fb8.js → index-69d2353a.js} +5090 -5090
  107. package/es/index-71ba4c28.cjs +1 -0
  108. package/es/index-7711aa69.cjs +1 -0
  109. package/es/index-7c4d8f5d.js +47 -0
  110. package/es/index-86678b72.js +131 -0
  111. package/es/index-99bb359f.cjs +1 -0
  112. package/es/index-99d4335d.cjs +1 -0
  113. package/es/index-a0522466.js +413 -0
  114. package/es/index-a181f161.js +429 -0
  115. package/es/index-b9a26e7f.js +141 -0
  116. package/es/{index-a9246d17.cjs → index-bb0bc131.cjs} +109 -109
  117. package/es/index-d372e68f.cjs +5 -0
  118. package/es/index-de9ad85c.js +12 -0
  119. package/es/{index-44a382a5.js → index-dfb34e00.js} +12 -12
  120. package/es/index-f5474dcc.cjs +3 -0
  121. package/es/{python-8a1664e6.js → python-6eafa04b.js} +32 -31
  122. package/es/{python-a3db9620.cjs → python-922eca89.cjs} +1 -1
  123. package/es/{raf-8249652f.cjs → raf-735cc598.cjs} +1 -1
  124. package/es/{raf-80ef0c0a.js → raf-b4fd1e12.js} +1 -1
  125. package/es/scroll-07bade1e.cjs +1 -0
  126. package/es/scroll-70271cb1.js +35 -0
  127. package/es/style.css +1 -1
  128. package/es/toNumber-b47ceb68.cjs +1 -0
  129. package/es/toNumber-f077c66a.js +31 -0
  130. package/es/use-form-item-0a831287.cjs +2 -0
  131. package/es/use-form-item-187cd7db.js +422 -0
  132. package/es/use-global-config-17dafd40.js +71 -0
  133. package/es/use-global-config-c90c91f7.cjs +1 -0
  134. package/es/{validator-c60a8956.js → validator-800ed2ba.js} +1 -1
  135. package/es/validator-ee5bc3eb.cjs +1 -0
  136. package/es/vnode-6f7b84f0.cjs +1 -0
  137. package/es/vnode-8ee9bf4e.js +12 -0
  138. package/es/{zh-cn-b59a0910.js → zh-cn-26cc7233.js} +36 -33
  139. package/es/zh-cn-a22a6792.cjs +1 -0
  140. package/lib/bundle.js +1 -1
  141. package/lib/bundle.umd.cjs +271 -252
  142. package/lib/{index-62fa175a.js → index-74ed48c6.js} +54107 -52151
  143. package/lib/{python-4a48fa39.js → python-7aaa84e4.js} +1 -1
  144. package/lib/style.css +1 -1
  145. package/package.json +1 -1
  146. package/es/_initCloneObject-5e73c9c8.js +0 -81
  147. package/es/_initCloneObject-a5832933.cjs +0 -1
  148. package/es/base-a5af3db3.js +0 -288
  149. package/es/base-ef747d02.cjs +0 -5
  150. package/es/config-provider-06ea6b42.cjs +0 -1
  151. package/es/config-provider-88b637a8.js +0 -59
  152. package/es/dayjs.min-2c20abe6.cjs +0 -1
  153. package/es/dayjs.min-8313b006.js +0 -299
  154. package/es/debounce-62f5b6e8.cjs +0 -1
  155. package/es/debounce-8d53f4dd.js +0 -83
  156. package/es/dropdown-4ce4c3e2.cjs +0 -1
  157. package/es/dropdown-72fbc15d.js +0 -178
  158. package/es/el-autocomplete-6cafcdf1.js +0 -329
  159. package/es/el-autocomplete-e0857c5b.cjs +0 -1
  160. package/es/el-button-613e0bb2.cjs +0 -1
  161. package/es/el-button-94d3de38.js +0 -272
  162. package/es/el-checkbox-6d4cb393.js +0 -459
  163. package/es/el-checkbox-e90762df.cjs +0 -1
  164. package/es/el-dialog-02942e22.cjs +0 -1
  165. package/es/el-dialog-5e30161f.js +0 -276
  166. package/es/el-divider-4713d74c.cjs +0 -1
  167. package/es/el-divider-4e059794.js +0 -45
  168. package/es/el-empty-1697ded8.cjs +0 -1
  169. package/es/el-empty-33cb66f1.js +0 -183
  170. package/es/el-form-item-44f060d8.cjs +0 -12
  171. package/es/el-form-item-9e8969ea.js +0 -1269
  172. package/es/el-input-342b2def.js +0 -531
  173. package/es/el-input-9a9a7f7f.cjs +0 -1
  174. package/es/el-input-number-65c847d6.cjs +0 -1
  175. package/es/el-input-number-c22b803a.js +0 -311
  176. package/es/el-loading-8179b497.cjs +0 -1
  177. package/es/el-loading-bcc51e3d.js +0 -203
  178. package/es/el-menu-item-339baf6d.js +0 -768
  179. package/es/el-menu-item-83186444.cjs +0 -1
  180. package/es/el-message-box-035b699c.js +0 -489
  181. package/es/el-message-box-c62d3217.cjs +0 -1
  182. package/es/el-overlay-3e17604b.js +0 -324
  183. package/es/el-overlay-8f1da9e8.cjs +0 -1
  184. package/es/el-popconfirm-4e32ec1b.cjs +0 -1
  185. package/es/el-popconfirm-f8a86e2c.js +0 -162
  186. package/es/el-popper-a4f3ae4d.cjs +0 -1
  187. package/es/el-popper-fbd0dcea.js +0 -2094
  188. package/es/el-segmented-56bd58a8.js +0 -142
  189. package/es/el-segmented-833ac177.cjs +0 -1
  190. package/es/el-select-44fa547d.js +0 -1256
  191. package/es/el-select-70806166.cjs +0 -1
  192. package/es/el-table-column-3e2cdfca.cjs +0 -14
  193. package/es/el-table-column-b74a857d.js +0 -3432
  194. package/es/el-tag-66c83156.js +0 -117
  195. package/es/el-tag-9c2f329f.cjs +0 -1
  196. package/es/el-text-034bd3f4.js +0 -67
  197. package/es/el-text-6b2374bb.cjs +0 -1
  198. package/es/index-00f6ca75.cjs +0 -1
  199. package/es/index-185792a7.cjs +0 -1
  200. package/es/index-1e2a38ab.js +0 -113
  201. package/es/index-2e331d74.js +0 -10
  202. package/es/index-3153c1db.cjs +0 -1
  203. package/es/index-5216d5f5.js +0 -406
  204. package/es/index-5c0dd943.cjs +0 -1
  205. package/es/index-657047bb.js +0 -513
  206. package/es/index-870b6c9d.cjs +0 -1
  207. package/es/index-8c2d7e05.js +0 -368
  208. package/es/index-960806da.js +0 -314
  209. package/es/index-9780a537.cjs +0 -1
  210. package/es/index-9d16cea8.cjs +0 -1
  211. package/es/index-ac8dc53d.cjs +0 -1
  212. package/es/index-bb833443.cjs +0 -1
  213. package/es/index-c5f2d372.js +0 -326
  214. package/es/index-c6584658.js +0 -163
  215. package/es/index-d77a7336.js +0 -204
  216. package/es/index-eea0bcb3.cjs +0 -1
  217. package/es/index-f034b910.js +0 -60
  218. package/es/index-f1c702f6.cjs +0 -1
  219. package/es/index-f58b2920.cjs +0 -1
  220. package/es/scroll-679bd6bf.js +0 -35
  221. package/es/scroll-b108dabd.cjs +0 -1
  222. package/es/use-form-common-props-ac666630.cjs +0 -1
  223. package/es/use-form-common-props-ed72e914.js +0 -364
  224. package/es/use-global-config-23472471.cjs +0 -1
  225. package/es/use-global-config-ee406d58.js +0 -72
  226. package/es/validator-366dbf39.cjs +0 -1
  227. package/es/vnode-5ddb7ed1.js +0 -14
  228. package/es/vnode-b906ae6d.cjs +0 -1
  229. package/es/zh-cn-c21d12d8.cjs +0 -1
@@ -0,0 +1,390 @@
1
+ import { B as J, b as be, c as R, s as b, l as g, u as Ne, i as F, v as K, t as ve, a as he, N as Q, w as Ee } from "./base-dd156b8e.js";
2
+ import { u as ye, C as ae, I as T, U as D, g as Ve, h as ge, a as Y } from "./el-popper-852446fd.js";
3
+ import { u as Se } from "./index-a181f161.js";
4
+ import { E as Z, f as Ie, C as we, D as xe, A as Fe } from "./index-60900c6c.js";
5
+ import { h as Ae, d as Ce, e as Pe, g as ke } from "./use-form-item-187cd7db.js";
6
+ import { E as Te } from "./el-input-e66500b7.js";
7
+ import { defineComponent as De, ref as Me, reactive as Be, computed as V, watch as _, onMounted as Le, onUpdated as Oe, openBlock as E, createElementBlock as G, normalizeClass as U, unref as l, withModifiers as $e, withDirectives as ee, withKeys as te, renderSlot as A, createVNode as W, withCtx as C, createBlock as P, createCommentVNode as ne, createSlots as ze } from "vue";
8
+ const k = "_RepeatClick", re = {
9
+ beforeMount(n, N) {
10
+ const m = N.value, { interval: r = 100, delay: c = 600 } = J(m) ? {} : m;
11
+ let v, s;
12
+ const p = () => J(m) ? m() : m.handler(), i = () => {
13
+ s && (clearTimeout(s), s = void 0), v && (clearInterval(v), v = void 0);
14
+ }, d = (S) => {
15
+ S.button === 0 && (i(), p(), document.addEventListener("mouseup", i, {
16
+ once: !0,
17
+ capture: !0
18
+ }), s = setTimeout(() => {
19
+ v = setInterval(() => {
20
+ p();
21
+ }, r);
22
+ }, c));
23
+ };
24
+ n[k] = {
25
+ start: d,
26
+ clear: i
27
+ }, n.addEventListener("mousedown", d);
28
+ },
29
+ unmounted(n) {
30
+ if (!n[k])
31
+ return;
32
+ const { start: N, clear: m } = n[k];
33
+ N && n.removeEventListener("mousedown", N), m && (m(), document.removeEventListener("mouseup", m, !0)), n[k] = null;
34
+ }
35
+ }, Re = be({
36
+ /**
37
+ * @description same as `id` in native input
38
+ */
39
+ id: {
40
+ type: String,
41
+ default: void 0
42
+ },
43
+ /**
44
+ * @description incremental step
45
+ */
46
+ step: {
47
+ type: Number,
48
+ default: 1
49
+ },
50
+ /**
51
+ * @description whether input value can only be multiple of step
52
+ */
53
+ stepStrictly: Boolean,
54
+ /**
55
+ * @description the maximum allowed value
56
+ */
57
+ max: {
58
+ type: Number,
59
+ default: Number.MAX_SAFE_INTEGER
60
+ },
61
+ /**
62
+ * @description the minimum allowed value
63
+ */
64
+ min: {
65
+ type: Number,
66
+ default: Number.MIN_SAFE_INTEGER
67
+ },
68
+ /**
69
+ * @description binding value
70
+ */
71
+ modelValue: { type: [Number, null] },
72
+ /**
73
+ * @description same as `readonly` in native input
74
+ */
75
+ readonly: Boolean,
76
+ /**
77
+ * @description whether the component is disabled
78
+ */
79
+ disabled: {
80
+ type: Boolean,
81
+ default: void 0
82
+ },
83
+ /**
84
+ * @description size of the component
85
+ */
86
+ size: Ae,
87
+ /**
88
+ * @description whether to enable the control buttons
89
+ */
90
+ controls: {
91
+ type: Boolean,
92
+ default: !0
93
+ },
94
+ /**
95
+ * @description position of the control buttons
96
+ */
97
+ controlsPosition: {
98
+ type: String,
99
+ default: "",
100
+ values: ["", "right"]
101
+ },
102
+ /**
103
+ * @description value should be set when input box is cleared
104
+ */
105
+ valueOnClear: {
106
+ type: R([
107
+ String,
108
+ Number,
109
+ null
110
+ ]),
111
+ validator: (n) => n === null || b(n) || ["min", "max"].includes(n),
112
+ default: null
113
+ },
114
+ /**
115
+ * @description same as `name` in native input
116
+ */
117
+ name: String,
118
+ /**
119
+ * @description same as `placeholder` in native input
120
+ */
121
+ placeholder: String,
122
+ /**
123
+ * @description precision of input value
124
+ */
125
+ precision: {
126
+ type: Number,
127
+ validator: (n) => n >= 0 && n === Number.parseInt(`${n}`, 10)
128
+ },
129
+ /**
130
+ * @description whether to trigger form validation
131
+ */
132
+ validateEvent: {
133
+ type: Boolean,
134
+ default: !0
135
+ },
136
+ ...ye(["ariaLabel"]),
137
+ /**
138
+ * @description native input mode for virtual keyboards
139
+ */
140
+ inputmode: {
141
+ type: R(String),
142
+ default: void 0
143
+ },
144
+ /**
145
+ * @description alignment for the inner input text
146
+ */
147
+ align: {
148
+ type: R(String),
149
+ default: "center"
150
+ },
151
+ /**
152
+ * @description whether to disable scientific notation input (e.g. 'e', 'E')
153
+ */
154
+ disabledScientific: Boolean,
155
+ /**
156
+ * @description specifies the format of the value presented in the input
157
+ */
158
+ formatter: { type: Function },
159
+ /**
160
+ * @description specifies the value extracted from the formatted input
161
+ */
162
+ parser: { type: Function },
163
+ /**
164
+ * @description same as `tabindex` in native input
165
+ */
166
+ tabindex: {
167
+ type: [String, Number],
168
+ default: 0
169
+ }
170
+ }), Ke = {
171
+ [ae]: (n, N) => N !== n,
172
+ blur: (n) => n instanceof FocusEvent,
173
+ focus: (n) => n instanceof FocusEvent,
174
+ [T]: (n) => b(n) || g(n),
175
+ [D]: (n) => b(n) || g(n)
176
+ }, Ge = ["aria-label"], Ue = ["aria-label"];
177
+ var We = /* @__PURE__ */ De({
178
+ name: "ElInputNumber",
179
+ __name: "input-number",
180
+ props: Re,
181
+ emits: Ke,
182
+ setup(n, { expose: N, emit: m }) {
183
+ const r = n, c = m, { t: v } = Se(), s = Ne("input-number"), p = Me(), i = Be({
184
+ currentValue: r.modelValue,
185
+ userInput: null
186
+ }), { formItem: d } = Ce(), S = V(() => b(r.modelValue) && r.modelValue <= r.min), X = V(() => b(r.modelValue) && r.modelValue >= r.max), ue = V(() => {
187
+ const e = j(r.step);
188
+ return F(r.precision) ? Math.max(j(r.modelValue), e) : (e > r.precision && K("InputNumber", "precision should not be less than the decimal places of step"), r.precision);
189
+ }), M = V(() => r.controls && r.controlsPosition === "right"), H = Pe(), y = ke(), B = V(() => {
190
+ if (i.userInput !== null)
191
+ return i.userInput;
192
+ let e = i.currentValue;
193
+ if (g(e))
194
+ return "";
195
+ if (b(e)) {
196
+ if (Number.isNaN(e))
197
+ return "";
198
+ F(r.precision) || (e = e.toFixed(r.precision));
199
+ }
200
+ return e;
201
+ }), I = (e, t) => {
202
+ if (F(t) && (t = ue.value), t === 0)
203
+ return Math.round(e);
204
+ let a = String(e);
205
+ const u = a.indexOf(".");
206
+ if (u === -1 || !a.replace(".", "").split("")[u + t])
207
+ return e;
208
+ const f = a.length;
209
+ return a.charAt(f - 1) === "5" && (a = `${a.slice(0, Math.max(0, f - 1))}6`), Number.parseFloat(Number(a).toFixed(t));
210
+ }, j = (e) => {
211
+ if (g(e))
212
+ return 0;
213
+ const t = e.toString(), a = t.indexOf(".");
214
+ let u = 0;
215
+ return a !== -1 && (u = t.length - a - 1), u;
216
+ }, q = (e, t = 1) => b(e) ? e >= Number.MAX_SAFE_INTEGER && t === 1 ? (K("InputNumber", "The value has reached the maximum safe integer limit."), e) : e <= Number.MIN_SAFE_INTEGER && t === -1 ? (K("InputNumber", "The value has reached the minimum safe integer limit."), e) : I(e + r.step * t) : i.currentValue, ie = (e) => {
217
+ const t = Ve(e), a = ge(e);
218
+ if (r.disabledScientific && ["e", "E"].includes(a)) {
219
+ e.preventDefault();
220
+ return;
221
+ }
222
+ switch (t) {
223
+ case Y.up:
224
+ e.preventDefault(), L();
225
+ break;
226
+ case Y.down:
227
+ e.preventDefault(), O();
228
+ break;
229
+ }
230
+ }, L = () => {
231
+ r.readonly || y.value || X.value || (w(q(Number(B.value) || 0)), c(T, i.currentValue), z());
232
+ }, O = () => {
233
+ r.readonly || y.value || S.value || (w(q(Number(B.value) || 0, -1)), c(T, i.currentValue), z());
234
+ }, $ = (e, t) => {
235
+ const { max: a, min: u, step: f, precision: h, stepStrictly: pe, valueOnClear: x } = r;
236
+ a < u && ve("InputNumber", "min should not be greater than max.");
237
+ let o = e ? Number.parseFloat(String(e)) : Number(e);
238
+ if (g(e) || Number.isNaN(o))
239
+ return null;
240
+ if (e === "") {
241
+ if (x === null)
242
+ return null;
243
+ o = he(x) ? {
244
+ min: u,
245
+ max: a
246
+ }[x] : x;
247
+ }
248
+ return pe && (o = I(Math.round(I(o / f)) * f, h), o !== e && t && c("update:modelValue", o)), F(h) || (o = I(o, h)), (o > a || o < u) && (o = o > a ? a : u, t && c("update:modelValue", o)), o;
249
+ }, w = (e, t = !0) => {
250
+ var f;
251
+ const a = i.currentValue, u = $(e);
252
+ if (!t) {
253
+ c(D, u);
254
+ return;
255
+ }
256
+ i.userInput = null, !(a === u && e) && (c(D, u), a !== u && c(ae, u, a), r.validateEvent && ((f = d == null ? void 0 : d.validate) == null || f.call(d, "change").catch(Q)), i.currentValue = u);
257
+ }, le = (e) => {
258
+ i.userInput = e;
259
+ let t = e === "" ? null : Number.parseFloat(e);
260
+ Number.isNaN(t) && (t = null), c(T, t), w(t, !1);
261
+ }, se = (e) => {
262
+ const t = e !== "" ? Number.parseFloat(e) : "";
263
+ (b(t) && !Number.isNaN(t) || r.formatter && Number.isNaN(t) || t === "") && w(t), z(), i.userInput = null;
264
+ }, oe = () => {
265
+ var e, t;
266
+ (t = (e = p.value) == null ? void 0 : e.focus) == null || t.call(e);
267
+ }, ce = () => {
268
+ var e, t;
269
+ (t = (e = p.value) == null ? void 0 : e.blur) == null || t.call(e);
270
+ }, de = (e) => {
271
+ c("focus", e);
272
+ }, me = (e) => {
273
+ var t, a, u;
274
+ i.userInput = null, i.currentValue === null && ((t = p.value) != null && t.input) && (p.value.input.value = ((a = r.formatter) == null ? void 0 : a.call(r, "")) ?? ""), c("blur", e), r.validateEvent && ((u = d == null ? void 0 : d.validate) == null || u.call(d, "blur").catch(Q));
275
+ }, z = () => {
276
+ i.currentValue !== r.modelValue && (i.currentValue = r.modelValue);
277
+ }, fe = (e) => {
278
+ document.activeElement === e.target && e.preventDefault();
279
+ };
280
+ return _(() => r.modelValue, (e, t) => {
281
+ const a = $(e, !0);
282
+ i.userInput === null && a !== t && (i.currentValue = a);
283
+ }, { immediate: !0 }), _(() => r.precision, () => {
284
+ i.currentValue = $(r.modelValue);
285
+ }), Le(() => {
286
+ var f;
287
+ const { min: e, max: t, modelValue: a } = r, u = (f = p.value) == null ? void 0 : f.input;
288
+ if (u.setAttribute("role", "spinbutton"), Number.isFinite(t) ? u.setAttribute("aria-valuemax", String(t)) : u.removeAttribute("aria-valuemax"), Number.isFinite(e) ? u.setAttribute("aria-valuemin", String(e)) : u.removeAttribute("aria-valuemin"), u.setAttribute("aria-valuenow", i.currentValue || i.currentValue === 0 ? String(i.currentValue) : ""), u.setAttribute("aria-disabled", String(y.value)), !b(a) && a != null) {
289
+ let h = Number(a);
290
+ Number.isNaN(h) && (h = null), c(D, h);
291
+ }
292
+ u.addEventListener("wheel", fe, { passive: !1 });
293
+ }), Oe(() => {
294
+ var e, t;
295
+ (t = (e = p.value) == null ? void 0 : e.input) == null || t.setAttribute("aria-valuenow", `${i.currentValue ?? ""}`);
296
+ }), N({
297
+ /** @description get focus the input component */
298
+ focus: oe,
299
+ /** @description remove focus the input component */
300
+ blur: ce
301
+ }), (e, t) => (E(), G("div", {
302
+ class: U([
303
+ l(s).b(),
304
+ l(s).m(l(H)),
305
+ l(s).is("disabled", l(y)),
306
+ l(s).is("without-controls", !n.controls),
307
+ l(s).is("controls-right", M.value),
308
+ l(s).is(n.align, !!n.align)
309
+ ]),
310
+ onDragstart: t[0] || (t[0] = $e(() => {
311
+ }, ["prevent"]))
312
+ }, [
313
+ n.controls ? ee((E(), G("span", {
314
+ key: 0,
315
+ role: "button",
316
+ "aria-label": l(v)("el.inputNumber.decrease"),
317
+ class: U([l(s).e("decrease"), l(s).is("disabled", S.value)]),
318
+ onKeydown: te(O, ["enter"])
319
+ }, [A(e.$slots, "decrease-icon", {}, () => [W(l(Z), null, {
320
+ default: C(() => [M.value ? (E(), P(l(Ie), { key: 0 })) : (E(), P(l(we), { key: 1 }))]),
321
+ _: 1
322
+ })])], 42, Ge)), [[l(re), O]]) : ne("v-if", !0),
323
+ n.controls ? ee((E(), G("span", {
324
+ key: 1,
325
+ role: "button",
326
+ "aria-label": l(v)("el.inputNumber.increase"),
327
+ class: U([l(s).e("increase"), l(s).is("disabled", X.value)]),
328
+ onKeydown: te(L, ["enter"])
329
+ }, [A(e.$slots, "increase-icon", {}, () => [W(l(Z), null, {
330
+ default: C(() => [M.value ? (E(), P(l(xe), { key: 0 })) : (E(), P(l(Fe), { key: 1 }))]),
331
+ _: 1
332
+ })])], 42, Ue)), [[l(re), L]]) : ne("v-if", !0),
333
+ W(l(Te), {
334
+ id: n.id,
335
+ ref_key: "input",
336
+ ref: p,
337
+ type: n.formatter ? "text" : "number",
338
+ step: n.step,
339
+ "model-value": B.value,
340
+ placeholder: n.placeholder,
341
+ readonly: n.readonly,
342
+ disabled: l(y),
343
+ size: l(H),
344
+ max: n.max,
345
+ min: n.min,
346
+ name: n.name,
347
+ "aria-label": n.ariaLabel,
348
+ "validate-event": !1,
349
+ inputmode: n.inputmode,
350
+ formatter: n.formatter,
351
+ parser: n.parser,
352
+ tabindex: n.tabindex,
353
+ onKeydown: ie,
354
+ onBlur: me,
355
+ onFocus: de,
356
+ onInput: le,
357
+ onChange: se
358
+ }, ze({ _: 2 }, [e.$slots.prefix ? {
359
+ name: "prefix",
360
+ fn: C(() => [A(e.$slots, "prefix")]),
361
+ key: "0"
362
+ } : void 0, e.$slots.suffix ? {
363
+ name: "suffix",
364
+ fn: C(() => [A(e.$slots, "suffix")]),
365
+ key: "1"
366
+ } : void 0]), 1032, [
367
+ "id",
368
+ "type",
369
+ "step",
370
+ "model-value",
371
+ "placeholder",
372
+ "readonly",
373
+ "disabled",
374
+ "size",
375
+ "max",
376
+ "min",
377
+ "name",
378
+ "aria-label",
379
+ "inputmode",
380
+ "formatter",
381
+ "parser",
382
+ "tabindex"
383
+ ])
384
+ ], 34));
385
+ }
386
+ }), Xe = We;
387
+ const _e = Ee(Xe);
388
+ export {
389
+ _e as E
390
+ };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./base-d987e5c9.cjs"),c=require("./el-popper-f824c63b.cjs"),j=require("./index-d372e68f.cjs"),V=require("./index-3e7d5ffb.cjs"),T=require("./use-form-item-0a831287.cjs"),J=require("./el-input-c8a9bb71.cjs"),t=require("vue"),x="_RepeatClick",L={beforeMount(r,E){const p=E.value,{interval:u=100,delay:m=600}=i.isFunction(p)?{}:p;let v,s;const N=()=>i.isFunction(p)?p():p.handler(),o=()=>{s&&(clearTimeout(s),s=void 0),v&&(clearInterval(v),v=void 0)},f=g=>{g.button===0&&(o(),N(),document.addEventListener("mouseup",o,{once:!0,capture:!0}),s=setTimeout(()=>{v=setInterval(()=>{N()},u)},m))};r[x]={start:f,clear:o},r.addEventListener("mousedown",f)},unmounted(r){if(!r[x])return;const{start:E,clear:p}=r[x];E&&r.removeEventListener("mousedown",E),p&&(p(),document.removeEventListener("mouseup",p,!0)),r[x]=null}},Q=i.buildProps({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.MAX_SAFE_INTEGER},min:{type:Number,default:Number.MIN_SAFE_INTEGER},modelValue:{type:[Number,null]},readonly:Boolean,disabled:{type:Boolean,default:void 0},size:T.useSizeProp,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:i.definePropType([String,Number,null]),validator:r=>r===null||i.isNumber(r)||["min","max"].includes(r),default:null},name:String,placeholder:String,precision:{type:Number,validator:r=>r>=0&&r===Number.parseInt(`${r}`,10)},validateEvent:{type:Boolean,default:!0},...c.useAriaProps(["ariaLabel"]),inputmode:{type:i.definePropType(String),default:void 0},align:{type:i.definePropType(String),default:"center"},disabledScientific:Boolean,formatter:{type:Function},parser:{type:Function},tabindex:{type:[String,Number],default:0}}),Y={[c.CHANGE_EVENT]:(r,E)=>E!==r,blur:r=>r instanceof FocusEvent,focus:r=>r instanceof FocusEvent,[c.INPUT_EVENT]:r=>i.isNumber(r)||i.isNil(r),[c.UPDATE_MODEL_EVENT]:r=>i.isNumber(r)||i.isNil(r)},Z=["aria-label"],ee=["aria-label"];var te=t.defineComponent({name:"ElInputNumber",__name:"input-number",props:Q,emits:Y,setup(r,{expose:E,emit:p}){const u=r,m=p,{t:v}=j.useLocale(),s=i.useNamespace("input-number"),N=t.ref(),o=t.reactive({currentValue:u.modelValue,userInput:null}),{formItem:f}=T.useFormItem(),g=t.computed(()=>i.isNumber(u.modelValue)&&u.modelValue<=u.min),D=t.computed(()=>i.isNumber(u.modelValue)&&u.modelValue>=u.max),_=t.computed(()=>{const e=O(u.step);return i.isUndefined(u.precision)?Math.max(O(u.modelValue),e):(e>u.precision&&i.debugWarn("InputNumber","precision should not be less than the decimal places of step"),u.precision)}),k=t.computed(()=>u.controls&&u.controlsPosition==="right"),M=T.useFormSize(),y=T.useFormDisabled(),P=t.computed(()=>{if(o.userInput!==null)return o.userInput;let e=o.currentValue;if(i.isNil(e))return"";if(i.isNumber(e)){if(Number.isNaN(e))return"";i.isUndefined(u.precision)||(e=e.toFixed(u.precision))}return e}),I=(e,n)=>{if(i.isUndefined(n)&&(n=_.value),n===0)return Math.round(e);let a=String(e);const l=a.indexOf(".");if(l===-1||!a.replace(".","").split("")[l+n])return e;const b=a.length;return a.charAt(b-1)==="5"&&(a=`${a.slice(0,Math.max(0,b-1))}6`),Number.parseFloat(Number(a).toFixed(n))},O=e=>{if(i.isNil(e))return 0;const n=e.toString(),a=n.indexOf(".");let l=0;return a!==-1&&(l=n.length-a-1),l},U=(e,n=1)=>i.isNumber(e)?e>=Number.MAX_SAFE_INTEGER&&n===1?(i.debugWarn("InputNumber","The value has reached the maximum safe integer limit."),e):e<=Number.MIN_SAFE_INTEGER&&n===-1?(i.debugWarn("InputNumber","The value has reached the minimum safe integer limit."),e):I(e+u.step*n):o.currentValue,$=e=>{const n=c.getEventCode(e),a=c.getEventKey(e);if(u.disabledScientific&&["e","E"].includes(a)){e.preventDefault();return}switch(n){case c.EVENT_CODE.up:e.preventDefault(),C();break;case c.EVENT_CODE.down:e.preventDefault(),F();break}},C=()=>{u.readonly||y.value||D.value||(S(U(Number(P.value)||0)),m(c.INPUT_EVENT,o.currentValue),B())},F=()=>{u.readonly||y.value||g.value||(S(U(Number(P.value)||0,-1)),m(c.INPUT_EVENT,o.currentValue),B())},A=(e,n)=>{const{max:a,min:l,step:b,precision:h,stepStrictly:X,valueOnClear:w}=u;a<l&&i.throwError("InputNumber","min should not be greater than max.");let d=e?Number.parseFloat(String(e)):Number(e);if(i.isNil(e)||Number.isNaN(d))return null;if(e===""){if(w===null)return null;d=i.isString(w)?{min:l,max:a}[w]:w}return X&&(d=I(Math.round(I(d/b))*b,h),d!==e&&n&&m("update:modelValue",d)),i.isUndefined(h)||(d=I(d,h)),(d>a||d<l)&&(d=d>a?a:l,n&&m("update:modelValue",d)),d},S=(e,n=!0)=>{var b;const a=o.currentValue,l=A(e);if(!n){m(c.UPDATE_MODEL_EVENT,l);return}o.userInput=null,!(a===l&&e)&&(m(c.UPDATE_MODEL_EVENT,l),a!==l&&m(c.CHANGE_EVENT,l,a),u.validateEvent&&((b=f==null?void 0:f.validate)==null||b.call(f,"change").catch(i.NOOP)),o.currentValue=l)},z=e=>{o.userInput=e;let n=e===""?null:Number.parseFloat(e);Number.isNaN(n)&&(n=null),m(c.INPUT_EVENT,n),S(n,!1)},q=e=>{const n=e!==""?Number.parseFloat(e):"";(i.isNumber(n)&&!Number.isNaN(n)||u.formatter&&Number.isNaN(n)||n==="")&&S(n),B(),o.userInput=null},K=()=>{var e,n;(n=(e=N.value)==null?void 0:e.focus)==null||n.call(e)},R=()=>{var e,n;(n=(e=N.value)==null?void 0:e.blur)==null||n.call(e)},G=e=>{m("focus",e)},W=e=>{var n,a,l;o.userInput=null,o.currentValue===null&&((n=N.value)!=null&&n.input)&&(N.value.input.value=((a=u.formatter)==null?void 0:a.call(u,""))??""),m("blur",e),u.validateEvent&&((l=f==null?void 0:f.validate)==null||l.call(f,"blur").catch(i.NOOP))},B=()=>{o.currentValue!==u.modelValue&&(o.currentValue=u.modelValue)},H=e=>{document.activeElement===e.target&&e.preventDefault()};return t.watch(()=>u.modelValue,(e,n)=>{const a=A(e,!0);o.userInput===null&&a!==n&&(o.currentValue=a)},{immediate:!0}),t.watch(()=>u.precision,()=>{o.currentValue=A(u.modelValue)}),t.onMounted(()=>{var b;const{min:e,max:n,modelValue:a}=u,l=(b=N.value)==null?void 0:b.input;if(l.setAttribute("role","spinbutton"),Number.isFinite(n)?l.setAttribute("aria-valuemax",String(n)):l.removeAttribute("aria-valuemax"),Number.isFinite(e)?l.setAttribute("aria-valuemin",String(e)):l.removeAttribute("aria-valuemin"),l.setAttribute("aria-valuenow",o.currentValue||o.currentValue===0?String(o.currentValue):""),l.setAttribute("aria-disabled",String(y.value)),!i.isNumber(a)&&a!=null){let h=Number(a);Number.isNaN(h)&&(h=null),m(c.UPDATE_MODEL_EVENT,h)}l.addEventListener("wheel",H,{passive:!1})}),t.onUpdated(()=>{var e,n;(n=(e=N.value)==null?void 0:e.input)==null||n.setAttribute("aria-valuenow",`${o.currentValue??""}`)}),E({focus:K,blur:R}),(e,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(s).b(),t.unref(s).m(t.unref(M)),t.unref(s).is("disabled",t.unref(y)),t.unref(s).is("without-controls",!r.controls),t.unref(s).is("controls-right",k.value),t.unref(s).is(r.align,!!r.align)]),onDragstart:n[0]||(n[0]=t.withModifiers(()=>{},["prevent"]))},[r.controls?t.withDirectives((t.openBlock(),t.createElementBlock("span",{key:0,role:"button","aria-label":t.unref(v)("el.inputNumber.decrease"),class:t.normalizeClass([t.unref(s).e("decrease"),t.unref(s).is("disabled",g.value)]),onKeydown:t.withKeys(F,["enter"])},[t.renderSlot(e.$slots,"decrease-icon",{},()=>[t.createVNode(t.unref(V.ElIcon),null,{default:t.withCtx(()=>[k.value?(t.openBlock(),t.createBlock(t.unref(V.arrow_down_default),{key:0})):(t.openBlock(),t.createBlock(t.unref(V.minus_default),{key:1}))]),_:1})])],42,Z)),[[t.unref(L),F]]):t.createCommentVNode("v-if",!0),r.controls?t.withDirectives((t.openBlock(),t.createElementBlock("span",{key:1,role:"button","aria-label":t.unref(v)("el.inputNumber.increase"),class:t.normalizeClass([t.unref(s).e("increase"),t.unref(s).is("disabled",D.value)]),onKeydown:t.withKeys(C,["enter"])},[t.renderSlot(e.$slots,"increase-icon",{},()=>[t.createVNode(t.unref(V.ElIcon),null,{default:t.withCtx(()=>[k.value?(t.openBlock(),t.createBlock(t.unref(V.arrow_up_default),{key:0})):(t.openBlock(),t.createBlock(t.unref(V.plus_default),{key:1}))]),_:1})])],42,ee)),[[t.unref(L),C]]):t.createCommentVNode("v-if",!0),t.createVNode(t.unref(J.ElInput),{id:r.id,ref_key:"input",ref:N,type:r.formatter?"text":"number",step:r.step,"model-value":P.value,placeholder:r.placeholder,readonly:r.readonly,disabled:t.unref(y),size:t.unref(M),max:r.max,min:r.min,name:r.name,"aria-label":r.ariaLabel,"validate-event":!1,inputmode:r.inputmode,formatter:r.formatter,parser:r.parser,tabindex:r.tabindex,onKeydown:$,onBlur:W,onFocus:G,onInput:z,onChange:q},t.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"suffix")]),key:"1"}:void 0]),1032,["id","type","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","inputmode","formatter","parser","tabindex"])],34))}}),ne=te;const re=i.withInstall(ne);exports.ElInputNumber=re;
@@ -0,0 +1 @@
1
+ "use strict";const a=require("./base-d987e5c9.cjs"),I=require("./use-global-config-c90c91f7.cjs"),l=require("vue");function T(e,n){let t;const o=l.ref(!1),s=l.reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function r(i){s.text=i}function d(){const i=s.parent,g=m.ns;if(!i.vLoadingAddClassList){let u=i.getAttribute("loading-number");u=Number.parseInt(u)-1,u?i.setAttribute("loading-number",u.toString()):(a.removeClass(i,g.bm("parent","relative")),i.removeAttribute("loading-number")),a.removeClass(i,g.bm("parent","hidden"))}f(),y.unmount()}function f(){var i,g;(g=(i=m.$el)==null?void 0:i.parentNode)==null||g.removeChild(m.$el)}function x(){var i;e.beforeClose&&!e.beforeClose()||(o.value=!0,clearTimeout(t),t=setTimeout(c,400),s.visible=!1,(i=e.closed)==null||i.call(e))}function c(){if(!o.value)return;const i=s.parent;o.value=!1,i.vLoadingAddClassList=void 0,d()}const y=l.createApp(l.defineComponent({name:"ElLoading",setup(i,{expose:g}){const{ns:u,zIndex:w}=I.useGlobalComponentSettings("loading");return g({ns:u,zIndex:w}),()=>{const C=s.spinner||s.svg,S=l.h("svg",{class:"circular",viewBox:s.svgViewBox?s.svgViewBox:"0 0 50 50",...C?{innerHTML:C}:{}},C?void 0:[l.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),B=s.text?l.h("p",{class:u.b("text")},[s.text]):void 0;return l.h(l.Transition,{name:u.b("fade"),onAfterLeave:c},{default:l.withCtx(()=>[l.withDirectives(l.createVNode("div",{style:{backgroundColor:s.background||""},class:[u.b("mask"),s.customClass,u.is("fullscreen",s.fullscreen)]},[l.h("div",{class:u.b("spinner")},[S,B])]),[[l.vShow,s.visible]])])})}}}));Object.assign(y._context,n??{});const m=y.mount(document.createElement("div"));return{...l.toRefs(s),setText:r,removeElLoadingChild:f,close:x,handleAfterLeave:c,vm:m,get $el(){return m.$el}}}let p;const h=function(e={},n){if(!a.isClient)return;const t=$(e);if(t.fullscreen&&p)return p;const o=T({...t,closed:()=>{var r;(r=t.closed)==null||r.call(t),t.fullscreen&&(p=void 0)}},n??h._context);N(t,t.parent,o),k(t,t.parent,o),t.parent.vLoadingAddClassList=()=>k(t,t.parent,o);let s=t.parent.getAttribute("loading-number");return s?s=`${Number.parseInt(s)+1}`:s="1",t.parent.setAttribute("loading-number",s),t.parent.appendChild(o.$el),l.nextTick(()=>o.visible.value=t.visible),t.fullscreen&&(p=o),o},$=e=>{let n;return a.isString(e.target)?n=document.querySelector(e.target)??document.body:n=e.target||document.body,{parent:n===document.body||e.body?document.body:n,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:n===document.body&&(e.fullscreen??!0),lock:e.lock??!1,customClass:e.customClass||"",visible:e.visible??!0,beforeClose:e.beforeClose,closed:e.closed,target:n}},N=async(e,n,t)=>{const{nextZIndex:o}=t.vm.zIndex||t.vm._.exposed.zIndex,s={};if(e.fullscreen)t.originalPosition.value=a.getStyle(document.body,"position"),t.originalOverflow.value=a.getStyle(document.body,"overflow"),s.zIndex=o();else if(e.parent===document.body){t.originalPosition.value=a.getStyle(document.body,"position"),await l.nextTick();for(const r of["top","left"]){const d=r==="top"?"scrollTop":"scrollLeft";s[r]=`${e.target.getBoundingClientRect()[r]+document.body[d]+document.documentElement[d]-Number.parseInt(a.getStyle(document.body,`margin-${r}`),10)}px`}for(const r of["height","width"])s[r]=`${e.target.getBoundingClientRect()[r]}px`}else t.originalPosition.value=a.getStyle(n,"position");for(const[r,d]of Object.entries(s))t.$el.style[r]=d},k=(e,n,t)=>{const o=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?a.removeClass(n,o.bm("parent","relative")):a.addClass(n,o.bm("parent","relative")),e.fullscreen&&e.lock?a.addClass(n,o.bm("parent","hidden")):a.removeClass(n,o.bm("parent","hidden"))};h._context=null;const b=Symbol("ElLoading"),v=e=>`element-loading-${a.hyphenate(e)}`,A=(e,n)=>{const t=n.instance,o=c=>a.isObject(n.value)?n.value[c]:void 0,s=c=>l.ref(a.isString(c)&&(t==null?void 0:t[c])||c),r=c=>s(o(c)||e.getAttribute(v(c))),d=o("fullscreen")??n.modifiers.fullscreen,f={text:r("text"),svg:r("svg"),svgViewBox:r("svgViewBox"),spinner:r("spinner"),background:r("background"),customClass:r("customClass"),fullscreen:d,target:o("target")??(d?void 0:e),body:o("body")??n.modifiers.body,lock:o("lock")??n.modifiers.lock},x=h(f);x._context=L._context,e[b]={options:f,instance:x}},_=(e,n)=>{for(const t of Object.keys(e))l.isRef(e[t])&&(e[t].value=n[t])},L={mounted(e,n){n.value&&A(e,n)},updated(e,n){const t=e[b];if(!n.value){t==null||t.instance.close(),e[b]=null;return}t?_(t.options,a.isObject(n.value)?n.value:{text:e.getAttribute(v("text")),svg:e.getAttribute(v("svg")),svgViewBox:e.getAttribute(v("svgViewBox")),spinner:e.getAttribute(v("spinner")),background:e.getAttribute(v("background")),customClass:e.getAttribute(v("customClass"))}):A(e,n)},unmounted(e){var n;(n=e[b])==null||n.instance.close(),e[b]=null}};L._context=null;exports.vLoading=L;
@@ -0,0 +1,190 @@
1
+ import { r as y, y as E, a as B, z as g, h as L, k as I, A as P } from "./base-dd156b8e.js";
2
+ import { u as O } from "./use-global-config-17dafd40.js";
3
+ import { ref as S, reactive as z, createApp as j, defineComponent as R, h as m, Transition as q, withCtx as D, withDirectives as F, createVNode as G, vShow as H, toRefs as K, nextTick as $, isRef as M } from "vue";
4
+ function Y(e, n) {
5
+ let t;
6
+ const s = S(!1), o = z({
7
+ ...e,
8
+ originalPosition: "",
9
+ originalOverflow: "",
10
+ visible: !1
11
+ });
12
+ function r(l) {
13
+ o.text = l;
14
+ }
15
+ function c() {
16
+ const l = o.parent, u = v.ns;
17
+ if (!l.vLoadingAddClassList) {
18
+ let i = l.getAttribute("loading-number");
19
+ i = Number.parseInt(i) - 1, i ? l.setAttribute("loading-number", i.toString()) : (y(l, u.bm("parent", "relative")), l.removeAttribute("loading-number")), y(l, u.bm("parent", "hidden"));
20
+ }
21
+ f(), C.unmount();
22
+ }
23
+ function f() {
24
+ var l, u;
25
+ (u = (l = v.$el) == null ? void 0 : l.parentNode) == null || u.removeChild(v.$el);
26
+ }
27
+ function x() {
28
+ var l;
29
+ e.beforeClose && !e.beforeClose() || (s.value = !0, clearTimeout(t), t = setTimeout(a, 400), o.visible = !1, (l = e.closed) == null || l.call(e));
30
+ }
31
+ function a() {
32
+ if (!s.value)
33
+ return;
34
+ const l = o.parent;
35
+ s.value = !1, l.vLoadingAddClassList = void 0, c();
36
+ }
37
+ const C = j(R({
38
+ name: "ElLoading",
39
+ setup(l, { expose: u }) {
40
+ const { ns: i, zIndex: T } = O("loading");
41
+ return u({
42
+ ns: i,
43
+ zIndex: T
44
+ }), () => {
45
+ const A = o.spinner || o.svg, _ = m("svg", {
46
+ class: "circular",
47
+ viewBox: o.svgViewBox ? o.svgViewBox : "0 0 50 50",
48
+ ...A ? { innerHTML: A } : {}
49
+ }, A ? void 0 : [m("circle", {
50
+ class: "path",
51
+ cx: "25",
52
+ cy: "25",
53
+ r: "20",
54
+ fill: "none"
55
+ })]), V = o.text ? m("p", { class: i.b("text") }, [o.text]) : void 0;
56
+ return m(q, {
57
+ name: i.b("fade"),
58
+ onAfterLeave: a
59
+ }, { default: D(() => [F(G("div", {
60
+ style: { backgroundColor: o.background || "" },
61
+ class: [
62
+ i.b("mask"),
63
+ o.customClass,
64
+ i.is("fullscreen", o.fullscreen)
65
+ ]
66
+ }, [m("div", { class: i.b("spinner") }, [_, V])]), [[H, o.visible]])]) });
67
+ };
68
+ }
69
+ }));
70
+ Object.assign(C._context, n ?? {});
71
+ const v = C.mount(document.createElement("div"));
72
+ return {
73
+ ...K(o),
74
+ setText: r,
75
+ removeElLoadingChild: f,
76
+ close: x,
77
+ handleAfterLeave: a,
78
+ vm: v,
79
+ get $el() {
80
+ return v.$el;
81
+ }
82
+ };
83
+ }
84
+ let p;
85
+ const k = function(e = {}, n) {
86
+ if (!E)
87
+ return;
88
+ const t = Z(e);
89
+ if (t.fullscreen && p)
90
+ return p;
91
+ const s = Y({
92
+ ...t,
93
+ closed: () => {
94
+ var r;
95
+ (r = t.closed) == null || r.call(t), t.fullscreen && (p = void 0);
96
+ }
97
+ }, n ?? k._context);
98
+ J(t, t.parent, s), h(t, t.parent, s), t.parent.vLoadingAddClassList = () => h(t, t.parent, s);
99
+ let o = t.parent.getAttribute("loading-number");
100
+ return o ? o = `${Number.parseInt(o) + 1}` : o = "1", t.parent.setAttribute("loading-number", o), t.parent.appendChild(s.$el), $(() => s.visible.value = t.visible), t.fullscreen && (p = s), s;
101
+ }, Z = (e) => {
102
+ let n;
103
+ return B(e.target) ? n = document.querySelector(e.target) ?? document.body : n = e.target || document.body, {
104
+ parent: n === document.body || e.body ? document.body : n,
105
+ background: e.background || "",
106
+ svg: e.svg || "",
107
+ svgViewBox: e.svgViewBox || "",
108
+ spinner: e.spinner || !1,
109
+ text: e.text || "",
110
+ fullscreen: n === document.body && (e.fullscreen ?? !0),
111
+ lock: e.lock ?? !1,
112
+ customClass: e.customClass || "",
113
+ visible: e.visible ?? !0,
114
+ beforeClose: e.beforeClose,
115
+ closed: e.closed,
116
+ target: n
117
+ };
118
+ }, J = async (e, n, t) => {
119
+ const { nextZIndex: s } = t.vm.zIndex || t.vm._.exposed.zIndex, o = {};
120
+ if (e.fullscreen)
121
+ t.originalPosition.value = g(document.body, "position"), t.originalOverflow.value = g(document.body, "overflow"), o.zIndex = s();
122
+ else if (e.parent === document.body) {
123
+ t.originalPosition.value = g(document.body, "position"), await $();
124
+ for (const r of ["top", "left"]) {
125
+ const c = r === "top" ? "scrollTop" : "scrollLeft";
126
+ o[r] = `${e.target.getBoundingClientRect()[r] + document.body[c] + document.documentElement[c] - Number.parseInt(g(document.body, `margin-${r}`), 10)}px`;
127
+ }
128
+ for (const r of ["height", "width"])
129
+ o[r] = `${e.target.getBoundingClientRect()[r]}px`;
130
+ } else
131
+ t.originalPosition.value = g(n, "position");
132
+ for (const [r, c] of Object.entries(o))
133
+ t.$el.style[r] = c;
134
+ }, h = (e, n, t) => {
135
+ const s = t.vm.ns || t.vm._.exposed.ns;
136
+ [
137
+ "absolute",
138
+ "fixed",
139
+ "sticky"
140
+ ].includes(t.originalPosition.value) ? y(n, s.bm("parent", "relative")) : L(n, s.bm("parent", "relative")), e.fullscreen && e.lock ? L(n, s.bm("parent", "hidden")) : y(n, s.bm("parent", "hidden"));
141
+ };
142
+ k._context = null;
143
+ const b = Symbol("ElLoading"), d = (e) => `element-loading-${P(e)}`, w = (e, n) => {
144
+ const t = n.instance, s = (a) => I(n.value) ? n.value[a] : void 0, o = (a) => S(B(a) && (t == null ? void 0 : t[a]) || a), r = (a) => o(s(a) || e.getAttribute(d(a))), c = s("fullscreen") ?? n.modifiers.fullscreen, f = {
145
+ text: r("text"),
146
+ svg: r("svg"),
147
+ svgViewBox: r("svgViewBox"),
148
+ spinner: r("spinner"),
149
+ background: r("background"),
150
+ customClass: r("customClass"),
151
+ fullscreen: c,
152
+ target: s("target") ?? (c ? void 0 : e),
153
+ body: s("body") ?? n.modifiers.body,
154
+ lock: s("lock") ?? n.modifiers.lock
155
+ }, x = k(f);
156
+ x._context = N._context, e[b] = {
157
+ options: f,
158
+ instance: x
159
+ };
160
+ }, Q = (e, n) => {
161
+ for (const t of Object.keys(e))
162
+ M(e[t]) && (e[t].value = n[t]);
163
+ }, N = {
164
+ mounted(e, n) {
165
+ n.value && w(e, n);
166
+ },
167
+ updated(e, n) {
168
+ const t = e[b];
169
+ if (!n.value) {
170
+ t == null || t.instance.close(), e[b] = null;
171
+ return;
172
+ }
173
+ t ? Q(t.options, I(n.value) ? n.value : {
174
+ text: e.getAttribute(d("text")),
175
+ svg: e.getAttribute(d("svg")),
176
+ svgViewBox: e.getAttribute(d("svgViewBox")),
177
+ spinner: e.getAttribute(d("spinner")),
178
+ background: e.getAttribute(d("background")),
179
+ customClass: e.getAttribute(d("customClass"))
180
+ }) : w(e, n);
181
+ },
182
+ unmounted(e) {
183
+ var n;
184
+ (n = e[b]) == null || n.instance.close(), e[b] = null;
185
+ }
186
+ };
187
+ N._context = null;
188
+ export {
189
+ N as v
190
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./base-d987e5c9.cjs"),P=require("./use-form-item-0a831287.cjs"),H=require("./index-3e7d5ffb.cjs"),E=require("./el-popper-f824c63b.cjs"),e=require("vue"),se=require("./index-71ba4c28.cjs"),le=require("./vnode-6f7b84f0.cjs"),re=require("./typescript-b63f8e83.cjs"),ue=require("./el-select-d2958ae8.cjs");var ie=e.defineComponent({name:"ElCollapseTransition",__name:"collapse-transition",setup(t){const a=s.useNamespace("collapse-transition"),i=n=>{n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom},o={beforeEnter(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.style.height&&(n.dataset.elExistsHeight=n.style.height),n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0},enter(n){requestAnimationFrame(()=>{n.dataset.oldOverflow=n.style.overflow,n.dataset.elExistsHeight?n.style.maxHeight=n.dataset.elExistsHeight:n.scrollHeight!==0?n.style.maxHeight=`${n.scrollHeight}px`:n.style.maxHeight=0,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom,n.style.overflow="hidden"})},afterEnter(n){n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow},enterCancelled(n){i(n)},beforeLeave(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.dataset.oldOverflow=n.style.overflow,n.style.maxHeight=`${n.scrollHeight}px`,n.style.overflow="hidden"},leave(n){n.scrollHeight!==0&&(n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0)},afterLeave(n){i(n)},leaveCancelled(n){i(n)}};return(n,S)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(a).b()},e.toHandlers(o)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16,["name"]))}}),ce=ie;const de=s.withInstall(ce),Q="rootMenu",R="subMenu:";function te(t,a){const i=e.computed(()=>{let o=t.parent;const n=[a.value];for(;o.type.name!=="ElMenu";)o.props.index&&n.unshift(o.props.index),o=o.parent;return n});return{parentMenu:e.computed(()=>{let o=t.parent;for(;o&&!["ElMenu","ElSubMenu"].includes(o.type.name);)o=o.parent;return o}),indexPath:i}}function pe(t){return e.computed(()=>{const a=t.backgroundColor;return a?new se.TinyColor(a).shade(20).toString():""})}const ne=(t,a)=>{const i=s.useNamespace("menu");return e.computed(()=>i.cssVarBlock({"text-color":t.textColor||"","hover-text-color":t.textColor||"","bg-color":t.backgroundColor||"","hover-bg-color":pe(t).value||"","active-color":t.activeTextColor||"",level:`${a}`}))},me=s.buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:{type:s.definePropType([String,Array,Object,Boolean]),default:void 0},popperStyle:{type:s.definePropType([String,Array,Object,Boolean]),default:void 0},disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:P.iconPropType},expandOpenIcon:{type:P.iconPropType},collapseCloseIcon:{type:P.iconPropType},collapseOpenIcon:{type:P.iconPropType}}),K="ElSubMenu";var X=e.defineComponent({name:K,props:me,setup(t,{slots:a,expose:i}){const o=e.getCurrentInstance(),{indexPath:n,parentMenu:S}=te(o,e.computed(()=>t.index)),p=s.useNamespace("menu"),I=s.useNamespace("sub-menu"),u=e.inject(Q);u||s.throwError(K,"can not inject root menu");const v=e.inject(`${R}${S.value.uid}`);v||s.throwError(K,"can not inject sub menu");const k=e.ref({}),M=e.ref({});let m;const g=e.ref(!1),_=e.ref(),C=e.ref(),O=e.computed(()=>v.level===0),V=e.computed(()=>w.value==="horizontal"&&O.value?"bottom-start":"right-start"),N=e.computed(()=>w.value==="horizontal"&&O.value||w.value==="vertical"&&!u.props.collapse?t.expandCloseIcon&&t.expandOpenIcon?x.value?t.expandOpenIcon:t.expandCloseIcon:H.arrow_down_default:t.collapseCloseIcon&&t.collapseOpenIcon?x.value?t.collapseOpenIcon:t.collapseCloseIcon:H.arrow_right_default),B=e.computed(()=>{const c=t.teleported;return s.isUndefined(c)?O.value:c}),j=e.computed(()=>u.props.collapse?`${p.namespace.value}-zoom-in-left`:`${p.namespace.value}-zoom-in-top`),U=e.computed(()=>w.value==="horizontal"&&O.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),x=e.computed(()=>u.openedMenus.includes(t.index)),$=e.computed(()=>[...Object.values(k.value),...Object.values(M.value)].some(({active:c})=>c)),w=e.computed(()=>u.props.mode),q=e.computed(()=>u.props.persistent),D=e.reactive({index:t.index,indexPath:n,active:$}),L=ne(u.props,v.level+1),F=e.computed(()=>t.popperOffset??u.props.popperOffset),z=e.computed(()=>t.popperClass??u.props.popperClass),A=e.computed(()=>t.popperStyle??u.props.popperStyle),W=e.computed(()=>t.showTimeout??u.props.showTimeout),G=e.computed(()=>t.hideTimeout??u.props.hideTimeout),l=()=>{var c,b,f;return(f=(b=(c=C.value)==null?void 0:c.popperRef)==null?void 0:b.popperInstanceRef)==null?void 0:f.destroy()},r=c=>{c||l()},d=()=>{u.props.menuTrigger==="hover"&&u.props.mode==="horizontal"||u.props.collapse&&u.props.mode==="vertical"||t.disabled||u.handleSubMenuClick({index:t.index,indexPath:n.value,active:$.value})},y=(c,b=W.value)=>{var f;if(c.type!=="focus"){if(u.props.menuTrigger==="click"&&u.props.mode==="horizontal"||!u.props.collapse&&u.props.mode==="vertical"||t.disabled){v.mouseInChild.value=!0;return}v.mouseInChild.value=!0,m==null||m(),{stop:m}=s.useTimeoutFn(()=>{u.openMenu(t.index,n.value)},b),B.value&&((f=S.value.vnode.el)==null||f.dispatchEvent(new MouseEvent("mouseenter"))),c.type==="mouseenter"&&c.target&&e.nextTick(()=>{s.focusElement(c.target,{preventScroll:!0})})}},h=(c=!1)=>{var b;if(u.props.menuTrigger==="click"&&u.props.mode==="horizontal"||!u.props.collapse&&u.props.mode==="vertical"){v.mouseInChild.value=!1;return}m==null||m(),v.mouseInChild.value=!1,{stop:m}=s.useTimeoutFn(()=>!g.value&&u.closeMenu(t.index,n.value),G.value),B.value&&c&&((b=v.handleMouseleave)==null||b.call(v,!0))};e.watch(()=>u.props.collapse,c=>r(!!c));{const c=f=>{M.value[f.index]=f},b=f=>{delete M.value[f.index]};e.provide(`${R}${o.uid}`,{addSubMenu:c,removeSubMenu:b,handleMouseleave:h,mouseInChild:g,level:v.level+1})}return i({opened:x}),e.onMounted(()=>{u.addSubMenu(D),v.addSubMenu(D)}),e.onBeforeUnmount(()=>{v.removeSubMenu(D),u.removeSubMenu(D)}),()=>{var f;const c=[(f=a.title)==null?void 0:f.call(a),e.h(H.ElIcon,{class:I.e("icon-arrow"),style:{transform:x.value?t.expandCloseIcon&&t.expandOpenIcon||t.collapseCloseIcon&&t.collapseOpenIcon&&u.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>s.isString(N.value)?e.h(o.appContext.components[N.value]):e.h(N.value)})],b=u.isMenuPopup?e.h(E.ElTooltip,{ref:C,visible:x.value,effect:"light",pure:!0,offset:F.value,showArrow:!1,persistent:q.value,popperClass:z.value,popperStyle:A.value,placement:V.value,teleported:B.value,fallbackPlacements:U.value,transition:j.value,gpuAcceleration:!1},{content:()=>{var T;return e.h("div",{class:[p.m(w.value),p.m("popup-container"),z.value],onMouseenter:J=>y(J,100),onMouseleave:()=>h(!0),onFocus:J=>y(J,100)},[e.h("ul",{class:[p.b(),p.m("popup"),p.m(`popup-${V.value}`)],style:L.value},[(T=a.default)==null?void 0:T.call(a)])])},default:()=>e.h("div",{class:I.e("title"),onClick:d},c)}):e.h(e.Fragment,{},[e.h("div",{class:I.e("title"),ref:_,onClick:d},c),e.h(de,{},{default:()=>{var T;return e.withDirectives(e.h("ul",{role:"menu",class:[p.b(),p.m("inline")],style:L.value},[(T=a.default)==null?void 0:T.call(a)]),[[e.vShow,x.value]])}})]);return e.h("li",{class:[I.b(),I.is("active",$.value),I.is("opened",x.value),I.is("disabled",t.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:x.value,onMouseenter:y,onMouseleave:()=>h(),onFocus:y},[b])}}}),fe=class{constructor(t,a){this.parent=t,this.domNode=a,this.subIndex=0,this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(t){t===this.subMenuItems.length?t=0:t<0&&(t=this.subMenuItems.length-1),this.subMenuItems[t].focus(),this.subIndex=t}addListeners(){const t=this.parent.domNode;this.subMenuItems.forEach(a=>{a.addEventListener("keydown",i=>{const o=E.getEventCode(i);let n=!1;switch(o){case E.EVENT_CODE.down:this.gotoSubIndex(this.subIndex+1),n=!0;break;case E.EVENT_CODE.up:this.gotoSubIndex(this.subIndex-1),n=!0;break;case E.EVENT_CODE.tab:s.triggerEvent(t,"mouseleave");break;case E.EVENT_CODE.enter:case E.EVENT_CODE.numpadEnter:case E.EVENT_CODE.space:n=!0,i.currentTarget.click();break}return n&&(i.preventDefault(),i.stopPropagation()),!1})})}},ve=class{constructor(t,a){this.domNode=t,this.submenu=null,this.init(a)}init(t){this.domNode.setAttribute("tabindex","0");const a=this.domNode.querySelector(`.${t}-menu`);a&&(this.submenu=new fe(this,a)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",t=>{var o,n;const a=E.getEventCode(t);let i=!1;switch(a){case E.EVENT_CODE.down:s.triggerEvent(t.currentTarget,"mouseenter"),(o=this.submenu)==null||o.gotoSubIndex(0),i=!0;break;case E.EVENT_CODE.up:s.triggerEvent(t.currentTarget,"mouseenter"),(n=this.submenu)==null||n.gotoSubIndex(this.submenu.subMenuItems.length-1),i=!0;break;case E.EVENT_CODE.tab:s.triggerEvent(t.currentTarget,"mouseleave");break;case E.EVENT_CODE.enter:case E.EVENT_CODE.numpadEnter:case E.EVENT_CODE.space:i=!0,t.currentTarget.click();break}i&&t.preventDefault()})}},he=class{constructor(t,a){this.domNode=t,this.init(a)}init(t){const a=this.domNode.childNodes;Array.from(a).forEach(i=>{i.nodeType===1&&new ve(i,t)})}},ge=e.defineComponent({name:"ElMenuCollapseTransition",__name:"menu-collapse-transition",setup(t){const a=s.useNamespace("menu"),i={onBeforeEnter:o=>o.style.opacity="0.2",onEnter(o,n){s.addClass(o,`${a.namespace.value}-opacity-transition`),o.style.opacity="1",n()},onAfterEnter(o){s.removeClass(o,`${a.namespace.value}-opacity-transition`),o.style.opacity=""},onBeforeLeave(o){o.dataset||(o.dataset={}),s.hasClass(o,a.m("collapse"))?(s.removeClass(o,a.m("collapse")),o.dataset.oldOverflow=o.style.overflow,o.dataset.scrollWidth=o.clientWidth.toString(),s.addClass(o,a.m("collapse"))):(s.addClass(o,a.m("collapse")),o.dataset.oldOverflow=o.style.overflow,o.dataset.scrollWidth=o.clientWidth.toString(),s.removeClass(o,a.m("collapse"))),o.style.width=`${o.scrollWidth}px`,o.style.overflow="hidden"},onLeave(o){s.addClass(o,"horizontal-collapse-transition"),o.style.width=`${o.dataset.scrollWidth}px`}};return(o,n)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({mode:"out-in"},i),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),ye=ge;const be=s.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:s.definePropType(Array),default:()=>re.mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:P.iconPropType,default:()=>H.more_default},popperEffect:{type:s.definePropType(String),default:"dark"},popperClass:{type:s.definePropType([String,Array,Object,Boolean]),default:void 0},popperStyle:{type:s.definePropType([String,Array,Object,Boolean]),default:void 0},showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},persistent:{type:Boolean,default:!0}}),Y=t=>s.isArray(t)&&t.every(a=>s.isString(a)),Ee={close:(t,a)=>s.isString(t)&&Y(a),open:(t,a)=>s.isString(t)&&Y(a),select:(t,a,i,o)=>s.isString(t)&&Y(a)&&s.isObject(i)&&(s.isUndefined(o)||o instanceof Promise)},ee=64;var Me=e.defineComponent({name:"ElMenu",props:be,emits:Ee,setup(t,{emit:a,slots:i,expose:o}){const n=e.getCurrentInstance(),S=n.appContext.config.globalProperties.$router,p=e.ref(),I=e.ref(),u=s.useNamespace("menu"),v=s.useNamespace("sub-menu");let k=ee;const M=e.ref(-1),m=e.ref(t.defaultOpeneds&&!t.collapse?t.defaultOpeneds.slice(0):[]),g=e.ref(t.defaultActive),_=e.ref({}),C=e.ref({}),O=e.computed(()=>t.mode==="horizontal"||t.mode==="vertical"&&t.collapse),V=()=>{const l=g.value&&_.value[g.value];!l||t.mode==="horizontal"||t.collapse||l.indexPath.forEach(r=>{const d=C.value[r];d&&N(r,d.indexPath)})},N=(l,r)=>{m.value.includes(l)||(t.uniqueOpened&&(m.value=m.value.filter(d=>r.includes(d))),m.value.push(l),a("open",l,r))},B=l=>{const r=m.value.indexOf(l);r!==-1&&m.value.splice(r,1)},j=(l,r)=>{B(l),a("close",l,r)},U=({index:l,indexPath:r})=>{m.value.includes(l)?j(l,r):N(l,r)},x=l=>{(t.mode==="horizontal"||t.collapse)&&(m.value=[]);const{index:r,indexPath:d}=l;if(!(s.isNil(r)||s.isNil(d)))if(t.router&&S){const y=l.route||r,h=S.push(y).then(c=>(c||(g.value=r),c));a("select",r,d,{index:r,indexPath:d,route:y},h)}else g.value=r,a("select",r,d,{index:r,indexPath:d})},$=l=>{var d;const r=_.value;g.value=((d=r[l]||g.value&&r[g.value]||r[t.defaultActive])==null?void 0:d.index)??l},w=l=>{const r=getComputedStyle(l),d=Number.parseInt(r.marginLeft,10),y=Number.parseInt(r.marginRight,10);return l.offsetWidth+d+y||0},q=()=>{if(!p.value)return-1;const l=Array.from(p.value.childNodes).filter(f=>f.nodeName!=="#comment"&&(f.nodeName!=="#text"||f.nodeValue)),r=getComputedStyle(p.value),d=Number.parseInt(r.paddingLeft,10),y=Number.parseInt(r.paddingRight,10),h=p.value.clientWidth-d-y;let c=0,b=0;return l.forEach((f,T)=>{c+=w(f),c<=h-k&&(b=T+1)}),b===l.length?-1:b},D=l=>C.value[l].indexPath,L=(l,r=33.34)=>{let d;return()=>{d&&clearTimeout(d),d=setTimeout(()=>{l()},r)}};let F=!0;const z=()=>{const l=P.unrefElement(I);if(l&&(k=w(l)||ee),M.value===q())return;const r=()=>{M.value=-1,e.nextTick(()=>{M.value=q()})};F?r():L(r)(),F=!1};e.watch(()=>t.defaultActive,l=>{_.value[l]||(g.value=""),$(l)}),e.watch(()=>t.collapse,l=>{l&&(m.value=[])}),e.watch(_.value,V);let A;e.watchEffect(()=>{t.mode==="horizontal"&&t.ellipsis?A=P.useResizeObserver(p,z).stop:A==null||A()});const W=e.ref(!1);{const l=h=>{C.value[h.index]=h},r=h=>{delete C.value[h.index]},d=h=>{_.value[h.index]=h},y=h=>{delete _.value[h.index]};e.provide(Q,e.reactive({props:t,openedMenus:m,items:_,subMenus:C,activeIndex:g,isMenuPopup:O,addMenuItem:d,removeMenuItem:y,addSubMenu:l,removeSubMenu:r,openMenu:N,closeMenu:j,handleMenuItemClick:x,handleSubMenuClick:U})),e.provide(`${R}${n.uid}`,{addSubMenu:l,removeSubMenu:r,mouseInChild:W,level:0})}e.onMounted(()=>{t.mode==="horizontal"&&new he(n.vnode.el,u.namespace.value)}),o({open:r=>{const{indexPath:d}=C.value[r];d.forEach(y=>N(y,d))},close:B,updateActiveIndex:$,handleResize:z});const G=ne(t,0);return()=>{var h;let l=((h=i.default)==null?void 0:h.call(i))??[];const r=[];if(t.mode==="horizontal"&&p.value){const c=le.flattedChildren(l).filter(T=>(T==null?void 0:T.shapeFlag)!==8),b=M.value===-1?c:c.slice(0,M.value),f=M.value===-1?[]:c.slice(M.value);f!=null&&f.length&&t.ellipsis&&(l=b,r.push(e.h(X,{ref:I,index:"sub-menu-more",class:v.e("hide-arrow"),popperOffset:t.popperOffset},{title:()=>e.h(H.ElIcon,{class:v.e("icon-more")},{default:()=>e.h(t.ellipsisIcon)}),default:()=>f})))}const d=t.closeOnClickOutside?[[ue.ClickOutside,()=>{m.value.length&&(W.value||(m.value.forEach(c=>a("close",c,D(c))),m.value=[]))}]]:[],y=e.withDirectives(e.h("ul",{key:String(t.collapse),role:"menubar",ref:p,style:G.value,class:{[u.b()]:!0,[u.m(t.mode)]:!0,[u.m("collapse")]:t.collapse}},[...l,...r]),d);return t.collapseTransition&&t.mode==="vertical"?e.h(ye,()=>y):y}}});const Ce=s.buildProps({index:{type:String,required:!0},route:{type:s.definePropType([String,Object])},disabled:Boolean}),Ie={click:t=>s.isString(t.index)&&s.isArray(t.indexPath)},_e={title:String},Z="ElMenuItem";var Te=e.defineComponent({name:Z,__name:"menu-item",props:Ce,emits:Ie,setup(t,{expose:a,emit:i}){const o=t,n=i,S=e.getCurrentInstance(),p=e.inject(Q),I=s.useNamespace("menu"),u=s.useNamespace("menu-item");p||s.throwError(Z,"can not inject root menu");const{parentMenu:v,indexPath:k}=te(S,e.toRef(o,"index")),M=e.inject(`${R}${v.value.uid}`);M||s.throwError(Z,"can not inject sub menu");const m=e.computed(()=>o.index===p.activeIndex),g=e.reactive({index:o.index,indexPath:k,active:m}),_=()=>{o.disabled||(p.handleMenuItemClick({index:o.index,indexPath:k.value,route:o.route}),n("click",g))};return e.onMounted(()=>{M.addSubMenu(g),p.addMenuItem(g)}),e.onBeforeUnmount(()=>{M.removeSubMenu(g),p.removeMenuItem(g)}),a({parentMenu:v,rootMenu:p,active:m,nsMenu:I,nsMenuItem:u,handleClick:_}),(C,O)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([e.unref(u).b(),e.unref(u).is("active",m.value),e.unref(u).is("disabled",t.disabled)]),role:"menuitem",tabindex:"-1",onClick:_},[e.unref(v).type.name==="ElMenu"&&e.unref(p).props.collapse&&C.$slots.title?(e.openBlock(),e.createBlock(e.unref(E.ElTooltip),{key:0,effect:e.unref(p).props.popperEffect,placement:"right","fallback-placements":["left"],"popper-class":e.unref(p).props.popperClass,"popper-style":e.unref(p).props.popperStyle,persistent:e.unref(p).props.persistent,"focus-on-target":""},{content:e.withCtx(()=>[e.renderSlot(C.$slots,"title")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(I).be("tooltip","trigger"))},[e.renderSlot(C.$slots,"default")],2)]),_:3},8,["effect","popper-class","popper-style","persistent"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(C.$slots,"default"),e.renderSlot(C.$slots,"title")],64))],2))}}),oe=Te,xe=e.defineComponent({name:"ElMenuItemGroup",__name:"menu-item-group",props:_e,setup(t){const a=s.useNamespace("menu-item-group");return(i,o)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(e.unref(a).b())},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(a).e("title"))},[i.$slots.title?e.renderSlot(i.$slots,"title",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.title),1)],64))],2),e.createElementVNode("ul",null,[e.renderSlot(i.$slots,"default")])],2))}}),ae=xe;const Se=s.withInstall(Me,{MenuItem:oe,MenuItemGroup:ae,SubMenu:X}),Ne=s.withNoopInstall(oe);s.withNoopInstall(ae);s.withNoopInstall(X);exports.ElMenu=Se;exports.ElMenuItem=Ne;