@dazhicheng/ui 1.6.66 → 1.6.68
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/dist/components/tt-button/index.d.ts +7 -7
- package/dist/components/tt-button/index.vue.d.ts +4 -4
- package/dist/components/tt-button/index.vue2.js +3 -2
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.d.ts +2 -2
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +1 -1
- package/dist/components/tt-input-textarea/index.vue.d.ts +1 -1
- package/dist/components/tt-input-textarea/index.vue.js +3 -2
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +1 -1
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.d.ts +1 -1
- package/dist/components/tt-panel-select/src/index.vue.d.ts +1 -1
- package/dist/components/tt-select/src/Select.vue.d.ts +2 -2
- package/dist/components/tt-table/index.d.ts +2 -2
- package/dist/components/tt-table/index.js +6 -5
- package/dist/components/tt-table/src/Table.vue.d.ts +4 -4
- package/dist/components/tt-table/src/TableForm.vue.d.ts +2 -2
- package/dist/components/tt-table/src/TableForm.vue.js +3 -2
- package/dist/components/tt-table/src/hooks/useSideSlot.d.ts +4 -4
- package/dist/components/tt-table/src/props.d.ts +1 -1
- package/dist/components/tt-upload/src/TtUpload.vue.js +87 -87
- package/dist/directives/auto-tip/index.js +39 -27
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as fe, mergeModels as
|
|
1
|
+
import { defineComponent as fe, mergeModels as R, useModel as me, useSlots as we, ref as $, computed as m, createBlock as ve, openBlock as _e, createVNode as r, mergeProps as ye, createTextVNode as w } from "vue";
|
|
2
2
|
import ge from "../../../assets/svg/exportSvg.svg.js";
|
|
3
|
-
import
|
|
3
|
+
import B from "../../../assets/svg/fileSvg.svg.js";
|
|
4
4
|
import { TtButton as k } from "../../tt-button/index.js";
|
|
5
5
|
import { TtIcon as b } from "../../tt-icon/index.js";
|
|
6
6
|
import "../../tt-modal/index.js";
|
|
@@ -19,43 +19,43 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.j
|
|
|
19
19
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
20
20
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
21
21
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
22
|
-
import { omit as Te, isFunction as
|
|
22
|
+
import { omit as Te, isFunction as M } from "lodash-es";
|
|
23
23
|
import "vue-router";
|
|
24
|
-
import { TtText as
|
|
24
|
+
import { TtText as z } from "../../tt-text/index.js";
|
|
25
25
|
/* empty css */
|
|
26
|
-
import { ttUploadProps as
|
|
26
|
+
import { ttUploadProps as Ce } from "./typing.js";
|
|
27
27
|
import { GlobalConfig as T } from "../../../hooks/useSetup.js";
|
|
28
|
-
import { getFileUrlOss as
|
|
28
|
+
import { getFileUrlOss as Se } from "../../../api/oss.js";
|
|
29
29
|
import { useModalRender as xe } from "../../tt-modal/src/hooks/useModalRender.js";
|
|
30
|
-
const
|
|
30
|
+
const no = /* @__PURE__ */ fe({
|
|
31
31
|
name: "TtUpload",
|
|
32
32
|
__name: "TtUpload",
|
|
33
|
-
props: /* @__PURE__ */
|
|
33
|
+
props: /* @__PURE__ */ R(Ce, {
|
|
34
34
|
modelValue: {
|
|
35
35
|
default: () => []
|
|
36
36
|
},
|
|
37
37
|
modelModifiers: {}
|
|
38
38
|
}),
|
|
39
|
-
emits: /* @__PURE__ */
|
|
40
|
-
setup(
|
|
41
|
-
expose:
|
|
42
|
-
emit:
|
|
39
|
+
emits: /* @__PURE__ */ R(["afterUpload", "preview", "download", "delete", "templateDownload", "ok", "close", "error"], ["update:modelValue"]),
|
|
40
|
+
setup(C, {
|
|
41
|
+
expose: I,
|
|
42
|
+
emit: P
|
|
43
43
|
}) {
|
|
44
|
-
const
|
|
45
|
-
function
|
|
44
|
+
const V = ["modal", "modelValue", "ossType", "uploadOssApi", "uploadTip", "maxSize", "showFileList", "showUploadArea", "showTemplateDownload", "templateText", "showPreview", "showDownload", "showDelete", "gridThreshold", "gridColumns", "showCount", "uploadOssViewApi", "beforeUpload", "onError"], N = /* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "webp", "bmp", "svg"]);
|
|
45
|
+
function D(e) {
|
|
46
46
|
var t;
|
|
47
47
|
const o = ((t = e.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
|
|
48
|
-
return
|
|
48
|
+
return N.has(o);
|
|
49
49
|
}
|
|
50
50
|
function K(e, o, t) {
|
|
51
|
-
var
|
|
51
|
+
var a;
|
|
52
52
|
if (!(t != null && t.trim())) return !0;
|
|
53
|
-
const l = e.includes(".") ? ((
|
|
53
|
+
const l = e.includes(".") ? ((a = e.split(".").pop()) == null ? void 0 : a.toLowerCase()) ?? "" : "";
|
|
54
54
|
return t.split(",").map((c) => c.trim()).filter(Boolean).some((c) => c.startsWith(".") ? l === c.slice(1).toLowerCase() : c.endsWith("/*") ? o.startsWith(c.slice(0, -1)) : o === c);
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const n = C, p = P, u = me(C, "modelValue"), d = we(), {
|
|
57
57
|
prefixCls: i
|
|
58
|
-
} = he("upload"),
|
|
58
|
+
} = he("upload"), S = $(), h = $(!1), x = $([]), [j, v] = xe({
|
|
59
59
|
onOk() {
|
|
60
60
|
p("ok", u.value);
|
|
61
61
|
},
|
|
@@ -66,38 +66,38 @@ const ao = /* @__PURE__ */ fe({
|
|
|
66
66
|
function W() {
|
|
67
67
|
return [...u.value];
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
I({
|
|
70
70
|
openModal: () => {
|
|
71
|
-
|
|
71
|
+
n.showUploadArea && (u.value = []), v.openModal();
|
|
72
72
|
},
|
|
73
73
|
setModalProps: v.setModalProps,
|
|
74
74
|
closeModal: v.closeModal,
|
|
75
75
|
getFileList: W
|
|
76
76
|
});
|
|
77
|
-
const U = m(() => u.value.length >
|
|
77
|
+
const U = m(() => u.value.length > n.gridThreshold), _ = m(() => n.limit ?? 0), y = m(() => n.uploadOssApi ?? T.uploadOssApi), G = m(() => n.uploadOssViewApi ?? T.uploadOssViewApi ?? Se);
|
|
78
78
|
async function q(e, o) {
|
|
79
|
-
const l = (
|
|
80
|
-
|
|
79
|
+
const l = (n.ossDir || o.dir || "notice").replace(/\/+$/, ""), s = l ? `${l}/${Date.now()}_${e.name}` : `${Date.now()}_${e.name}`, a = new FormData();
|
|
80
|
+
a.append("key", s), a.append("policy", o.policy), a.append("x-oss-signature-version", o.version), a.append("x-oss-signature", o.signature), a.append("x-oss-credential", o.x_oss_credential), a.append("x-oss-date", o.x_oss_date), a.append("x-oss-security-token", o.security_token), o.callback && a.append("callback", o.callback), a.append("success_action_status", "200"), a.append("file", e);
|
|
81
81
|
const c = await fetch(o.host, {
|
|
82
82
|
method: "POST",
|
|
83
|
-
body:
|
|
83
|
+
body: a
|
|
84
84
|
});
|
|
85
85
|
if (!c.ok && c.status !== 203 && c.status !== 200)
|
|
86
86
|
throw new Error(`OSS 上传失败: ${c.status}`);
|
|
87
87
|
return s;
|
|
88
88
|
}
|
|
89
89
|
async function H(e, o) {
|
|
90
|
-
const l = (
|
|
91
|
-
|
|
90
|
+
const l = (n.ossDir || o.dir || "notice").replace(/\/+$/, ""), s = l ? `${l}/${Date.now()}_${encodeURIComponent(e.name)}` : `${Date.now()}_${encodeURIComponent(e.name)}`, a = new FormData();
|
|
91
|
+
a.append("key", s), a.append("policy", o.policy), a.append("AccessKeyId", o.accessKeyId), a.append("signature", o.signature), o.security_token && a.append("x-obs-security-token", o.security_token), o.callbackUrl && a.append("callbackUrl", o.callbackUrl), o.callbackBody && a.append("callbackBody", o.callbackBody), o.callbackBodyType && a.append("callbackBodyType", o.callbackBodyType), a.append("success_action_status", "200"), a.append("file", e);
|
|
92
92
|
const c = await fetch(o.host, {
|
|
93
93
|
method: "POST",
|
|
94
|
-
body:
|
|
94
|
+
body: a
|
|
95
95
|
});
|
|
96
96
|
if (!c.ok && c.status !== 204 && c.status !== 200)
|
|
97
97
|
throw new Error(`OBS 上传失败: ${c.status}`);
|
|
98
98
|
return s;
|
|
99
99
|
}
|
|
100
|
-
const X = m(() =>
|
|
100
|
+
const X = m(() => n.ossType ?? T.ossType ?? "huawei");
|
|
101
101
|
async function Y(e, o) {
|
|
102
102
|
return X.value === "aliyun" ? q(e, o) : H(e, o);
|
|
103
103
|
}
|
|
@@ -131,14 +131,14 @@ const ao = /* @__PURE__ */ fe({
|
|
|
131
131
|
var t;
|
|
132
132
|
const o = y.value;
|
|
133
133
|
try {
|
|
134
|
-
const l = await o(e.file), s = await Y(e.file, l),
|
|
134
|
+
const l = await o(e.file), s = await Y(e.file, l), a = n.ossDir || l.dir, c = {
|
|
135
135
|
fileName: e.file.name,
|
|
136
136
|
fileSize: e.file.size ?? 0,
|
|
137
137
|
fileSuffix: ((t = e.file.name.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "",
|
|
138
138
|
file: e.file,
|
|
139
139
|
uid: e.file.uid,
|
|
140
140
|
ossKey: s,
|
|
141
|
-
ossUploadBaseDir:
|
|
141
|
+
ossUploadBaseDir: a
|
|
142
142
|
};
|
|
143
143
|
return u.value = [...u.value, c], f.success("上传成功"), p("afterUpload", c, s), e.onSuccess(c), c;
|
|
144
144
|
} catch (l) {
|
|
@@ -147,10 +147,10 @@ const ao = /* @__PURE__ */ fe({
|
|
|
147
147
|
}
|
|
148
148
|
function Z(e, o, t) {
|
|
149
149
|
var l;
|
|
150
|
-
o.raw && (O(o.raw), p("error", e, o.raw)), (l =
|
|
150
|
+
o.raw && (O(o.raw), p("error", e, o.raw)), (l = n.onError) == null || l.call(n, e, o, t);
|
|
151
151
|
}
|
|
152
152
|
const ee = m(() => ({
|
|
153
|
-
...Te(
|
|
153
|
+
...Te(n, V),
|
|
154
154
|
showFileList: !1,
|
|
155
155
|
beforeUpload: oe,
|
|
156
156
|
onExceed: te,
|
|
@@ -160,10 +160,10 @@ const ao = /* @__PURE__ */ fe({
|
|
|
160
160
|
httpRequest: y.value ? Q : J
|
|
161
161
|
}));
|
|
162
162
|
function oe(e) {
|
|
163
|
-
if (!K(e.name, e.type,
|
|
164
|
-
return f.warning(`文件格式不支持,仅支持:${
|
|
163
|
+
if (!K(e.name, e.type, n.accept))
|
|
164
|
+
return f.warning(`文件格式不支持,仅支持:${n.accept}`), !1;
|
|
165
165
|
const o = u.value.map((t) => ke(t.fileSize) || be(t.fileSize) ? +t.fileSize : 0).reduce((t, l) => t + l, 0);
|
|
166
|
-
return
|
|
166
|
+
return n.maxSize && (e.size + o) / 1024 / 1024 > n.maxSize ? (f.warning(`文件大小不能超过 ${n.maxSize}MB`), !1) : _.value > 0 && u.value.length >= _.value ? (f.warning("已超过上传数量"), !1) : M(n.beforeUpload) ? n.beforeUpload(e) : !0;
|
|
167
167
|
}
|
|
168
168
|
function te() {
|
|
169
169
|
f.warning("已超过上传数量");
|
|
@@ -177,7 +177,7 @@ const ao = /* @__PURE__ */ fe({
|
|
|
177
177
|
if (!o)
|
|
178
178
|
throw new Error("No OssKey");
|
|
179
179
|
const t = u.value.filter((s) => g(s) !== o);
|
|
180
|
-
t.length !== u.value.length && (u.value = t), e.file && ((l =
|
|
180
|
+
t.length !== u.value.length && (u.value = t), e.file && ((l = S.value) == null || l.handleRemove(e.file)), p("delete", e);
|
|
181
181
|
}
|
|
182
182
|
async function E(e) {
|
|
183
183
|
var t;
|
|
@@ -186,150 +186,150 @@ const ao = /* @__PURE__ */ fe({
|
|
|
186
186
|
try {
|
|
187
187
|
const s = (t = (await o({
|
|
188
188
|
filePath: e.ossKey
|
|
189
|
-
})).find((
|
|
189
|
+
})).find((a) => a.fileName === e.ossKey)) == null ? void 0 : t.fileUrl;
|
|
190
190
|
return e.url = s, s;
|
|
191
191
|
} catch (l) {
|
|
192
192
|
f.warning((l == null ? void 0 : l.message) ?? "获取文件地址失败");
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
async function
|
|
197
|
-
const l = await (await fetch(e)).blob(), s = URL.createObjectURL(l),
|
|
198
|
-
|
|
196
|
+
async function ne(e, o) {
|
|
197
|
+
const l = await (await fetch(e)).blob(), s = URL.createObjectURL(l), a = document.createElement("a");
|
|
198
|
+
a.href = s, a.download = o, a.click(), URL.revokeObjectURL(s);
|
|
199
199
|
}
|
|
200
|
-
async function
|
|
200
|
+
async function ae(e) {
|
|
201
201
|
p("preview", e);
|
|
202
202
|
let o = await E(e);
|
|
203
|
-
y.value || (o = URL.createObjectURL(e.file)), o && (
|
|
203
|
+
y.value || (o = URL.createObjectURL(e.file)), o && (D(e.fileName) ? (x.value = [o], h.value = !0) : window.open(o, "_blank"));
|
|
204
204
|
}
|
|
205
|
-
async function
|
|
205
|
+
async function re(e) {
|
|
206
206
|
let o = !1;
|
|
207
|
-
if (o =
|
|
207
|
+
if (o = M(n.beforeDownload) ? !!await n.beforeDownload(e) : n.beforeDownload, !o) {
|
|
208
208
|
p("download", e);
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
let t;
|
|
212
|
-
y.value ? t = await E(e) : t = URL.createObjectURL(e.file), t &&
|
|
212
|
+
y.value ? t = await E(e) : t = URL.createObjectURL(e.file), t && ne(t, e.fileName);
|
|
213
213
|
}
|
|
214
|
-
const ie = () =>
|
|
214
|
+
const ie = () => n.showUploadArea ? r("div", {
|
|
215
215
|
class: `${i}-area`
|
|
216
|
-
}, [
|
|
217
|
-
ref:
|
|
216
|
+
}, [r($e, ye({
|
|
217
|
+
ref: S
|
|
218
218
|
}, ee.value), {
|
|
219
219
|
default: () => {
|
|
220
220
|
var e, o;
|
|
221
|
-
return [((e = d.uploadContent) == null ? void 0 : e.call(d)) ||
|
|
221
|
+
return [((e = d.uploadContent) == null ? void 0 : e.call(d)) || r("div", {
|
|
222
222
|
class: `${i}-dragger`
|
|
223
|
-
}, [
|
|
223
|
+
}, [r(b, {
|
|
224
224
|
icon: ge,
|
|
225
225
|
size: 32,
|
|
226
226
|
isCustomSvg: !0
|
|
227
|
-
}, null),
|
|
227
|
+
}, null), r("div", {
|
|
228
228
|
class: `${i}-dragger__text`
|
|
229
|
-
}, [w("上传附件")]),
|
|
229
|
+
}, [w("上传附件")]), r("div", {
|
|
230
230
|
class: `${i}-dragger__tip`
|
|
231
|
-
}, [((o = d.uploadTip) == null ? void 0 : o.call(d)) ||
|
|
231
|
+
}, [((o = d.uploadTip) == null ? void 0 : o.call(d)) || n.uploadTip]), n.showTemplateDownload && r("div", {
|
|
232
232
|
class: `${i}-dragger__template`,
|
|
233
233
|
onClick: (t) => {
|
|
234
234
|
t.stopPropagation(), p("templateDownload");
|
|
235
235
|
}
|
|
236
|
-
}, [
|
|
236
|
+
}, [n.templateText])])];
|
|
237
237
|
}
|
|
238
238
|
})]) : null, A = (e, o) => d.fileActions ? d.fileActions({
|
|
239
239
|
file: e,
|
|
240
240
|
index: o
|
|
241
|
-
}) :
|
|
241
|
+
}) : r("div", {
|
|
242
242
|
class: `${i}-file__actions`
|
|
243
|
-
}, [
|
|
243
|
+
}, [n.showPreview && r(k, {
|
|
244
244
|
type: "primary",
|
|
245
245
|
link: !0,
|
|
246
|
-
onClick: () =>
|
|
246
|
+
onClick: () => ae(e)
|
|
247
247
|
}, {
|
|
248
248
|
default: () => [w("查看")]
|
|
249
|
-
}),
|
|
249
|
+
}), n.showDownload && r(k, {
|
|
250
250
|
type: "primary",
|
|
251
251
|
link: !0,
|
|
252
|
-
onClick: () =>
|
|
252
|
+
onClick: () => re(e)
|
|
253
253
|
}, {
|
|
254
254
|
default: () => [w("下载")]
|
|
255
|
-
}),
|
|
255
|
+
}), n.showDelete && !n.disabled && r(k, {
|
|
256
256
|
type: "danger",
|
|
257
257
|
link: !0,
|
|
258
258
|
onClick: () => le(e)
|
|
259
259
|
}, {
|
|
260
260
|
default: () => [w("删除")]
|
|
261
|
-
})]), se = (e, o) =>
|
|
261
|
+
})]), se = (e, o) => r("div", {
|
|
262
262
|
class: `${i}-file__card`,
|
|
263
263
|
key: g(e)
|
|
264
|
-
}, [
|
|
264
|
+
}, [r("div", {
|
|
265
265
|
class: `${i}-file__card-header`
|
|
266
|
-
}, [
|
|
266
|
+
}, [r("div", {
|
|
267
267
|
class: `${i}-file__card-icon`
|
|
268
|
-
}, [
|
|
269
|
-
icon:
|
|
268
|
+
}, [r(b, {
|
|
269
|
+
icon: B,
|
|
270
270
|
size: 28,
|
|
271
271
|
isCustomSvg: !0
|
|
272
|
-
}, null)]),
|
|
272
|
+
}, null)]), r("div", {
|
|
273
273
|
class: `${i}-file__card-info`
|
|
274
|
-
}, [
|
|
274
|
+
}, [r(z, {
|
|
275
275
|
class: `${i}-file__card-name`
|
|
276
276
|
}, {
|
|
277
277
|
default: () => [e.fileName]
|
|
278
|
-
})])]),
|
|
278
|
+
})])]), r("div", {
|
|
279
279
|
class: `${i}-file__card-footer`
|
|
280
|
-
}, [A(e, o)])]), ce = (e, o) =>
|
|
280
|
+
}, [A(e, o)])]), ce = (e, o) => r("div", {
|
|
281
281
|
class: `${i}-file__row`,
|
|
282
282
|
key: g(e)
|
|
283
|
-
}, [
|
|
283
|
+
}, [r("div", {
|
|
284
284
|
class: `${i}-file__row-icon`
|
|
285
|
-
}, [
|
|
286
|
-
icon:
|
|
285
|
+
}, [r(b, {
|
|
286
|
+
icon: B,
|
|
287
287
|
size: 28,
|
|
288
288
|
isCustomSvg: !0
|
|
289
|
-
}, null)]),
|
|
289
|
+
}, null)]), r("div", {
|
|
290
290
|
class: `${i}-file__row-info`
|
|
291
|
-
}, [
|
|
291
|
+
}, [r(z, {
|
|
292
292
|
class: `${i}-file__row-name`
|
|
293
293
|
}, {
|
|
294
294
|
default: () => [e.fileName]
|
|
295
|
-
})]),
|
|
295
|
+
})]), r("div", {
|
|
296
296
|
class: `${i}-file__row-actions`
|
|
297
297
|
}, [A(e, o)])]), ue = (e, o) => d.fileItem ? d.fileItem({
|
|
298
298
|
file: e,
|
|
299
299
|
index: o
|
|
300
300
|
}) : U.value ? se(e, o) : ce(e, o), de = () => {
|
|
301
|
-
if (!
|
|
301
|
+
if (!n.showFileList || u.value.length === 0) return null;
|
|
302
302
|
const e = u.value.map((l, s) => ue(l, s)), o = U.value ? `${i}-filelist__grid` : `${i}-filelist__list`, t = U.value ? {
|
|
303
|
-
gridTemplateColumns: `repeat(${
|
|
303
|
+
gridTemplateColumns: `repeat(${n.gridColumns}, 1fr)`
|
|
304
304
|
} : void 0;
|
|
305
|
-
return
|
|
305
|
+
return r("div", {
|
|
306
306
|
class: `${i}-filelist`
|
|
307
|
-
}, [
|
|
307
|
+
}, [r("div", {
|
|
308
308
|
class: o,
|
|
309
309
|
style: t
|
|
310
|
-
}, [e]),
|
|
310
|
+
}, [e]), n.showCount && _.value > 0 && r("div", {
|
|
311
311
|
class: `${i}-filelist__count`
|
|
312
|
-
}, [
|
|
312
|
+
}, [r("span", {
|
|
313
313
|
class: `${i}-filelist__count-current-number`
|
|
314
|
-
}, [u.value.length]),
|
|
314
|
+
}, [u.value.length]), r("span", null, [w(" / ")]), r("span", {
|
|
315
315
|
class: `${i}-filelist__count-total-number`
|
|
316
316
|
}, [_.value])])]);
|
|
317
317
|
}, F = () => {
|
|
318
318
|
var e;
|
|
319
|
-
return
|
|
319
|
+
return r("div", {
|
|
320
320
|
class: i
|
|
321
|
-
}, [ie(), de(), (e = d.footer) == null ? void 0 : e.call(d), h.value &&
|
|
321
|
+
}, [ie(), de(), (e = d.footer) == null ? void 0 : e.call(d), h.value && r(Ue, {
|
|
322
322
|
urlList: x.value,
|
|
323
323
|
hideOnClickModal: !0,
|
|
324
324
|
teleported: !0,
|
|
325
325
|
onClose: () => h.value = !1
|
|
326
326
|
}, null)]);
|
|
327
|
-
}, pe = () =>
|
|
327
|
+
}, pe = () => n.modal ? r(j, null, {
|
|
328
328
|
default: () => F()
|
|
329
329
|
}) : F();
|
|
330
330
|
return (e, o) => (_e(), ve(pe));
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
333
|
export {
|
|
334
|
-
|
|
334
|
+
no as default
|
|
335
335
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { createVNode as
|
|
2
|
-
import { ElTooltip as
|
|
3
|
-
|
|
1
|
+
import { createVNode as i, render as c } from "vue";
|
|
2
|
+
import { ElTooltip as m, ElScrollbar as v } from "element-plus";
|
|
3
|
+
/* empty css */
|
|
4
|
+
const o = {
|
|
4
5
|
value: null
|
|
5
6
|
};
|
|
6
|
-
function
|
|
7
|
-
const e = !!(t != null && t.textContent),
|
|
8
|
-
return e && (
|
|
7
|
+
function f(t) {
|
|
8
|
+
const e = !!(t != null && t.textContent), n = t.scrollWidth > t.clientWidth, l = t.scrollHeight >= t.clientHeight * 1.2;
|
|
9
|
+
return e && (n || l);
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function s(t) {
|
|
11
12
|
const e = t.currentTarget;
|
|
12
|
-
if (
|
|
13
|
-
if (!
|
|
14
|
-
const
|
|
13
|
+
if (o.value && (o.value.props.trigger = "manual"), !!e.boundingValue && f(e)) {
|
|
14
|
+
if (!o.value) {
|
|
15
|
+
const n = i(m, {
|
|
15
16
|
content: "",
|
|
16
17
|
placement: e.boundingValue.placement || "top",
|
|
17
18
|
teleported: !1,
|
|
@@ -26,37 +27,48 @@ function u(t) {
|
|
|
26
27
|
// trigger: 'hover',
|
|
27
28
|
// enterable: true,
|
|
28
29
|
}, {
|
|
29
|
-
content: () =>
|
|
30
|
-
class: "tt-tip-el-popper-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
content: () => i(v, {
|
|
31
|
+
class: "tt-tip-el-popper-scrollbar",
|
|
32
|
+
wrapClass: "tt-tip-el-popper-scrollbar-wrap",
|
|
33
|
+
always: !0,
|
|
34
|
+
maxHeight: e.boundingValue.toolTipMaxHeight || 600
|
|
35
|
+
}, {
|
|
36
|
+
default: () => [i("div", {
|
|
37
|
+
class: "tt-tip-el-popper-content"
|
|
38
|
+
}, [e.textContent])]
|
|
39
|
+
})
|
|
40
|
+
}), l = document.createElement("div");
|
|
41
|
+
c(n, l), document.body.appendChild(l), o.value = n.component;
|
|
34
42
|
}
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
43
|
+
o.value.props.content = e.boundingValue.content || e.textContent, o.value.props.placement = e.boundingValue.placement || "top", o.value.props.fallbackPlacements = ["right", "left", "top", "bottom"], o.value.props.trigger = "hover", o.value.props.popperClass = "tt-tip-el-popper", o.value.props.virtualRef = e, o.value.exposed.onOpen(), setTimeout(() => {
|
|
44
|
+
const n = document.querySelector(".tt-tip-el-popper-content"), l = document.querySelector(".tt-tip-el-popper-scrollbar"), u = document.querySelector(".tt-tip-el-popper-scrollbar-wrap");
|
|
45
|
+
if (n) {
|
|
46
|
+
const a = `${e.boundingValue.toolTipMaxWidth || 400}px`, d = `${e.boundingValue.toolTipMaxHeight || 600}px`;
|
|
47
|
+
l.style.maxWidth = a, u.style.maxHeight = d, n.style.maxWidth = a, n.textContent = e.textContent;
|
|
48
|
+
}
|
|
49
|
+
o.value.exposed.updatePopper();
|
|
38
50
|
}, 20);
|
|
39
51
|
}
|
|
40
52
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
53
|
+
function r() {
|
|
54
|
+
o.value && o.value.exposed.onClose();
|
|
43
55
|
}
|
|
44
56
|
function p(t, {
|
|
45
57
|
value: e = {}
|
|
46
58
|
}) {
|
|
47
|
-
const
|
|
48
|
-
t.boundingValue =
|
|
59
|
+
const n = e === void 0 ? {} : e;
|
|
60
|
+
t.boundingValue = n, n && !(n != null && n.listened) && (t.addEventListener("mouseenter", s), t.addEventListener("mouseleave", r), t.boundingValue.listened = !0);
|
|
49
61
|
}
|
|
50
|
-
function
|
|
62
|
+
function b(t) {
|
|
51
63
|
var e;
|
|
52
|
-
(e = t.boundingValue) != null && e.listened && (t.removeEventListener("mouseenter",
|
|
64
|
+
(e = t.boundingValue) != null && e.listened && (t.removeEventListener("mouseenter", s), t.removeEventListener("mouseleave", r), o.value && o.value.exposed.onClose());
|
|
53
65
|
}
|
|
54
|
-
const
|
|
66
|
+
const C = {
|
|
55
67
|
created: p,
|
|
56
68
|
beforeMount: p,
|
|
57
69
|
updated: p,
|
|
58
|
-
unmounted:
|
|
70
|
+
unmounted: b
|
|
59
71
|
};
|
|
60
72
|
export {
|
|
61
|
-
|
|
73
|
+
C as default
|
|
62
74
|
};
|