x-next 1.5.0 → 1.7.0
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/AI_USAGE.md +57 -4
- package/CHANGELOG.md +72 -0
- package/dist/_utils/color.d.ts +53 -0
- package/dist/components/color-picker/ColorPicker.d.ts +239 -0
- package/dist/components/color-picker/gradient-slider.d.ts +52 -0
- package/dist/components/color-picker/index.d.ts +238 -0
- package/dist/components/color-picker/panel.d.ts +721 -0
- package/dist/components/color-picker/sv-panel.d.ts +48 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/draggable/Draggable.d.ts +1 -1
- package/dist/components/draggable/index.d.ts +2 -2
- package/dist/components/drawer/index.d.ts +6 -6
- package/dist/components/drawer/src/Drawer.vue.d.ts +3 -3
- package/dist/components/dropdown/Dropdown.vue.d.ts +34 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +35 -5
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +34 -4
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +30 -0
- package/dist/components/dropdown/index.d.ts +209 -29
- package/dist/components/form/FormItem.vue.d.ts +12 -12
- package/dist/components/form/form-item-label.vue.d.ts +3 -3
- package/dist/components/form/index.d.ts +24 -24
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/SelectDropdown.vue.d.ts +30 -0
- package/dist/components/form-select/index.d.ts +66 -6
- package/dist/components/form-slider/Slider.vue.d.ts +3 -3
- package/dist/components/form-slider/index.d.ts +6 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
- package/dist/components/grid/Row.vue.d.ts +3 -3
- package/dist/components/grid/index.d.ts +9 -9
- package/dist/components/heatmap/Heatmap.d.ts +311 -0
- package/dist/components/heatmap/helpers/matrix.d.ts +58 -0
- package/dist/components/heatmap/index.d.ts +372 -0
- package/dist/components/heatmap/interface.d.ts +57 -0
- package/dist/components/image/Image.vue.d.ts +125 -17
- package/dist/components/image/ImagePreview.vue.d.ts +97 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +100 -7
- package/dist/components/image/hooks/use-image-drag.d.ts +2 -2
- package/dist/components/image/index.d.ts +712 -124
- package/dist/components/image/interface.d.ts +9 -1
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/index.d.ts +3 -0
- package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
- package/dist/components/network/Network.vue.d.ts +1 -1
- package/dist/components/network/index.d.ts +3 -3
- package/dist/components/network/utils.d.ts +2 -0
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +9 -0
- package/dist/components/pagination/page-jumper.vue.d.ts +6 -0
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popconfirm/src/popup.vue.d.ts +3 -3
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/skeleton/SkeletonShape.vue.d.ts +3 -3
- package/dist/components/skeleton/index.d.ts +6 -6
- package/dist/components/space/Space.d.ts +1 -1
- package/dist/components/space/index.d.ts +3 -3
- package/dist/components/spin/Spin.d.ts +38 -0
- package/dist/components/spin/index.d.ts +30 -0
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
- package/dist/components/time-picker/index.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/components/upload/Upload.d.ts +372 -0
- package/dist/components/upload/context.d.ts +28 -0
- package/dist/components/upload/index.d.ts +656 -0
- package/dist/components/upload/interface.d.ts +110 -0
- package/dist/components/upload/props.d.ts +321 -0
- package/dist/components/upload/upload-list-item.d.ts +15 -0
- package/dist/components/upload/upload-list.d.ts +11 -0
- package/dist/components/upload/upload-picture-item.d.ts +20 -0
- package/dist/components/upload/upload-trigger.d.ts +8 -0
- package/dist/components/upload/utils.d.ts +48 -0
- package/dist/components/watermark/Watermark.d.ts +1 -1
- package/dist/components/watermark/index.d.ts +3 -3
- package/dist/es/_styles/palette-aliases.js +10 -4
- package/dist/es/_utils/color.js +73 -0
- package/dist/es/components/button/Button.js +2 -2
- package/dist/es/components/color-picker/ColorPicker.js +239 -0
- package/dist/es/components/color-picker/gradient-slider.js +79 -0
- package/dist/es/components/color-picker/index.js +8 -0
- package/dist/es/components/color-picker/panel.js +307 -0
- package/dist/es/components/color-picker/sv-panel.js +99 -0
- package/dist/es/components/dropdown/dropdown-panel.vue.js +17 -17
- package/dist/es/components/form-input/Input.js +7 -7
- package/dist/es/components/form-input/InputPassword.vue2.js +2 -2
- package/dist/es/components/form-input/InputSearch.js +2 -2
- package/dist/es/components/form-input-number/InputNumber.js +12 -12
- package/dist/es/components/heatmap/Heatmap.js +334 -0
- package/dist/es/components/heatmap/helpers/matrix.js +106 -0
- package/dist/es/components/heatmap/index.js +8 -0
- package/dist/es/components/image/Image.vue.js +55 -45
- package/dist/es/components/image/Image.vue2.js +113 -92
- package/dist/es/components/image/ImagePreview.vue.js +66 -53
- package/dist/es/components/image/ImagePreview.vue2.js +219 -171
- package/dist/es/components/image/ImagePreviewAction.js +12 -15
- package/dist/es/components/image/ImagePreviewGroup.vue.js +21 -20
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +45 -39
- package/dist/es/components/image/hooks/use-image-drag.js +16 -14
- package/dist/es/components/index.js +123 -117
- package/dist/es/components/menu/sub-menu-pop.vue2.js +12 -12
- package/dist/es/components/network/Network.vue2.js +72 -72
- package/dist/es/components/network/utils.js +44 -35
- package/dist/es/components/pagination/Pagination.js +113 -104
- package/dist/es/components/pagination/page-item-ellipsis.vue.js +13 -12
- package/dist/es/components/pagination/page-item-ellipsis.vue2.js +19 -15
- package/dist/es/components/pagination/page-jumper.vue.js +13 -12
- package/dist/es/components/pagination/page-jumper.vue2.js +7 -4
- package/dist/es/components/pagination/page-options.vue.js +4 -3
- package/dist/es/components/pagination/page-options.vue2.js +17 -15
- package/dist/es/components/skeleton/Skeleton.vue.js +11 -9
- package/dist/es/components/skeleton/SkeletonLine.vue.js +9 -8
- package/dist/es/components/skeleton/SkeletonShape.vue.js +8 -7
- package/dist/es/components/spin/Spin.js +124 -60
- package/dist/es/components/table/Table.js +3 -1
- package/dist/es/components/trigger/Trigger.js +19 -19
- package/dist/es/components/upload/Upload.js +420 -0
- package/dist/es/components/upload/context.js +4 -0
- package/dist/es/components/upload/index.js +8 -0
- package/dist/es/components/upload/props.js +321 -0
- package/dist/es/components/upload/upload-list-item.js +138 -0
- package/dist/es/components/upload/upload-list.js +48 -0
- package/dist/es/components/upload/upload-picture-item.js +109 -0
- package/dist/es/components/upload/upload-trigger.js +89 -0
- package/dist/es/components/upload/utils.js +195 -0
- package/dist/es/icons/_self/empty-better.js +25 -8
- package/dist/es/icons/_self/upload-icons.js +103 -0
- package/dist/es/index.js +168 -162
- package/dist/es/locale/en-US.js +39 -1
- package/dist/es/locale/zh-CN.js +39 -1
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/upload-icons.d.ts +523 -0
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +60 -0
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/color-picker.css +1 -0
- package/dist/style/color-picker.js +2 -0
- package/dist/style/date-picker.css +1 -1
- package/dist/style/empty.css +1 -1
- package/dist/style/form-checkbox.css +1 -1
- package/dist/style/form-input-tag.css +1 -1
- package/dist/style/form-input.css +1 -1
- package/dist/style/form-radio.css +1 -1
- package/dist/style/form-textarea.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/heatmap.css +1 -0
- package/dist/style/heatmap.js +2 -0
- package/dist/style/image.css +1 -1
- package/dist/style/menu.css +1 -1
- package/dist/style/pagination.css +1 -1
- package/dist/style/skeleton.css +1 -1
- package/dist/style/spin.css +1 -1
- package/dist/style/steps.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style/upload.css +1 -0
- package/dist/style/upload.js +2 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
- package/volar.d.ts +3 -0
- package/dist/es/_hooks/use-popup-overflow-hidden.js +0 -29
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineComponent as I, inject as L, computed as n, watch as P, createVNode as l, mergeProps as v } from "vue";
|
|
2
|
+
import { getClassNameMixin as E } from "../../_utils/config.js";
|
|
3
|
+
import { useLocale as K } from "../../locale/index.js";
|
|
4
|
+
import { IconUploadCloud as N } from "../../icons/_self/upload-icons.js";
|
|
5
|
+
import { uploadInjectionKey as U } from "./context.js";
|
|
6
|
+
import { useFormItem as j, useFormItemControl as A } from "../../_hooks/use-form-item.js";
|
|
7
|
+
const S = /* @__PURE__ */ I({
|
|
8
|
+
name: "UploadTrigger",
|
|
9
|
+
setup() {
|
|
10
|
+
const e = L(U);
|
|
11
|
+
if (!e) return () => null;
|
|
12
|
+
const {
|
|
13
|
+
t: o
|
|
14
|
+
} = K(), r = E("upload"), {
|
|
15
|
+
formItemCtx: m,
|
|
16
|
+
eventHandlers: b
|
|
17
|
+
} = j(), d = A(m, () => ({
|
|
18
|
+
...e.getTriggerAttrs(),
|
|
19
|
+
...e.props.ariaLabel ? {
|
|
20
|
+
"aria-label": e.props.ariaLabel
|
|
21
|
+
} : {}
|
|
22
|
+
}), {
|
|
23
|
+
labelable: !1
|
|
24
|
+
}), t = n(() => e.props.draggable), c = n(() => e.listType.value === "picture-card"), y = n(() => e.props.ariaLabel || o("upload.trigger")), D = n(() => [r.element("trigger"), t.value && r.element("dragger"), t.value && e.dragging.value && r.is("dragging"), e.listType.value === "picture-card" && r.element("picture-trigger"), e.disabled.value && r.is("disabled")]), T = n(() => e.dragging.value ? o("upload.dragHover") : t.value ? o("upload.drag") : o("upload.buttonText"));
|
|
25
|
+
P(e.disabled, (a) => {
|
|
26
|
+
a && (e.dragging.value = !1);
|
|
27
|
+
});
|
|
28
|
+
const g = () => {
|
|
29
|
+
e.disabled.value || e.openFileDialog();
|
|
30
|
+
}, C = (a) => {
|
|
31
|
+
a.key !== "Enter" && a.key !== " " || (a.preventDefault(), g());
|
|
32
|
+
}, h = (a) => {
|
|
33
|
+
t.value && (a.preventDefault(), !e.disabled.value && (e.dragging.value = !0));
|
|
34
|
+
}, x = (a) => {
|
|
35
|
+
t.value && (a.preventDefault(), a.dataTransfer && (a.dataTransfer.dropEffect = e.disabled.value ? "none" : "copy"), !e.disabled.value && (e.dragging.value = !0));
|
|
36
|
+
}, k = (a) => {
|
|
37
|
+
if (e.disabled.value || !t.value) return;
|
|
38
|
+
const i = a.currentTarget, s = a.relatedTarget;
|
|
39
|
+
s && i.contains(s) || (e.dragging.value = !1);
|
|
40
|
+
}, F = (a) => {
|
|
41
|
+
t.value && (a.preventDefault(), e.dragging.value = !1, !e.disabled.value && e.onDropFiles(a));
|
|
42
|
+
};
|
|
43
|
+
return () => {
|
|
44
|
+
const a = {
|
|
45
|
+
type: "file",
|
|
46
|
+
class: r.element("input"),
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
tabindex: -1
|
|
49
|
+
};
|
|
50
|
+
e.props.accept && (a.accept = e.props.accept), (e.props.multiple || e.props.directory) && (a.multiple = !0), a.disabled = e.disabled.value, e.props.directory && (a.directory = "", a.webkitdirectory = ""), e.props.capture !== void 0 && e.props.capture !== !1 && (a.capture = e.props.capture === !0 ? "" : e.props.capture);
|
|
51
|
+
const i = e.slots["upload-button"] ?? e.slots.default, s = i ? i() : [l("span", {
|
|
52
|
+
class: r.element("trigger-icon"),
|
|
53
|
+
key: "icon"
|
|
54
|
+
}, [l(N, {
|
|
55
|
+
size: t.value ? 40 : c.value ? 20 : 16
|
|
56
|
+
}, null)]), l("span", {
|
|
57
|
+
class: r.element("trigger-text"),
|
|
58
|
+
key: "text"
|
|
59
|
+
}, [T.value])], w = !!e.props.tip && !c.value;
|
|
60
|
+
return l("div", v(d.value, {
|
|
61
|
+
class: D.value,
|
|
62
|
+
role: "button",
|
|
63
|
+
tabindex: e.disabled.value ? void 0 : 0,
|
|
64
|
+
"aria-disabled": e.disabled.value || void 0,
|
|
65
|
+
"aria-label": d.value["aria-label"] || (d.value["aria-labelledby"] ? void 0 : y.value),
|
|
66
|
+
onClick: g,
|
|
67
|
+
onKeydown: C,
|
|
68
|
+
onDragenter: h,
|
|
69
|
+
onDragover: x,
|
|
70
|
+
onDragleave: k,
|
|
71
|
+
onDrop: F,
|
|
72
|
+
onFocusout: (u) => {
|
|
73
|
+
var p, f;
|
|
74
|
+
u.currentTarget.contains(u.relatedTarget) || (f = (p = b.value) == null ? void 0 : p.onBlur) == null || f.call(p);
|
|
75
|
+
}
|
|
76
|
+
}), [l("input", v({
|
|
77
|
+
ref: e.inputRef
|
|
78
|
+
}, a, {
|
|
79
|
+
onChange: e.onFileChange,
|
|
80
|
+
onClick: (u) => u.stopPropagation()
|
|
81
|
+
}), null), s, w && l("span", {
|
|
82
|
+
class: r.element("tip")
|
|
83
|
+
}, [e.props.tip])]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
S as default
|
|
89
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { isFunction as j } from "../../_utils/is.js";
|
|
2
|
+
const u = [
|
|
3
|
+
"avif",
|
|
4
|
+
"bmp",
|
|
5
|
+
"dpg",
|
|
6
|
+
"gif",
|
|
7
|
+
"heic",
|
|
8
|
+
"heif",
|
|
9
|
+
"ico",
|
|
10
|
+
"jfif",
|
|
11
|
+
"jpeg",
|
|
12
|
+
"jpg",
|
|
13
|
+
"png",
|
|
14
|
+
"svg",
|
|
15
|
+
"tif",
|
|
16
|
+
"tiff",
|
|
17
|
+
"webp"
|
|
18
|
+
], E = {
|
|
19
|
+
"audio/mp3": "audio/mpeg",
|
|
20
|
+
"image/jpg": "image/jpeg",
|
|
21
|
+
"text/xml": "application/xml"
|
|
22
|
+
}, R = {
|
|
23
|
+
jpeg: ["jpeg", "jpg"],
|
|
24
|
+
jpg: ["jpeg", "jpg"],
|
|
25
|
+
tif: ["tif", "tiff"],
|
|
26
|
+
tiff: ["tif", "tiff"]
|
|
27
|
+
};
|
|
28
|
+
let x = 0;
|
|
29
|
+
const L = () => `${Date.now().toString(36)}-${(x++).toString(36)}`, d = (t) => {
|
|
30
|
+
const e = (t ?? "").toLowerCase().split(";")[0].trim();
|
|
31
|
+
return E[e] ?? e;
|
|
32
|
+
}, a = (t) => {
|
|
33
|
+
const e = t.lastIndexOf(".");
|
|
34
|
+
return e >= 0 ? t.slice(e + 1).toLowerCase() : "";
|
|
35
|
+
}, p = (t, e) => (R[t] ?? [t]).includes(e), P = (t, e) => {
|
|
36
|
+
const r = (e ?? "").split(",").map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
37
|
+
if (!r.length) return !0;
|
|
38
|
+
const n = d(t.type), o = a(t.name);
|
|
39
|
+
return r.some((s) => {
|
|
40
|
+
if (s === "*" || s === "*/*") return !0;
|
|
41
|
+
if (s.startsWith("."))
|
|
42
|
+
return p(s.slice(1), o);
|
|
43
|
+
if (s.endsWith("/*"))
|
|
44
|
+
return n.startsWith(s.slice(0, -1));
|
|
45
|
+
const i = d(s);
|
|
46
|
+
if (n && i === n) return !0;
|
|
47
|
+
if (n) return !1;
|
|
48
|
+
const c = i.lastIndexOf("/");
|
|
49
|
+
return c >= 0 && p(i.slice(c + 1), o);
|
|
50
|
+
});
|
|
51
|
+
}, h = (t) => d(t).startsWith("image/"), S = (t) => h(t.type) || !t.type && u.includes(a(t.name)), $ = (t) => {
|
|
52
|
+
if (t.type) return h(t.type);
|
|
53
|
+
const e = t.url || t.thumbUrl || t.name;
|
|
54
|
+
return e.startsWith("data:image/") ? !0 : u.includes(a(e.split(/[?#]/)[0])) || u.includes(a(t.name));
|
|
55
|
+
}, m = /* @__PURE__ */ new WeakMap(), A = (t) => {
|
|
56
|
+
const e = m.get(t), r = t.uid || e || L();
|
|
57
|
+
!t.uid && !e && m.set(t, r);
|
|
58
|
+
const n = t.status ?? "done";
|
|
59
|
+
return {
|
|
60
|
+
...t,
|
|
61
|
+
uid: r,
|
|
62
|
+
status: n,
|
|
63
|
+
percent: t.percent ?? (n === "done" ? 1 : 0)
|
|
64
|
+
};
|
|
65
|
+
}, q = (t) => (t ?? []).map(A), g = /* @__PURE__ */ new Set(), C = (t) => {
|
|
66
|
+
if (!S(t) || typeof URL > "u" || typeof URL.createObjectURL != "function") return;
|
|
67
|
+
const e = URL.createObjectURL(t);
|
|
68
|
+
return g.add(e), e;
|
|
69
|
+
}, N = (t) => {
|
|
70
|
+
if (!(!t || !g.delete(t)))
|
|
71
|
+
try {
|
|
72
|
+
URL.revokeObjectURL(t);
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
}, U = (t) => {
|
|
76
|
+
const e = t.responseText ?? "";
|
|
77
|
+
if ((t.getResponseHeader("content-type") ?? "").includes("json"))
|
|
78
|
+
try {
|
|
79
|
+
return JSON.parse(e || "null");
|
|
80
|
+
} catch {
|
|
81
|
+
return e;
|
|
82
|
+
}
|
|
83
|
+
return t.response ?? e;
|
|
84
|
+
}, W = (t) => t === null || typeof t != "object" && typeof t != "function" ? !1 : typeof t.then == "function", T = (t) => {
|
|
85
|
+
if (t === null || typeof t != "object") return;
|
|
86
|
+
const e = t.abort;
|
|
87
|
+
return j(e) ? () => e.call(t) : void 0;
|
|
88
|
+
}, I = (t) => {
|
|
89
|
+
if (t === null || typeof t != "object") return !1;
|
|
90
|
+
const e = t;
|
|
91
|
+
return typeof e.ok == "boolean" && typeof e.status == "number" && typeof e.text == "function" && typeof e.json == "function";
|
|
92
|
+
}, z = async (t) => {
|
|
93
|
+
var r, n;
|
|
94
|
+
if (!I(t)) return t;
|
|
95
|
+
if (!t.ok) {
|
|
96
|
+
const o = new Error(`Request failed with status ${t.status}`);
|
|
97
|
+
throw o.status = t.status, o.response = t, o;
|
|
98
|
+
}
|
|
99
|
+
const e = ((n = (r = t.headers) == null ? void 0 : r.get) == null ? void 0 : n.call(r, "content-type")) ?? "";
|
|
100
|
+
if (e.includes("json")) {
|
|
101
|
+
const o = await t.text();
|
|
102
|
+
if (!o) return;
|
|
103
|
+
try {
|
|
104
|
+
return JSON.parse(o);
|
|
105
|
+
} catch {
|
|
106
|
+
return o;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return e.startsWith("text/") ? t.text() : t;
|
|
110
|
+
}, f = (t, e) => {
|
|
111
|
+
const r = new Error(e);
|
|
112
|
+
return r.status = t.status, r;
|
|
113
|
+
}, y = (t, e, r) => {
|
|
114
|
+
if (r != null) {
|
|
115
|
+
if (Array.isArray(r)) {
|
|
116
|
+
r.forEach((n) => y(t, `${e}[]`, n));
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (typeof Blob < "u" && r instanceof Blob) {
|
|
120
|
+
t.append(e, r);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
t.append(e, String(r));
|
|
124
|
+
}
|
|
125
|
+
}, B = (t) => {
|
|
126
|
+
const e = new XMLHttpRequest();
|
|
127
|
+
e.open(t.method.toUpperCase(), t.action || "", !0), t.withCredentials && (e.withCredentials = !0), t.timeout > 0 && (e.timeout = t.timeout), Object.entries(t.headers ?? {}).forEach(([n, o]) => {
|
|
128
|
+
o != null && e.setRequestHeader(n, String(o));
|
|
129
|
+
}), e.upload.onprogress = (n) => {
|
|
130
|
+
t.onProgress(n.total > 0 ? Math.min(1, n.loaded / n.total) : 0, n);
|
|
131
|
+
}, e.onload = () => {
|
|
132
|
+
if (e.status >= 200 && e.status < 300) {
|
|
133
|
+
t.onSuccess(U(e));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
t.onError(f(e, `Request failed with status ${e.status}`));
|
|
137
|
+
}, e.onerror = () => t.onError(f(e, "Network error")), e.ontimeout = () => t.onError(f(e, "Request timeout")), e.onabort = () => {
|
|
138
|
+
};
|
|
139
|
+
const r = new FormData();
|
|
140
|
+
return Object.entries(t.data ?? {}).forEach(([n, o]) => y(r, n, o)), r.append(t.name || "file", t.file, t.file.name), e.send(r), {
|
|
141
|
+
abort: () => e.abort()
|
|
142
|
+
};
|
|
143
|
+
}, O = (t) => new Promise((e, r) => {
|
|
144
|
+
t.readEntries(e, r);
|
|
145
|
+
}), F = async (t) => {
|
|
146
|
+
const e = [];
|
|
147
|
+
for (; ; ) {
|
|
148
|
+
const r = await O(t);
|
|
149
|
+
if (!r.length) break;
|
|
150
|
+
e.push(...r);
|
|
151
|
+
}
|
|
152
|
+
return e;
|
|
153
|
+
}, M = (t) => new Promise((e, r) => {
|
|
154
|
+
t.file(e, r);
|
|
155
|
+
}), H = async (t) => {
|
|
156
|
+
const r = (t.items ? Array.from(t.items) : []).map((s) => {
|
|
157
|
+
var i;
|
|
158
|
+
return (i = s.webkitGetAsEntry) == null ? void 0 : i.call(s);
|
|
159
|
+
}).filter((s) => !!s);
|
|
160
|
+
if (!r.length) return Array.from(t.files ?? []);
|
|
161
|
+
const n = [], o = async (s, i) => {
|
|
162
|
+
if (s.isFile) {
|
|
163
|
+
const c = await M(s);
|
|
164
|
+
i && Object.defineProperty(c, "webkitRelativePath", { value: i, configurable: !0 }), n.push(c);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (s.isDirectory) {
|
|
168
|
+
const c = s.createReader(), b = await F(c), w = i ? `${i}/` : "";
|
|
169
|
+
for (const l of b)
|
|
170
|
+
await o(l, `${w}${l.name}`);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
for (const s of r)
|
|
174
|
+
await o(s, s.name);
|
|
175
|
+
return n;
|
|
176
|
+
}, D = (t) => t ? Array.from(t.files ?? []) : [];
|
|
177
|
+
export {
|
|
178
|
+
H as collectDropFiles,
|
|
179
|
+
D as collectPasteFiles,
|
|
180
|
+
C as createThumbUrl,
|
|
181
|
+
L as genUid,
|
|
182
|
+
a as getExtension,
|
|
183
|
+
S as isImageFile,
|
|
184
|
+
$ as isImageItem,
|
|
185
|
+
h as isImageMime,
|
|
186
|
+
W as isPromiseLike,
|
|
187
|
+
P as matchAccept,
|
|
188
|
+
A as normalizeFile,
|
|
189
|
+
q as normalizeFileList,
|
|
190
|
+
d as normalizeMime,
|
|
191
|
+
z as normalizePromiseResponse,
|
|
192
|
+
T as resolveAbortHandle,
|
|
193
|
+
N as revokeThumbUrl,
|
|
194
|
+
B as uploadRequest
|
|
195
|
+
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { h as a, createVNode as l } from "vue";
|
|
2
|
-
import { generateIcon as
|
|
3
|
-
const
|
|
2
|
+
import { generateIcon as e } from "../icon.js";
|
|
3
|
+
const t = {
|
|
4
|
+
planes: "var(--x-empty-illustration-planes)",
|
|
5
|
+
mid: "var(--x-empty-illustration-mid)",
|
|
6
|
+
strong: "var(--x-empty-illustration-strong)",
|
|
7
|
+
highlight: "var(--x-empty-illustration-highlight)"
|
|
8
|
+
}, n = e("EmptyBetter", a(l("svg", {
|
|
4
9
|
width: "184",
|
|
5
10
|
height: "152",
|
|
6
11
|
viewBox: "0 0 184 152",
|
|
@@ -12,30 +17,42 @@ const n = t("EmptyBetter", a(l("svg", {
|
|
|
12
17
|
transform: "translate(24 31.67)"
|
|
13
18
|
}, [l("ellipse", {
|
|
14
19
|
"fill-opacity": ".8",
|
|
15
|
-
|
|
20
|
+
style: {
|
|
21
|
+
fill: t.planes
|
|
22
|
+
},
|
|
16
23
|
cx: "67.797",
|
|
17
24
|
cy: "106.89",
|
|
18
25
|
rx: "67.797",
|
|
19
26
|
ry: "12.668"
|
|
20
27
|
}, null), l("path", {
|
|
21
28
|
d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
|
|
22
|
-
|
|
29
|
+
style: {
|
|
30
|
+
fill: t.strong
|
|
31
|
+
}
|
|
23
32
|
}, null), l("path", {
|
|
24
33
|
d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
|
|
25
34
|
fill: "url(#linearGradient-1)",
|
|
26
35
|
transform: "translate(13.56)"
|
|
27
36
|
}, null), l("path", {
|
|
28
37
|
d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
|
|
29
|
-
|
|
38
|
+
style: {
|
|
39
|
+
fill: t.planes
|
|
40
|
+
}
|
|
30
41
|
}, null), l("path", {
|
|
31
42
|
d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
|
|
32
|
-
|
|
43
|
+
style: {
|
|
44
|
+
fill: t.mid
|
|
45
|
+
}
|
|
33
46
|
}, null)]), l("path", {
|
|
34
47
|
d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
|
|
35
|
-
|
|
48
|
+
style: {
|
|
49
|
+
fill: t.mid
|
|
50
|
+
}
|
|
36
51
|
}, null), l("g", {
|
|
37
52
|
transform: "translate(149.65 15.383)",
|
|
38
|
-
|
|
53
|
+
style: {
|
|
54
|
+
fill: t.highlight
|
|
55
|
+
}
|
|
39
56
|
}, [l("ellipse", {
|
|
40
57
|
cx: "20.654",
|
|
41
58
|
cy: "3.167",
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { h as t, createVNode as o } from "vue";
|
|
2
|
+
import { generateIcon as l } from "../icon.js";
|
|
3
|
+
const r = l("UploadCloud", t(o("svg", {
|
|
4
|
+
viewBox: "0 0 48 48",
|
|
5
|
+
fill: "none",
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
stroke: "currentColor",
|
|
8
|
+
"stroke-width": "4",
|
|
9
|
+
"stroke-linecap": "butt",
|
|
10
|
+
"stroke-linejoin": "miter"
|
|
11
|
+
}, [o("path", {
|
|
12
|
+
d: "M32 34h4a7 7 0 0 0 1.2-13.9A9 9 0 0 0 20.7 17 7 7 0 0 0 12 34h4"
|
|
13
|
+
}, null), o("path", {
|
|
14
|
+
d: "M24 40V22"
|
|
15
|
+
}, null), o("path", {
|
|
16
|
+
d: "m17 29 7-7 7 7"
|
|
17
|
+
}, null)]))), a = l("UploadFile", t(o("svg", {
|
|
18
|
+
viewBox: "0 0 48 48",
|
|
19
|
+
fill: "none",
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
21
|
+
stroke: "currentColor",
|
|
22
|
+
"stroke-width": "4",
|
|
23
|
+
"stroke-linecap": "butt",
|
|
24
|
+
"stroke-linejoin": "miter"
|
|
25
|
+
}, [o("path", {
|
|
26
|
+
d: "M28 6H16a4 4 0 0 0-4 4v28a4 4 0 0 0 4 4h16a4 4 0 0 0 4-4V14Z"
|
|
27
|
+
}, null), o("path", {
|
|
28
|
+
d: "M28 6v8h8"
|
|
29
|
+
}, null)]))), s = l("UploadImage", t(o("svg", {
|
|
30
|
+
viewBox: "0 0 48 48",
|
|
31
|
+
fill: "none",
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
"stroke-width": "4",
|
|
35
|
+
"stroke-linecap": "butt",
|
|
36
|
+
"stroke-linejoin": "miter"
|
|
37
|
+
}, [o("rect", {
|
|
38
|
+
x: "7",
|
|
39
|
+
y: "9",
|
|
40
|
+
width: "34",
|
|
41
|
+
height: "30",
|
|
42
|
+
rx: "4"
|
|
43
|
+
}, null), o("circle", {
|
|
44
|
+
cx: "17.5",
|
|
45
|
+
cy: "19.5",
|
|
46
|
+
r: "3.5"
|
|
47
|
+
}, null), o("path", {
|
|
48
|
+
d: "m12 35 9-9 6 6 4-4 6 6"
|
|
49
|
+
}, null)]))), i = l("UploadTrash", t(o("svg", {
|
|
50
|
+
viewBox: "0 0 48 48",
|
|
51
|
+
fill: "none",
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
53
|
+
stroke: "currentColor",
|
|
54
|
+
"stroke-width": "4",
|
|
55
|
+
"stroke-linecap": "butt",
|
|
56
|
+
"stroke-linejoin": "miter"
|
|
57
|
+
}, [o("path", {
|
|
58
|
+
d: "M9 14h30"
|
|
59
|
+
}, null), o("path", {
|
|
60
|
+
d: "M20 14V9a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v5"
|
|
61
|
+
}, null), o("path", {
|
|
62
|
+
d: "M13 14v24a4 4 0 0 0 4 4h14a4 4 0 0 0 4-4V14"
|
|
63
|
+
}, null), o("path", {
|
|
64
|
+
d: "M20 22v12M28 22v12"
|
|
65
|
+
}, null)]))), h = l("UploadRefresh", t(o("svg", {
|
|
66
|
+
viewBox: "0 0 48 48",
|
|
67
|
+
fill: "none",
|
|
68
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
69
|
+
stroke: "currentColor",
|
|
70
|
+
"stroke-width": "4",
|
|
71
|
+
"stroke-linecap": "butt",
|
|
72
|
+
"stroke-linejoin": "miter"
|
|
73
|
+
}, [o("path", {
|
|
74
|
+
d: "M41 10v10H31"
|
|
75
|
+
}, null), o("path", {
|
|
76
|
+
d: "M10.8 16A15 15 0 0 1 38.6 13.4L41 20"
|
|
77
|
+
}, null), o("path", {
|
|
78
|
+
d: "M7 38V28h10"
|
|
79
|
+
}, null), o("path", {
|
|
80
|
+
d: "M37.2 32A15 15 0 0 1 9.4 34.6L7 28"
|
|
81
|
+
}, null)]))), p = l("UploadDownload", t(o("svg", {
|
|
82
|
+
viewBox: "0 0 48 48",
|
|
83
|
+
fill: "none",
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
85
|
+
stroke: "currentColor",
|
|
86
|
+
"stroke-width": "4",
|
|
87
|
+
"stroke-linecap": "butt",
|
|
88
|
+
"stroke-linejoin": "miter"
|
|
89
|
+
}, [o("path", {
|
|
90
|
+
d: "M24 8v22"
|
|
91
|
+
}, null), o("path", {
|
|
92
|
+
d: "m15 23 9 9 9-9"
|
|
93
|
+
}, null), o("path", {
|
|
94
|
+
d: "M9 32v4a6 6 0 0 0 6 6h18a6 6 0 0 0 6-6v-4"
|
|
95
|
+
}, null)])));
|
|
96
|
+
export {
|
|
97
|
+
r as IconUploadCloud,
|
|
98
|
+
p as IconUploadDownload,
|
|
99
|
+
a as IconUploadFile,
|
|
100
|
+
s as IconUploadImage,
|
|
101
|
+
h as IconUploadRefresh,
|
|
102
|
+
i as IconUploadTrash
|
|
103
|
+
};
|