st-comp 0.0.173 → 0.0.175

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 (76) hide show
  1. package/es/ChartLayout.js +3 -3
  2. package/es/Dialog.js +14 -14
  3. package/es/FactorWarning.cjs +1 -1
  4. package/es/FactorWarning.js +337 -817
  5. package/es/Kline.js +16 -16
  6. package/es/KlineBasic.js +26 -26
  7. package/es/KlineConfig.cjs +1 -1
  8. package/es/KlineConfig.js +41 -40
  9. package/es/KlineNew.js +14 -14
  10. package/es/KlinePlus.js +17 -17
  11. package/es/Pagination.js +19 -19
  12. package/es/PasswordPrompt.js +3 -3
  13. package/es/Table.js +21 -21
  14. package/es/User.js +39 -39
  15. package/es/VarSelectDialog.cjs +2 -2
  16. package/es/VarSelectDialog.js +173 -169
  17. package/es/VarietySearch.cjs +6 -6
  18. package/es/VarietySearch.js +1055 -1033
  19. package/es/VirtualTable.js +494 -494
  20. package/es/{_initCloneObject-a9305c1e.js → _initCloneObject-da90eef0.js} +3 -3
  21. package/es/{base-4bcd2756.js → base-d9284bf0.js} +23 -23
  22. package/es/{castArray-681d750b.js → castArray-b0ab0165.js} +1 -1
  23. package/es/{config-provider-93846ae3.js → config-provider-f0151e9f.js} +10 -10
  24. package/es/{debounce-51046b06.js → debounce-3cec4646.js} +1 -1
  25. package/es/{dropdown-65e74de8.js → dropdown-82b80e8b.js} +6 -6
  26. package/es/{el-button-d39472d3.js → el-button-34665425.js} +9 -9
  27. package/es/{el-dialog-f45ec2a1.js → el-dialog-a412484e.js} +17 -17
  28. package/es/{el-divider-7cf13678.js → el-divider-fd2b4e2e.js} +4 -4
  29. package/es/{el-empty-64b2ea8a.js → el-empty-412fc297.js} +2 -2
  30. package/es/{el-form-item-b31e7a98.js → el-form-item-668ba024.js} +65 -65
  31. package/es/{el-input-42315ac4.js → el-input-22e66e37.js} +22 -22
  32. package/es/{el-input-number-ebd64e22.js → el-input-number-481e21c5.js} +26 -26
  33. package/es/{el-loading-5d29f26d.js → el-loading-d4e403ab.js} +5 -5
  34. package/es/{el-menu-item-d62e0a3f.js → el-menu-item-404c10e5.js} +8 -8
  35. package/es/el-message-box-41f39f6d.js +558 -0
  36. package/es/el-message-box-6694f827.cjs +1 -0
  37. package/es/{el-message-bd1d2c82.js → el-message-ef506caa.js} +24 -24
  38. package/es/{el-overlay-690b50aa.js → el-overlay-4a9fa4e1.js} +30 -30
  39. package/es/{el-popconfirm-88bbd066.js → el-popconfirm-7b9183aa.js} +6 -6
  40. package/es/{el-popper-85365d5b.js → el-popper-e73466eb.js} +5 -5
  41. package/es/{el-scrollbar-bcf29780.js → el-scrollbar-45318df0.js} +8 -8
  42. package/es/el-segmented-3ba6d664.cjs +1 -0
  43. package/es/el-segmented-41820018.js +135 -0
  44. package/es/{el-select-d3bce4d1.js → el-select-d7a00294.js} +13 -13
  45. package/es/{el-table-column-9691b26d.js → el-table-column-a2d0c635.js} +122 -122
  46. package/es/{el-tag-6036f51c.js → el-tag-7f391090.js} +32 -32
  47. package/es/{index-d3c37134.js → index-1c41bd56.js} +3 -3
  48. package/es/index-3120be08.js +14 -0
  49. package/es/{index-fbe85773.js → index-85a32a00.js} +15 -15
  50. package/es/{index-21fb27eb.js → index-94f38460.js} +19 -19
  51. package/es/{index-ef7c4392.js → index-a8e9ec0f.js} +23 -23
  52. package/es/{index-cb8157f2.js → index-d577b81b.js} +2 -2
  53. package/es/{index-8ee89b40.js → index-d99fdc6d.js} +8 -8
  54. package/es/{index-3425f2f0.js → index-ee1cebbc.js} +5 -5
  55. package/es/{raf-36faa519.js → raf-bfbf42e4.js} +1 -1
  56. package/es/{scroll-0277d145.js → scroll-e3cb691f.js} +2 -2
  57. package/es/style.css +1 -1
  58. package/es/{use-form-common-props-54c31983.js → use-form-common-props-cc347a83.js} +36 -36
  59. package/es/{use-global-config-946f61a4.js → use-global-config-c7f0a7e3.js} +3 -3
  60. package/es/validator-10fa54fe.js +5 -0
  61. package/es/validator-af488a9a.cjs +1 -0
  62. package/es/{vnode-dfc92f20.js → vnode-6be33bb1.js} +1 -1
  63. package/es/{zh-cn-5066f5e9.js → zh-cn-d883afa8.js} +2 -2
  64. package/lib/bundle.js +1 -1
  65. package/lib/bundle.umd.cjs +172 -172
  66. package/lib/{index-c35886c2.js → index-d3f4c395.js} +11045 -11020
  67. package/lib/{python-37ee7d62.js → python-0128b724.js} +1 -1
  68. package/lib/style.css +1 -1
  69. package/package.json +1 -1
  70. package/packages/VarSelectDialog/index.vue +5 -1
  71. package/packages/VarietySearch/components/FactorScreen/index.vue +271 -254
  72. package/es/el-checkbox-group-020b49f5.cjs +0 -1
  73. package/es/el-checkbox-group-779f353a.js +0 -67
  74. package/es/el-segmented-84707138.js +0 -136
  75. package/es/el-segmented-bccd9f2a.cjs +0 -1
  76. package/es/index-c45ac024.js +0 -14
