ep-craft 0.1.32 → 0.1.34
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/components/button/index.d.ts +12 -0
- package/dist/components/button-group/index.d.ts +3 -2
- package/dist/components/button-group/index.js +7 -3
- package/dist/components/button-group/src/button-group.d.ts +48 -0
- package/dist/components/button-group/src/button-group.js +7 -0
- package/dist/components/button-group/src/button-group.vue.d.ts +16 -0
- package/dist/components/button-group/src/button-group.vue.js +42 -0
- package/dist/components/button-group/src/button-group2.vue.js +4 -0
- package/dist/components/checkbox/index.js +6 -5
- package/dist/components/collection/index.d.ts +8 -0
- package/dist/components/collection/src/collection-item.vue.d.ts +2 -0
- package/dist/components/collection/src/collection-item.vue.js +10 -0
- package/dist/components/collection/src/collection-item2.vue.js +8 -0
- package/dist/components/collection/src/collection.d.ts +39 -0
- package/dist/components/collection/src/collection.js +52 -0
- package/dist/components/collection/src/collection.vue.d.ts +2 -0
- package/dist/components/collection/src/collection.vue.js +10 -0
- package/dist/components/collection/src/collection2.vue.js +7 -0
- package/dist/components/collection/src/tokens.d.ts +18 -0
- package/dist/components/divider/index.d.ts +24 -2
- package/dist/components/divider/index.js +8 -3
- package/dist/components/divider/src/divider.d.ts +30 -0
- package/dist/components/divider/src/divider.js +34 -0
- package/dist/components/divider/src/divider.vue.d.ts +24 -0
- package/dist/components/divider/src/divider.vue.js +39 -0
- package/dist/components/divider/src/divider2.vue.js +4 -0
- package/dist/components/dropdown/index.d.ts +3017 -3
- package/dist/components/dropdown/index.js +23 -3
- package/dist/components/dropdown/src/dropdown-item-impl.vue.d.ts +79 -0
- package/dist/components/dropdown/src/dropdown-item-impl.vue.js +40 -0
- package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +68 -0
- package/dist/components/dropdown/src/dropdown-item.vue.d.ts +169 -0
- package/dist/components/dropdown/src/dropdown-item.vue.js +35 -0
- package/dist/components/dropdown/src/dropdown-item2.vue.js +63 -0
- package/dist/components/dropdown/src/dropdown-menu.vue.d.ts +27 -0
- package/dist/components/dropdown/src/dropdown-menu.vue.js +24 -0
- package/dist/components/dropdown/src/dropdown-menu2.vue.js +75 -0
- package/dist/components/dropdown/src/dropdown.d.ts +200 -0
- package/dist/components/dropdown/src/dropdown.js +201 -0
- package/dist/components/dropdown/src/dropdown.vue.d.ts +1126 -0
- package/dist/components/dropdown/src/dropdown.vue.js +127 -0
- package/dist/components/dropdown/src/dropdown2.vue.js +127 -0
- package/dist/components/dropdown/src/instance.d.ts +2 -0
- package/dist/components/dropdown/src/tokens.d.ts +13 -0
- package/dist/components/dropdown/src/tokens.js +5 -0
- package/dist/components/dropdown/src/useDropdown.d.ts +5 -0
- package/dist/components/dropdown/src/useDropdown.js +15 -0
- package/dist/components/dropdown-item/index.d.ts +1 -4
- package/dist/components/dropdown-menu/index.d.ts +1 -4
- package/dist/components/index.js +129 -131
- package/dist/components/popover/index.d.ts +121 -3
- package/dist/components/popover/index.js +19 -4
- package/dist/components/popover/src/directive.d.ts +4 -0
- package/dist/components/popover/src/directive.js +15 -0
- package/dist/components/popover/src/popover.d.ts +291 -0
- package/dist/components/popover/src/popover.js +168 -0
- package/dist/components/popover/src/popover.vue.d.ts +53 -0
- package/dist/components/popover/src/popover.vue.js +125 -0
- package/dist/components/popover/src/popover2.vue.js +4 -0
- package/dist/components/progress/index.d.ts +35 -2
- package/dist/components/progress/index.js +10 -4
- package/dist/components/progress/src/progress.d.ts +97 -0
- package/dist/components/progress/src/progress.js +104 -0
- package/dist/components/progress/src/progress.vue.d.ts +30 -0
- package/dist/components/progress/src/progress.vue.js +179 -0
- package/dist/components/progress/src/progress2.vue.js +4 -0
- package/dist/components/roving-focus-group/index.d.ts +14 -0
- package/dist/components/roving-focus-group/index.js +15 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +50 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.js +10 -0
- package/dist/components/roving-focus-group/src/roving-focus-group-impl2.vue.js +115 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.d.ts +56 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.js +43 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.d.ts +67 -0
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +13 -0
- package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +21 -0
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.d.ts +43 -0
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +20 -0
- package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +78 -0
- package/dist/components/roving-focus-group/src/tokens.d.ts +28 -0
- package/dist/components/roving-focus-group/src/tokens.js +5 -0
- package/dist/components/roving-focus-group/src/utils.d.ts +8 -0
- package/dist/components/roving-focus-group/src/utils.js +28 -0
- package/dist/components/table/index.d.ts +56 -3
- package/dist/components/table/index.js +20 -4
- package/dist/components/table/src/composables/use-scrollbar.d.ts +6 -0
- package/dist/components/table/src/composables/use-scrollbar.js +24 -0
- package/dist/components/table/src/config.d.ts +87 -0
- package/dist/components/table/src/config.js +210 -0
- package/dist/components/table/src/filter-panel.vue.d.ts +837 -0
- package/dist/components/table/src/filter-panel.vue.js +130 -0
- package/dist/components/table/src/filter-panel2.vue.js +155 -0
- package/dist/components/table/src/h-helper.d.ts +13 -0
- package/dist/components/table/src/h-helper.js +30 -0
- package/dist/components/table/src/layout-observer.d.ts +8 -0
- package/dist/components/table/src/layout-observer.js +49 -0
- package/dist/components/table/src/store/current.d.ts +15 -0
- package/dist/components/table/src/store/current.js +45 -0
- package/dist/components/table/src/store/expand.d.ts +14 -0
- package/dist/components/table/src/store/expand.js +55 -0
- package/dist/components/table/src/store/helper.d.ts +548 -0
- package/dist/components/table/src/store/helper.js +61 -0
- package/dist/components/table/src/store/index.d.ts +1107 -0
- package/dist/components/table/src/store/index.js +123 -0
- package/dist/components/table/src/store/tree.d.ts +27 -0
- package/dist/components/table/src/store/tree.js +153 -0
- package/dist/components/table/src/store/watcher.d.ts +88 -0
- package/dist/components/table/src/store/watcher.js +483 -0
- package/dist/components/table/src/table/defaults.d.ts +560 -0
- package/dist/components/table/src/table/defaults.js +236 -0
- package/dist/components/table/src/table/key-render-helper.d.ts +2 -0
- package/dist/components/table/src/table/key-render-helper.js +18 -0
- package/dist/components/table/src/table/style-helper.d.ts +51 -0
- package/dist/components/table/src/table/style-helper.js +169 -0
- package/dist/components/table/src/table/utils-helper.d.ts +16 -0
- package/dist/components/table/src/table/utils-helper.js +36 -0
- package/dist/components/table/src/table-body/defaults.d.ts +39 -0
- package/dist/components/table/src/table-body/defaults.js +25 -0
- package/dist/components/table/src/table-body/events-helper.d.ts +19 -0
- package/dist/components/table/src/table-body/events-helper.js +126 -0
- package/dist/components/table/src/table-body/index.d.ts +84 -0
- package/dist/components/table/src/table-body/index.js +77 -0
- package/dist/components/table/src/table-body/render-helper.d.ts +18 -0
- package/dist/components/table/src/table-body/render-helper.js +188 -0
- package/dist/components/table/src/table-body/styles-helper.d.ts +15 -0
- package/dist/components/table/src/table-body/styles-helper.js +98 -0
- package/dist/components/table/src/table-body/td-wrapper.vue.d.ts +33 -0
- package/dist/components/table/src/table-body/td-wrapper.vue.js +26 -0
- package/dist/components/table/src/table-body/td-wrapper2.vue.js +4 -0
- package/dist/components/table/src/table-column/defaults.d.ts +348 -0
- package/dist/components/table/src/table-column/defaults.js +152 -0
- package/dist/components/table/src/table-column/index.d.ts +2 -0
- package/dist/components/table/src/table-column/index.vue.d.ts +32 -0
- package/dist/components/table/src/table-column/index.vue.js +161 -0
- package/dist/components/table/src/table-column/index2.vue.js +4 -0
- package/dist/components/table/src/table-column/render-helper.d.ts +17 -0
- package/dist/components/table/src/table-column/render-helper.js +116 -0
- package/dist/components/table/src/table-column/watcher-helper.d.ts +8 -0
- package/dist/components/table/src/table-column/watcher-helper.js +85 -0
- package/dist/components/table/src/table-footer/index.d.ts +79 -0
- package/dist/components/table/src/table-footer/index.js +110 -0
- package/dist/components/table/src/table-footer/mapState-helper.d.ts +9 -0
- package/dist/components/table/src/table-footer/mapState-helper.js +16 -0
- package/dist/components/table/src/table-footer/style-helper.d.ts +9 -0
- package/dist/components/table/src/table-footer/style-helper.js +42 -0
- package/dist/components/table/src/table-header/event-helper.d.ts +14 -0
- package/dist/components/table/src/table-header/event-helper.js +113 -0
- package/dist/components/table/src/table-header/index.d.ts +361 -0
- package/dist/components/table/src/table-header/index.js +255 -0
- package/dist/components/table/src/table-header/style.helper.d.ts +10 -0
- package/dist/components/table/src/table-header/style.helper.js +73 -0
- package/dist/components/table/src/table-header/utils-helper.d.ts +10 -0
- package/dist/components/table/src/table-header/utils-helper.js +45 -0
- package/dist/components/table/src/table-layout.d.ts +37 -0
- package/dist/components/table/src/table-layout.js +144 -0
- package/dist/components/table/src/table.vue.d.ts +734 -0
- package/dist/components/table/src/table.vue.js +443 -0
- package/dist/components/table/src/table2.vue.js +4 -0
- package/dist/components/table/src/tableColumn.d.ts +2 -0
- package/dist/components/table/src/tokens.d.ts +3 -0
- package/dist/components/table/src/tokens.js +4 -0
- package/dist/components/table/src/util.d.ts +55 -0
- package/dist/components/table/src/util.js +310 -0
- package/dist/components/table-column/index.d.ts +40 -3
- package/dist/components/table-column/index.js +6 -3
- package/dist/components/upload/index.d.ts +45 -2
- package/dist/components/upload/index.js +23 -4
- package/dist/components/upload/src/ajax.d.ts +9 -0
- package/dist/components/upload/src/ajax.js +58 -0
- package/dist/components/upload/src/constants.d.ts +5 -0
- package/dist/components/upload/src/constants.js +4 -0
- package/dist/components/upload/src/upload-content.d.ts +136 -0
- package/dist/components/upload/src/upload-content.js +53 -0
- package/dist/components/upload/src/upload-content.vue.d.ts +38 -0
- package/dist/components/upload/src/upload-content.vue.js +186 -0
- package/dist/components/upload/src/upload-content2.vue.js +4 -0
- package/dist/components/upload/src/upload-dragger.d.ts +22 -0
- package/dist/components/upload/src/upload-dragger.js +19 -0
- package/dist/components/upload/src/upload-dragger.vue.d.ts +19 -0
- package/dist/components/upload/src/upload-dragger.vue.js +91 -0
- package/dist/components/upload/src/upload-dragger2.vue.js +4 -0
- package/dist/components/upload/src/upload-list.d.ts +45 -0
- package/dist/components/upload/src/upload-list.js +39 -0
- package/dist/components/upload/src/upload-list.vue.d.ts +28 -0
- package/dist/components/upload/src/upload-list.vue.js +182 -0
- package/dist/components/upload/src/upload-list2.vue.js +4 -0
- package/dist/components/upload/src/upload.d.ts +361 -0
- package/dist/components/upload/src/upload.js +216 -0
- package/dist/components/upload/src/upload.vue.d.ts +64 -0
- package/dist/components/upload/src/upload.vue.js +150 -0
- package/dist/components/upload/src/upload2.vue.js +4 -0
- package/dist/components/upload/src/use-handlers.d.ts +60 -0
- package/dist/components/upload/src/use-handlers.js +111 -0
- package/dist/directives/mousewheel/index.js +28 -0
- package/dist/ep-craft.js +277 -236
- package/dist/index.d.ts +67 -0
- package/dist/utils/dom/event.js +12 -11
- package/dist/utils/objects.js +10 -9
- package/dist/utils/vue/install.js +21 -18
- package/dist/utils/vue/refs.js +8 -0
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +44 -4
- package/package.json +1 -1
- package/dist/components/dropdown-item/index.js +0 -6
- package/dist/components/dropdown-menu/index.js +0 -6
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NOOP as o } from "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import { buildProps as e, definePropType as t } from "../../../utils/vue/props/runtime.js";
|
|
6
|
+
import "vue";
|
|
7
|
+
import { uploadBaseProps as n, uploadBasePropsDefaults as r } from "./upload.js";
|
|
8
|
+
const c = e({
|
|
9
|
+
...n,
|
|
10
|
+
beforeUpload: {
|
|
11
|
+
type: t(Function),
|
|
12
|
+
default: o
|
|
13
|
+
},
|
|
14
|
+
onRemove: {
|
|
15
|
+
type: t(Function),
|
|
16
|
+
default: o
|
|
17
|
+
},
|
|
18
|
+
onStart: {
|
|
19
|
+
type: t(Function),
|
|
20
|
+
default: o
|
|
21
|
+
},
|
|
22
|
+
onSuccess: {
|
|
23
|
+
type: t(
|
|
24
|
+
Function
|
|
25
|
+
),
|
|
26
|
+
default: o
|
|
27
|
+
},
|
|
28
|
+
onProgress: {
|
|
29
|
+
type: t(Function),
|
|
30
|
+
default: o
|
|
31
|
+
},
|
|
32
|
+
onError: {
|
|
33
|
+
type: t(Function),
|
|
34
|
+
default: o
|
|
35
|
+
},
|
|
36
|
+
onExceed: {
|
|
37
|
+
type: t(Function),
|
|
38
|
+
default: o
|
|
39
|
+
}
|
|
40
|
+
}), f = {
|
|
41
|
+
...r,
|
|
42
|
+
beforeUpload: o,
|
|
43
|
+
onRemove: o,
|
|
44
|
+
onStart: o,
|
|
45
|
+
onSuccess: o,
|
|
46
|
+
onProgress: o,
|
|
47
|
+
onError: o,
|
|
48
|
+
onExceed: o
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
c as uploadContentProps,
|
|
52
|
+
f as uploadContentPropsDefaults
|
|
53
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { UploadContentProps } from './upload-content';
|
|
2
|
+
import type { UploadFile, UploadHooks, UploadRawFile } from './upload';
|
|
3
|
+
declare var __VLS_8: {}, __VLS_10: {};
|
|
4
|
+
type __VLS_Slots = {} & {
|
|
5
|
+
default?: (props: typeof __VLS_8) => any;
|
|
6
|
+
} & {
|
|
7
|
+
default?: (props: typeof __VLS_10) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<UploadContentProps, {
|
|
10
|
+
abort: (file?: UploadFile) => void;
|
|
11
|
+
upload: (rawFile: UploadRawFile) => Promise<void>;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<UploadContentProps> & Readonly<{}>, {
|
|
13
|
+
data: import("@element-plus/utils").Awaitable<import("./upload").UploadData> | ((rawFile: UploadRawFile) => import("@element-plus/utils").Awaitable<import("./upload").UploadData>);
|
|
14
|
+
name: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
onProgress: (evt: import("./upload").UploadProgressEvent, rawFile: UploadRawFile) => void;
|
|
17
|
+
onError: (err: import("./ajax.js").UploadAjaxError, rawFile: UploadRawFile) => void;
|
|
18
|
+
method: string;
|
|
19
|
+
beforeUpload: UploadHooks["beforeUpload"];
|
|
20
|
+
onRemove: (file: UploadFile | UploadRawFile) => void;
|
|
21
|
+
onSuccess: (response: any, rawFile: UploadRawFile) => unknown;
|
|
22
|
+
onExceed: UploadHooks["onExceed"];
|
|
23
|
+
action: string;
|
|
24
|
+
showFileList: boolean;
|
|
25
|
+
accept: string;
|
|
26
|
+
fileList: import("./upload").UploadUserFile[];
|
|
27
|
+
autoUpload: boolean;
|
|
28
|
+
listType: import("./upload").ListType;
|
|
29
|
+
httpRequest: import("./upload").UploadRequestHandler;
|
|
30
|
+
onStart: (rawFile: UploadRawFile) => void;
|
|
31
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { defineComponent as A, shallowRef as R, openBlock as P, createElementBlock as M, withKeys as N, withModifiers as S, unref as a, normalizeClass as U, createBlock as T, withCtx as z, renderSlot as q, createElementVNode as H, mergeDefaults as I } from "vue";
|
|
2
|
+
import { cloneDeep as x, isEqual as V } from "lodash-unified";
|
|
3
|
+
import { isPlainObject as F, isFunction as X } from "@vue/shared";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { entriesOf as G } from "../../../utils/objects.js";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import { useNamespace as J } from "../../../hooks/use-namespace/index.js";
|
|
8
|
+
import "../../../hooks/use-size/index.js";
|
|
9
|
+
import "@popperjs/core";
|
|
10
|
+
import "../../../hooks/use-z-index/index.js";
|
|
11
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
12
|
+
import "../../../hooks/use-aria/index.js";
|
|
13
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
14
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
15
|
+
import "../../form/index.js";
|
|
16
|
+
import Q from "./upload-dragger.vue.js";
|
|
17
|
+
import { genFileId as W } from "./upload.js";
|
|
18
|
+
import { uploadContentPropsDefaults as Y } from "./upload-content.js";
|
|
19
|
+
import { useFormDisabled as Z } from "../../form/src/hooks/use-form-common-props.js";
|
|
20
|
+
const _ = ["tabindex", "aria-disabled", "onKeydown"], ee = ["name", "disabled", "multiple", "accept", "webkitdirectory"], Ce = /* @__PURE__ */ A({
|
|
21
|
+
name: "ElUploadContent",
|
|
22
|
+
inheritAttrs: !1,
|
|
23
|
+
__name: "upload-content",
|
|
24
|
+
props: /* @__PURE__ */ I({
|
|
25
|
+
beforeUpload: { type: Function },
|
|
26
|
+
onRemove: { type: Function },
|
|
27
|
+
onStart: { type: Function },
|
|
28
|
+
onSuccess: { type: Function },
|
|
29
|
+
onProgress: { type: Function },
|
|
30
|
+
onError: { type: Function },
|
|
31
|
+
onExceed: { type: Function },
|
|
32
|
+
action: {},
|
|
33
|
+
headers: {},
|
|
34
|
+
method: {},
|
|
35
|
+
data: { type: [Promise, Function] },
|
|
36
|
+
multiple: { type: Boolean },
|
|
37
|
+
name: {},
|
|
38
|
+
drag: { type: Boolean },
|
|
39
|
+
withCredentials: { type: Boolean },
|
|
40
|
+
showFileList: { type: Boolean },
|
|
41
|
+
accept: {},
|
|
42
|
+
fileList: {},
|
|
43
|
+
autoUpload: { type: Boolean },
|
|
44
|
+
listType: {},
|
|
45
|
+
httpRequest: { type: Function },
|
|
46
|
+
disabled: { type: Boolean },
|
|
47
|
+
limit: {},
|
|
48
|
+
directory: { type: Boolean }
|
|
49
|
+
}, Y),
|
|
50
|
+
setup(r, { expose: D }) {
|
|
51
|
+
const n = r, l = J("upload"), s = Z(), c = R(
|
|
52
|
+
{}
|
|
53
|
+
), f = R(), k = (e) => {
|
|
54
|
+
if (e.length === 0) return;
|
|
55
|
+
const { autoUpload: t, limit: o, fileList: i, multiple: d, onStart: u, onExceed: y } = n;
|
|
56
|
+
if (o && i.length + e.length > o) {
|
|
57
|
+
y(e, i);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
d || (e = e.slice(0, 1));
|
|
61
|
+
for (const h of e) {
|
|
62
|
+
const p = h;
|
|
63
|
+
p.uid = W(), u(p), t && C(p);
|
|
64
|
+
}
|
|
65
|
+
}, C = async (e) => {
|
|
66
|
+
if (f.value.value = "", !n.beforeUpload)
|
|
67
|
+
return B(e);
|
|
68
|
+
let t, o = {};
|
|
69
|
+
try {
|
|
70
|
+
const d = n.data, u = n.beforeUpload(e);
|
|
71
|
+
o = F(n.data) ? x(n.data) : n.data, t = await u, F(n.data) && V(d, o) && (o = x(n.data));
|
|
72
|
+
} catch {
|
|
73
|
+
t = !1;
|
|
74
|
+
}
|
|
75
|
+
if (t === !1) {
|
|
76
|
+
n.onRemove(e);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
let i = e;
|
|
80
|
+
t instanceof Blob && (t instanceof File ? i = t : i = new File([t], e.name, {
|
|
81
|
+
type: e.type
|
|
82
|
+
})), B(
|
|
83
|
+
Object.assign(i, {
|
|
84
|
+
uid: e.uid
|
|
85
|
+
}),
|
|
86
|
+
o
|
|
87
|
+
);
|
|
88
|
+
}, w = async (e, t) => X(e) ? e(t) : e, B = async (e, t) => {
|
|
89
|
+
const {
|
|
90
|
+
headers: o,
|
|
91
|
+
data: i,
|
|
92
|
+
method: d,
|
|
93
|
+
withCredentials: u,
|
|
94
|
+
name: y,
|
|
95
|
+
action: h,
|
|
96
|
+
onProgress: p,
|
|
97
|
+
onSuccess: O,
|
|
98
|
+
onError: $,
|
|
99
|
+
httpRequest: j
|
|
100
|
+
} = n;
|
|
101
|
+
try {
|
|
102
|
+
t = await w(t ?? i, e);
|
|
103
|
+
} catch {
|
|
104
|
+
n.onRemove(e);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const { uid: b } = e, v = {
|
|
108
|
+
headers: o || {},
|
|
109
|
+
withCredentials: u,
|
|
110
|
+
file: e,
|
|
111
|
+
data: t,
|
|
112
|
+
method: d,
|
|
113
|
+
filename: y,
|
|
114
|
+
action: h,
|
|
115
|
+
onProgress: (m) => {
|
|
116
|
+
p(m, e);
|
|
117
|
+
},
|
|
118
|
+
onSuccess: (m) => {
|
|
119
|
+
O(m, e), delete c.value[b];
|
|
120
|
+
},
|
|
121
|
+
onError: (m) => {
|
|
122
|
+
$(m, e), delete c.value[b];
|
|
123
|
+
}
|
|
124
|
+
}, g = j(v);
|
|
125
|
+
c.value[b] = g, g instanceof Promise && g.then(v.onSuccess, v.onError);
|
|
126
|
+
}, K = (e) => {
|
|
127
|
+
const t = e.target.files;
|
|
128
|
+
t && k(Array.from(t));
|
|
129
|
+
}, E = () => {
|
|
130
|
+
s.value || (f.value.value = "", f.value.click());
|
|
131
|
+
}, L = () => {
|
|
132
|
+
E();
|
|
133
|
+
};
|
|
134
|
+
return D({
|
|
135
|
+
abort: (e) => {
|
|
136
|
+
G(c.value).filter(
|
|
137
|
+
e ? ([o]) => String(e.uid) === o : () => !0
|
|
138
|
+
).forEach(([o, i]) => {
|
|
139
|
+
i instanceof XMLHttpRequest && i.abort(), delete c.value[o];
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
upload: C
|
|
143
|
+
}), (e, t) => (P(), M("div", {
|
|
144
|
+
class: U([
|
|
145
|
+
a(l).b(),
|
|
146
|
+
a(l).m(r.listType),
|
|
147
|
+
a(l).is("drag", r.drag),
|
|
148
|
+
a(l).is("disabled", a(s))
|
|
149
|
+
]),
|
|
150
|
+
tabindex: a(s) ? void 0 : 0,
|
|
151
|
+
"aria-disabled": a(s),
|
|
152
|
+
role: "button",
|
|
153
|
+
onClick: E,
|
|
154
|
+
onKeydown: N(S(L, ["self"]), ["enter", "space"])
|
|
155
|
+
}, [
|
|
156
|
+
r.drag ? (P(), T(Q, {
|
|
157
|
+
key: 0,
|
|
158
|
+
disabled: a(s),
|
|
159
|
+
directory: r.directory,
|
|
160
|
+
onFile: k
|
|
161
|
+
}, {
|
|
162
|
+
default: z(() => [
|
|
163
|
+
q(e.$slots, "default")
|
|
164
|
+
]),
|
|
165
|
+
_: 3
|
|
166
|
+
}, 8, ["disabled", "directory"])) : q(e.$slots, "default", {}, void 0, void 0, 1),
|
|
167
|
+
H("input", {
|
|
168
|
+
ref_key: "inputRef",
|
|
169
|
+
ref: f,
|
|
170
|
+
class: U(a(l).e("input")),
|
|
171
|
+
name: r.name,
|
|
172
|
+
disabled: a(s),
|
|
173
|
+
multiple: r.multiple,
|
|
174
|
+
accept: r.accept,
|
|
175
|
+
webkitdirectory: r.directory || void 0,
|
|
176
|
+
type: "file",
|
|
177
|
+
onChange: K,
|
|
178
|
+
onClick: t[0] || (t[0] = S(() => {
|
|
179
|
+
}, ["stop"]))
|
|
180
|
+
}, null, 42, ee)
|
|
181
|
+
], 42, _));
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
export {
|
|
185
|
+
Ce as default
|
|
186
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type UploadDragger from './upload-dragger.vue';
|
|
3
|
+
export interface UploadDraggerProps {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
directory?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Removed after 3.0.0, Use `UploadDraggerProps` instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare const uploadDraggerProps: {
|
|
11
|
+
readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
12
|
+
readonly directory: BooleanConstructor;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Removed after 3.0.0, Use `UploadDraggerProps` instead.
|
|
16
|
+
*/
|
|
17
|
+
export type UploadDraggerPropsPublic = ExtractPublicPropTypes<typeof uploadDraggerProps>;
|
|
18
|
+
export declare const uploadDraggerEmits: {
|
|
19
|
+
file: (file: File[]) => boolean;
|
|
20
|
+
};
|
|
21
|
+
export type UploadDraggerEmits = typeof uploadDraggerEmits;
|
|
22
|
+
export type UploadDraggerInstance = InstanceType<typeof UploadDragger> & unknown;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isArray as r } from "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import { buildProps as i } from "../../../utils/vue/props/runtime.js";
|
|
6
|
+
import "vue";
|
|
7
|
+
const l = i({
|
|
8
|
+
disabled: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: void 0
|
|
11
|
+
},
|
|
12
|
+
directory: Boolean
|
|
13
|
+
}), s = {
|
|
14
|
+
file: (o) => r(o)
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
s as uploadDraggerEmits,
|
|
18
|
+
l as uploadDraggerProps
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { UploadDraggerProps } from './upload-dragger';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<UploadDraggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
file: (file: File[]) => void;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<UploadDraggerProps> & Readonly<{
|
|
9
|
+
onFile?: ((file: File[]) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent as C, inject as _, ref as F, openBlock as T, createElementBlock as k, withModifiers as c, normalizeClass as x, unref as u, renderSlot as B } from "vue";
|
|
2
|
+
import { useNamespace as N } from "../../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import { flatten as g } from "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import { throwError as M } from "../../../utils/error.js";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import "../../../hooks/use-size/index.js";
|
|
9
|
+
import "@popperjs/core";
|
|
10
|
+
import "../../../hooks/use-z-index/index.js";
|
|
11
|
+
import "../../../hooks/use-delayed-toggle/index.js";
|
|
12
|
+
import "../../../hooks/use-aria/index.js";
|
|
13
|
+
import "../../../hooks/use-model-toggle/index.js";
|
|
14
|
+
import "../../../hooks/use-empty-values/index.js";
|
|
15
|
+
import "../../form/index.js";
|
|
16
|
+
import { uploadContextKey as G } from "./constants.js";
|
|
17
|
+
import { uploadDraggerEmits as O } from "./upload-dragger.js";
|
|
18
|
+
import { useFormDisabled as R } from "../../form/src/hooks/use-form-common-props.js";
|
|
19
|
+
const v = "ElUploadDrag", tr = /* @__PURE__ */ C({
|
|
20
|
+
name: v,
|
|
21
|
+
__name: "upload-dragger",
|
|
22
|
+
props: {
|
|
23
|
+
disabled: { type: Boolean, default: void 0 },
|
|
24
|
+
directory: { type: Boolean }
|
|
25
|
+
},
|
|
26
|
+
emits: O,
|
|
27
|
+
setup(y, { emit: D }) {
|
|
28
|
+
const w = y, p = D;
|
|
29
|
+
_(G) || M(
|
|
30
|
+
v,
|
|
31
|
+
"usage: <el-upload><el-upload-dragger /></el-upload>"
|
|
32
|
+
);
|
|
33
|
+
const f = N("upload"), l = F(!1), d = R(), E = (r) => new Promise((t, o) => r.file(t, o)), m = async (r) => {
|
|
34
|
+
try {
|
|
35
|
+
if (r.isFile) {
|
|
36
|
+
const t = await E(
|
|
37
|
+
r
|
|
38
|
+
);
|
|
39
|
+
return t.isDirectory = !1, [t];
|
|
40
|
+
}
|
|
41
|
+
if (r.isDirectory) {
|
|
42
|
+
const t = r.createReader(), o = () => new Promise(
|
|
43
|
+
(n, A) => t.readEntries(n, A)
|
|
44
|
+
), i = [];
|
|
45
|
+
let a = await o();
|
|
46
|
+
for (; a.length > 0; )
|
|
47
|
+
i.push(...a), a = await o();
|
|
48
|
+
const e = i.map(
|
|
49
|
+
(n) => m(n).catch(() => [])
|
|
50
|
+
), s = await Promise.all(e);
|
|
51
|
+
return g(s);
|
|
52
|
+
}
|
|
53
|
+
} catch {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
return [];
|
|
57
|
+
}, h = async (r) => {
|
|
58
|
+
if (d.value) return;
|
|
59
|
+
l.value = !1, r.stopPropagation();
|
|
60
|
+
const t = Array.from(r.dataTransfer.files), o = r.dataTransfer.items || [];
|
|
61
|
+
if (w.directory) {
|
|
62
|
+
const i = Array.from(o).map((e) => {
|
|
63
|
+
var s;
|
|
64
|
+
return (s = e == null ? void 0 : e.webkitGetAsEntry) == null ? void 0 : s.call(e);
|
|
65
|
+
}).filter((e) => e), a = await Promise.all(i.map(m));
|
|
66
|
+
p("file", g(a));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
t.forEach((i, a) => {
|
|
70
|
+
var n;
|
|
71
|
+
const e = o[a], s = (n = e == null ? void 0 : e.webkitGetAsEntry) == null ? void 0 : n.call(e);
|
|
72
|
+
s && (i.isDirectory = s.isDirectory);
|
|
73
|
+
}), p("file", t);
|
|
74
|
+
}, P = () => {
|
|
75
|
+
d.value || (l.value = !0);
|
|
76
|
+
}, b = (r) => {
|
|
77
|
+
r.currentTarget.contains(r.relatedTarget) || (l.value = !1);
|
|
78
|
+
};
|
|
79
|
+
return (r, t) => (T(), k("div", {
|
|
80
|
+
class: x([u(f).b("dragger"), u(f).is("dragover", l.value)]),
|
|
81
|
+
onDrop: c(h, ["prevent"]),
|
|
82
|
+
onDragover: c(P, ["prevent"]),
|
|
83
|
+
onDragleave: c(b, ["prevent"])
|
|
84
|
+
}, [
|
|
85
|
+
B(r.$slots, "default")
|
|
86
|
+
], 34));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
tr as default
|
|
91
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type { Crossorigin, ListType, UploadFile, UploadFiles, UploadHooks } from './upload';
|
|
3
|
+
import type UploadList from './upload-list.vue';
|
|
4
|
+
export interface UploadListProps {
|
|
5
|
+
files?: UploadFiles;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
handlePreview?: UploadHooks['onPreview'];
|
|
8
|
+
listType?: ListType;
|
|
9
|
+
/**
|
|
10
|
+
* @description set HTML attribute: crossorigin.
|
|
11
|
+
*/
|
|
12
|
+
crossorigin?: Crossorigin;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Removed after 3.0.0, Use `UploadListProps` instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare const uploadListProps: {
|
|
18
|
+
readonly files: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => UploadFiles) | (() => UploadFiles) | (((new (...args: any[]) => UploadFiles) | (() => UploadFiles)) | null)[], unknown, unknown, () => never[], boolean>;
|
|
19
|
+
readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
20
|
+
readonly handlePreview: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => (uploadFile: UploadFile) => void) | (() => (uploadFile: UploadFile) => void) | {
|
|
21
|
+
(): (uploadFile: UploadFile) => void;
|
|
22
|
+
new (): any;
|
|
23
|
+
readonly prototype: any;
|
|
24
|
+
} | (((new (...args: any[]) => (uploadFile: UploadFile) => void) | (() => (uploadFile: UploadFile) => void) | {
|
|
25
|
+
(): (uploadFile: UploadFile) => void;
|
|
26
|
+
new (): any;
|
|
27
|
+
readonly prototype: any;
|
|
28
|
+
}) | null)[], unknown, unknown, () => void, boolean>;
|
|
29
|
+
readonly listType: import("@element-plus/utils").EpPropFinalized<StringConstructor, "text" | "picture" | "picture-card", unknown, "text", boolean>;
|
|
30
|
+
readonly crossorigin: {
|
|
31
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => "" | "anonymous" | "use-credentials") | (() => "" | "anonymous" | "use-credentials") | (((new (...args: any[]) => "" | "anonymous" | "use-credentials") | (() => "" | "anonymous" | "use-credentials")) | null)[], unknown, unknown>>;
|
|
32
|
+
readonly required: false;
|
|
33
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
34
|
+
__epPropKey: true;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Removed after 3.0.0, Use `UploadListProps` instead.
|
|
39
|
+
*/
|
|
40
|
+
export type UploadListPropsPublic = ExtractPublicPropTypes<typeof uploadListProps>;
|
|
41
|
+
export declare const uploadListEmits: {
|
|
42
|
+
remove: (file: UploadFile) => boolean;
|
|
43
|
+
};
|
|
44
|
+
export type UploadListEmits = typeof uploadListEmits;
|
|
45
|
+
export type UploadListInstance = InstanceType<typeof UploadList> & unknown;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NOOP as e } from "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import { mutable as i } from "../../../utils/typescript.js";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import { buildProps as r, definePropType as t } from "../../../utils/vue/props/runtime.js";
|
|
7
|
+
import "vue";
|
|
8
|
+
import { uploadListTypes as p } from "./upload.js";
|
|
9
|
+
const y = r({
|
|
10
|
+
files: {
|
|
11
|
+
type: t(Array),
|
|
12
|
+
default: () => i([])
|
|
13
|
+
},
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
handlePreview: {
|
|
19
|
+
type: t(Function),
|
|
20
|
+
default: e
|
|
21
|
+
},
|
|
22
|
+
listType: {
|
|
23
|
+
type: String,
|
|
24
|
+
values: p,
|
|
25
|
+
default: "text"
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* @description set HTML attribute: crossorigin.
|
|
29
|
+
*/
|
|
30
|
+
crossorigin: {
|
|
31
|
+
type: t(String)
|
|
32
|
+
}
|
|
33
|
+
}), P = {
|
|
34
|
+
remove: (o) => !!o
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
P as uploadListEmits,
|
|
38
|
+
y as uploadListProps
|
|
39
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { UploadListProps } from './upload-list';
|
|
2
|
+
import type { UploadFile } from './upload';
|
|
3
|
+
declare var __VLS_6: {
|
|
4
|
+
file: UploadFile;
|
|
5
|
+
index: number;
|
|
6
|
+
}, __VLS_65: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_6) => any;
|
|
9
|
+
} & {
|
|
10
|
+
append?: (props: typeof __VLS_65) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<UploadListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
remove: (file: UploadFile) => void;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<UploadListProps> & Readonly<{
|
|
15
|
+
onRemove?: ((file: UploadFile) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
listType: import("./upload").ListType;
|
|
19
|
+
files: import("./upload").UploadFiles;
|
|
20
|
+
handlePreview: import("./upload").UploadHooks["onPreview"];
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|