@element-plus/nightly 0.0.20240110 → 0.0.20240111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +46 -37
- 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 +46 -37
- 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-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.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/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.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/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.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/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.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/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb.mjs +36 -11
- package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb2.mjs +11 -36
- package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel.mjs +56 -169
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel2.mjs +169 -56
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +65 -227
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +227 -65
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +7 -7
- package/es/components/select/src/select2.mjs +25 -24
- package/es/components/select/src/select2.mjs.map +1 -1
- package/es/components/select/src/useSelect.mjs +15 -9
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +7 -5
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/tour/index.mjs +2 -2
- package/es/components/tour/src/tour.mjs +69 -146
- package/es/components/tour/src/tour.mjs.map +1 -1
- package/es/components/tour/src/tour2.mjs +146 -69
- package/es/components/tour/src/tour2.mjs.map +1 -1
- package/es/components/transfer/src/composables/use-check.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +19 -128
- package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel2.mjs +128 -19
- package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +1 -1
- package/es/components/upload/index.mjs +4 -4
- package/es/components/upload/src/upload-content.mjs +33 -194
- package/es/components/upload/src/upload-content.mjs.map +1 -1
- package/es/components/upload/src/upload-content2.mjs +194 -33
- package/es/components/upload/src/upload-content2.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger.mjs +11 -72
- package/es/components/upload/src/upload-dragger.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger2.mjs +72 -11
- package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +101 -116
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +116 -101
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/index.mjs +7 -7
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb.js +36 -11
- package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb2.js +11 -36
- package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel.js +57 -169
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel2.js +169 -57
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +65 -226
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +226 -65
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +7 -7
- package/lib/components/select/src/select2.js +24 -23
- package/lib/components/select/src/select2.js.map +1 -1
- package/lib/components/select/src/useSelect.js +13 -7
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/src/select.js +7 -5
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/tour/index.js +2 -2
- package/lib/components/tour/src/tour.js +69 -145
- package/lib/components/tour/src/tour.js.map +1 -1
- package/lib/components/tour/src/tour2.js +145 -69
- package/lib/components/tour/src/tour2.js.map +1 -1
- package/lib/components/transfer/src/composables/use-check.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +21 -128
- package/lib/components/transfer/src/transfer-panel.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel2.js +128 -21
- package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +1 -1
- package/lib/components/upload/index.js +4 -4
- package/lib/components/upload/src/upload-content.js +32 -193
- package/lib/components/upload/src/upload-content.js.map +1 -1
- package/lib/components/upload/src/upload-content2.js +193 -32
- package/lib/components/upload/src/upload-content2.js.map +1 -1
- package/lib/components/upload/src/upload-dragger.js +12 -72
- package/lib/components/upload/src/upload-dragger.js.map +1 -1
- package/lib/components/upload/src/upload-dragger2.js +72 -12
- package/lib/components/upload/src/upload-dragger2.js.map +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +104 -116
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +116 -104
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/index.js +7 -7
- 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/web-types.json +1 -1
|
@@ -1,133 +1,24 @@
|
|
|
1
|
-
import { defineComponent, useSlots, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createVNode, isRef, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, withDirectives, Fragment, renderList, vShow, renderSlot } from 'vue';
|
|
2
1
|
import '../../../utils/index.mjs';
|
|
3
|
-
import '
|
|
4
|
-
import {
|
|
5
|
-
import { ElInput } from '../../input/index.mjs';
|
|
6
|
-
import { Search } from '@element-plus/icons-vue';
|
|
7
|
-
import { transferPanelProps, transferPanelEmits } from './transfer-panel2.mjs';
|
|
8
|
-
import './composables/index.mjs';
|
|
9
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
10
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
11
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
12
|
-
import { usePropsAlias } from './composables/use-props-alias.mjs';
|
|
13
|
-
import { useCheck } from './composables/use-check.mjs';
|
|
14
|
-
import { isEmpty } from '../../../utils/types.mjs';
|
|
2
|
+
import { transferProps, transferCheckedChangeFn } from './transfer.mjs';
|
|
3
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
15
4
|
|
|
16
|
-
const
|
|
17
|
-
|
|
5
|
+
const CHECKED_CHANGE_EVENT = "checked-change";
|
|
6
|
+
const transferPanelProps = buildProps({
|
|
7
|
+
data: transferProps.data,
|
|
8
|
+
optionRender: {
|
|
9
|
+
type: definePropType(Function)
|
|
10
|
+
},
|
|
11
|
+
placeholder: String,
|
|
12
|
+
title: String,
|
|
13
|
+
filterable: Boolean,
|
|
14
|
+
format: transferProps.format,
|
|
15
|
+
filterMethod: transferProps.filterMethod,
|
|
16
|
+
defaultChecked: transferProps.leftDefaultChecked,
|
|
17
|
+
props: transferProps.props
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
emits: transferPanelEmits,
|
|
23
|
-
setup(__props, { expose, emit }) {
|
|
24
|
-
const props = __props;
|
|
25
|
-
const slots = useSlots();
|
|
26
|
-
const OptionContent = ({ option }) => option;
|
|
27
|
-
const { t } = useLocale();
|
|
28
|
-
const ns = useNamespace("transfer");
|
|
29
|
-
const panelState = reactive({
|
|
30
|
-
checked: [],
|
|
31
|
-
allChecked: false,
|
|
32
|
-
query: "",
|
|
33
|
-
checkChangeByUser: true
|
|
34
|
-
});
|
|
35
|
-
const propsAlias = usePropsAlias(props);
|
|
36
|
-
const {
|
|
37
|
-
filteredData,
|
|
38
|
-
checkedSummary,
|
|
39
|
-
isIndeterminate,
|
|
40
|
-
handleAllCheckedChange
|
|
41
|
-
} = useCheck(props, panelState, emit);
|
|
42
|
-
const hasNoMatch = computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
|
|
43
|
-
const hasFooter = computed(() => !isEmpty(slots.default()[0].children));
|
|
44
|
-
const { checked, allChecked, query } = toRefs(panelState);
|
|
45
|
-
expose({
|
|
46
|
-
query
|
|
47
|
-
});
|
|
48
|
-
return (_ctx, _cache) => {
|
|
49
|
-
return openBlock(), createElementBlock("div", {
|
|
50
|
-
class: normalizeClass(unref(ns).b("panel"))
|
|
51
|
-
}, [
|
|
52
|
-
createElementVNode("p", {
|
|
53
|
-
class: normalizeClass(unref(ns).be("panel", "header"))
|
|
54
|
-
}, [
|
|
55
|
-
createVNode(unref(ElCheckbox), {
|
|
56
|
-
modelValue: unref(allChecked),
|
|
57
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(allChecked) ? allChecked.value = $event : null),
|
|
58
|
-
indeterminate: unref(isIndeterminate),
|
|
59
|
-
"validate-event": false,
|
|
60
|
-
onChange: unref(handleAllCheckedChange)
|
|
61
|
-
}, {
|
|
62
|
-
default: withCtx(() => [
|
|
63
|
-
createTextVNode(toDisplayString(_ctx.title) + " ", 1),
|
|
64
|
-
createElementVNode("span", null, toDisplayString(unref(checkedSummary)), 1)
|
|
65
|
-
]),
|
|
66
|
-
_: 1
|
|
67
|
-
}, 8, ["modelValue", "indeterminate", "onChange"])
|
|
68
|
-
], 2),
|
|
69
|
-
createElementVNode("div", {
|
|
70
|
-
class: normalizeClass([unref(ns).be("panel", "body"), unref(ns).is("with-footer", unref(hasFooter))])
|
|
71
|
-
}, [
|
|
72
|
-
_ctx.filterable ? (openBlock(), createBlock(unref(ElInput), {
|
|
73
|
-
key: 0,
|
|
74
|
-
modelValue: unref(query),
|
|
75
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(query) ? query.value = $event : null),
|
|
76
|
-
class: normalizeClass(unref(ns).be("panel", "filter")),
|
|
77
|
-
size: "default",
|
|
78
|
-
placeholder: _ctx.placeholder,
|
|
79
|
-
"prefix-icon": unref(Search),
|
|
80
|
-
clearable: "",
|
|
81
|
-
"validate-event": false
|
|
82
|
-
}, null, 8, ["modelValue", "class", "placeholder", "prefix-icon"])) : createCommentVNode("v-if", true),
|
|
83
|
-
withDirectives(createVNode(unref(ElCheckboxGroup), {
|
|
84
|
-
modelValue: unref(checked),
|
|
85
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(checked) ? checked.value = $event : null),
|
|
86
|
-
"validate-event": false,
|
|
87
|
-
class: normalizeClass([unref(ns).is("filterable", _ctx.filterable), unref(ns).be("panel", "list")])
|
|
88
|
-
}, {
|
|
89
|
-
default: withCtx(() => [
|
|
90
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredData), (item) => {
|
|
91
|
-
return openBlock(), createBlock(unref(ElCheckbox), {
|
|
92
|
-
key: item[unref(propsAlias).key],
|
|
93
|
-
class: normalizeClass(unref(ns).be("panel", "item")),
|
|
94
|
-
label: item[unref(propsAlias).key],
|
|
95
|
-
disabled: item[unref(propsAlias).disabled],
|
|
96
|
-
"validate-event": false
|
|
97
|
-
}, {
|
|
98
|
-
default: withCtx(() => {
|
|
99
|
-
var _a;
|
|
100
|
-
return [
|
|
101
|
-
createVNode(OptionContent, {
|
|
102
|
-
option: (_a = _ctx.optionRender) == null ? void 0 : _a.call(_ctx, item)
|
|
103
|
-
}, null, 8, ["option"])
|
|
104
|
-
];
|
|
105
|
-
}),
|
|
106
|
-
_: 2
|
|
107
|
-
}, 1032, ["class", "label", "disabled"]);
|
|
108
|
-
}), 128))
|
|
109
|
-
]),
|
|
110
|
-
_: 1
|
|
111
|
-
}, 8, ["modelValue", "class"]), [
|
|
112
|
-
[vShow, !unref(hasNoMatch) && !unref(isEmpty)(_ctx.data)]
|
|
113
|
-
]),
|
|
114
|
-
withDirectives(createElementVNode("p", {
|
|
115
|
-
class: normalizeClass(unref(ns).be("panel", "empty"))
|
|
116
|
-
}, toDisplayString(unref(hasNoMatch) ? unref(t)("el.transfer.noMatch") : unref(t)("el.transfer.noData")), 3), [
|
|
117
|
-
[vShow, unref(hasNoMatch) || unref(isEmpty)(_ctx.data)]
|
|
118
|
-
])
|
|
119
|
-
], 2),
|
|
120
|
-
unref(hasFooter) ? (openBlock(), createElementBlock("p", {
|
|
121
|
-
key: 0,
|
|
122
|
-
class: normalizeClass(unref(ns).be("panel", "footer"))
|
|
123
|
-
}, [
|
|
124
|
-
renderSlot(_ctx.$slots, "default")
|
|
125
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
126
|
-
], 2);
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
var TransferPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "transfer-panel.vue"]]);
|
|
19
|
+
const transferPanelEmits = {
|
|
20
|
+
[CHECKED_CHANGE_EVENT]: transferCheckedChangeFn
|
|
21
|
+
};
|
|
131
22
|
|
|
132
|
-
export {
|
|
23
|
+
export { CHECKED_CHANGE_EVENT, transferPanelEmits, transferPanelProps };
|
|
133
24
|
//# sourceMappingURL=transfer-panel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer-panel.mjs","sources":["../../../../../../packages/components/transfer/src/transfer-panel.
|
|
1
|
+
{"version":3,"file":"transfer-panel.mjs","sources":["../../../../../../packages/components/transfer/src/transfer-panel.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { transferCheckedChangeFn, transferProps } from './transfer'\n\nimport type { ExtractPropTypes, VNode } from 'vue'\nimport type { TransferDataItem, TransferKey } from './transfer'\nimport type TransferPanel from './transfer-panel.vue'\n\nexport interface TransferPanelState {\n checked: TransferKey[]\n allChecked: boolean\n query: string\n checkChangeByUser: boolean\n}\n\nexport const CHECKED_CHANGE_EVENT = 'checked-change'\n\nexport const transferPanelProps = buildProps({\n data: transferProps.data,\n optionRender: {\n type: definePropType<(option: TransferDataItem) => VNode | VNode[]>(\n Function\n ),\n },\n placeholder: String,\n title: String,\n filterable: Boolean,\n format: transferProps.format,\n filterMethod: transferProps.filterMethod,\n defaultChecked: transferProps.leftDefaultChecked,\n props: transferProps.props,\n} as const)\nexport type TransferPanelProps = ExtractPropTypes<typeof transferPanelProps>\n\nexport const transferPanelEmits = {\n [CHECKED_CHANGE_EVENT]: transferCheckedChangeFn,\n}\nexport type TransferPanelEmits = typeof transferPanelEmits\n\nexport type TransferPanelInstance = InstanceType<typeof TransferPanel>\n"],"names":[],"mappings":";;;;AAEY,MAAC,oBAAoB,GAAG,iBAAiB;AACzC,MAAC,kBAAkB,GAAG,UAAU,CAAC;AAC7C,EAAE,IAAI,EAAE,aAAa,CAAC,IAAI;AAC1B,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM;AAC9B,EAAE,YAAY,EAAE,aAAa,CAAC,YAAY;AAC1C,EAAE,cAAc,EAAE,aAAa,CAAC,kBAAkB;AAClD,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK;AAC5B,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG;AAClC,EAAE,CAAC,oBAAoB,GAAG,uBAAuB;AACjD;;;;"}
|
|
@@ -1,24 +1,133 @@
|
|
|
1
|
+
import { defineComponent, useSlots, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createVNode, isRef, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, withDirectives, Fragment, renderList, vShow, renderSlot } from 'vue';
|
|
1
2
|
import '../../../utils/index.mjs';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import { ElCheckbox, ElCheckboxGroup } from '../../checkbox/index.mjs';
|
|
5
|
+
import { ElInput } from '../../input/index.mjs';
|
|
6
|
+
import { Search } from '@element-plus/icons-vue';
|
|
7
|
+
import { transferPanelProps, transferPanelEmits } from './transfer-panel.mjs';
|
|
8
|
+
import './composables/index.mjs';
|
|
9
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
10
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
11
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
12
|
+
import { usePropsAlias } from './composables/use-props-alias.mjs';
|
|
13
|
+
import { useCheck } from './composables/use-check.mjs';
|
|
14
|
+
import { isEmpty } from '../../../utils/types.mjs';
|
|
4
15
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
data: transferProps.data,
|
|
8
|
-
optionRender: {
|
|
9
|
-
type: definePropType(Function)
|
|
10
|
-
},
|
|
11
|
-
placeholder: String,
|
|
12
|
-
title: String,
|
|
13
|
-
filterable: Boolean,
|
|
14
|
-
format: transferProps.format,
|
|
15
|
-
filterMethod: transferProps.filterMethod,
|
|
16
|
-
defaultChecked: transferProps.leftDefaultChecked,
|
|
17
|
-
props: transferProps.props
|
|
16
|
+
const __default__ = defineComponent({
|
|
17
|
+
name: "ElTransferPanel"
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
|
+
...__default__,
|
|
21
|
+
props: transferPanelProps,
|
|
22
|
+
emits: transferPanelEmits,
|
|
23
|
+
setup(__props, { expose, emit }) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const slots = useSlots();
|
|
26
|
+
const OptionContent = ({ option }) => option;
|
|
27
|
+
const { t } = useLocale();
|
|
28
|
+
const ns = useNamespace("transfer");
|
|
29
|
+
const panelState = reactive({
|
|
30
|
+
checked: [],
|
|
31
|
+
allChecked: false,
|
|
32
|
+
query: "",
|
|
33
|
+
checkChangeByUser: true
|
|
34
|
+
});
|
|
35
|
+
const propsAlias = usePropsAlias(props);
|
|
36
|
+
const {
|
|
37
|
+
filteredData,
|
|
38
|
+
checkedSummary,
|
|
39
|
+
isIndeterminate,
|
|
40
|
+
handleAllCheckedChange
|
|
41
|
+
} = useCheck(props, panelState, emit);
|
|
42
|
+
const hasNoMatch = computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
|
|
43
|
+
const hasFooter = computed(() => !isEmpty(slots.default()[0].children));
|
|
44
|
+
const { checked, allChecked, query } = toRefs(panelState);
|
|
45
|
+
expose({
|
|
46
|
+
query
|
|
47
|
+
});
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return openBlock(), createElementBlock("div", {
|
|
50
|
+
class: normalizeClass(unref(ns).b("panel"))
|
|
51
|
+
}, [
|
|
52
|
+
createElementVNode("p", {
|
|
53
|
+
class: normalizeClass(unref(ns).be("panel", "header"))
|
|
54
|
+
}, [
|
|
55
|
+
createVNode(unref(ElCheckbox), {
|
|
56
|
+
modelValue: unref(allChecked),
|
|
57
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(allChecked) ? allChecked.value = $event : null),
|
|
58
|
+
indeterminate: unref(isIndeterminate),
|
|
59
|
+
"validate-event": false,
|
|
60
|
+
onChange: unref(handleAllCheckedChange)
|
|
61
|
+
}, {
|
|
62
|
+
default: withCtx(() => [
|
|
63
|
+
createTextVNode(toDisplayString(_ctx.title) + " ", 1),
|
|
64
|
+
createElementVNode("span", null, toDisplayString(unref(checkedSummary)), 1)
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
}, 8, ["modelValue", "indeterminate", "onChange"])
|
|
68
|
+
], 2),
|
|
69
|
+
createElementVNode("div", {
|
|
70
|
+
class: normalizeClass([unref(ns).be("panel", "body"), unref(ns).is("with-footer", unref(hasFooter))])
|
|
71
|
+
}, [
|
|
72
|
+
_ctx.filterable ? (openBlock(), createBlock(unref(ElInput), {
|
|
73
|
+
key: 0,
|
|
74
|
+
modelValue: unref(query),
|
|
75
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(query) ? query.value = $event : null),
|
|
76
|
+
class: normalizeClass(unref(ns).be("panel", "filter")),
|
|
77
|
+
size: "default",
|
|
78
|
+
placeholder: _ctx.placeholder,
|
|
79
|
+
"prefix-icon": unref(Search),
|
|
80
|
+
clearable: "",
|
|
81
|
+
"validate-event": false
|
|
82
|
+
}, null, 8, ["modelValue", "class", "placeholder", "prefix-icon"])) : createCommentVNode("v-if", true),
|
|
83
|
+
withDirectives(createVNode(unref(ElCheckboxGroup), {
|
|
84
|
+
modelValue: unref(checked),
|
|
85
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(checked) ? checked.value = $event : null),
|
|
86
|
+
"validate-event": false,
|
|
87
|
+
class: normalizeClass([unref(ns).is("filterable", _ctx.filterable), unref(ns).be("panel", "list")])
|
|
88
|
+
}, {
|
|
89
|
+
default: withCtx(() => [
|
|
90
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredData), (item) => {
|
|
91
|
+
return openBlock(), createBlock(unref(ElCheckbox), {
|
|
92
|
+
key: item[unref(propsAlias).key],
|
|
93
|
+
class: normalizeClass(unref(ns).be("panel", "item")),
|
|
94
|
+
label: item[unref(propsAlias).key],
|
|
95
|
+
disabled: item[unref(propsAlias).disabled],
|
|
96
|
+
"validate-event": false
|
|
97
|
+
}, {
|
|
98
|
+
default: withCtx(() => {
|
|
99
|
+
var _a;
|
|
100
|
+
return [
|
|
101
|
+
createVNode(OptionContent, {
|
|
102
|
+
option: (_a = _ctx.optionRender) == null ? void 0 : _a.call(_ctx, item)
|
|
103
|
+
}, null, 8, ["option"])
|
|
104
|
+
];
|
|
105
|
+
}),
|
|
106
|
+
_: 2
|
|
107
|
+
}, 1032, ["class", "label", "disabled"]);
|
|
108
|
+
}), 128))
|
|
109
|
+
]),
|
|
110
|
+
_: 1
|
|
111
|
+
}, 8, ["modelValue", "class"]), [
|
|
112
|
+
[vShow, !unref(hasNoMatch) && !unref(isEmpty)(_ctx.data)]
|
|
113
|
+
]),
|
|
114
|
+
withDirectives(createElementVNode("p", {
|
|
115
|
+
class: normalizeClass(unref(ns).be("panel", "empty"))
|
|
116
|
+
}, toDisplayString(unref(hasNoMatch) ? unref(t)("el.transfer.noMatch") : unref(t)("el.transfer.noData")), 3), [
|
|
117
|
+
[vShow, unref(hasNoMatch) || unref(isEmpty)(_ctx.data)]
|
|
118
|
+
])
|
|
119
|
+
], 2),
|
|
120
|
+
unref(hasFooter) ? (openBlock(), createElementBlock("p", {
|
|
121
|
+
key: 0,
|
|
122
|
+
class: normalizeClass(unref(ns).be("panel", "footer"))
|
|
123
|
+
}, [
|
|
124
|
+
renderSlot(_ctx.$slots, "default")
|
|
125
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
126
|
+
], 2);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
var TransferPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "transfer-panel.vue"]]);
|
|
22
131
|
|
|
23
|
-
export {
|
|
132
|
+
export { TransferPanel as default };
|
|
24
133
|
//# sourceMappingURL=transfer-panel2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer-panel2.mjs","sources":["../../../../../../packages/components/transfer/src/transfer-panel.
|
|
1
|
+
{"version":3,"file":"transfer-panel2.mjs","sources":["../../../../../../packages/components/transfer/src/transfer-panel.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b('panel')\">\n <p :class=\"ns.be('panel', 'header')\">\n <el-checkbox\n v-model=\"allChecked\"\n :indeterminate=\"isIndeterminate\"\n :validate-event=\"false\"\n @change=\"handleAllCheckedChange\"\n >\n {{ title }}\n <span>{{ checkedSummary }}</span>\n </el-checkbox>\n </p>\n\n <div :class=\"[ns.be('panel', 'body'), ns.is('with-footer', hasFooter)]\">\n <el-input\n v-if=\"filterable\"\n v-model=\"query\"\n :class=\"ns.be('panel', 'filter')\"\n size=\"default\"\n :placeholder=\"placeholder\"\n :prefix-icon=\"Search\"\n clearable\n :validate-event=\"false\"\n />\n <el-checkbox-group\n v-show=\"!hasNoMatch && !isEmpty(data)\"\n v-model=\"checked\"\n :validate-event=\"false\"\n :class=\"[ns.is('filterable', filterable), ns.be('panel', 'list')]\"\n >\n <el-checkbox\n v-for=\"item in filteredData\"\n :key=\"item[propsAlias.key]\"\n :class=\"ns.be('panel', 'item')\"\n :label=\"item[propsAlias.key]\"\n :disabled=\"item[propsAlias.disabled]\"\n :validate-event=\"false\"\n >\n <option-content :option=\"optionRender?.(item)\" />\n </el-checkbox>\n </el-checkbox-group>\n <p v-show=\"hasNoMatch || isEmpty(data)\" :class=\"ns.be('panel', 'empty')\">\n {{ hasNoMatch ? t('el.transfer.noMatch') : t('el.transfer.noData') }}\n </p>\n </div>\n <p v-if=\"hasFooter\" :class=\"ns.be('panel', 'footer')\">\n <slot />\n </p>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, reactive, toRefs, useSlots } from 'vue'\nimport { isEmpty } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { ElCheckbox, ElCheckboxGroup } from '@element-plus/components/checkbox'\nimport { ElInput } from '@element-plus/components/input'\nimport { Search } from '@element-plus/icons-vue'\nimport { transferPanelEmits, transferPanelProps } from './transfer-panel'\nimport { useCheck, usePropsAlias } from './composables'\n\nimport type { VNode } from 'vue'\nimport type { TransferPanelState } from './transfer-panel'\n\ndefineOptions({\n name: 'ElTransferPanel',\n})\n\nconst props = defineProps(transferPanelProps)\nconst emit = defineEmits(transferPanelEmits)\nconst slots = useSlots()\n\nconst OptionContent = ({ option }: { option: VNode | VNode[] }) => option\n\nconst { t } = useLocale()\nconst ns = useNamespace('transfer')\n\nconst panelState = reactive<TransferPanelState>({\n checked: [],\n allChecked: false,\n query: '',\n checkChangeByUser: true,\n})\n\nconst propsAlias = usePropsAlias(props)\n\nconst {\n filteredData,\n checkedSummary,\n isIndeterminate,\n handleAllCheckedChange,\n} = useCheck(props, panelState, emit)\n\nconst hasNoMatch = computed(\n () => !isEmpty(panelState.query) && isEmpty(filteredData.value)\n)\n\nconst hasFooter = computed(() => !isEmpty(slots.default!()[0].children))\n\nconst { checked, allChecked, query } = toRefs(panelState)\n\ndefineExpose({\n /** @description filter keyword */\n query,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;mCAiEc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAM,MAAA,aAAA,GAAgB,CAAC,EAAE,MAA0C,EAAA,KAAA,MAAA,CAAA;AAEnE,IAAM,MAAA,EAAE,MAAM,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAElC,IAAA,MAAM,aAAa,QAA6B,CAAA;AAAA,MAC9C,SAAS,EAAC;AAAA,MACV,UAAY,EAAA,KAAA;AAAA,MACZ,KAAO,EAAA,EAAA;AAAA,MACP,iBAAmB,EAAA,IAAA;AAAA,KACpB,CAAA,CAAA;AAED,IAAM,MAAA,UAAA,GAAa,cAAc,KAAK,CAAA,CAAA;AAEtC,IAAM,MAAA;AAAA,MACJ,YAAA;AAAA,MACA,cAAA;AAAA,MACA,eAAA;AAAA,MACA,sBAAA;AAAA,KACE,GAAA,QAAA,CAAS,KAAO,EAAA,UAAA,EAAY,IAAI,CAAA,CAAA;AAEpC,IAAM,MAAA,UAAA,GAAa,QACjB,CAAA,MAAM,CAAC,OAAA,CAAQ,UAAW,CAAA,KAAK,CAAK,IAAA,OAAA,CAAQ,YAAa,CAAA,KAAK,CAChE,CAAA,CAAA;AAEA,IAAM,MAAA,SAAA,GAAY,QAAS,CAAA,MAAM,CAAC,OAAA,CAAQ,MAAM,OAAS,EAAA,CAAE,CAAG,CAAA,CAAA,QAAQ,CAAC,CAAA,CAAA;AAEvE,IAAA,MAAM,EAAE,OAAA,EAAS,UAAY,EAAA,KAAA,EAAA,GAAU,OAAO,UAAU,CAAA,CAAA;AAExD,IAAa,MAAA,CAAA;AAAA,MAEX,KAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,7 @@ import '../../form/index.mjs';
|
|
|
7
7
|
import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
|
|
8
8
|
import { transferProps, transferEmits } from './transfer.mjs';
|
|
9
9
|
import './composables/index.mjs';
|
|
10
|
-
import TransferPanel from './transfer-
|
|
10
|
+
import TransferPanel from './transfer-panel2.mjs';
|
|
11
11
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
12
12
|
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
13
13
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Upload from './src/
|
|
3
|
-
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './src/
|
|
4
|
-
export { uploadContentProps } from './src/upload-
|
|
2
|
+
import Upload from './src/upload2.mjs';
|
|
3
|
+
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './src/upload.mjs';
|
|
4
|
+
export { uploadContentProps } from './src/upload-content.mjs';
|
|
5
5
|
export { uploadListEmits, uploadListProps } from './src/upload-list.mjs';
|
|
6
|
-
export { uploadDraggerEmits, uploadDraggerProps } from './src/upload-
|
|
6
|
+
export { uploadDraggerEmits, uploadDraggerProps } from './src/upload-dragger.mjs';
|
|
7
7
|
export { uploadContextKey } from './src/constants.mjs';
|
|
8
8
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
9
9
|
|
|
@@ -1,200 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isPlainObject, isFunction } from '@vue/shared';
|
|
3
|
-
import { cloneDeep, isEqual } from 'lodash-unified';
|
|
4
|
-
import '../../../hooks/index.mjs';
|
|
1
|
+
import { NOOP } from '@vue/shared';
|
|
5
2
|
import '../../../utils/index.mjs';
|
|
6
|
-
import '
|
|
7
|
-
import
|
|
8
|
-
import { uploadContentProps } from './upload-content2.mjs';
|
|
9
|
-
import { genFileId } from './upload2.mjs';
|
|
10
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
11
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
12
|
-
import { useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
13
|
-
import { entriesOf } from '../../../utils/objects.mjs';
|
|
3
|
+
import { uploadBaseProps } from './upload.mjs';
|
|
4
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
14
5
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onStart(rawFile);
|
|
45
|
-
if (autoUpload)
|
|
46
|
-
upload(rawFile);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const upload = async (rawFile) => {
|
|
50
|
-
inputRef.value.value = "";
|
|
51
|
-
if (!props.beforeUpload) {
|
|
52
|
-
return doUpload(rawFile);
|
|
53
|
-
}
|
|
54
|
-
let hookResult;
|
|
55
|
-
let beforeData = {};
|
|
56
|
-
try {
|
|
57
|
-
const originData = props.data;
|
|
58
|
-
const beforeUploadPromise = props.beforeUpload(rawFile);
|
|
59
|
-
beforeData = isPlainObject(props.data) ? cloneDeep(props.data) : props.data;
|
|
60
|
-
hookResult = await beforeUploadPromise;
|
|
61
|
-
if (isPlainObject(props.data) && isEqual(originData, beforeData)) {
|
|
62
|
-
beforeData = cloneDeep(props.data);
|
|
63
|
-
}
|
|
64
|
-
} catch (e) {
|
|
65
|
-
hookResult = false;
|
|
66
|
-
}
|
|
67
|
-
if (hookResult === false) {
|
|
68
|
-
props.onRemove(rawFile);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
let file = rawFile;
|
|
72
|
-
if (hookResult instanceof Blob) {
|
|
73
|
-
if (hookResult instanceof File) {
|
|
74
|
-
file = hookResult;
|
|
75
|
-
} else {
|
|
76
|
-
file = new File([hookResult], rawFile.name, {
|
|
77
|
-
type: rawFile.type
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
doUpload(Object.assign(file, {
|
|
82
|
-
uid: rawFile.uid
|
|
83
|
-
}), beforeData);
|
|
84
|
-
};
|
|
85
|
-
const resolveData = async (data, rawFile) => {
|
|
86
|
-
if (isFunction(data)) {
|
|
87
|
-
return data(rawFile);
|
|
88
|
-
}
|
|
89
|
-
return data;
|
|
90
|
-
};
|
|
91
|
-
const doUpload = async (rawFile, beforeData) => {
|
|
92
|
-
const {
|
|
93
|
-
headers,
|
|
94
|
-
data,
|
|
95
|
-
method,
|
|
96
|
-
withCredentials,
|
|
97
|
-
name: filename,
|
|
98
|
-
action,
|
|
99
|
-
onProgress,
|
|
100
|
-
onSuccess,
|
|
101
|
-
onError,
|
|
102
|
-
httpRequest
|
|
103
|
-
} = props;
|
|
104
|
-
try {
|
|
105
|
-
beforeData = await resolveData(beforeData != null ? beforeData : data, rawFile);
|
|
106
|
-
} catch (e) {
|
|
107
|
-
props.onRemove(rawFile);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const { uid } = rawFile;
|
|
111
|
-
const options = {
|
|
112
|
-
headers: headers || {},
|
|
113
|
-
withCredentials,
|
|
114
|
-
file: rawFile,
|
|
115
|
-
data: beforeData,
|
|
116
|
-
method,
|
|
117
|
-
filename,
|
|
118
|
-
action,
|
|
119
|
-
onProgress: (evt) => {
|
|
120
|
-
onProgress(evt, rawFile);
|
|
121
|
-
},
|
|
122
|
-
onSuccess: (res) => {
|
|
123
|
-
onSuccess(res, rawFile);
|
|
124
|
-
delete requests.value[uid];
|
|
125
|
-
},
|
|
126
|
-
onError: (err) => {
|
|
127
|
-
onError(err, rawFile);
|
|
128
|
-
delete requests.value[uid];
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
const request = httpRequest(options);
|
|
132
|
-
requests.value[uid] = request;
|
|
133
|
-
if (request instanceof Promise) {
|
|
134
|
-
request.then(options.onSuccess, options.onError);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const handleChange = (e) => {
|
|
138
|
-
const files = e.target.files;
|
|
139
|
-
if (!files)
|
|
140
|
-
return;
|
|
141
|
-
uploadFiles(Array.from(files));
|
|
142
|
-
};
|
|
143
|
-
const handleClick = () => {
|
|
144
|
-
if (!disabled.value) {
|
|
145
|
-
inputRef.value.value = "";
|
|
146
|
-
inputRef.value.click();
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
const handleKeydown = () => {
|
|
150
|
-
handleClick();
|
|
151
|
-
};
|
|
152
|
-
const abort = (file) => {
|
|
153
|
-
const _reqs = entriesOf(requests.value).filter(file ? ([uid]) => String(file.uid) === uid : () => true);
|
|
154
|
-
_reqs.forEach(([uid, req]) => {
|
|
155
|
-
if (req instanceof XMLHttpRequest)
|
|
156
|
-
req.abort();
|
|
157
|
-
delete requests.value[uid];
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
expose({
|
|
161
|
-
abort,
|
|
162
|
-
upload
|
|
163
|
-
});
|
|
164
|
-
return (_ctx, _cache) => {
|
|
165
|
-
return openBlock(), createElementBlock("div", {
|
|
166
|
-
class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.listType), unref(ns).is("drag", _ctx.drag)]),
|
|
167
|
-
tabindex: "0",
|
|
168
|
-
onClick: handleClick,
|
|
169
|
-
onKeydown: withKeys(withModifiers(handleKeydown, ["self"]), ["enter", "space"])
|
|
170
|
-
}, [
|
|
171
|
-
_ctx.drag ? (openBlock(), createBlock(UploadDragger, {
|
|
172
|
-
key: 0,
|
|
173
|
-
disabled: unref(disabled),
|
|
174
|
-
onFile: uploadFiles
|
|
175
|
-
}, {
|
|
176
|
-
default: withCtx(() => [
|
|
177
|
-
renderSlot(_ctx.$slots, "default")
|
|
178
|
-
]),
|
|
179
|
-
_: 3
|
|
180
|
-
}, 8, ["disabled"])) : renderSlot(_ctx.$slots, "default", { key: 1 }),
|
|
181
|
-
createElementVNode("input", {
|
|
182
|
-
ref_key: "inputRef",
|
|
183
|
-
ref: inputRef,
|
|
184
|
-
class: normalizeClass(unref(ns).e("input")),
|
|
185
|
-
name: _ctx.name,
|
|
186
|
-
multiple: _ctx.multiple,
|
|
187
|
-
accept: _ctx.accept,
|
|
188
|
-
type: "file",
|
|
189
|
-
onChange: handleChange,
|
|
190
|
-
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
191
|
-
}, ["stop"]))
|
|
192
|
-
}, null, 42, _hoisted_2)
|
|
193
|
-
], 42, _hoisted_1);
|
|
194
|
-
};
|
|
6
|
+
const uploadContentProps = buildProps({
|
|
7
|
+
...uploadBaseProps,
|
|
8
|
+
beforeUpload: {
|
|
9
|
+
type: definePropType(Function),
|
|
10
|
+
default: NOOP
|
|
11
|
+
},
|
|
12
|
+
onRemove: {
|
|
13
|
+
type: definePropType(Function),
|
|
14
|
+
default: NOOP
|
|
15
|
+
},
|
|
16
|
+
onStart: {
|
|
17
|
+
type: definePropType(Function),
|
|
18
|
+
default: NOOP
|
|
19
|
+
},
|
|
20
|
+
onSuccess: {
|
|
21
|
+
type: definePropType(Function),
|
|
22
|
+
default: NOOP
|
|
23
|
+
},
|
|
24
|
+
onProgress: {
|
|
25
|
+
type: definePropType(Function),
|
|
26
|
+
default: NOOP
|
|
27
|
+
},
|
|
28
|
+
onError: {
|
|
29
|
+
type: definePropType(Function),
|
|
30
|
+
default: NOOP
|
|
31
|
+
},
|
|
32
|
+
onExceed: {
|
|
33
|
+
type: definePropType(Function),
|
|
34
|
+
default: NOOP
|
|
195
35
|
}
|
|
196
36
|
});
|
|
197
|
-
var UploadContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "upload-content.vue"]]);
|
|
198
37
|
|
|
199
|
-
export {
|
|
38
|
+
export { uploadContentProps };
|
|
200
39
|
//# sourceMappingURL=upload-content.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-content.mjs","sources":["../../../../../../packages/components/upload/src/upload-content.vue"],"sourcesContent":["<template>\n <div\n :class=\"[ns.b(), ns.m(listType), ns.is('drag', drag)]\"\n tabindex=\"0\"\n @click=\"handleClick\"\n @keydown.self.enter.space=\"handleKeydown\"\n >\n <template v-if=\"drag\">\n <upload-dragger :disabled=\"disabled\" @file=\"uploadFiles\">\n <slot />\n </upload-dragger>\n </template>\n <template v-else>\n <slot />\n </template>\n <input\n ref=\"inputRef\"\n :class=\"ns.e('input')\"\n :name=\"name\"\n :multiple=\"multiple\"\n :accept=\"accept\"\n type=\"file\"\n @change=\"handleChange\"\n @click.stop\n />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { shallowRef } from 'vue'\nimport { isPlainObject } from '@vue/shared'\nimport { cloneDeep, isEqual } from 'lodash-unified'\nimport { useNamespace } from '@element-plus/hooks'\nimport { entriesOf, isFunction } from '@element-plus/utils'\nimport { useFormDisabled } from '@element-plus/components/form'\nimport UploadDragger from './upload-dragger.vue'\nimport { uploadContentProps } from './upload-content'\nimport { genFileId } from './upload'\nimport type { UploadContentProps } from './upload-content'\n\nimport type {\n UploadFile,\n UploadHooks,\n UploadRawFile,\n UploadRequestOptions,\n} from './upload'\n\ndefineOptions({\n name: 'ElUploadContent',\n inheritAttrs: false,\n})\n\nconst props = defineProps(uploadContentProps)\nconst ns = useNamespace('upload')\nconst disabled = useFormDisabled()\n\nconst requests = shallowRef<Record<string, XMLHttpRequest | Promise<unknown>>>(\n {}\n)\nconst inputRef = shallowRef<HTMLInputElement>()\n\nconst uploadFiles = (files: File[]) => {\n if (files.length === 0) return\n\n const { autoUpload, limit, fileList, multiple, onStart, onExceed } = props\n\n if (limit && fileList.length + files.length > limit) {\n onExceed(files, fileList)\n return\n }\n\n if (!multiple) {\n files = files.slice(0, 1)\n }\n\n for (const file of files) {\n const rawFile = file as UploadRawFile\n rawFile.uid = genFileId()\n onStart(rawFile)\n if (autoUpload) upload(rawFile)\n }\n}\n\nconst upload = async (rawFile: UploadRawFile): Promise<void> => {\n inputRef.value!.value = ''\n\n if (!props.beforeUpload) {\n return doUpload(rawFile)\n }\n\n let hookResult: Exclude<ReturnType<UploadHooks['beforeUpload']>, Promise<any>>\n let beforeData: UploadContentProps['data'] = {}\n\n try {\n // origin data: Handle data changes after synchronization tasks are executed\n const originData = props.data\n const beforeUploadPromise = props.beforeUpload(rawFile)\n beforeData = isPlainObject(props.data) ? cloneDeep(props.data) : props.data\n hookResult = await beforeUploadPromise\n if (isPlainObject(props.data) && isEqual(originData, beforeData)) {\n beforeData = cloneDeep(props.data)\n }\n } catch {\n hookResult = false\n }\n\n if (hookResult === false) {\n props.onRemove(rawFile)\n return\n }\n\n let file: File = rawFile\n if (hookResult instanceof Blob) {\n if (hookResult instanceof File) {\n file = hookResult\n } else {\n file = new File([hookResult], rawFile.name, {\n type: rawFile.type,\n })\n }\n }\n\n doUpload(\n Object.assign(file, {\n uid: rawFile.uid,\n }),\n beforeData\n )\n}\n\nconst resolveData = async (\n data: UploadContentProps['data'],\n rawFile: UploadRawFile\n): Promise<Record<string, any>> => {\n if (isFunction(data)) {\n return data(rawFile)\n }\n\n return data\n}\n\nconst doUpload = async (\n rawFile: UploadRawFile,\n beforeData?: UploadContentProps['data']\n) => {\n const {\n headers,\n data,\n method,\n withCredentials,\n name: filename,\n action,\n onProgress,\n onSuccess,\n onError,\n httpRequest,\n } = props\n\n try {\n beforeData = await resolveData(beforeData ?? data, rawFile)\n } catch {\n props.onRemove(rawFile)\n return\n }\n\n const { uid } = rawFile\n const options: UploadRequestOptions = {\n headers: headers || {},\n withCredentials,\n file: rawFile,\n data: beforeData,\n method,\n filename,\n action,\n onProgress: (evt) => {\n onProgress(evt, rawFile)\n },\n onSuccess: (res) => {\n onSuccess(res, rawFile)\n delete requests.value[uid]\n },\n onError: (err) => {\n onError(err, rawFile)\n delete requests.value[uid]\n },\n }\n const request = httpRequest(options)\n requests.value[uid] = request\n if (request instanceof Promise) {\n request.then(options.onSuccess, options.onError)\n }\n}\n\nconst handleChange = (e: Event) => {\n const files = (e.target as HTMLInputElement).files\n if (!files) return\n uploadFiles(Array.from(files))\n}\n\nconst handleClick = () => {\n if (!disabled.value) {\n inputRef.value!.value = ''\n inputRef.value!.click()\n }\n}\n\nconst handleKeydown = () => {\n handleClick()\n}\n\nconst abort = (file?: UploadFile) => {\n const _reqs = entriesOf(requests.value).filter(\n file ? ([uid]) => String(file.uid) === uid : () => true\n )\n _reqs.forEach(([uid, req]) => {\n if (req instanceof XMLHttpRequest) req.abort()\n delete requests.value[uid]\n })\n}\n\ndefineExpose({\n abort,\n upload,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;mCA+Cc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AAAA,EACN,YAAc,EAAA,KAAA;AAChB,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAChC,IAAA,MAAM,WAAW,eAAgB,EAAA,CAAA;AAEjC,IAAM,MA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AAA,GAAA,CAAA,CAAA;AAAA,OACvB,CAAA,CAAA;AAAA,KACH,CAAA;AAEA,IAAa,MAAA,CAAA;AAAA,MACX,KAAA;AAAA,MACA,MAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"upload-content.mjs","sources":["../../../../../../packages/components/upload/src/upload-content.ts"],"sourcesContent":["import { NOOP } from '@vue/shared'\nimport { buildProps, definePropType } from '@element-plus/utils'\nimport { uploadBaseProps } from './upload'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type {\n UploadFile,\n UploadHooks,\n UploadProgressEvent,\n UploadRawFile,\n} from './upload'\nimport type UploadContent from './upload-content.vue'\nimport type { UploadAjaxError } from './ajax'\n\nexport const uploadContentProps = buildProps({\n ...uploadBaseProps,\n\n beforeUpload: {\n type: definePropType<UploadHooks['beforeUpload']>(Function),\n default: NOOP,\n },\n onRemove: {\n type: definePropType<\n (file: UploadFile | UploadRawFile, rawFile?: UploadRawFile) => void\n >(Function),\n default: NOOP,\n },\n onStart: {\n type: definePropType<(rawFile: UploadRawFile) => void>(Function),\n default: NOOP,\n },\n onSuccess: {\n type: definePropType<(response: any, rawFile: UploadRawFile) => unknown>(\n Function\n ),\n default: NOOP,\n },\n onProgress: {\n type: definePropType<\n (evt: UploadProgressEvent, rawFile: UploadRawFile) => void\n >(Function),\n default: NOOP,\n },\n onError: {\n type: definePropType<\n (err: UploadAjaxError, rawFile: UploadRawFile) => void\n >(Function),\n default: NOOP,\n },\n onExceed: {\n type: definePropType<UploadHooks['onExceed']>(Function),\n default: NOOP,\n },\n} as const)\n\nexport type UploadContentProps = ExtractPropTypes<typeof uploadContentProps>\n\nexport type UploadContentInstance = InstanceType<typeof UploadContent>\n"],"names":[],"mappings":";;;;;AAGY,MAAC,kBAAkB,GAAG,UAAU,CAAC;AAC7C,EAAE,GAAG,eAAe;AACpB,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC;;;;"}
|