morya-ui 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/Button-dMqRmoYa.js +222 -0
- package/dist/{Card-Dsmnzong.js → Card-B1CB9Trm.js} +3 -5
- package/dist/Empty-C5tndBOm.js +147 -0
- package/dist/Icon-od9Ob-Ay.js +393 -0
- package/dist/Loading-BSsRs6v9.js +420 -0
- package/dist/Pagination-CqpC5EAs.js +166 -0
- package/dist/Select-CKGrSoaC.js +572 -0
- package/dist/Skeleton-DCYdXAH2.js +59 -0
- package/dist/accordion/style.css +20 -71
- package/dist/auto-complete/index.js +118 -120
- package/dist/auto-complete/style.css +24 -88
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/style.css +10 -67
- package/dist/badge/style.css +10 -68
- package/dist/block-ui/style.css +10 -68
- package/dist/breadcrumb/style.css +10 -61
- package/dist/button/index.js +1 -1
- package/dist/button/style.css +72 -78
- package/dist/card/index.js +1 -1
- package/dist/card/style.css +30 -67
- package/dist/carousel/index.js +72 -64
- package/dist/carousel/style.css +36 -82
- package/dist/cascade-select/index.js +1 -1
- package/dist/cascade-select/style.css +24 -81
- package/dist/checkbox/style.css +10 -61
- package/dist/chip/index.js +1 -1
- package/dist/chip/style.css +10 -67
- package/dist/command-menu/index.js +37 -39
- package/dist/command-menu/style.css +10 -75
- package/dist/components/Accordion/styles.css +10 -10
- package/dist/components/AutoComplete/AutoComplete.vue.d.ts.map +1 -1
- package/dist/components/AutoComplete/styles.css +0 -7
- package/dist/components/Badge/styles.css +0 -7
- package/dist/components/BlockUI/styles.css +0 -7
- package/dist/components/Button/Button.vue.d.ts +2 -0
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/styles.css +62 -11
- package/dist/components/Button/types.d.ts +4 -0
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/Card.vue.d.ts +2 -2
- package/dist/components/Card/Card.vue.d.ts.map +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/styles.css +20 -6
- package/dist/components/Card/types.d.ts +4 -2
- package/dist/components/Card/types.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.vue.d.ts.map +1 -1
- package/dist/components/Carousel/styles.css +26 -15
- package/dist/components/CommandMenu/CommandMenu.vue.d.ts.map +1 -1
- package/dist/components/ConfigProvider/ConfigProvider.vue.d.ts +2 -2
- package/dist/components/DataView/DataView.vue.d.ts +7 -7
- package/dist/components/DataView/DataView.vue.d.ts.map +1 -1
- package/dist/components/DataView/styles.css +0 -20
- package/dist/components/Dialog/styles.css +3 -46
- package/dist/components/Dock/styles.css +0 -10
- package/dist/components/Drawer/styles.css +2 -51
- package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/DropdownNodes.vue.d.ts +8 -9
- package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/styles.css +24 -5
- package/dist/components/Fieldset/styles.css +0 -7
- package/dist/components/FileUpload/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/FileUpload/fileUtils.d.ts +8 -0
- package/dist/components/FileUpload/fileUtils.d.ts.map +1 -0
- package/dist/components/Gallery/styles.css +0 -8
- package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
- package/dist/components/Icon/icon-categories.d.ts.map +1 -1
- package/dist/components/Icon/icons-types.d.ts +4 -2
- package/dist/components/Icon/icons-types.d.ts.map +1 -1
- package/dist/components/Icon/icons.d.ts +250 -561
- package/dist/components/Icon/icons.d.ts.map +1 -1
- package/dist/components/Icon/index.d.ts +2 -2
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/styles.css +0 -6
- package/dist/components/Knob/styles.css +0 -6
- package/dist/components/Layout/styles.css +5 -14
- package/dist/components/Listbox/Listbox.vue.d.ts.map +1 -1
- package/dist/components/Loading/styles.css +0 -16
- package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
- package/dist/components/Menu/styles.css +6 -7
- package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
- package/dist/components/Menubar/styles.css +4 -0
- package/dist/components/Message/styles.css +0 -13
- package/dist/components/Page/PageContent.vue.d.ts +2 -1
- package/dist/components/Page/PageContent.vue.d.ts.map +1 -1
- package/dist/components/Page/PageFilterChips.vue.d.ts +16 -0
- package/dist/components/Page/PageFilterChips.vue.d.ts.map +1 -0
- package/dist/components/Page/PageFilters.vue.d.ts +15 -3
- package/dist/components/Page/PageFilters.vue.d.ts.map +1 -1
- package/dist/components/Page/PageHeader.vue.d.ts +8 -4
- package/dist/components/Page/PageHeader.vue.d.ts.map +1 -1
- package/dist/components/Page/PagePlaceholder.vue.d.ts +6 -2
- package/dist/components/Page/PagePlaceholder.vue.d.ts.map +1 -1
- package/dist/components/Page/PageSection.vue.d.ts +8 -2
- package/dist/components/Page/PageSection.vue.d.ts.map +1 -1
- package/dist/components/Page/PageStat.vue.d.ts +8 -3
- package/dist/components/Page/PageStat.vue.d.ts.map +1 -1
- package/dist/components/Page/index.d.ts +2 -1
- package/dist/components/Page/index.d.ts.map +1 -1
- package/dist/components/Page/styles.css +239 -44
- package/dist/components/Page/types.d.ts +40 -0
- package/dist/components/Page/types.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
- package/dist/components/Pagination/styles.css +7 -10
- package/dist/components/Pagination/types.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts.map +1 -1
- package/dist/components/Panel/styles.css +0 -7
- package/dist/components/Popover/styles.css +20 -17
- package/dist/components/ProgressBar/styles.css +0 -9
- package/dist/components/ProgressSpinner/styles.css +0 -7
- package/dist/components/ScrollTop/styles.css +0 -7
- package/dist/components/Scrollbar/Scrollbar.vue.d.ts +1 -1
- package/dist/components/Scrollbar/styles.css +0 -8
- package/dist/components/Select/Select.vue.d.ts +10 -8
- package/dist/components/Select/Select.vue.d.ts.map +1 -1
- package/dist/components/Select/selectOptions.d.ts +46 -0
- package/dist/components/Select/selectOptions.d.ts.map +1 -0
- package/dist/components/Select/styles.css +35 -8
- package/dist/components/Select/types.d.ts +11 -1
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Sidebar/styles.css +0 -6
- package/dist/components/Skeleton/styles.css +0 -6
- package/dist/components/Slider/styles.css +9 -0
- package/dist/components/SplitButton/styles.css +5 -0
- package/dist/components/Status/styles.css +0 -7
- package/dist/components/Switch/styles.css +0 -7
- package/dist/components/Table/Table.vue.d.ts +26 -26
- package/dist/components/Table/Table.vue.d.ts.map +1 -1
- package/dist/components/Table/TableLoadingLine.vue.d.ts.map +1 -1
- package/dist/components/Table/hooks/useExpandableRow.d.ts.map +1 -1
- package/dist/components/Table/hooks/useTotalItems.d.ts.map +1 -1
- package/dist/components/Table/styles.css +61 -44
- package/dist/components/Table/tableQuery.d.ts +30 -0
- package/dist/components/Table/tableQuery.d.ts.map +1 -0
- package/dist/components/Tree/Tree.vue.d.ts.map +1 -1
- package/dist/components/Tree/treeQuery.d.ts +31 -0
- package/dist/components/Tree/treeQuery.d.ts.map +1 -0
- package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
- package/dist/components/TreeSelect/styles.css +1 -1
- package/dist/config-provider/index.js +1 -1
- package/dist/config-provider/style.css +72 -72
- package/dist/confirm-dialog/index.js +2 -2
- package/dist/confirm-dialog/style.css +75 -124
- package/dist/confirm-popup/index.js +2 -2
- package/dist/confirm-popup/style.css +72 -78
- package/dist/context-menu/index.js +2 -2
- package/dist/context-menu/style.css +10 -75
- package/dist/data-view/index.js +47 -47
- package/dist/data-view/style.css +393 -174
- package/dist/data-view/style.js +1 -1
- package/dist/date-picker/index.js +1 -1
- package/dist/date-picker/style.css +10 -67
- package/dist/dialog/index.js +2 -2
- package/dist/dialog/style.css +75 -124
- package/dist/divider/style.css +10 -61
- package/dist/dock/index.js +2 -2
- package/dist/dock/style.css +10 -77
- package/dist/drawer/index.js +1 -1
- package/dist/drawer/style.css +12 -118
- package/dist/dropdown/index.js +110 -91
- package/dist/dropdown/style.css +34 -80
- package/dist/empty/index.js +5 -150
- package/dist/empty/style.css +10 -67
- package/dist/fieldset/index.js +1 -1
- package/dist/fieldset/style.css +10 -74
- package/dist/file-upload/index.js +148 -146
- package/dist/file-upload/style.css +10 -67
- package/dist/filterByQuery-Bczaxzih.js +17 -0
- package/dist/flex/style.css +10 -61
- package/dist/float-label/style.css +10 -61
- package/dist/fluid/style.css +10 -61
- package/dist/form/style.css +10 -61
- package/dist/gallery/index.js +1 -1
- package/dist/gallery/style.css +10 -83
- package/dist/grid/style.css +10 -61
- package/dist/icon/index.js +93 -39
- package/dist/icon/style.css +10 -67
- package/dist/icon-COrt_N8A.js +18 -0
- package/dist/icon-field/style.css +10 -61
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5400 -5145
- package/dist/inplace/style.css +10 -61
- package/dist/input/index.js +1 -1
- package/dist/input/style.css +10 -67
- package/dist/input-color/style.css +10 -61
- package/dist/input-group/style.css +10 -61
- package/dist/input-number/index.js +1 -1
- package/dist/input-number/style.css +10 -67
- package/dist/input-otp/style.css +10 -61
- package/dist/input-password/index.js +1 -1
- package/dist/input-password/style.css +10 -67
- package/dist/input-tags/index.js +1 -1
- package/dist/input-tags/style.css +10 -67
- package/dist/knob/style.css +10 -67
- package/dist/label/style.css +10 -61
- package/dist/layout/index.js +1 -1
- package/dist/layout/style.css +15 -89
- package/dist/listbox/index.js +30 -32
- package/dist/listbox/style.css +10 -69
- package/dist/loading/index.js +32 -446
- package/dist/loading/style.css +10 -77
- package/dist/mega-menu/index.js +2 -2
- package/dist/mega-menu/style.css +10 -67
- package/dist/menu/index.js +265 -255
- package/dist/menu/style.css +36 -99
- package/dist/menubar/index.js +6 -3
- package/dist/menubar/style.css +14 -75
- package/dist/message/index.js +1 -1
- package/dist/message/style.css +10 -80
- package/dist/meter-group/style.css +10 -61
- package/dist/order-list/index.js +1 -1
- package/dist/order-list/style.css +10 -67
- package/dist/page/index.js +229 -70
- package/dist/page/style.css +1186 -113
- package/dist/page/style.js +3 -0
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/style.css +210 -77
- package/dist/pagination/style.js +1 -0
- package/dist/panel/index.js +1 -1
- package/dist/panel/style.css +10 -74
- package/dist/pick-list/index.js +1 -1
- package/dist/pick-list/style.css +10 -67
- package/dist/popover/style.css +30 -78
- package/dist/progress-bar/style.css +10 -70
- package/dist/progress-spinner/index.js +105 -2
- package/dist/progress-spinner/style.css +10 -68
- package/dist/radio/style.css +10 -61
- package/dist/rating/index.js +1 -1
- package/dist/rating/style.css +10 -67
- package/dist/resolver-map.d.ts.map +1 -1
- package/dist/resolver.js +1 -0
- package/dist/result/index.js +1 -1
- package/dist/result/style.css +10 -67
- package/dist/scroll-top/index.js +1 -1
- package/dist/scroll-top/style.css +10 -82
- package/dist/scrollbar/style.css +10 -69
- package/dist/select/index.js +2 -478
- package/dist/select/style.css +59 -89
- package/dist/select-button/style.css +10 -61
- package/dist/shared/config.d.ts +2 -2
- package/dist/shared/filterByQuery.d.ts +14 -0
- package/dist/shared/filterByQuery.d.ts.map +1 -0
- package/dist/shared/menu/expand.d.ts +38 -0
- package/dist/shared/menu/expand.d.ts.map +1 -0
- package/dist/shared/menu/icon.d.ts.map +1 -1
- package/dist/shared/menu/index.d.ts +2 -0
- package/dist/shared/menu/index.d.ts.map +1 -1
- package/dist/shared/styles/select-overlay.css +14 -6
- package/dist/sidebar/index.js +2 -2
- package/dist/sidebar/style.css +10 -73
- package/dist/skeleton/index.js +2 -59
- package/dist/skeleton/style.css +10 -67
- package/dist/slider/style.css +19 -61
- package/dist/space/style.css +10 -61
- package/dist/speed-dial/index.js +2 -2
- package/dist/speed-dial/style.css +10 -67
- package/dist/split-button/index.js +1 -1
- package/dist/split-button/style.css +77 -78
- package/dist/splitter/style.css +10 -61
- package/dist/status/index.js +1 -1
- package/dist/status/style.css +10 -74
- package/dist/stepper/index.js +1 -1
- package/dist/stepper/style.css +10 -67
- package/dist/styles/base.css +5 -50
- package/dist/styles.css +1 -1
- package/dist/switch/style.css +10 -68
- package/dist/table/index.js +409 -373
- package/dist/table/style.css +457 -215
- package/dist/table/style.js +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/style.css +10 -75
- package/dist/tag/index.js +1 -1
- package/dist/tag/style.css +10 -67
- package/dist/terminal/style.css +10 -61
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/style.css +10 -67
- package/dist/theme/styles.css +5 -11
- package/dist/theme/useMotion.d.ts +5 -1
- package/dist/theme/useMotion.d.ts.map +1 -1
- package/dist/tiered-menu/index.js +1 -1
- package/dist/tiered-menu/style.css +10 -75
- package/dist/timeline/index.js +1 -1
- package/dist/timeline/style.css +10 -75
- package/dist/toast/index.js +1 -1
- package/dist/toast/style.css +10 -67
- package/dist/toggle-button/index.js +2 -2
- package/dist/toggle-button/style.css +10 -67
- package/dist/toolbar/style.css +10 -61
- package/dist/tooltip/style.css +10 -61
- package/dist/tree/index.js +159 -173
- package/dist/tree/style.css +10 -67
- package/dist/tree-select/index.js +200 -213
- package/dist/tree-select/style.css +25 -82
- package/dist/tree-table/index.js +1 -1
- package/dist/tree-table/style.css +10 -67
- package/dist/treeQuery-CnHkyYOA.js +107 -0
- package/dist/virtual-scroller/style.css +10 -69
- package/package.json +1 -1
- package/dist/Button-B5X_R4Md.js +0 -156
- package/dist/Icon-lcN1rS87.js +0 -610
- package/dist/Pagination-CVrH8Ypi.js +0 -158
- package/dist/ProgressSpinner-BeWVF6Jv.js +0 -105
- package/dist/checkStrategy-CZzuUKDI.js +0 -63
- package/dist/components/Icon/icons-tabler.d.ts +0 -77
- package/dist/components/Icon/icons-tabler.d.ts.map +0 -1
- package/dist/icon-DWXkh-RM.js +0 -27
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { i as e } from "../useComponentAttrs-e-5QAjdw.js";
|
|
2
|
-
import { t } from "../Icon-
|
|
2
|
+
import { t } from "../Icon-od9Ob-Ay.js";
|
|
3
3
|
import { n } from "../locale-Bzm2nbEp.js";
|
|
4
4
|
import "./style.js";
|
|
5
|
-
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as ee, createVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as
|
|
5
|
+
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as ee, createVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as te, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, useAttrs as ne, watch as re } from "vue";
|
|
6
6
|
//#region src/components/FileUpload/ajax.ts
|
|
7
|
-
function
|
|
7
|
+
function ie(e) {
|
|
8
8
|
let t = new XMLHttpRequest(), n = new FormData();
|
|
9
9
|
n.append(e.filename, e.file, e.file.name);
|
|
10
10
|
for (let [t, r] of Object.entries(e.data)) n.append(t, r);
|
|
@@ -25,53 +25,68 @@ function re(e) {
|
|
|
25
25
|
return t.send(n), t;
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
|
+
//#region src/components/FileUpload/fileUtils.ts
|
|
29
|
+
function ae(e, t) {
|
|
30
|
+
let n = t?.trim();
|
|
31
|
+
return !n || n.split(",").some((t) => {
|
|
32
|
+
let n = t.trim().toLowerCase();
|
|
33
|
+
return n ? n.startsWith(".") ? e.name.toLowerCase().endsWith(n) : n.endsWith("/*") ? e.type.toLowerCase().startsWith(n.slice(0, -1)) : e.type.toLowerCase() === n : !1;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function y(e) {
|
|
37
|
+
return e.type?.startsWith("image/") ? !0 : /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i.test(e.name);
|
|
38
|
+
}
|
|
39
|
+
function oe(e = 0) {
|
|
40
|
+
return e < 1024 ? `${e} B` : e < 1048576 ? `${Math.round(e / 1024)} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
28
43
|
//#region src/components/FileUpload/FileUpload.vue?vue&type=script&setup=true&lang.ts
|
|
29
|
-
var
|
|
44
|
+
var se = [
|
|
30
45
|
"multiple",
|
|
31
46
|
"accept",
|
|
32
47
|
"disabled",
|
|
33
48
|
"webkitdirectory"
|
|
34
|
-
],
|
|
49
|
+
], ce = ["aria-disabled", "aria-label"], le = { class: "m-fileupload__text" }, ue = ["disabled"], de = ["disabled"], fe = {
|
|
35
50
|
key: 3,
|
|
36
51
|
class: "m-fileupload__tip"
|
|
37
|
-
},
|
|
52
|
+
}, pe = {
|
|
38
53
|
key: 4,
|
|
39
54
|
class: "m-fileupload__list"
|
|
40
|
-
},
|
|
55
|
+
}, me = { class: "m-fileupload__file-body" }, he = [
|
|
41
56
|
"src",
|
|
42
57
|
"alt",
|
|
43
58
|
"onClick"
|
|
44
|
-
],
|
|
59
|
+
], ge = { class: "m-fileupload__name" }, _e = {
|
|
45
60
|
key: 1,
|
|
46
61
|
class: "m-fileupload__size"
|
|
47
|
-
},
|
|
62
|
+
}, ve = {
|
|
48
63
|
key: 2,
|
|
49
64
|
class: "m-fileupload__status"
|
|
50
|
-
},
|
|
65
|
+
}, ye = { class: "m-fileupload__actions" }, be = ["aria-label", "onClick"], xe = ["aria-label", "onClick"], Se = [
|
|
51
66
|
"aria-label",
|
|
52
67
|
"disabled",
|
|
53
68
|
"onClick"
|
|
54
|
-
],
|
|
69
|
+
], Ce = ["aria-valuenow"], we = [
|
|
55
70
|
"src",
|
|
56
71
|
"alt",
|
|
57
72
|
"onClick"
|
|
58
|
-
],
|
|
73
|
+
], Te = {
|
|
59
74
|
key: 1,
|
|
60
75
|
class: "m-fileupload__card-name"
|
|
61
|
-
},
|
|
76
|
+
}, Ee = {
|
|
62
77
|
key: 2,
|
|
63
78
|
class: "m-fileupload__card-progress"
|
|
64
|
-
},
|
|
79
|
+
}, De = {
|
|
65
80
|
key: 3,
|
|
66
81
|
class: "m-fileupload__card-mask"
|
|
67
|
-
},
|
|
82
|
+
}, Oe = ["aria-label", "onClick"], ke = ["aria-label", "onClick"], Ae = [
|
|
68
83
|
"aria-label",
|
|
69
84
|
"disabled",
|
|
70
85
|
"onClick"
|
|
71
|
-
],
|
|
86
|
+
], je = ["aria-label"], b = {
|
|
72
87
|
key: 6,
|
|
73
88
|
class: "m-fileupload__toolbar"
|
|
74
|
-
},
|
|
89
|
+
}, x = /* @__PURE__ */ l({
|
|
75
90
|
inheritAttrs: !1,
|
|
76
91
|
__name: "FileUpload",
|
|
77
92
|
props: {
|
|
@@ -133,49 +148,36 @@ var ie = [
|
|
|
133
148
|
"error",
|
|
134
149
|
"abort"
|
|
135
150
|
],
|
|
136
|
-
setup(l, { expose:
|
|
137
|
-
let
|
|
151
|
+
setup(l, { expose: x, emit: S }) {
|
|
152
|
+
let C = l, w = S, Me = ne(), { rootAttrs: Ne, controlAttrs: Pe } = e(Me, () => C.pt, { controlKey: "input" }), T = 0, E = m(null), D = m([]), O = m(!1), k = /* @__PURE__ */ new Map(), A = n(), j = i(() => C.chooseLabel ?? A.value.chooseFile), M = i(() => C.listType === "picture-card"), N = i(() => C.listType === "picture" || M.value), P = i(() => !!(C.action || C.httpRequest)), Fe = i(() => C.autoUpload && P.value), Ie = i(() => C.showFileList && D.value.length > 0 && !M.value), F = i(() => !M.value), I = i(() => !C.disabled && (C.limit == null || D.value.length < C.limit)), Le = i(() => P.value && !C.autoUpload && D.value.some((e) => e.status === "ready" || e.status === "fail")), Re = i(() => D.value.length > 0 && C.showFileList), ze = i(() => [
|
|
138
153
|
"m-fileupload",
|
|
139
|
-
`m-fileupload--${
|
|
140
|
-
`m-fileupload--${
|
|
154
|
+
`m-fileupload--${C.mode}`,
|
|
155
|
+
`m-fileupload--${C.listType}`,
|
|
141
156
|
{
|
|
142
|
-
"m-fileupload--disabled":
|
|
143
|
-
"m-fileupload--drag":
|
|
157
|
+
"m-fileupload--disabled": C.disabled,
|
|
158
|
+
"m-fileupload--drag": C.drag
|
|
144
159
|
}
|
|
145
160
|
]);
|
|
146
|
-
|
|
147
|
-
e && (
|
|
161
|
+
re(() => C.fileList, (e) => {
|
|
162
|
+
e && (D.value = e.map((e) => ({
|
|
148
163
|
...e,
|
|
149
164
|
status: e.status ?? "success",
|
|
150
165
|
percentage: e.percentage ?? (e.status && e.status !== "success" ? 0 : 100),
|
|
151
|
-
uid: e.uid ||
|
|
166
|
+
uid: e.uid || L()
|
|
152
167
|
})));
|
|
153
168
|
}, { immediate: !0 });
|
|
154
|
-
function
|
|
155
|
-
return
|
|
156
|
-
}
|
|
157
|
-
function L(e) {
|
|
158
|
-
E.value = e, S("update:fileList", e);
|
|
159
|
-
}
|
|
160
|
-
function R(e, t) {
|
|
161
|
-
S("change", e, t);
|
|
162
|
-
}
|
|
163
|
-
function Re(e) {
|
|
164
|
-
let t = x.accept?.trim();
|
|
165
|
-
return !t || t.split(",").some((t) => {
|
|
166
|
-
let n = t.trim().toLowerCase();
|
|
167
|
-
return n ? n.startsWith(".") ? e.name.toLowerCase().endsWith(n) : n.endsWith("/*") ? e.type.toLowerCase().startsWith(n.slice(0, -1)) : e.type.toLowerCase() === n : !1;
|
|
168
|
-
});
|
|
169
|
+
function L() {
|
|
170
|
+
return T += 1, `m-upload-${Date.now()}-${T}`;
|
|
169
171
|
}
|
|
170
|
-
function
|
|
171
|
-
|
|
172
|
+
function R(e) {
|
|
173
|
+
D.value = e, w("update:fileList", e);
|
|
172
174
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
175
|
+
function z(e, t) {
|
|
176
|
+
w("change", e, t);
|
|
175
177
|
}
|
|
176
178
|
function Be(e) {
|
|
177
179
|
return {
|
|
178
|
-
uid:
|
|
180
|
+
uid: L(),
|
|
179
181
|
name: e.name,
|
|
180
182
|
size: e.size,
|
|
181
183
|
type: e.type,
|
|
@@ -189,94 +191,94 @@ var ie = [
|
|
|
189
191
|
e.url?.startsWith("blob:") && URL.revokeObjectURL(e.url);
|
|
190
192
|
}
|
|
191
193
|
async function V(e) {
|
|
192
|
-
if (
|
|
194
|
+
if (C.disabled) return;
|
|
193
195
|
let t = [];
|
|
194
|
-
for (let n of e) if (
|
|
195
|
-
if (
|
|
196
|
-
|
|
196
|
+
for (let n of e) if (ae(n, C.accept)) {
|
|
197
|
+
if (C.maxSize != null && n.size > C.maxSize) {
|
|
198
|
+
w("exceed-size", n);
|
|
197
199
|
continue;
|
|
198
200
|
}
|
|
199
201
|
t.push(n);
|
|
200
202
|
}
|
|
201
|
-
let n =
|
|
203
|
+
let n = C.multiple ? t : t.slice(0, 1);
|
|
202
204
|
if (!n.length) return;
|
|
203
|
-
let r =
|
|
204
|
-
if (
|
|
205
|
-
|
|
205
|
+
let r = C.multiple ? D.value : [];
|
|
206
|
+
if (C.limit != null && r.length + n.length > C.limit) {
|
|
207
|
+
w("exceed", n);
|
|
206
208
|
return;
|
|
207
209
|
}
|
|
208
|
-
|
|
210
|
+
C.multiple || D.value.forEach(B);
|
|
209
211
|
let i = [];
|
|
210
212
|
for (let e of n) {
|
|
211
213
|
let t = Be(e);
|
|
212
|
-
if (
|
|
214
|
+
if (C.beforeUpload && await C.beforeUpload(e, t) === !1) {
|
|
213
215
|
B(t);
|
|
214
216
|
continue;
|
|
215
217
|
}
|
|
216
218
|
i.push(t);
|
|
217
219
|
}
|
|
218
220
|
if (!i.length) return;
|
|
219
|
-
let a =
|
|
220
|
-
|
|
221
|
-
for (let e of i)
|
|
221
|
+
let a = C.multiple ? [...r, ...i] : i;
|
|
222
|
+
R(a), w("select", i.map((e) => e.raw).filter(Boolean));
|
|
223
|
+
for (let e of i) z(e, a), Fe.value && J(e);
|
|
222
224
|
}
|
|
223
225
|
function H() {
|
|
224
|
-
|
|
226
|
+
I.value && E.value?.click();
|
|
225
227
|
}
|
|
226
228
|
function Ve(e) {
|
|
227
229
|
let t = e.target;
|
|
228
230
|
V(Array.from(t.files ?? [])), t.value = "";
|
|
229
231
|
}
|
|
230
232
|
function U(e) {
|
|
231
|
-
|
|
233
|
+
C.disabled || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"), O.value = !0);
|
|
232
234
|
}
|
|
233
235
|
function W(e) {
|
|
234
236
|
let t = e.currentTarget, n = e.relatedTarget;
|
|
235
|
-
t && n && t.contains(n) || (
|
|
237
|
+
t && n && t.contains(n) || (O.value = !1);
|
|
236
238
|
}
|
|
237
239
|
function G(e) {
|
|
238
|
-
|
|
240
|
+
C.disabled || (e.preventDefault(), O.value = !1, V(Array.from(e.dataTransfer?.files ?? [])));
|
|
239
241
|
}
|
|
240
242
|
function K(e) {
|
|
241
243
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), H());
|
|
242
244
|
}
|
|
243
245
|
function q(e, t) {
|
|
244
|
-
let n =
|
|
246
|
+
let n = D.value.find((t) => t.uid === e), r = D.value.map((n) => n.uid === e ? {
|
|
245
247
|
...n,
|
|
246
248
|
...t
|
|
247
249
|
} : n), i = r.find((t) => t.uid === e);
|
|
248
|
-
|
|
250
|
+
R(r), i && n && t.status != null && t.status !== n.status && z(i, r);
|
|
249
251
|
}
|
|
250
252
|
function He(e, t) {
|
|
251
|
-
let n = typeof
|
|
253
|
+
let n = typeof C.data == "function" ? C.data() : C.data ?? {};
|
|
252
254
|
return {
|
|
253
|
-
action:
|
|
254
|
-
method:
|
|
255
|
+
action: C.action ?? "",
|
|
256
|
+
method: C.method ?? "post",
|
|
255
257
|
file: t,
|
|
256
|
-
filename:
|
|
258
|
+
filename: C.name ?? "file",
|
|
257
259
|
data: n,
|
|
258
|
-
headers:
|
|
259
|
-
withCredentials:
|
|
260
|
+
headers: C.headers ?? {},
|
|
261
|
+
withCredentials: C.withCredentials,
|
|
260
262
|
onProgress: (t) => {
|
|
261
263
|
q(e.uid, {
|
|
262
264
|
percentage: t,
|
|
263
265
|
status: "uploading"
|
|
264
266
|
});
|
|
265
|
-
let n =
|
|
266
|
-
n &&
|
|
267
|
+
let n = D.value.find((t) => t.uid === e.uid);
|
|
268
|
+
n && w("progress", n, t);
|
|
267
269
|
},
|
|
268
270
|
onSuccess: (t) => {
|
|
269
|
-
|
|
271
|
+
k.delete(e.uid), q(e.uid, {
|
|
270
272
|
status: "success",
|
|
271
273
|
percentage: 100,
|
|
272
274
|
response: t,
|
|
273
275
|
error: void 0
|
|
274
276
|
});
|
|
275
|
-
let n =
|
|
276
|
-
n &&
|
|
277
|
+
let n = D.value.find((t) => t.uid === e.uid);
|
|
278
|
+
n && w("success", n, t);
|
|
277
279
|
},
|
|
278
280
|
onError: (t) => {
|
|
279
|
-
if (
|
|
281
|
+
if (k.delete(e.uid), t.message === "aborted") {
|
|
280
282
|
q(e.uid, {
|
|
281
283
|
status: "ready",
|
|
282
284
|
percentage: 0
|
|
@@ -287,24 +289,24 @@ var ie = [
|
|
|
287
289
|
status: "fail",
|
|
288
290
|
error: t.message
|
|
289
291
|
});
|
|
290
|
-
let n =
|
|
291
|
-
n &&
|
|
292
|
+
let n = D.value.find((t) => t.uid === e.uid);
|
|
293
|
+
n && w("error", n, t);
|
|
292
294
|
}
|
|
293
295
|
};
|
|
294
296
|
}
|
|
295
297
|
async function J(e) {
|
|
296
298
|
let t = e.raw;
|
|
297
|
-
if (!t ||
|
|
299
|
+
if (!t || C.disabled || !P.value) return;
|
|
298
300
|
q(e.uid, {
|
|
299
301
|
status: "uploading",
|
|
300
302
|
percentage: e.percentage ?? 0,
|
|
301
303
|
error: void 0
|
|
302
304
|
});
|
|
303
305
|
let n = He(e, t);
|
|
304
|
-
if (
|
|
306
|
+
if (C.httpRequest) {
|
|
305
307
|
try {
|
|
306
|
-
let t =
|
|
307
|
-
if (t instanceof XMLHttpRequest)
|
|
308
|
+
let t = C.httpRequest(n);
|
|
309
|
+
if (t instanceof XMLHttpRequest) k.set(e.uid, t);
|
|
308
310
|
else if (t && typeof t.then == "function") {
|
|
309
311
|
let e = await t;
|
|
310
312
|
n.onSuccess(e);
|
|
@@ -314,121 +316,121 @@ var ie = [
|
|
|
314
316
|
}
|
|
315
317
|
return;
|
|
316
318
|
}
|
|
317
|
-
|
|
319
|
+
k.set(e.uid, ie(n));
|
|
318
320
|
}
|
|
319
321
|
function Y() {
|
|
320
|
-
for (let e of
|
|
322
|
+
for (let e of D.value) (e.status === "ready" || e.status === "fail") && J(e);
|
|
321
323
|
}
|
|
322
324
|
function X(e) {
|
|
323
|
-
let t = e ? [e.uid] : [...
|
|
324
|
-
for (let e of t)
|
|
325
|
-
|
|
325
|
+
let t = e ? [e.uid] : [...k.keys()];
|
|
326
|
+
for (let e of t) k.get(e)?.abort(), k.delete(e);
|
|
327
|
+
w("abort", e);
|
|
326
328
|
}
|
|
327
329
|
async function Z(e) {
|
|
328
|
-
|
|
330
|
+
C.disabled || C.beforeRemove && await C.beforeRemove(e, D.value) === !1 || (X(e), B(e), R(D.value.filter((t) => t.uid !== e.uid)), w("remove", e));
|
|
329
331
|
}
|
|
330
332
|
function Q(e) {
|
|
331
|
-
|
|
333
|
+
w("preview", e);
|
|
332
334
|
}
|
|
333
335
|
function $() {
|
|
334
|
-
X(),
|
|
336
|
+
X(), D.value.forEach(B), R([]);
|
|
335
337
|
}
|
|
336
|
-
return
|
|
337
|
-
X(),
|
|
338
|
-
}),
|
|
338
|
+
return te(() => {
|
|
339
|
+
X(), D.value.forEach(B);
|
|
340
|
+
}), x({
|
|
339
341
|
openPicker: H,
|
|
340
342
|
submit: Y,
|
|
341
343
|
abort: X,
|
|
342
344
|
clear: $,
|
|
343
345
|
clearFiles: $
|
|
344
|
-
}), (e, n) => (
|
|
346
|
+
}), (e, n) => (p(), o("div", u(v(Ne), { class: ze.value }), [
|
|
345
347
|
s("input", u({
|
|
346
348
|
ref_key: "inputRef",
|
|
347
|
-
ref:
|
|
349
|
+
ref: E,
|
|
348
350
|
class: "m-fileupload__input",
|
|
349
351
|
type: "file",
|
|
350
352
|
multiple: l.multiple || l.directory,
|
|
351
353
|
accept: l.accept,
|
|
352
354
|
disabled: l.disabled,
|
|
353
355
|
webkitdirectory: l.directory || void 0
|
|
354
|
-
},
|
|
355
|
-
l.drag &&
|
|
356
|
+
}, v(Pe), { onChange: Ve }), null, 16, se),
|
|
357
|
+
l.drag && F.value ? (p(), o("div", {
|
|
356
358
|
key: 0,
|
|
357
|
-
class: d(["m-fileupload__dragger", { "m-fileupload__dragger--over":
|
|
359
|
+
class: d(["m-fileupload__dragger", { "m-fileupload__dragger--over": O.value }]),
|
|
358
360
|
role: "button",
|
|
359
361
|
tabindex: "0",
|
|
360
362
|
"aria-disabled": l.disabled || void 0,
|
|
361
|
-
"aria-label":
|
|
363
|
+
"aria-label": j.value,
|
|
362
364
|
onClick: H,
|
|
363
365
|
onKeydown: K,
|
|
364
366
|
onDragenter: U,
|
|
365
367
|
onDragover: U,
|
|
366
368
|
onDragleave: W,
|
|
367
369
|
onDrop: G
|
|
368
|
-
}, [
|
|
370
|
+
}, [g(e.$slots, "default", {}, () => [c(t, {
|
|
369
371
|
class: "m-fileupload__icon",
|
|
370
372
|
name: "upload"
|
|
371
|
-
}), s("p",
|
|
373
|
+
}), s("p", le, [ee(_(v(A).dropFileHere) + " ", 1), s("em", null, _(v(A).clickToUpload), 1)])])], 42, ce)) : F.value && e.$slots.trigger ? (p(), o("button", {
|
|
372
374
|
key: 1,
|
|
373
375
|
type: "button",
|
|
374
376
|
class: "m-fileupload__choose m-fileupload__choose--slot",
|
|
375
|
-
disabled: l.disabled || !
|
|
377
|
+
disabled: l.disabled || !I.value,
|
|
376
378
|
onClick: H
|
|
377
|
-
}, [
|
|
379
|
+
}, [g(e.$slots, "trigger")], 8, ue)) : F.value ? (p(), o("button", {
|
|
378
380
|
key: 2,
|
|
379
381
|
type: "button",
|
|
380
382
|
class: "m-fileupload__choose",
|
|
381
|
-
disabled: l.disabled || !
|
|
383
|
+
disabled: l.disabled || !I.value,
|
|
382
384
|
onClick: H
|
|
383
|
-
},
|
|
384
|
-
e.$slots.tip ? (
|
|
385
|
-
|
|
385
|
+
}, _(j.value), 9, de)) : a("", !0),
|
|
386
|
+
e.$slots.tip ? (p(), o("div", fe, [g(e.$slots, "tip")])) : a("", !0),
|
|
387
|
+
Ie.value && !M.value ? (p(), o("ul", pe, [(p(!0), o(r, null, h(D.value, (n) => (p(), o("li", {
|
|
386
388
|
key: n.uid,
|
|
387
|
-
class: d(["m-fileupload__file", [`m-fileupload__file--${n.status}`, { "m-fileupload__file--picture":
|
|
388
|
-
}, [
|
|
389
|
-
|
|
389
|
+
class: d(["m-fileupload__file", [`m-fileupload__file--${n.status}`, { "m-fileupload__file--picture": N.value }]])
|
|
390
|
+
}, [g(e.$slots, "file", { file: n }, () => [s("div", me, [
|
|
391
|
+
N.value && n.url && v(y)(n) ? (p(), o("img", {
|
|
390
392
|
key: 0,
|
|
391
393
|
class: "m-fileupload__thumb",
|
|
392
394
|
src: n.url,
|
|
393
395
|
alt: n.name,
|
|
394
396
|
onClick: (e) => Q(n)
|
|
395
|
-
}, null, 8,
|
|
396
|
-
s("span",
|
|
397
|
-
n.size == null ? a("", !0) : (
|
|
398
|
-
n.status === "fail" ? (
|
|
399
|
-
s("span",
|
|
400
|
-
n.url &&
|
|
397
|
+
}, null, 8, he)) : a("", !0),
|
|
398
|
+
s("span", ge, _(n.name), 1),
|
|
399
|
+
n.size == null ? a("", !0) : (p(), o("span", _e, _(v(oe)(n.size)), 1)),
|
|
400
|
+
n.status === "fail" ? (p(), o("span", ve, _(n.error || v(A).uploadFailed), 1)) : a("", !0),
|
|
401
|
+
s("span", ye, [
|
|
402
|
+
n.url && v(y)(n) ? (p(), o("button", {
|
|
401
403
|
key: 0,
|
|
402
404
|
type: "button",
|
|
403
405
|
class: "m-fileupload__action",
|
|
404
|
-
"aria-label":
|
|
406
|
+
"aria-label": v(A).previewFile,
|
|
405
407
|
onClick: (e) => Q(n)
|
|
406
408
|
}, [c(t, {
|
|
407
409
|
name: "eye",
|
|
408
410
|
size: "sm"
|
|
409
|
-
})], 8,
|
|
410
|
-
n.status === "fail" ? (
|
|
411
|
+
})], 8, be)) : a("", !0),
|
|
412
|
+
n.status === "fail" ? (p(), o("button", {
|
|
411
413
|
key: 1,
|
|
412
414
|
type: "button",
|
|
413
415
|
class: "m-fileupload__action",
|
|
414
|
-
"aria-label":
|
|
416
|
+
"aria-label": v(A).retryUpload,
|
|
415
417
|
onClick: (e) => J(n)
|
|
416
418
|
}, [c(t, {
|
|
417
419
|
name: "refresh",
|
|
418
420
|
size: "sm"
|
|
419
|
-
})], 8,
|
|
421
|
+
})], 8, xe)) : a("", !0),
|
|
420
422
|
s("button", {
|
|
421
423
|
type: "button",
|
|
422
424
|
class: "m-fileupload__action",
|
|
423
|
-
"aria-label":
|
|
425
|
+
"aria-label": v(A).removeFile,
|
|
424
426
|
disabled: l.disabled,
|
|
425
427
|
onClick: (e) => Z(n)
|
|
426
428
|
}, [c(t, {
|
|
427
429
|
name: "trash",
|
|
428
430
|
size: "sm"
|
|
429
|
-
})], 8,
|
|
431
|
+
})], 8, Se)
|
|
430
432
|
])
|
|
431
|
-
]), n.status === "uploading" ? (
|
|
433
|
+
]), n.status === "uploading" ? (p(), o("div", {
|
|
432
434
|
key: 0,
|
|
433
435
|
class: "m-fileupload__progress",
|
|
434
436
|
role: "progressbar",
|
|
@@ -436,73 +438,73 @@ var ie = [
|
|
|
436
438
|
"aria-valuemax": 100,
|
|
437
439
|
"aria-valuenow": Math.round(n.percentage ?? 0),
|
|
438
440
|
style: f({ width: `${n.percentage ?? 0}%` })
|
|
439
|
-
}, null, 12,
|
|
440
|
-
|
|
441
|
+
}, null, 12, Ce)) : a("", !0)])], 2))), 128))])) : a("", !0),
|
|
442
|
+
M.value ? (p(), o("div", {
|
|
441
443
|
key: 5,
|
|
442
|
-
class: d(["m-fileupload__cards", { "m-fileupload__cards--over":
|
|
444
|
+
class: d(["m-fileupload__cards", { "m-fileupload__cards--over": O.value }]),
|
|
443
445
|
onDragenter: U,
|
|
444
446
|
onDragover: U,
|
|
445
447
|
onDragleave: W,
|
|
446
448
|
onDrop: G
|
|
447
|
-
}, [(
|
|
449
|
+
}, [(p(!0), o(r, null, h(l.showFileList ? D.value : [], (n) => (p(), o("div", {
|
|
448
450
|
key: n.uid,
|
|
449
451
|
class: d(["m-fileupload__card", `m-fileupload__card--${n.status}`])
|
|
450
|
-
}, [
|
|
452
|
+
}, [g(e.$slots, "file", { file: n }, () => [n.url && v(y)(n) ? (p(), o("img", {
|
|
451
453
|
key: 0,
|
|
452
454
|
class: "m-fileupload__card-image",
|
|
453
455
|
src: n.url,
|
|
454
456
|
alt: n.name,
|
|
455
457
|
onClick: (e) => Q(n)
|
|
456
|
-
}, null, 8,
|
|
457
|
-
n.url &&
|
|
458
|
+
}, null, 8, we)) : (p(), o("span", Te, _(n.name), 1)), n.status === "uploading" ? (p(), o("div", Ee, _(Math.round(n.percentage ?? 0)) + "% ", 1)) : (p(), o("div", De, [
|
|
459
|
+
n.url && v(y)(n) ? (p(), o("button", {
|
|
458
460
|
key: 0,
|
|
459
461
|
type: "button",
|
|
460
462
|
class: "m-fileupload__action",
|
|
461
|
-
"aria-label":
|
|
463
|
+
"aria-label": v(A).previewFile,
|
|
462
464
|
onClick: (e) => Q(n)
|
|
463
465
|
}, [c(t, {
|
|
464
466
|
name: "eye",
|
|
465
467
|
size: "sm"
|
|
466
|
-
})], 8,
|
|
467
|
-
n.status === "fail" ? (
|
|
468
|
+
})], 8, Oe)) : a("", !0),
|
|
469
|
+
n.status === "fail" ? (p(), o("button", {
|
|
468
470
|
key: 1,
|
|
469
471
|
type: "button",
|
|
470
472
|
class: "m-fileupload__action",
|
|
471
|
-
"aria-label":
|
|
473
|
+
"aria-label": v(A).retryUpload,
|
|
472
474
|
onClick: (e) => J(n)
|
|
473
475
|
}, [c(t, {
|
|
474
476
|
name: "refresh",
|
|
475
477
|
size: "sm"
|
|
476
|
-
})], 8,
|
|
478
|
+
})], 8, ke)) : a("", !0),
|
|
477
479
|
s("button", {
|
|
478
480
|
type: "button",
|
|
479
481
|
class: "m-fileupload__action",
|
|
480
|
-
"aria-label":
|
|
482
|
+
"aria-label": v(A).removeFile,
|
|
481
483
|
disabled: l.disabled,
|
|
482
484
|
onClick: (e) => Z(n)
|
|
483
485
|
}, [c(t, {
|
|
484
486
|
name: "trash",
|
|
485
487
|
size: "sm"
|
|
486
|
-
})], 8,
|
|
487
|
-
]))])], 2))), 128)),
|
|
488
|
+
})], 8, Ae)
|
|
489
|
+
]))])], 2))), 128)), I.value ? (p(), o("button", {
|
|
488
490
|
key: 0,
|
|
489
491
|
type: "button",
|
|
490
492
|
class: "m-fileupload__card m-fileupload__card--add",
|
|
491
|
-
"aria-label":
|
|
493
|
+
"aria-label": v(A).addFile,
|
|
492
494
|
onClick: H
|
|
493
|
-
}, [c(t, { name: "plus" })], 8,
|
|
494
|
-
|
|
495
|
+
}, [c(t, { name: "plus" })], 8, je)) : a("", !0)], 34)) : a("", !0),
|
|
496
|
+
Re.value ? (p(), o("div", b, [Le.value ? (p(), o("button", {
|
|
495
497
|
key: 0,
|
|
496
498
|
type: "button",
|
|
497
499
|
class: "m-fileupload__choose",
|
|
498
500
|
onClick: Y
|
|
499
|
-
}, v(
|
|
501
|
+
}, _(v(A).uploadFile), 1)) : a("", !0), s("button", {
|
|
500
502
|
type: "button",
|
|
501
503
|
class: "m-fileupload__clear",
|
|
502
504
|
onClick: $
|
|
503
|
-
}, v(
|
|
505
|
+
}, _(v(A).clear), 1)])) : a("", !0)
|
|
504
506
|
], 16));
|
|
505
507
|
}
|
|
506
508
|
});
|
|
507
509
|
//#endregion
|
|
508
|
-
export {
|
|
510
|
+
export { x as MFileUpload };
|