yahee-components 0.0.100 → 0.0.103
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/es/_virtual/_commonjs-dynamic-modules.js +6 -0
- package/es/_virtual/jszip.min.js +7 -0
- package/es/_virtual/jszip.min2.js +4 -0
- package/es/drop-down-condition/drop-down-condition.vue.js +5 -223
- package/es/drop-down-condition/drop-down-condition.vue2.js +220 -2
- package/es/file-download-wrapper/file-download-wrapper.vue.js +265 -0
- package/es/file-download-wrapper/file-download-wrapper.vue2.js +4 -0
- package/es/file-download-wrapper/index.js +7 -0
- package/es/file-download-wrapper/key.js +17 -0
- package/es/file-download-wrapper/props.js +12 -0
- package/es/file-download-wrapper/style/index.css +66 -0
- package/es/height-collapse/height-collapse.vue.js +53 -0
- package/es/height-collapse/height-collapse.vue2.js +4 -0
- package/es/height-collapse/index.js +7 -0
- package/es/height-collapse/props.js +11 -0
- package/es/height-collapse/style/index.css +32 -0
- package/es/index.js +56 -50
- package/es/installs.js +22 -20
- package/es/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min.js +2320 -0
- package/es/style.css +99 -4
- package/lib/file-download-wrapper/style/index.css +66 -0
- package/lib/height-collapse/style/index.css +32 -0
- package/lib/style.css +99 -4
- package/package.json +4 -3
- package/types/src/annex-upload/annex-upload.vue.d.ts +8 -8
- package/types/src/annex-upload/index.d.ts +4 -4
- package/types/src/components.d.ts +2 -1
- package/types/src/drop-down-condition/drop-down-condition.vue.d.ts +30 -16
- package/types/src/drop-down-condition/props.d.ts +1 -1
- package/types/src/file-download-wrapper/file-download-wrapper.d.ts +11 -0
- package/types/src/file-download-wrapper/file-download-wrapper.vue.d.ts +4 -0
- package/types/src/file-download-wrapper/index.d.ts +8 -0
- package/types/src/file-download-wrapper/key.d.ts +20 -0
- package/types/src/file-download-wrapper/props.d.ts +21 -0
- package/types/src/filter-container/filter-container.d.ts +2 -0
- package/types/src/filter-container/props.d.ts +0 -2
- package/types/src/filter-wrapper/index.d.ts +2 -1
- package/types/src/height-collapse/height-collapse.vue.d.ts +32 -0
- package/types/src/height-collapse/index.d.ts +50 -0
- package/types/src/height-collapse/props.d.ts +11 -0
- package/types/src/help-tag/help-tag.vue.d.ts +5 -5
- package/types/src/help-tag/index.d.ts +5 -5
- package/types/src/help-tag/props.d.ts +5 -5
- package/types/src/operation-log/index.d.ts +2 -2
- package/types/src/operation-log/operation-log.vue.d.ts +2 -2
- package/types/src/operation-log/props.d.ts +1 -1
- package/types/src/scale-screen/props.d.ts +2 -2
- package/es/input/index.js +0 -7
- package/es/input/input.vue.js +0 -40
- package/es/input/input.vue2.js +0 -4
- package/es/input/style/index.css +0 -3
- package/lib/input/style/index.css +0 -3
- package/types/src/drop-down-condition/index.d.ts +0 -462
- package/types/src/input/index.d.ts +0 -515
- package/types/src/input/input.d.ts +0 -18
- package/types/src/input/input.vue.d.ts +0 -513
- package/types/src/installs.d.ts +0 -3481
- package/types/src/shared/hello.d.ts +0 -1
- package/types/src/shared/index.d.ts +0 -2
- package/types/src/shared/typeCheck.d.ts +0 -2
- package/types/src/shared/types/InferVueDefaults.d.ts +0 -7
- package/types/src/shared/types/index.d.ts +0 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { defineComponent as K, ref as R, watch as Q, onMounted as ee, computed as V, resolveComponent as F, createElementBlock as c, openBlock as s, createCommentVNode as B, createElementVNode as i, createVNode as k, withCtx as C, createTextVNode as D, toDisplayString as p, Fragment as te, renderList as le, createBlock as oe, unref as n, withModifiers as se } from "vue";
|
|
2
|
+
import { ElMessage as v } from "element-plus";
|
|
3
|
+
import "element-plus/theme-chalk/src/base.scss";
|
|
4
|
+
import "element-plus/theme-chalk/src/badge.scss";
|
|
5
|
+
import "element-plus/theme-chalk/src/message.scss";
|
|
6
|
+
import ie from "../_virtual/jszip.min.js";
|
|
7
|
+
import { Document as z } from "@element-plus/icons-vue";
|
|
8
|
+
import { FILE_TYPE_REGEX as g } from "./key.js";
|
|
9
|
+
import E from "../packages/components/hooks/useImgPath.js";
|
|
10
|
+
const ce = { class: "yahee-file-download-wrapper" }, ne = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "batch-toolbar"
|
|
13
|
+
}, ae = { class: "file-list" }, re = { class: "file-item" }, de = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "image-item"
|
|
16
|
+
}, me = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "document-item"
|
|
19
|
+
}, fe = ["src"], he = ["href"], ue = {
|
|
20
|
+
key: 2,
|
|
21
|
+
class: "document-item"
|
|
22
|
+
}, _e = ["src"], pe = ["href"], ke = {
|
|
23
|
+
key: 3,
|
|
24
|
+
class: "document-item"
|
|
25
|
+
}, we = ["src"], ve = ["href"], ge = {
|
|
26
|
+
key: 4,
|
|
27
|
+
class: "document-item"
|
|
28
|
+
}, be = ["src"], ye = ["href"], Ne = {
|
|
29
|
+
key: 5,
|
|
30
|
+
class: "document-item"
|
|
31
|
+
}, Ue = ["onClick"], $e = {
|
|
32
|
+
key: 6,
|
|
33
|
+
class: "document-item"
|
|
34
|
+
}, Fe = ["href"], Ce = {
|
|
35
|
+
key: 7,
|
|
36
|
+
class: "file-name"
|
|
37
|
+
}, y = "[文件批量下载调试]", Pe = /* @__PURE__ */ K({
|
|
38
|
+
__name: "file-download-wrapper",
|
|
39
|
+
props: {
|
|
40
|
+
fileId: {},
|
|
41
|
+
fileName: {},
|
|
42
|
+
fileUrl: {},
|
|
43
|
+
files: {},
|
|
44
|
+
showBatchDownload: { type: Boolean }
|
|
45
|
+
},
|
|
46
|
+
setup(P) {
|
|
47
|
+
const a = P, o = (e, l) => {
|
|
48
|
+
l ? console.log(`${y} ${e}`, l) : console.log(`${y} ${e}`);
|
|
49
|
+
}, h = R([]), L = R(!1), x = () => {
|
|
50
|
+
var e;
|
|
51
|
+
if ((e = a.files) != null && e.length) {
|
|
52
|
+
h.value = a.files.map((l) => ({
|
|
53
|
+
...l,
|
|
54
|
+
checked: !1
|
|
55
|
+
})), o("初始化多文件列表:", h.value);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
a.fileName && (h.value = [
|
|
59
|
+
{
|
|
60
|
+
fileId: a.fileId,
|
|
61
|
+
fileName: a.fileName,
|
|
62
|
+
fileUrl: a.fileUrl,
|
|
63
|
+
checked: !1
|
|
64
|
+
}
|
|
65
|
+
], o("初始化单文件列表:", h.value));
|
|
66
|
+
};
|
|
67
|
+
Q(
|
|
68
|
+
() => [a.files, a.fileId, a.fileName, a.fileUrl],
|
|
69
|
+
() => x(),
|
|
70
|
+
{ deep: !0, immediate: !0 }
|
|
71
|
+
), ee(() => x());
|
|
72
|
+
const N = V(() => {
|
|
73
|
+
const e = h.value.filter((l) => l.checked);
|
|
74
|
+
return o("当前选中的文件:", e), e;
|
|
75
|
+
}), T = V(() => h.value.length > 1 && a.showBatchDownload), r = (e) => e.fileUrl ? e.fileUrl : e.fileId ? `https://imgs.yaheecloud.com/${e.fileId}` : "", M = {
|
|
76
|
+
isImageFile: (e) => g.image.test(e),
|
|
77
|
+
isWordFile: (e) => g.word.test(e),
|
|
78
|
+
isPdfFile: (e) => g.pdf.test(e),
|
|
79
|
+
isPptFile: (e) => g.ppt.test(e),
|
|
80
|
+
isExcelFile: (e) => g.excel.test(e),
|
|
81
|
+
isTxtFile: (e) => g.txt.test(e)
|
|
82
|
+
}, { isImageFile: O, isWordFile: j, isPdfFile: A, isPptFile: S, isExcelFile: G, isTxtFile: X } = M, J = () => {
|
|
83
|
+
L.value = h.value.every((e) => e.checked);
|
|
84
|
+
}, W = (e) => {
|
|
85
|
+
h.value.forEach((l) => {
|
|
86
|
+
l.checked = e;
|
|
87
|
+
});
|
|
88
|
+
}, Y = async (e) => {
|
|
89
|
+
try {
|
|
90
|
+
const l = r(e);
|
|
91
|
+
o("开始单个TXT文件下载,URL:", l), o("使用的文件名:", e.fileName);
|
|
92
|
+
const u = await fetch(l);
|
|
93
|
+
if (!u.ok) throw new Error("文件请求失败");
|
|
94
|
+
const w = await u.blob(), f = window.URL.createObjectURL(w), d = document.createElement("a");
|
|
95
|
+
d.href = f, d.download = e.fileName, document.body.appendChild(d), d.click(), document.body.removeChild(d), window.URL.revokeObjectURL(f), v.success("下载成功");
|
|
96
|
+
} catch (l) {
|
|
97
|
+
console.error(`${y} TXT文件下载失败:`, l), v.error("文件下载失败,请重试");
|
|
98
|
+
}
|
|
99
|
+
}, Z = async () => {
|
|
100
|
+
if (N.value.length === 0) {
|
|
101
|
+
v.warning("请先选择要下载的文件");
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
o("========== 开始批量下载流程 ==========");
|
|
105
|
+
const e = new ie(), l = [];
|
|
106
|
+
v.info("正在加载文件并打包,请稍候...");
|
|
107
|
+
try {
|
|
108
|
+
N.value.forEach((d, t) => {
|
|
109
|
+
const U = r(d), m = d.fileName;
|
|
110
|
+
o(`[文件 ${t + 1}] 开始处理`), o(`[文件 ${t + 1}] 请求URL:`, U), o(`[文件 ${t + 1}] 使用的文件名:`, m);
|
|
111
|
+
const q = fetch(U).then((_) => {
|
|
112
|
+
if (!_.ok) throw new Error(`【${m}】加载失败,状态码:${_.status}`);
|
|
113
|
+
return _.blob();
|
|
114
|
+
}).then((_) => {
|
|
115
|
+
let b = m, I = 1;
|
|
116
|
+
for (; e.files[b]; ) {
|
|
117
|
+
const $ = m.lastIndexOf("."), H = $ > -1 ? m.slice($) : "";
|
|
118
|
+
b = `${$ > -1 ? m.slice(0, $) : m}(${I})${H}`, I++;
|
|
119
|
+
}
|
|
120
|
+
b !== m && o(`[文件 ${t + 1}] 检测到重名,重命名为:`, b), e.file(b, _), o(`[文件 ${t + 1}] 已加入压缩包`);
|
|
121
|
+
}).catch((_) => {
|
|
122
|
+
throw console.error(`${y} [文件 ${t + 1}] 处理失败:`, _), _;
|
|
123
|
+
});
|
|
124
|
+
l.push(q);
|
|
125
|
+
}), o("等待所有文件加载完成..."), await Promise.all(l), o("所有文件加载完成,开始生成压缩包...");
|
|
126
|
+
const u = await e.generateAsync({ type: "blob" }), w = window.URL.createObjectURL(u), f = document.createElement("a");
|
|
127
|
+
f.href = w, f.download = `批量文件下载_${Date.now()}.zip`, document.body.appendChild(f), f.click(), document.body.removeChild(f), window.URL.revokeObjectURL(w), o("========== 批量下载流程完成 =========="), v.success("批量打包下载完成");
|
|
128
|
+
} catch (u) {
|
|
129
|
+
console.error(`${y} 批量下载失败:`, u), v.error("打包下载失败,请检查控制台日志");
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
return (e, l) => {
|
|
133
|
+
const u = F("el-checkbox"), w = F("el-button"), f = F("el-image"), d = F("el-icon");
|
|
134
|
+
return s(), c("div", ce, [
|
|
135
|
+
T.value ? (s(), c("div", ne, [
|
|
136
|
+
k(u, {
|
|
137
|
+
modelValue: L.value,
|
|
138
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => L.value = t),
|
|
139
|
+
onChange: W
|
|
140
|
+
}, {
|
|
141
|
+
default: C(() => l[1] || (l[1] = [
|
|
142
|
+
D("全选")
|
|
143
|
+
])),
|
|
144
|
+
_: 1,
|
|
145
|
+
__: [1]
|
|
146
|
+
}, 8, ["modelValue"]),
|
|
147
|
+
k(w, {
|
|
148
|
+
type: "primary",
|
|
149
|
+
size: "small",
|
|
150
|
+
disabled: N.value.length === 0,
|
|
151
|
+
onClick: Z
|
|
152
|
+
}, {
|
|
153
|
+
default: C(() => [
|
|
154
|
+
D(" 下载选中文件(" + p(N.value.length) + ") ", 1)
|
|
155
|
+
]),
|
|
156
|
+
_: 1
|
|
157
|
+
}, 8, ["disabled"])
|
|
158
|
+
])) : B("", !0),
|
|
159
|
+
i("div", ae, [
|
|
160
|
+
(s(!0), c(te, null, le(h.value, (t, U) => (s(), c("div", {
|
|
161
|
+
key: `file-${U}`,
|
|
162
|
+
class: "file-row"
|
|
163
|
+
}, [
|
|
164
|
+
T.value ? (s(), oe(u, {
|
|
165
|
+
key: 0,
|
|
166
|
+
modelValue: t.checked,
|
|
167
|
+
"onUpdate:modelValue": (m) => t.checked = m,
|
|
168
|
+
class: "file-checkbox",
|
|
169
|
+
onChange: J
|
|
170
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : B("", !0),
|
|
171
|
+
i("div", re, [
|
|
172
|
+
n(O)(r(t)) ? (s(), c("div", de, [
|
|
173
|
+
k(f, {
|
|
174
|
+
class: "file-image",
|
|
175
|
+
src: r(t),
|
|
176
|
+
"preview-src-list": [r(t)],
|
|
177
|
+
fit: "contain",
|
|
178
|
+
"preview-teleported": !0
|
|
179
|
+
}, null, 8, ["src", "preview-src-list"])
|
|
180
|
+
])) : n(j)(t.fileName) ? (s(), c("div", me, [
|
|
181
|
+
i("img", {
|
|
182
|
+
src: n(E)("file-word.png"),
|
|
183
|
+
class: "file-icon",
|
|
184
|
+
alt: "word"
|
|
185
|
+
}, null, 8, fe),
|
|
186
|
+
i("a", {
|
|
187
|
+
href: r(t),
|
|
188
|
+
target: "_blank",
|
|
189
|
+
class: "file-link"
|
|
190
|
+
}, p(t.fileName), 9, he)
|
|
191
|
+
])) : n(A)(t.fileName) ? (s(), c("div", ue, [
|
|
192
|
+
i("img", {
|
|
193
|
+
src: n(E)("pdf.png"),
|
|
194
|
+
class: "file-icon",
|
|
195
|
+
alt: "pdf"
|
|
196
|
+
}, null, 8, _e),
|
|
197
|
+
i("a", {
|
|
198
|
+
href: r(t),
|
|
199
|
+
target: "_blank",
|
|
200
|
+
class: "file-link"
|
|
201
|
+
}, p(t.fileName), 9, pe)
|
|
202
|
+
])) : n(S)(t.fileName) ? (s(), c("div", ke, [
|
|
203
|
+
i("img", {
|
|
204
|
+
src: n(E)("ppt.png"),
|
|
205
|
+
class: "file-icon",
|
|
206
|
+
alt: "ppt"
|
|
207
|
+
}, null, 8, we),
|
|
208
|
+
i("a", {
|
|
209
|
+
href: r(t),
|
|
210
|
+
target: "_blank",
|
|
211
|
+
class: "file-link"
|
|
212
|
+
}, p(t.fileName), 9, ve)
|
|
213
|
+
])) : n(G)(t.fileName) ? (s(), c("div", ge, [
|
|
214
|
+
i("img", {
|
|
215
|
+
src: n(E)("excel.png"),
|
|
216
|
+
class: "file-icon",
|
|
217
|
+
alt: "excel"
|
|
218
|
+
}, null, 8, be),
|
|
219
|
+
i("a", {
|
|
220
|
+
href: r(t),
|
|
221
|
+
target: "_blank",
|
|
222
|
+
class: "file-link"
|
|
223
|
+
}, p(t.fileName), 9, ye)
|
|
224
|
+
])) : n(X)(t.fileName) ? (s(), c("div", Ne, [
|
|
225
|
+
k(d, {
|
|
226
|
+
size: "24",
|
|
227
|
+
class: "file-icon"
|
|
228
|
+
}, {
|
|
229
|
+
default: C(() => [
|
|
230
|
+
k(n(z))
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
}),
|
|
234
|
+
i("a", {
|
|
235
|
+
class: "file-link",
|
|
236
|
+
onClick: se((m) => Y(t), ["prevent"])
|
|
237
|
+
}, p(t.fileName), 9, Ue)
|
|
238
|
+
])) : r(t) ? (s(), c("div", $e, [
|
|
239
|
+
k(d, {
|
|
240
|
+
size: "24",
|
|
241
|
+
class: "file-icon"
|
|
242
|
+
}, {
|
|
243
|
+
default: C(() => [
|
|
244
|
+
k(n(z))
|
|
245
|
+
]),
|
|
246
|
+
_: 1
|
|
247
|
+
}),
|
|
248
|
+
i("a", {
|
|
249
|
+
href: r(t),
|
|
250
|
+
target: "_blank",
|
|
251
|
+
class: "file-link"
|
|
252
|
+
}, p(t.fileName), 9, Fe)
|
|
253
|
+
])) : (s(), c("div", Ce, [
|
|
254
|
+
i("span", null, p(t.fileName), 1)
|
|
255
|
+
]))
|
|
256
|
+
])
|
|
257
|
+
]))), 128))
|
|
258
|
+
])
|
|
259
|
+
]);
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
export {
|
|
264
|
+
Pe as default
|
|
265
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const p = {
|
|
2
|
+
/** 图片文件 */
|
|
3
|
+
image: /\.(png|jpg|jpeg|gif|webp|svg|bmp)$/i,
|
|
4
|
+
/** Word文档 */
|
|
5
|
+
word: /\.(doc|docx|docm|dot|dotx)$/i,
|
|
6
|
+
/** PDF文档 */
|
|
7
|
+
pdf: /\.pdf$/i,
|
|
8
|
+
/** PPT演示文档 */
|
|
9
|
+
ppt: /\.(ppt|pptx|pptm|pot|potx)$/i,
|
|
10
|
+
/** Excel表格 */
|
|
11
|
+
excel: /\.(xls|xlsx|xlsm|csv|xlt|xltx)$/i,
|
|
12
|
+
/** TXT文本文件 */
|
|
13
|
+
txt: /\.txt$/i
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
p as FILE_TYPE_REGEX
|
|
17
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.yahee-file-download-wrapper {
|
|
2
|
+
width: 100%;
|
|
3
|
+
padding: 8px 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
.yahee-file-download-wrapper .batch-toolbar {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 12px;
|
|
10
|
+
margin-bottom: 12px;
|
|
11
|
+
padding-bottom: 8px;
|
|
12
|
+
}
|
|
13
|
+
.yahee-file-download-wrapper .file-list {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 10px;
|
|
17
|
+
}
|
|
18
|
+
.yahee-file-download-wrapper .file-row {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
.yahee-file-download-wrapper .file-row .file-checkbox {
|
|
25
|
+
margin-top: 2px;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
}
|
|
28
|
+
.yahee-file-download-wrapper .file-item {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 8px;
|
|
32
|
+
flex: 1;
|
|
33
|
+
min-width: 0;
|
|
34
|
+
}
|
|
35
|
+
.yahee-file-download-wrapper .file-item .image-item .file-image {
|
|
36
|
+
max-width: 200px;
|
|
37
|
+
max-height: 200px;
|
|
38
|
+
border: 1px solid #dcdfe6;
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
.yahee-file-download-wrapper .file-item .document-item {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 8px;
|
|
46
|
+
}
|
|
47
|
+
.yahee-file-download-wrapper .file-item .document-item .file-icon {
|
|
48
|
+
width: 24px;
|
|
49
|
+
height: 24px;
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
}
|
|
52
|
+
.yahee-file-download-wrapper .file-item .document-item .file-link {
|
|
53
|
+
color: #409eff;
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
word-break: break-all;
|
|
56
|
+
flex: 1;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
}
|
|
60
|
+
.yahee-file-download-wrapper .file-item .document-item .file-link:hover {
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
}
|
|
63
|
+
.yahee-file-download-wrapper .file-item .file-name {
|
|
64
|
+
color: #606266;
|
|
65
|
+
word-break: break-all;
|
|
66
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent as x, mergeDefaults as w, ref as s, watch as H, onMounted as y, onUnmounted as T, createElementBlock as u, openBlock as p, createElementVNode as k, createCommentVNode as E, normalizeStyle as v, renderSlot as _, normalizeClass as C, toDisplayString as z, nextTick as d } from "vue";
|
|
2
|
+
import { defaultHeightCollapseProps as B } from "./props.js";
|
|
3
|
+
const R = { class: "yahee-height-collapse-wrapper" }, S = ["title"], L = /* @__PURE__ */ x({
|
|
4
|
+
__name: "height-collapse",
|
|
5
|
+
props: /* @__PURE__ */ w({
|
|
6
|
+
maxHeight: {},
|
|
7
|
+
defaultExpand: { type: Boolean },
|
|
8
|
+
expandTitle: {},
|
|
9
|
+
collapseTitle: {}
|
|
10
|
+
}, B()),
|
|
11
|
+
emits: ["change"],
|
|
12
|
+
setup(m, { emit: h }) {
|
|
13
|
+
const l = m, f = h, e = s(l.defaultExpand), c = s(!1), t = s(null), i = s(l.maxHeight + 5);
|
|
14
|
+
let o = null;
|
|
15
|
+
const r = () => {
|
|
16
|
+
if (!t.value) {
|
|
17
|
+
i.value = l.maxHeight + 5;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
e.value ? i.value = t.value.scrollHeight : i.value = Math.min(t.value.clientHeight, l.maxHeight);
|
|
21
|
+
}, n = async () => {
|
|
22
|
+
if (await d(), !t.value) return;
|
|
23
|
+
const { scrollHeight: a } = t.value;
|
|
24
|
+
c.value = a > l.maxHeight, r();
|
|
25
|
+
}, g = async () => {
|
|
26
|
+
e.value = !e.value, f("change", e.value), await d(), r();
|
|
27
|
+
};
|
|
28
|
+
return H(() => l.maxHeight, n), y(() => {
|
|
29
|
+
n(), t.value && (o = new ResizeObserver(n), o.observe(t.value)), window.addEventListener("resize", n);
|
|
30
|
+
}), T(() => {
|
|
31
|
+
o == null || o.disconnect(), window.removeEventListener("resize", n);
|
|
32
|
+
}), (a, $) => (p(), u("div", R, [
|
|
33
|
+
k("div", {
|
|
34
|
+
ref_key: "contentRef",
|
|
35
|
+
ref: t,
|
|
36
|
+
class: "height-collapse-content",
|
|
37
|
+
style: v(e.value ? {} : { maxHeight: `${a.maxHeight}px`, overflow: "hidden" })
|
|
38
|
+
}, [
|
|
39
|
+
_(a.$slots, "default")
|
|
40
|
+
], 4),
|
|
41
|
+
c.value ? (p(), u("div", {
|
|
42
|
+
key: 0,
|
|
43
|
+
title: e.value ? a.expandTitle : a.collapseTitle,
|
|
44
|
+
class: C(["show-filters", { more: !e.value }]),
|
|
45
|
+
style: v({ top: `${i.value}px` }),
|
|
46
|
+
onClick: g
|
|
47
|
+
}, z(e.value ? "∧" : "∨"), 15, S)) : E("", !0)
|
|
48
|
+
]));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
L as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.yahee-height-collapse-wrapper {
|
|
3
|
+
width: 100%;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
.yahee-height-collapse-wrapper .height-collapse-content {
|
|
7
|
+
width: 100%;
|
|
8
|
+
transition: max-height 0.2s ease;
|
|
9
|
+
}
|
|
10
|
+
.yahee-height-collapse-wrapper .show-filters {
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
width: 100%;
|
|
13
|
+
background: #eaeded;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
color: #3366cc;
|
|
16
|
+
text-align: center;
|
|
17
|
+
font-size: 10px;
|
|
18
|
+
height: 12px;
|
|
19
|
+
z-index: 1111;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
position: absolute;
|
|
22
|
+
margin: 0;
|
|
23
|
+
border-bottom: 1px solid #3366cc;
|
|
24
|
+
border-top: 1px solid #ddd;
|
|
25
|
+
line-height: 9px;
|
|
26
|
+
left: 0;
|
|
27
|
+
/* 收起状态的额外样式可以通过 .show-filters.more 来扩展 */
|
|
28
|
+
}
|
|
29
|
+
.yahee-height-collapse-wrapper .show-filters:hover {
|
|
30
|
+
background: #9bafbf;
|
|
31
|
+
color: #fff;
|
|
32
|
+
}
|
package/es/index.js
CHANGED
|
@@ -1,57 +1,63 @@
|
|
|
1
1
|
import { makeInstaller as o } from "./utils/install.js";
|
|
2
2
|
import r from "./installs.js";
|
|
3
3
|
import { config as t } from "./utils/config.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
import { YaheeComplexSearch as i } from "./complex-search/index.js";
|
|
5
|
+
import { YaheeCopy as s } from "./copy/index.js";
|
|
6
|
+
import { YaheeImageUpload as u } from "./image-upload/index.js";
|
|
7
|
+
import { YaheeAnnexUpload as c } from "./annex-upload/index.js";
|
|
8
|
+
import { YaheeOperationLog as P } from "./operation-log/index.js";
|
|
9
|
+
import { YaheeCountryPlatformShopCondition as W } from "./country-platform-shop-condition/index.js";
|
|
10
|
+
import { YaheeLeftCondition as F } from "./left-condition/index.js";
|
|
11
|
+
import { YaheeLeftConditionEnum as w } from "./left-condition-enum/index.js";
|
|
12
|
+
import { YaheeDropDownCondition as E } from "./drop-down-condition/index.js";
|
|
13
|
+
import { YaheeCommonImport as I } from "./common-import/index.js";
|
|
14
|
+
import { YaheeBorderWrap as B } from "./border-wrap/index.js";
|
|
15
|
+
import { YaheeEchartGauge as U } from "./echart-gauge/index.js";
|
|
16
|
+
import { YaheeScaleScreen as k } from "./scale-screen/index.js";
|
|
17
|
+
import { YaheeHelpTag as O } from "./help-tag/index.js";
|
|
18
|
+
import { YaheeFilterContainer as q } from "./filter-container/index.js";
|
|
19
|
+
import { YaheeFilterWrapper as z } from "./filter-wrapper/index.js";
|
|
20
|
+
import { YaheeHeightCollapse as K } from "./height-collapse/index.js";
|
|
21
|
+
import { YaheeFileDownloadWrapper as N } from "./file-download-wrapper/index.js";
|
|
22
|
+
import { defaultComplexSearchProps as R } from "./complex-search/props.js";
|
|
23
|
+
import { defaultCopyProps as X } from "./copy/props.js";
|
|
24
|
+
import { defaultBorderWrapPropsProps as _ } from "./border-wrap/props.js";
|
|
25
|
+
import { defaultEchartGaugeProps as ee } from "./echart-gauge/props.js";
|
|
26
|
+
import { defaultScaleScreenProps as re } from "./scale-screen/props.js";
|
|
27
|
+
import { defaultHelpTagProps as pe } from "./help-tag/props.js";
|
|
28
|
+
import { defaultHeightCollapseProps as fe } from "./height-collapse/props.js";
|
|
29
|
+
import { defaultFileDownloadWrapperProps as le } from "./file-download-wrapper/props.js";
|
|
30
|
+
const { setConfig: p } = t(), l = o([...r]);
|
|
31
|
+
function n(e) {
|
|
29
32
|
p(e);
|
|
30
33
|
}
|
|
31
34
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
R as
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
35
|
+
c as YaheeAnnexUpload,
|
|
36
|
+
B as YaheeBorderWrap,
|
|
37
|
+
I as YaheeCommonImport,
|
|
38
|
+
i as YaheeComplexSearch,
|
|
39
|
+
s as YaheeCopy,
|
|
40
|
+
W as YaheeCountryPlatformShopCondition,
|
|
41
|
+
E as YaheeDropDownCondition,
|
|
42
|
+
U as YaheeEchartGauge,
|
|
43
|
+
N as YaheeFileDownloadWrapper,
|
|
44
|
+
q as YaheeFilterContainer,
|
|
45
|
+
z as YaheeFilterWrapper,
|
|
46
|
+
K as YaheeHeightCollapse,
|
|
47
|
+
O as YaheeHelpTag,
|
|
48
|
+
u as YaheeImageUpload,
|
|
49
|
+
F as YaheeLeftCondition,
|
|
50
|
+
w as YaheeLeftConditionEnum,
|
|
51
|
+
P as YaheeOperationLog,
|
|
52
|
+
k as YaheeScaleScreen,
|
|
53
|
+
l as default,
|
|
54
|
+
_ as defaultBorderWrapPropsProps,
|
|
55
|
+
R as defaultComplexSearchProps,
|
|
56
|
+
X as defaultCopyProps,
|
|
57
|
+
ee as defaultEchartGaugeProps,
|
|
58
|
+
le as defaultFileDownloadWrapperProps,
|
|
59
|
+
fe as defaultHeightCollapseProps,
|
|
60
|
+
pe as defaultHelpTagProps,
|
|
61
|
+
re as defaultScaleScreenProps,
|
|
62
|
+
n as useGlobalConfig
|
|
57
63
|
};
|
package/es/installs.js
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { YaheeOperationLog as t } from "./operation-log/index.js";
|
|
1
|
+
import { YaheeComplexSearch as o } from "./complex-search/index.js";
|
|
2
|
+
import { YaheeCopy as e } from "./copy/index.js";
|
|
3
|
+
import { YaheeImageUpload as r } from "./image-upload/index.js";
|
|
4
|
+
import { YaheeOperationLog as m } from "./operation-log/index.js";
|
|
6
5
|
import { YaheeAnnexUpload as a } from "./annex-upload/index.js";
|
|
7
|
-
import { YaheeLeftCondition as
|
|
8
|
-
import { YaheeLeftConditionEnum as
|
|
9
|
-
import { YaheeDropDownCondition as
|
|
10
|
-
import { YaheeCountryPlatformShopCondition as
|
|
6
|
+
import { YaheeLeftCondition as t } from "./left-condition/index.js";
|
|
7
|
+
import { YaheeLeftConditionEnum as p } from "./left-condition-enum/index.js";
|
|
8
|
+
import { YaheeDropDownCondition as i } from "./drop-down-condition/index.js";
|
|
9
|
+
import { YaheeCountryPlatformShopCondition as f } from "./country-platform-shop-condition/index.js";
|
|
11
10
|
import { YaheeCommonImport as h } from "./common-import/index.js";
|
|
12
|
-
import { YaheeBorderWrap as
|
|
13
|
-
import { YaheeEchartGauge as
|
|
14
|
-
import { YaheeScaleScreen as
|
|
15
|
-
import { YaheeHelpTag as
|
|
16
|
-
import { YaheeFilterContainer as
|
|
17
|
-
import { YaheeFilterWrapper as
|
|
18
|
-
|
|
11
|
+
import { YaheeBorderWrap as n } from "./border-wrap/index.js";
|
|
12
|
+
import { YaheeEchartGauge as Y } from "./echart-gauge/index.js";
|
|
13
|
+
import { YaheeScaleScreen as l } from "./scale-screen/index.js";
|
|
14
|
+
import { YaheeHelpTag as C } from "./help-tag/index.js";
|
|
15
|
+
import { YaheeFilterContainer as d } from "./filter-container/index.js";
|
|
16
|
+
import { YaheeFilterWrapper as c } from "./filter-wrapper/index.js";
|
|
17
|
+
import { YaheeHeightCollapse as g } from "./height-collapse/index.js";
|
|
18
|
+
import { YaheeFileDownloadWrapper as s } from "./file-download-wrapper/index.js";
|
|
19
|
+
const T = [
|
|
19
20
|
o,
|
|
20
21
|
e,
|
|
21
22
|
r,
|
|
22
23
|
m,
|
|
23
|
-
t,
|
|
24
24
|
a,
|
|
25
|
+
t,
|
|
25
26
|
p,
|
|
26
27
|
i,
|
|
27
28
|
f,
|
|
28
|
-
n,
|
|
29
29
|
h,
|
|
30
|
+
n,
|
|
30
31
|
Y,
|
|
31
32
|
l,
|
|
32
33
|
C,
|
|
33
34
|
d,
|
|
34
35
|
c,
|
|
35
|
-
|
|
36
|
+
g,
|
|
37
|
+
s
|
|
36
38
|
];
|
|
37
39
|
export {
|
|
38
|
-
|
|
40
|
+
T as default
|
|
39
41
|
};
|