@element-plus/nightly 0.0.20251231 → 0.0.20260101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- 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/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.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/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.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/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.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/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.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/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.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-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.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/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +29 -153
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +153 -29
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb.mjs +9 -37
- package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb2.mjs +37 -9
- package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
- package/es/components/button/index.mjs +2 -2
- package/es/components/button/src/button-group.mjs +1 -1
- package/es/components/button/src/button.mjs +98 -67
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +67 -98
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +196 -23
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +23 -196
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/calendar/src/select-controller.mjs +95 -12
- package/es/components/calendar/src/select-controller.mjs.map +1 -1
- package/es/components/calendar/src/select-controller2.mjs +12 -95
- package/es/components/calendar/src/select-controller2.mjs.map +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +42 -65
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +65 -42
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse-item.mjs +17 -118
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item2.mjs +118 -17
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/countdown/index.mjs +2 -2
- package/es/components/countdown/src/countdown.mjs +20 -83
- package/es/components/countdown/src/countdown.mjs.map +1 -1
- package/es/components/countdown/src/countdown2.mjs +83 -20
- package/es/components/countdown/src/countdown2.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +225 -31
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +31 -225
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/empty/index.mjs +2 -2
- package/es/components/empty/src/empty.mjs +10 -80
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty2.mjs +80 -10
- package/es/components/empty/src/empty2.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +68 -279
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +279 -68
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +19 -19
- package/es/components/mention/src/mention-dropdown.mjs +14 -205
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +205 -14
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/pagination/src/components/jumper.mjs +69 -7
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +7 -69
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/popconfirm/src/popconfirm.mjs +2 -2
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +52 -256
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +256 -52
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +29 -96
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +96 -29
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +43 -27
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +27 -43
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/splitter/index.mjs +2 -2
- package/es/components/splitter/src/split-panel.mjs +186 -19
- package/es/components/splitter/src/split-panel.mjs.map +1 -1
- package/es/components/splitter/src/split-panel2.mjs +19 -186
- package/es/components/splitter/src/split-panel2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +1 -1
- package/es/components/tabs/src/tab-bar.mjs +10 -102
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +102 -10
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tooltip/src/trigger.mjs +104 -15
- package/es/components/tooltip/src/trigger.mjs.map +1 -1
- package/es/components/tooltip/src/trigger2.mjs +15 -104
- package/es/components/tooltip/src/trigger2.mjs.map +1 -1
- package/es/components/tour/index.mjs +1 -1
- package/es/components/tour/src/content.mjs +85 -42
- package/es/components/tour/src/content.mjs.map +1 -1
- package/es/components/tour/src/content2.mjs +42 -85
- package/es/components/tour/src/content2.mjs.map +1 -1
- package/es/components/tour/src/mask.mjs +82 -17
- package/es/components/tour/src/mask.mjs.map +1 -1
- package/es/components/tour/src/mask2.mjs +17 -82
- package/es/components/tour/src/mask2.mjs.map +1 -1
- package/es/components/tour/src/step.mjs +1 -1
- package/es/components/tour/src/tour.mjs +1 -1
- package/es/components/tour/src/tour2.mjs +2 -2
- package/es/components/transfer/index.mjs +2 -2
- package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +1 -1
- package/es/components/transfer/src/transfer.mjs +203 -69
- package/es/components/transfer/src/transfer.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +69 -203
- package/es/components/transfer/src/transfer2.mjs.map +1 -1
- package/es/components/upload/index.mjs +1 -1
- package/es/components/upload/src/upload-content.mjs +206 -34
- package/es/components/upload/src/upload-content.mjs.map +1 -1
- package/es/components/upload/src/upload-content2.mjs +34 -206
- package/es/components/upload/src/upload-content2.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +1 -1
- package/es/index.mjs +19 -19
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +30 -153
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +153 -30
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb.js +9 -37
- package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb2.js +37 -9
- package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
- package/lib/components/button/index.js +2 -2
- package/lib/components/button/src/button-group.js +1 -1
- package/lib/components/button/src/button.js +98 -70
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +70 -98
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +196 -24
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +24 -196
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/calendar/src/select-controller.js +98 -12
- package/lib/components/calendar/src/select-controller.js.map +1 -1
- package/lib/components/calendar/src/select-controller2.js +12 -98
- package/lib/components/calendar/src/select-controller2.js.map +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +42 -65
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +65 -42
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse-item.js +17 -118
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item2.js +118 -17
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/countdown/index.js +2 -2
- package/lib/components/countdown/src/countdown.js +21 -83
- package/lib/components/countdown/src/countdown.js.map +1 -1
- package/lib/components/countdown/src/countdown2.js +83 -21
- package/lib/components/countdown/src/countdown2.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +225 -32
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +32 -225
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/empty/index.js +2 -2
- package/lib/components/empty/src/empty.js +10 -80
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty2.js +80 -10
- package/lib/components/empty/src/empty2.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +68 -278
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +278 -68
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +19 -19
- package/lib/components/mention/src/mention-dropdown.js +15 -205
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +205 -15
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/pagination/src/components/jumper.js +69 -7
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/jumper2.js +7 -69
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/popconfirm/src/popconfirm.js +2 -2
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +52 -256
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +256 -52
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +31 -96
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +96 -31
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +43 -29
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +29 -43
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/splitter/index.js +2 -2
- package/lib/components/splitter/src/split-panel.js +186 -20
- package/lib/components/splitter/src/split-panel.js.map +1 -1
- package/lib/components/splitter/src/split-panel2.js +20 -186
- package/lib/components/splitter/src/split-panel2.js.map +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/tabs/src/tab-bar.js +10 -102
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +102 -10
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tooltip/src/trigger.js +104 -15
- package/lib/components/tooltip/src/trigger.js.map +1 -1
- package/lib/components/tooltip/src/trigger2.js +15 -104
- package/lib/components/tooltip/src/trigger2.js.map +1 -1
- package/lib/components/tour/index.js +1 -1
- package/lib/components/tour/src/content.js +85 -45
- package/lib/components/tour/src/content.js.map +1 -1
- package/lib/components/tour/src/content2.js +45 -85
- package/lib/components/tour/src/content2.js.map +1 -1
- package/lib/components/tour/src/mask.js +82 -17
- package/lib/components/tour/src/mask.js.map +1 -1
- package/lib/components/tour/src/mask2.js +17 -82
- package/lib/components/tour/src/mask2.js.map +1 -1
- package/lib/components/tour/src/step.js +1 -1
- package/lib/components/tour/src/tour.js +1 -1
- package/lib/components/tour/src/tour2.js +2 -2
- package/lib/components/transfer/index.js +2 -2
- package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +1 -1
- package/lib/components/transfer/src/transfer.js +203 -73
- package/lib/components/transfer/src/transfer.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +73 -203
- package/lib/components/transfer/src/transfer2.js.map +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/upload/src/upload-content.js +204 -32
- package/lib/components/upload/src/upload-content.js.map +1 -1
- package/lib/components/upload/src/upload-content2.js +32 -204
- package/lib/components/upload/src/upload-content2.js.map +1 -1
- package/lib/components/upload/src/upload2.js +1 -1
- package/lib/index.js +19 -19
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer.mjs","sources":["../../../../../../packages/components/transfer/src/transfer.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport {\n buildProps,\n definePropType,\n isArray,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type {\n ExtractPropTypes,\n ExtractPublicPropTypes,\n h as H,\n VNode,\n} from 'vue'\nimport type Transfer from './transfer.vue'\n\nexport type TransferKey = string | number\nexport type TransferDirection = 'left' | 'right'\n\nexport type TransferDataItem = Record<string, any>\n\nexport type renderContent = (\n h: typeof H,\n option: TransferDataItem\n) => VNode | VNode[]\n\nexport interface TransferFormat {\n noChecked?: string\n hasChecked?: string\n}\n\nexport interface TransferPropsAlias {\n label?: string\n key?: string\n disabled?: string\n}\n\nexport interface TransferCheckedState {\n leftChecked: TransferKey[]\n rightChecked: TransferKey[]\n}\n\nexport const LEFT_CHECK_CHANGE_EVENT = 'left-check-change'\nexport const RIGHT_CHECK_CHANGE_EVENT = 'right-check-change'\n\nexport const transferProps = buildProps({\n /**\n * @description data source\n */\n data: {\n type: definePropType<TransferDataItem[]>(Array),\n default: () => [],\n },\n /**\n * @description custom list titles\n */\n titles: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n /**\n * @description custom button texts\n */\n buttonTexts: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n /**\n * @description placeholder for the filter input\n */\n filterPlaceholder: String,\n /**\n * @description custom filter method\n */\n filterMethod: {\n type: definePropType<(query: string, item: TransferDataItem) => boolean>(\n Function\n ),\n },\n /**\n * @description key array of initially checked data items of the left list\n */\n leftDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description key array of initially checked data items of the right list\n */\n rightDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description custom render function for data items\n */\n renderContent: {\n type: definePropType<renderContent>(Function),\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description texts for checking status in list header\n */\n format: {\n type: definePropType<TransferFormat>(Object),\n default: () => ({}),\n },\n /**\n * @description whether Transfer is filterable\n */\n filterable: Boolean,\n /**\n * @description prop aliases for data source\n */\n props: {\n type: definePropType<TransferPropsAlias>(Object),\n default: () =>\n mutable({\n label: 'label',\n key: 'key',\n disabled: 'disabled',\n } as const),\n },\n /**\n * @description order strategy for elements in the target list. If set to `original`, the elements will keep the same order as the data source. If set to `push`, the newly added elements will be pushed to the bottom. If set to `unshift`, the newly added elements will be inserted on the top\n */\n targetOrder: {\n type: String,\n values: ['original', 'push', 'unshift'],\n default: 'original',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type TransferProps = ExtractPropTypes<typeof transferProps>\nexport type TransferPropsPublic = ExtractPublicPropTypes<typeof transferProps>\n\nexport const transferCheckedChangeFn = (\n value: TransferKey[],\n movedKeys?: TransferKey[]\n) => [value, movedKeys].every(isArray) || (isArray(value) && isNil(movedKeys))\n\nexport const transferEmits = {\n [CHANGE_EVENT]: (\n value: TransferKey[],\n direction: TransferDirection,\n movedKeys: TransferKey[]\n ) =>\n [value, movedKeys].every(isArray) && ['left', 'right'].includes(direction),\n [UPDATE_MODEL_EVENT]: (value: TransferKey[]) => isArray(value),\n [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n}\nexport type TransferEmits = typeof transferEmits\n\nexport type TransferInstance = InstanceType<typeof Transfer> & unknown\n"],"names":[],"mappings":";;;;;;AA2CO,MAAM,uBAA0B,GAAA,oBAAA;AAChC,MAAM,wBAA2B,GAAA,qBAAA;AAEjC,MAAM,gBAAgB,UAAW,CAAA;AAAA,EAItC,IAAM,EAAA;AAAA,IACJ,IAAA,EAAM,eAAmC,KAAK,CAAA;AAAA,IAC9C,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,eAAiC,KAAK,CAAA;AAAA,IAC5C,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAA,EAAM,eAAiC,KAAK,CAAA;AAAA,IAC5C,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,iBAAmB,EAAA,MAAA;AAAA,EAInB,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,cAAA;AAAA,MACJ,QAAA;AAAA,KACF;AAAA,GACF;AAAA,EAIA,kBAAoB,EAAA;AAAA,IAClB,IAAA,EAAM,eAA8B,KAAK,CAAA;AAAA,IACzC,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,mBAAqB,EAAA;AAAA,IACnB,IAAA,EAAM,eAA8B,KAAK,CAAA;AAAA,IACzC,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,aAAe,EAAA;AAAA,IACb,IAAA,EAAM,eAA8B,QAAQ,CAAA;AAAA,GAC9C;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAA,EAAM,eAA8B,KAAK,CAAA;AAAA,IACzC,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,eAA+B,MAAM,CAAA;AAAA,IAC3C,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA,EAIA,UAAY,EAAA,OAAA;AAAA,EAIZ,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAAmC,MAAM,CAAA;AAAA,IAC/C,OAAA,EAAS,MACP,OAAQ,CAAA;AAAA,MACN,KAAO,EAAA,OAAA;AAAA,MACP,GAAK,EAAA,KAAA;AAAA,MACL,QAAU,EAAA,UAAA;AAAA,KACF,CAAA;AAAA,GACd;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAM,EAAA,MAAA;AAAA,IACN,MAAQ,EAAA,CAAC,UAAY,EAAA,MAAA,EAAQ,SAAS,CAAA;AAAA,IACtC,OAAS,EAAA,UAAA;AAAA,GACX;AAAA,EAIA,aAAe,EAAA;AAAA,IACb,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AACF,CAAU,EAAA;AAIH,MAAM,uBAA0B,GAAA,CACrC,KACA,EAAA,SAAA,KACG,CAAC,KAAO,EAAA,SAAS,CAAE,CAAA,KAAA,CAAM,OAAO,CAAM,IAAA,OAAA,CAAQ,KAAK,CAAA,IAAK,MAAM,SAAS,EAAA;AAErE,MAAM,aAAgB,GAAA;AAAA,EAC3B,CAAC,YAAe,GAAA,CACd,OACA,SACA,EAAA,SAAA,KAEA,CAAC,KAAO,EAAA,SAAS,CAAE,CAAA,KAAA,CAAM,OAAO,CAAK,IAAA,CAAC,QAAQ,OAAO,CAAA,CAAE,SAAS,SAAS,CAAA;AAAA,EAC3E,CAAC,kBAAA,GAAqB,CAAC,KAAA,KAAyB,QAAQ,KAAK,CAAA;AAAA,EAC7D,CAAC,uBAA0B,GAAA,uBAAA;AAAA,EAC3B,CAAC,wBAA2B,GAAA,uBAAA;AAC9B;;;;"}
|
|
1
|
+
{"version":3,"file":"transfer.mjs","sources":["../../../../../../packages/components/transfer/src/transfer.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <transfer-panel\n ref=\"leftPanel\"\n :data=\"sourceData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :title=\"leftPanelTitle\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :default-checked=\"leftDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onSourceCheckedChange\"\n >\n <template #empty>\n <slot name=\"left-empty\" />\n </template>\n <slot name=\"left-footer\" />\n </transfer-panel>\n <div :class=\"ns.e('buttons')\">\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.rightChecked)\"\n @click=\"addToLeft\"\n >\n <el-icon><arrow-left /></el-icon>\n <span v-if=\"!isUndefined(buttonTexts[0])\">{{ buttonTexts[0] }}</span>\n </el-button>\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.leftChecked)\"\n @click=\"addToRight\"\n >\n <span v-if=\"!isUndefined(buttonTexts[1])\">{{ buttonTexts[1] }}</span>\n <el-icon><arrow-right /></el-icon>\n </el-button>\n </div>\n <transfer-panel\n ref=\"rightPanel\"\n :data=\"targetData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :title=\"rightPanelTitle\"\n :default-checked=\"rightDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onTargetCheckedChange\"\n >\n <template #empty>\n <slot name=\"right-empty\" />\n </template>\n <slot name=\"right-footer\" />\n </transfer-panel>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Comment, computed, h, reactive, ref, useSlots, watch } from 'vue'\nimport { debugWarn, isEmpty, isUndefined } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useFormItem } from '@element-plus/components/form'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { transferEmits, transferProps } from './transfer'\nimport {\n useCheckedChange,\n useComputedData,\n useMove,\n usePropsAlias,\n} from './composables'\nimport TransferPanel from './transfer-panel.vue'\n\nimport type {\n TransferCheckedState,\n TransferDataItem,\n TransferDirection,\n} from './transfer'\nimport type { TransferPanelInstance } from './transfer-panel'\n\ndefineOptions({\n name: 'ElTransfer',\n})\n\nconst props = defineProps(transferProps)\nconst emit = defineEmits(transferEmits)\nconst slots = useSlots()\n\nconst { t } = useLocale()\nconst ns = useNamespace('transfer')\nconst { formItem } = useFormItem()\n\nconst checkedState = reactive<TransferCheckedState>({\n leftChecked: [],\n rightChecked: [],\n})\n\nconst propsAlias = usePropsAlias(props)\n\nconst { sourceData, targetData } = useComputedData(props)\n\nconst { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(\n checkedState,\n emit\n)\n\nconst { addToLeft, addToRight } = useMove(props, checkedState, emit)\n\nconst leftPanel = ref<TransferPanelInstance>()\nconst rightPanel = ref<TransferPanelInstance>()\n\nconst clearQuery = (which: TransferDirection) => {\n switch (which) {\n case 'left':\n leftPanel.value!.query = ''\n break\n case 'right':\n rightPanel.value!.query = ''\n break\n }\n}\n\nconst hasButtonTexts = computed(() => props.buttonTexts.length === 2)\n\nconst leftPanelTitle = computed(\n () => props.titles[0] || t('el.transfer.titles.0')\n)\n\nconst rightPanelTitle = computed(\n () => props.titles[1] || t('el.transfer.titles.1')\n)\n\nconst panelFilterPlaceholder = computed(\n () => props.filterPlaceholder || t('el.transfer.filterPlaceholder')\n)\n\nwatch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nconst optionRender = computed(() => (option: TransferDataItem) => {\n if (props.renderContent) return props.renderContent(h, option)\n\n const defaultSlotVNodes = (slots.default?.({ option }) || []).filter(\n (node) => node.type !== Comment\n )\n if (defaultSlotVNodes.length) {\n return defaultSlotVNodes\n }\n\n return h(\n 'span',\n option[propsAlias.value.label] || option[propsAlias.value.key]\n )\n})\n\ndefineExpose({\n /** @description clear the filter keyword of a certain panel */\n clearQuery,\n /** @description left panel ref */\n leftPanel,\n /** @description right panel ref */\n rightPanel,\n})\n</script>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_createVNode","filterable","format","filterMethod","leftDefaultChecked","_withCtx","_renderSlot","_createElementVNode","buttonTexts","_toDisplayString","_createCommentVNode","rightDefaultChecked"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AACb,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEjB,IAAA,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AAClB,IAAA,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAC5B,IAAA,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA,CAAA;AAEjC,IAAA,MAAM,eAAe,QAA+B,CAAA;AAAA,MAClD,aAAa,EAAC;AAAA,MACd,cAAc,EAAC;AAAA,KAChB,CAAA,CAAA;AAEK,IAAA,MAAA,UAAA,GAAa,cAAc,KAAK,CAAA,CAAA;AAEtC,IAAA,MAAM,EAAE,UAAA,EAAY,UAAW,EAAA,GAAI,gBAAgB,KAAK,CAAA,CAAA;AAElD,IAAA,MAAA,EAAE,qBAAuB,EAAA,qBAAA,EAA0B,GAAA,gBAAA;AAAA,MACvD,YAAA;AAAA,MACA,IAAA;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,EAAE,SAAW,EAAA,UAAA,KAAe,OAAQ,CAAA,KAAA,EAAO,cAAc,IAAI,CAAA,CAAA;AAEnE,IAAA,MAAM,YAAY,GAA2B,EAAA,CAAA;AAC7C,IAAA,MAAM,aAAa,GAA2B,EAAA,CAAA;AAExC,IAAA,MAAA,UAAA,GAAa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EAAMD,MAAA,UAAA,CAAA;AAAA,YACN,iBAAe,YAAA,CAAA,KAAA;AAAA,YACf,aAAa,sBAAA,CAAA,KAAA;AAAA,YACb,YAAYE,IAAAA,CAAAA,UAAAA;AAAAA,YACZ,QAAQC,IAAAA,CAAAA,MAAAA;AAAAA,YACR,iBAAeC,IAAAA,CAAAA,YAAAA;AAAAA,YACf,OAAO,eAAA,CAAA,KAAA;AAAA,YACP,mBAAiBQ,IAAAA,CAAAA,mBAAAA;AAAAA,YACjB,OAAO,KAAM,CAAA,KAAA;AAAA,YACb,eAAA,EAAgBZ,MAAA,qBAAA,CAAA;AAAA,WAAA,EAAA;AAAA,YAEN,KAAA,EAAKM,QACd,MAA2B;AAAA,cAA3BC,UAAA,CAA2B,IAAA,CAAA,MAAA,EAAA,aAAA,CAAA;AAAA,aAAA,CAAA;AAAA,6BAE7B,MAA4B;AAAA,cAA5BA,UAAA,CAA4B,IAAA,CAAA,MAAA,EAAA,cAAA,CAAA;AAAA,aAAA,CAAA;AAAA;;;;;;;;;;;;"}
|
|
@@ -1,209 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import TransferPanel from './transfer-panel2.mjs';
|
|
7
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
-
import { useComputedData } from './composables/use-computed-data.mjs';
|
|
9
|
-
import { useMove } from './composables/use-move.mjs';
|
|
10
|
-
import { useCheckedChange } from './composables/use-checked-change.mjs';
|
|
11
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
12
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
13
|
-
import { useFormItem } from '../../form/src/hooks/use-form-item.mjs';
|
|
14
|
-
import { usePropsAlias } from './composables/use-props-alias.mjs';
|
|
15
|
-
import { debugWarn } from '../../../utils/error.mjs';
|
|
16
|
-
import { isEmpty, isUndefined } from '../../../utils/types.mjs';
|
|
1
|
+
import { isNil } from 'lodash-unified';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { mutable } from '../../../utils/typescript.mjs';
|
|
4
|
+
import { isArray } from '@vue/shared';
|
|
5
|
+
import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
|
|
17
6
|
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
const LEFT_CHECK_CHANGE_EVENT = "left-check-change";
|
|
8
|
+
const RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
|
|
9
|
+
const transferProps = buildProps({
|
|
10
|
+
data: {
|
|
11
|
+
type: definePropType(Array),
|
|
12
|
+
default: () => []
|
|
23
13
|
},
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
const optionRender = computed(() => (option) => {
|
|
77
|
-
var _a;
|
|
78
|
-
if (props.renderContent)
|
|
79
|
-
return props.renderContent(h, option);
|
|
80
|
-
const defaultSlotVNodes = (((_a = slots.default) == null ? void 0 : _a.call(slots, { option })) || []).filter(
|
|
81
|
-
(node) => node.type !== Comment
|
|
82
|
-
);
|
|
83
|
-
if (defaultSlotVNodes.length) {
|
|
84
|
-
return defaultSlotVNodes;
|
|
85
|
-
}
|
|
86
|
-
return h(
|
|
87
|
-
"span",
|
|
88
|
-
option[propsAlias.value.label] || option[propsAlias.value.key]
|
|
89
|
-
);
|
|
90
|
-
});
|
|
91
|
-
__expose({
|
|
92
|
-
clearQuery,
|
|
93
|
-
leftPanel,
|
|
94
|
-
rightPanel
|
|
95
|
-
});
|
|
96
|
-
return (_ctx, _cache) => {
|
|
97
|
-
return openBlock(), createElementBlock(
|
|
98
|
-
"div",
|
|
99
|
-
{
|
|
100
|
-
class: normalizeClass(unref(ns).b())
|
|
101
|
-
},
|
|
102
|
-
[
|
|
103
|
-
createVNode(TransferPanel, {
|
|
104
|
-
ref_key: "leftPanel",
|
|
105
|
-
ref: leftPanel,
|
|
106
|
-
data: unref(sourceData),
|
|
107
|
-
"option-render": optionRender.value,
|
|
108
|
-
placeholder: panelFilterPlaceholder.value,
|
|
109
|
-
title: leftPanelTitle.value,
|
|
110
|
-
filterable: _ctx.filterable,
|
|
111
|
-
format: _ctx.format,
|
|
112
|
-
"filter-method": _ctx.filterMethod,
|
|
113
|
-
"default-checked": _ctx.leftDefaultChecked,
|
|
114
|
-
props: props.props,
|
|
115
|
-
onCheckedChange: unref(onSourceCheckedChange)
|
|
116
|
-
}, {
|
|
117
|
-
empty: withCtx(() => [
|
|
118
|
-
renderSlot(_ctx.$slots, "left-empty")
|
|
119
|
-
]),
|
|
120
|
-
default: withCtx(() => [
|
|
121
|
-
renderSlot(_ctx.$slots, "left-footer")
|
|
122
|
-
]),
|
|
123
|
-
_: 3
|
|
124
|
-
}, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
|
|
125
|
-
createElementVNode(
|
|
126
|
-
"div",
|
|
127
|
-
{
|
|
128
|
-
class: normalizeClass(unref(ns).e("buttons"))
|
|
129
|
-
},
|
|
130
|
-
[
|
|
131
|
-
createVNode(unref(ElButton), {
|
|
132
|
-
type: "primary",
|
|
133
|
-
class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", hasButtonTexts.value)]),
|
|
134
|
-
disabled: unref(isEmpty)(checkedState.rightChecked),
|
|
135
|
-
onClick: unref(addToLeft)
|
|
136
|
-
}, {
|
|
137
|
-
default: withCtx(() => [
|
|
138
|
-
createVNode(unref(ElIcon), null, {
|
|
139
|
-
default: withCtx(() => [
|
|
140
|
-
createVNode(unref(ArrowLeft))
|
|
141
|
-
]),
|
|
142
|
-
_: 1
|
|
143
|
-
}),
|
|
144
|
-
!unref(isUndefined)(_ctx.buttonTexts[0]) ? (openBlock(), createElementBlock(
|
|
145
|
-
"span",
|
|
146
|
-
_hoisted_1,
|
|
147
|
-
toDisplayString(_ctx.buttonTexts[0]),
|
|
148
|
-
1
|
|
149
|
-
)) : createCommentVNode("v-if", true)
|
|
150
|
-
]),
|
|
151
|
-
_: 1
|
|
152
|
-
}, 8, ["class", "disabled", "onClick"]),
|
|
153
|
-
createVNode(unref(ElButton), {
|
|
154
|
-
type: "primary",
|
|
155
|
-
class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", hasButtonTexts.value)]),
|
|
156
|
-
disabled: unref(isEmpty)(checkedState.leftChecked),
|
|
157
|
-
onClick: unref(addToRight)
|
|
158
|
-
}, {
|
|
159
|
-
default: withCtx(() => [
|
|
160
|
-
!unref(isUndefined)(_ctx.buttonTexts[1]) ? (openBlock(), createElementBlock(
|
|
161
|
-
"span",
|
|
162
|
-
_hoisted_2,
|
|
163
|
-
toDisplayString(_ctx.buttonTexts[1]),
|
|
164
|
-
1
|
|
165
|
-
)) : createCommentVNode("v-if", true),
|
|
166
|
-
createVNode(unref(ElIcon), null, {
|
|
167
|
-
default: withCtx(() => [
|
|
168
|
-
createVNode(unref(ArrowRight))
|
|
169
|
-
]),
|
|
170
|
-
_: 1
|
|
171
|
-
})
|
|
172
|
-
]),
|
|
173
|
-
_: 1
|
|
174
|
-
}, 8, ["class", "disabled", "onClick"])
|
|
175
|
-
],
|
|
176
|
-
2
|
|
177
|
-
),
|
|
178
|
-
createVNode(TransferPanel, {
|
|
179
|
-
ref_key: "rightPanel",
|
|
180
|
-
ref: rightPanel,
|
|
181
|
-
data: unref(targetData),
|
|
182
|
-
"option-render": optionRender.value,
|
|
183
|
-
placeholder: panelFilterPlaceholder.value,
|
|
184
|
-
filterable: _ctx.filterable,
|
|
185
|
-
format: _ctx.format,
|
|
186
|
-
"filter-method": _ctx.filterMethod,
|
|
187
|
-
title: rightPanelTitle.value,
|
|
188
|
-
"default-checked": _ctx.rightDefaultChecked,
|
|
189
|
-
props: props.props,
|
|
190
|
-
onCheckedChange: unref(onTargetCheckedChange)
|
|
191
|
-
}, {
|
|
192
|
-
empty: withCtx(() => [
|
|
193
|
-
renderSlot(_ctx.$slots, "right-empty")
|
|
194
|
-
]),
|
|
195
|
-
default: withCtx(() => [
|
|
196
|
-
renderSlot(_ctx.$slots, "right-footer")
|
|
197
|
-
]),
|
|
198
|
-
_: 3
|
|
199
|
-
}, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
|
|
200
|
-
],
|
|
201
|
-
2
|
|
202
|
-
);
|
|
203
|
-
};
|
|
14
|
+
titles: {
|
|
15
|
+
type: definePropType(Array),
|
|
16
|
+
default: () => []
|
|
17
|
+
},
|
|
18
|
+
buttonTexts: {
|
|
19
|
+
type: definePropType(Array),
|
|
20
|
+
default: () => []
|
|
21
|
+
},
|
|
22
|
+
filterPlaceholder: String,
|
|
23
|
+
filterMethod: {
|
|
24
|
+
type: definePropType(
|
|
25
|
+
Function
|
|
26
|
+
)
|
|
27
|
+
},
|
|
28
|
+
leftDefaultChecked: {
|
|
29
|
+
type: definePropType(Array),
|
|
30
|
+
default: () => []
|
|
31
|
+
},
|
|
32
|
+
rightDefaultChecked: {
|
|
33
|
+
type: definePropType(Array),
|
|
34
|
+
default: () => []
|
|
35
|
+
},
|
|
36
|
+
renderContent: {
|
|
37
|
+
type: definePropType(Function)
|
|
38
|
+
},
|
|
39
|
+
modelValue: {
|
|
40
|
+
type: definePropType(Array),
|
|
41
|
+
default: () => []
|
|
42
|
+
},
|
|
43
|
+
format: {
|
|
44
|
+
type: definePropType(Object),
|
|
45
|
+
default: () => ({})
|
|
46
|
+
},
|
|
47
|
+
filterable: Boolean,
|
|
48
|
+
props: {
|
|
49
|
+
type: definePropType(Object),
|
|
50
|
+
default: () => mutable({
|
|
51
|
+
label: "label",
|
|
52
|
+
key: "key",
|
|
53
|
+
disabled: "disabled"
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
targetOrder: {
|
|
57
|
+
type: String,
|
|
58
|
+
values: ["original", "push", "unshift"],
|
|
59
|
+
default: "original"
|
|
60
|
+
},
|
|
61
|
+
validateEvent: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: true
|
|
204
64
|
}
|
|
205
65
|
});
|
|
206
|
-
|
|
66
|
+
const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray) || isArray(value) && isNil(movedKeys);
|
|
67
|
+
const transferEmits = {
|
|
68
|
+
[CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(isArray) && ["left", "right"].includes(direction),
|
|
69
|
+
[UPDATE_MODEL_EVENT]: (value) => isArray(value),
|
|
70
|
+
[LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
|
|
71
|
+
[RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
|
|
72
|
+
};
|
|
207
73
|
|
|
208
|
-
export {
|
|
74
|
+
export { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT, transferCheckedChangeFn, transferEmits, transferProps };
|
|
209
75
|
//# sourceMappingURL=transfer2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer2.mjs","sources":["../../../../../../packages/components/transfer/src/transfer.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <transfer-panel\n ref=\"leftPanel\"\n :data=\"sourceData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :title=\"leftPanelTitle\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :default-checked=\"leftDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onSourceCheckedChange\"\n >\n <template #empty>\n <slot name=\"left-empty\" />\n </template>\n <slot name=\"left-footer\" />\n </transfer-panel>\n <div :class=\"ns.e('buttons')\">\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.rightChecked)\"\n @click=\"addToLeft\"\n >\n <el-icon><arrow-left /></el-icon>\n <span v-if=\"!isUndefined(buttonTexts[0])\">{{ buttonTexts[0] }}</span>\n </el-button>\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.leftChecked)\"\n @click=\"addToRight\"\n >\n <span v-if=\"!isUndefined(buttonTexts[1])\">{{ buttonTexts[1] }}</span>\n <el-icon><arrow-right /></el-icon>\n </el-button>\n </div>\n <transfer-panel\n ref=\"rightPanel\"\n :data=\"targetData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :title=\"rightPanelTitle\"\n :default-checked=\"rightDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onTargetCheckedChange\"\n >\n <template #empty>\n <slot name=\"right-empty\" />\n </template>\n <slot name=\"right-footer\" />\n </transfer-panel>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Comment, computed, h, reactive, ref, useSlots, watch } from 'vue'\nimport { debugWarn, isEmpty, isUndefined } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useFormItem } from '@element-plus/components/form'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { transferEmits, transferProps } from './transfer'\nimport {\n useCheckedChange,\n useComputedData,\n useMove,\n usePropsAlias,\n} from './composables'\nimport TransferPanel from './transfer-panel.vue'\n\nimport type {\n TransferCheckedState,\n TransferDataItem,\n TransferDirection,\n} from './transfer'\nimport type { TransferPanelInstance } from './transfer-panel'\n\ndefineOptions({\n name: 'ElTransfer',\n})\n\nconst props = defineProps(transferProps)\nconst emit = defineEmits(transferEmits)\nconst slots = useSlots()\n\nconst { t } = useLocale()\nconst ns = useNamespace('transfer')\nconst { formItem } = useFormItem()\n\nconst checkedState = reactive<TransferCheckedState>({\n leftChecked: [],\n rightChecked: [],\n})\n\nconst propsAlias = usePropsAlias(props)\n\nconst { sourceData, targetData } = useComputedData(props)\n\nconst { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(\n checkedState,\n emit\n)\n\nconst { addToLeft, addToRight } = useMove(props, checkedState, emit)\n\nconst leftPanel = ref<TransferPanelInstance>()\nconst rightPanel = ref<TransferPanelInstance>()\n\nconst clearQuery = (which: TransferDirection) => {\n switch (which) {\n case 'left':\n leftPanel.value!.query = ''\n break\n case 'right':\n rightPanel.value!.query = ''\n break\n }\n}\n\nconst hasButtonTexts = computed(() => props.buttonTexts.length === 2)\n\nconst leftPanelTitle = computed(\n () => props.titles[0] || t('el.transfer.titles.0')\n)\n\nconst rightPanelTitle = computed(\n () => props.titles[1] || t('el.transfer.titles.1')\n)\n\nconst panelFilterPlaceholder = computed(\n () => props.filterPlaceholder || t('el.transfer.filterPlaceholder')\n)\n\nwatch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nconst optionRender = computed(() => (option: TransferDataItem) => {\n if (props.renderContent) return props.renderContent(h, option)\n\n const defaultSlotVNodes = (slots.default?.({ option }) || []).filter(\n (node) => node.type !== Comment\n )\n if (defaultSlotVNodes.length) {\n return defaultSlotVNodes\n }\n\n return h(\n 'span',\n option[propsAlias.value.label] || option[propsAlias.value.key]\n )\n})\n\ndefineExpose({\n /** @description clear the filter keyword of a certain panel */\n clearQuery,\n /** @description left panel ref */\n leftPanel,\n /** @description right panel ref */\n rightPanel,\n})\n</script>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_createVNode","filterable","format","filterMethod","leftDefaultChecked","_withCtx","_renderSlot","_createElementVNode","buttonTexts","_toDisplayString","_createCommentVNode","rightDefaultChecked"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AACb,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEjB,IAAA,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AAClB,IAAA,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAC5B,IAAA,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA,CAAA;AAEjC,IAAA,MAAM,eAAe,QAA+B,CAAA;AAAA,MAClD,aAAa,EAAC;AAAA,MACd,cAAc,EAAC;AAAA,KAChB,CAAA,CAAA;AAEK,IAAA,MAAA,UAAA,GAAa,cAAc,KAAK,CAAA,CAAA;AAEtC,IAAA,MAAM,EAAE,UAAA,EAAY,UAAW,EAAA,GAAI,gBAAgB,KAAK,CAAA,CAAA;AAElD,IAAA,MAAA,EAAE,qBAAuB,EAAA,qBAAA,EAA0B,GAAA,gBAAA;AAAA,MACvD,YAAA;AAAA,MACA,IAAA;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,EAAE,SAAW,EAAA,UAAA,KAAe,OAAQ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A,UAAA,CAAA,CAAA;AAAA,qBAAA,CAAA;AAAA;;;;;;;;UAG5BC,YAiBiB,aAAA,EAAA;AAAA,YAhBX,OAAA,EAAA,YAAA;AAAA,YAAJ,GAAI,EAAA,UAAA;AAAA,YACH,IAAA,EAAMD,MAAA,UAAA,CAAA;AAAA,YACN,iBAAe,YAAA,CAAA,KAAA;AAAA,YACf,aAAa,sBAAA,CAAA,KAAA;AAAA,YACb,YAAYE,IAAAA,CAAAA,UAAAA;AAAAA,YACZ,QAAQC,IAAAA,CAAAA,MAAAA;AAAAA,YACR,iBAAeC,IAAAA,CAAAA,YAAAA;AAAAA,YACf,OAAO,eAAA,CAAA,KAAA;AAAA,YACP,mBAAiBQ,IAAAA,CAAAA,mBAAAA;AAAAA,YACjB,OAAO,KAAM,CAAA,KAAA;AAAA,YACb,eAAA,EAAgBZ,MAAA,qBAAA,CAAA;AAAA,WAAA,EAAA;AAAA,YAEN,KAAA,EAAKM,QACd,MAA2B;AAAA,cAA3BC,UAAA,CAA2B,IAAA,CAAA,MAAA,EAAA,aAAA,CAAA;AAAA,aAAA,CAAA;AAAA,6BAE7B,MAA4B;AAAA,cAA5BA,UAAA,CAA4B,IAAA,CAAA,MAAA,EAAA,cAAA,CAAA;AAAA,aAAA,CAAA;AAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"transfer2.mjs","sources":["../../../../../../packages/components/transfer/src/transfer.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport {\n buildProps,\n definePropType,\n isArray,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type {\n ExtractPropTypes,\n ExtractPublicPropTypes,\n h as H,\n VNode,\n} from 'vue'\nimport type Transfer from './transfer.vue'\n\nexport type TransferKey = string | number\nexport type TransferDirection = 'left' | 'right'\n\nexport type TransferDataItem = Record<string, any>\n\nexport type renderContent = (\n h: typeof H,\n option: TransferDataItem\n) => VNode | VNode[]\n\nexport interface TransferFormat {\n noChecked?: string\n hasChecked?: string\n}\n\nexport interface TransferPropsAlias {\n label?: string\n key?: string\n disabled?: string\n}\n\nexport interface TransferCheckedState {\n leftChecked: TransferKey[]\n rightChecked: TransferKey[]\n}\n\nexport const LEFT_CHECK_CHANGE_EVENT = 'left-check-change'\nexport const RIGHT_CHECK_CHANGE_EVENT = 'right-check-change'\n\nexport const transferProps = buildProps({\n /**\n * @description data source\n */\n data: {\n type: definePropType<TransferDataItem[]>(Array),\n default: () => [],\n },\n /**\n * @description custom list titles\n */\n titles: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n /**\n * @description custom button texts\n */\n buttonTexts: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n /**\n * @description placeholder for the filter input\n */\n filterPlaceholder: String,\n /**\n * @description custom filter method\n */\n filterMethod: {\n type: definePropType<(query: string, item: TransferDataItem) => boolean>(\n Function\n ),\n },\n /**\n * @description key array of initially checked data items of the left list\n */\n leftDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description key array of initially checked data items of the right list\n */\n rightDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description custom render function for data items\n */\n renderContent: {\n type: definePropType<renderContent>(Function),\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n /**\n * @description texts for checking status in list header\n */\n format: {\n type: definePropType<TransferFormat>(Object),\n default: () => ({}),\n },\n /**\n * @description whether Transfer is filterable\n */\n filterable: Boolean,\n /**\n * @description prop aliases for data source\n */\n props: {\n type: definePropType<TransferPropsAlias>(Object),\n default: () =>\n mutable({\n label: 'label',\n key: 'key',\n disabled: 'disabled',\n } as const),\n },\n /**\n * @description order strategy for elements in the target list. If set to `original`, the elements will keep the same order as the data source. If set to `push`, the newly added elements will be pushed to the bottom. If set to `unshift`, the newly added elements will be inserted on the top\n */\n targetOrder: {\n type: String,\n values: ['original', 'push', 'unshift'],\n default: 'original',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type TransferProps = ExtractPropTypes<typeof transferProps>\nexport type TransferPropsPublic = ExtractPublicPropTypes<typeof transferProps>\n\nexport const transferCheckedChangeFn = (\n value: TransferKey[],\n movedKeys?: TransferKey[]\n) => [value, movedKeys].every(isArray) || (isArray(value) && isNil(movedKeys))\n\nexport const transferEmits = {\n [CHANGE_EVENT]: (\n value: TransferKey[],\n direction: TransferDirection,\n movedKeys: TransferKey[]\n ) =>\n [value, movedKeys].every(isArray) && ['left', 'right'].includes(direction),\n [UPDATE_MODEL_EVENT]: (value: TransferKey[]) => isArray(value),\n [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n}\nexport type TransferEmits = typeof transferEmits\n\nexport type TransferInstance = InstanceType<typeof Transfer> & unknown\n"],"names":[],"mappings":";;;;;;AA2CO,MAAM,uBAA0B,GAAA,oBAAA;AAChC,MAAM,wBAA2B,GAAA,qBAAA;AAEjC,MAAM,gBAAgB,UAAW,CAAA;AAAA,EAItC,IAAM,EAAA;AAAA,IACJ,IAAA,EAAM,eAAmC,KAAK,CAAA;AAAA,IAC9C,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,eAAiC,KAAK,CAAA;AAAA,IAC5C,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAA,EAAM,eAAiC,KAAK,CAAA;AAAA,IAC5C,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EAIA,iBAAmB,EAAA,MAAA;AAAA,EAInB,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,cAAA;AAAA,MACJ,QAAA;AAAA,KACF;AAAA,GACF;AAAA,EAIA,kBAAoB,EA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MAAM,aAAgB,GAAA;AAAA,EAC3B,CAAC,YAAe,GAAA,CACd,OACA,SACA,EAAA,SAAA,KAEA,CAAC,KAAO,EAAA,SAAS,CAAE,CAAA,KAAA,CAAM,OAAO,CAAK,IAAA,CAAC,QAAQ,OAAO,CAAA,CAAE,SAAS,SAAS,CAAA;AAAA,EAC3E,CAAC,kBAAA,GAAqB,CAAC,KAAA,KAAyB,QAAQ,KAAK,CAAA;AAAA,EAC7D,CAAC,uBAA0B,GAAA,uBAAA;AAAA,EAC3B,CAAC,wBAA2B,GAAA,uBAAA;AAC9B;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Upload from './src/upload2.mjs';
|
|
2
2
|
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './src/upload.mjs';
|
|
3
|
-
export { uploadContentProps } from './src/upload-
|
|
3
|
+
export { uploadContentProps } from './src/upload-content2.mjs';
|
|
4
4
|
export { uploadListEmits, uploadListProps } from './src/upload-list.mjs';
|
|
5
5
|
export { uploadDraggerEmits, uploadDraggerProps } from './src/upload-dragger.mjs';
|
|
6
6
|
export { uploadContextKey } from './src/constants.mjs';
|
|
@@ -1,40 +1,212 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent, shallowRef, openBlock, createElementBlock, normalizeClass, unref, withKeys, withModifiers, createBlock, withCtx, renderSlot, createElementVNode } from 'vue';
|
|
2
|
+
import { cloneDeep, isEqual } from 'lodash-unified';
|
|
3
|
+
import UploadDragger from './upload-dragger2.mjs';
|
|
4
|
+
import { uploadContentProps } from './upload-content2.mjs';
|
|
5
|
+
import { genFileId } from './upload.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { entriesOf } from '../../../utils/objects.mjs';
|
|
8
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
|
+
import { useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
|
|
10
|
+
import { isPlainObject, isFunction } from '@vue/shared';
|
|
4
11
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
const _hoisted_1 = ["tabindex", "aria-disabled", "onKeydown"];
|
|
13
|
+
const _hoisted_2 = ["name", "disabled", "multiple", "accept"];
|
|
14
|
+
const _sfc_main = defineComponent({
|
|
15
|
+
...{
|
|
16
|
+
name: "ElUploadContent",
|
|
17
|
+
inheritAttrs: false
|
|
10
18
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
__name: "upload-content",
|
|
20
|
+
props: uploadContentProps,
|
|
21
|
+
setup(__props, { expose: __expose }) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const ns = useNamespace("upload");
|
|
24
|
+
const disabled = useFormDisabled();
|
|
25
|
+
const requests = shallowRef(
|
|
26
|
+
{}
|
|
27
|
+
);
|
|
28
|
+
const inputRef = shallowRef();
|
|
29
|
+
const uploadFiles = (files) => {
|
|
30
|
+
if (files.length === 0)
|
|
31
|
+
return;
|
|
32
|
+
const { autoUpload, limit, fileList, multiple, onStart, onExceed } = props;
|
|
33
|
+
if (limit && fileList.length + files.length > limit) {
|
|
34
|
+
onExceed(files, fileList);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!multiple) {
|
|
38
|
+
files = files.slice(0, 1);
|
|
39
|
+
}
|
|
40
|
+
for (const file of files) {
|
|
41
|
+
const rawFile = file;
|
|
42
|
+
rawFile.uid = genFileId();
|
|
43
|
+
onStart(rawFile);
|
|
44
|
+
if (autoUpload)
|
|
45
|
+
upload(rawFile);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const upload = async (rawFile) => {
|
|
49
|
+
inputRef.value.value = "";
|
|
50
|
+
if (!props.beforeUpload) {
|
|
51
|
+
return doUpload(rawFile);
|
|
52
|
+
}
|
|
53
|
+
let hookResult;
|
|
54
|
+
let beforeData = {};
|
|
55
|
+
try {
|
|
56
|
+
const originData = props.data;
|
|
57
|
+
const beforeUploadPromise = props.beforeUpload(rawFile);
|
|
58
|
+
beforeData = isPlainObject(props.data) ? cloneDeep(props.data) : props.data;
|
|
59
|
+
hookResult = await beforeUploadPromise;
|
|
60
|
+
if (isPlainObject(props.data) && isEqual(originData, beforeData)) {
|
|
61
|
+
beforeData = cloneDeep(props.data);
|
|
62
|
+
}
|
|
63
|
+
} catch (e) {
|
|
64
|
+
hookResult = false;
|
|
65
|
+
}
|
|
66
|
+
if (hookResult === false) {
|
|
67
|
+
props.onRemove(rawFile);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
let file = rawFile;
|
|
71
|
+
if (hookResult instanceof Blob) {
|
|
72
|
+
if (hookResult instanceof File) {
|
|
73
|
+
file = hookResult;
|
|
74
|
+
} else {
|
|
75
|
+
file = new File([hookResult], rawFile.name, {
|
|
76
|
+
type: rawFile.type
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
doUpload(
|
|
81
|
+
Object.assign(file, {
|
|
82
|
+
uid: rawFile.uid
|
|
83
|
+
}),
|
|
84
|
+
beforeData
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
const resolveData = async (data, rawFile) => {
|
|
88
|
+
if (isFunction(data)) {
|
|
89
|
+
return data(rawFile);
|
|
90
|
+
}
|
|
91
|
+
return data;
|
|
92
|
+
};
|
|
93
|
+
const doUpload = async (rawFile, beforeData) => {
|
|
94
|
+
const {
|
|
95
|
+
headers,
|
|
96
|
+
data,
|
|
97
|
+
method,
|
|
98
|
+
withCredentials,
|
|
99
|
+
name: filename,
|
|
100
|
+
action,
|
|
101
|
+
onProgress,
|
|
102
|
+
onSuccess,
|
|
103
|
+
onError,
|
|
104
|
+
httpRequest
|
|
105
|
+
} = props;
|
|
106
|
+
try {
|
|
107
|
+
beforeData = await resolveData(beforeData != null ? beforeData : data, rawFile);
|
|
108
|
+
} catch (e) {
|
|
109
|
+
props.onRemove(rawFile);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const { uid } = rawFile;
|
|
113
|
+
const options = {
|
|
114
|
+
headers: headers || {},
|
|
115
|
+
withCredentials,
|
|
116
|
+
file: rawFile,
|
|
117
|
+
data: beforeData,
|
|
118
|
+
method,
|
|
119
|
+
filename,
|
|
120
|
+
action,
|
|
121
|
+
onProgress: (evt) => {
|
|
122
|
+
onProgress(evt, rawFile);
|
|
123
|
+
},
|
|
124
|
+
onSuccess: (res) => {
|
|
125
|
+
onSuccess(res, rawFile);
|
|
126
|
+
delete requests.value[uid];
|
|
127
|
+
},
|
|
128
|
+
onError: (err) => {
|
|
129
|
+
onError(err, rawFile);
|
|
130
|
+
delete requests.value[uid];
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const request = httpRequest(options);
|
|
134
|
+
requests.value[uid] = request;
|
|
135
|
+
if (request instanceof Promise) {
|
|
136
|
+
request.then(options.onSuccess, options.onError);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const handleChange = (e) => {
|
|
140
|
+
const files = e.target.files;
|
|
141
|
+
if (!files)
|
|
142
|
+
return;
|
|
143
|
+
uploadFiles(Array.from(files));
|
|
144
|
+
};
|
|
145
|
+
const handleClick = () => {
|
|
146
|
+
if (!disabled.value) {
|
|
147
|
+
inputRef.value.value = "";
|
|
148
|
+
inputRef.value.click();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const handleKeydown = () => {
|
|
152
|
+
handleClick();
|
|
153
|
+
};
|
|
154
|
+
const abort = (file) => {
|
|
155
|
+
const _reqs = entriesOf(requests.value).filter(
|
|
156
|
+
file ? ([uid]) => String(file.uid) === uid : () => true
|
|
157
|
+
);
|
|
158
|
+
_reqs.forEach(([uid, req]) => {
|
|
159
|
+
if (req instanceof XMLHttpRequest)
|
|
160
|
+
req.abort();
|
|
161
|
+
delete requests.value[uid];
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
__expose({
|
|
165
|
+
abort,
|
|
166
|
+
upload
|
|
167
|
+
});
|
|
168
|
+
return (_ctx, _cache) => {
|
|
169
|
+
return openBlock(), createElementBlock("div", {
|
|
170
|
+
class: normalizeClass([
|
|
171
|
+
unref(ns).b(),
|
|
172
|
+
unref(ns).m(_ctx.listType),
|
|
173
|
+
unref(ns).is("drag", _ctx.drag),
|
|
174
|
+
unref(ns).is("disabled", unref(disabled))
|
|
175
|
+
]),
|
|
176
|
+
tabindex: unref(disabled) ? void 0 : 0,
|
|
177
|
+
"aria-disabled": unref(disabled),
|
|
178
|
+
role: "button",
|
|
179
|
+
onClick: handleClick,
|
|
180
|
+
onKeydown: withKeys(withModifiers(handleKeydown, ["self"]), ["enter", "space"])
|
|
181
|
+
}, [
|
|
182
|
+
_ctx.drag ? (openBlock(), createBlock(UploadDragger, {
|
|
183
|
+
key: 0,
|
|
184
|
+
disabled: unref(disabled),
|
|
185
|
+
onFile: uploadFiles
|
|
186
|
+
}, {
|
|
187
|
+
default: withCtx(() => [
|
|
188
|
+
renderSlot(_ctx.$slots, "default")
|
|
189
|
+
]),
|
|
190
|
+
_: 3
|
|
191
|
+
}, 8, ["disabled"])) : renderSlot(_ctx.$slots, "default", { key: 1 }),
|
|
192
|
+
createElementVNode("input", {
|
|
193
|
+
ref_key: "inputRef",
|
|
194
|
+
ref: inputRef,
|
|
195
|
+
class: normalizeClass(unref(ns).e("input")),
|
|
196
|
+
name: _ctx.name,
|
|
197
|
+
disabled: unref(disabled),
|
|
198
|
+
multiple: _ctx.multiple,
|
|
199
|
+
accept: _ctx.accept,
|
|
200
|
+
type: "file",
|
|
201
|
+
onChange: handleChange,
|
|
202
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
203
|
+
}, ["stop"]))
|
|
204
|
+
}, null, 42, _hoisted_2)
|
|
205
|
+
], 42, _hoisted_1);
|
|
206
|
+
};
|
|
36
207
|
}
|
|
37
208
|
});
|
|
209
|
+
var UploadContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);
|
|
38
210
|
|
|
39
|
-
export {
|
|
211
|
+
export { UploadContent as default };
|
|
40
212
|
//# sourceMappingURL=upload-content.mjs.map
|