@mobileaction/action-kit 1.1.23 → 1.1.25
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/action-kit.js +3 -3
- package/dist/action-kit.mjs +1348 -981
- package/dist/close-circle-bulk-49febd0e.mjs +24 -0
- package/dist/close-circle-bulk-b52bdb88.js +1 -0
- package/dist/components/upload/composables/file.d.ts +7 -0
- package/dist/components/upload/index.vue.d.ts +203 -0
- package/dist/components/upload/singleFile.vue.d.ts +38 -0
- package/dist/components/upload/types.d.ts +17 -0
- package/dist/document-bulk-1d978376.mjs +24 -0
- package/dist/document-bulk-86acdc42.js +1 -0
- package/dist/export-2-6595b6fa.mjs +22 -0
- package/dist/export-2-69f06f16.js +1 -0
- package/dist/export-2-bold-5629dc36.js +1 -0
- package/dist/export-2-bold-8832fb34.mjs +19 -0
- package/dist/export-2-bulk-25deffb0.mjs +24 -0
- package/dist/export-2-bulk-e71812db.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/src/components/upload/composables/file.d.ts +7 -0
- package/dist/src/components/upload/index.vue.d.ts +72 -0
- package/dist/src/components/upload/singleFile.vue.d.ts +25 -0
- package/dist/src/components/upload/stories/box.stories.d.ts +11 -0
- package/dist/src/components/upload/stories/button.stories.d.ts +6 -0
- package/dist/src/components/upload/stories/constants.d.ts +6 -0
- package/dist/src/components/upload/stories/small-box.stories.d.ts +6 -0
- package/dist/src/components/upload/types.d.ts +17 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/trash-bulk-034c6526.js +1 -0
- package/dist/trash-bulk-89ab0a45.mjs +30 -0
- package/dist/upload-bulk-4dd4fc57.js +1 -0
- package/dist/upload-bulk-c4de9af1.mjs +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { openBlock as o, createElementBlock as t, createElementVNode as e } from "vue";
|
|
2
|
+
const l = {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24"
|
|
6
|
+
}, c = /* @__PURE__ */ e("path", {
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
d: "M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z",
|
|
9
|
+
opacity: ".4"
|
|
10
|
+
}, null, -1), n = /* @__PURE__ */ e("path", {
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
d: "m13.06 12 2.3-2.3c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.3 2.3-2.3-2.3a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l2.3 2.3-2.3 2.3c-.29.29-.29.77 0 1.06.15.15.34.22.53.22s.38-.07.53-.22l2.3-2.3 2.3 2.3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-2.3-2.3Z"
|
|
13
|
+
}, null, -1), r = [
|
|
14
|
+
c,
|
|
15
|
+
n
|
|
16
|
+
];
|
|
17
|
+
function s(i, a) {
|
|
18
|
+
return o(), t("svg", l, r);
|
|
19
|
+
}
|
|
20
|
+
const _ = { render: s };
|
|
21
|
+
export {
|
|
22
|
+
_ as default,
|
|
23
|
+
s as render
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},o=e.createElementVNode("path",{fill:"currentColor",d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z",opacity:".4"},null,-1),c=e.createElementVNode("path",{fill:"currentColor",d:"m13.06 12 2.3-2.3c.29-.29.29-.77 0-1.06a.754.754 0 0 0-1.06 0l-2.3 2.3-2.3-2.3a.754.754 0 0 0-1.06 0c-.29.29-.29.77 0 1.06l2.3 2.3-2.3 2.3c-.29.29-.29.77 0 1.06.15.15.34.22.53.22s.38-.07.53-.22l2.3-2.3 2.3 2.3c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-2.3-2.3Z"},null,-1),n=[o,c];function t(s,i){return e.openBlock(),e.createElementBlock("svg",l,n)}const r={render:t};exports.default=r;exports.render=t;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MAUploadFile, MaUploadFileStatus } from './../types';
|
|
2
|
+
export declare const generateFileID: (length?: number) => string;
|
|
3
|
+
export declare const useUploadFile: (action: string, headers: Record<string, string>, additionalData: Record<string, any>, name: string) => {
|
|
4
|
+
progress: import("vue").Ref<number>;
|
|
5
|
+
upload: (maFile: MAUploadFile, cb: (status: MaUploadFileStatus, progress: number, response?: any) => void) => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export declare const validateFile: (file: File, acceptedTypesStr: string) => boolean;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import type { PropType as __PropType } from 'vue';
|
|
2
|
+
import { MaUploadType, MaUploadSize, MAUploadFile } from './types';
|
|
3
|
+
export interface MaUploadProps {
|
|
4
|
+
fileList: MAUploadFile[];
|
|
5
|
+
type?: MaUploadType;
|
|
6
|
+
size?: MaUploadSize;
|
|
7
|
+
accept?: string;
|
|
8
|
+
action?: string;
|
|
9
|
+
beforeUpload?: (file: File) => Promise<File>;
|
|
10
|
+
data?: Object;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
maxCount?: number;
|
|
14
|
+
maxFileSize?: number;
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
name?: string;
|
|
17
|
+
ordered?: boolean;
|
|
18
|
+
showFileList?: boolean;
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
wait?: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
24
|
+
fileList: {
|
|
25
|
+
type: __PropType<MAUploadFile[]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
type: {
|
|
29
|
+
type: __PropType<"button" | "box" | "small-box">;
|
|
30
|
+
required: false;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
size: {
|
|
34
|
+
type: __PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
35
|
+
required: false;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
accept: {
|
|
39
|
+
type: __PropType<string>;
|
|
40
|
+
required: false;
|
|
41
|
+
};
|
|
42
|
+
action: {
|
|
43
|
+
type: __PropType<string>;
|
|
44
|
+
required: false;
|
|
45
|
+
};
|
|
46
|
+
beforeUpload: {
|
|
47
|
+
type: __PropType<(file: File) => Promise<File>>;
|
|
48
|
+
required: false;
|
|
49
|
+
};
|
|
50
|
+
data: {
|
|
51
|
+
type: __PropType<Object>;
|
|
52
|
+
required: false;
|
|
53
|
+
};
|
|
54
|
+
disabled: {
|
|
55
|
+
type: __PropType<boolean>;
|
|
56
|
+
required: false;
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
59
|
+
headers: {
|
|
60
|
+
type: __PropType<Record<string, string>>;
|
|
61
|
+
required: false;
|
|
62
|
+
default: () => {};
|
|
63
|
+
};
|
|
64
|
+
maxCount: {
|
|
65
|
+
type: __PropType<number>;
|
|
66
|
+
required: false;
|
|
67
|
+
};
|
|
68
|
+
maxFileSize: {
|
|
69
|
+
type: __PropType<number>;
|
|
70
|
+
required: false;
|
|
71
|
+
};
|
|
72
|
+
multiple: {
|
|
73
|
+
type: __PropType<boolean>;
|
|
74
|
+
required: false;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
77
|
+
name: {
|
|
78
|
+
type: __PropType<string>;
|
|
79
|
+
required: false;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
ordered: {
|
|
83
|
+
type: __PropType<boolean>;
|
|
84
|
+
required: false;
|
|
85
|
+
default: boolean;
|
|
86
|
+
};
|
|
87
|
+
showFileList: {
|
|
88
|
+
type: __PropType<boolean>;
|
|
89
|
+
required: false;
|
|
90
|
+
default: boolean;
|
|
91
|
+
};
|
|
92
|
+
title: {
|
|
93
|
+
type: __PropType<string>;
|
|
94
|
+
required: false;
|
|
95
|
+
};
|
|
96
|
+
description: {
|
|
97
|
+
type: __PropType<string>;
|
|
98
|
+
required: false;
|
|
99
|
+
};
|
|
100
|
+
wait: {
|
|
101
|
+
type: __PropType<boolean>;
|
|
102
|
+
required: false;
|
|
103
|
+
default: boolean;
|
|
104
|
+
};
|
|
105
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "change" | "update:fileList" | "remove")[], "error" | "change" | "update:fileList" | "remove", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
106
|
+
fileList: {
|
|
107
|
+
type: __PropType<MAUploadFile[]>;
|
|
108
|
+
required: true;
|
|
109
|
+
};
|
|
110
|
+
type: {
|
|
111
|
+
type: __PropType<"button" | "box" | "small-box">;
|
|
112
|
+
required: false;
|
|
113
|
+
default: string;
|
|
114
|
+
};
|
|
115
|
+
size: {
|
|
116
|
+
type: __PropType<"xs" | "sm" | "md" | "lg" | "xl">;
|
|
117
|
+
required: false;
|
|
118
|
+
default: string;
|
|
119
|
+
};
|
|
120
|
+
accept: {
|
|
121
|
+
type: __PropType<string>;
|
|
122
|
+
required: false;
|
|
123
|
+
};
|
|
124
|
+
action: {
|
|
125
|
+
type: __PropType<string>;
|
|
126
|
+
required: false;
|
|
127
|
+
};
|
|
128
|
+
beforeUpload: {
|
|
129
|
+
type: __PropType<(file: File) => Promise<File>>;
|
|
130
|
+
required: false;
|
|
131
|
+
};
|
|
132
|
+
data: {
|
|
133
|
+
type: __PropType<Object>;
|
|
134
|
+
required: false;
|
|
135
|
+
};
|
|
136
|
+
disabled: {
|
|
137
|
+
type: __PropType<boolean>;
|
|
138
|
+
required: false;
|
|
139
|
+
default: boolean;
|
|
140
|
+
};
|
|
141
|
+
headers: {
|
|
142
|
+
type: __PropType<Record<string, string>>;
|
|
143
|
+
required: false;
|
|
144
|
+
default: () => {};
|
|
145
|
+
};
|
|
146
|
+
maxCount: {
|
|
147
|
+
type: __PropType<number>;
|
|
148
|
+
required: false;
|
|
149
|
+
};
|
|
150
|
+
maxFileSize: {
|
|
151
|
+
type: __PropType<number>;
|
|
152
|
+
required: false;
|
|
153
|
+
};
|
|
154
|
+
multiple: {
|
|
155
|
+
type: __PropType<boolean>;
|
|
156
|
+
required: false;
|
|
157
|
+
default: boolean;
|
|
158
|
+
};
|
|
159
|
+
name: {
|
|
160
|
+
type: __PropType<string>;
|
|
161
|
+
required: false;
|
|
162
|
+
default: string;
|
|
163
|
+
};
|
|
164
|
+
ordered: {
|
|
165
|
+
type: __PropType<boolean>;
|
|
166
|
+
required: false;
|
|
167
|
+
default: boolean;
|
|
168
|
+
};
|
|
169
|
+
showFileList: {
|
|
170
|
+
type: __PropType<boolean>;
|
|
171
|
+
required: false;
|
|
172
|
+
default: boolean;
|
|
173
|
+
};
|
|
174
|
+
title: {
|
|
175
|
+
type: __PropType<string>;
|
|
176
|
+
required: false;
|
|
177
|
+
};
|
|
178
|
+
description: {
|
|
179
|
+
type: __PropType<string>;
|
|
180
|
+
required: false;
|
|
181
|
+
};
|
|
182
|
+
wait: {
|
|
183
|
+
type: __PropType<boolean>;
|
|
184
|
+
required: false;
|
|
185
|
+
default: boolean;
|
|
186
|
+
};
|
|
187
|
+
}>> & {
|
|
188
|
+
onError?: (...args: any[]) => any;
|
|
189
|
+
onChange?: (...args: any[]) => any;
|
|
190
|
+
"onUpdate:fileList"?: (...args: any[]) => any;
|
|
191
|
+
onRemove?: (...args: any[]) => any;
|
|
192
|
+
}, {
|
|
193
|
+
type: "button" | "box" | "small-box";
|
|
194
|
+
name: string;
|
|
195
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
196
|
+
disabled: boolean;
|
|
197
|
+
multiple: boolean;
|
|
198
|
+
headers: Record<string, string>;
|
|
199
|
+
ordered: boolean;
|
|
200
|
+
showFileList: boolean;
|
|
201
|
+
wait: boolean;
|
|
202
|
+
}>;
|
|
203
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PropType as __PropType } from 'vue';
|
|
2
|
+
import { MAUploadFile } from './types';
|
|
3
|
+
export interface SingleFileProps {
|
|
4
|
+
file: MAUploadFile;
|
|
5
|
+
action?: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
9
|
+
file: {
|
|
10
|
+
type: __PropType<MAUploadFile>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
action: {
|
|
14
|
+
type: __PropType<string>;
|
|
15
|
+
required: false;
|
|
16
|
+
};
|
|
17
|
+
disabled: {
|
|
18
|
+
type: __PropType<boolean>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "remove")[], "cancel" | "remove", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
file: {
|
|
23
|
+
type: __PropType<MAUploadFile>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
action: {
|
|
27
|
+
type: __PropType<string>;
|
|
28
|
+
required: false;
|
|
29
|
+
};
|
|
30
|
+
disabled: {
|
|
31
|
+
type: __PropType<boolean>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
}>> & {
|
|
35
|
+
onCancel?: (...args: any[]) => any;
|
|
36
|
+
onRemove?: (...args: any[]) => any;
|
|
37
|
+
}, {}>;
|
|
38
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const MaUploadTypes: readonly ["button", "box", "small-box"];
|
|
2
|
+
export declare const MaUploadSizes: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
3
|
+
export declare enum MaUploadFileStatus {
|
|
4
|
+
error = "error",
|
|
5
|
+
done = "done",
|
|
6
|
+
uploading = "uploading"
|
|
7
|
+
}
|
|
8
|
+
export interface MAUploadFile {
|
|
9
|
+
id: string;
|
|
10
|
+
file: File;
|
|
11
|
+
status: MaUploadFileStatus;
|
|
12
|
+
response: any;
|
|
13
|
+
progress: number;
|
|
14
|
+
cancelRequest?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export type MaUploadType = (typeof MaUploadTypes)[number];
|
|
17
|
+
export type MaUploadSize = (typeof MaUploadSizes)[number];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { openBlock as e, createElementBlock as t, createElementVNode as c } from "vue";
|
|
2
|
+
const o = {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24"
|
|
6
|
+
}, n = /* @__PURE__ */ c("path", {
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
d: "M21 7v10c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V7c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5Z",
|
|
9
|
+
opacity: ".4"
|
|
10
|
+
}, null, -1), l = /* @__PURE__ */ c("path", {
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
d: "M18.5 9.25h-2c-1.52 0-2.75-1.23-2.75-2.75v-2c0-.41.34-.75.75-.75s.75.34.75.75v2c0 .69.56 1.25 1.25 1.25h2c.41 0 .75.34.75.75s-.34.75-.75.75ZM12 13.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75ZM16 17.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h8c.41 0 .75.34.75.75s-.34.75-.75.75Z"
|
|
13
|
+
}, null, -1), s = [
|
|
14
|
+
n,
|
|
15
|
+
l
|
|
16
|
+
];
|
|
17
|
+
function r(h, d) {
|
|
18
|
+
return e(), t("svg", o, s);
|
|
19
|
+
}
|
|
20
|
+
const _ = { render: r };
|
|
21
|
+
export {
|
|
22
|
+
_ as default,
|
|
23
|
+
r as render
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},o=e.createElementVNode("path",{fill:"currentColor",d:"M21 7v10c0 3-1.5 5-5 5H8c-3.5 0-5-2-5-5V7c0-3 1.5-5 5-5h8c3.5 0 5 2 5 5Z",opacity:".4"},null,-1),n=e.createElementVNode("path",{fill:"currentColor",d:"M18.5 9.25h-2c-1.52 0-2.75-1.23-2.75-2.75v-2c0-.41.34-.75.75-.75s.75.34.75.75v2c0 .69.56 1.25 1.25 1.25h2c.41 0 .75.34.75.75s-.34.75-.75.75ZM12 13.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75ZM16 17.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h8c.41 0 .75.34.75.75s-.34.75-.75.75Z"},null,-1),r=[o,n];function t(s,d){return e.openBlock(),e.createElementBlock("svg",c,r)}const l={render:t};exports.default=l;exports.render=t;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { openBlock as e, createElementBlock as o, createElementVNode as t } from "vue";
|
|
2
|
+
const n = {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24"
|
|
6
|
+
}, r = /* @__PURE__ */ t("path", {
|
|
7
|
+
stroke: "currentColor",
|
|
8
|
+
"stroke-linecap": "round",
|
|
9
|
+
"stroke-linejoin": "round",
|
|
10
|
+
"stroke-width": "1.5",
|
|
11
|
+
d: "M16.44 8.9c3.6.31 5.07 2.16 5.07 6.21v.13c0 4.47-1.79 6.26-6.26 6.26H8.74c-4.47 0-6.26-1.79-6.26-6.26v-.13c0-4.02 1.45-5.87 4.99-6.2M12 15V3.62M15.35 5.85 12 2.5 8.65 5.85"
|
|
12
|
+
}, null, -1), c = [
|
|
13
|
+
r
|
|
14
|
+
];
|
|
15
|
+
function s(l, d) {
|
|
16
|
+
return e(), o("svg", n, c);
|
|
17
|
+
}
|
|
18
|
+
const _ = { render: s };
|
|
19
|
+
export {
|
|
20
|
+
_ as default,
|
|
21
|
+
s as render
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},r=e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M16.44 8.9c3.6.31 5.07 2.16 5.07 6.21v.13c0 4.47-1.79 6.26-6.26 6.26H8.74c-4.47 0-6.26-1.79-6.26-6.26v-.13c0-4.02 1.45-5.87 4.99-6.2M12 15V3.62M15.35 5.85 12 2.5 8.65 5.85"},null,-1),n=[r];function t(s,l){return e.openBlock(),e.createElementBlock("svg",o,n)}const c={render:t};exports.default=c;exports.render=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},c=e.createElementVNode("path",{fill:"currentColor",d:"M16.8 9h-4.05v6.25c0 .41-.34.75-.75.75s-.75-.34-.75-.75V9H7.2C4 9 2 11 2 14.2v2.59C2 20 4 22 7.2 22h9.59c3.2 0 5.2-2 5.2-5.2v-2.6C22 11 20 9 16.8 9ZM12.75 4.56l2.07 2.07c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-3.35-3.35a.754.754 0 0 0-1.06 0L8.12 5.57c-.29.29-.29.77 0 1.06.29.29.77.29 1.06 0l2.07-2.07V9h1.5V4.56Z"},null,-1),n=[c];function t(l,s){return e.openBlock(),e.createElementBlock("svg",o,n)}const r={render:t};exports.default=r;exports.render=t;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { openBlock as e, createElementBlock as o, createElementVNode as t } from "vue";
|
|
2
|
+
const c = {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24"
|
|
6
|
+
}, l = /* @__PURE__ */ t("path", {
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
d: "M16.8 9h-4.05v6.25c0 .41-.34.75-.75.75s-.75-.34-.75-.75V9H7.2C4 9 2 11 2 14.2v2.59C2 20 4 22 7.2 22h9.59c3.2 0 5.2-2 5.2-5.2v-2.6C22 11 20 9 16.8 9ZM12.75 4.56l2.07 2.07c.15.15.34.22.53.22s.38-.07.53-.22c.29-.29.29-.77 0-1.06l-3.35-3.35a.754.754 0 0 0-1.06 0L8.12 5.57c-.29.29-.29.77 0 1.06.29.29.77.29 1.06 0l2.07-2.07V9h1.5V4.56Z"
|
|
9
|
+
}, null, -1), n = [
|
|
10
|
+
l
|
|
11
|
+
];
|
|
12
|
+
function r(s, d) {
|
|
13
|
+
return e(), o("svg", c, n);
|
|
14
|
+
}
|
|
15
|
+
const i = { render: r };
|
|
16
|
+
export {
|
|
17
|
+
i as default,
|
|
18
|
+
r as render
|
|
19
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { openBlock as t, createElementBlock as o, createElementVNode as e } from "vue";
|
|
2
|
+
const c = {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24"
|
|
6
|
+
}, l = /* @__PURE__ */ e("path", {
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
d: "M16.8 9H7.2C4 9 2 11 2 14.2v2.59C2 20 4 22 7.2 22h9.59c3.2 0 5.2-2 5.2-5.2v-2.6C22 11 20 9 16.8 9Z",
|
|
9
|
+
opacity: ".4"
|
|
10
|
+
}, null, -1), n = /* @__PURE__ */ e("path", {
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
d: "m15.88 5.57-3.35-3.35a.754.754 0 0 0-1.06 0L8.12 5.57c-.29.29-.29.77 0 1.06.29.29.77.29 1.06 0l2.07-2.07v10.69c0 .41.34.75.75.75s.75-.34.75-.75V4.56l2.07 2.07c.15.15.34.22.53.22s.38-.07.53-.22c.3-.29.3-.76 0-1.06Z"
|
|
13
|
+
}, null, -1), r = [
|
|
14
|
+
l,
|
|
15
|
+
n
|
|
16
|
+
];
|
|
17
|
+
function s(i, d) {
|
|
18
|
+
return t(), o("svg", c, r);
|
|
19
|
+
}
|
|
20
|
+
const a = { render: s };
|
|
21
|
+
export {
|
|
22
|
+
a as default,
|
|
23
|
+
s as render
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},c=e.createElementVNode("path",{fill:"currentColor",d:"M16.8 9H7.2C4 9 2 11 2 14.2v2.59C2 20 4 22 7.2 22h9.59c3.2 0 5.2-2 5.2-5.2v-2.6C22 11 20 9 16.8 9Z",opacity:".4"},null,-1),l=e.createElementVNode("path",{fill:"currentColor",d:"m15.88 5.57-3.35-3.35a.754.754 0 0 0-1.06 0L8.12 5.57c-.29.29-.29.77 0 1.06.29.29.77.29 1.06 0l2.07-2.07v10.69c0 .41.34.75.75.75s.75-.34.75-.75V4.56l2.07 2.07c.15.15.34.22.53.22s.38-.07.53-.22c.3-.29.3-.76 0-1.06Z"},null,-1),n=[c,l];function t(s,d){return e.openBlock(),e.createElementBlock("svg",o,n)}const r={render:t};exports.default=r;exports.render=t;
|
package/dist/index.d.ts
CHANGED
|
@@ -44,5 +44,7 @@ export { default as MaDropdown } from './components/dropdown/index.vue';
|
|
|
44
44
|
export * from './components/dropdown/types';
|
|
45
45
|
export { default as MaEmpty } from './components/empty/index.vue';
|
|
46
46
|
export * from './components/empty/types';
|
|
47
|
+
export { default as MaUpload } from './components/upload/index.vue';
|
|
48
|
+
export * from './components/upload/types';
|
|
47
49
|
export { ActionKitConfig } from './services/config';
|
|
48
50
|
export { useActionKitConfig } from './composables/config';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MAUploadFile, MaUploadFileStatus } from './../types';
|
|
2
|
+
export declare const generateFileID: (length?: number) => string;
|
|
3
|
+
export declare const useUploadFile: (action: string, headers: Record<string, string>, additionalData: Record<string, any>, name: string) => {
|
|
4
|
+
progress: import("vue").Ref<number>;
|
|
5
|
+
upload: (maFile: MAUploadFile, cb: (status: MaUploadFileStatus, progress: number, response?: any) => void) => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export declare const validateFile: (file: File, acceptedTypesStr: string) => boolean;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { MaUploadType, MaUploadSize, MAUploadFile } from './types';
|
|
2
|
+
export interface MaUploadProps {
|
|
3
|
+
fileList: MAUploadFile[];
|
|
4
|
+
type?: MaUploadType;
|
|
5
|
+
size?: MaUploadSize;
|
|
6
|
+
accept?: string;
|
|
7
|
+
action?: string;
|
|
8
|
+
beforeUpload?: (file: File) => Promise<File>;
|
|
9
|
+
data?: Object;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
maxCount?: number;
|
|
13
|
+
maxFileSize?: number;
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
name?: string;
|
|
16
|
+
ordered?: boolean;
|
|
17
|
+
showFileList?: boolean;
|
|
18
|
+
title?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
wait?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MaUploadProps>, {
|
|
23
|
+
type: string;
|
|
24
|
+
headers: () => {};
|
|
25
|
+
multiple: boolean;
|
|
26
|
+
name: string;
|
|
27
|
+
ordered: boolean;
|
|
28
|
+
showFileList: boolean;
|
|
29
|
+
size: string;
|
|
30
|
+
wait: boolean;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "change" | "remove" | "update:fileList")[], "error" | "change" | "remove" | "update:fileList", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MaUploadProps>, {
|
|
33
|
+
type: string;
|
|
34
|
+
headers: () => {};
|
|
35
|
+
multiple: boolean;
|
|
36
|
+
name: string;
|
|
37
|
+
ordered: boolean;
|
|
38
|
+
showFileList: boolean;
|
|
39
|
+
size: string;
|
|
40
|
+
wait: boolean;
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
}>>> & {
|
|
43
|
+
onChange?: (...args: any[]) => any;
|
|
44
|
+
onError?: (...args: any[]) => any;
|
|
45
|
+
onRemove?: (...args: any[]) => any;
|
|
46
|
+
"onUpdate:fileList"?: (...args: any[]) => any;
|
|
47
|
+
}, {
|
|
48
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
49
|
+
name: string;
|
|
50
|
+
type: "button" | "box" | "small-box";
|
|
51
|
+
disabled: boolean;
|
|
52
|
+
multiple: boolean;
|
|
53
|
+
wait: boolean;
|
|
54
|
+
headers: Record<string, string>;
|
|
55
|
+
ordered: boolean;
|
|
56
|
+
showFileList: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
export default _default;
|
|
59
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
60
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
61
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
62
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
63
|
+
} : {
|
|
64
|
+
type: import('vue').PropType<T[K]>;
|
|
65
|
+
required: true;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
69
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
70
|
+
default: D[K];
|
|
71
|
+
} : P[K];
|
|
72
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MAUploadFile } from './types';
|
|
2
|
+
export interface SingleFileProps {
|
|
3
|
+
file: MAUploadFile;
|
|
4
|
+
action?: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SingleFileProps>, {}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "remove")[], "cancel" | "remove", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<SingleFileProps>, {}>>> & {
|
|
8
|
+
onCancel?: (...args: any[]) => any;
|
|
9
|
+
onRemove?: (...args: any[]) => any;
|
|
10
|
+
}, {}>;
|
|
11
|
+
export default _default;
|
|
12
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
declare type __VLS_WithDefaults<P, D> = {
|
|
22
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
23
|
+
default: D[K];
|
|
24
|
+
} : P[K];
|
|
25
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
import type MaUpload from '../index.vue';
|
|
3
|
+
declare const meta: Meta<typeof MaUpload>;
|
|
4
|
+
export default meta;
|
|
5
|
+
declare type Story = StoryObj<typeof MaUpload>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithoutAction: Story;
|
|
8
|
+
export declare const BeforeUpload: Story;
|
|
9
|
+
export declare const Ordered: Story;
|
|
10
|
+
export declare const Single: Story;
|
|
11
|
+
export declare const ExistingFiles: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
+
import MaUpload from '../index.vue';
|
|
3
|
+
export declare const baseConfig: Meta<typeof MaUpload>;
|
|
4
|
+
export declare const Template: StoryFn;
|
|
5
|
+
export declare const BeforeUploadTemplate: StoryFn;
|
|
6
|
+
export declare const ExistingFilesTemplate: StoryFn;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const MaUploadTypes: readonly ["button", "box", "small-box"];
|
|
2
|
+
export declare const MaUploadSizes: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
3
|
+
export declare enum MaUploadFileStatus {
|
|
4
|
+
error = "error",
|
|
5
|
+
done = "done",
|
|
6
|
+
uploading = "uploading"
|
|
7
|
+
}
|
|
8
|
+
export interface MAUploadFile {
|
|
9
|
+
id: string;
|
|
10
|
+
file: File;
|
|
11
|
+
status: MaUploadFileStatus;
|
|
12
|
+
response: any;
|
|
13
|
+
progress: number;
|
|
14
|
+
cancelRequest?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare type MaUploadType = (typeof MaUploadTypes)[number];
|
|
17
|
+
export declare type MaUploadSize = (typeof MaUploadSizes)[number];
|
package/dist/src/index.d.ts
CHANGED
|
@@ -45,5 +45,7 @@ export { default as MaDropdown } from './components/dropdown/index.vue';
|
|
|
45
45
|
export * from './components/dropdown/types';
|
|
46
46
|
export { default as MaEmpty } from './components/empty/index.vue';
|
|
47
47
|
export * from './components/empty/types';
|
|
48
|
+
export { default as MaUpload } from './components/upload/index.vue';
|
|
49
|
+
export * from './components/upload/types';
|
|
48
50
|
export { ActionKitConfig } from './services/config';
|
|
49
51
|
export { useActionKitConfig } from './composables/config';
|