@@ -0,0 +1,558 @@
1
+ import { defineComponent as Y, ref as B, computed as E, useAttrs as ke, onMounted as me, onUpdated as Me, openBlock as p, createBlock as b, resolveDynamicComponent as V, normalizeClass as r, unref as Se, normalizeStyle as X, withCtx as h, renderSlot as pe, nextTick as P, reactive as Ie, markRaw as se, watch as ae, onBeforeUnmount as Ae, toRefs as Le, resolveComponent as I, Transition as Re, withDirectives as j, createVNode as T, createElementVNode as y, withModifiers as N, createElementBlock as q, createCommentVNode as A, toDisplayString as O, withKeys as K, createTextVNode as W, vShow as G, isVNode as ve, render as ge } from "vue";
2
+ import { b as $e, u as ze, x as Z, _ as he, w as Oe, y as J, i as _, p as Ve, z as le, e as Pe, A as ie, n as De } from "./base-d9284bf0.js";
3
+ import { e as He, a as Fe, T as Ne, g as re } from "./use-form-common-props-cc347a83.js";
4
+ import { E as Ke } from "./el-button-34665425.js";
5
+ import { E as Ue } from "./el-input-22e66e37.js";
6
+ import { E as je, b as qe, c as We } from "./el-overlay-4a9fa4e1.js";
7
+ import { E as Ge, l as ue } from "./index-ee1cebbc.js";
8
+ import { o as ce, E as Xe, b as Ze } from "./index-94f38460.js";
9
+ import { i as Je } from "./validator-10fa54fe.js";
10
+ import { u as Qe } from "./use-global-config-c7f0a7e3.js";
11
+ import { a as de } from "./index-a8e9ec0f.js";
12
+ import { u as Ye } from "./el-dialog-a412484e.js";
13
+ const _e = $e({
14
+ type: {
15
+ type: String,
16
+ values: ["primary", "success", "info", "warning", "danger", ""],
17
+ default: ""
18
+ },
19
+ size: {
20
+ type: String,
21
+ values: He,
22
+ default: ""
23
+ },
24
+ truncated: Boolean,
25
+ lineClamp: {
26
+ type: [String, Number]
27
+ },
28
+ tag: {
29
+ type: String,
30
+ default: "span"
31
+ }
32
+ }), xe = Y({
33
+ name: "ElText"
34
+ }), en = /* @__PURE__ */ Y({
35
+ ...xe,
36
+ props: _e,
37
+ setup(e) {
38
+ const t = e, o = B(), i = Fe(), a = ze("text"), s = E(() => [
39
+ a.b(),
40
+ a.m(t.type),
41
+ a.m(i.value),
42
+ a.is("truncated", t.truncated),
43
+ a.is("line-clamp", !Z(t.lineClamp))
44
+ ]), u = ke().title, f = () => {
45
+ var c, n, M, S, d;
46
+ if (u)
47
+ return;
48
+ let R = !1;
49
+ const U = ((c = o.value) == null ? void 0 : c.textContent) || "";
50
+ if (t.truncated) {
51
+ const m = (n = o.value) == null ? void 0 : n.offsetWidth, C = (M = o.value) == null ? void 0 : M.scrollWidth;
52
+ m && C && C > m && (R = !0);
53
+ } else if (!Z(t.lineClamp)) {
54
+ const m = (S = o.value) == null ? void 0 : S.offsetHeight, C = (d = o.value) == null ? void 0 : d.scrollHeight;
55
+ m && C && C > m && (R = !0);
56
+ }
57
+ R ? o.value.setAttribute("title", U) : o.value.removeAttribute("title");
58
+ };
59
+ return me(f), Me(f), (c, n) => (p(), b(V(c.tag), {
60
+ ref_key: "textRef",
61
+ ref: o,
62
+ class: r(Se(s)),
63
+ style: X({ "-webkit-line-clamp": c.lineClamp })
64
+ }, {
65
+ default: h(() => [
66
+ pe(c.$slots, "default")
67
+ ]),
68
+ _: 3
69
+ }, 8, ["class", "style"]));
70
+ }
71
+ });
72
+ var nn = /* @__PURE__ */ he(en, [["__file", "text.vue"]]);
73
+ const Mn = Oe(nn), Q = "_trap-focus-children", k = [], fe = (e) => {
74
+ var t;
75
+ if (k.length === 0)
76
+ return;
77
+ const o = k[k.length - 1][Q];
78
+ if (o.length > 0 && e.code === Xe.tab) {
79
+ if (o.length === 1) {
80
+ e.preventDefault(), document.activeElement !== o[0] && o[0].focus();
81
+ return;
82
+ }
83
+ const i = e.shiftKey, a = e.target === o[0], s = e.target === o[o.length - 1];
84
+ if (a && i && (e.preventDefault(), o[o.length - 1].focus()), s && !i && (e.preventDefault(), o[0].focus()), process.env.NODE_ENV === "test") {
85
+ const u = o.indexOf(e.target);
86
+ u !== -1 && ((t = o[i ? u - 1 : u + 1]) == null || t.focus());
87
+ }
88
+ }
89
+ }, on = {
90
+ beforeMount(e) {
91
+ e[Q] = ce(e), k.push(e), k.length <= 1 && document.addEventListener("keydown", fe);
92
+ },
93
+ updated(e) {
94
+ P(() => {
95
+ e[Q] = ce(e);
96
+ });
97
+ },
98
+ unmounted() {
99
+ k.shift(), k.length === 0 && document.removeEventListener("keydown", fe);
100
+ }
101
+ }, tn = Y({
102
+ name: "ElMessageBox",
103
+ directives: {
104
+ TrapFocus: on
105
+ },
106
+ components: {
107
+ ElButton: Ke,
108
+ ElFocusTrap: Ze,
109
+ ElInput: Ue,
110
+ ElOverlay: je,
111
+ ElIcon: Ge,
112
+ ...Ne
113
+ },
114
+ inheritAttrs: !1,
115
+ props: {
116
+ buttonSize: {
117
+ type: String,
118
+ validator: Je
119
+ },
120
+ modal: {
121
+ type: Boolean,
122
+ default: !0
123
+ },
124
+ lockScroll: {
125
+ type: Boolean,
126
+ default: !0
127
+ },
128
+ showClose: {
129
+ type: Boolean,
130
+ default: !0
131
+ },
132
+ closeOnClickModal: {
133
+ type: Boolean,
134
+ default: !0
135
+ },
136
+ closeOnPressEscape: {
137
+ type: Boolean,
138
+ default: !0
139
+ },
140
+ closeOnHashChange: {
141
+ type: Boolean,
142
+ default: !0
143
+ },
144
+ center: Boolean,
145
+ draggable: Boolean,
146
+ overflow: Boolean,
147
+ roundButton: {
148
+ default: !1,
149
+ type: Boolean
150
+ },
151
+ container: {
152
+ type: String,
153
+ default: "body"
154
+ },
155
+ boxType: {
156
+ type: String,
157
+ default: ""
158
+ }
159
+ },
160
+ emits: ["vanish", "action"],
161
+ setup(e, { emit: t }) {
162
+ const {
163
+ locale: o,
164
+ zIndex: i,
165
+ ns: a,
166
+ size: s
167
+ } = Qe("message-box", E(() => e.buttonSize)), { t: u } = o, { nextZIndex: f } = i, c = B(!1), n = Ie({
168
+ autofocus: !0,
169
+ beforeClose: null,
170
+ callback: null,
171
+ cancelButtonText: "",
172
+ cancelButtonClass: "",
173
+ confirmButtonText: "",
174
+ confirmButtonClass: "",
175
+ customClass: "",
176
+ customStyle: {},
177
+ dangerouslyUseHTMLString: !1,
178
+ distinguishCancelAndClose: !1,
179
+ icon: "",
180
+ inputPattern: null,
181
+ inputPlaceholder: "",
182
+ inputType: "text",
183
+ inputValue: "",
184
+ inputValidator: void 0,
185
+ inputErrorMessage: "",
186
+ message: "",
187
+ modalFade: !0,
188
+ modalClass: "",
189
+ showCancelButton: !1,
190
+ showConfirmButton: !0,
191
+ type: "",
192
+ title: void 0,
193
+ showInput: !1,
194
+ action: "",
195
+ confirmButtonLoading: !1,
196
+ cancelButtonLoading: !1,
197
+ confirmButtonLoadingIcon: se(ue),
198
+ cancelButtonLoadingIcon: se(ue),
199
+ confirmButtonDisabled: !1,
200
+ editorErrorMessage: "",
201
+ validateError: !1,
202
+ zIndex: f()
203
+ }), M = E(() => {
204
+ const l = n.type;
205
+ return { [a.bm("icon", l)]: l && re[l] };
206
+ }), S = de(), d = de(), R = E(() => {
207
+ const l = n.type;
208
+ return n.icon || l && re[l] || "";
209
+ }), U = E(() => !!n.message), m = B(), C = B(), $ = B(), H = B(), x = B(), ye = E(() => n.confirmButtonClass);
210
+ ae(() => n.inputValue, async (l) => {
211
+ await P(), e.boxType === "prompt" && l !== null && ne();
212
+ }, { immediate: !0 }), ae(() => c.value, (l) => {
213
+ var v, g;
214
+ l && (e.boxType !== "prompt" && (n.autofocus ? $.value = (g = (v = x.value) == null ? void 0 : v.$el) != null ? g : m.value : $.value = m.value), n.zIndex = f()), e.boxType === "prompt" && (l ? P().then(() => {
215
+ var te;
216
+ H.value && H.value.$el && (n.autofocus ? $.value = (te = Be()) != null ? te : m.value : $.value = m.value);
217
+ }) : (n.editorErrorMessage = "", n.validateError = !1));
218
+ });
219
+ const be = E(() => e.draggable), Ce = E(() => e.overflow);
220
+ Ye(m, C, be, Ce), me(async () => {
221
+ await P(), e.closeOnHashChange && window.addEventListener("hashchange", z);
222
+ }), Ae(() => {
223
+ e.closeOnHashChange && window.removeEventListener("hashchange", z);
224
+ });
225
+ function z() {
226
+ c.value && (c.value = !1, P(() => {
227
+ n.action && t("action", n.action);
228
+ }));
229
+ }
230
+ const ee = () => {
231
+ e.closeOnClickModal && F(n.distinguishCancelAndClose ? "close" : "cancel");
232
+ }, Ee = We(ee), we = (l) => {
233
+ if (n.inputType !== "textarea")
234
+ return l.preventDefault(), F("confirm");
235
+ }, F = (l) => {
236
+ var v;
237
+ e.boxType === "prompt" && l === "confirm" && !ne() || (n.action = l, n.beforeClose ? (v = n.beforeClose) == null || v.call(n, l, n, z) : z());
238
+ }, ne = () => {
239
+ if (e.boxType === "prompt") {
240
+ const l = n.inputPattern;
241
+ if (l && !l.test(n.inputValue || ""))
242
+ return n.editorErrorMessage = n.inputErrorMessage || u("el.messagebox.error"), n.validateError = !0, !1;
243
+ const v = n.inputValidator;
244
+ if (J(v)) {
245
+ const g = v(n.inputValue);
246
+ if (g === !1)
247
+ return n.editorErrorMessage = n.inputErrorMessage || u("el.messagebox.error"), n.validateError = !0, !1;
248
+ if (_(g))
249
+ return n.editorErrorMessage = g, n.validateError = !0, !1;
250
+ }
251
+ }
252
+ return n.editorErrorMessage = "", n.validateError = !1, !0;
253
+ }, Be = () => {
254
+ var l, v;
255
+ const g = (l = H.value) == null ? void 0 : l.$refs;
256
+ return (v = g == null ? void 0 : g.input) != null ? v : g == null ? void 0 : g.textarea;
257
+ }, oe = () => {
258
+ F("close");
259
+ }, Te = () => {
260
+ e.closeOnPressEscape && oe();
261
+ };
262
+ return e.lockScroll && qe(c), {
263
+ ...Le(n),
264
+ ns: a,
265
+ overlayEvent: Ee,
266
+ visible: c,
267
+ hasMessage: U,
268
+ typeClass: M,
269
+ contentId: S,
270
+ inputId: d,
271
+ btnSize: s,
272
+ iconComponent: R,
273
+ confirmButtonClasses: ye,
274
+ rootRef: m,
275
+ focusStartRef: $,
276
+ headerRef: C,
277
+ inputRef: H,
278
+ confirmRef: x,
279
+ doClose: z,
280
+ handleClose: oe,
281
+ onCloseRequested: Te,
282
+ handleWrapperClick: ee,
283
+ handleInputEnter: we,
284
+ handleAction: F,
285
+ t: u
286
+ };
287
+ }
288
+ });
289
+ function sn(e, t, o, i, a, s) {
290
+ const u = I("el-icon"), f = I("close"), c = I("el-input"), n = I("el-button"), M = I("el-focus-trap"), S = I("el-overlay");
291
+ return p(), b(Re, {
292
+ name: "fade-in-linear",
293
+ onAfterLeave: (d) => e.$emit("vanish"),
294
+ persisted: ""
295
+ }, {
296
+ default: h(() => [
297
+ j(T(S, {
298
+ "z-index": e.zIndex,
299
+ "overlay-class": [e.ns.is("message-box"), e.modalClass],
300
+ mask: e.modal
301
+ }, {
302
+ default: h(() => [
303
+ y("div", {
304
+ role: "dialog",
305
+ "aria-label": e.title,
306
+ "aria-modal": "true",
307
+ "aria-describedby": e.showInput ? void 0 : e.contentId,
308
+ class: r(`${e.ns.namespace.value}-overlay-message-box`),
309
+ onClick: e.overlayEvent.onClick,
310
+ onMousedown: e.overlayEvent.onMousedown,
311
+ onMouseup: e.overlayEvent.onMouseup
312
+ }, [
313
+ T(M, {
314
+ loop: "",
315
+ trapped: e.visible,
316
+ "focus-trap-el": e.rootRef,
317
+ "focus-start-el": e.focusStartRef,
318
+ onReleaseRequested: e.onCloseRequested
319
+ }, {
320
+ default: h(() => [
321
+ y("div", {
322
+ ref: "rootRef",
323
+ class: r([
324
+ e.ns.b(),
325
+ e.customClass,
326
+ e.ns.is("draggable", e.draggable),
327
+ { [e.ns.m("center")]: e.center }
328
+ ]),
329
+ style: X(e.customStyle),
330
+ tabindex: "-1",
331
+ onClick: N(() => {
332
+ }, ["stop"])
333
+ }, [
334
+ e.title !== null && e.title !== void 0 ? (p(), q("div", {
335
+ key: 0,
336
+ ref: "headerRef",
337
+ class: r([e.ns.e("header"), { "show-close": e.showClose }])
338
+ }, [
339
+ y("div", {
340
+ class: r(e.ns.e("title"))
341
+ }, [
342
+ e.iconComponent && e.center ? (p(), b(u, {
343
+ key: 0,
344
+ class: r([e.ns.e("status"), e.typeClass])
345
+ }, {
346
+ default: h(() => [
347
+ (p(), b(V(e.iconComponent)))
348
+ ]),
349
+ _: 1
350
+ }, 8, ["class"])) : A("v-if", !0),
351
+ y("span", null, O(e.title), 1)
352
+ ], 2),
353
+ e.showClose ? (p(), q("button", {
354
+ key: 0,
355
+ type: "button",
356
+ class: r(e.ns.e("headerbtn")),
357
+ "aria-label": e.t("el.messagebox.close"),
358
+ onClick: (d) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"),
359
+ onKeydown: K(N((d) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])
360
+ }, [
361
+ T(u, {
362
+ class: r(e.ns.e("close"))
363
+ }, {
364
+ default: h(() => [
365
+ T(f)
366
+ ]),
367
+ _: 1
368
+ }, 8, ["class"])
369
+ ], 42, ["aria-label", "onClick", "onKeydown"])) : A("v-if", !0)
370
+ ], 2)) : A("v-if", !0),
371
+ y("div", {
372
+ id: e.contentId,
373
+ class: r(e.ns.e("content"))
374
+ }, [
375
+ y("div", {
376
+ class: r(e.ns.e("container"))
377
+ }, [
378
+ e.iconComponent && !e.center && e.hasMessage ? (p(), b(u, {
379
+ key: 0,
380
+ class: r([e.ns.e("status"), e.typeClass])
381
+ }, {
382
+ default: h(() => [
383
+ (p(), b(V(e.iconComponent)))
384
+ ]),
385
+ _: 1
386
+ }, 8, ["class"])) : A("v-if", !0),
387
+ e.hasMessage ? (p(), q("div", {
388
+ key: 1,
389
+ class: r(e.ns.e("message"))
390
+ }, [
391
+ pe(e.$slots, "default", {}, () => [
392
+ e.dangerouslyUseHTMLString ? (p(), b(V(e.showInput ? "label" : "p"), {
393
+ key: 1,
394
+ for: e.showInput ? e.inputId : void 0,
395
+ innerHTML: e.message
396
+ }, null, 8, ["for", "innerHTML"])) : (p(), b(V(e.showInput ? "label" : "p"), {
397
+ key: 0,
398
+ for: e.showInput ? e.inputId : void 0
399
+ }, {
400
+ default: h(() => [
401
+ W(O(e.dangerouslyUseHTMLString ? "" : e.message), 1)
402
+ ]),
403
+ _: 1
404
+ }, 8, ["for"]))
405
+ ])
406
+ ], 2)) : A("v-if", !0)
407
+ ], 2),
408
+ j(y("div", {
409
+ class: r(e.ns.e("input"))
410
+ }, [
411
+ T(c, {
412
+ id: e.inputId,
413
+ ref: "inputRef",
414
+ modelValue: e.inputValue,
415
+ "onUpdate:modelValue": (d) => e.inputValue = d,
416
+ type: e.inputType,
417
+ placeholder: e.inputPlaceholder,
418
+ "aria-invalid": e.validateError,
419
+ class: r({ invalid: e.validateError }),
420
+ onKeydown: K(e.handleInputEnter, ["enter"])
421
+ }, null, 8, ["id", "modelValue", "onUpdate:modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown"]),
422
+ y("div", {
423
+ class: r(e.ns.e("errormsg")),
424
+ style: X({
425
+ visibility: e.editorErrorMessage ? "visible" : "hidden"
426
+ })
427
+ }, O(e.editorErrorMessage), 7)
428
+ ], 2), [
429
+ [G, e.showInput]
430
+ ])
431
+ ], 10, ["id"]),
432
+ y("div", {
433
+ class: r(e.ns.e("btns"))
434
+ }, [
435
+ e.showCancelButton ? (p(), b(n, {
436
+ key: 0,
437
+ loading: e.cancelButtonLoading,
438
+ "loading-icon": e.cancelButtonLoadingIcon,
439
+ class: r([e.cancelButtonClass]),
440
+ round: e.roundButton,
441
+ size: e.btnSize,
442
+ onClick: (d) => e.handleAction("cancel"),
443
+ onKeydown: K(N((d) => e.handleAction("cancel"), ["prevent"]), ["enter"])
444
+ }, {
445
+ default: h(() => [
446
+ W(O(e.cancelButtonText || e.t("el.messagebox.cancel")), 1)
447
+ ]),
448
+ _: 1
449
+ }, 8, ["loading", "loading-icon", "class", "round", "size", "onClick", "onKeydown"])) : A("v-if", !0),
450
+ j(T(n, {
451
+ ref: "confirmRef",
452
+ type: "primary",
453
+ loading: e.confirmButtonLoading,
454
+ "loading-icon": e.confirmButtonLoadingIcon,
455
+ class: r([e.confirmButtonClasses]),
456
+ round: e.roundButton,
457
+ disabled: e.confirmButtonDisabled,
458
+ size: e.btnSize,
459
+ onClick: (d) => e.handleAction("confirm"),
460
+ onKeydown: K(N((d) => e.handleAction("confirm"), ["prevent"]), ["enter"])
461
+ }, {
462
+ default: h(() => [
463
+ W(O(e.confirmButtonText || e.t("el.messagebox.confirm")), 1)
464
+ ]),
465
+ _: 1
466
+ }, 8, ["loading", "loading-icon", "class", "round", "disabled", "size", "onClick", "onKeydown"]), [
467
+ [G, e.showConfirmButton]
468
+ ])
469
+ ], 2)
470
+ ], 14, ["onClick"])
471
+ ]),
472
+ _: 3
473
+ }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
474
+ ], 42, ["aria-label", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
475
+ ]),
476
+ _: 3
477
+ }, 8, ["z-index", "overlay-class", "mask"]), [
478
+ [G, e.visible]
479
+ ])
480
+ ]),
481
+ _: 3
482
+ }, 8, ["onAfterLeave"]);
483
+ }
484
+ var an = /* @__PURE__ */ he(tn, [["render", sn], ["__file", "index.vue"]]);
485
+ const D = /* @__PURE__ */ new Map(), ln = (e) => {
486
+ let t = document.body;
487
+ return e.appendTo && (_(e.appendTo) && (t = document.querySelector(e.appendTo)), ie(e.appendTo) && (t = e.appendTo), ie(t) || (De("ElMessageBox", "the appendTo option is not an HTMLElement. Falling back to document.body."), t = document.body)), t;
488
+ }, rn = (e, t, o = null) => {
489
+ const i = T(an, e, J(e.message) || ve(e.message) ? {
490
+ default: J(e.message) ? e.message : () => e.message
491
+ } : null);
492
+ return i.appContext = o, ge(i, t), ln(e).appendChild(t.firstElementChild), i.component;
493
+ }, un = () => document.createElement("div"), cn = (e, t) => {
494
+ const o = un();
495
+ e.onVanish = () => {
496
+ ge(null, o), D.delete(a);
497
+ }, e.onAction = (s) => {
498
+ const u = D.get(a);
499
+ let f;
500
+ e.showInput ? f = { value: a.inputValue, action: s } : f = s, e.callback ? e.callback(f, i.proxy) : s === "cancel" || s === "close" ? e.distinguishCancelAndClose && s !== "cancel" ? u.reject("close") : u.reject("cancel") : u.resolve(f);
501
+ };
502
+ const i = rn(e, o, t), a = i.proxy;
503
+ for (const s in e)
504
+ le(e, s) && !le(a.$props, s) && (a[s] = e[s]);
505
+ return a.visible = !0, a;
506
+ };
507
+ function L(e, t = null) {
508
+ if (!Ve)
509
+ return Promise.reject();
510
+ let o;
511
+ return _(e) || ve(e) ? e = {
512
+ message: e
513
+ } : o = e.callback, new Promise((i, a) => {
514
+ const s = cn(e, t ?? L._context);
515
+ D.set(s, {
516
+ options: e,
517
+ callback: o,
518
+ resolve: i,
519
+ reject: a
520
+ });
521
+ });
522
+ }
523
+ const dn = ["alert", "confirm", "prompt"], fn = {
524
+ alert: { closeOnPressEscape: !1, closeOnClickModal: !1 },
525
+ confirm: { showCancelButton: !0 },
526
+ prompt: { showCancelButton: !0, showInput: !0 }
527
+ };
528
+ dn.forEach((e) => {
529
+ L[e] = mn(e);
530
+ });
531
+ function mn(e) {
532
+ return (t, o, i, a) => {
533
+ let s = "";
534
+ return Pe(o) ? (i = o, s = "") : Z(o) ? s = "" : s = o, L(Object.assign({
535
+ title: s,
536
+ message: t,
537
+ type: "",
538
+ ...fn[e]
539
+ }, i, {
540
+ boxType: e
541
+ }), a);
542
+ };
543
+ }
544
+ L.close = () => {
545
+ D.forEach((e, t) => {
546
+ t.doClose();
547
+ }), D.clear();
548
+ };
549
+ L._context = null;
550
+ const w = L;
551
+ w.install = (e) => {
552
+ w._context = e._context, e.config.globalProperties.$msgbox = w, e.config.globalProperties.$messageBox = w, e.config.globalProperties.$alert = w.alert, e.config.globalProperties.$confirm = w.confirm, e.config.globalProperties.$prompt = w.prompt;
553
+ };
554
+ const Sn = w;
555
+ export {
556
+ Sn as E,
557
+ Mn as a
558
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("vue"),i=require("./base-bdc10baa.cjs"),T=require("./use-form-common-props-592797e2.cjs"),J=require("./el-button-960edd49.cjs"),Q=require("./el-input-5163bda3.cjs"),A=require("./el-overlay-e5d318c3.cjs"),O=require("./index-19fa1fcf.cjs"),I=require("./index-d94bae37.cjs"),Y=require("./validator-af488a9a.cjs"),x=require("./use-global-config-584b62f1.cjs"),q=require("./index-02ca0096.cjs"),_=require("./el-dialog-cd484c1f.cjs"),ee=i.buildProps({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:T.componentSizes,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}}),ne=n.defineComponent({name:"ElText"}),oe=n.defineComponent({...ne,props:ee,setup(e){const l=e,t=n.ref(),c=T.useFormSize(),a=i.useNamespace("text"),s=n.computed(()=>[a.b(),a.m(l.type),a.m(c.value),a.is("truncated",l.truncated),a.is("line-clamp",!i.isUndefined(l.lineClamp))]),u=n.useAttrs().title,m=()=>{var d,o,b,E,f;if(u)return;let w=!1;const N=((d=t.value)==null?void 0:d.textContent)||"";if(l.truncated){const p=(o=t.value)==null?void 0:o.offsetWidth,C=(b=t.value)==null?void 0:b.scrollWidth;p&&C&&C>p&&(w=!0)}else if(!i.isUndefined(l.lineClamp)){const p=(E=t.value)==null?void 0:E.offsetHeight,C=(f=t.value)==null?void 0:f.scrollHeight;p&&C&&C>p&&(w=!0)}w?t.value.setAttribute("title",N):t.value.removeAttribute("title")};return n.onMounted(m),n.onUpdated(m),(d,o)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(d.tag),{ref_key:"textRef",ref:t,class:n.normalizeClass(n.unref(s)),style:n.normalizeStyle({"-webkit-line-clamp":d.lineClamp})},{default:n.withCtx(()=>[n.renderSlot(d.$slots,"default")]),_:3},8,["class","style"]))}});var te=i._export_sfc(oe,[["__file","text.vue"]]);const le=i.withInstall(te),R="_trap-focus-children",y=[],K=e=>{var l;if(y.length===0)return;const t=y[y.length-1][R];if(t.length>0&&e.code===I.EVENT_CODE.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const c=e.shiftKey,a=e.target===t[0],s=e.target===t[t.length-1];if(a&&c&&(e.preventDefault(),t[t.length-1].focus()),s&&!c&&(e.preventDefault(),t[0].focus()),process.env.NODE_ENV==="test"){const u=t.indexOf(e.target);u!==-1&&((l=t[c?u-1:u+1])==null||l.focus())}}},se={beforeMount(e){e[R]=I.obtainAllFocusableElements(e),y.push(e),y.length<=1&&document.addEventListener("keydown",K)},updated(e){n.nextTick(()=>{e[R]=I.obtainAllFocusableElements(e)})},unmounted(){y.shift(),y.length===0&&document.removeEventListener("keydown",K)}},ae=n.defineComponent({name:"ElMessageBox",directives:{TrapFocus:se},components:{ElButton:J.ElButton,ElFocusTrap:I.ElFocusTrap,ElInput:Q.ElInput,ElOverlay:A.ElOverlay,ElIcon:O.ElIcon,...T.TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:Y.isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:l}){const{locale:t,zIndex:c,ns:a,size:s}=x.useGlobalComponentSettings("message-box",n.computed(()=>e.buttonSize)),{t:u}=t,{nextZIndex:m}=c,d=n.ref(!1),o=n.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:n.markRaw(O.loading_default),cancelButtonLoadingIcon:n.markRaw(O.loading_default),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:m()}),b=n.computed(()=>{const r=o.type;return{[a.bm("icon",r)]:r&&T.TypeComponentsMap[r]}}),E=q.useId(),f=q.useId(),w=n.computed(()=>{const r=o.type;return o.icon||r&&T.TypeComponentsMap[r]||""}),N=n.computed(()=>!!o.message),p=n.ref(),C=n.ref(),k=n.ref(),V=n.ref(),$=n.ref(),H=n.computed(()=>o.confirmButtonClass);n.watch(()=>o.inputValue,async r=>{await n.nextTick(),e.boxType==="prompt"&&r!==null&&L()},{immediate:!0}),n.watch(()=>d.value,r=>{var v,g;r&&(e.boxType!=="prompt"&&(o.autofocus?k.value=(g=(v=$.value)==null?void 0:v.$el)!=null?g:p.value:k.value=p.value),o.zIndex=m()),e.boxType==="prompt"&&(r?n.nextTick().then(()=>{var F;V.value&&V.value.$el&&(o.autofocus?k.value=(F=X())!=null?F:p.value:k.value=p.value)}):(o.editorErrorMessage="",o.validateError=!1))});const U=n.computed(()=>e.draggable),j=n.computed(()=>e.overflow);_.useDraggable(p,C,U,j),n.onMounted(async()=>{await n.nextTick(),e.closeOnHashChange&&window.addEventListener("hashchange",S)}),n.onBeforeUnmount(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){d.value&&(d.value=!1,n.nextTick(()=>{o.action&&l("action",o.action)}))}const D=()=>{e.closeOnClickModal&&z(o.distinguishCancelAndClose?"close":"cancel")},G=A.useSameTarget(D),W=r=>{if(o.inputType!=="textarea")return r.preventDefault(),z("confirm")},z=r=>{var v;e.boxType==="prompt"&&r==="confirm"&&!L()||(o.action=r,o.beforeClose?(v=o.beforeClose)==null||v.call(o,r,o,S):S())},L=()=>{if(e.boxType==="prompt"){const r=o.inputPattern;if(r&&!r.test(o.inputValue||""))return o.editorErrorMessage=o.inputErrorMessage||u("el.messagebox.error"),o.validateError=!0,!1;const v=o.inputValidator;if(i.isFunction(v)){const g=v(o.inputValue);if(g===!1)return o.editorErrorMessage=o.inputErrorMessage||u("el.messagebox.error"),o.validateError=!0,!1;if(i.isString(g))return o.editorErrorMessage=g,o.validateError=!0,!1}}return o.editorErrorMessage="",o.validateError=!1,!0},X=()=>{var r,v;const g=(r=V.value)==null?void 0:r.$refs;return(v=g==null?void 0:g.input)!=null?v:g==null?void 0:g.textarea},P=()=>{z("close")},Z=()=>{e.closeOnPressEscape&&P()};return e.lockScroll&&A.useLockscreen(d),{...n.toRefs(o),ns:a,overlayEvent:G,visible:d,hasMessage:N,typeClass:b,contentId:E,inputId:f,btnSize:s,iconComponent:w,confirmButtonClasses:H,rootRef:p,focusStartRef:k,headerRef:C,inputRef:V,confirmRef:$,doClose:S,handleClose:P,onCloseRequested:Z,handleWrapperClick:D,handleInputEnter:W,handleAction:z,t:u}}});function re(e,l,t,c,a,s){const u=n.resolveComponent("el-icon"),m=n.resolveComponent("close"),d=n.resolveComponent("el-input"),o=n.resolveComponent("el-button"),b=n.resolveComponent("el-focus-trap"),E=n.resolveComponent("el-overlay");return n.openBlock(),n.createBlock(n.Transition,{name:"fade-in-linear",onAfterLeave:f=>e.$emit("vanish"),persisted:""},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(E,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:n.withCtx(()=>[n.createElementVNode("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:n.normalizeClass(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[n.createVNode(b,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:n.withCtx(()=>[n.createElementVNode("div",{ref:"rootRef",class:n.normalizeClass([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:n.normalizeStyle(e.customStyle),tabindex:"-1",onClick:n.withModifiers(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(n.openBlock(),n.createElementBlock("div",{key:0,ref:"headerRef",class:n.normalizeClass([e.ns.e("header"),{"show-close":e.showClose}])},[n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("title"))},[e.iconComponent&&e.center?(n.openBlock(),n.createBlock(u,{key:0,class:n.normalizeClass([e.ns.e("status"),e.typeClass])},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):n.createCommentVNode("v-if",!0),n.createElementVNode("span",null,n.toDisplayString(e.title),1)],2),e.showClose?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:n.normalizeClass(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:n.withKeys(n.withModifiers(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[n.createVNode(u,{class:n.normalizeClass(e.ns.e("close"))},{default:n.withCtx(()=>[n.createVNode(m)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):n.createCommentVNode("v-if",!0)],2)):n.createCommentVNode("v-if",!0),n.createElementVNode("div",{id:e.contentId,class:n.normalizeClass(e.ns.e("content"))},[n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(n.openBlock(),n.createBlock(u,{key:0,class:n.normalizeClass([e.ns.e("status"),e.typeClass])},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):n.createCommentVNode("v-if",!0),e.hasMessage?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(e.ns.e("message"))},[n.renderSlot(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):n.createCommentVNode("v-if",!0)],2),n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("input"))},[n.createVNode(d,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":f=>e.inputValue=f,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:n.normalizeClass({invalid:e.validateError}),onKeydown:n.withKeys(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("errormsg")),style:n.normalizeStyle({visibility:e.editorErrorMessage?"visible":"hidden"})},n.toDisplayString(e.editorErrorMessage),7)],2),[[n.vShow,e.showInput]])],10,["id"]),n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("btns"))},[e.showCancelButton?(n.openBlock(),n.createBlock(o,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:n.normalizeClass([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:f=>e.handleAction("cancel"),onKeydown:n.withKeys(n.withModifiers(f=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):n.createCommentVNode("v-if",!0),n.withDirectives(n.createVNode(o,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:n.normalizeClass([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:f=>e.handleAction("confirm"),onKeydown:n.withKeys(n.withModifiers(f=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[n.vShow,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[n.vShow,e.visible]])]),_:3},8,["onAfterLeave"])}var ie=i._export_sfc(ae,[["render",re],["__file","index.vue"]]);const M=new Map,ce=e=>{let l=document.body;return e.appendTo&&(i.isString(e.appendTo)&&(l=document.querySelector(e.appendTo)),i.isElement(e.appendTo)&&(l=e.appendTo),i.isElement(l)||(i.debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),l=document.body)),l},ue=(e,l,t=null)=>{const c=n.createVNode(ie,e,i.isFunction(e.message)||n.isVNode(e.message)?{default:i.isFunction(e.message)?e.message:()=>e.message}:null);return c.appContext=t,n.render(c,l),ce(e).appendChild(l.firstElementChild),c.component},de=()=>document.createElement("div"),fe=(e,l)=>{const t=de();e.onVanish=()=>{n.render(null,t),M.delete(a)},e.onAction=s=>{const u=M.get(a);let m;e.showInput?m={value:a.inputValue,action:s}:m=s,e.callback?e.callback(m,c.proxy):s==="cancel"||s==="close"?e.distinguishCancelAndClose&&s!=="cancel"?u.reject("close"):u.reject("cancel"):u.resolve(m)};const c=ue(e,t,l),a=c.proxy;for(const s in e)i.hasOwn(e,s)&&!i.hasOwn(a.$props,s)&&(a[s]=e[s]);return a.visible=!0,a};function B(e,l=null){if(!i.isClient)return Promise.reject();let t;return i.isString(e)||n.isVNode(e)?e={message:e}:t=e.callback,new Promise((c,a)=>{const s=fe(e,l??B._context);M.set(s,{options:e,callback:t,resolve:c,reject:a})})}const me=["alert","confirm","prompt"],pe={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};me.forEach(e=>{B[e]=ve(e)});function ve(e){return(l,t,c,a)=>{let s="";return i.isObject(t)?(c=t,s=""):i.isUndefined(t)?s="":s=t,B(Object.assign({title:s,message:l,type:"",...pe[e]},c,{boxType:e}),a)}}B.close=()=>{M.forEach((e,l)=>{l.doClose()}),M.clear()};B._context=null;const h=B;h.install=e=>{h._context=e._context,e.config.globalProperties.$msgbox=h,e.config.globalProperties.$messageBox=h,e.config.globalProperties.$alert=h.alert,e.config.globalProperties.$confirm=h.confirm,e.config.globalProperties.$prompt=h.prompt};const ge=h;exports.ElMessageBox=ge;exports.ElText=le;