@element-plus/nightly 0.0.20220304 → 0.0.20220305

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/README.md +1 -1
  2. package/attributes.json +1 -1
  3. package/dist/index.css +1 -1
  4. package/dist/index.full.js +1512 -1911
  5. package/dist/index.full.min.js +11 -11
  6. package/dist/index.full.min.js.map +1 -1
  7. package/dist/index.full.min.mjs +11 -11
  8. package/dist/index.full.min.mjs.map +1 -1
  9. package/dist/index.full.mjs +1503 -1912
  10. package/dist/locale/af.js +1 -1
  11. package/dist/locale/af.min.js +1 -1
  12. package/dist/locale/af.min.mjs +1 -1
  13. package/dist/locale/af.mjs +1 -1
  14. package/dist/locale/ar.js +1 -1
  15. package/dist/locale/ar.min.js +1 -1
  16. package/dist/locale/ar.min.mjs +1 -1
  17. package/dist/locale/ar.mjs +1 -1
  18. package/dist/locale/bg.js +1 -1
  19. package/dist/locale/bg.min.js +1 -1
  20. package/dist/locale/bg.min.mjs +1 -1
  21. package/dist/locale/bg.mjs +1 -1
  22. package/dist/locale/bn.js +1 -1
  23. package/dist/locale/bn.min.js +1 -1
  24. package/dist/locale/bn.min.mjs +1 -1
  25. package/dist/locale/bn.mjs +1 -1
  26. package/dist/locale/ca.js +1 -1
  27. package/dist/locale/ca.min.js +1 -1
  28. package/dist/locale/ca.min.mjs +1 -1
  29. package/dist/locale/ca.mjs +1 -1
  30. package/dist/locale/cs.js +1 -1
  31. package/dist/locale/cs.min.js +1 -1
  32. package/dist/locale/cs.min.mjs +1 -1
  33. package/dist/locale/cs.mjs +1 -1
  34. package/dist/locale/da.js +1 -1
  35. package/dist/locale/da.min.js +1 -1
  36. package/dist/locale/da.min.mjs +1 -1
  37. package/dist/locale/da.mjs +1 -1
  38. package/dist/locale/de.js +1 -1
  39. package/dist/locale/de.min.js +1 -1
  40. package/dist/locale/de.min.mjs +1 -1
  41. package/dist/locale/de.mjs +1 -1
  42. package/dist/locale/el.js +1 -1
  43. package/dist/locale/el.min.js +1 -1
  44. package/dist/locale/el.min.mjs +1 -1
  45. package/dist/locale/el.mjs +1 -1
  46. package/dist/locale/en.js +1 -1
  47. package/dist/locale/en.min.js +1 -1
  48. package/dist/locale/en.min.mjs +1 -1
  49. package/dist/locale/en.mjs +1 -1
  50. package/dist/locale/eo.js +1 -1
  51. package/dist/locale/eo.min.js +1 -1
  52. package/dist/locale/eo.min.mjs +1 -1
  53. package/dist/locale/eo.mjs +1 -1
  54. package/dist/locale/es.js +1 -1
  55. package/dist/locale/es.min.js +1 -1
  56. package/dist/locale/es.min.mjs +1 -1
  57. package/dist/locale/es.mjs +1 -1
  58. package/dist/locale/et.js +1 -1
  59. package/dist/locale/et.min.js +1 -1
  60. package/dist/locale/et.min.mjs +1 -1
  61. package/dist/locale/et.mjs +1 -1
  62. package/dist/locale/eu.js +1 -1
  63. package/dist/locale/eu.min.js +1 -1
  64. package/dist/locale/eu.min.mjs +1 -1
  65. package/dist/locale/eu.mjs +1 -1
  66. package/dist/locale/fa.js +1 -1
  67. package/dist/locale/fa.min.js +1 -1
  68. package/dist/locale/fa.min.mjs +1 -1
  69. package/dist/locale/fa.mjs +1 -1
  70. package/dist/locale/fi.js +1 -1
  71. package/dist/locale/fi.min.js +1 -1
  72. package/dist/locale/fi.min.mjs +1 -1
  73. package/dist/locale/fi.mjs +1 -1
  74. package/dist/locale/fr.js +1 -1
  75. package/dist/locale/fr.min.js +1 -1
  76. package/dist/locale/fr.min.mjs +1 -1
  77. package/dist/locale/fr.mjs +1 -1
  78. package/dist/locale/he.js +1 -1
  79. package/dist/locale/he.min.js +1 -1
  80. package/dist/locale/he.min.mjs +1 -1
  81. package/dist/locale/he.mjs +1 -1
  82. package/dist/locale/hr.js +1 -1
  83. package/dist/locale/hr.min.js +1 -1
  84. package/dist/locale/hr.min.mjs +1 -1
  85. package/dist/locale/hr.mjs +1 -1
  86. package/dist/locale/hu.js +1 -1
  87. package/dist/locale/hu.min.js +1 -1
  88. package/dist/locale/hu.min.mjs +1 -1
  89. package/dist/locale/hu.mjs +1 -1
  90. package/dist/locale/hy-am.js +1 -1
  91. package/dist/locale/hy-am.min.js +1 -1
  92. package/dist/locale/hy-am.min.mjs +1 -1
  93. package/dist/locale/hy-am.mjs +1 -1
  94. package/dist/locale/id.js +1 -1
  95. package/dist/locale/id.min.js +1 -1
  96. package/dist/locale/id.min.mjs +1 -1
  97. package/dist/locale/id.mjs +1 -1
  98. package/dist/locale/it.js +1 -1
  99. package/dist/locale/it.min.js +1 -1
  100. package/dist/locale/it.min.mjs +1 -1
  101. package/dist/locale/it.mjs +1 -1
  102. package/dist/locale/ja.js +1 -1
  103. package/dist/locale/ja.min.js +1 -1
  104. package/dist/locale/ja.min.mjs +1 -1
  105. package/dist/locale/ja.mjs +1 -1
  106. package/dist/locale/kk.js +1 -1
  107. package/dist/locale/kk.min.js +1 -1
  108. package/dist/locale/kk.min.mjs +1 -1
  109. package/dist/locale/kk.mjs +1 -1
  110. package/dist/locale/km.js +1 -1
  111. package/dist/locale/km.min.js +1 -1
  112. package/dist/locale/km.min.mjs +1 -1
  113. package/dist/locale/km.mjs +1 -1
  114. package/dist/locale/ko.js +1 -1
  115. package/dist/locale/ko.min.js +1 -1
  116. package/dist/locale/ko.min.mjs +1 -1
  117. package/dist/locale/ko.mjs +1 -1
  118. package/dist/locale/ku.js +1 -1
  119. package/dist/locale/ku.min.js +1 -1
  120. package/dist/locale/ku.min.mjs +1 -1
  121. package/dist/locale/ku.mjs +1 -1
  122. package/dist/locale/ky.js +1 -1
  123. package/dist/locale/ky.min.js +1 -1
  124. package/dist/locale/ky.min.mjs +1 -1
  125. package/dist/locale/ky.mjs +1 -1
  126. package/dist/locale/lt.js +1 -1
  127. package/dist/locale/lt.min.js +1 -1
  128. package/dist/locale/lt.min.mjs +1 -1
  129. package/dist/locale/lt.mjs +1 -1
  130. package/dist/locale/lv.js +1 -1
  131. package/dist/locale/lv.min.js +1 -1
  132. package/dist/locale/lv.min.mjs +1 -1
  133. package/dist/locale/lv.mjs +1 -1
  134. package/dist/locale/mg.js +1 -1
  135. package/dist/locale/mg.min.js +1 -1
  136. package/dist/locale/mg.min.mjs +1 -1
  137. package/dist/locale/mg.mjs +1 -1
  138. package/dist/locale/mn.js +1 -1
  139. package/dist/locale/mn.min.js +1 -1
  140. package/dist/locale/mn.min.mjs +1 -1
  141. package/dist/locale/mn.mjs +1 -1
  142. package/dist/locale/nb-no.js +1 -1
  143. package/dist/locale/nb-no.min.js +1 -1
  144. package/dist/locale/nb-no.min.mjs +1 -1
  145. package/dist/locale/nb-no.mjs +1 -1
  146. package/dist/locale/nl.js +1 -1
  147. package/dist/locale/nl.min.js +1 -1
  148. package/dist/locale/nl.min.mjs +1 -1
  149. package/dist/locale/nl.mjs +1 -1
  150. package/dist/locale/pa.js +1 -1
  151. package/dist/locale/pa.min.js +1 -1
  152. package/dist/locale/pa.min.mjs +1 -1
  153. package/dist/locale/pa.mjs +1 -1
  154. package/dist/locale/pl.js +1 -1
  155. package/dist/locale/pl.min.js +1 -1
  156. package/dist/locale/pl.min.mjs +1 -1
  157. package/dist/locale/pl.mjs +1 -1
  158. package/dist/locale/pt-br.js +1 -1
  159. package/dist/locale/pt-br.min.js +1 -1
  160. package/dist/locale/pt-br.min.mjs +1 -1
  161. package/dist/locale/pt-br.mjs +1 -1
  162. package/dist/locale/pt.js +1 -1
  163. package/dist/locale/pt.min.js +1 -1
  164. package/dist/locale/pt.min.mjs +1 -1
  165. package/dist/locale/pt.mjs +1 -1
  166. package/dist/locale/ro.js +1 -1
  167. package/dist/locale/ro.min.js +1 -1
  168. package/dist/locale/ro.min.mjs +1 -1
  169. package/dist/locale/ro.mjs +1 -1
  170. package/dist/locale/ru.js +1 -1
  171. package/dist/locale/ru.min.js +1 -1
  172. package/dist/locale/ru.min.mjs +1 -1
  173. package/dist/locale/ru.mjs +1 -1
  174. package/dist/locale/sk.js +1 -1
  175. package/dist/locale/sk.min.js +1 -1
  176. package/dist/locale/sk.min.mjs +1 -1
  177. package/dist/locale/sk.mjs +1 -1
  178. package/dist/locale/sl.js +1 -1
  179. package/dist/locale/sl.min.js +1 -1
  180. package/dist/locale/sl.min.mjs +1 -1
  181. package/dist/locale/sl.mjs +1 -1
  182. package/dist/locale/sr.js +1 -1
  183. package/dist/locale/sr.min.js +1 -1
  184. package/dist/locale/sr.min.mjs +1 -1
  185. package/dist/locale/sr.mjs +1 -1
  186. package/dist/locale/sv.js +1 -1
  187. package/dist/locale/sv.min.js +1 -1
  188. package/dist/locale/sv.min.mjs +1 -1
  189. package/dist/locale/sv.mjs +1 -1
  190. package/dist/locale/ta.js +1 -1
  191. package/dist/locale/ta.min.js +1 -1
  192. package/dist/locale/ta.min.mjs +1 -1
  193. package/dist/locale/ta.mjs +1 -1
  194. package/dist/locale/th.js +1 -1
  195. package/dist/locale/th.min.js +1 -1
  196. package/dist/locale/th.min.mjs +1 -1
  197. package/dist/locale/th.mjs +1 -1
  198. package/dist/locale/tk.js +1 -1
  199. package/dist/locale/tk.min.js +1 -1
  200. package/dist/locale/tk.min.mjs +1 -1
  201. package/dist/locale/tk.mjs +1 -1
  202. package/dist/locale/tr.js +1 -1
  203. package/dist/locale/tr.min.js +1 -1
  204. package/dist/locale/tr.min.mjs +1 -1
  205. package/dist/locale/tr.mjs +1 -1
  206. package/dist/locale/ug-cn.js +1 -1
  207. package/dist/locale/ug-cn.min.js +1 -1
  208. package/dist/locale/ug-cn.min.mjs +1 -1
  209. package/dist/locale/ug-cn.mjs +1 -1
  210. package/dist/locale/uk.js +1 -1
  211. package/dist/locale/uk.min.js +1 -1
  212. package/dist/locale/uk.min.mjs +1 -1
  213. package/dist/locale/uk.mjs +1 -1
  214. package/dist/locale/uz-uz.js +1 -1
  215. package/dist/locale/uz-uz.min.js +1 -1
  216. package/dist/locale/uz-uz.min.mjs +1 -1
  217. package/dist/locale/uz-uz.mjs +1 -1
  218. package/dist/locale/vi.js +1 -1
  219. package/dist/locale/vi.min.js +1 -1
  220. package/dist/locale/vi.min.mjs +1 -1
  221. package/dist/locale/vi.mjs +1 -1
  222. package/dist/locale/zh-cn.js +1 -1
  223. package/dist/locale/zh-cn.min.js +1 -1
  224. package/dist/locale/zh-cn.min.mjs +1 -1
  225. package/dist/locale/zh-cn.mjs +1 -1
  226. package/dist/locale/zh-tw.js +1 -1
  227. package/dist/locale/zh-tw.min.js +1 -1
  228. package/dist/locale/zh-tw.min.mjs +1 -1
  229. package/dist/locale/zh-tw.mjs +1 -1
  230. package/es/components/index.mjs +4 -0
  231. package/es/components/index.mjs.map +1 -1
  232. package/es/components/message-box/index.mjs +1 -0
  233. package/es/components/message-box/index.mjs.map +1 -1
  234. package/es/components/message-box/src/index.vue.d.ts +2 -2
  235. package/es/components/message-box/src/message-box.type.d.ts +4 -3
  236. package/es/components/message-box/src/messageBox.mjs +39 -56
  237. package/es/components/message-box/src/messageBox.mjs.map +1 -1
  238. package/es/components/upload/index.d.ts +807 -727
  239. package/es/components/upload/index.mjs +9 -7
  240. package/es/components/upload/index.mjs.map +1 -1
  241. package/es/components/upload/src/ajax.d.ts +8 -2
  242. package/es/components/upload/src/ajax.mjs +39 -34
  243. package/es/components/upload/src/ajax.mjs.map +1 -1
  244. package/es/components/upload/src/upload-content.d.ts +32 -0
  245. package/es/components/upload/src/upload-content.mjs +39 -0
  246. package/es/components/upload/src/upload-content.mjs.map +1 -0
  247. package/es/components/upload/src/upload-content.vue.d.ts +165 -0
  248. package/es/components/upload/src/upload-content2.mjs +172 -0
  249. package/es/components/upload/src/upload-content2.mjs.map +1 -0
  250. package/es/components/upload/src/upload-dragger.d.ts +11 -0
  251. package/es/components/upload/src/upload-dragger.mjs +11 -67
  252. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  253. package/es/components/upload/src/upload-dragger.vue.d.ts +15 -11
  254. package/es/components/upload/src/upload-dragger2.mjs +73 -0
  255. package/es/components/upload/src/upload-dragger2.mjs.map +1 -0
  256. package/es/components/upload/src/upload-list.d.ts +15 -0
  257. package/es/components/upload/src/upload-list.mjs +23 -207
  258. package/es/components/upload/src/upload-list.mjs.map +1 -1
  259. package/es/components/upload/src/upload-list.vue.d.ts +148 -44
  260. package/es/components/upload/src/upload-list2.mjs +173 -0
  261. package/es/components/upload/src/upload-list2.mjs.map +1 -0
  262. package/es/components/upload/src/upload.d.ts +97 -0
  263. package/es/components/upload/src/upload.mjs +103 -266
  264. package/es/components/upload/src/upload.mjs.map +1 -1
  265. package/es/components/upload/src/upload.vue.d.ts +830 -292
  266. package/es/components/upload/src/upload2.mjs +122 -0
  267. package/es/components/upload/src/upload2.mjs.map +1 -0
  268. package/es/components/upload/src/{useHandlers.d.ts → use-handlers.d.ts} +10 -13
  269. package/es/components/upload/src/use-handlers.mjs +142 -0
  270. package/es/components/upload/src/use-handlers.mjs.map +1 -0
  271. package/es/index.mjs +5 -0
  272. package/es/index.mjs.map +1 -1
  273. package/es/tokens/index.d.ts +1 -0
  274. package/es/tokens/index.mjs +1 -0
  275. package/es/tokens/index.mjs.map +1 -1
  276. package/es/tokens/upload.d.ts +5 -0
  277. package/es/tokens/upload.mjs +4 -0
  278. package/es/tokens/upload.mjs.map +1 -0
  279. package/es/utils/typescript.d.ts +1 -0
  280. package/es/utils/typescript.mjs.map +1 -1
  281. package/es/version.d.ts +1 -1
  282. package/es/version.mjs +1 -1
  283. package/es/version.mjs.map +1 -1
  284. package/lib/components/index.js +13 -0
  285. package/lib/components/index.js.map +1 -1
  286. package/lib/components/message-box/index.js +1 -0
  287. package/lib/components/message-box/index.js.map +1 -1
  288. package/lib/components/message-box/src/index.vue.d.ts +2 -2
  289. package/lib/components/message-box/src/message-box.type.d.ts +4 -3
  290. package/lib/components/message-box/src/messageBox.js +38 -55
  291. package/lib/components/message-box/src/messageBox.js.map +1 -1
  292. package/lib/components/upload/index.d.ts +807 -727
  293. package/lib/components/upload/index.js +18 -7
  294. package/lib/components/upload/index.js.map +1 -1
  295. package/lib/components/upload/src/ajax.d.ts +8 -2
  296. package/lib/components/upload/src/ajax.js +40 -34
  297. package/lib/components/upload/src/ajax.js.map +1 -1
  298. package/lib/components/upload/src/upload-content.d.ts +32 -0
  299. package/lib/components/upload/src/upload-content.js +43 -0
  300. package/lib/components/upload/src/upload-content.js.map +1 -0
  301. package/lib/components/upload/src/upload-content.vue.d.ts +165 -0
  302. package/lib/components/upload/src/upload-content2.js +176 -0
  303. package/lib/components/upload/src/upload-content2.js.map +1 -0
  304. package/lib/components/upload/src/upload-dragger.d.ts +11 -0
  305. package/lib/components/upload/src/upload-dragger.js +12 -67
  306. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  307. package/lib/components/upload/src/upload-dragger.vue.d.ts +15 -11
  308. package/lib/components/upload/src/upload-dragger2.js +77 -0
  309. package/lib/components/upload/src/upload-dragger2.js.map +1 -0
  310. package/lib/components/upload/src/upload-list.d.ts +15 -0
  311. package/lib/components/upload/src/upload-list.js +24 -207
  312. package/lib/components/upload/src/upload-list.js.map +1 -1
  313. package/lib/components/upload/src/upload-list.vue.d.ts +148 -44
  314. package/lib/components/upload/src/upload-list2.js +177 -0
  315. package/lib/components/upload/src/upload-list2.js.map +1 -0
  316. package/lib/components/upload/src/upload.d.ts +97 -0
  317. package/lib/components/upload/src/upload.js +104 -264
  318. package/lib/components/upload/src/upload.js.map +1 -1
  319. package/lib/components/upload/src/upload.vue.d.ts +830 -292
  320. package/lib/components/upload/src/upload2.js +126 -0
  321. package/lib/components/upload/src/upload2.js.map +1 -0
  322. package/lib/components/upload/src/{useHandlers.d.ts → use-handlers.d.ts} +10 -13
  323. package/lib/components/upload/src/use-handlers.js +146 -0
  324. package/lib/components/upload/src/use-handlers.js.map +1 -0
  325. package/lib/index.js +15 -0
  326. package/lib/index.js.map +1 -1
  327. package/lib/tokens/index.d.ts +1 -0
  328. package/lib/tokens/index.js +2 -0
  329. package/lib/tokens/index.js.map +1 -1
  330. package/lib/tokens/upload.d.ts +5 -0
  331. package/lib/tokens/upload.js +8 -0
  332. package/lib/tokens/upload.js.map +1 -0
  333. package/lib/utils/typescript.d.ts +1 -0
  334. package/lib/utils/typescript.js.map +1 -1
  335. package/lib/version.d.ts +1 -1
  336. package/lib/version.js +1 -1
  337. package/lib/version.js.map +1 -1
  338. package/package.json +2 -2
  339. package/theme-chalk/el-dialog.css +1 -1
  340. package/theme-chalk/el-input.css +1 -1
  341. package/theme-chalk/el-table.css +1 -1
  342. package/theme-chalk/index.css +1 -1
  343. package/theme-chalk/src/cascader-panel.scss +1 -1
  344. package/theme-chalk/src/common/transition.scss +2 -2
  345. package/theme-chalk/src/common/var.scss +1 -0
  346. package/theme-chalk/src/date-picker/date-table.scss +4 -4
  347. package/theme-chalk/src/dialog.scss +1 -1
  348. package/theme-chalk/src/input.scss +12 -4
  349. package/theme-chalk/src/menu.scss +1 -1
  350. package/theme-chalk/src/option-item.scss +2 -2
  351. package/theme-chalk/src/page-header.scss +1 -1
  352. package/theme-chalk/src/pagination.scss +2 -2
  353. package/theme-chalk/src/table.scss +2 -1
  354. package/web-types.json +1 -1
  355. package/es/components/upload/src/index.mjs +0 -220
  356. package/es/components/upload/src/index.mjs.map +0 -1
  357. package/es/components/upload/src/index.vue.d.ts +0 -282
  358. package/es/components/upload/src/upload.type.d.ts +0 -72
  359. package/es/components/upload/src/upload.type.mjs +0 -2
  360. package/es/components/upload/src/upload.type.mjs.map +0 -1
  361. package/es/components/upload/src/useHandlers.mjs +0 -143
  362. package/es/components/upload/src/useHandlers.mjs.map +0 -1
  363. package/lib/components/upload/src/index.js +0 -224
  364. package/lib/components/upload/src/index.js.map +0 -1
  365. package/lib/components/upload/src/index.vue.d.ts +0 -282
  366. package/lib/components/upload/src/upload.type.d.ts +0 -72
  367. package/lib/components/upload/src/upload.type.js +0 -3
  368. package/lib/components/upload/src/upload.type.js.map +0 -1
  369. package/lib/components/upload/src/useHandlers.js +0 -147
  370. package/lib/components/upload/src/useHandlers.js.map +0 -1
