@vunk/form 1.1.12 → 1.1.13
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/components/form/index.js +112 -21
- package/components/form/src/ctx.d.ts +27 -1
- package/components/form/src/ctx.js +12 -0
- package/components/form/src/index.vue.d.ts +30 -0
- package/components/form/src/types.d.ts +12 -2
- package/components/form/src/utils.d.ts +15 -0
- package/components/form/src/utils.js +55 -0
- package/components/upload-plus/index.css +85 -0
- package/components/upload-plus/index.d.ts +6 -0
- package/components/upload-plus/index.js +485 -0
- package/components/upload-plus/src/api.d.ts +31 -0
- package/components/upload-plus/src/api.js +65 -0
- package/components/upload-plus/src/const.d.ts +7 -0
- package/components/upload-plus/src/const.js +10 -0
- package/components/upload-plus/src/ctx.d.ts +59 -0
- package/components/upload-plus/src/ctx.js +34 -0
- package/components/upload-plus/src/index.vue.d.ts +163 -0
- package/components/upload-plus/src/types.d.ts +24 -0
- package/components/upload-plus/src/types.js +1 -0
- package/index.css +86 -0
- package/package.json +1 -1
- package/shared/types/source/index.d.ts +6 -0
- package/shared/upload/index.d.ts +7 -0
- package/shared/upload/index.js +767 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Status } from './const';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
size: {
|
|
4
|
+
type: NumberConstructor;
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
dictId: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
12
|
+
label: StringConstructor;
|
|
13
|
+
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
14
|
+
prop: {
|
|
15
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp) | ((new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp))[], unknown, unknown>>;
|
|
16
|
+
readonly required: false;
|
|
17
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
18
|
+
__epPropKey: true;
|
|
19
|
+
};
|
|
20
|
+
rules: {
|
|
21
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>) | ((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>))[], unknown, unknown>>;
|
|
22
|
+
readonly required: false;
|
|
23
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
24
|
+
__epPropKey: true;
|
|
25
|
+
};
|
|
26
|
+
error: StringConstructor;
|
|
27
|
+
validateStatus: {
|
|
28
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
29
|
+
readonly required: false;
|
|
30
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
31
|
+
__epPropKey: true;
|
|
32
|
+
};
|
|
33
|
+
for: StringConstructor;
|
|
34
|
+
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
35
|
+
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
36
|
+
formItemSize: {
|
|
37
|
+
type: import("vue").PropType<"default" | "small" | "large">;
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
formItemSlots: {
|
|
41
|
+
type: import("vue").PropType<import("../../form-item/src/types").FormItemSlots>;
|
|
42
|
+
default: undefined;
|
|
43
|
+
};
|
|
44
|
+
elRef: {
|
|
45
|
+
type: import("vue").PropType<any>;
|
|
46
|
+
required: boolean;
|
|
47
|
+
};
|
|
48
|
+
inline: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
52
|
+
readonly: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: undefined;
|
|
55
|
+
};
|
|
56
|
+
}, {
|
|
57
|
+
formItemBindProps: import("vue").ComputedRef<{
|
|
58
|
+
required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown> | undefined;
|
|
59
|
+
label: string | undefined;
|
|
60
|
+
labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
61
|
+
prop: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp) | ((new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp))[], unknown, unknown> | undefined;
|
|
62
|
+
rules: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>) | ((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>))[], unknown, unknown> | undefined;
|
|
63
|
+
error: string | undefined;
|
|
64
|
+
validateStatus: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown> | undefined;
|
|
65
|
+
for: string | undefined;
|
|
66
|
+
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
67
|
+
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
68
|
+
formItemSize: "default" | "small" | "large";
|
|
69
|
+
formItemSlots: import("../../form-item/src/types").FormItemSlots | undefined;
|
|
70
|
+
elRef: any;
|
|
71
|
+
inline: boolean;
|
|
72
|
+
readonly: boolean | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
handleFileChange: (e: Event) => void;
|
|
75
|
+
uuid: string;
|
|
76
|
+
container: {
|
|
77
|
+
file?: File | undefined;
|
|
78
|
+
hash?: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
handleUpload: () => Promise<void>;
|
|
81
|
+
fileStatus: import("vue").Ref<Status>;
|
|
82
|
+
chunks: import("vue").Ref<{
|
|
83
|
+
fileName: string;
|
|
84
|
+
fileHash: string;
|
|
85
|
+
fileSize: number;
|
|
86
|
+
chunk: Blob;
|
|
87
|
+
hash: string;
|
|
88
|
+
chunksLength: number;
|
|
89
|
+
index: number;
|
|
90
|
+
progress: number;
|
|
91
|
+
sliceSize: number;
|
|
92
|
+
status: Status;
|
|
93
|
+
}[]>;
|
|
94
|
+
Status: typeof Status;
|
|
95
|
+
filePrefixIcon: import("vue").ComputedRef<import("vue").DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
96
|
+
handlePause: () => void;
|
|
97
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
98
|
+
size: {
|
|
99
|
+
type: NumberConstructor;
|
|
100
|
+
default: number;
|
|
101
|
+
};
|
|
102
|
+
dictId: {
|
|
103
|
+
type: StringConstructor;
|
|
104
|
+
default: string;
|
|
105
|
+
};
|
|
106
|
+
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
107
|
+
label: StringConstructor;
|
|
108
|
+
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
109
|
+
prop: {
|
|
110
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp) | ((new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp))[], unknown, unknown>>;
|
|
111
|
+
readonly required: false;
|
|
112
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
113
|
+
__epPropKey: true;
|
|
114
|
+
};
|
|
115
|
+
rules: {
|
|
116
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>) | ((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>))[], unknown, unknown>>;
|
|
117
|
+
readonly required: false;
|
|
118
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
119
|
+
__epPropKey: true;
|
|
120
|
+
};
|
|
121
|
+
error: StringConstructor;
|
|
122
|
+
validateStatus: {
|
|
123
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
124
|
+
readonly required: false;
|
|
125
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
126
|
+
__epPropKey: true;
|
|
127
|
+
};
|
|
128
|
+
for: StringConstructor;
|
|
129
|
+
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
130
|
+
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
131
|
+
formItemSize: {
|
|
132
|
+
type: import("vue").PropType<"default" | "small" | "large">;
|
|
133
|
+
default: string;
|
|
134
|
+
};
|
|
135
|
+
formItemSlots: {
|
|
136
|
+
type: import("vue").PropType<import("../../form-item/src/types").FormItemSlots>;
|
|
137
|
+
default: undefined;
|
|
138
|
+
};
|
|
139
|
+
elRef: {
|
|
140
|
+
type: import("vue").PropType<any>;
|
|
141
|
+
required: boolean;
|
|
142
|
+
};
|
|
143
|
+
inline: {
|
|
144
|
+
type: BooleanConstructor;
|
|
145
|
+
default: boolean;
|
|
146
|
+
};
|
|
147
|
+
readonly: {
|
|
148
|
+
type: BooleanConstructor;
|
|
149
|
+
default: undefined;
|
|
150
|
+
};
|
|
151
|
+
}>>, {
|
|
152
|
+
required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
153
|
+
labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
154
|
+
inlineMessage: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, BooleanConstructor], unknown, unknown>;
|
|
155
|
+
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
156
|
+
size: number;
|
|
157
|
+
formItemSize: "default" | "small" | "large";
|
|
158
|
+
formItemSlots: import("../../form-item/src/types").FormItemSlots;
|
|
159
|
+
inline: boolean;
|
|
160
|
+
readonly: boolean;
|
|
161
|
+
dictId: string;
|
|
162
|
+
}>;
|
|
163
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Status } from './const';
|
|
2
|
+
export interface FileContainer {
|
|
3
|
+
file?: File;
|
|
4
|
+
hash?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Chunk {
|
|
7
|
+
fileName: string;
|
|
8
|
+
fileHash: string;
|
|
9
|
+
fileSize: number;
|
|
10
|
+
/**
|
|
11
|
+
* 当前块的文件
|
|
12
|
+
*/
|
|
13
|
+
chunk: Blob;
|
|
14
|
+
hash: string;
|
|
15
|
+
chunksLength: number;
|
|
16
|
+
index: number;
|
|
17
|
+
progress: number;
|
|
18
|
+
/**
|
|
19
|
+
* 分割大小
|
|
20
|
+
*/
|
|
21
|
+
sliceSize: number;
|
|
22
|
+
status: Status;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/index.css
CHANGED
|
@@ -216,6 +216,92 @@
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
|
|
219
|
+
@keyframes hide {
|
|
220
|
+
0% {
|
|
221
|
+
opacity: 1; /* 初始状态为完全显示 */
|
|
222
|
+
}
|
|
223
|
+
100% {
|
|
224
|
+
opacity: 0; /* 最终状态为完全隐藏 */
|
|
225
|
+
display: none; /* 同时隐藏元素 */
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.vkf-upload-plus{
|
|
230
|
+
--vkf-upload-plus-height: 34px;
|
|
231
|
+
}
|
|
232
|
+
.vkf-upload-plus-label{
|
|
233
|
+
position: relative;
|
|
234
|
+
}
|
|
235
|
+
.vkf-upload-plus-cube-x,
|
|
236
|
+
.vkf-upload-plus-msg-x
|
|
237
|
+
{
|
|
238
|
+
position: absolute;
|
|
239
|
+
top: 0;
|
|
240
|
+
left: 0;
|
|
241
|
+
bottom: 0;
|
|
242
|
+
right: 0;
|
|
243
|
+
}
|
|
244
|
+
.vkf-upload-plus-msg-x{
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
justify-content: center;
|
|
248
|
+
color: var(--el-color-success);
|
|
249
|
+
background: var(--el-bg-color);
|
|
250
|
+
animation-name: hide; /* 指定使用hide关键帧动画 */
|
|
251
|
+
animation-duration: 1s; /* 动画持续时间为2秒 */
|
|
252
|
+
animation-delay: 1s; /* 延迟2秒后开始动画 */
|
|
253
|
+
animation-fill-mode: forwards; /* 动画结束后保持最后一帧的状态 */
|
|
254
|
+
}
|
|
255
|
+
.vkf-upload-plus-msg{
|
|
256
|
+
margin-left: 2px;
|
|
257
|
+
}
|
|
258
|
+
.vkf-upload-plus-cube {
|
|
259
|
+
float: left;
|
|
260
|
+
height: 100%;
|
|
261
|
+
}
|
|
262
|
+
.vkf-upload-plus-cube.error {
|
|
263
|
+
background: var(--el-color-danger);
|
|
264
|
+
}
|
|
265
|
+
.vkf-upload-plus-cube .success{
|
|
266
|
+
background: var(--el-color-success);
|
|
267
|
+
}
|
|
268
|
+
.vkf-upload-plus-cube .uploading{
|
|
269
|
+
background: var(--el-color-primary);
|
|
270
|
+
}
|
|
271
|
+
.vkf-upload-plus-cube .error{
|
|
272
|
+
background: var(--el-color-danger);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.vkf-upload-plus-btng >.el-button:first-child{
|
|
276
|
+
border-radius: 0;
|
|
277
|
+
}
|
|
278
|
+
.vkf-upload-plus-btng >.el-button{
|
|
279
|
+
height: var(--vkf-upload-plus-height);
|
|
280
|
+
}
|
|
281
|
+
.vkf-upload-plus-main{
|
|
282
|
+
display: flex;
|
|
283
|
+
align-items: center;
|
|
284
|
+
border: var(--el-border);
|
|
285
|
+
border-radius: var(--el-border-radius-base);
|
|
286
|
+
}
|
|
287
|
+
.vkf-upload-plus-label{
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
}
|
|
290
|
+
.vkf-upload-plus-label .el-input{
|
|
291
|
+
pointer-events: none;
|
|
292
|
+
--el-input-border-color: transparent;
|
|
293
|
+
}
|
|
294
|
+
.vkf-upload-plus-label .el-input.is-success .el-icon{
|
|
295
|
+
color: var(--el-color-success);
|
|
296
|
+
}
|
|
297
|
+
.vkf-upload-plus-label .el-input.is-error .el-icon{
|
|
298
|
+
color: var(--el-color-danger);
|
|
299
|
+
}
|
|
300
|
+
.vkf-upload-plus-input{
|
|
301
|
+
display: none;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
|
|
219
305
|
.vkf-van-cascader .el-select{
|
|
220
306
|
--el-readonly-cursor: pointer;
|
|
221
307
|
}
|
package/package.json
CHANGED
|
@@ -9,5 +9,11 @@ export interface BasicSource {
|
|
|
9
9
|
class?: any;
|
|
10
10
|
prop?: any;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated use __VkfTemplatesDefault.Source<P>
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { __VkfTemplatesDefault } from '@vunk/form/components/templates-default'
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
12
18
|
export declare type FormItemRendererSource<P extends string = string> = __VkfTemplatesDefault.Source<P>;
|
|
13
19
|
export declare type AllTemplatesSource<P extends string = string> = __VkfTemplatesDefault.Source<P> | __VkfTemplatesMapbox.Source<P> | __VkfTemplatesLayout.ElRowSource<AllTemplatesSource<P>> | __VkfTemplatesLayout.ElColSource<AllTemplatesSource<P>> | __VkfTemplatesLayout.VkfFlexSource<AllTemplatesSource<P>> | __VkfTemplatesElementPlus.Source;
|