@element-plus/nightly 0.0.20220302 → 0.0.20220305
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/README.md +1 -1
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +1525 -1916
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +1516 -1917
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/index.mjs +4 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/message-box/index.mjs +1 -0
- package/es/components/message-box/index.mjs.map +1 -1
- package/es/components/message-box/src/index.vue.d.ts +2 -2
- package/es/components/message-box/src/message-box.type.d.ts +4 -3
- package/es/components/message-box/src/messageBox.mjs +39 -56
- package/es/components/message-box/src/messageBox.mjs.map +1 -1
- package/es/components/select/index.d.ts +9 -0
- package/es/components/select/src/select.mjs +6 -2
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/select.vue.d.ts +9 -0
- package/es/components/select-v2/index.d.ts +18 -0
- package/es/components/select-v2/src/defaults.d.ts +4 -0
- package/es/components/select-v2/src/defaults.mjs +4 -0
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +3 -3
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +9 -0
- package/es/components/upload/index.d.ts +807 -727
- package/es/components/upload/index.mjs +9 -7
- package/es/components/upload/index.mjs.map +1 -1
- package/es/components/upload/src/ajax.d.ts +8 -2
- package/es/components/upload/src/ajax.mjs +39 -34
- package/es/components/upload/src/ajax.mjs.map +1 -1
- package/es/components/upload/src/upload-content.d.ts +32 -0
- package/es/components/upload/src/upload-content.mjs +39 -0
- package/es/components/upload/src/upload-content.mjs.map +1 -0
- package/es/components/upload/src/upload-content.vue.d.ts +165 -0
- package/es/components/upload/src/upload-content2.mjs +172 -0
- package/es/components/upload/src/upload-content2.mjs.map +1 -0
- package/es/components/upload/src/upload-dragger.d.ts +11 -0
- package/es/components/upload/src/upload-dragger.mjs +11 -67
- package/es/components/upload/src/upload-dragger.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger.vue.d.ts +15 -11
- package/es/components/upload/src/upload-dragger2.mjs +73 -0
- package/es/components/upload/src/upload-dragger2.mjs.map +1 -0
- package/es/components/upload/src/upload-list.d.ts +15 -0
- package/es/components/upload/src/upload-list.mjs +23 -207
- package/es/components/upload/src/upload-list.mjs.map +1 -1
- package/es/components/upload/src/upload-list.vue.d.ts +148 -44
- package/es/components/upload/src/upload-list2.mjs +173 -0
- package/es/components/upload/src/upload-list2.mjs.map +1 -0
- package/es/components/upload/src/upload.d.ts +97 -0
- package/es/components/upload/src/upload.mjs +103 -266
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload.vue.d.ts +830 -292
- package/es/components/upload/src/upload2.mjs +122 -0
- package/es/components/upload/src/upload2.mjs.map +1 -0
- package/es/components/upload/src/{useHandlers.d.ts → use-handlers.d.ts} +10 -13
- package/es/components/upload/src/use-handlers.mjs +142 -0
- package/es/components/upload/src/use-handlers.mjs.map +1 -0
- package/es/index.mjs +5 -0
- package/es/index.mjs.map +1 -1
- package/es/tokens/index.d.ts +1 -0
- package/es/tokens/index.mjs +1 -0
- package/es/tokens/index.mjs.map +1 -1
- package/es/tokens/upload.d.ts +5 -0
- package/es/tokens/upload.mjs +4 -0
- package/es/tokens/upload.mjs.map +1 -0
- package/es/utils/typescript.d.ts +1 -0
- package/es/utils/typescript.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/index.js +13 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/message-box/index.js +1 -0
- package/lib/components/message-box/index.js.map +1 -1
- package/lib/components/message-box/src/index.vue.d.ts +2 -2
- package/lib/components/message-box/src/message-box.type.d.ts +4 -3
- package/lib/components/message-box/src/messageBox.js +38 -55
- package/lib/components/message-box/src/messageBox.js.map +1 -1
- package/lib/components/select/index.d.ts +9 -0
- package/lib/components/select/src/select.js +6 -2
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/select.vue.d.ts +9 -0
- package/lib/components/select-v2/index.d.ts +18 -0
- package/lib/components/select-v2/src/defaults.d.ts +4 -0
- package/lib/components/select-v2/src/defaults.js +4 -0
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/components/select-v2/src/select.js +3 -3
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +9 -0
- package/lib/components/upload/index.d.ts +807 -727
- package/lib/components/upload/index.js +18 -7
- package/lib/components/upload/index.js.map +1 -1
- package/lib/components/upload/src/ajax.d.ts +8 -2
- package/lib/components/upload/src/ajax.js +40 -34
- package/lib/components/upload/src/ajax.js.map +1 -1
- package/lib/components/upload/src/upload-content.d.ts +32 -0
- package/lib/components/upload/src/upload-content.js +43 -0
- package/lib/components/upload/src/upload-content.js.map +1 -0
- package/lib/components/upload/src/upload-content.vue.d.ts +165 -0
- package/lib/components/upload/src/upload-content2.js +176 -0
- package/lib/components/upload/src/upload-content2.js.map +1 -0
- package/lib/components/upload/src/upload-dragger.d.ts +11 -0
- package/lib/components/upload/src/upload-dragger.js +12 -67
- package/lib/components/upload/src/upload-dragger.js.map +1 -1
- package/lib/components/upload/src/upload-dragger.vue.d.ts +15 -11
- package/lib/components/upload/src/upload-dragger2.js +77 -0
- package/lib/components/upload/src/upload-dragger2.js.map +1 -0
- package/lib/components/upload/src/upload-list.d.ts +15 -0
- package/lib/components/upload/src/upload-list.js +24 -207
- package/lib/components/upload/src/upload-list.js.map +1 -1
- package/lib/components/upload/src/upload-list.vue.d.ts +148 -44
- package/lib/components/upload/src/upload-list2.js +177 -0
- package/lib/components/upload/src/upload-list2.js.map +1 -0
- package/lib/components/upload/src/upload.d.ts +97 -0
- package/lib/components/upload/src/upload.js +104 -264
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload.vue.d.ts +830 -292
- package/lib/components/upload/src/upload2.js +126 -0
- package/lib/components/upload/src/upload2.js.map +1 -0
- package/lib/components/upload/src/{useHandlers.d.ts → use-handlers.d.ts} +10 -13
- package/lib/components/upload/src/use-handlers.js +146 -0
- package/lib/components/upload/src/use-handlers.js.map +1 -0
- package/lib/index.js +15 -0
- package/lib/index.js.map +1 -1
- package/lib/tokens/index.d.ts +1 -0
- package/lib/tokens/index.js +2 -0
- package/lib/tokens/index.js.map +1 -1
- package/lib/tokens/upload.d.ts +5 -0
- package/lib/tokens/upload.js +8 -0
- package/lib/tokens/upload.js.map +1 -0
- package/lib/utils/typescript.d.ts +1 -0
- package/lib/utils/typescript.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-cascader.css +1 -1
- package/theme-chalk/el-dialog.css +1 -1
- package/theme-chalk/el-input.css +1 -1
- package/theme-chalk/el-select-v2.css +1 -1
- package/theme-chalk/el-select.css +1 -1
- package/theme-chalk/el-table.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/cascader-panel.scss +1 -1
- package/theme-chalk/src/cascader.scss +1 -1
- package/theme-chalk/src/common/transition.scss +2 -2
- package/theme-chalk/src/common/var.scss +1 -0
- package/theme-chalk/src/date-picker/date-table.scss +4 -4
- package/theme-chalk/src/dialog.scss +1 -1
- package/theme-chalk/src/input.scss +12 -4
- package/theme-chalk/src/menu.scss +1 -1
- package/theme-chalk/src/option-item.scss +2 -2
- package/theme-chalk/src/page-header.scss +1 -1
- package/theme-chalk/src/pagination.scss +2 -2
- package/theme-chalk/src/select-v2.scss +8 -0
- package/theme-chalk/src/select.scss +0 -4
- package/theme-chalk/src/table.scss +2 -1
- package/web-types.json +1 -1
- package/es/components/upload/src/index.mjs +0 -220
- package/es/components/upload/src/index.mjs.map +0 -1
- package/es/components/upload/src/index.vue.d.ts +0 -282
- package/es/components/upload/src/upload.type.d.ts +0 -72
- package/es/components/upload/src/upload.type.mjs +0 -2
- package/es/components/upload/src/upload.type.mjs.map +0 -1
- package/es/components/upload/src/useHandlers.mjs +0 -143
- package/es/components/upload/src/useHandlers.mjs.map +0 -1
- package/lib/components/upload/src/index.js +0 -224
- package/lib/components/upload/src/index.js.map +0 -1
- package/lib/components/upload/src/index.vue.d.ts +0 -282
- package/lib/components/upload/src/upload.type.d.ts +0 -72
- package/lib/components/upload/src/upload.type.js +0 -3
- package/lib/components/upload/src/upload.type.js.map +0 -1
- package/lib/components/upload/src/useHandlers.js +0 -147
- package/lib/components/upload/src/useHandlers.js.map +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { defineComponent, shallowRef, computed, onBeforeUnmount, provide, toRef, openBlock, createElementBlock, unref, createBlock, createSlots, withCtx, renderSlot, createCommentVNode, createVNode } from 'vue';
|
|
2
|
+
import '../../../tokens/index.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import _sfc_main$1 from './upload-list2.mjs';
|
|
5
|
+
import _sfc_main$2 from './upload-content2.mjs';
|
|
6
|
+
import { useHandlers } from './use-handlers.mjs';
|
|
7
|
+
import { uploadProps } from './upload.mjs';
|
|
8
|
+
import { useDisabled } from '../../../hooks/use-common-props/index.mjs';
|
|
9
|
+
import { uploadContextKey } from '../../../tokens/upload.mjs';
|
|
10
|
+
|
|
11
|
+
const __default__ = {
|
|
12
|
+
name: "ElUpload"
|
|
13
|
+
};
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
...__default__,
|
|
16
|
+
props: uploadProps,
|
|
17
|
+
setup(__props, { expose }) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const disabled = useDisabled();
|
|
20
|
+
const uploadRef = shallowRef();
|
|
21
|
+
const {
|
|
22
|
+
abort,
|
|
23
|
+
submit,
|
|
24
|
+
clearFiles,
|
|
25
|
+
uploadFiles,
|
|
26
|
+
handleStart,
|
|
27
|
+
handleError,
|
|
28
|
+
handleRemove,
|
|
29
|
+
handleSuccess,
|
|
30
|
+
handleProgress
|
|
31
|
+
} = useHandlers(props, uploadRef);
|
|
32
|
+
const isPictureCard = computed(() => props.listType === "picture-card");
|
|
33
|
+
onBeforeUnmount(() => {
|
|
34
|
+
uploadFiles.value.forEach(({ url }) => {
|
|
35
|
+
if (url == null ? void 0 : url.startsWith("blob:"))
|
|
36
|
+
URL.revokeObjectURL(url);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
provide(uploadContextKey, {
|
|
40
|
+
accept: toRef(props, "accept")
|
|
41
|
+
});
|
|
42
|
+
expose({
|
|
43
|
+
abort,
|
|
44
|
+
submit,
|
|
45
|
+
clearFiles,
|
|
46
|
+
handleStart,
|
|
47
|
+
handleRemove
|
|
48
|
+
});
|
|
49
|
+
return (_ctx, _cache) => {
|
|
50
|
+
return openBlock(), createElementBlock("div", null, [
|
|
51
|
+
unref(isPictureCard) && _ctx.showFileList ? (openBlock(), createBlock(_sfc_main$1, {
|
|
52
|
+
key: 0,
|
|
53
|
+
disabled: unref(disabled),
|
|
54
|
+
"list-type": _ctx.listType,
|
|
55
|
+
files: unref(uploadFiles),
|
|
56
|
+
"handle-preview": _ctx.onPreview,
|
|
57
|
+
onRemove: unref(handleRemove)
|
|
58
|
+
}, createSlots({ _: 2 }, [
|
|
59
|
+
_ctx.$slots.file ? {
|
|
60
|
+
name: "default",
|
|
61
|
+
fn: withCtx(({ file }) => [
|
|
62
|
+
renderSlot(_ctx.$slots, "file", { file })
|
|
63
|
+
])
|
|
64
|
+
} : void 0
|
|
65
|
+
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true),
|
|
66
|
+
createVNode(_sfc_main$2, {
|
|
67
|
+
ref_key: "uploadRef",
|
|
68
|
+
ref: uploadRef,
|
|
69
|
+
type: _ctx.type,
|
|
70
|
+
drag: _ctx.drag,
|
|
71
|
+
action: _ctx.action,
|
|
72
|
+
multiple: _ctx.multiple,
|
|
73
|
+
"with-credentials": _ctx.withCredentials,
|
|
74
|
+
headers: _ctx.headers,
|
|
75
|
+
method: _ctx.method,
|
|
76
|
+
name: _ctx.name,
|
|
77
|
+
data: _ctx.data,
|
|
78
|
+
accept: _ctx.accept,
|
|
79
|
+
"file-list": unref(uploadFiles),
|
|
80
|
+
"auto-upload": _ctx.autoUpload,
|
|
81
|
+
"list-type": _ctx.listType,
|
|
82
|
+
disabled: unref(disabled),
|
|
83
|
+
limit: _ctx.limit,
|
|
84
|
+
"http-request": _ctx.httpRequest,
|
|
85
|
+
"before-upload": _ctx.beforeUpload,
|
|
86
|
+
"on-exceed": _ctx.onExceed,
|
|
87
|
+
"on-start": unref(handleStart),
|
|
88
|
+
"on-progress": unref(handleProgress),
|
|
89
|
+
"on-success": unref(handleSuccess),
|
|
90
|
+
"on-error": unref(handleError),
|
|
91
|
+
"on-remove": unref(handleRemove)
|
|
92
|
+
}, {
|
|
93
|
+
default: withCtx(() => [
|
|
94
|
+
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
|
|
95
|
+
!_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
|
|
96
|
+
]),
|
|
97
|
+
_: 3
|
|
98
|
+
}, 8, ["type", "drag", "action", "multiple", "with-credentials", "headers", "method", "name", "data", "accept", "file-list", "auto-upload", "list-type", "disabled", "limit", "http-request", "before-upload", "on-exceed", "on-start", "on-progress", "on-success", "on-error", "on-remove"]),
|
|
99
|
+
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true),
|
|
100
|
+
renderSlot(_ctx.$slots, "tip"),
|
|
101
|
+
!unref(isPictureCard) && _ctx.showFileList ? (openBlock(), createBlock(_sfc_main$1, {
|
|
102
|
+
key: 2,
|
|
103
|
+
disabled: unref(disabled),
|
|
104
|
+
"list-type": _ctx.listType,
|
|
105
|
+
files: unref(uploadFiles),
|
|
106
|
+
"handle-preview": _ctx.onPreview,
|
|
107
|
+
onRemove: unref(handleRemove)
|
|
108
|
+
}, createSlots({ _: 2 }, [
|
|
109
|
+
_ctx.$slots.file ? {
|
|
110
|
+
name: "default",
|
|
111
|
+
fn: withCtx(({ file }) => [
|
|
112
|
+
renderSlot(_ctx.$slots, "file", { file })
|
|
113
|
+
])
|
|
114
|
+
} : void 0
|
|
115
|
+
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true)
|
|
116
|
+
]);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
export { _sfc_main as default };
|
|
122
|
+
//# sourceMappingURL=upload2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload2.mjs","sources":["../../../../../../packages/components/upload/src/upload.vue"],"sourcesContent":["<template>\n <div>\n <upload-list\n v-if=\"isPictureCard && showFileList\"\n :disabled=\"disabled\"\n :list-type=\"listType\"\n :files=\"uploadFiles\"\n :handle-preview=\"onPreview\"\n @remove=\"handleRemove\"\n >\n <template v-if=\"$slots.file\" #default=\"{ file }\">\n <slot name=\"file\" :file=\"file\"></slot>\n </template>\n </upload-list>\n <upload-content\n ref=\"uploadRef\"\n :type=\"type\"\n :drag=\"drag\"\n :action=\"action\"\n :multiple=\"multiple\"\n :with-credentials=\"withCredentials\"\n :headers=\"headers\"\n :method=\"method\"\n :name=\"name\"\n :data=\"data\"\n :accept=\"accept\"\n :file-list=\"uploadFiles\"\n :auto-upload=\"autoUpload\"\n :list-type=\"listType\"\n :disabled=\"disabled\"\n :limit=\"limit\"\n :http-request=\"httpRequest\"\n :before-upload=\"beforeUpload\"\n :on-exceed=\"onExceed\"\n :on-start=\"handleStart\"\n :on-progress=\"handleProgress\"\n :on-success=\"handleSuccess\"\n :on-error=\"handleError\"\n :on-remove=\"handleRemove\"\n >\n <template #default>\n <slot v-if=\"$slots.trigger\" name=\"trigger\" />\n <slot v-if=\"!$slots.trigger && $slots.default\" />\n </template>\n </upload-content>\n <slot v-if=\"$slots.trigger\" />\n <slot name=\"tip\" />\n <upload-list\n v-if=\"!isPictureCard && showFileList\"\n :disabled=\"disabled\"\n :list-type=\"listType\"\n :files=\"uploadFiles\"\n :handle-preview=\"onPreview\"\n @remove=\"handleRemove\"\n >\n <template v-if=\"$slots.file\" #default=\"{ file }\">\n <slot name=\"file\" :file=\"file\" />\n </template>\n </upload-list>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, provide, onBeforeUnmount, toRef, shallowRef } from 'vue'\nimport { uploadContextKey } from '@element-plus/tokens'\nimport { useDisabled } from '@element-plus/hooks'\n\nimport UploadList from './upload-list.vue'\nimport UploadContent from './upload-content.vue'\nimport { useHandlers } from './use-handlers'\nimport { uploadProps } from './upload'\nimport type { UploadContentInstance } from './upload-content'\n\ndefineOptions({\n name: 'ElUpload',\n})\n\nconst props = defineProps(uploadProps)\nconst disabled = useDisabled()\n\nconst uploadRef = shallowRef<UploadContentInstance>()\nconst {\n abort,\n submit,\n clearFiles,\n uploadFiles,\n handleStart,\n handleError,\n handleRemove,\n handleSuccess,\n handleProgress,\n} = useHandlers(props, uploadRef)\n\nconst isPictureCard = computed(() => props.listType === 'picture-card')\n\nonBeforeUnmount(() => {\n uploadFiles.value.forEach(({ url }) => {\n if (url?.startsWith('blob:')) URL.revokeObjectURL(url)\n })\n})\n\nprovide(uploadContextKey, {\n accept: toRef(props, 'accept'),\n})\n\ndefineExpose({\n /** @description cancel upload request */\n abort,\n /** @description upload the file list manually */\n submit,\n /** @description clear the file list */\n clearFiles,\n /** @description select the file manually */\n handleStart,\n /** @description remove the file manually */\n handleRemove,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA6EA;AAEA;AACA;;;;;;;;;;;AAYA;AAEA;;;;;;AAMA;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { ShallowRef } from 'vue';
|
|
3
|
+
import type { UploadContentInstance } from './upload-content';
|
|
4
|
+
import type { UploadRawFile, UploadFile, UploadProps, UploadStatus } from './upload';
|
|
5
|
+
export declare const useHandlers: (props: UploadProps, uploadRef: ShallowRef<UploadContentInstance | undefined>) => {
|
|
4
6
|
abort: (file: UploadFile) => void;
|
|
5
|
-
clearFiles: (
|
|
6
|
-
handleError: (err:
|
|
7
|
-
handleProgress: (
|
|
8
|
-
handleStart: (rawFile:
|
|
9
|
-
handleSuccess: (
|
|
10
|
-
handleRemove: (file: UploadFile,
|
|
7
|
+
clearFiles: (states?: UploadStatus[]) => void;
|
|
8
|
+
handleError: (err: import("./ajax").UploadAjaxError, rawFile: UploadRawFile) => void;
|
|
9
|
+
handleProgress: (evt: import("./upload").UploadProgressEvent, rawFile: UploadRawFile) => void;
|
|
10
|
+
handleStart: (rawFile: UploadRawFile) => void;
|
|
11
|
+
handleSuccess: (response: any, rawFile: UploadRawFile) => unknown;
|
|
12
|
+
handleRemove: (file: UploadFile | UploadRawFile, rawFile?: UploadRawFile | undefined) => void;
|
|
11
13
|
submit: () => void;
|
|
12
14
|
uploadFiles: import("vue").Ref<{
|
|
13
15
|
name: string;
|
|
@@ -42,9 +44,4 @@ declare const _default: (props: IUseHandlersProps) => {
|
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
46
|
}[]>;
|
|
45
|
-
uploadRef: import("vue").Ref<{
|
|
46
|
-
abort: (file: UploadFile) => void;
|
|
47
|
-
upload: (file: ElFile) => void;
|
|
48
|
-
}>;
|
|
49
47
|
};
|
|
50
|
-
export default _default;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { ref, watch } from 'vue';
|
|
2
|
+
import '../../../utils/index.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import { genFileId } from './upload.mjs';
|
|
5
|
+
import { debugWarn, throwError } from '../../../utils/error.mjs';
|
|
6
|
+
import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
|
|
7
|
+
|
|
8
|
+
const SCOPE = "ElUpload";
|
|
9
|
+
const revokeObjectURL = (file) => {
|
|
10
|
+
var _a;
|
|
11
|
+
if ((_a = file.url) == null ? void 0 : _a.startsWith("blob:")) {
|
|
12
|
+
URL.revokeObjectURL(file.url);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const useHandlers = (props, uploadRef) => {
|
|
16
|
+
const uploadFiles = ref([]);
|
|
17
|
+
const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid);
|
|
18
|
+
function abort(file) {
|
|
19
|
+
var _a;
|
|
20
|
+
(_a = uploadRef.value) == null ? void 0 : _a.abort(file);
|
|
21
|
+
}
|
|
22
|
+
function clearFiles(states = ["ready", "uploading", "success", "fail"]) {
|
|
23
|
+
uploadFiles.value = uploadFiles.value.filter((row) => !states.includes(row.status));
|
|
24
|
+
}
|
|
25
|
+
const handleError = (err, rawFile) => {
|
|
26
|
+
const file = getFile(rawFile);
|
|
27
|
+
if (!file)
|
|
28
|
+
return;
|
|
29
|
+
file.status = "fail";
|
|
30
|
+
uploadFiles.value.splice(uploadFiles.value.indexOf(file), 1);
|
|
31
|
+
props.onError(err, file, uploadFiles.value);
|
|
32
|
+
props.onChange(file, uploadFiles.value);
|
|
33
|
+
};
|
|
34
|
+
const handleProgress = (evt, rawFile) => {
|
|
35
|
+
const file = getFile(rawFile);
|
|
36
|
+
if (!file)
|
|
37
|
+
return;
|
|
38
|
+
props.onProgress(evt, file, uploadFiles.value);
|
|
39
|
+
file.status = "uploading";
|
|
40
|
+
file.percentage = evt.percent;
|
|
41
|
+
};
|
|
42
|
+
const handleSuccess = (response, rawFile) => {
|
|
43
|
+
const file = getFile(rawFile);
|
|
44
|
+
if (!file)
|
|
45
|
+
return;
|
|
46
|
+
file.status = "success";
|
|
47
|
+
file.response = response;
|
|
48
|
+
props.onSuccess(response, file, uploadFiles.value);
|
|
49
|
+
props.onChange(file, uploadFiles.value);
|
|
50
|
+
};
|
|
51
|
+
const handleStart = (file) => {
|
|
52
|
+
const uploadFile = {
|
|
53
|
+
name: file.name,
|
|
54
|
+
percentage: 0,
|
|
55
|
+
status: "ready",
|
|
56
|
+
size: file.size,
|
|
57
|
+
raw: file,
|
|
58
|
+
uid: file.uid
|
|
59
|
+
};
|
|
60
|
+
if (props.listType === "picture-card" || props.listType === "picture") {
|
|
61
|
+
try {
|
|
62
|
+
uploadFile.url = URL.createObjectURL(file);
|
|
63
|
+
} catch (err) {
|
|
64
|
+
debugWarn(SCOPE, err.message);
|
|
65
|
+
props.onError(err, uploadFile, uploadFiles.value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
uploadFiles.value.push(uploadFile);
|
|
69
|
+
props.onChange(uploadFile, uploadFiles.value);
|
|
70
|
+
};
|
|
71
|
+
const handleRemove = async (file, rawFile) => {
|
|
72
|
+
if (rawFile) {
|
|
73
|
+
useDeprecated({
|
|
74
|
+
scope: SCOPE,
|
|
75
|
+
from: "handleRemove second argument",
|
|
76
|
+
version: "2.2",
|
|
77
|
+
replacement: "first argument `file`",
|
|
78
|
+
ref: "https://element-plus.org/en-US/component/upload.html#methods"
|
|
79
|
+
}, true);
|
|
80
|
+
}
|
|
81
|
+
const _file = rawFile || file;
|
|
82
|
+
const uploadFile = _file instanceof File ? getFile(_file) : _file;
|
|
83
|
+
if (!uploadFile)
|
|
84
|
+
throwError(SCOPE, "file to be removed not found");
|
|
85
|
+
const doRemove = (file2) => {
|
|
86
|
+
abort(file2);
|
|
87
|
+
const fileList = uploadFiles.value;
|
|
88
|
+
fileList.splice(fileList.indexOf(file2), 1);
|
|
89
|
+
props.onRemove(file2, fileList);
|
|
90
|
+
revokeObjectURL(file2);
|
|
91
|
+
};
|
|
92
|
+
if (props.beforeRemove) {
|
|
93
|
+
const before = await props.beforeRemove(uploadFile, uploadFiles.value);
|
|
94
|
+
if (before !== false)
|
|
95
|
+
doRemove(uploadFile);
|
|
96
|
+
} else {
|
|
97
|
+
doRemove(uploadFile);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
function submit() {
|
|
101
|
+
uploadFiles.value.filter(({ status }) => status === "ready").forEach(({ raw }) => {
|
|
102
|
+
var _a;
|
|
103
|
+
return (_a = uploadRef.value) == null ? void 0 : _a.upload(raw);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
watch(() => props.listType, (val) => {
|
|
107
|
+
if (val !== "picture-card" && val !== "picture") {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
uploadFiles.value = uploadFiles.value.map((file) => {
|
|
111
|
+
const { raw, url } = file;
|
|
112
|
+
if (!url && raw) {
|
|
113
|
+
try {
|
|
114
|
+
file.url = URL.createObjectURL(raw);
|
|
115
|
+
} catch (err) {
|
|
116
|
+
props.onError(err, file, uploadFiles.value);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return file;
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
watch(() => props.fileList, (fileList) => {
|
|
123
|
+
for (const file of fileList) {
|
|
124
|
+
file.uid = genFileId();
|
|
125
|
+
file.status || (file.status = "success");
|
|
126
|
+
}
|
|
127
|
+
}, { immediate: true });
|
|
128
|
+
return {
|
|
129
|
+
abort,
|
|
130
|
+
clearFiles,
|
|
131
|
+
handleError,
|
|
132
|
+
handleProgress,
|
|
133
|
+
handleStart,
|
|
134
|
+
handleSuccess,
|
|
135
|
+
handleRemove,
|
|
136
|
+
submit,
|
|
137
|
+
uploadFiles
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export { useHandlers };
|
|
142
|
+
//# sourceMappingURL=use-handlers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-handlers.mjs","sources":["../../../../../../packages/components/upload/src/use-handlers.ts"],"sourcesContent":["import { ref, watch } from 'vue'\nimport { debugWarn, throwError } from '@element-plus/utils'\nimport { useDeprecated } from '@element-plus/hooks'\nimport { genFileId } from './upload'\nimport type { ShallowRef } from 'vue'\nimport type {\n UploadContentProps,\n UploadContentInstance,\n} from './upload-content'\nimport type {\n UploadRawFile,\n UploadFile,\n UploadProps,\n UploadStatus,\n UploadFiles,\n} from './upload'\n\nconst SCOPE = 'ElUpload'\n\nconst revokeObjectURL = (file: UploadFile) => {\n if (file.url?.startsWith('blob:')) {\n URL.revokeObjectURL(file.url)\n }\n}\n\nexport const useHandlers = (\n props: UploadProps,\n uploadRef: ShallowRef<UploadContentInstance | undefined>\n) => {\n const uploadFiles = ref<UploadFiles>([])\n\n const getFile = (rawFile: UploadRawFile) =>\n uploadFiles.value.find((file) => file.uid === rawFile.uid)\n\n function abort(file: UploadFile) {\n uploadRef.value?.abort(file)\n }\n\n function clearFiles(\n /** @default ['ready', 'uploading', 'success', 'fail'] */\n states: UploadStatus[] = ['ready', 'uploading', 'success', 'fail']\n ) {\n uploadFiles.value = uploadFiles.value.filter(\n (row) => !states.includes(row.status)\n )\n }\n\n const handleError: UploadContentProps['onError'] = (err, rawFile) => {\n const file = getFile(rawFile)\n if (!file) return\n\n file.status = 'fail'\n uploadFiles.value.splice(uploadFiles.value.indexOf(file), 1)\n props.onError(err, file, uploadFiles.value)\n props.onChange(file, uploadFiles.value)\n }\n\n const handleProgress: UploadContentProps['onProgress'] = (evt, rawFile) => {\n const file = getFile(rawFile)\n if (!file) return\n\n props.onProgress(evt, file, uploadFiles.value)\n file.status = 'uploading'\n file.percentage = evt.percent\n }\n\n const handleSuccess: UploadContentProps['onSuccess'] = (\n response,\n rawFile\n ) => {\n const file = getFile(rawFile)\n if (!file) return\n\n file.status = 'success'\n file.response = response\n props.onSuccess(response, file, uploadFiles.value)\n props.onChange(file, uploadFiles.value)\n }\n\n const handleStart: UploadContentProps['onStart'] = (file) => {\n const uploadFile: UploadFile = {\n name: file.name,\n percentage: 0,\n status: 'ready',\n size: file.size,\n raw: file,\n uid: file.uid,\n }\n if (props.listType === 'picture-card' || props.listType === 'picture') {\n try {\n uploadFile.url = URL.createObjectURL(file)\n } catch (err: unknown) {\n debugWarn(SCOPE, (err as Error).message)\n props.onError(err as Error, uploadFile, uploadFiles.value)\n }\n }\n uploadFiles.value.push(uploadFile)\n props.onChange(uploadFile, uploadFiles.value)\n }\n\n const handleRemove: UploadContentProps['onRemove'] = async (\n file,\n rawFile // TODO: deprecated in 2.2\n ): Promise<void> => {\n if (rawFile) {\n useDeprecated(\n {\n scope: SCOPE,\n from: 'handleRemove second argument',\n version: '2.2',\n replacement: 'first argument `file`',\n ref: 'https://element-plus.org/en-US/component/upload.html#methods',\n },\n true\n )\n }\n\n const _file = rawFile || file\n const uploadFile = _file instanceof File ? getFile(_file) : _file\n if (!uploadFile) throwError(SCOPE, 'file to be removed not found')\n\n const doRemove = (file: UploadFile) => {\n abort(file)\n const fileList = uploadFiles.value\n fileList.splice(fileList.indexOf(file), 1)\n props.onRemove(file, fileList)\n revokeObjectURL(file)\n }\n\n if (props.beforeRemove) {\n const before = await props.beforeRemove(uploadFile, uploadFiles.value)\n if (before !== false) doRemove(uploadFile)\n } else {\n doRemove(uploadFile)\n }\n }\n\n function submit() {\n uploadFiles.value\n .filter(({ status }) => status === 'ready')\n .forEach(({ raw }) => uploadRef.value?.upload(raw))\n }\n\n watch(\n () => props.listType,\n (val) => {\n if (val !== 'picture-card' && val !== 'picture') {\n return\n }\n\n uploadFiles.value = uploadFiles.value.map((file) => {\n const { raw, url } = file\n if (!url && raw) {\n try {\n file.url = URL.createObjectURL(raw)\n } catch (err: unknown) {\n props.onError(err as Error, file, uploadFiles.value)\n }\n }\n return file\n })\n }\n )\n\n watch(\n () => props.fileList,\n (fileList) => {\n for (const file of fileList) {\n file.uid = genFileId()\n file.status ||= 'success'\n }\n },\n { immediate: true }\n )\n\n return {\n abort,\n clearFiles,\n handleError,\n handleProgress,\n handleStart,\n handleSuccess,\n handleRemove,\n submit,\n uploadFiles,\n }\n}\n"],"names":[],"mappings":";;;;;;;AAIA,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,eAAe,GAAG,CAAC,IAAI,KAAK;AAClC,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AACjE,IAAI,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,GAAG;AACH,CAAC,CAAC;AACU,MAAC,WAAW,GAAG,CAAC,KAAK,EAAE,SAAS,K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I,CAAC,GAAG,IAAI,GAAG,EAAE;AACvB,QAAQ,IAAI;AACZ,UAAU,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;AAC9C,SAAS,CAAC,OAAO,GAAG,EAAE;AACtB,UAAU,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AACtD,SAAS;AACT,OAAO;AACP,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,KAAK;AAC5C,IAAI,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE;AACjC,MAAM,IAAI,CAAC,GAAG,GAAG,SAAS,EAAE,CAAC;AAC7B,MAAM,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAC/C,KAAK;AACL,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1B,EAAE,OAAO;AACT,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,WAAW;AACf,IAAI,cAAc;AAClB,IAAI,WAAW;AACf,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,MAAM;AACV,IAAI,WAAW;AACf,GAAG,CAAC;AACJ;;;;"}
|
package/es/index.mjs
CHANGED
|
@@ -145,6 +145,10 @@ export { CHANGE_EVENT } from './constants/event.mjs';
|
|
|
145
145
|
export { ElTransfer } from './components/transfer/index.mjs';
|
|
146
146
|
export { ElTree } from './components/tree/index.mjs';
|
|
147
147
|
export { ElTreeV2 } from './components/tree-v2/index.mjs';
|
|
148
|
+
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './components/upload/src/upload.mjs';
|
|
149
|
+
export { uploadContentProps } from './components/upload/src/upload-content.mjs';
|
|
150
|
+
export { uploadListEmits, uploadListProps } from './components/upload/src/upload-list.mjs';
|
|
151
|
+
export { uploadDraggerEmits, uploadDraggerProps } from './components/upload/src/upload-dragger.mjs';
|
|
148
152
|
export { ElUpload } from './components/upload/index.mjs';
|
|
149
153
|
export { default as FixedSizeList } from './components/virtual-list/src/components/fixed-size-list.mjs';
|
|
150
154
|
export { default as DynamicSizeList } from './components/virtual-list/src/components/dynamic-size-list.mjs';
|
|
@@ -201,6 +205,7 @@ export { elPaginationKey } from './tokens/pagination.mjs';
|
|
|
201
205
|
export { radioGroupKey } from './tokens/radio.mjs';
|
|
202
206
|
export { scrollbarContextKey } from './tokens/scrollbar.mjs';
|
|
203
207
|
export { tabsRootContextKey } from './tokens/tabs.mjs';
|
|
208
|
+
export { uploadContextKey } from './tokens/upload.mjs';
|
|
204
209
|
|
|
205
210
|
const install = installer.install;
|
|
206
211
|
const version = installer.version;
|
package/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
|
package/es/tokens/index.d.ts
CHANGED
package/es/tokens/index.mjs
CHANGED
|
@@ -8,4 +8,5 @@ export { elPaginationKey } from './pagination.mjs';
|
|
|
8
8
|
export { radioGroupKey } from './radio.mjs';
|
|
9
9
|
export { scrollbarContextKey } from './scrollbar.mjs';
|
|
10
10
|
export { tabsRootContextKey } from './tabs.mjs';
|
|
11
|
+
export { uploadContextKey } from './upload.mjs';
|
|
11
12
|
//# sourceMappingURL=index.mjs.map
|
package/es/tokens/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.mjs","sources":["../../../../packages/tokens/upload.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey } from 'vue'\n\nexport interface UploadContext {\n accept: ComputedRef<string>\n}\n\nexport const uploadContextKey: InjectionKey<UploadContext> =\n Symbol('uploadContextKey')\n"],"names":[],"mappings":"AAAY,MAAC,gBAAgB,GAAG,MAAM,CAAC,kBAAkB;;;;"}
|
package/es/utils/typescript.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.mjs","sources":["../../../../packages/utils/typescript.ts"],"sourcesContent":["export const mutable = <T extends readonly any[] | Record<string, unknown>>(\n val: T\n) => val as Mutable<typeof val>\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] }\n\nexport type HTMLElementCustomized<T> = HTMLElement & T\n\n/**\n * @deprecated stop to use null\n * @see {@link https://github.com/sindresorhus/meta/discussions/7}\n */\nexport type Nullable<T> = T | null\n\nexport type Arrayable<T> = T | T[]\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK;;;;"}
|
|
1
|
+
{"version":3,"file":"typescript.mjs","sources":["../../../../packages/utils/typescript.ts"],"sourcesContent":["export const mutable = <T extends readonly any[] | Record<string, unknown>>(\n val: T\n) => val as Mutable<typeof val>\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] }\n\nexport type HTMLElementCustomized<T> = HTMLElement & T\n\n/**\n * @deprecated stop to use null\n * @see {@link https://github.com/sindresorhus/meta/discussions/7}\n */\nexport type Nullable<T> = T | null\n\nexport type Arrayable<T> = T | T[]\nexport type Awaitable<T> = Promise<T> | T\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK;;;;"}
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20220305";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220305'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
package/lib/components/index.js
CHANGED
|
@@ -150,6 +150,10 @@ var timelineItem = require('./timeline/src/timeline-item.js');
|
|
|
150
150
|
var tooltip = require('./tooltip/src/tooltip.js');
|
|
151
151
|
var tokens$2 = require('./tooltip/src/tokens.js');
|
|
152
152
|
var event = require('../constants/event.js');
|
|
153
|
+
var upload = require('./upload/src/upload.js');
|
|
154
|
+
var uploadContent = require('./upload/src/upload-content.js');
|
|
155
|
+
var uploadList = require('./upload/src/upload-list.js');
|
|
156
|
+
var uploadDragger = require('./upload/src/upload-dragger.js');
|
|
153
157
|
var fixedSizeList = require('./virtual-list/src/components/fixed-size-list.js');
|
|
154
158
|
var dynamicSizeList = require('./virtual-list/src/components/dynamic-size-list.js');
|
|
155
159
|
var fixedSizeGrid = require('./virtual-list/src/components/fixed-size-grid.js');
|
|
@@ -399,6 +403,15 @@ exports.useTooltipProps = tooltip.useTooltipProps;
|
|
|
399
403
|
exports.useTooltipTriggerProps = tooltip.useTooltipTriggerProps;
|
|
400
404
|
exports.TOOLTIP_INJECTION_KEY = tokens$2.TOOLTIP_INJECTION_KEY;
|
|
401
405
|
exports.CHANGE_EVENT = event.CHANGE_EVENT;
|
|
406
|
+
exports.genFileId = upload.genFileId;
|
|
407
|
+
exports.uploadBaseProps = upload.uploadBaseProps;
|
|
408
|
+
exports.uploadListTypes = upload.uploadListTypes;
|
|
409
|
+
exports.uploadProps = upload.uploadProps;
|
|
410
|
+
exports.uploadContentProps = uploadContent.uploadContentProps;
|
|
411
|
+
exports.uploadListEmits = uploadList.uploadListEmits;
|
|
412
|
+
exports.uploadListProps = uploadList.uploadListProps;
|
|
413
|
+
exports.uploadDraggerEmits = uploadDragger.uploadDraggerEmits;
|
|
414
|
+
exports.uploadDraggerProps = uploadDragger.uploadDraggerProps;
|
|
402
415
|
exports.FixedSizeList = fixedSizeList["default"];
|
|
403
416
|
exports.DynamicSizeList = dynamicSizeList["default"];
|
|
404
417
|
exports.FixedSizeGrid = fixedSizeGrid["default"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,6 +7,7 @@ require('./src/message-box.type.js');
|
|
|
7
7
|
|
|
8
8
|
const _MessageBox = messageBox["default"];
|
|
9
9
|
_MessageBox.install = (app) => {
|
|
10
|
+
_MessageBox._context = app._context;
|
|
10
11
|
app.config.globalProperties.$msgbox = _MessageBox;
|
|
11
12
|
app.config.globalProperties.$messageBox = _MessageBox;
|
|
12
13
|
app.config.globalProperties.$alert = _MessageBox.alert;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/message-box/index.ts"],"sourcesContent":["import MessageBox from './src/messageBox'\n\nimport type { App } from 'vue'\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nconst _MessageBox = MessageBox as SFCWithInstall<typeof MessageBox>\n\n_MessageBox.install = (app: App) => {\n app.config.globalProperties.$msgbox = _MessageBox\n app.config.globalProperties.$messageBox = _MessageBox\n app.config.globalProperties.$alert = _MessageBox.alert\n app.config.globalProperties.$confirm = _MessageBox.confirm\n app.config.globalProperties.$prompt = _MessageBox.prompt\n}\n\nexport default _MessageBox\nexport const ElMessageBox = _MessageBox\n\nexport * from './src/message-box.type'\n"],"names":["MessageBox"],"mappings":";;;;;;;AACK,MAAC,WAAW,GAAGA,sBAAW;AAC/B,WAAW,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC;AACpD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,GAAG,WAAW,CAAC;AACxD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC;AACzD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;AAC7D,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC;AAC3D,CAAC,CAAC;AAEU,MAAC,YAAY,GAAG;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/message-box/index.ts"],"sourcesContent":["import MessageBox from './src/messageBox'\n\nimport type { App } from 'vue'\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nconst _MessageBox = MessageBox as SFCWithInstall<typeof MessageBox>\n\n_MessageBox.install = (app: App) => {\n _MessageBox._context = app._context\n app.config.globalProperties.$msgbox = _MessageBox\n app.config.globalProperties.$messageBox = _MessageBox\n app.config.globalProperties.$alert = _MessageBox.alert\n app.config.globalProperties.$confirm = _MessageBox.confirm\n app.config.globalProperties.$prompt = _MessageBox.prompt\n}\n\nexport default _MessageBox\nexport const ElMessageBox = _MessageBox\n\nexport * from './src/message-box.type'\n"],"names":["MessageBox"],"mappings":";;;;;;;AACK,MAAC,WAAW,GAAGA,sBAAW;AAC/B,WAAW,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,WAAW,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AACtC,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC;AACpD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,GAAG,WAAW,CAAC;AACxD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC;AACzD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;AAC7D,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC;AAC3D,CAAC,CAAC;AAEU,MAAC,YAAY,GAAG;;;;;"}
|
|
@@ -1858,8 +1858,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1858
1858
|
lockScroll: boolean;
|
|
1859
1859
|
modal: boolean;
|
|
1860
1860
|
container: string;
|
|
1861
|
-
closeOnHashChange: boolean;
|
|
1862
|
-
roundButton: boolean;
|
|
1863
1861
|
boxType: MessageBoxType;
|
|
1862
|
+
roundButton: boolean;
|
|
1863
|
+
closeOnHashChange: boolean;
|
|
1864
1864
|
}>;
|
|
1865
1865
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSProperties, VNode, Component } from 'vue';
|
|
1
|
+
import type { AppContext, CSSProperties, VNode, Component } from 'vue';
|
|
2
2
|
import type { ComponentSize } from 'element-plus/es/constants';
|
|
3
3
|
declare type MessageType = '' | 'success' | 'warning' | 'info' | 'error';
|
|
4
4
|
export declare type Action = 'confirm' | 'close' | 'cancel';
|
|
@@ -115,11 +115,12 @@ export interface ElMessageBoxOptions {
|
|
|
115
115
|
/** Custom size of confirm and cancel buttons */
|
|
116
116
|
buttonSize?: ComponentSize;
|
|
117
117
|
}
|
|
118
|
-
export declare type ElMessageBoxShortcutMethod = ((message: ElMessageBoxOptions['message'], title: ElMessageBoxOptions['title'], options?: ElMessageBoxOptions) => Promise<MessageBoxData>) & ((message: ElMessageBoxOptions['message'], options?: ElMessageBoxOptions) => Promise<MessageBoxData>);
|
|
118
|
+
export declare type ElMessageBoxShortcutMethod = ((message: ElMessageBoxOptions['message'], title: ElMessageBoxOptions['title'], options?: ElMessageBoxOptions, appContext?: AppContext | null) => Promise<MessageBoxData>) & ((message: ElMessageBoxOptions['message'], options?: ElMessageBoxOptions, appContext?: AppContext | null) => Promise<MessageBoxData>);
|
|
119
119
|
export interface IElMessageBox {
|
|
120
|
+
_context: AppContext | null;
|
|
120
121
|
/** Show a message box */
|
|
121
122
|
/** Show a message box */
|
|
122
|
-
(options: ElMessageBoxOptions): Promise<MessageBoxData>;
|
|
123
|
+
(options: ElMessageBoxOptions, appContext?: AppContext | null): Promise<MessageBoxData>;
|
|
123
124
|
/** Show an alert message box */
|
|
124
125
|
alert: ElMessageBoxShortcutMethod;
|
|
125
126
|
/** Show a confirm message box */
|