st-comp 0.0.199 → 0.0.201
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.
- package/auto-imports.d.ts +3 -0
- package/es/CustomFunction.cjs +1 -1
- package/es/CustomFunction.js +267 -199
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +27 -25
- package/es/KlinePlus.cjs +3 -3
- package/es/KlinePlus.js +252 -249
- package/es/User.cjs +1 -1
- package/es/User.js +714 -624
- package/es/VarietySearch.cjs +6 -6
- package/es/VarietySearch.js +19 -17
- package/es/VarietyTextCopy.cjs +3 -3
- package/es/VarietyTextCopy.js +4 -4
- package/es/el-checkbox-group-0ea8fbf8.cjs +1 -0
- package/es/el-checkbox-group-4ed993c7.js +1 -0
- package/es/{el-form-item-eeb64520.js → el-form-item-c53c374d.js} +2 -2
- package/es/el-message-box-a93d2f6a.js +489 -0
- package/es/el-message-box-c10adb52.cjs +1 -0
- package/es/el-text-ac60d0f2.js +67 -0
- package/es/el-text-c20a9f48.cjs +1 -0
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +206 -206
- package/lib/{index-c9dddb13.js → index-c0ce50bc.js} +20375 -20219
- package/lib/{python-8de8f552.js → python-9dae326e.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +141 -30
- package/packages/KlinePlus/index.vue +17 -7
- package/packages/User/components/EditInfoDialog/Mobile.vue +110 -0
- package/packages/User/components/EditInfoDialog/index.vue +136 -0
- package/packages/User/components/SetPasswordDialog.vue +6 -3
- package/packages/User/index.vue +7 -22
- package/src/pages/KlinePlus/index.vue +6 -5
- package/es/el-message-box-48d71ee5.cjs +0 -1
- package/es/el-message-box-81ffd21e.js +0 -550
- package/packages/User/components/EditInfoDialog.vue +0 -144
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { nextTick as V, defineComponent as Be, computed as b, ref as w, reactive as we, markRaw as N, watch as _, onMounted as Me, onBeforeUnmount as ke, toRefs as Ie, resolveComponent as A, openBlock as u, createBlock as g, Transition as Te, withCtx as C, withDirectives as K, createVNode as k, createElementVNode as v, normalizeClass as r, normalizeStyle as x, withModifiers as D, createElementBlock as U, resolveDynamicComponent as L, createCommentVNode as M, toDisplayString as R, withKeys as P, renderSlot as Se, vShow as H, createTextVNode as ee, isVNode as ie, render as ue } from "vue";
|
|
2
|
+
import { E as Ae } from "./el-button-c95adb85.js";
|
|
3
|
+
import { E as Le } from "./el-input-2f75c4ba.js";
|
|
4
|
+
import { E as Re, b as Ve, c as $e } from "./el-overlay-09ad71cd.js";
|
|
5
|
+
import { E as Oe, l as ne } from "./index-a871c3eb.js";
|
|
6
|
+
import { o as oe, a as ze, e as De } from "./el-popper-b4f97157.js";
|
|
7
|
+
import { x as j, c as G, _ as Pe, s as Fe, y as se, f as ce, i as Ke, z as te } from "./base-a5af3db3.js";
|
|
8
|
+
import { T as Ue, m as ae } from "./use-form-common-props-815d48a6.js";
|
|
9
|
+
import { i as He } from "./validator-764a9db0.js";
|
|
10
|
+
import { u as Ne } from "./use-global-config-b5e9d3d5.js";
|
|
11
|
+
import { u as le } from "./index-960806da.js";
|
|
12
|
+
import { u as je } from "./el-dialog-41ab8417.js";
|
|
13
|
+
const q = "_trap-focus-children", E = [], re = (e) => {
|
|
14
|
+
if (E.length === 0)
|
|
15
|
+
return;
|
|
16
|
+
const o = E[E.length - 1][q];
|
|
17
|
+
if (o.length > 0 && e.code === ze.tab) {
|
|
18
|
+
if (o.length === 1) {
|
|
19
|
+
e.preventDefault(), document.activeElement !== o[0] && o[0].focus();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const a = e.shiftKey, i = e.target === o[0], l = e.target === o[o.length - 1];
|
|
23
|
+
i && a && (e.preventDefault(), o[o.length - 1].focus()), l && !a && (e.preventDefault(), o[0].focus());
|
|
24
|
+
}
|
|
25
|
+
}, qe = {
|
|
26
|
+
beforeMount(e) {
|
|
27
|
+
e[q] = oe(e), E.push(e), E.length <= 1 && document.addEventListener("keydown", re);
|
|
28
|
+
},
|
|
29
|
+
updated(e) {
|
|
30
|
+
V(() => {
|
|
31
|
+
e[q] = oe(e);
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
unmounted() {
|
|
35
|
+
E.shift(), E.length === 0 && document.removeEventListener("keydown", re);
|
|
36
|
+
}
|
|
37
|
+
}, Ge = Be({
|
|
38
|
+
name: "ElMessageBox",
|
|
39
|
+
directives: {
|
|
40
|
+
TrapFocus: qe
|
|
41
|
+
},
|
|
42
|
+
components: {
|
|
43
|
+
ElButton: Ae,
|
|
44
|
+
ElFocusTrap: De,
|
|
45
|
+
ElInput: Le,
|
|
46
|
+
ElOverlay: Re,
|
|
47
|
+
ElIcon: Oe,
|
|
48
|
+
...Ue
|
|
49
|
+
},
|
|
50
|
+
inheritAttrs: !1,
|
|
51
|
+
props: {
|
|
52
|
+
buttonSize: {
|
|
53
|
+
type: String,
|
|
54
|
+
validator: He
|
|
55
|
+
},
|
|
56
|
+
modal: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !0
|
|
59
|
+
},
|
|
60
|
+
lockScroll: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !0
|
|
63
|
+
},
|
|
64
|
+
showClose: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !0
|
|
67
|
+
},
|
|
68
|
+
closeOnClickModal: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !0
|
|
71
|
+
},
|
|
72
|
+
closeOnPressEscape: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !0
|
|
75
|
+
},
|
|
76
|
+
closeOnHashChange: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: !0
|
|
79
|
+
},
|
|
80
|
+
center: Boolean,
|
|
81
|
+
draggable: Boolean,
|
|
82
|
+
overflow: Boolean,
|
|
83
|
+
roundButton: Boolean,
|
|
84
|
+
container: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: "body"
|
|
87
|
+
},
|
|
88
|
+
boxType: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: ""
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
emits: ["vanish", "action"],
|
|
94
|
+
setup(e, { emit: o }) {
|
|
95
|
+
const {
|
|
96
|
+
locale: a,
|
|
97
|
+
zIndex: i,
|
|
98
|
+
ns: l,
|
|
99
|
+
size: s
|
|
100
|
+
} = Ne("message-box", b(() => e.buttonSize)), { t: c } = a, { nextZIndex: p } = i, h = w(!1), n = we({
|
|
101
|
+
autofocus: !0,
|
|
102
|
+
beforeClose: null,
|
|
103
|
+
callback: null,
|
|
104
|
+
cancelButtonText: "",
|
|
105
|
+
cancelButtonClass: "",
|
|
106
|
+
confirmButtonText: "",
|
|
107
|
+
confirmButtonClass: "",
|
|
108
|
+
customClass: "",
|
|
109
|
+
customStyle: {},
|
|
110
|
+
dangerouslyUseHTMLString: !1,
|
|
111
|
+
distinguishCancelAndClose: !1,
|
|
112
|
+
icon: "",
|
|
113
|
+
closeIcon: "",
|
|
114
|
+
inputPattern: null,
|
|
115
|
+
inputPlaceholder: "",
|
|
116
|
+
inputType: "text",
|
|
117
|
+
inputValue: "",
|
|
118
|
+
inputValidator: void 0,
|
|
119
|
+
inputErrorMessage: "",
|
|
120
|
+
message: "",
|
|
121
|
+
modalFade: !0,
|
|
122
|
+
modalClass: "",
|
|
123
|
+
showCancelButton: !1,
|
|
124
|
+
showConfirmButton: !0,
|
|
125
|
+
type: "",
|
|
126
|
+
title: void 0,
|
|
127
|
+
showInput: !1,
|
|
128
|
+
action: "",
|
|
129
|
+
confirmButtonLoading: !1,
|
|
130
|
+
cancelButtonLoading: !1,
|
|
131
|
+
confirmButtonLoadingIcon: N(ne),
|
|
132
|
+
cancelButtonLoadingIcon: N(ne),
|
|
133
|
+
confirmButtonDisabled: !1,
|
|
134
|
+
editorErrorMessage: "",
|
|
135
|
+
validateError: !1,
|
|
136
|
+
zIndex: p()
|
|
137
|
+
}), F = b(() => {
|
|
138
|
+
const t = n.type;
|
|
139
|
+
return { [l.bm("icon", t)]: t && ae[t] };
|
|
140
|
+
}), m = le(), de = le(), fe = b(() => {
|
|
141
|
+
const t = n.type;
|
|
142
|
+
return n.icon || t && ae[t] || "";
|
|
143
|
+
}), me = b(() => !!n.message), B = w(), X = w(), T = w(), O = w(), W = w(), pe = b(() => n.confirmButtonClass);
|
|
144
|
+
_(() => n.inputValue, async (t) => {
|
|
145
|
+
await V(), e.boxType === "prompt" && t && J();
|
|
146
|
+
}, { immediate: !0 }), _(() => h.value, (t) => {
|
|
147
|
+
var d, f;
|
|
148
|
+
t && (e.boxType !== "prompt" && (n.autofocus ? T.value = (f = (d = W.value) == null ? void 0 : d.$el) != null ? f : B.value : T.value = B.value), n.zIndex = p()), e.boxType === "prompt" && (t ? V().then(() => {
|
|
149
|
+
var Y;
|
|
150
|
+
O.value && O.value.$el && (n.autofocus ? T.value = (Y = be()) != null ? Y : B.value : T.value = B.value);
|
|
151
|
+
}) : (n.editorErrorMessage = "", n.validateError = !1));
|
|
152
|
+
});
|
|
153
|
+
const ge = b(() => e.draggable), ve = b(() => e.overflow), { isDragging: he } = je(B, X, ge, ve);
|
|
154
|
+
Me(async () => {
|
|
155
|
+
await V(), e.closeOnHashChange && window.addEventListener("hashchange", S);
|
|
156
|
+
}), ke(() => {
|
|
157
|
+
e.closeOnHashChange && window.removeEventListener("hashchange", S);
|
|
158
|
+
});
|
|
159
|
+
function S() {
|
|
160
|
+
h.value && (h.value = !1, V(() => {
|
|
161
|
+
n.action && o("action", n.action);
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
const Z = () => {
|
|
165
|
+
e.closeOnClickModal && z(n.distinguishCancelAndClose ? "close" : "cancel");
|
|
166
|
+
}, Ce = $e(Z), ye = (t) => {
|
|
167
|
+
if (n.inputType !== "textarea")
|
|
168
|
+
return t.preventDefault(), z("confirm");
|
|
169
|
+
}, z = (t) => {
|
|
170
|
+
var d;
|
|
171
|
+
e.boxType === "prompt" && t === "confirm" && !J() || (n.action = t, n.beforeClose ? (d = n.beforeClose) == null || d.call(n, t, n, S) : S());
|
|
172
|
+
}, J = () => {
|
|
173
|
+
if (e.boxType === "prompt") {
|
|
174
|
+
const t = n.inputPattern;
|
|
175
|
+
if (t && !t.test(n.inputValue || ""))
|
|
176
|
+
return n.editorErrorMessage = n.inputErrorMessage || c("el.messagebox.error"), n.validateError = !0, !1;
|
|
177
|
+
const d = n.inputValidator;
|
|
178
|
+
if (j(d)) {
|
|
179
|
+
const f = d(n.inputValue);
|
|
180
|
+
if (f === !1)
|
|
181
|
+
return n.editorErrorMessage = n.inputErrorMessage || c("el.messagebox.error"), n.validateError = !0, !1;
|
|
182
|
+
if (G(f))
|
|
183
|
+
return n.editorErrorMessage = f, n.validateError = !0, !1;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return n.editorErrorMessage = "", n.validateError = !1, !0;
|
|
187
|
+
}, be = () => {
|
|
188
|
+
var t, d;
|
|
189
|
+
const f = (t = O.value) == null ? void 0 : t.$refs;
|
|
190
|
+
return (d = f == null ? void 0 : f.input) != null ? d : f == null ? void 0 : f.textarea;
|
|
191
|
+
}, Q = () => {
|
|
192
|
+
z("close");
|
|
193
|
+
}, Ee = () => {
|
|
194
|
+
e.closeOnPressEscape && Q();
|
|
195
|
+
};
|
|
196
|
+
return e.lockScroll && Ve(h), {
|
|
197
|
+
...Ie(n),
|
|
198
|
+
ns: l,
|
|
199
|
+
overlayEvent: Ce,
|
|
200
|
+
visible: h,
|
|
201
|
+
hasMessage: me,
|
|
202
|
+
typeClass: F,
|
|
203
|
+
contentId: m,
|
|
204
|
+
inputId: de,
|
|
205
|
+
btnSize: s,
|
|
206
|
+
iconComponent: fe,
|
|
207
|
+
confirmButtonClasses: pe,
|
|
208
|
+
rootRef: B,
|
|
209
|
+
focusStartRef: T,
|
|
210
|
+
headerRef: X,
|
|
211
|
+
inputRef: O,
|
|
212
|
+
isDragging: he,
|
|
213
|
+
confirmRef: W,
|
|
214
|
+
doClose: S,
|
|
215
|
+
handleClose: Q,
|
|
216
|
+
onCloseRequested: Ee,
|
|
217
|
+
handleWrapperClick: Z,
|
|
218
|
+
handleInputEnter: ye,
|
|
219
|
+
handleAction: z,
|
|
220
|
+
t: c
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
function Xe(e, o, a, i, l, s) {
|
|
225
|
+
const c = A("el-icon"), p = A("el-input"), h = A("el-button"), n = A("el-focus-trap"), F = A("el-overlay");
|
|
226
|
+
return u(), g(Te, {
|
|
227
|
+
name: "fade-in-linear",
|
|
228
|
+
onAfterLeave: (m) => e.$emit("vanish"),
|
|
229
|
+
persisted: ""
|
|
230
|
+
}, {
|
|
231
|
+
default: C(() => [
|
|
232
|
+
K(k(F, {
|
|
233
|
+
"z-index": e.zIndex,
|
|
234
|
+
"overlay-class": [e.ns.is("message-box"), e.modalClass],
|
|
235
|
+
mask: e.modal
|
|
236
|
+
}, {
|
|
237
|
+
default: C(() => [
|
|
238
|
+
v("div", {
|
|
239
|
+
role: "dialog",
|
|
240
|
+
"aria-label": e.title,
|
|
241
|
+
"aria-modal": "true",
|
|
242
|
+
"aria-describedby": e.showInput ? void 0 : e.contentId,
|
|
243
|
+
class: r(`${e.ns.namespace.value}-overlay-message-box`),
|
|
244
|
+
onClick: e.overlayEvent.onClick,
|
|
245
|
+
onMousedown: e.overlayEvent.onMousedown,
|
|
246
|
+
onMouseup: e.overlayEvent.onMouseup
|
|
247
|
+
}, [
|
|
248
|
+
k(n, {
|
|
249
|
+
loop: "",
|
|
250
|
+
trapped: e.visible,
|
|
251
|
+
"focus-trap-el": e.rootRef,
|
|
252
|
+
"focus-start-el": e.focusStartRef,
|
|
253
|
+
onReleaseRequested: e.onCloseRequested
|
|
254
|
+
}, {
|
|
255
|
+
default: C(() => [
|
|
256
|
+
v("div", {
|
|
257
|
+
ref: "rootRef",
|
|
258
|
+
class: r([
|
|
259
|
+
e.ns.b(),
|
|
260
|
+
e.customClass,
|
|
261
|
+
e.ns.is("draggable", e.draggable),
|
|
262
|
+
e.ns.is("dragging", e.isDragging),
|
|
263
|
+
{ [e.ns.m("center")]: e.center }
|
|
264
|
+
]),
|
|
265
|
+
style: x(e.customStyle),
|
|
266
|
+
tabindex: "-1",
|
|
267
|
+
onClick: D(() => {
|
|
268
|
+
}, ["stop"])
|
|
269
|
+
}, [
|
|
270
|
+
e.title !== null && e.title !== void 0 ? (u(), U("div", {
|
|
271
|
+
key: 0,
|
|
272
|
+
ref: "headerRef",
|
|
273
|
+
class: r([e.ns.e("header"), { "show-close": e.showClose }])
|
|
274
|
+
}, [
|
|
275
|
+
v("div", {
|
|
276
|
+
class: r(e.ns.e("title"))
|
|
277
|
+
}, [
|
|
278
|
+
e.iconComponent && e.center ? (u(), g(c, {
|
|
279
|
+
key: 0,
|
|
280
|
+
class: r([e.ns.e("status"), e.typeClass])
|
|
281
|
+
}, {
|
|
282
|
+
default: C(() => [
|
|
283
|
+
(u(), g(L(e.iconComponent)))
|
|
284
|
+
]),
|
|
285
|
+
_: 1
|
|
286
|
+
}, 8, ["class"])) : M("v-if", !0),
|
|
287
|
+
v("span", null, R(e.title), 1)
|
|
288
|
+
], 2),
|
|
289
|
+
e.showClose ? (u(), U("button", {
|
|
290
|
+
key: 0,
|
|
291
|
+
type: "button",
|
|
292
|
+
class: r(e.ns.e("headerbtn")),
|
|
293
|
+
"aria-label": e.t("el.messagebox.close"),
|
|
294
|
+
onClick: (m) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"),
|
|
295
|
+
onKeydown: P(D((m) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])
|
|
296
|
+
}, [
|
|
297
|
+
k(c, {
|
|
298
|
+
class: r(e.ns.e("close"))
|
|
299
|
+
}, {
|
|
300
|
+
default: C(() => [
|
|
301
|
+
(u(), g(L(e.closeIcon || "close")))
|
|
302
|
+
]),
|
|
303
|
+
_: 1
|
|
304
|
+
}, 8, ["class"])
|
|
305
|
+
], 42, ["aria-label", "onClick", "onKeydown"])) : M("v-if", !0)
|
|
306
|
+
], 2)) : M("v-if", !0),
|
|
307
|
+
v("div", {
|
|
308
|
+
id: e.contentId,
|
|
309
|
+
class: r(e.ns.e("content"))
|
|
310
|
+
}, [
|
|
311
|
+
v("div", {
|
|
312
|
+
class: r(e.ns.e("container"))
|
|
313
|
+
}, [
|
|
314
|
+
e.iconComponent && !e.center && e.hasMessage ? (u(), g(c, {
|
|
315
|
+
key: 0,
|
|
316
|
+
class: r([e.ns.e("status"), e.typeClass])
|
|
317
|
+
}, {
|
|
318
|
+
default: C(() => [
|
|
319
|
+
(u(), g(L(e.iconComponent)))
|
|
320
|
+
]),
|
|
321
|
+
_: 1
|
|
322
|
+
}, 8, ["class"])) : M("v-if", !0),
|
|
323
|
+
e.hasMessage ? (u(), U("div", {
|
|
324
|
+
key: 1,
|
|
325
|
+
class: r(e.ns.e("message"))
|
|
326
|
+
}, [
|
|
327
|
+
Se(e.$slots, "default", {}, () => [
|
|
328
|
+
e.dangerouslyUseHTMLString ? (u(), g(L(e.showInput ? "label" : "p"), {
|
|
329
|
+
key: 1,
|
|
330
|
+
for: e.showInput ? e.inputId : void 0,
|
|
331
|
+
innerHTML: e.message
|
|
332
|
+
}, null, 8, ["for", "innerHTML"])) : (u(), g(L(e.showInput ? "label" : "p"), {
|
|
333
|
+
key: 0,
|
|
334
|
+
for: e.showInput ? e.inputId : void 0,
|
|
335
|
+
textContent: R(e.message)
|
|
336
|
+
}, null, 8, ["for", "textContent"]))
|
|
337
|
+
])
|
|
338
|
+
], 2)) : M("v-if", !0)
|
|
339
|
+
], 2),
|
|
340
|
+
K(v("div", {
|
|
341
|
+
class: r(e.ns.e("input"))
|
|
342
|
+
}, [
|
|
343
|
+
k(p, {
|
|
344
|
+
id: e.inputId,
|
|
345
|
+
ref: "inputRef",
|
|
346
|
+
modelValue: e.inputValue,
|
|
347
|
+
"onUpdate:modelValue": (m) => e.inputValue = m,
|
|
348
|
+
type: e.inputType,
|
|
349
|
+
placeholder: e.inputPlaceholder,
|
|
350
|
+
"aria-invalid": e.validateError,
|
|
351
|
+
class: r({ invalid: e.validateError }),
|
|
352
|
+
onKeydown: P(e.handleInputEnter, ["enter"])
|
|
353
|
+
}, null, 8, ["id", "modelValue", "onUpdate:modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown"]),
|
|
354
|
+
v("div", {
|
|
355
|
+
class: r(e.ns.e("errormsg")),
|
|
356
|
+
style: x({
|
|
357
|
+
visibility: e.editorErrorMessage ? "visible" : "hidden"
|
|
358
|
+
})
|
|
359
|
+
}, R(e.editorErrorMessage), 7)
|
|
360
|
+
], 2), [
|
|
361
|
+
[H, e.showInput]
|
|
362
|
+
])
|
|
363
|
+
], 10, ["id"]),
|
|
364
|
+
v("div", {
|
|
365
|
+
class: r(e.ns.e("btns"))
|
|
366
|
+
}, [
|
|
367
|
+
e.showCancelButton ? (u(), g(h, {
|
|
368
|
+
key: 0,
|
|
369
|
+
loading: e.cancelButtonLoading,
|
|
370
|
+
"loading-icon": e.cancelButtonLoadingIcon,
|
|
371
|
+
class: r([e.cancelButtonClass]),
|
|
372
|
+
round: e.roundButton,
|
|
373
|
+
size: e.btnSize,
|
|
374
|
+
onClick: (m) => e.handleAction("cancel"),
|
|
375
|
+
onKeydown: P(D((m) => e.handleAction("cancel"), ["prevent"]), ["enter"])
|
|
376
|
+
}, {
|
|
377
|
+
default: C(() => [
|
|
378
|
+
ee(R(e.cancelButtonText || e.t("el.messagebox.cancel")), 1)
|
|
379
|
+
]),
|
|
380
|
+
_: 1
|
|
381
|
+
}, 8, ["loading", "loading-icon", "class", "round", "size", "onClick", "onKeydown"])) : M("v-if", !0),
|
|
382
|
+
K(k(h, {
|
|
383
|
+
ref: "confirmRef",
|
|
384
|
+
type: "primary",
|
|
385
|
+
loading: e.confirmButtonLoading,
|
|
386
|
+
"loading-icon": e.confirmButtonLoadingIcon,
|
|
387
|
+
class: r([e.confirmButtonClasses]),
|
|
388
|
+
round: e.roundButton,
|
|
389
|
+
disabled: e.confirmButtonDisabled,
|
|
390
|
+
size: e.btnSize,
|
|
391
|
+
onClick: (m) => e.handleAction("confirm"),
|
|
392
|
+
onKeydown: P(D((m) => e.handleAction("confirm"), ["prevent"]), ["enter"])
|
|
393
|
+
}, {
|
|
394
|
+
default: C(() => [
|
|
395
|
+
ee(R(e.confirmButtonText || e.t("el.messagebox.confirm")), 1)
|
|
396
|
+
]),
|
|
397
|
+
_: 1
|
|
398
|
+
}, 8, ["loading", "loading-icon", "class", "round", "disabled", "size", "onClick", "onKeydown"]), [
|
|
399
|
+
[H, e.showConfirmButton]
|
|
400
|
+
])
|
|
401
|
+
], 2)
|
|
402
|
+
], 14, ["onClick"])
|
|
403
|
+
]),
|
|
404
|
+
_: 3
|
|
405
|
+
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
|
|
406
|
+
], 42, ["aria-label", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
|
|
407
|
+
]),
|
|
408
|
+
_: 3
|
|
409
|
+
}, 8, ["z-index", "overlay-class", "mask"]), [
|
|
410
|
+
[H, e.visible]
|
|
411
|
+
])
|
|
412
|
+
]),
|
|
413
|
+
_: 3
|
|
414
|
+
}, 8, ["onAfterLeave"]);
|
|
415
|
+
}
|
|
416
|
+
var We = /* @__PURE__ */ Pe(Ge, [["render", Xe], ["__file", "index.vue"]]);
|
|
417
|
+
const $ = /* @__PURE__ */ new Map(), Ze = (e) => {
|
|
418
|
+
let o = document.body;
|
|
419
|
+
return e.appendTo && (G(e.appendTo) && (o = document.querySelector(e.appendTo)), te(e.appendTo) && (o = e.appendTo), te(o) || (o = document.body)), o;
|
|
420
|
+
}, Je = (e, o, a = null) => {
|
|
421
|
+
const i = k(We, e, j(e.message) || ie(e.message) ? {
|
|
422
|
+
default: j(e.message) ? e.message : () => e.message
|
|
423
|
+
} : null);
|
|
424
|
+
return i.appContext = a, ue(i, o), Ze(e).appendChild(o.firstElementChild), i.component;
|
|
425
|
+
}, Qe = () => document.createElement("div"), Ye = (e, o) => {
|
|
426
|
+
const a = Qe();
|
|
427
|
+
e.onVanish = () => {
|
|
428
|
+
ue(null, a), $.delete(l);
|
|
429
|
+
}, e.onAction = (s) => {
|
|
430
|
+
const c = $.get(l);
|
|
431
|
+
let p;
|
|
432
|
+
e.showInput ? p = { value: l.inputValue, action: s } : p = s, e.callback ? e.callback(p, i.proxy) : s === "cancel" || s === "close" ? e.distinguishCancelAndClose && s !== "cancel" ? c.reject("close") : c.reject("cancel") : c.resolve(p);
|
|
433
|
+
};
|
|
434
|
+
const i = Je(e, a, o), l = i.proxy;
|
|
435
|
+
for (const s in e)
|
|
436
|
+
se(e, s) && !se(l.$props, s) && (s === "closeIcon" && ce(e[s]) ? l[s] = N(e[s]) : l[s] = e[s]);
|
|
437
|
+
return l.visible = !0, l;
|
|
438
|
+
};
|
|
439
|
+
function I(e, o = null) {
|
|
440
|
+
if (!Fe)
|
|
441
|
+
return Promise.reject();
|
|
442
|
+
let a;
|
|
443
|
+
return G(e) || ie(e) ? e = {
|
|
444
|
+
message: e
|
|
445
|
+
} : a = e.callback, new Promise((i, l) => {
|
|
446
|
+
const s = Ye(e, o ?? I._context);
|
|
447
|
+
$.set(s, {
|
|
448
|
+
options: e,
|
|
449
|
+
callback: a,
|
|
450
|
+
resolve: i,
|
|
451
|
+
reject: l
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
const _e = ["alert", "confirm", "prompt"], xe = {
|
|
456
|
+
alert: { closeOnPressEscape: !1, closeOnClickModal: !1 },
|
|
457
|
+
confirm: { showCancelButton: !0 },
|
|
458
|
+
prompt: { showCancelButton: !0, showInput: !0 }
|
|
459
|
+
};
|
|
460
|
+
_e.forEach((e) => {
|
|
461
|
+
I[e] = en(e);
|
|
462
|
+
});
|
|
463
|
+
function en(e) {
|
|
464
|
+
return (o, a, i, l) => {
|
|
465
|
+
let s = "";
|
|
466
|
+
return ce(a) ? (i = a, s = "") : Ke(a) ? s = "" : s = a, I(Object.assign({
|
|
467
|
+
title: s,
|
|
468
|
+
message: o,
|
|
469
|
+
type: "",
|
|
470
|
+
...xe[e]
|
|
471
|
+
}, i, {
|
|
472
|
+
boxType: e
|
|
473
|
+
}), l);
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
I.close = () => {
|
|
477
|
+
$.forEach((e, o) => {
|
|
478
|
+
o.doClose();
|
|
479
|
+
}), $.clear();
|
|
480
|
+
};
|
|
481
|
+
I._context = null;
|
|
482
|
+
const y = I;
|
|
483
|
+
y.install = (e) => {
|
|
484
|
+
y._context = e._context, e.config.globalProperties.$msgbox = y, e.config.globalProperties.$messageBox = y, e.config.globalProperties.$alert = y.alert, e.config.globalProperties.$confirm = y.confirm, e.config.globalProperties.$prompt = y.prompt;
|
|
485
|
+
};
|
|
486
|
+
const pn = y;
|
|
487
|
+
export {
|
|
488
|
+
pn as E
|
|
489
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("vue"),Q=require("./el-button-eec58cff.cjs"),Y=require("./el-input-7fd293af.cjs"),V=require("./el-overlay-9e34965f.cjs"),I=require("./index-098c2447.cjs"),M=require("./el-popper-b6c99b28.cjs"),c=require("./base-ef747d02.cjs"),T=require("./use-form-common-props-fd9b61a0.cjs"),x=require("./validator-1b8a6128.cjs"),_=require("./use-global-config-30d7d8ce.cjs"),$=require("./index-9780a537.cjs"),ee=require("./el-dialog-ae86edb8.cjs"),z="_trap-focus-children",C=[],P=e=>{if(C.length===0)return;const t=C[C.length-1][z];if(t.length>0&&e.code===M.EVENT_CODE.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const a=e.shiftKey,i=e.target===t[0],r=e.target===t[t.length-1];i&&a&&(e.preventDefault(),t[t.length-1].focus()),r&&!a&&(e.preventDefault(),t[0].focus())}},ne={beforeMount(e){e[z]=M.obtainAllFocusableElements(e),C.push(e),C.length<=1&&document.addEventListener("keydown",P)},updated(e){n.nextTick(()=>{e[z]=M.obtainAllFocusableElements(e)})},unmounted(){C.shift(),C.length===0&&document.removeEventListener("keydown",P)}},oe=n.defineComponent({name:"ElMessageBox",directives:{TrapFocus:ne},components:{ElButton:Q.ElButton,ElFocusTrap:M.ElFocusTrap,ElInput:Y.ElInput,ElOverlay:V.ElOverlay,ElIcon:I.ElIcon,...T.TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:x.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:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:a,zIndex:i,ns:r,size:l}=_.useGlobalComponentSettings("message-box",n.computed(()=>e.buttonSize)),{t:u}=a,{nextZIndex:p}=i,g=n.ref(!1),o=n.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",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(I.loading_default),cancelButtonLoadingIcon:n.markRaw(I.loading_default),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:p()}),S=n.computed(()=>{const s=o.type;return{[r.bm("icon",s)]:s&&T.TypeComponentsMap[s]}}),m=$.useId(),q=$.useId(),F=n.computed(()=>{const s=o.type;return o.icon||s&&T.TypeComponentsMap[s]||""}),K=n.computed(()=>!!o.message),h=n.ref(),N=n.ref(),b=n.ref(),w=n.ref(),A=n.ref(),U=n.computed(()=>o.confirmButtonClass);n.watch(()=>o.inputValue,async s=>{await n.nextTick(),e.boxType==="prompt"&&s&&O()},{immediate:!0}),n.watch(()=>g.value,s=>{var d,f;s&&(e.boxType!=="prompt"&&(o.autofocus?b.value=(f=(d=A.value)==null?void 0:d.$el)!=null?f:h.value:b.value=h.value),o.zIndex=p()),e.boxType==="prompt"&&(s?n.nextTick().then(()=>{var L;w.value&&w.value.$el&&(o.autofocus?b.value=(L=Z())!=null?L:h.value:b.value=h.value)}):(o.editorErrorMessage="",o.validateError=!1))});const H=n.computed(()=>e.draggable),j=n.computed(()=>e.overflow),{isDragging:G}=ee.useDraggable(h,N,H,j);n.onMounted(async()=>{await n.nextTick(),e.closeOnHashChange&&window.addEventListener("hashchange",B)}),n.onBeforeUnmount(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",B)});function B(){g.value&&(g.value=!1,n.nextTick(()=>{o.action&&t("action",o.action)}))}const D=()=>{e.closeOnClickModal&&k(o.distinguishCancelAndClose?"close":"cancel")},X=V.useSameTarget(D),W=s=>{if(o.inputType!=="textarea")return s.preventDefault(),k("confirm")},k=s=>{var d;e.boxType==="prompt"&&s==="confirm"&&!O()||(o.action=s,o.beforeClose?(d=o.beforeClose)==null||d.call(o,s,o,B):B())},O=()=>{if(e.boxType==="prompt"){const s=o.inputPattern;if(s&&!s.test(o.inputValue||""))return o.editorErrorMessage=o.inputErrorMessage||u("el.messagebox.error"),o.validateError=!0,!1;const d=o.inputValidator;if(c.isFunction(d)){const f=d(o.inputValue);if(f===!1)return o.editorErrorMessage=o.inputErrorMessage||u("el.messagebox.error"),o.validateError=!0,!1;if(c.isString(f))return o.editorErrorMessage=f,o.validateError=!0,!1}}return o.editorErrorMessage="",o.validateError=!1,!0},Z=()=>{var s,d;const f=(s=w.value)==null?void 0:s.$refs;return(d=f==null?void 0:f.input)!=null?d:f==null?void 0:f.textarea},R=()=>{k("close")},J=()=>{e.closeOnPressEscape&&R()};return e.lockScroll&&V.useLockscreen(g),{...n.toRefs(o),ns:r,overlayEvent:X,visible:g,hasMessage:K,typeClass:S,contentId:m,inputId:q,btnSize:l,iconComponent:F,confirmButtonClasses:U,rootRef:h,focusStartRef:b,headerRef:N,inputRef:w,isDragging:G,confirmRef:A,doClose:B,handleClose:R,onCloseRequested:J,handleWrapperClick:D,handleInputEnter:W,handleAction:k,t:u}}});function te(e,t,a,i,r,l){const u=n.resolveComponent("el-icon"),p=n.resolveComponent("el-input"),g=n.resolveComponent("el-button"),o=n.resolveComponent("el-focus-trap"),S=n.resolveComponent("el-overlay");return n.openBlock(),n.createBlock(n.Transition,{name:"fade-in-linear",onAfterLeave:m=>e.$emit("vanish"),persisted:""},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(S,{"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(o,{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.is("dragging",e.isDragging),{[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:m=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:n.withKeys(n.withModifiers(m=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[n.createVNode(u,{class:n.normalizeClass(e.ns.e("close"))},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.closeIcon||"close")))]),_: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,textContent:n.toDisplayString(e.message)},null,8,["for","textContent"]))])],2)):n.createCommentVNode("v-if",!0)],2),n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(e.ns.e("input"))},[n.createVNode(p,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":m=>e.inputValue=m,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(g,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:n.normalizeClass([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:m=>e.handleAction("cancel"),onKeydown:n.withKeys(n.withModifiers(m=>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(g,{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:m=>e.handleAction("confirm"),onKeydown:n.withKeys(n.withModifiers(m=>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 le=c._export_sfc(oe,[["render",te],["__file","index.vue"]]);const E=new Map,se=e=>{let t=document.body;return e.appendTo&&(c.isString(e.appendTo)&&(t=document.querySelector(e.appendTo)),c.isElement(e.appendTo)&&(t=e.appendTo),c.isElement(t)||(t=document.body)),t},ae=(e,t,a=null)=>{const i=n.createVNode(le,e,c.isFunction(e.message)||n.isVNode(e.message)?{default:c.isFunction(e.message)?e.message:()=>e.message}:null);return i.appContext=a,n.render(i,t),se(e).appendChild(t.firstElementChild),i.component},re=()=>document.createElement("div"),ie=(e,t)=>{const a=re();e.onVanish=()=>{n.render(null,a),E.delete(r)},e.onAction=l=>{const u=E.get(r);let p;e.showInput?p={value:r.inputValue,action:l}:p=l,e.callback?e.callback(p,i.proxy):l==="cancel"||l==="close"?e.distinguishCancelAndClose&&l!=="cancel"?u.reject("close"):u.reject("cancel"):u.resolve(p)};const i=ae(e,a,t),r=i.proxy;for(const l in e)c.hasOwn(e,l)&&!c.hasOwn(r.$props,l)&&(l==="closeIcon"&&c.isObject(e[l])?r[l]=n.markRaw(e[l]):r[l]=e[l]);return r.visible=!0,r};function y(e,t=null){if(!c.isClient)return Promise.reject();let a;return c.isString(e)||n.isVNode(e)?e={message:e}:a=e.callback,new Promise((i,r)=>{const l=ie(e,t??y._context);E.set(l,{options:e,callback:a,resolve:i,reject:r})})}const ce=["alert","confirm","prompt"],ue={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};ce.forEach(e=>{y[e]=de(e)});function de(e){return(t,a,i,r)=>{let l="";return c.isObject(a)?(i=a,l=""):c.isUndefined(a)?l="":l=a,y(Object.assign({title:l,message:t,type:"",...ue[e]},i,{boxType:e}),r)}}y.close=()=>{E.forEach((e,t)=>{t.doClose()}),E.clear()};y._context=null;const v=y;v.install=e=>{v._context=e._context,e.config.globalProperties.$msgbox=v,e.config.globalProperties.$messageBox=v,e.config.globalProperties.$alert=v.alert,e.config.globalProperties.$confirm=v.confirm,e.config.globalProperties.$prompt=v.prompt};const fe=v;exports.ElMessageBox=fe;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent as v, ref as y, computed as b, onMounted as C, onUpdated as S, openBlock as T, createBlock as w, resolveDynamicComponent as z, normalizeClass as k, unref as A, normalizeStyle as B, withCtx as E, renderSlot as H, useAttrs as W } from "vue";
|
|
2
|
+
import { b as N, u as P, i as m, _ as R, w as U } from "./base-a5af3db3.js";
|
|
3
|
+
import { k as D, e as F } from "./use-form-common-props-815d48a6.js";
|
|
4
|
+
const I = N({
|
|
5
|
+
type: {
|
|
6
|
+
type: String,
|
|
7
|
+
values: ["primary", "success", "info", "warning", "danger", ""],
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
size: {
|
|
11
|
+
type: String,
|
|
12
|
+
values: D,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
truncated: Boolean,
|
|
16
|
+
lineClamp: {
|
|
17
|
+
type: [String, Number]
|
|
18
|
+
},
|
|
19
|
+
tag: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "span"
|
|
22
|
+
}
|
|
23
|
+
}), K = v({
|
|
24
|
+
name: "ElText"
|
|
25
|
+
}), M = /* @__PURE__ */ v({
|
|
26
|
+
...K,
|
|
27
|
+
props: I,
|
|
28
|
+
setup(_) {
|
|
29
|
+
const l = _, e = y(), h = F(), n = P("text"), x = b(() => [
|
|
30
|
+
n.b(),
|
|
31
|
+
n.m(l.type),
|
|
32
|
+
n.m(h.value),
|
|
33
|
+
n.is("truncated", l.truncated),
|
|
34
|
+
n.is("line-clamp", !m(l.lineClamp))
|
|
35
|
+
]), r = () => {
|
|
36
|
+
var t, o, u, c, d, f, p;
|
|
37
|
+
if (W().title)
|
|
38
|
+
return;
|
|
39
|
+
let a = !1;
|
|
40
|
+
const g = ((t = e.value) == null ? void 0 : t.textContent) || "";
|
|
41
|
+
if (l.truncated) {
|
|
42
|
+
const s = (o = e.value) == null ? void 0 : o.offsetWidth, i = (u = e.value) == null ? void 0 : u.scrollWidth;
|
|
43
|
+
s && i && i > s && (a = !0);
|
|
44
|
+
} else if (!m(l.lineClamp)) {
|
|
45
|
+
const s = (c = e.value) == null ? void 0 : c.offsetHeight, i = (d = e.value) == null ? void 0 : d.scrollHeight;
|
|
46
|
+
s && i && i > s && (a = !0);
|
|
47
|
+
}
|
|
48
|
+
a ? (f = e.value) == null || f.setAttribute("title", g) : (p = e.value) == null || p.removeAttribute("title");
|
|
49
|
+
};
|
|
50
|
+
return C(r), S(r), (t, o) => (T(), w(z(t.tag), {
|
|
51
|
+
ref_key: "textRef",
|
|
52
|
+
ref: e,
|
|
53
|
+
class: k(A(x)),
|
|
54
|
+
style: B({ "-webkit-line-clamp": t.lineClamp })
|
|
55
|
+
}, {
|
|
56
|
+
default: E(() => [
|
|
57
|
+
H(t.$slots, "default")
|
|
58
|
+
]),
|
|
59
|
+
_: 3
|
|
60
|
+
}, 8, ["class", "style"]));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var $ = /* @__PURE__ */ R(M, [["__file", "text.vue"]]);
|
|
64
|
+
const L = U($);
|
|
65
|
+
export {
|
|
66
|
+
L as E
|
|
67
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),n=require("./base-ef747d02.cjs"),_=require("./use-form-common-props-fd9b61a0.cjs"),C=n.buildProps({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:_.componentSizes,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}}),b=e.defineComponent({name:"ElText"}),S=e.defineComponent({...b,props:C,setup(h){const s=h,t=e.ref(),x=_.useFormSize(),i=n.useNamespace("text"),g=e.computed(()=>[i.b(),i.m(s.type),i.m(x.value),i.is("truncated",s.truncated),i.is("line-clamp",!n.isUndefined(s.lineClamp))]),c=()=>{var l,a,d,f,p,m,v;if(e.useAttrs().title)return;let u=!1;const y=((l=t.value)==null?void 0:l.textContent)||"";if(s.truncated){const o=(a=t.value)==null?void 0:a.offsetWidth,r=(d=t.value)==null?void 0:d.scrollWidth;o&&r&&r>o&&(u=!0)}else if(!n.isUndefined(s.lineClamp)){const o=(f=t.value)==null?void 0:f.offsetHeight,r=(p=t.value)==null?void 0:p.scrollHeight;o&&r&&r>o&&(u=!0)}u?(m=t.value)==null||m.setAttribute("title",y):(v=t.value)==null||v.removeAttribute("title")};return e.onMounted(c),e.onUpdated(c),(l,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.tag),{ref_key:"textRef",ref:t,class:e.normalizeClass(e.unref(g)),style:e.normalizeStyle({"-webkit-line-clamp":l.lineClamp})},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},8,["class","style"]))}});var T=n._export_sfc(S,[["__file","text.vue"]]);const z=n.withInstall(T);exports.ElText=z;
|