el-plus-crud 0.1.115 → 0.1.116
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/CHANGELOG.md +2 -0
- package/dist/components/el-plus-form/components/fileType.d.ts +35 -0
- package/dist/el-plus-crud.mjs +3357 -3385
- package/dist/el-plus-crud.umd.js +1 -1
- package/dist/style.css +1 -1
- package/example/App.vue +31 -0
- package/lib/components/el-plus-form/components/ElPlusFormFile.vue +152 -12
- package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +27 -11
- package/lib/components/el-plus-form/components/fileType.ts +78 -0
- package/package.json +1 -1
- package/dist/components/el-plus-form/components/components/file-icons/FileIcons.vue.d.ts +0 -27
- package/dist/components/el-plus-form/components/components/file-icons/data/index.d.ts +0 -5
- package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +0 -203
- package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +0 -27
- package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +0 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +0 -19
- package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +0 -14
- package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +0 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +0 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +0 -13
- package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.116](https://github.com/KDJack/el-plus-crud/compare/v0.1.115...v0.1.116) (2026-08-12)
|
|
6
|
+
|
|
5
7
|
### [0.1.115](https://github.com/KDJack/el-plus-crud/compare/v0.1.114...v0.1.115) (2026-08-12)
|
|
6
8
|
|
|
7
9
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 类型 → 色系 class + 缩写标签
|
|
3
|
+
* 与 ElPlusFormUpload cardMode 共用同一套分类,单一来源
|
|
4
|
+
*/
|
|
5
|
+
export declare const TYPE_META: Record<string, {
|
|
6
|
+
cls: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* 取文件类型 key(img/pdf/word/excel/ppt/txt/zip/file)
|
|
11
|
+
* 兼容 IOssInfo 与 el-upload 内部 file:suffix 优先取业务字段,缺失则从文件名提取扩展名兜底,
|
|
12
|
+
* 否则类型图标会全部退化成 file
|
|
13
|
+
*/
|
|
14
|
+
export declare function getFileType(file: any): string;
|
|
15
|
+
export declare function typeClass(file: any): string;
|
|
16
|
+
export declare function typeLabel(file: any): string;
|
|
17
|
+
export declare function isImageFile(file: any): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 图片可直接 <img> 展示的 url(缩略图 / 预览器共用)。
|
|
20
|
+
* 与 ElPlusFormUpload.getImgPreviewUrl 取址完全一致:
|
|
21
|
+
* signUrl → shareUrl → url → furl,含 raw 兜底;不含 previewUrl
|
|
22
|
+
*(后者是「非图片」文件的在线预览地址,不适用于图片缩略图,见 oss-upload-url-semantics 记忆)。
|
|
23
|
+
*/
|
|
24
|
+
export declare function getImageUrl(item: any): string;
|
|
25
|
+
/**
|
|
26
|
+
* 是否为图片项:suffix 命中图片后缀,或 url 为 data:image base64。
|
|
27
|
+
* 与 ElPlusFormUpload 的 isImageItem 对齐(预览/点击路径用此判定,而非仅后缀的 isImageFile)。
|
|
28
|
+
* ponytail: base64 data URL 无文件后缀,suffix 解析不可靠,须以 data: 前缀兜底,
|
|
29
|
+
* 否则点击会误判为非图片 → 走文件预览分支。
|
|
30
|
+
*/
|
|
31
|
+
export declare function isImageItem(item: any): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 文件大小格式化
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatSize(bytes?: number): string;
|