@ccn-ui-kit/upload 0.1.2
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/index.cjs +1 -0
- package/dist/index.js +512 -0
- package/dist/packages/components/__tests__/loading.spec.d.ts +1 -0
- package/dist/packages/components/badge/index.d.ts +10 -0
- package/dist/packages/components/badge/src/badge.d.ts +25 -0
- package/dist/packages/components/breadcrumb/index.d.ts +12 -0
- package/dist/packages/components/breadcrumb/src/breadcrumb-item.d.ts +13 -0
- package/dist/packages/components/breadcrumb/src/breadcrumb.d.ts +10 -0
- package/dist/packages/components/button/index.d.ts +10 -0
- package/dist/packages/components/button/src/button.d.ts +25 -0
- package/dist/packages/components/date-picker/index.d.ts +10 -0
- package/dist/packages/components/date-picker/src/date-picker.d.ts +20 -0
- package/dist/packages/components/descriptions/index.d.ts +12 -0
- package/dist/packages/components/descriptions/src/descriptions-item.d.ts +13 -0
- package/dist/packages/components/descriptions/src/descriptions.d.ts +17 -0
- package/dist/packages/components/divider/index.d.ts +10 -0
- package/dist/packages/components/divider/src/divider.d.ts +20 -0
- package/dist/packages/components/dropdown/index.d.ts +12 -0
- package/dist/packages/components/dropdown/src/dropdown-item.d.ts +20 -0
- package/dist/packages/components/dropdown/src/dropdown.d.ts +46 -0
- package/dist/packages/components/form/index.d.ts +12 -0
- package/dist/packages/components/form/src/form-item.d.ts +45 -0
- package/dist/packages/components/form/src/form.d.ts +96 -0
- package/dist/packages/components/icon/index.d.ts +11 -0
- package/dist/packages/components/icon/src/icon.d.ts +18 -0
- package/dist/packages/components/icon/src/icons.d.ts +50 -0
- package/dist/packages/components/input/index.d.ts +10 -0
- package/dist/packages/components/input/src/input.d.ts +25 -0
- package/dist/packages/components/link/index.d.ts +10 -0
- package/dist/packages/components/link/src/link.d.ts +25 -0
- package/dist/packages/components/loading/index.d.ts +10 -0
- package/dist/packages/components/loading/src/loading.d.ts +15 -0
- package/dist/packages/components/menu/index.d.ts +14 -0
- package/dist/packages/components/menu/src/menu-item.d.ts +12 -0
- package/dist/packages/components/menu/src/menu.d.ts +40 -0
- package/dist/packages/components/menu/src/sub-menu.d.ts +12 -0
- package/dist/packages/components/message/index.d.ts +12 -0
- package/dist/packages/components/message/src/manager.d.ts +14 -0
- package/dist/packages/components/message/src/message.d.ts +28 -0
- package/dist/packages/components/modal/index.d.ts +10 -0
- package/dist/packages/components/modal/src/modal.d.ts +46 -0
- package/dist/packages/components/notification/index.d.ts +12 -0
- package/dist/packages/components/notification/src/manager.d.ts +14 -0
- package/dist/packages/components/notification/src/notification.d.ts +44 -0
- package/dist/packages/components/pagination/index.d.ts +10 -0
- package/dist/packages/components/pagination/src/pagination.d.ts +30 -0
- package/dist/packages/components/popconfirm/index.d.ts +10 -0
- package/dist/packages/components/popconfirm/src/popconfirm.d.ts +56 -0
- package/dist/packages/components/rich-editor/index.d.ts +10 -0
- package/dist/packages/components/rich-editor/src/rich-editor.d.ts +36 -0
- package/dist/packages/components/select/index.d.ts +10 -0
- package/dist/packages/components/select/src/select.d.ts +45 -0
- package/dist/packages/components/space/index.d.ts +10 -0
- package/dist/packages/components/space/src/space.d.ts +33 -0
- package/dist/packages/components/steps/index.d.ts +12 -0
- package/dist/packages/components/steps/src/step.d.ts +28 -0
- package/dist/packages/components/steps/src/steps.d.ts +46 -0
- package/dist/packages/components/table/index.d.ts +10 -0
- package/dist/packages/components/table/src/table.d.ts +56 -0
- package/dist/packages/components/tabs/index.d.ts +12 -0
- package/dist/packages/components/tabs/src/tab-pane.d.ts +22 -0
- package/dist/packages/components/tabs/src/tabs.d.ts +43 -0
- package/dist/packages/components/tree/index.d.ts +10 -0
- package/dist/packages/components/tree/src/tree.d.ts +134 -0
- package/dist/packages/components/upload/index.d.ts +10 -0
- package/dist/packages/components/upload/src/upload.d.ts +103 -0
- package/dist/packages/components/upload/src/upload.vue.d.ts +135 -0
- package/dist/packages/directives/index.d.ts +2 -0
- package/dist/packages/directives/loading/index.d.ts +11 -0
- package/dist/packages/directives/permission/index.d.ts +3 -0
- package/dist/packages/ui-kit/index.d.ts +34 -0
- package/dist/packages/utils/dom.d.ts +5 -0
- package/dist/packages/utils/index.d.ts +3 -0
- package/dist/packages/utils/types.d.ts +7 -0
- package/dist/packages/utils/vue-helper.d.ts +9 -0
- package/dist/play/main.d.ts +1 -0
- package/dist/play/vite.config.d.ts +2 -0
- package/package.json +27 -0
- package/style/index.scss +241 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component, ExtractPropTypes, InjectionKey, Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare const tabsProps: {
|
|
4
|
+
/** 当前激活页签名(v-model) */
|
|
5
|
+
readonly modelValue: {
|
|
6
|
+
readonly type: [StringConstructor, NumberConstructor];
|
|
7
|
+
readonly default: "";
|
|
8
|
+
};
|
|
9
|
+
/** 页签类型:''(下划线) | card | border-card */
|
|
10
|
+
readonly type: {
|
|
11
|
+
readonly type: StringConstructor;
|
|
12
|
+
readonly default: "";
|
|
13
|
+
};
|
|
14
|
+
/** 全局默认是否可关闭(TabPane 可用 closable 单独覆盖) */
|
|
15
|
+
readonly closable: BooleanConstructor;
|
|
16
|
+
};
|
|
17
|
+
export declare const tabsEmits: {
|
|
18
|
+
'update:modelValue': (name: string | number) => boolean;
|
|
19
|
+
/** 点击页签时触发,参数为页签名 */
|
|
20
|
+
'tab-click': (name: string | number) => boolean;
|
|
21
|
+
/** 点击关闭按钮时触发,由外部负责移除对应数据 */
|
|
22
|
+
'tab-remove': (name: string | number) => boolean;
|
|
23
|
+
};
|
|
24
|
+
export type TabsProps = ExtractPropTypes<typeof tabsProps>;
|
|
25
|
+
/** TabPane 注册到 Tabs 时的页签状态 */
|
|
26
|
+
export interface PaneState {
|
|
27
|
+
name: string | number;
|
|
28
|
+
label: string;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
/** 是否可关闭:缺省继承 Tabs 的 closable */
|
|
31
|
+
closable?: boolean;
|
|
32
|
+
/** 自定义页签头渲染(TabPane 的 #label 插槽) */
|
|
33
|
+
labelSlot?: Component;
|
|
34
|
+
}
|
|
35
|
+
/** 提供给 TabPane 的上下文 */
|
|
36
|
+
export interface TabsContext {
|
|
37
|
+
activeName: Ref<string | number>;
|
|
38
|
+
type: string;
|
|
39
|
+
closable: boolean;
|
|
40
|
+
registerPane: (pane: PaneState) => void;
|
|
41
|
+
unregisterPane: (name: string | number) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare const tabsContextKey: InjectionKey<TabsContext>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ComputedRef, ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
/** 树节点原始数据(字段名可用 props 配置) */
|
|
4
|
+
export interface TreeData {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
children?: TreeData[];
|
|
7
|
+
}
|
|
8
|
+
/** 节点字段映射配置 */
|
|
9
|
+
export interface TreePropsConfig {
|
|
10
|
+
/** 节点显示文案字段 */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** 子节点数组字段 */
|
|
13
|
+
children?: string;
|
|
14
|
+
/** 禁用字段 */
|
|
15
|
+
disabled?: string;
|
|
16
|
+
/** 叶子标记字段(配合 lazy 使用) */
|
|
17
|
+
isLeaf?: string;
|
|
18
|
+
/** 节点唯一键字段 */
|
|
19
|
+
key?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const defaultTreePropsConfig: TreePropsConfig;
|
|
22
|
+
/** 节点唯一键(统一为 string | number) */
|
|
23
|
+
export type KeyType = string | number;
|
|
24
|
+
/** 组件内部使用的树节点模型(由 data 构建,含父/子引用与层级) */
|
|
25
|
+
export interface TreeNode {
|
|
26
|
+
key: KeyType;
|
|
27
|
+
data: TreeData;
|
|
28
|
+
parent: TreeNode | null;
|
|
29
|
+
children: TreeNode[];
|
|
30
|
+
level: number;
|
|
31
|
+
isLeaf: boolean;
|
|
32
|
+
isLazy: boolean;
|
|
33
|
+
path: string;
|
|
34
|
+
}
|
|
35
|
+
/** 懒加载参数:根节点 load 时 node 为 null */
|
|
36
|
+
export interface TreeNodeLoadArg {
|
|
37
|
+
key: KeyType;
|
|
38
|
+
level: number;
|
|
39
|
+
data: TreeData;
|
|
40
|
+
}
|
|
41
|
+
export type TreeNodeLoader = (node: TreeNodeLoadArg | null, resolve: (children: TreeData[]) => void) => void;
|
|
42
|
+
export declare const treeProps: {
|
|
43
|
+
/** 树数据 */
|
|
44
|
+
readonly data: {
|
|
45
|
+
readonly type: PropType<TreeData[]>;
|
|
46
|
+
readonly default: () => never[];
|
|
47
|
+
};
|
|
48
|
+
/** 字段映射:{ label, children, disabled, isLeaf, key },缺省用默认字段名 */
|
|
49
|
+
readonly props: {
|
|
50
|
+
readonly type: PropType<TreePropsConfig>;
|
|
51
|
+
readonly default: () => {};
|
|
52
|
+
};
|
|
53
|
+
/** 节点唯一键字段,缺省取 props.key */
|
|
54
|
+
readonly nodeKey: {
|
|
55
|
+
readonly type: StringConstructor;
|
|
56
|
+
readonly default: "";
|
|
57
|
+
};
|
|
58
|
+
/** 是否展示复选框 */
|
|
59
|
+
readonly showCheckbox: BooleanConstructor;
|
|
60
|
+
/** 勾选是否严格(父子不联动,仅影响复选框) */
|
|
61
|
+
readonly checkStrictly: BooleanConstructor;
|
|
62
|
+
/** 默认展开所有节点 */
|
|
63
|
+
readonly defaultExpandAll: BooleanConstructor;
|
|
64
|
+
/** 默认展开的节点 key 列表 */
|
|
65
|
+
readonly defaultExpandedKeys: {
|
|
66
|
+
readonly type: PropType<KeyType[]>;
|
|
67
|
+
readonly default: () => never[];
|
|
68
|
+
};
|
|
69
|
+
/** 初始勾选的节点 key 列表(可在外部用 ref.setCheckedKeys 再控制) */
|
|
70
|
+
readonly defaultCheckedKeys: {
|
|
71
|
+
readonly type: PropType<KeyType[]>;
|
|
72
|
+
readonly default: () => never[];
|
|
73
|
+
};
|
|
74
|
+
/** 点击节点是否展开/收起(默认 true) */
|
|
75
|
+
readonly expandOnClickNode: {
|
|
76
|
+
readonly type: BooleanConstructor;
|
|
77
|
+
readonly default: true;
|
|
78
|
+
};
|
|
79
|
+
/** 当前选中节点 key(v-model:current-node-key) */
|
|
80
|
+
readonly currentNodeKey: {
|
|
81
|
+
readonly type: [StringConstructor, NumberConstructor];
|
|
82
|
+
readonly default: null;
|
|
83
|
+
};
|
|
84
|
+
/** 懒加载(需配合 load 使用) */
|
|
85
|
+
readonly lazy: BooleanConstructor;
|
|
86
|
+
/** 懒加载函数:(node, resolve) => void */
|
|
87
|
+
readonly load: {
|
|
88
|
+
readonly type: PropType<TreeNodeLoader>;
|
|
89
|
+
readonly default: undefined;
|
|
90
|
+
};
|
|
91
|
+
/** 空数据提示文案 */
|
|
92
|
+
readonly emptyText: {
|
|
93
|
+
readonly type: StringConstructor;
|
|
94
|
+
readonly default: "暂无数据";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
export declare const treeEmits: {
|
|
98
|
+
'update:current-node-key': null;
|
|
99
|
+
'update:checked-keys': null;
|
|
100
|
+
/** 点击节点:node / data / 原生事件 */
|
|
101
|
+
'node-click': (node: TreeNode, data: TreeData, e: MouseEvent) => boolean;
|
|
102
|
+
/** 节点展开 */
|
|
103
|
+
'node-expand': () => boolean;
|
|
104
|
+
/** 节点收起 */
|
|
105
|
+
'node-collapse': () => boolean;
|
|
106
|
+
/** 复选框勾选状态改变 */
|
|
107
|
+
check: (node: TreeNode, data: TreeData) => boolean;
|
|
108
|
+
/** 节点勾选状态变化(含级联影响的节点) */
|
|
109
|
+
'check-change': (node: TreeNode, data: TreeData, checked: boolean) => boolean;
|
|
110
|
+
/** 右键节点 */
|
|
111
|
+
'node-contextmenu': (e: MouseEvent, data: TreeData, node: TreeNode) => boolean;
|
|
112
|
+
};
|
|
113
|
+
export type TreeProps = ExtractPropTypes<typeof treeProps>;
|
|
114
|
+
/** 提供给内部 UiTreeNode 的共享上下文 */
|
|
115
|
+
export interface TreeContext {
|
|
116
|
+
config: ComputedRef<Required<TreePropsConfig>>;
|
|
117
|
+
nodeKeyField: ComputedRef<string>;
|
|
118
|
+
expandedKeys: Ref<Set<KeyType>>;
|
|
119
|
+
checkedKeys: Ref<Set<KeyType>>;
|
|
120
|
+
halfCheckedKeys: Ref<Set<KeyType>>;
|
|
121
|
+
selectedKey: Ref<KeyType | null>;
|
|
122
|
+
loadingKeys: Ref<Set<KeyType>>;
|
|
123
|
+
showCheckbox: ComputedRef<boolean>;
|
|
124
|
+
checkStrictly: ComputedRef<boolean>;
|
|
125
|
+
expandOnClickNode: ComputedRef<boolean>;
|
|
126
|
+
lazy: ComputedRef<boolean>;
|
|
127
|
+
isDisabledNode: (node: TreeNode) => boolean;
|
|
128
|
+
toggleExpand: (node: TreeNode) => void;
|
|
129
|
+
handleNodeClick: (node: TreeNode, data: TreeData, e: MouseEvent) => void;
|
|
130
|
+
handleNodeContextMenu: (node: TreeNode, data: TreeData, e: MouseEvent) => void;
|
|
131
|
+
toggleCheck: (node: TreeNode, data: TreeData) => void;
|
|
132
|
+
loadNodeData: (node: TreeNode) => void;
|
|
133
|
+
}
|
|
134
|
+
export declare const treeContextKey: InjectionKey<TreeContext>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
|
|
3
|
+
/** 文件上传状态 */
|
|
4
|
+
export type UploadStatus = 'ready' | 'uploading' | 'success' | 'fail';
|
|
5
|
+
/** 文件列表展示类型 */
|
|
6
|
+
export type UploadListType = 'text' | 'picture' | 'picture-card';
|
|
7
|
+
/** 列表中的单个文件 */
|
|
8
|
+
export interface UploadFile {
|
|
9
|
+
/** 组件内唯一标识(新增时自增生成) */
|
|
10
|
+
uid: number;
|
|
11
|
+
/** 文件名 */
|
|
12
|
+
name: string;
|
|
13
|
+
/** 文件大小(字节) */
|
|
14
|
+
size: number;
|
|
15
|
+
/** MIME 类型 */
|
|
16
|
+
type: string;
|
|
17
|
+
/** 当前上传状态 */
|
|
18
|
+
status: UploadStatus;
|
|
19
|
+
/** 上传进度 0-100 */
|
|
20
|
+
percentage: number;
|
|
21
|
+
/** 原始 File 对象 */
|
|
22
|
+
raw: File;
|
|
23
|
+
/** 本地预览地址(仅图片,blob: URL) */
|
|
24
|
+
url?: string;
|
|
25
|
+
/** 上传成功/失败后的响应 */
|
|
26
|
+
response?: unknown;
|
|
27
|
+
}
|
|
28
|
+
export declare const uploadProps: {
|
|
29
|
+
/** 上传请求的 URL;留空时不发起请求,文件直接标记为成功(便于无后端演示) */
|
|
30
|
+
readonly action: {
|
|
31
|
+
readonly type: StringConstructor;
|
|
32
|
+
readonly default: "";
|
|
33
|
+
};
|
|
34
|
+
/** FormData 中文件字段的 key */
|
|
35
|
+
readonly name: {
|
|
36
|
+
readonly type: StringConstructor;
|
|
37
|
+
readonly default: "file";
|
|
38
|
+
};
|
|
39
|
+
/** 是否允许多选 */
|
|
40
|
+
readonly multiple: BooleanConstructor;
|
|
41
|
+
/** 原生 input 的 accept,如 'image/*'、'.zip,.rar' */
|
|
42
|
+
readonly accept: {
|
|
43
|
+
readonly type: StringConstructor;
|
|
44
|
+
readonly default: "";
|
|
45
|
+
};
|
|
46
|
+
/** 禁用上传 */
|
|
47
|
+
readonly disabled: BooleanConstructor;
|
|
48
|
+
/** 最大文件数,0 表示不限制 */
|
|
49
|
+
readonly limit: {
|
|
50
|
+
readonly type: NumberConstructor;
|
|
51
|
+
readonly default: 0;
|
|
52
|
+
};
|
|
53
|
+
/** 自定义请求头 */
|
|
54
|
+
readonly headers: {
|
|
55
|
+
readonly type: PropType<Record<string, string>>;
|
|
56
|
+
readonly default: () => {};
|
|
57
|
+
};
|
|
58
|
+
/** 附加的 FormData 字段 */
|
|
59
|
+
readonly data: {
|
|
60
|
+
readonly type: PropType<Record<string, unknown>>;
|
|
61
|
+
readonly default: () => {};
|
|
62
|
+
};
|
|
63
|
+
/** 跨域时是否携带 cookie */
|
|
64
|
+
readonly withCredentials: BooleanConstructor;
|
|
65
|
+
/** 是否支持拖拽上传(将触发器区域变成拖拽区) */
|
|
66
|
+
readonly drag: BooleanConstructor;
|
|
67
|
+
/** 选择文件后是否立即上传;false 时仅加入列表,等待手动触发 */
|
|
68
|
+
readonly autoUpload: {
|
|
69
|
+
readonly type: BooleanConstructor;
|
|
70
|
+
readonly default: true;
|
|
71
|
+
};
|
|
72
|
+
/** 是否展示文件列表 */
|
|
73
|
+
readonly showFileList: {
|
|
74
|
+
readonly type: BooleanConstructor;
|
|
75
|
+
readonly default: true;
|
|
76
|
+
};
|
|
77
|
+
/** 列表展示类型 */
|
|
78
|
+
readonly listType: {
|
|
79
|
+
readonly type: PropType<UploadListType>;
|
|
80
|
+
readonly default: "text";
|
|
81
|
+
};
|
|
82
|
+
/** 受控文件列表(配合 v-model:file-list 使用) */
|
|
83
|
+
readonly fileList: {
|
|
84
|
+
readonly type: PropType<UploadFile[]>;
|
|
85
|
+
readonly default: () => never[];
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export declare const uploadEmits: {
|
|
89
|
+
readonly 'update:file-list': (files: UploadFile[]) => boolean;
|
|
90
|
+
/** 文件列表变化(新增 / 移除) */
|
|
91
|
+
readonly change: (files: UploadFile[]) => boolean;
|
|
92
|
+
/** 上传成功 */
|
|
93
|
+
readonly success: (file: UploadFile, response?: unknown) => boolean;
|
|
94
|
+
/** 上传失败 */
|
|
95
|
+
readonly error: (file: UploadFile, error: unknown) => boolean;
|
|
96
|
+
/** 上传进度 */
|
|
97
|
+
readonly progress: (file: UploadFile, percent: number) => boolean;
|
|
98
|
+
/** 移除文件 */
|
|
99
|
+
readonly remove: (file: UploadFile) => boolean;
|
|
100
|
+
/** 超出 limit 限制 */
|
|
101
|
+
readonly exceed: (files: File[], limit: number) => boolean;
|
|
102
|
+
};
|
|
103
|
+
export type UploadProps = ExtractPropTypes<typeof uploadProps>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { UploadFile } from './upload';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
trigger?(_: {}): any;
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
8
|
+
readonly action: {
|
|
9
|
+
readonly type: StringConstructor;
|
|
10
|
+
readonly default: "";
|
|
11
|
+
};
|
|
12
|
+
readonly name: {
|
|
13
|
+
readonly type: StringConstructor;
|
|
14
|
+
readonly default: "file";
|
|
15
|
+
};
|
|
16
|
+
readonly multiple: BooleanConstructor;
|
|
17
|
+
readonly accept: {
|
|
18
|
+
readonly type: StringConstructor;
|
|
19
|
+
readonly default: "";
|
|
20
|
+
};
|
|
21
|
+
readonly disabled: BooleanConstructor;
|
|
22
|
+
readonly limit: {
|
|
23
|
+
readonly type: NumberConstructor;
|
|
24
|
+
readonly default: 0;
|
|
25
|
+
};
|
|
26
|
+
readonly headers: {
|
|
27
|
+
readonly type: import('vue').PropType<Record<string, string>>;
|
|
28
|
+
readonly default: () => {};
|
|
29
|
+
};
|
|
30
|
+
readonly data: {
|
|
31
|
+
readonly type: import('vue').PropType<Record<string, unknown>>;
|
|
32
|
+
readonly default: () => {};
|
|
33
|
+
};
|
|
34
|
+
readonly withCredentials: BooleanConstructor;
|
|
35
|
+
readonly drag: BooleanConstructor;
|
|
36
|
+
readonly autoUpload: {
|
|
37
|
+
readonly type: BooleanConstructor;
|
|
38
|
+
readonly default: true;
|
|
39
|
+
};
|
|
40
|
+
readonly showFileList: {
|
|
41
|
+
readonly type: BooleanConstructor;
|
|
42
|
+
readonly default: true;
|
|
43
|
+
};
|
|
44
|
+
readonly listType: {
|
|
45
|
+
readonly type: import('vue').PropType<import('./upload').UploadListType>;
|
|
46
|
+
readonly default: "text";
|
|
47
|
+
};
|
|
48
|
+
readonly fileList: {
|
|
49
|
+
readonly type: import('vue').PropType<UploadFile[]>;
|
|
50
|
+
readonly default: () => never[];
|
|
51
|
+
};
|
|
52
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
53
|
+
progress: (file: UploadFile, percent: number) => void;
|
|
54
|
+
change: (files: UploadFile[]) => void;
|
|
55
|
+
error: (file: UploadFile, error: unknown) => void;
|
|
56
|
+
success: (file: UploadFile, response?: unknown) => void;
|
|
57
|
+
"update:file-list": (files: UploadFile[]) => void;
|
|
58
|
+
remove: (file: UploadFile) => void;
|
|
59
|
+
exceed: (files: File[], limit: number) => void;
|
|
60
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
61
|
+
readonly action: {
|
|
62
|
+
readonly type: StringConstructor;
|
|
63
|
+
readonly default: "";
|
|
64
|
+
};
|
|
65
|
+
readonly name: {
|
|
66
|
+
readonly type: StringConstructor;
|
|
67
|
+
readonly default: "file";
|
|
68
|
+
};
|
|
69
|
+
readonly multiple: BooleanConstructor;
|
|
70
|
+
readonly accept: {
|
|
71
|
+
readonly type: StringConstructor;
|
|
72
|
+
readonly default: "";
|
|
73
|
+
};
|
|
74
|
+
readonly disabled: BooleanConstructor;
|
|
75
|
+
readonly limit: {
|
|
76
|
+
readonly type: NumberConstructor;
|
|
77
|
+
readonly default: 0;
|
|
78
|
+
};
|
|
79
|
+
readonly headers: {
|
|
80
|
+
readonly type: import('vue').PropType<Record<string, string>>;
|
|
81
|
+
readonly default: () => {};
|
|
82
|
+
};
|
|
83
|
+
readonly data: {
|
|
84
|
+
readonly type: import('vue').PropType<Record<string, unknown>>;
|
|
85
|
+
readonly default: () => {};
|
|
86
|
+
};
|
|
87
|
+
readonly withCredentials: BooleanConstructor;
|
|
88
|
+
readonly drag: BooleanConstructor;
|
|
89
|
+
readonly autoUpload: {
|
|
90
|
+
readonly type: BooleanConstructor;
|
|
91
|
+
readonly default: true;
|
|
92
|
+
};
|
|
93
|
+
readonly showFileList: {
|
|
94
|
+
readonly type: BooleanConstructor;
|
|
95
|
+
readonly default: true;
|
|
96
|
+
};
|
|
97
|
+
readonly listType: {
|
|
98
|
+
readonly type: import('vue').PropType<import('./upload').UploadListType>;
|
|
99
|
+
readonly default: "text";
|
|
100
|
+
};
|
|
101
|
+
readonly fileList: {
|
|
102
|
+
readonly type: import('vue').PropType<UploadFile[]>;
|
|
103
|
+
readonly default: () => never[];
|
|
104
|
+
};
|
|
105
|
+
}>> & Readonly<{
|
|
106
|
+
onProgress?: ((file: UploadFile, percent: number) => any) | undefined;
|
|
107
|
+
onChange?: ((files: UploadFile[]) => any) | undefined;
|
|
108
|
+
onError?: ((file: UploadFile, error: unknown) => any) | undefined;
|
|
109
|
+
onSuccess?: ((file: UploadFile, response?: unknown) => any) | undefined;
|
|
110
|
+
"onUpdate:file-list"?: ((files: UploadFile[]) => any) | undefined;
|
|
111
|
+
onRemove?: ((file: UploadFile) => any) | undefined;
|
|
112
|
+
onExceed?: ((files: File[], limit: number) => any) | undefined;
|
|
113
|
+
}>, {
|
|
114
|
+
readonly data: Record<string, unknown>;
|
|
115
|
+
readonly disabled: boolean;
|
|
116
|
+
readonly name: string;
|
|
117
|
+
readonly drag: boolean;
|
|
118
|
+
readonly multiple: boolean;
|
|
119
|
+
readonly action: string;
|
|
120
|
+
readonly accept: string;
|
|
121
|
+
readonly limit: number;
|
|
122
|
+
readonly headers: Record<string, string>;
|
|
123
|
+
readonly withCredentials: boolean;
|
|
124
|
+
readonly autoUpload: boolean;
|
|
125
|
+
readonly showFileList: boolean;
|
|
126
|
+
readonly listType: import('./upload').UploadListType;
|
|
127
|
+
readonly fileList: UploadFile[];
|
|
128
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
129
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
130
|
+
export default _default;
|
|
131
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
132
|
+
new (): {
|
|
133
|
+
$slots: S;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
|
|
3
|
+
export declare function install(app: App): void;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
install: typeof install;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export * from '../components/button';
|
|
9
|
+
export * from '../components/input';
|
|
10
|
+
export * from '../components/badge';
|
|
11
|
+
export * from '../components/breadcrumb';
|
|
12
|
+
export * from '../components/date-picker';
|
|
13
|
+
export * from '../components/descriptions';
|
|
14
|
+
export * from '../components/divider';
|
|
15
|
+
export * from '../components/dropdown';
|
|
16
|
+
export * from '../components/icon';
|
|
17
|
+
export * from '../components/link';
|
|
18
|
+
export * from '../components/loading';
|
|
19
|
+
export * from '../components/menu';
|
|
20
|
+
export * from '../components/message';
|
|
21
|
+
export * from '../components/modal';
|
|
22
|
+
export * from '../components/notification';
|
|
23
|
+
export * from '../components/pagination';
|
|
24
|
+
export * from '../components/popconfirm';
|
|
25
|
+
export * from '../components/form';
|
|
26
|
+
export * from '../components/table';
|
|
27
|
+
export * from '../components/tree';
|
|
28
|
+
export * from '../components/tabs';
|
|
29
|
+
export * from '../components/rich-editor';
|
|
30
|
+
export * from '../components/select';
|
|
31
|
+
export * from '../components/space';
|
|
32
|
+
export * from '../components/steps';
|
|
33
|
+
export * from '../components/upload';
|
|
34
|
+
export * from '../directives';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function addClass(el: HTMLElement, cls: string): void;
|
|
2
|
+
export declare function removeClass(el: HTMLElement, cls: string): void;
|
|
3
|
+
export declare function hasClass(el: HTMLElement, cls: string): boolean;
|
|
4
|
+
export declare function getScrollTop(el?: Element | Window): number;
|
|
5
|
+
export declare function isServer(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ccn-ui-kit/upload",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/packages/components/upload/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"style"
|
|
11
|
+
],
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"**/*.scss"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/packages/components/upload/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./style": "./style/index.scss",
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"vue": "^3.4.0"
|
|
26
|
+
}
|
|
27
|
+
}
|