@@ -0,0 +1,122 @@
1
+ import { defineComponent, shallowRef, computed, onBeforeUnmount, provide, toRef, openBlock, createElementBlock, unref, createBlock, createSlots, withCtx, renderSlot, createCommentVNode, createVNode } from 'vue';
2
+ import '../../../tokens/index.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import _sfc_main$1 from './upload-list2.mjs';
5
+ import _sfc_main$2 from './upload-content2.mjs';
6
+ import { useHandlers } from './use-handlers.mjs';
7
+ import { uploadProps } from './upload.mjs';
8
+ import { useDisabled } from '../../../hooks/use-common-props/index.mjs';
9
+ import { uploadContextKey } from '../../../tokens/upload.mjs';
10
+
11
+ const __default__ = {
12
+ name: "ElUpload"
13
+ };
14
+ const _sfc_main = /* @__PURE__ */ defineComponent({
15
+ ...__default__,
16
+ props: uploadProps,
17
+ setup(__props, { expose }) {
18
+ const props = __props;
19
+ const disabled = useDisabled();
20
+ const uploadRef = shallowRef();
21
+ const {
22
+ abort,
23
+ submit,
24
+ clearFiles,
25
+ uploadFiles,
26
+ handleStart,
27
+ handleError,
28
+ handleRemove,
29
+ handleSuccess,
30
+ handleProgress
31
+ } = useHandlers(props, uploadRef);
32
+ const isPictureCard = computed(() => props.listType === "picture-card");
33
+ onBeforeUnmount(() => {
34
+ uploadFiles.value.forEach(({ url }) => {
35
+ if (url == null ? void 0 : url.startsWith("blob:"))
36
+ URL.revokeObjectURL(url);
37
+ });
38
+ });
39
+ provide(uploadContextKey, {
40
+ accept: toRef(props, "accept")
41
+ });
42
+ expose({
43
+ abort,
44
+ submit,
45
+ clearFiles,
46
+ handleStart,
47
+ handleRemove
48
+ });
49
+ return (_ctx, _cache) => {
50
+ return openBlock(), createElementBlock("div", null, [
51
+ unref(isPictureCard) && _ctx.showFileList ? (openBlock(), createBlock(_sfc_main$1, {
52
+ key: 0,
53
+ disabled: unref(disabled),
54
+ "list-type": _ctx.listType,
55
+ files: unref(uploadFiles),
56
+ "handle-preview": _ctx.onPreview,
57
+ onRemove: unref(handleRemove)
58
+ }, createSlots({ _: 2 }, [
59
+ _ctx.$slots.file ? {
60
+ name: "default",
61
+ fn: withCtx(({ file }) => [
62
+ renderSlot(_ctx.$slots, "file", { file })
63
+ ])
64
+ } : void 0
65
+ ]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true),
66
+ createVNode(_sfc_main$2, {
67
+ ref_key: "uploadRef",
68
+ ref: uploadRef,
69
+ type: _ctx.type,
70
+ drag: _ctx.drag,
71
+ action: _ctx.action,
72
+ multiple: _ctx.multiple,
73
+ "with-credentials": _ctx.withCredentials,
74
+ headers: _ctx.headers,
75
+ method: _ctx.method,
76
+ name: _ctx.name,
77
+ data: _ctx.data,
78
+ accept: _ctx.accept,
79
+ "file-list": unref(uploadFiles),
80
+ "auto-upload": _ctx.autoUpload,
81
+ "list-type": _ctx.listType,
82
+ disabled: unref(disabled),
83
+ limit: _ctx.limit,
84
+ "http-request": _ctx.httpRequest,
85
+ "before-upload": _ctx.beforeUpload,
86
+ "on-exceed": _ctx.onExceed,
87
+ "on-start": unref(handleStart),
88
+ "on-progress": unref(handleProgress),
89
+ "on-success": unref(handleSuccess),
90
+ "on-error": unref(handleError),
91
+ "on-remove": unref(handleRemove)
92
+ }, {
93
+ default: withCtx(() => [
94
+ _ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
95
+ !_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
96
+ ]),
97
+ _: 3
98
+ }, 8, ["type", "drag", "action", "multiple", "with-credentials", "headers", "method", "name", "data", "accept", "file-list", "auto-upload", "list-type", "disabled", "limit", "http-request", "before-upload", "on-exceed", "on-start", "on-progress", "on-success", "on-error", "on-remove"]),
99
+ _ctx.$slots.trigger ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true),
100
+ renderSlot(_ctx.$slots, "tip"),
101
+ !unref(isPictureCard) && _ctx.showFileList ? (openBlock(), createBlock(_sfc_main$1, {
102
+ key: 2,
103
+ disabled: unref(disabled),
104
+ "list-type": _ctx.listType,
105
+ files: unref(uploadFiles),
106
+ "handle-preview": _ctx.onPreview,
107
+ onRemove: unref(handleRemove)
108
+ }, createSlots({ _: 2 }, [
109
+ _ctx.$slots.file ? {
110
+ name: "default",
111
+ fn: withCtx(({ file }) => [
112
+ renderSlot(_ctx.$slots, "file", { file })
113
+ ])
114
+ } : void 0
115
+ ]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true)
116
+ ]);
117
+ };
118
+ }
119
+ });
120
+
121
+ export { _sfc_main as default };
122
+ //# sourceMappingURL=upload2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload2.mjs","sources":["../../../../../../packages/components/upload/src/upload.vue"],"sourcesContent":["<template>\n <div>\n <upload-list\n v-if=\"isPictureCard && showFileList\"\n :disabled=\"disabled\"\n :list-type=\"listType\"\n :files=\"uploadFiles\"\n :handle-preview=\"onPreview\"\n @remove=\"handleRemove\"\n >\n <template v-if=\"$slots.file\" #default=\"{ file }\">\n <slot name=\"file\" :file=\"file\"></slot>\n </template>\n </upload-list>\n <upload-content\n ref=\"uploadRef\"\n :type=\"type\"\n :drag=\"drag\"\n :action=\"action\"\n :multiple=\"multiple\"\n :with-credentials=\"withCredentials\"\n :headers=\"headers\"\n :method=\"method\"\n :name=\"name\"\n :data=\"data\"\n :accept=\"accept\"\n :file-list=\"uploadFiles\"\n :auto-upload=\"autoUpload\"\n :list-type=\"listType\"\n :disabled=\"disabled\"\n :limit=\"limit\"\n :http-request=\"httpRequest\"\n :before-upload=\"beforeUpload\"\n :on-exceed=\"onExceed\"\n :on-start=\"handleStart\"\n :on-progress=\"handleProgress\"\n :on-success=\"handleSuccess\"\n :on-error=\"handleError\"\n :on-remove=\"handleRemove\"\n >\n <template #default>\n <slot v-if=\"$slots.trigger\" name=\"trigger\" />\n <slot v-if=\"!$slots.trigger && $slots.default\" />\n </template>\n </upload-content>\n <slot v-if=\"$slots.trigger\" />\n <slot name=\"tip\" />\n <upload-list\n v-if=\"!isPictureCard && showFileList\"\n :disabled=\"disabled\"\n :list-type=\"listType\"\n :files=\"uploadFiles\"\n :handle-preview=\"onPreview\"\n @remove=\"handleRemove\"\n >\n <template v-if=\"$slots.file\" #default=\"{ file }\">\n <slot name=\"file\" :file=\"file\" />\n </template>\n </upload-list>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, provide, onBeforeUnmount, toRef, shallowRef } from 'vue'\nimport { uploadContextKey } from '@element-plus/tokens'\nimport { useDisabled } from '@element-plus/hooks'\n\nimport UploadList from './upload-list.vue'\nimport UploadContent from './upload-content.vue'\nimport { useHandlers } from './use-handlers'\nimport { uploadProps } from './upload'\nimport type { UploadContentInstance } from './upload-content'\n\ndefineOptions({\n name: 'ElUpload',\n})\n\nconst props = defineProps(uploadProps)\nconst disabled = useDisabled()\n\nconst uploadRef = shallowRef<UploadContentInstance>()\nconst {\n abort,\n submit,\n clearFiles,\n uploadFiles,\n handleStart,\n handleError,\n handleRemove,\n handleSuccess,\n handleProgress,\n} = useHandlers(props, uploadRef)\n\nconst isPictureCard = computed(() => props.listType === 'picture-card')\n\nonBeforeUnmount(() => {\n uploadFiles.value.forEach(({ url }) => {\n if (url?.startsWith('blob:')) URL.revokeObjectURL(url)\n })\n})\n\nprovide(uploadContextKey, {\n accept: toRef(props, 'accept'),\n})\n\ndefineExpose({\n /** @description cancel upload request */\n abort,\n /** @description upload the file list manually */\n submit,\n /** @description clear the file list */\n clearFiles,\n /** @description select the file manually */\n handleStart,\n /** @description remove the file manually */\n handleRemove,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA6EA;AAEA;AACA;;;;;;;;;;;AAYA;AAEA;;;;;;AAMA;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,13 +1,15 @@
1
1
  /// <reference types="node" />
2
- import type { UploadFile, UploadStatus, ElFile, ElUploadProgressEvent, IUseHandlersProps } from './upload.type';
3
- declare const _default: (props: IUseHandlersProps) => {
2
+ import type { ShallowRef } from 'vue';
3
+ import type { UploadContentInstance } from './upload-content';
4
+ import type { UploadRawFile, UploadFile, UploadProps, UploadStatus } from './upload';
5
+ export declare const useHandlers: (props: UploadProps, uploadRef: ShallowRef<UploadContentInstance | undefined>) => {
4
6
  abort: (file: UploadFile) => void;
5
- clearFiles: (status?: UploadStatus[]) => void;
6
- handleError: (err: Error, rawFile: ElFile) => void;
7
- handleProgress: (ev: ElUploadProgressEvent, rawFile: ElFile) => void;
8
- handleStart: (rawFile: ElFile) => void;
9
- handleSuccess: (res: any, rawFile: ElFile) => void;
10
- handleRemove: (file: UploadFile, raw: ElFile) => void;
7
+ clearFiles: (states?: UploadStatus[]) => void;
8
+ handleError: (err: import("./ajax").UploadAjaxError, rawFile: UploadRawFile) => void;
9
+ handleProgress: (evt: import("./upload").UploadProgressEvent, rawFile: UploadRawFile) => void;
10
+ handleStart: (rawFile: UploadRawFile) => void;
11
+ handleSuccess: (response: any, rawFile: UploadRawFile) => unknown;
12
+ handleRemove: (file: UploadFile | UploadRawFile, rawFile?: UploadRawFile | undefined) => void;
11
13
  submit: () => void;
12
14
  uploadFiles: import("vue").Ref<{
13
15
  name: string;
@@ -42,9 +44,4 @@ declare const _default: (props: IUseHandlersProps) => {
42
44
  };
43
45
  };
44
46
  }[]>;
45
- uploadRef: import("vue").Ref<{
46
- abort: (file: UploadFile) => void;
47
- upload: (file: ElFile) => void;
48
- }>;
49
47
  };
50
- export default _default;
@@ -0,0 +1,142 @@
1
+ import { ref, watch } from 'vue';
2
+ import '../../../utils/index.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import { genFileId } from './upload.mjs';
5
+ import { debugWarn, throwError } from '../../../utils/error.mjs';
6
+ import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
7
+
8
+ const SCOPE = "ElUpload";
9
+ const revokeObjectURL = (file) => {
10
+ var _a;
11
+ if ((_a = file.url) == null ? void 0 : _a.startsWith("blob:")) {
12
+ URL.revokeObjectURL(file.url);
13
+ }
14
+ };
15
+ const useHandlers = (props, uploadRef) => {
16
+ const uploadFiles = ref([]);
17
+ const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid);
18
+ function abort(file) {
19
+ var _a;
20
+ (_a = uploadRef.value) == null ? void 0 : _a.abort(file);
21
+ }
22
+ function clearFiles(states = ["ready", "uploading", "success", "fail"]) {
23
+ uploadFiles.value = uploadFiles.value.filter((row) => !states.includes(row.status));
24
+ }
25
+ const handleError = (err, rawFile) => {
26
+ const file = getFile(rawFile);
27
+ if (!file)
28
+ return;
29
+ file.status = "fail";
30
+ uploadFiles.value.splice(uploadFiles.value.indexOf(file), 1);
31
+ props.onError(err, file, uploadFiles.value);
32
+ props.onChange(file, uploadFiles.value);
33
+ };
34
+ const handleProgress = (evt, rawFile) => {
35
+ const file = getFile(rawFile);
36
+ if (!file)
37
+ return;
38
+ props.onProgress(evt, file, uploadFiles.value);
39
+ file.status = "uploading";
40
+ file.percentage = evt.percent;
41
+ };
42
+ const handleSuccess = (response, rawFile) => {
43
+ const file = getFile(rawFile);
44
+ if (!file)
45
+ return;
46
+ file.status = "success";
47
+ file.response = response;
48
+ props.onSuccess(response, file, uploadFiles.value);
49
+ props.onChange(file, uploadFiles.value);
50
+ };
51
+ const handleStart = (file) => {
52
+ const uploadFile = {
53
+ name: file.name,
54
+ percentage: 0,
55
+ status: "ready",
56
+ size: file.size,
57
+ raw: file,
58
+ uid: file.uid
59
+ };
60
+ if (props.listType === "picture-card" || props.listType === "picture") {
61
+ try {
62
+ uploadFile.url = URL.createObjectURL(file);
63
+ } catch (err) {
64
+ debugWarn(SCOPE, err.message);
65
+ props.onError(err, uploadFile, uploadFiles.value);
66
+ }
67
+ }
68
+ uploadFiles.value.push(uploadFile);
69
+ props.onChange(uploadFile, uploadFiles.value);
70
+ };
71
+ const handleRemove = async (file, rawFile) => {
72
+ if (rawFile) {
73
+ useDeprecated({
74
+ scope: SCOPE,
75
+ from: "handleRemove second argument",
76
+ version: "2.2",
77
+ replacement: "first argument `file`",
78
+ ref: "https://element-plus.org/en-US/component/upload.html#methods"
79
+ }, true);
80
+ }
81
+ const _file = rawFile || file;
82
+ const uploadFile = _file instanceof File ? getFile(_file) : _file;
83
+ if (!uploadFile)
84
+ throwError(SCOPE, "file to be removed not found");
85
+ const doRemove = (file2) => {
86
+ abort(file2);
87
+ const fileList = uploadFiles.value;
88
+ fileList.splice(fileList.indexOf(file2), 1);
89
+ props.onRemove(file2, fileList);
90
+ revokeObjectURL(file2);
91
+ };
92
+ if (props.beforeRemove) {
93
+ const before = await props.beforeRemove(uploadFile, uploadFiles.value);
94
+ if (before !== false)
95
+ doRemove(uploadFile);
96
+ } else {
97
+ doRemove(uploadFile);
98
+ }
99
+ };
100
+ function submit() {
101
+ uploadFiles.value.filter(({ status }) => status === "ready").forEach(({ raw }) => {
102
+ var _a;
103
+ return (_a = uploadRef.value) == null ? void 0 : _a.upload(raw);
104
+ });
105
+ }
106
+ watch(() => props.listType, (val) => {
107
+ if (val !== "picture-card" && val !== "picture") {
108
+ return;
109
+ }
110
+ uploadFiles.value = uploadFiles.value.map((file) => {
111
+ const { raw, url } = file;
112
+ if (!url && raw) {
113
+ try {
114
+ file.url = URL.createObjectURL(raw);
115
+ } catch (err) {
116
+ props.onError(err, file, uploadFiles.value);
117
+ }
118
+ }
119
+ return file;
120
+ });
121
+ });
122
+ watch(() => props.fileList, (fileList) => {
123
+ for (const file of fileList) {
124
+ file.uid = genFileId();
125
+ file.status || (file.status = "success");
126
+ }
127
+ }, { immediate: true });
128
+ return {
129
+ abort,
130
+ clearFiles,
131
+ handleError,
132
+ handleProgress,
133
+ handleStart,
134
+ handleSuccess,
135
+ handleRemove,
136
+ submit,
137
+ uploadFiles
138
+ };
139
+ };
140
+
141
+ export { useHandlers };
142
+ //# sourceMappingURL=use-handlers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-handlers.mjs","sources":["../../../../../../packages/components/upload/src/use-handlers.ts"],"sourcesContent":["import { ref, watch } from 'vue'\nimport { debugWarn, throwError } from '@element-plus/utils'\nimport { useDeprecated } from '@element-plus/hooks'\nimport { genFileId } from './upload'\nimport type { ShallowRef } from 'vue'\nimport type {\n UploadContentProps,\n UploadContentInstance,\n} from './upload-content'\nimport type {\n UploadRawFile,\n UploadFile,\n UploadProps,\n UploadStatus,\n UploadFiles,\n} from './upload'\n\nconst SCOPE = 'ElUpload'\n\nconst revokeObjectURL = (file: UploadFile) => {\n if (file.url?.startsWith('blob:')) {\n URL.revokeObjectURL(file.url)\n }\n}\n\nexport const useHandlers = (\n props: UploadProps,\n uploadRef: ShallowRef<UploadContentInstance | undefined>\n) => {\n const uploadFiles = ref<UploadFiles>([])\n\n const getFile = (rawFile: UploadRawFile) =>\n uploadFiles.value.find((file) => file.uid === rawFile.uid)\n\n function abort(file: UploadFile) {\n uploadRef.value?.abort(file)\n }\n\n function clearFiles(\n /** @default ['ready', 'uploading', 'success', 'fail'] */\n states: UploadStatus[] = ['ready', 'uploading', 'success', 'fail']\n ) {\n uploadFiles.value = uploadFiles.value.filter(\n (row) => !states.includes(row.status)\n )\n }\n\n const handleError: UploadContentProps['onError'] = (err, rawFile) => {\n const file = getFile(rawFile)\n if (!file) return\n\n file.status = 'fail'\n uploadFiles.value.splice(uploadFiles.value.indexOf(file), 1)\n props.onError(err, file, uploadFiles.value)\n props.onChange(file, uploadFiles.value)\n }\n\n const handleProgress: UploadContentProps['onProgress'] = (evt, rawFile) => {\n const file = getFile(rawFile)\n if (!file) return\n\n props.onProgress(evt, file, uploadFiles.value)\n file.status = 'uploading'\n file.percentage = evt.percent\n }\n\n const handleSuccess: UploadContentProps['onSuccess'] = (\n response,\n rawFile\n ) => {\n const file = getFile(rawFile)\n if (!file) return\n\n file.status = 'success'\n file.response = response\n props.onSuccess(response, file, uploadFiles.value)\n props.onChange(file, uploadFiles.value)\n }\n\n const handleStart: UploadContentProps['onStart'] = (file) => {\n const uploadFile: UploadFile = {\n name: file.name,\n percentage: 0,\n status: 'ready',\n size: file.size,\n raw: file,\n uid: file.uid,\n }\n if (props.listType === 'picture-card' || props.listType === 'picture') {\n try {\n uploadFile.url = URL.createObjectURL(file)\n } catch (err: unknown) {\n debugWarn(SCOPE, (err as Error).message)\n props.onError(err as Error, uploadFile, uploadFiles.value)\n }\n }\n uploadFiles.value.push(uploadFile)\n props.onChange(uploadFile, uploadFiles.value)\n }\n\n const handleRemove: UploadContentProps['onRemove'] = async (\n file,\n rawFile // TODO: deprecated in 2.2\n ): Promise<void> => {\n if (rawFile) {\n useDeprecated(\n {\n scope: SCOPE,\n from: 'handleRemove second argument',\n version: '2.2',\n replacement: 'first argument `file`',\n ref: 'https://element-plus.org/en-US/component/upload.html#methods',\n },\n true\n )\n }\n\n const _file = rawFile || file\n const uploadFile = _file instanceof File ? getFile(_file) : _file\n if (!uploadFile) throwError(SCOPE, 'file to be removed not found')\n\n const doRemove = (file: UploadFile) => {\n abort(file)\n const fileList = uploadFiles.value\n fileList.splice(fileList.indexOf(file), 1)\n props.onRemove(file, fileList)\n revokeObjectURL(file)\n }\n\n if (props.beforeRemove) {\n const before = await props.beforeRemove(uploadFile, uploadFiles.value)\n if (before !== false) doRemove(uploadFile)\n } else {\n doRemove(uploadFile)\n }\n }\n\n function submit() {\n uploadFiles.value\n .filter(({ status }) => status === 'ready')\n .forEach(({ raw }) => uploadRef.value?.upload(raw))\n }\n\n watch(\n () => props.listType,\n (val) => {\n if (val !== 'picture-card' && val !== 'picture') {\n return\n }\n\n uploadFiles.value = uploadFiles.value.map((file) => {\n const { raw, url } = file\n if (!url && raw) {\n try {\n file.url = URL.createObjectURL(raw)\n } catch (err: unknown) {\n props.onError(err as Error, file, uploadFiles.value)\n }\n }\n return file\n })\n }\n )\n\n watch(\n () => props.fileList,\n (fileList) => {\n for (const file of fileList) {\n file.uid = genFileId()\n file.status ||= 'success'\n }\n },\n { immediate: true }\n )\n\n return {\n abort,\n clearFiles,\n handleError,\n handleProgress,\n handleStart,\n handleSuccess,\n handleRemove,\n submit,\n uploadFiles,\n }\n}\n"],"names":[],"mappings":";;;;;;;AAIA,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,eAAe,GAAG,CAAC,IAAI,KAAK;AAClC,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;AACjE,IAAI,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,GAAG;AACH,CAAC,CAAC;AACU,MAAC,WAAW,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK;AACjD,EAAE,MAAM,WAAW,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAC9B,EAAE,MAAM,OAAO,GAAG,CAAC,OAAO,KAAK,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAC1F,EAAE,SAAS,KAAK,CAAC,IAAI,EAAE;AACvB,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7D,GAAG;AACH,EAAE,SAAS,UAAU,CAAC,MAAM,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE;AAC1E,IAAI,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACxF,GAAG;AACH,EAAE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KAAK;AACT,IAAI,UAAU;AACd,IAAI,WAAW;AACf,IAAI,cAAc;AAClB,IAAI,WAAW;AACf,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,MAAM;AACV,IAAI,WAAW;AACf,GAAG,CAAC;AACJ;;;;"}
package/es/index.mjs CHANGED
@@ -145,6 +145,10 @@ export { CHANGE_EVENT } from './constants/event.mjs';
145
145
  export { ElTransfer } from './components/transfer/index.mjs';
146
146
  export { ElTree } from './components/tree/index.mjs';
147
147
  export { ElTreeV2 } from './components/tree-v2/index.mjs';
148
+ export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './components/upload/src/upload.mjs';
149
+ export { uploadContentProps } from './components/upload/src/upload-content.mjs';
150
+ export { uploadListEmits, uploadListProps } from './components/upload/src/upload-list.mjs';
151
+ export { uploadDraggerEmits, uploadDraggerProps } from './components/upload/src/upload-dragger.mjs';
148
152
  export { ElUpload } from './components/upload/index.mjs';
149
153
  export { default as FixedSizeList } from './components/virtual-list/src/components/fixed-size-list.mjs';
150
154
  export { default as DynamicSizeList } from './components/virtual-list/src/components/dynamic-size-list.mjs';
@@ -201,6 +205,7 @@ export { elPaginationKey } from './tokens/pagination.mjs';
201
205
  export { radioGroupKey } from './tokens/radio.mjs';
202
206
  export { scrollbarContextKey } from './tokens/scrollbar.mjs';
203
207
  export { tabsRootContextKey } from './tokens/tabs.mjs';
208
+ export { uploadContextKey } from './tokens/upload.mjs';
204
209
 
205
210
  const install = installer.install;
206
211
  const version = installer.version;
package/es/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
@@ -8,3 +8,4 @@ export * from './pagination';
8
8
  export * from './radio';
9
9
  export * from './scrollbar';
10
10
  export * from './tabs';
11
+ export * from './upload';
@@ -8,4 +8,5 @@ export { elPaginationKey } from './pagination.mjs';
8
8
  export { radioGroupKey } from './radio.mjs';
9
9
  export { scrollbarContextKey } from './scrollbar.mjs';
10
10
  export { tabsRootContextKey } from './tabs.mjs';
11
+ export { uploadContextKey } from './upload.mjs';
11
12
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ import type { ComputedRef, InjectionKey } from 'vue';
2
+ export interface UploadContext {
3
+ accept: ComputedRef<string>;
4
+ }
5
+ export declare const uploadContextKey: InjectionKey<UploadContext>;
@@ -0,0 +1,4 @@
1
+ const uploadContextKey = Symbol("uploadContextKey");
2
+
3
+ export { uploadContextKey };
4
+ //# sourceMappingURL=upload.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.mjs","sources":["../../../../packages/tokens/upload.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey } from 'vue'\n\nexport interface UploadContext {\n accept: ComputedRef<string>\n}\n\nexport const uploadContextKey: InjectionKey<UploadContext> =\n Symbol('uploadContextKey')\n"],"names":[],"mappings":"AAAY,MAAC,gBAAgB,GAAG,MAAM,CAAC,kBAAkB;;;;"}
@@ -9,3 +9,4 @@ export declare type HTMLElementCustomized<T> = HTMLElement & T;
9
9
  */
10
10
  export declare type Nullable<T> = T | null;
11
11
  export declare type Arrayable<T> = T | T[];
12
+ export declare type Awaitable<T> = Promise<T> | T;
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.mjs","sources":["../../../../packages/utils/typescript.ts"],"sourcesContent":["export const mutable = <T extends readonly any[] | Record<string, unknown>>(\n val: T\n) => val as Mutable<typeof val>\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] }\n\nexport type HTMLElementCustomized<T> = HTMLElement & T\n\n/**\n * @deprecated stop to use null\n * @see {@link https://github.com/sindresorhus/meta/discussions/7}\n */\nexport type Nullable<T> = T | null\n\nexport type Arrayable<T> = T | T[]\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK;;;;"}
1
+ {"version":3,"file":"typescript.mjs","sources":["../../../../packages/utils/typescript.ts"],"sourcesContent":["export const mutable = <T extends readonly any[] | Record<string, unknown>>(\n val: T\n) => val as Mutable<typeof val>\nexport type Mutable<T> = { -readonly [P in keyof T]: T[P] }\n\nexport type HTMLElementCustomized<T> = HTMLElement & T\n\n/**\n * @deprecated stop to use null\n * @see {@link https://github.com/sindresorhus/meta/discussions/7}\n */\nexport type Nullable<T> = T | null\n\nexport type Arrayable<T> = T | T[]\nexport type Awaitable<T> = Promise<T> | T\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK;;;;"}
package/es/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.20220304";
1
+ export declare const version = "0.0.20220305";
package/es/version.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const version = "0.0.20220304";
1
+ const version = "0.0.20220305";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=version.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220304'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220305'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
@@ -150,6 +150,10 @@ var timelineItem = require('./timeline/src/timeline-item.js');
150
150
  var tooltip = require('./tooltip/src/tooltip.js');
151
151
  var tokens$2 = require('./tooltip/src/tokens.js');
152
152
  var event = require('../constants/event.js');
153
+ var upload = require('./upload/src/upload.js');
154
+ var uploadContent = require('./upload/src/upload-content.js');
155
+ var uploadList = require('./upload/src/upload-list.js');
156
+ var uploadDragger = require('./upload/src/upload-dragger.js');
153
157
  var fixedSizeList = require('./virtual-list/src/components/fixed-size-list.js');
154
158
  var dynamicSizeList = require('./virtual-list/src/components/dynamic-size-list.js');
155
159
  var fixedSizeGrid = require('./virtual-list/src/components/fixed-size-grid.js');
@@ -399,6 +403,15 @@ exports.useTooltipProps = tooltip.useTooltipProps;
399
403
  exports.useTooltipTriggerProps = tooltip.useTooltipTriggerProps;
400
404
  exports.TOOLTIP_INJECTION_KEY = tokens$2.TOOLTIP_INJECTION_KEY;
401
405
  exports.CHANGE_EVENT = event.CHANGE_EVENT;
406
+ exports.genFileId = upload.genFileId;
407
+ exports.uploadBaseProps = upload.uploadBaseProps;
408
+ exports.uploadListTypes = upload.uploadListTypes;
409
+ exports.uploadProps = upload.uploadProps;
410
+ exports.uploadContentProps = uploadContent.uploadContentProps;
411
+ exports.uploadListEmits = uploadList.uploadListEmits;
412
+ exports.uploadListProps = uploadList.uploadListProps;
413
+ exports.uploadDraggerEmits = uploadDragger.uploadDraggerEmits;
414
+ exports.uploadDraggerProps = uploadDragger.uploadDraggerProps;
402
415
  exports.FixedSizeList = fixedSizeList["default"];
403
416
  exports.DynamicSizeList = dynamicSizeList["default"];
404
417
  exports.FixedSizeGrid = fixedSizeGrid["default"];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,6 +7,7 @@ require('./src/message-box.type.js');
7
7
 
8
8
  const _MessageBox = messageBox["default"];
9
9
  _MessageBox.install = (app) => {
10
+ _MessageBox._context = app._context;
10
11
  app.config.globalProperties.$msgbox = _MessageBox;
11
12
  app.config.globalProperties.$messageBox = _MessageBox;
12
13
  app.config.globalProperties.$alert = _MessageBox.alert;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../packages/components/message-box/index.ts"],"sourcesContent":["import MessageBox from './src/messageBox'\n\nimport type { App } from 'vue'\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nconst _MessageBox = MessageBox as SFCWithInstall<typeof MessageBox>\n\n_MessageBox.install = (app: App) => {\n app.config.globalProperties.$msgbox = _MessageBox\n app.config.globalProperties.$messageBox = _MessageBox\n app.config.globalProperties.$alert = _MessageBox.alert\n app.config.globalProperties.$confirm = _MessageBox.confirm\n app.config.globalProperties.$prompt = _MessageBox.prompt\n}\n\nexport default _MessageBox\nexport const ElMessageBox = _MessageBox\n\nexport * from './src/message-box.type'\n"],"names":["MessageBox"],"mappings":";;;;;;;AACK,MAAC,WAAW,GAAGA,sBAAW;AAC/B,WAAW,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC;AACpD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,GAAG,WAAW,CAAC;AACxD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC;AACzD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;AAC7D,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC;AAC3D,CAAC,CAAC;AAEU,MAAC,YAAY,GAAG;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/components/message-box/index.ts"],"sourcesContent":["import MessageBox from './src/messageBox'\n\nimport type { App } from 'vue'\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nconst _MessageBox = MessageBox as SFCWithInstall<typeof MessageBox>\n\n_MessageBox.install = (app: App) => {\n _MessageBox._context = app._context\n app.config.globalProperties.$msgbox = _MessageBox\n app.config.globalProperties.$messageBox = _MessageBox\n app.config.globalProperties.$alert = _MessageBox.alert\n app.config.globalProperties.$confirm = _MessageBox.confirm\n app.config.globalProperties.$prompt = _MessageBox.prompt\n}\n\nexport default _MessageBox\nexport const ElMessageBox = _MessageBox\n\nexport * from './src/message-box.type'\n"],"names":["MessageBox"],"mappings":";;;;;;;AACK,MAAC,WAAW,GAAGA,sBAAW;AAC/B,WAAW,CAAC,OAAO,GAAG,CAAC,GAAG,KAAK;AAC/B,EAAE,WAAW,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AACtC,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC;AACpD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,GAAG,WAAW,CAAC;AACxD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC;AACzD,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;AAC7D,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC;AAC3D,CAAC,CAAC;AAEU,MAAC,YAAY,GAAG;;;;;"}
@@ -1858,8 +1858,8 @@ declare const _default: import("vue").DefineComponent<{
1858
1858
  lockScroll: boolean;
1859
1859
  modal: boolean;
1860
1860
  container: string;
1861
- closeOnHashChange: boolean;
1862
- roundButton: boolean;
1863
1861
  boxType: MessageBoxType;
1862
+ roundButton: boolean;
1863
+ closeOnHashChange: boolean;
1864
1864
  }>;
1865
1865
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { CSSProperties, VNode, Component } from 'vue';
1
+ import type { AppContext, CSSProperties, VNode, Component } from 'vue';
2
2
  import type { ComponentSize } from 'element-plus/es/constants';
3
3
  declare type MessageType = '' | 'success' | 'warning' | 'info' | 'error';
4
4
  export declare type Action = 'confirm' | 'close' | 'cancel';
@@ -115,11 +115,12 @@ export interface ElMessageBoxOptions {
115
115
  /** Custom size of confirm and cancel buttons */
116
116
  buttonSize?: ComponentSize;
117
117
  }
118
- export declare type ElMessageBoxShortcutMethod = ((message: ElMessageBoxOptions['message'], title: ElMessageBoxOptions['title'], options?: ElMessageBoxOptions) => Promise<MessageBoxData>) & ((message: ElMessageBoxOptions['message'], options?: ElMessageBoxOptions) => Promise<MessageBoxData>);
118
+ export declare type ElMessageBoxShortcutMethod = ((message: ElMessageBoxOptions['message'], title: ElMessageBoxOptions['title'], options?: ElMessageBoxOptions, appContext?: AppContext | null) => Promise<MessageBoxData>) & ((message: ElMessageBoxOptions['message'], options?: ElMessageBoxOptions, appContext?: AppContext | null) => Promise<MessageBoxData>);
119
119
  export interface IElMessageBox {
120
+ _context: AppContext | null;
120
121
  /** Show a message box */
121
122
  /** Show a message box */
122
- (options: ElMessageBoxOptions): Promise<MessageBoxData>;
123
+ (options: ElMessageBoxOptions, appContext?: AppContext | null): Promise<MessageBoxData>;
123
124
  /** Show an alert message box */
124
125
  alert: ElMessageBoxShortcutMethod;
125
126
  /** Show a confirm message box */