@lemon30_npm/csit-vue3 1.0.66 → 1.0.67
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/csit-vue3.js +834 -765
- package/dist/index.css +1 -1
- package/dist/lib/ci-upload/hooks/rules/createUploadRules.js +14 -0
- package/dist/lib/ci-upload/hooks/rules/fileNameLengthRule.js +15 -0
- package/dist/lib/ci-upload/hooks/rules/maxSizeRule.js +8 -0
- package/dist/lib/ci-upload/hooks/rules/minSizeRule.js +8 -0
- package/dist/lib/ci-upload/hooks/rules/typeRule.js +10 -0
- package/dist/lib/ci-upload/hooks/useAbortUploadFlow.js +13 -0
- package/dist/lib/ci-upload/hooks/useConfirmBeforeUpload.js +11 -0
- package/dist/lib/ci-upload/hooks/useUploadValidateFail.js +12 -0
- package/dist/lib/ci-upload/index.css +1 -1
- package/dist/lib/ci-upload/index.vue.js +2 -2
- package/dist/lib/ci-upload/index.vue2.js +210 -199
- package/dist/lib/ci-upload/props/index.js +11 -1
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/createUploadRules.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/fileNameLengthRule.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/maxSizeRule.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/minSizeRule.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/typeRule.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/rules/types.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/useAbortUploadFlow.d.ts +20 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/useConfirmBeforeUpload.d.ts +1 -0
- package/dist/types/src/components/components-project/ci-upload/hooks/useUploadValidateFail.d.ts +19 -0
- package/dist/types/src/components/components-project/ci-upload/index.vue.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/props/index.d.ts +10 -0
- package/dist/types/src/components/components-project/ci-upload/type.d.ts +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { UploadUserFile } from 'element-plus';
|
|
3
|
+
interface UploadValidateFailOptions {
|
|
4
|
+
rawFile: UploadUserFile;
|
|
5
|
+
fileList: UploadUserFile[];
|
|
6
|
+
emit: (event: 'update:fileList', value: UploadUserFile[]) => void;
|
|
7
|
+
internalRemoveFlag: Ref<boolean>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 中断上传流程(不负责提示)
|
|
11
|
+
* 纯流程中断”方法(不带 UI)
|
|
12
|
+
*
|
|
13
|
+
* 作用:
|
|
14
|
+
* 1. 标记为“自动移除” ---> 防止弹出二次删除的确认框 ---> 直接删除
|
|
15
|
+
* 2. 从 fileList 中移除当前文件
|
|
16
|
+
* 3. 通知父组件同步 fileList
|
|
17
|
+
* 4. 阻止上传
|
|
18
|
+
*/
|
|
19
|
+
export declare function abortUploadFlow(options: UploadValidateFailOptions): boolean;
|
|
20
|
+
export {};
|
package/dist/types/src/components/components-project/ci-upload/hooks/useConfirmBeforeUpload.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const confirmBeforeUpload: (message: string) => Promise<import('element-plus').MessageBoxData>;
|
package/dist/types/src/components/components-project/ci-upload/hooks/useUploadValidateFail.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { UploadUserFile } from 'element-plus';
|
|
3
|
+
interface UploadValidateFailOptions {
|
|
4
|
+
rawFile: UploadUserFile;
|
|
5
|
+
fileList: UploadUserFile[];
|
|
6
|
+
emit: (event: 'update:fileList', value: UploadUserFile[]) => void;
|
|
7
|
+
internalRemoveFlag: Ref<boolean>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 上传校验失败的统一处理工具
|
|
11
|
+
*
|
|
12
|
+
* 作用:
|
|
13
|
+
* 1. 弹出错误提示
|
|
14
|
+
* 2. 标记为“自动移除”(避免误触发删除确认)
|
|
15
|
+
* 3. 从 fileList 中移除当前文件
|
|
16
|
+
* 4. 通知父组件同步 fileList
|
|
17
|
+
*/
|
|
18
|
+
export declare function handleUploadValidateFail(message: string, options: UploadValidateFailOptions): boolean;
|
|
19
|
+
export {};
|
|
@@ -50,6 +50,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Ci
|
|
|
50
50
|
showFileNameEllipsisTooltip: boolean;
|
|
51
51
|
maxFileNameLength: number;
|
|
52
52
|
minFileNameLength: number;
|
|
53
|
+
confirmBeforeUpload: boolean;
|
|
54
|
+
confirmBeforeUploadText: string;
|
|
53
55
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
54
56
|
uploadRef: unknown;
|
|
55
57
|
}, HTMLDivElement>, Partial<Record<number, (_: any) => any>> & {
|
|
@@ -31,4 +31,14 @@ export declare const defaultProps: {
|
|
|
31
31
|
showFileNameEllipsisTooltip: boolean;
|
|
32
32
|
maxFileNameLength: number;
|
|
33
33
|
minFileNameLength: number;
|
|
34
|
+
/**
|
|
35
|
+
* 是否在上传前进行二次确认
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
confirmBeforeUpload: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 二次确认提示文案
|
|
41
|
+
* confirmBeforeUpload = true 时生效
|
|
42
|
+
*/
|
|
43
|
+
confirmBeforeUploadText: string;
|
|
34
44
|
};
|
|
@@ -32,6 +32,16 @@ export interface CiUploadProps {
|
|
|
32
32
|
showFileNameEllipsisTooltip?: boolean;
|
|
33
33
|
maxFileNameLength?: number;
|
|
34
34
|
minFileNameLength?: number;
|
|
35
|
+
/**
|
|
36
|
+
* 是否在上传前进行二次确认
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
confirmBeforeUpload?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 二次确认提示文案
|
|
42
|
+
* confirmBeforeUpload = true 时生效
|
|
43
|
+
*/
|
|
44
|
+
confirmBeforeUploadText?: string;
|
|
35
45
|
}
|
|
36
46
|
export type CiUploadFiles = CiUploadFile[];
|
|
37
47
|
export interface CiUploadUserFile extends UploadUserFile {
|