@element-plus/nightly 0.0.20240110 → 0.0.20240112
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/attributes.json +1 -1
- package/dist/index.full.js +49 -49
- 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 +49 -49
- 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/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.d.ts +19 -5
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.d.ts +6 -1
- package/es/components/image/src/image.mjs +64 -227
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image.vue.d.ts +19 -5
- package/es/components/image/src/image2.mjs +227 -65
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +5 -5
- package/es/components/select/src/select2.mjs +25 -25
- 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/index.d.ts +12 -12
- package/es/components/select-v2/src/defaults.d.ts +2 -2
- package/es/components/select-v2/src/defaults.mjs +2 -8
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +7 -6
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +6 -6
- 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 +3 -3
- package/es/components/upload/src/upload-content.mjs +2 -2
- package/es/components/upload/src/upload-content2.mjs +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 +5 -5
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.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.d.ts +19 -5
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.d.ts +6 -1
- package/lib/components/image/src/image.js +64 -226
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image.vue.d.ts +19 -5
- package/lib/components/image/src/image2.js +226 -65
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +5 -5
- package/lib/components/select/src/select2.js +24 -24
- 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/index.d.ts +12 -12
- package/lib/components/select-v2/src/defaults.d.ts +2 -2
- package/lib/components/select-v2/src/defaults.js +2 -8
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/components/select-v2/src/select.js +7 -6
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +6 -6
- 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 +3 -3
- package/lib/components/upload/src/upload-content.js +2 -2
- package/lib/components/upload/src/upload-content2.js +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 +5 -5
- 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/web-types.json +1 -1
|
@@ -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/
|
|
2
|
+
import Upload from './src/upload2.mjs';
|
|
3
|
+
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './src/upload.mjs';
|
|
4
4
|
export { uploadContentProps } from './src/upload-content2.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
|
|
|
@@ -4,9 +4,9 @@ import { cloneDeep, isEqual } from 'lodash-unified';
|
|
|
4
4
|
import '../../../hooks/index.mjs';
|
|
5
5
|
import '../../../utils/index.mjs';
|
|
6
6
|
import '../../form/index.mjs';
|
|
7
|
-
import UploadDragger from './upload-
|
|
7
|
+
import UploadDragger from './upload-dragger2.mjs';
|
|
8
8
|
import { uploadContentProps } from './upload-content2.mjs';
|
|
9
|
-
import { genFileId } from './
|
|
9
|
+
import { genFileId } from './upload.mjs';
|
|
10
10
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
11
11
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
12
12
|
import { useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NOOP } from '@vue/shared';
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
|
-
import { uploadBaseProps } from './
|
|
3
|
+
import { uploadBaseProps } from './upload.mjs';
|
|
4
4
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
5
5
|
|
|
6
6
|
const uploadContentProps = buildProps({
|
|
@@ -1,77 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../
|
|
3
|
-
import '
|
|
4
|
-
import { throwError } from '../../../utils/error.mjs';
|
|
5
|
-
import { uploadContextKey } from './constants.mjs';
|
|
6
|
-
import { uploadDraggerProps, uploadDraggerEmits } from './upload-dragger2.mjs';
|
|
7
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
-
import { useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { isArray } from '@vue/shared';
|
|
10
4
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
-
...__default__,
|
|
18
|
-
props: uploadDraggerProps,
|
|
19
|
-
emits: uploadDraggerEmits,
|
|
20
|
-
setup(__props, { emit }) {
|
|
21
|
-
const uploaderContext = inject(uploadContextKey);
|
|
22
|
-
if (!uploaderContext) {
|
|
23
|
-
throwError(COMPONENT_NAME, "usage: <el-upload><el-upload-dragger /></el-upload>");
|
|
24
|
-
}
|
|
25
|
-
const ns = useNamespace("upload");
|
|
26
|
-
const dragover = ref(false);
|
|
27
|
-
const disabled = useFormDisabled();
|
|
28
|
-
const onDrop = (e) => {
|
|
29
|
-
if (disabled.value)
|
|
30
|
-
return;
|
|
31
|
-
dragover.value = false;
|
|
32
|
-
e.stopPropagation();
|
|
33
|
-
const files = Array.from(e.dataTransfer.files);
|
|
34
|
-
const accept = uploaderContext.accept.value;
|
|
35
|
-
if (!accept) {
|
|
36
|
-
emit("file", files);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const filesFiltered = files.filter((file) => {
|
|
40
|
-
const { type, name } = file;
|
|
41
|
-
const extension = name.includes(".") ? `.${name.split(".").pop()}` : "";
|
|
42
|
-
const baseType = type.replace(/\/.*$/, "");
|
|
43
|
-
return accept.split(",").map((type2) => type2.trim()).filter((type2) => type2).some((acceptedType) => {
|
|
44
|
-
if (acceptedType.startsWith(".")) {
|
|
45
|
-
return extension === acceptedType;
|
|
46
|
-
}
|
|
47
|
-
if (/\/\*$/.test(acceptedType)) {
|
|
48
|
-
return baseType === acceptedType.replace(/\/\*$/, "");
|
|
49
|
-
}
|
|
50
|
-
if (/^[^/]+\/[^/]+$/.test(acceptedType)) {
|
|
51
|
-
return type === acceptedType;
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
emit("file", filesFiltered);
|
|
57
|
-
};
|
|
58
|
-
const onDragover = () => {
|
|
59
|
-
if (!disabled.value)
|
|
60
|
-
dragover.value = true;
|
|
61
|
-
};
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return openBlock(), createElementBlock("div", {
|
|
64
|
-
class: normalizeClass([unref(ns).b("dragger"), unref(ns).is("dragover", dragover.value)]),
|
|
65
|
-
onDrop: withModifiers(onDrop, ["prevent"]),
|
|
66
|
-
onDragover: withModifiers(onDragover, ["prevent"]),
|
|
67
|
-
onDragleave: _cache[0] || (_cache[0] = withModifiers(($event) => dragover.value = false, ["prevent"]))
|
|
68
|
-
}, [
|
|
69
|
-
renderSlot(_ctx.$slots, "default")
|
|
70
|
-
], 42, _hoisted_1);
|
|
71
|
-
};
|
|
5
|
+
const uploadDraggerProps = buildProps({
|
|
6
|
+
disabled: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false
|
|
72
9
|
}
|
|
73
10
|
});
|
|
74
|
-
|
|
11
|
+
const uploadDraggerEmits = {
|
|
12
|
+
file: (file) => isArray(file)
|
|
13
|
+
};
|
|
75
14
|
|
|
76
|
-
export {
|
|
15
|
+
export { uploadDraggerEmits, uploadDraggerProps };
|
|
77
16
|
//# sourceMappingURL=upload-dragger.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-dragger.mjs","sources":["../../../../../../packages/components/upload/src/upload-dragger.
|
|
1
|
+
{"version":3,"file":"upload-dragger.mjs","sources":["../../../../../../packages/components/upload/src/upload-dragger.ts"],"sourcesContent":["import { buildProps, isArray } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type UploadDragger from './upload-dragger.vue'\n\nexport const uploadDraggerProps = buildProps({\n disabled: {\n type: Boolean,\n default: false,\n },\n} as const)\nexport type UploadDraggerProps = ExtractPropTypes<typeof uploadDraggerProps>\n\nexport const uploadDraggerEmits = {\n file: (file: File[]) => isArray(file),\n}\nexport type UploadDraggerEmits = typeof uploadDraggerEmits\n\nexport type UploadDraggerInstance = InstanceType<typeof UploadDragger>\n"],"names":[],"mappings":";;;;AACY,MAAC,kBAAkB,GAAG,UAAU,CAAC;AAC7C,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG;AAClC,EAAE,IAAI,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC;AAC/B;;;;"}
|
|
@@ -1,16 +1,77 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent, inject, ref, openBlock, createElementBlock, normalizeClass, unref, withModifiers, renderSlot } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import '../../form/index.mjs';
|
|
4
|
+
import { throwError } from '../../../utils/error.mjs';
|
|
5
|
+
import { uploadContextKey } from './constants.mjs';
|
|
6
|
+
import { uploadDraggerProps, uploadDraggerEmits } from './upload-dragger.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
+
import { useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
4
10
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
const _hoisted_1 = ["onDrop", "onDragover"];
|
|
12
|
+
const COMPONENT_NAME = "ElUploadDrag";
|
|
13
|
+
const __default__ = defineComponent({
|
|
14
|
+
name: COMPONENT_NAME
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: uploadDraggerProps,
|
|
19
|
+
emits: uploadDraggerEmits,
|
|
20
|
+
setup(__props, { emit }) {
|
|
21
|
+
const uploaderContext = inject(uploadContextKey);
|
|
22
|
+
if (!uploaderContext) {
|
|
23
|
+
throwError(COMPONENT_NAME, "usage: <el-upload><el-upload-dragger /></el-upload>");
|
|
24
|
+
}
|
|
25
|
+
const ns = useNamespace("upload");
|
|
26
|
+
const dragover = ref(false);
|
|
27
|
+
const disabled = useFormDisabled();
|
|
28
|
+
const onDrop = (e) => {
|
|
29
|
+
if (disabled.value)
|
|
30
|
+
return;
|
|
31
|
+
dragover.value = false;
|
|
32
|
+
e.stopPropagation();
|
|
33
|
+
const files = Array.from(e.dataTransfer.files);
|
|
34
|
+
const accept = uploaderContext.accept.value;
|
|
35
|
+
if (!accept) {
|
|
36
|
+
emit("file", files);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const filesFiltered = files.filter((file) => {
|
|
40
|
+
const { type, name } = file;
|
|
41
|
+
const extension = name.includes(".") ? `.${name.split(".").pop()}` : "";
|
|
42
|
+
const baseType = type.replace(/\/.*$/, "");
|
|
43
|
+
return accept.split(",").map((type2) => type2.trim()).filter((type2) => type2).some((acceptedType) => {
|
|
44
|
+
if (acceptedType.startsWith(".")) {
|
|
45
|
+
return extension === acceptedType;
|
|
46
|
+
}
|
|
47
|
+
if (/\/\*$/.test(acceptedType)) {
|
|
48
|
+
return baseType === acceptedType.replace(/\/\*$/, "");
|
|
49
|
+
}
|
|
50
|
+
if (/^[^/]+\/[^/]+$/.test(acceptedType)) {
|
|
51
|
+
return type === acceptedType;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
emit("file", filesFiltered);
|
|
57
|
+
};
|
|
58
|
+
const onDragover = () => {
|
|
59
|
+
if (!disabled.value)
|
|
60
|
+
dragover.value = true;
|
|
61
|
+
};
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return openBlock(), createElementBlock("div", {
|
|
64
|
+
class: normalizeClass([unref(ns).b("dragger"), unref(ns).is("dragover", dragover.value)]),
|
|
65
|
+
onDrop: withModifiers(onDrop, ["prevent"]),
|
|
66
|
+
onDragover: withModifiers(onDragover, ["prevent"]),
|
|
67
|
+
onDragleave: _cache[0] || (_cache[0] = withModifiers(($event) => dragover.value = false, ["prevent"]))
|
|
68
|
+
}, [
|
|
69
|
+
renderSlot(_ctx.$slots, "default")
|
|
70
|
+
], 42, _hoisted_1);
|
|
71
|
+
};
|
|
9
72
|
}
|
|
10
73
|
});
|
|
11
|
-
|
|
12
|
-
file: (file) => isArray(file)
|
|
13
|
-
};
|
|
74
|
+
var UploadDragger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "upload-dragger.vue"]]);
|
|
14
75
|
|
|
15
|
-
export {
|
|
76
|
+
export { UploadDragger as default };
|
|
16
77
|
//# sourceMappingURL=upload-dragger2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-dragger2.mjs","sources":["../../../../../../packages/components/upload/src/upload-dragger.
|
|
1
|
+
{"version":3,"file":"upload-dragger2.mjs","sources":["../../../../../../packages/components/upload/src/upload-dragger.vue"],"sourcesContent":["<template>\n <div\n :class=\"[ns.b('dragger'), ns.is('dragover', dragover)]\"\n @drop.prevent=\"onDrop\"\n @dragover.prevent=\"onDragover\"\n @dragleave.prevent=\"dragover = false\"\n >\n <slot />\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { inject, ref } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormDisabled } from '@element-plus/components/form'\nimport { throwError } from '@element-plus/utils/error'\nimport { uploadContextKey } from './constants'\nimport { uploadDraggerEmits, uploadDraggerProps } from './upload-dragger'\n\nconst COMPONENT_NAME = 'ElUploadDrag'\n\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\ndefineProps(uploadDraggerProps)\nconst emit = defineEmits(uploadDraggerEmits)\n\nconst uploaderContext = inject(uploadContextKey)\nif (!uploaderContext) {\n throwError(\n COMPONENT_NAME,\n 'usage: <el-upload><el-upload-dragger /></el-upload>'\n )\n}\n\nconst ns = useNamespace('upload')\nconst dragover = ref(false)\nconst disabled = useFormDisabled()\n\nconst onDrop = (e: DragEvent) => {\n if (disabled.value) return\n dragover.value = false\n\n e.stopPropagation()\n\n const files = Array.from(e.dataTransfer!.files)\n const accept = uploaderContext.accept.value\n if (!accept) {\n emit('file', files)\n return\n }\n\n const filesFiltered = files.filter((file) => {\n const { type, name } = file\n const extension = name.includes('.') ? `.${name.split('.').pop()}` : ''\n const baseType = type.replace(/\\/.*$/, '')\n return accept\n .split(',')\n .map((type) => type.trim())\n .filter((type) => type)\n .some((acceptedType) => {\n if (acceptedType.startsWith('.')) {\n return extension === acceptedType\n }\n if (/\\/\\*$/.test(acceptedType)) {\n return baseType === acceptedType.replace(/\\/\\*$/, '')\n }\n if (/^[^/]+\\/[^/]+$/.test(acceptedType)) {\n return type === acceptedType\n }\n return false\n })\n })\n\n emit('file', filesFiltered)\n}\n\nconst onDragover = () => {\n if (!disabled.value) dragover.value = true\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;mCAoBc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;AAKA,IAAM,MAAA,eAAA,GAAkB,OAAO,gBAAgB,CAAA,CAAA;AAC/C,IAAA,IAAI,CAAC,eAAiB,EAAA;AACpB,MAAA,UAAA,CACE,gBACA,qDACF,CAAA,CAAA;AAAA,KACF;AAEA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAChC,IAAM,MAAA,QAAA,GAAW,IAAI,KAAK,CAAA,CAAA;AAC1B,IAAA,MAAM,WAAW,eAAgB,EAAA,CAAA;AAEjC,IAAM,MAAA,MAAA,GAAS,CAAC,CAAiB,KAAA;AAC/B,MAAA,IAAI,QAAS,CAAA,KAAA;AAAO,QAAA,OAAA;AACpB,MAAA,QAAA,CAAS,KAAQ,GAAA,KAAA,CAAA;AAEjB,MAAA,CAAA,CAAE,eAAgB,EAAA,CAAA;AAElB,MAAA,MAAM,KAAQ,GAAA,KAAA,CAAM,IAAK,CAAA,CAAA,CAAE,aAAc,KAAK,CAAA,CAAA;AAC9C,MAAM,MAAA,MAAA,GAAS,gBAAgB,MAAO,CAAA,KAAA,CAAA;AACtC,MAAA,IAAI,CAAC,MAAQ,EAAA;AACX,QAAA,IAAA,CAAK,QAAQ,KAAK,CAAA,CAAA;AAClB,QAAA,OAAA;AAAA,OACF;AAEA,MAAA,MAAM,aAAgB,GAAA,KAAA,CAAM,MAAO,CAAA,CAAC,IAAS,KAAA;AAC3C,QAAM,MAAA,EAAE,MAAM,IAAS,EAAA,GAAA,IAAA,CAAA;AACvB,QAAM,MAAA,SAAA,GAAY,IAAK,CAAA,QAAA,CAAS,GAAG,CAAA,GAAI,CAAI,CAAA,EAAA,IAAA,CAAK,KAAM,CAAA,GAAG,CAAE,CAAA,GAAA,EAAU,CAAA,CAAA,GAAA,EAAA,CAAA;AACrE,QAAA,MAAM,QAAW,GAAA,IAAA,CAAK,OAAQ,CAAA,OAAA,EAAS,EAAE,CAAA,CAAA;AACzC,QAAA,OAAO,OACJ,KAAM,CAAA,GAAG,EACT,GAAI,CAAA,CAAC,UAAS,KAAK,CAAA,IAAA,EAAM,CAAA,CACzB,OAAO,CAAC,KAAA,KAAS,KAAI,CACrB,CAAA,IAAA,CAAK,CAAC,YAAiB,KAAA;AACtB,UAAI,IAAA,YAAA,CAAa,UAAW,CAAA,GAAG,CAAG,EAAA;AAChC,YAAA,OAAO,SAAc,KAAA,YAAA,CAAA;AAAA,WACvB;AACA,UAAI,IAAA,OAAA,CAAQ,IAAK,CAAA,YAAY,CAAG,EAAA;AAC9B,YAAA,OAAO,QAAa,KAAA,YAAA,CAAa,OAAQ,CAAA,OAAA,EAAS,EAAE,CAAA,CAAA;AAAA,WACtD;AACA,UAAI,IAAA,gBAAA,CAAiB,IAAK,CAAA,YAAY,CAAG,EAAA;AACvC,YAAA,OAAO,IAAS,KAAA,YAAA,CAAA;AAAA,WAClB;AACA,UAAO,OAAA,KAAA,CAAA;AAAA,SACR,CAAA,CAAA;AAAA,OACJ,CAAA,CAAA;AAED,MAAA,IAAA,CAAK,QAAQ,aAAa,CAAA,CAAA;AAAA,KAC5B,CAAA;AAEA,IAAA,MAAM,aAAa,MAAM;AACvB,MAAA,IAAI,CAAC,QAAS,CAAA,KAAA;AAAO,QAAA,QAAA,CAAS,KAAQ,GAAA,IAAA,CAAA;AAAA,KACxC,CAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NOOP } from '@vue/shared';
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
|
-
import { uploadListTypes } from './
|
|
3
|
+
import { uploadListTypes } from './upload.mjs';
|
|
4
4
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
5
5
|
import { mutable } from '../../../utils/typescript.mjs';
|
|
6
6
|
|
|
@@ -1,122 +1,107 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useHandlers } from './use-handlers.mjs';
|
|
7
|
-
import { uploadProps } from './upload2.mjs';
|
|
8
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
9
|
-
import { useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
1
|
+
import { NOOP } from '@vue/shared';
|
|
2
|
+
import '../../../utils/index.mjs';
|
|
3
|
+
import { ajaxUpload } from './ajax.mjs';
|
|
4
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
5
|
+
import { mutable } from '../../../utils/typescript.mjs';
|
|
10
6
|
|
|
11
|
-
const
|
|
12
|
-
|
|
7
|
+
const uploadListTypes = ["text", "picture", "picture-card"];
|
|
8
|
+
let fileId = 1;
|
|
9
|
+
const genFileId = () => Date.now() + fileId++;
|
|
10
|
+
const uploadBaseProps = buildProps({
|
|
11
|
+
action: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "#"
|
|
14
|
+
},
|
|
15
|
+
headers: {
|
|
16
|
+
type: definePropType(Object)
|
|
17
|
+
},
|
|
18
|
+
method: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "post"
|
|
21
|
+
},
|
|
22
|
+
data: {
|
|
23
|
+
type: definePropType([Object, Function, Promise]),
|
|
24
|
+
default: () => mutable({})
|
|
25
|
+
},
|
|
26
|
+
multiple: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
name: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "file"
|
|
33
|
+
},
|
|
34
|
+
drag: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
withCredentials: Boolean,
|
|
39
|
+
showFileList: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
accept: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
fileList: {
|
|
48
|
+
type: definePropType(Array),
|
|
49
|
+
default: () => mutable([])
|
|
50
|
+
},
|
|
51
|
+
autoUpload: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
listType: {
|
|
56
|
+
type: String,
|
|
57
|
+
values: uploadListTypes,
|
|
58
|
+
default: "text"
|
|
59
|
+
},
|
|
60
|
+
httpRequest: {
|
|
61
|
+
type: definePropType(Function),
|
|
62
|
+
default: ajaxUpload
|
|
63
|
+
},
|
|
64
|
+
disabled: Boolean,
|
|
65
|
+
limit: Number
|
|
13
66
|
});
|
|
14
|
-
const
|
|
15
|
-
...
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
abort,
|
|
51
|
-
submit,
|
|
52
|
-
clearFiles,
|
|
53
|
-
handleStart,
|
|
54
|
-
handleRemove
|
|
55
|
-
});
|
|
56
|
-
return (_ctx, _cache) => {
|
|
57
|
-
return openBlock(), createElementBlock("div", null, [
|
|
58
|
-
unref(isPictureCard) && _ctx.showFileList ? (openBlock(), createBlock(UploadList, {
|
|
59
|
-
key: 0,
|
|
60
|
-
disabled: unref(disabled),
|
|
61
|
-
"list-type": _ctx.listType,
|
|
62
|
-
files: unref(uploadFiles),
|
|
63
|
-
"handle-preview": _ctx.onPreview,
|
|
64
|
-
onRemove: unref(handleRemove)
|
|
65
|
-
}, createSlots({
|
|
66
|
-
append: withCtx(() => [
|
|
67
|
-
createVNode(UploadContent, mergeProps({
|
|
68
|
-
ref_key: "uploadRef",
|
|
69
|
-
ref: uploadRef
|
|
70
|
-
}, unref(uploadContentProps)), {
|
|
71
|
-
default: withCtx(() => [
|
|
72
|
-
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
|
|
73
|
-
!_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
|
|
74
|
-
]),
|
|
75
|
-
_: 3
|
|
76
|
-
}, 16)
|
|
77
|
-
]),
|
|
78
|
-
_: 2
|
|
79
|
-
}, [
|
|
80
|
-
_ctx.$slots.file ? {
|
|
81
|
-
name: "default",
|
|
82
|
-
fn: withCtx(({ file }) => [
|
|
83
|
-
renderSlot(_ctx.$slots, "file", { file })
|
|
84
|
-
])
|
|
85
|
-
} : void 0
|
|
86
|
-
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true),
|
|
87
|
-
!unref(isPictureCard) || unref(isPictureCard) && !_ctx.showFileList ? (openBlock(), createBlock(UploadContent, mergeProps({
|
|
88
|
-
key: 1,
|
|
89
|
-
ref_key: "uploadRef",
|
|
90
|
-
ref: uploadRef
|
|
91
|
-
}, unref(uploadContentProps)), {
|
|
92
|
-
default: withCtx(() => [
|
|
93
|
-
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
|
|
94
|
-
!_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
|
|
95
|
-
]),
|
|
96
|
-
_: 3
|
|
97
|
-
}, 16)) : createCommentVNode("v-if", true),
|
|
98
|
-
_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("v-if", true),
|
|
99
|
-
renderSlot(_ctx.$slots, "tip"),
|
|
100
|
-
!unref(isPictureCard) && _ctx.showFileList ? (openBlock(), createBlock(UploadList, {
|
|
101
|
-
key: 3,
|
|
102
|
-
disabled: unref(disabled),
|
|
103
|
-
"list-type": _ctx.listType,
|
|
104
|
-
files: unref(uploadFiles),
|
|
105
|
-
"handle-preview": _ctx.onPreview,
|
|
106
|
-
onRemove: unref(handleRemove)
|
|
107
|
-
}, createSlots({ _: 2 }, [
|
|
108
|
-
_ctx.$slots.file ? {
|
|
109
|
-
name: "default",
|
|
110
|
-
fn: withCtx(({ file }) => [
|
|
111
|
-
renderSlot(_ctx.$slots, "file", { file })
|
|
112
|
-
])
|
|
113
|
-
} : void 0
|
|
114
|
-
]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true)
|
|
115
|
-
]);
|
|
116
|
-
};
|
|
67
|
+
const uploadProps = buildProps({
|
|
68
|
+
...uploadBaseProps,
|
|
69
|
+
beforeUpload: {
|
|
70
|
+
type: definePropType(Function),
|
|
71
|
+
default: NOOP
|
|
72
|
+
},
|
|
73
|
+
beforeRemove: {
|
|
74
|
+
type: definePropType(Function)
|
|
75
|
+
},
|
|
76
|
+
onRemove: {
|
|
77
|
+
type: definePropType(Function),
|
|
78
|
+
default: NOOP
|
|
79
|
+
},
|
|
80
|
+
onChange: {
|
|
81
|
+
type: definePropType(Function),
|
|
82
|
+
default: NOOP
|
|
83
|
+
},
|
|
84
|
+
onPreview: {
|
|
85
|
+
type: definePropType(Function),
|
|
86
|
+
default: NOOP
|
|
87
|
+
},
|
|
88
|
+
onSuccess: {
|
|
89
|
+
type: definePropType(Function),
|
|
90
|
+
default: NOOP
|
|
91
|
+
},
|
|
92
|
+
onProgress: {
|
|
93
|
+
type: definePropType(Function),
|
|
94
|
+
default: NOOP
|
|
95
|
+
},
|
|
96
|
+
onError: {
|
|
97
|
+
type: definePropType(Function),
|
|
98
|
+
default: NOOP
|
|
99
|
+
},
|
|
100
|
+
onExceed: {
|
|
101
|
+
type: definePropType(Function),
|
|
102
|
+
default: NOOP
|
|
117
103
|
}
|
|
118
104
|
});
|
|
119
|
-
var Upload = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "upload.vue"]]);
|
|
120
105
|
|
|
121
|
-
export {
|
|
106
|
+
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps };
|
|
122
107
|
//# sourceMappingURL=upload.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.mjs","sources":["../../../../../../packages/components/upload/src/upload.
|
|
1
|
+
{"version":3,"file":"upload.mjs","sources":["../../../../../../packages/components/upload/src/upload.ts"],"sourcesContent":["import { NOOP } from '@vue/shared'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils'\nimport { ajaxUpload } from './ajax'\nimport type { Awaitable, Mutable } from '@element-plus/utils'\n\nimport type { UploadAjaxError } from './ajax'\nimport type { ExtractPropTypes } from 'vue'\nimport type Upload from './upload.vue'\n\nexport const uploadListTypes = ['text', 'picture', 'picture-card'] as const\n\nlet fileId = 1\nexport const genFileId = () => Date.now() + fileId++\n\nexport type UploadStatus = 'ready' | 'uploading' | 'success' | 'fail'\nexport interface UploadProgressEvent extends ProgressEvent {\n percent: number\n}\n\nexport interface UploadRequestOptions {\n action: string\n method: string\n data: Record<string, string | Blob | [string | Blob, string]>\n filename: string\n file: UploadRawFile\n headers: Headers | Record<string, string | number | null | undefined>\n onError: (evt: UploadAjaxError) => void\n onProgress: (evt: UploadProgressEvent) => void\n onSuccess: (response: any) => void\n withCredentials: boolean\n}\nexport interface UploadFile {\n name: string\n percentage?: number\n status: UploadStatus\n size?: number\n response?: unknown\n uid: number\n url?: string\n raw?: UploadRawFile\n}\nexport type UploadUserFile = Omit<UploadFile, 'status' | 'uid'> &\n Partial<Pick<UploadFile, 'status' | 'uid'>>\n\nexport type UploadFiles = UploadFile[]\nexport interface UploadRawFile extends File {\n uid: number\n}\nexport type UploadRequestHandler = (\n options: UploadRequestOptions\n) => XMLHttpRequest | Promise<unknown>\nexport interface UploadHooks {\n beforeUpload: (\n rawFile: UploadRawFile\n ) => Awaitable<void | undefined | null | boolean | File | Blob>\n beforeRemove: (\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => Awaitable<boolean>\n onRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void\n onChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void\n onPreview: (uploadFile: UploadFile) => void\n onSuccess: (\n response: any,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onProgress: (\n evt: UploadProgressEvent,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onError: (\n error: Error,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onExceed: (files: File[], uploadFiles: UploadUserFile[]) => void\n}\n\nexport type UploadData = Mutable<Record<string, any>>\n\nexport const uploadBaseProps = buildProps({\n /**\n * @description request URL\n */\n action: {\n type: String,\n default: '#',\n },\n /**\n * @description request headers\n */\n headers: {\n type: definePropType<Headers | Record<string, any>>(Object),\n },\n /**\n * @description set upload request method\n */\n method: {\n type: String,\n default: 'post',\n },\n /**\n * @description additions options of request\n */\n data: {\n type: definePropType<\n | Awaitable<UploadData>\n | ((rawFile: UploadRawFile) => Awaitable<UploadData>)\n >([Object, Function, Promise]),\n default: () => mutable({} as const),\n },\n /**\n * @description whether uploading multiple files is permitted\n */\n multiple: {\n type: Boolean,\n default: false,\n },\n /**\n * @description key name for uploaded file\n */\n name: {\n type: String,\n default: 'file',\n },\n /**\n * @description whether to activate drag and drop mode\n */\n drag: {\n type: Boolean,\n default: false,\n },\n /**\n * @description whether cookies are sent\n */\n withCredentials: Boolean,\n /**\n * @description whether to show the uploaded file list\n */\n showFileList: {\n type: Boolean,\n default: true,\n },\n /**\n * @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true`\n */\n accept: {\n type: String,\n default: '',\n },\n /**\n * @description default uploaded files\n */\n fileList: {\n type: definePropType<UploadUserFile[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description whether to auto upload file\n */\n autoUpload: {\n type: Boolean,\n default: true,\n },\n /**\n * @description type of file list\n */\n listType: {\n type: String,\n values: uploadListTypes,\n default: 'text',\n },\n /**\n * @description override default xhr behavior, allowing you to implement your own upload-file's request\n */\n httpRequest: {\n type: definePropType<UploadRequestHandler>(Function),\n default: ajaxUpload,\n },\n /**\n * @description whether to disable upload\n */\n disabled: Boolean,\n /**\n * @description maximum number of uploads allowed\n */\n limit: Number,\n} as const)\n\nexport const uploadProps = buildProps({\n ...uploadBaseProps,\n /**\n * @description hook function before uploading with the file to be uploaded as its parameter. If `false` is returned or a `Promise` is returned and then is rejected, uploading will be aborted\n */\n beforeUpload: {\n type: definePropType<UploadHooks['beforeUpload']>(Function),\n default: NOOP,\n },\n /**\n * @description hook function before removing a file with the file and file list as its parameters. If `false` is returned or a `Promise` is returned and then is rejected, removing will be aborted\n */\n beforeRemove: {\n type: definePropType<UploadHooks['beforeRemove']>(Function),\n },\n /**\n * @description hook function when files are removed\n */\n onRemove: {\n type: definePropType<UploadHooks['onRemove']>(Function),\n default: NOOP,\n },\n /**\n * @description hook function when select file or upload file success or upload file fail\n */\n onChange: {\n type: definePropType<UploadHooks['onChange']>(Function),\n default: NOOP,\n },\n /**\n * @description hook function when clicking the uploaded files\n */\n onPreview: {\n type: definePropType<UploadHooks['onPreview']>(Function),\n default: NOOP,\n },\n /**\n * @description hook function when uploaded successfully\n */\n onSuccess: {\n type: definePropType<UploadHooks['onSuccess']>(Function),\n default: NOOP,\n },\n /**\n * @description hook function when some progress occurs\n */\n onProgress: {\n type: definePropType<UploadHooks['onProgress']>(Function),\n default: NOOP,\n },\n /**\n * @description hook function when some errors occurs\n */\n onError: {\n type: definePropType<UploadHooks['onError']>(Function),\n default: NOOP,\n },\n /**\n * @description hook function when limit is exceeded\n */\n onExceed: {\n type: definePropType<UploadHooks['onExceed']>(Function),\n default: NOOP,\n },\n} as const)\n\nexport type UploadProps = ExtractPropTypes<typeof uploadProps>\n\nexport type UploadInstance = InstanceType<typeof Upload>\n"],"names":[],"mappings":";;;;;;AAGY,MAAC,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE;AACnE,IAAI,MAAM,GAAG,CAAC,CAAC;AACH,MAAC,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,GAAG;AACzC,MAAC,eAAe,GAAG,UAAU,CAAC;AAC1C,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrD,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,eAAe,EAAE,OAAO;AAC1B,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,eAAe;AAC3B,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,UAAU;AACvB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,KAAK,EAAE,MAAM;AACf,CAAC,EAAE;AACS,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,GAAG,eAAe;AACpB,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,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,SAAS,EAAE;AACb,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;;;;"}
|