element-plus 1.3.0-beta.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +1014 -748
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +1012 -749
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/autocomplete/index.d.ts +12 -4
- package/es/components/autocomplete/src/index.mjs +11 -4
- package/es/components/autocomplete/src/index.mjs.map +1 -1
- package/es/components/autocomplete/src/index.vue.d.ts +6 -2
- package/es/components/avatar/index.d.ts +1 -1
- package/es/components/avatar/src/avatar.vue.d.ts +1 -1
- package/es/components/avatar/src/avatar2.mjs +3 -3
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/cascader/index.d.ts +60 -4
- package/es/components/cascader/src/index.mjs +13 -12
- package/es/components/cascader/src/index.mjs.map +1 -1
- package/es/components/cascader/src/index.vue.d.ts +30 -2
- package/es/components/dialog/index.d.ts +4 -0
- package/es/components/dialog/src/dialog.d.ts +1 -0
- package/es/components/dialog/src/dialog.mjs +4 -0
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +4 -0
- package/es/components/dialog/src/dialog2.mjs +12 -3
- package/es/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/components/drawer/index.d.ts +14 -0
- package/es/components/drawer/src/drawer.d.ts +1 -0
- package/es/components/drawer/src/drawer.vue.d.ts +14 -0
- package/es/components/drawer/src/drawer2.mjs +33 -29
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/empty/src/img-empty.mjs +13 -13
- package/es/components/empty/src/img-empty.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +3 -4
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/image-viewer/index.d.ts +1 -1
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +34 -23
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +2 -1
- package/es/components/index.mjs.map +1 -1
- package/es/components/message-box/src/index.mjs +133 -113
- package/es/components/message-box/src/index.mjs.map +1 -1
- package/es/components/message-box/src/index.vue.d.ts +14 -4
- package/es/components/message-box/src/message-box.type.d.ts +2 -0
- package/es/components/pagination/src/components/jumper.mjs +6 -3
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.mjs +7 -3
- package/es/components/pagination/src/components/sizes.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.vue.d.ts +3 -0
- package/es/components/pagination/src/components/total.mjs +10 -4
- package/es/components/pagination/src/components/total.mjs.map +1 -1
- package/es/components/pagination/src/components/total.vue.d.ts +1 -0
- package/es/components/pagination/src/pagination.mjs +12 -1
- package/es/components/pagination/src/pagination.mjs.map +1 -1
- package/es/components/popconfirm/index.d.ts +26 -22
- package/es/components/popconfirm/src/popconfirm.d.ts +12 -11
- package/es/components/popconfirm/src/popconfirm.mjs +48 -43
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +26 -22
- package/es/components/popconfirm/src/popconfirm2.mjs +8 -3
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popover/index.d.ts +30 -0
- package/es/components/popover/src/index.mjs +21 -6
- package/es/components/popover/src/index.mjs.map +1 -1
- package/es/components/popover/src/index.vue.d.ts +41 -26
- package/es/components/popover/src/popover.d.ts +5 -0
- package/es/components/popover/src/popover.mjs +2 -0
- package/es/components/popover/src/popover.mjs.map +1 -1
- package/es/components/popper/index.d.ts +1 -0
- package/es/components/popper/index.mjs +1 -0
- package/es/components/popper/index.mjs.map +1 -1
- package/es/components/popper/src/deprecation.d.ts +3 -0
- package/es/components/popper/src/deprecation.mjs +24 -0
- package/es/components/popper/src/deprecation.mjs.map +1 -0
- package/es/components/rate/index.d.ts +8 -8
- package/es/components/rate/src/rate.d.ts +4 -4
- package/es/components/rate/src/rate.mjs +8 -4
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate.vue.d.ts +8 -8
- package/es/components/scrollbar/index.d.ts +13 -1
- package/es/components/scrollbar/index.mjs +1 -1
- package/es/components/scrollbar/index.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.d.ts +5 -5
- package/es/components/scrollbar/src/bar.mjs +18 -6
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.vue.d.ts +18 -37
- package/es/components/scrollbar/src/bar2.mjs +34 -118
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +12 -0
- package/es/components/scrollbar/src/scrollbar2.mjs +26 -29
- package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb.d.ts +9 -0
- package/es/components/scrollbar/src/thumb.mjs +15 -0
- package/es/components/scrollbar/src/thumb.mjs.map +1 -0
- package/es/components/scrollbar/src/thumb.vue.d.ts +54 -0
- package/es/components/scrollbar/src/thumb2.mjs +141 -0
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -0
- package/es/components/select/index.d.ts +6 -2
- package/es/components/select/src/select.mjs +16 -6
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/select.vue.d.ts +30 -26
- package/es/components/select-v2/index.d.ts +12 -12
- package/es/components/select-v2/src/defaults.d.ts +2 -1
- package/es/components/select-v2/src/defaults.mjs +4 -1
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +2 -2
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +6 -6
- package/es/components/select-v2/src/useSelect.d.ts +1 -4
- package/es/components/select-v2/src/useSelect.mjs +4 -2
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/skeleton/index.d.ts +37 -2
- package/es/components/skeleton/src/skeleton-item.vue.d.ts +13 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +10 -2
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +11 -0
- package/es/components/skeleton/src/skeleton2.mjs +11 -8
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/table/src/table/style-helper.mjs +2 -0
- package/es/components/table/src/table/style-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/index.mjs +1 -1
- package/es/components/table/src/table-body/index.mjs.map +1 -1
- package/es/components/table/src/table.mjs +3 -2
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/tag/index.d.ts +12 -1
- package/es/components/tag/src/tag.vue.d.ts +12 -1
- package/es/components/tag/src/tag2.mjs +23 -18
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/tree/index.d.ts +8 -8
- package/es/components/tree/src/tree.mjs +0 -1
- package/es/components/tree/src/tree.mjs.map +1 -1
- package/es/components/tree/src/tree.vue.d.ts +4 -4
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.mjs +2 -0
- package/es/hooks/index.mjs.map +1 -1
- package/es/hooks/use-deprecated/index.d.ts +10 -0
- package/es/hooks/use-deprecated/index.mjs +17 -0
- package/es/hooks/use-deprecated/index.mjs.map +1 -0
- package/es/hooks/use-draggable/index.d.ts +2 -0
- package/es/hooks/use-draggable/index.mjs +65 -0
- package/es/hooks/use-draggable/index.mjs.map +1 -0
- package/es/index.mjs +4 -1
- package/es/index.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/index.d.ts +12 -4
- package/lib/components/autocomplete/src/index.js +11 -4
- package/lib/components/autocomplete/src/index.js.map +1 -1
- package/lib/components/autocomplete/src/index.vue.d.ts +6 -2
- package/lib/components/avatar/index.d.ts +1 -1
- package/lib/components/avatar/src/avatar.vue.d.ts +1 -1
- package/lib/components/avatar/src/avatar2.js +3 -3
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/cascader/index.d.ts +60 -4
- package/lib/components/cascader/src/index.js +13 -12
- package/lib/components/cascader/src/index.js.map +1 -1
- package/lib/components/cascader/src/index.vue.d.ts +30 -2
- package/lib/components/dialog/index.d.ts +4 -0
- package/lib/components/dialog/src/dialog.d.ts +1 -0
- package/lib/components/dialog/src/dialog.js +4 -0
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +4 -0
- package/lib/components/dialog/src/dialog2.js +11 -2
- package/lib/components/dialog/src/dialog2.js.map +1 -1
- package/lib/components/drawer/index.d.ts +14 -0
- package/lib/components/drawer/src/drawer.d.ts +1 -0
- package/lib/components/drawer/src/drawer.vue.d.ts +14 -0
- package/lib/components/drawer/src/drawer2.js +33 -29
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/empty/src/img-empty.js +13 -13
- package/lib/components/empty/src/img-empty.js.map +1 -1
- package/lib/components/image/src/image2.js +3 -4
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/image-viewer/index.d.ts +1 -1
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +34 -23
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +4 -2
- package/lib/components/index.js.map +1 -1
- package/lib/components/message-box/src/index.js +140 -120
- package/lib/components/message-box/src/index.js.map +1 -1
- package/lib/components/message-box/src/index.vue.d.ts +14 -4
- package/lib/components/message-box/src/message-box.type.d.ts +2 -0
- package/lib/components/pagination/src/components/jumper.js +6 -3
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.js +7 -3
- package/lib/components/pagination/src/components/sizes.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.vue.d.ts +3 -0
- package/lib/components/pagination/src/components/total.js +10 -4
- package/lib/components/pagination/src/components/total.js.map +1 -1
- package/lib/components/pagination/src/components/total.vue.d.ts +1 -0
- package/lib/components/pagination/src/pagination.js +12 -1
- package/lib/components/pagination/src/pagination.js.map +1 -1
- package/lib/components/popconfirm/index.d.ts +26 -22
- package/lib/components/popconfirm/src/popconfirm.d.ts +12 -11
- package/lib/components/popconfirm/src/popconfirm.js +48 -43
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +26 -22
- package/lib/components/popconfirm/src/popconfirm2.js +8 -3
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popover/index.d.ts +30 -0
- package/lib/components/popover/src/index.js +21 -6
- package/lib/components/popover/src/index.js.map +1 -1
- package/lib/components/popover/src/index.vue.d.ts +41 -26
- package/lib/components/popover/src/popover.d.ts +5 -0
- package/lib/components/popover/src/popover.js +2 -0
- package/lib/components/popover/src/popover.js.map +1 -1
- package/lib/components/popper/index.d.ts +1 -0
- package/lib/components/popper/index.js +2 -0
- package/lib/components/popper/index.js.map +1 -1
- package/lib/components/popper/src/deprecation.d.ts +3 -0
- package/lib/components/popper/src/deprecation.js +28 -0
- package/lib/components/popper/src/deprecation.js.map +1 -0
- package/lib/components/rate/index.d.ts +8 -8
- package/lib/components/rate/src/rate.d.ts +4 -4
- package/lib/components/rate/src/rate.js +8 -4
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate.vue.d.ts +8 -8
- package/lib/components/scrollbar/index.d.ts +13 -1
- package/lib/components/scrollbar/index.js +2 -2
- package/lib/components/scrollbar/index.js.map +1 -1
- package/lib/components/scrollbar/src/bar.d.ts +5 -5
- package/lib/components/scrollbar/src/bar.js +18 -6
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar.vue.d.ts +18 -37
- package/lib/components/scrollbar/src/bar2.js +33 -117
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +12 -0
- package/lib/components/scrollbar/src/scrollbar2.js +25 -28
- package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
- package/lib/components/scrollbar/src/thumb.d.ts +9 -0
- package/lib/components/scrollbar/src/thumb.js +19 -0
- package/lib/components/scrollbar/src/thumb.js.map +1 -0
- package/lib/components/scrollbar/src/thumb.vue.d.ts +54 -0
- package/lib/components/scrollbar/src/thumb2.js +145 -0
- package/lib/components/scrollbar/src/thumb2.js.map +1 -0
- package/lib/components/select/index.d.ts +6 -2
- package/lib/components/select/src/select.js +16 -6
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/select.vue.d.ts +30 -26
- package/lib/components/select-v2/index.d.ts +12 -12
- package/lib/components/select-v2/src/defaults.d.ts +2 -1
- package/lib/components/select-v2/src/defaults.js +4 -1
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/components/select-v2/src/select.js +2 -2
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +6 -6
- package/lib/components/select-v2/src/useSelect.d.ts +1 -4
- package/lib/components/select-v2/src/useSelect.js +11 -9
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/skeleton/index.d.ts +37 -2
- package/lib/components/skeleton/src/skeleton-item.vue.d.ts +13 -1
- package/lib/components/skeleton/src/skeleton-item2.js +10 -2
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +11 -0
- package/lib/components/skeleton/src/skeleton2.js +12 -9
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/table/src/table/style-helper.js +2 -0
- package/lib/components/table/src/table/style-helper.js.map +1 -1
- package/lib/components/table/src/table-body/index.js +1 -1
- package/lib/components/table/src/table-body/index.js.map +1 -1
- package/lib/components/table/src/table.js +3 -2
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/tag/index.d.ts +12 -1
- package/lib/components/tag/src/tag.vue.d.ts +12 -1
- package/lib/components/tag/src/tag2.js +23 -18
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/tree/index.d.ts +8 -8
- package/lib/components/tree/src/tree.js +0 -1
- package/lib/components/tree/src/tree.js.map +1 -1
- package/lib/components/tree/src/tree.vue.d.ts +4 -4
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +62 -58
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-deprecated/index.d.ts +10 -0
- package/lib/hooks/use-deprecated/index.js +21 -0
- package/lib/hooks/use-deprecated/index.js.map +1 -0
- package/lib/hooks/use-draggable/index.d.ts +2 -0
- package/lib/hooks/use-draggable/index.js +69 -0
- package/lib/hooks/use-draggable/index.js.map +1 -0
- package/lib/index.js +66 -60
- package/lib/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -3
- package/tags.json +1 -1
- package/theme-chalk/el-breadcrumb.css +1 -1
- package/theme-chalk/el-dialog.css +1 -1
- package/theme-chalk/el-empty.css +1 -1
- package/theme-chalk/el-image-viewer.css +1 -1
- package/theme-chalk/el-message-box.css +1 -1
- package/theme-chalk/el-pagination.css +1 -1
- package/theme-chalk/el-popper.css +1 -1
- package/theme-chalk/el-rate.css +1 -1
- package/theme-chalk/el-select.css +1 -1
- package/theme-chalk/el-table.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/breadcrumb.scss +2 -0
- package/theme-chalk/src/common/var.scss +18 -4
- package/theme-chalk/src/dialog.scss +7 -0
- package/theme-chalk/src/image-viewer.scss +1 -0
- package/theme-chalk/src/message-box.scss +26 -15
- package/theme-chalk/src/pagination.scss +73 -56
- package/theme-chalk/src/popper.scss +6 -6
- package/theme-chalk/src/select.scss +3 -3
- package/theme-chalk/src/table.scss +0 -12
- package/web-types.json +1 -1
package/lib/components/index.js
CHANGED
|
@@ -111,6 +111,7 @@ var popconfirm = require('./popconfirm/src/popconfirm.js');
|
|
|
111
111
|
var arrow = require('./popper/src/arrow.js');
|
|
112
112
|
var trigger = require('./popper/src/trigger.js');
|
|
113
113
|
var content = require('./popper/src/content.js');
|
|
114
|
+
var deprecation = require('./popper/src/deprecation.js');
|
|
114
115
|
var popper = require('./popper/src/popper.js');
|
|
115
116
|
var tokens = require('./popper/src/tokens.js');
|
|
116
117
|
var progress = require('./progress/src/progress.js');
|
|
@@ -122,7 +123,7 @@ var result = require('./result/src/result.js');
|
|
|
122
123
|
var row = require('./row/src/row.js');
|
|
123
124
|
var util = require('./scrollbar/src/util.js');
|
|
124
125
|
var scrollbar = require('./scrollbar/src/scrollbar.js');
|
|
125
|
-
var
|
|
126
|
+
var thumb = require('./scrollbar/src/thumb.js');
|
|
126
127
|
var token = require('./select/src/token.js');
|
|
127
128
|
var token$1 = require('./select-v2/src/token.js');
|
|
128
129
|
var skeleton = require('./skeleton/src/skeleton.js');
|
|
@@ -317,6 +318,7 @@ exports.popconfirmProps = popconfirm.popconfirmProps;
|
|
|
317
318
|
exports.ElPopperArrow = arrow["default"];
|
|
318
319
|
exports.ElPopperTrigger = trigger["default"];
|
|
319
320
|
exports.ElPopperContent = content["default"];
|
|
321
|
+
exports.useDeprecateAppendToBody = deprecation.useDeprecateAppendToBody;
|
|
320
322
|
exports.Effect = popper.Effect;
|
|
321
323
|
exports.usePopperArrowProps = popper.usePopperArrowProps;
|
|
322
324
|
exports.usePopperContentProps = popper.usePopperContentProps;
|
|
@@ -343,7 +345,7 @@ exports.BAR_MAP = util.BAR_MAP;
|
|
|
343
345
|
exports.renderThumbStyle = util.renderThumbStyle;
|
|
344
346
|
exports.scrollbarEmits = scrollbar.scrollbarEmits;
|
|
345
347
|
exports.scrollbarProps = scrollbar.scrollbarProps;
|
|
346
|
-
exports.
|
|
348
|
+
exports.thumbProps = thumb.thumbProps;
|
|
347
349
|
exports.selectGroupKey = token.selectGroupKey;
|
|
348
350
|
exports.selectKey = token.selectKey;
|
|
349
351
|
exports.selectV2InjectionKey = token$1.selectV2InjectionKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -18,10 +18,12 @@ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper
|
|
|
18
18
|
var index = require('../../../directives/trap-focus/index.js');
|
|
19
19
|
var index$5 = require('../../../hooks/use-locale/index.js');
|
|
20
20
|
var index$6 = require('../../../hooks/use-common-props/index.js');
|
|
21
|
-
var index$7 = require('../../../hooks/use-
|
|
22
|
-
var index$8 = require('../../../hooks/use-
|
|
23
|
-
var index$9 = require('../../../hooks/use-
|
|
24
|
-
var index$a = require('../../../hooks/use-
|
|
21
|
+
var index$7 = require('../../../hooks/use-draggable/index.js');
|
|
22
|
+
var index$8 = require('../../../hooks/use-same-target/index.js');
|
|
23
|
+
var index$9 = require('../../../hooks/use-modal/index.js');
|
|
24
|
+
var index$a = require('../../../hooks/use-prevent-global/index.js');
|
|
25
|
+
var index$b = require('../../../hooks/use-lockscreen/index.js');
|
|
26
|
+
var index$c = require('../../../hooks/use-restore-active/index.js');
|
|
25
27
|
|
|
26
28
|
const _sfc_main = vue.defineComponent({
|
|
27
29
|
name: "ElMessageBox",
|
|
@@ -66,6 +68,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
66
68
|
default: true
|
|
67
69
|
},
|
|
68
70
|
center: Boolean,
|
|
71
|
+
draggable: Boolean,
|
|
69
72
|
roundButton: {
|
|
70
73
|
default: false,
|
|
71
74
|
type: Boolean
|
|
@@ -124,8 +127,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
124
127
|
const btnSize = index$6.useSize(vue.computed(() => props.buttonSize), { prop: true, form: true, formItem: true });
|
|
125
128
|
const iconComponent = vue.computed(() => state.icon || icon.TypeComponentsMap[state.type] || "");
|
|
126
129
|
const hasMessage = vue.computed(() => !!state.message);
|
|
127
|
-
const
|
|
128
|
-
const
|
|
130
|
+
const rootRef = vue.ref();
|
|
131
|
+
const headerRef = vue.ref();
|
|
132
|
+
const inputRef = vue.ref();
|
|
133
|
+
const confirmRef = vue.ref();
|
|
129
134
|
const confirmButtonClasses = vue.computed(() => state.confirmButtonClass);
|
|
130
135
|
vue.watch(() => state.inputValue, async (val) => {
|
|
131
136
|
await vue.nextTick();
|
|
@@ -156,6 +161,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
156
161
|
state.validateError = false;
|
|
157
162
|
}
|
|
158
163
|
});
|
|
164
|
+
const draggable = vue.computed(() => props.draggable);
|
|
165
|
+
index$7.useDraggable(rootRef, headerRef, draggable);
|
|
159
166
|
vue.onMounted(async () => {
|
|
160
167
|
await vue.nextTick();
|
|
161
168
|
if (props.closeOnHashChange) {
|
|
@@ -181,6 +188,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
181
188
|
handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
|
|
182
189
|
}
|
|
183
190
|
};
|
|
191
|
+
const overlayEvent = index$8.useSameTarget(handleWrapperClick);
|
|
184
192
|
const handleInputEnter = () => {
|
|
185
193
|
if (state.inputType !== "textarea") {
|
|
186
194
|
return handleAction("confirm");
|
|
@@ -233,24 +241,27 @@ const _sfc_main = vue.defineComponent({
|
|
|
233
241
|
handleAction("close");
|
|
234
242
|
};
|
|
235
243
|
if (props.closeOnPressEscape) {
|
|
236
|
-
index$
|
|
244
|
+
index$9.useModal({
|
|
237
245
|
handleClose
|
|
238
246
|
}, visible);
|
|
239
247
|
} else {
|
|
240
|
-
index$
|
|
248
|
+
index$a.usePreventGlobal(visible, "keydown", (e) => e.code === aria.EVENT_CODE.esc);
|
|
241
249
|
}
|
|
242
250
|
if (props.lockScroll) {
|
|
243
|
-
index$
|
|
251
|
+
index$b.useLockscreen(visible);
|
|
244
252
|
}
|
|
245
|
-
index$
|
|
253
|
+
index$c.useRestoreActive(visible);
|
|
246
254
|
return {
|
|
247
255
|
...vue.toRefs(state),
|
|
256
|
+
overlayEvent,
|
|
248
257
|
visible,
|
|
249
258
|
hasMessage,
|
|
250
259
|
typeClass,
|
|
251
260
|
btnSize,
|
|
252
261
|
iconComponent,
|
|
253
262
|
confirmButtonClasses,
|
|
263
|
+
rootRef,
|
|
264
|
+
headerRef,
|
|
254
265
|
inputRef,
|
|
255
266
|
confirmRef,
|
|
256
267
|
doClose,
|
|
@@ -265,6 +276,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
265
276
|
const _hoisted_1 = ["aria-label"];
|
|
266
277
|
const _hoisted_2 = {
|
|
267
278
|
key: 0,
|
|
279
|
+
ref: "headerRef",
|
|
268
280
|
class: "el-message-box__header"
|
|
269
281
|
};
|
|
270
282
|
const _hoisted_3 = { class: "el-message-box__title" };
|
|
@@ -287,137 +299,145 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
287
299
|
const _directive_trap_focus = vue.resolveDirective("trap-focus");
|
|
288
300
|
return vue.openBlock(), vue.createBlock(vue.Transition, {
|
|
289
301
|
name: "fade-in-linear",
|
|
290
|
-
onAfterLeave: _cache[
|
|
302
|
+
onAfterLeave: _cache[11] || (_cache[11] = ($event) => _ctx.$emit("vanish"))
|
|
291
303
|
}, {
|
|
292
304
|
default: vue.withCtx(() => [
|
|
293
305
|
vue.withDirectives(vue.createVNode(_component_el_overlay, {
|
|
294
306
|
"z-index": _ctx.zIndex,
|
|
295
307
|
"overlay-class": ["is-message-box", _ctx.modalClass],
|
|
296
|
-
mask: _ctx.modal
|
|
297
|
-
onClick: vue.withModifiers(_ctx.handleWrapperClick, ["self"])
|
|
308
|
+
mask: _ctx.modal
|
|
298
309
|
}, {
|
|
299
310
|
default: vue.withCtx(() => [
|
|
300
|
-
vue.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
class: vue.normalizeClass([
|
|
306
|
-
"el-message-box",
|
|
307
|
-
_ctx.customClass,
|
|
308
|
-
{ "el-message-box--center": _ctx.center }
|
|
309
|
-
]),
|
|
310
|
-
style: vue.normalizeStyle(_ctx.customStyle)
|
|
311
|
+
vue.createElementVNode("div", {
|
|
312
|
+
class: "el-overlay-message-box",
|
|
313
|
+
onClick: _cache[8] || (_cache[8] = (...args) => _ctx.overlayEvent.onClick && _ctx.overlayEvent.onClick(...args)),
|
|
314
|
+
onMousedown: _cache[9] || (_cache[9] = (...args) => _ctx.overlayEvent.onMousedown && _ctx.overlayEvent.onMousedown(...args)),
|
|
315
|
+
onMouseup: _cache[10] || (_cache[10] = (...args) => _ctx.overlayEvent.onMouseup && _ctx.overlayEvent.onMouseup(...args))
|
|
311
316
|
}, [
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
317
|
+
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
318
|
+
ref: "rootRef",
|
|
319
|
+
role: "dialog",
|
|
320
|
+
"aria-label": _ctx.title || "dialog",
|
|
321
|
+
"aria-modal": "true",
|
|
322
|
+
class: vue.normalizeClass([
|
|
323
|
+
"el-message-box",
|
|
324
|
+
_ctx.customClass,
|
|
325
|
+
{ "el-message-box--center": _ctx.center, "is-draggable": _ctx.draggable }
|
|
326
|
+
]),
|
|
327
|
+
style: vue.normalizeStyle(_ctx.customStyle),
|
|
328
|
+
onClick: _cache[7] || (_cache[7] = vue.withModifiers(() => {
|
|
329
|
+
}, ["stop"]))
|
|
330
|
+
}, [
|
|
331
|
+
_ctx.title !== null && _ctx.title !== void 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
332
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
333
|
+
_ctx.iconComponent && _ctx.center ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
334
|
+
key: 0,
|
|
335
|
+
class: vue.normalizeClass(["el-message-box__status", _ctx.typeClass])
|
|
336
|
+
}, {
|
|
337
|
+
default: vue.withCtx(() => [
|
|
338
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.iconComponent)))
|
|
339
|
+
]),
|
|
340
|
+
_: 1
|
|
341
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
|
342
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.title), 1)
|
|
343
|
+
]),
|
|
344
|
+
_ctx.showClose ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
315
345
|
key: 0,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
]),
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
346
|
+
type: "button",
|
|
347
|
+
class: "el-message-box__headerbtn",
|
|
348
|
+
"aria-label": "Close",
|
|
349
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel")),
|
|
350
|
+
onKeydown: _cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers(($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"]))
|
|
351
|
+
}, [
|
|
352
|
+
vue.createVNode(_component_el_icon, { class: "el-message-box__close" }, {
|
|
353
|
+
default: vue.withCtx(() => [
|
|
354
|
+
vue.createVNode(_component_close)
|
|
355
|
+
]),
|
|
356
|
+
_: 1
|
|
357
|
+
})
|
|
358
|
+
], 32)) : vue.createCommentVNode("v-if", true)
|
|
359
|
+
], 512)) : vue.createCommentVNode("v-if", true),
|
|
360
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
361
|
+
vue.createElementVNode("div", _hoisted_5, [
|
|
362
|
+
_ctx.iconComponent && !_ctx.center && _ctx.hasMessage ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
363
|
+
key: 0,
|
|
364
|
+
class: vue.normalizeClass(["el-message-box__status", _ctx.typeClass])
|
|
365
|
+
}, {
|
|
366
|
+
default: vue.withCtx(() => [
|
|
367
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.iconComponent)))
|
|
368
|
+
]),
|
|
369
|
+
_: 1
|
|
370
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
|
371
|
+
_ctx.hasMessage ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
372
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
373
|
+
!_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_7, vue.toDisplayString(_ctx.message), 1)) : (vue.openBlock(), vue.createElementBlock("p", {
|
|
374
|
+
key: 1,
|
|
375
|
+
innerHTML: _ctx.message
|
|
376
|
+
}, null, 8, _hoisted_8))
|
|
377
|
+
])
|
|
378
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
379
|
+
]),
|
|
380
|
+
vue.withDirectives(vue.createElementVNode("div", _hoisted_9, [
|
|
381
|
+
vue.createVNode(_component_el_input, {
|
|
382
|
+
ref: "inputRef",
|
|
383
|
+
modelValue: _ctx.inputValue,
|
|
384
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.inputValue = $event),
|
|
385
|
+
type: _ctx.inputType,
|
|
386
|
+
placeholder: _ctx.inputPlaceholder,
|
|
387
|
+
class: vue.normalizeClass({ invalid: _ctx.validateError }),
|
|
388
|
+
onKeydown: vue.withKeys(vue.withModifiers(_ctx.handleInputEnter, ["prevent"]), ["enter"])
|
|
389
|
+
}, null, 8, ["modelValue", "type", "placeholder", "class", "onKeydown"]),
|
|
390
|
+
vue.createElementVNode("div", {
|
|
391
|
+
class: "el-message-box__errormsg",
|
|
392
|
+
style: vue.normalizeStyle({
|
|
393
|
+
visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden"
|
|
394
|
+
})
|
|
395
|
+
}, vue.toDisplayString(_ctx.editorErrorMessage), 5)
|
|
396
|
+
], 512), [
|
|
397
|
+
[vue.vShow, _ctx.showInput]
|
|
398
|
+
])
|
|
324
399
|
]),
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
400
|
+
vue.createElementVNode("div", _hoisted_10, [
|
|
401
|
+
_ctx.showCancelButton ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
402
|
+
key: 0,
|
|
403
|
+
loading: _ctx.cancelButtonLoading,
|
|
404
|
+
class: vue.normalizeClass([_ctx.cancelButtonClass]),
|
|
405
|
+
round: _ctx.roundButton,
|
|
406
|
+
size: _ctx.btnSize,
|
|
407
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleAction("cancel")),
|
|
408
|
+
onKeydown: _cache[4] || (_cache[4] = vue.withKeys(vue.withModifiers(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"]))
|
|
409
|
+
}, {
|
|
334
410
|
default: vue.withCtx(() => [
|
|
335
|
-
vue.
|
|
411
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)
|
|
336
412
|
]),
|
|
337
413
|
_: 1
|
|
338
|
-
})
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
414
|
+
}, 8, ["loading", "class", "round", "size"])) : vue.createCommentVNode("v-if", true),
|
|
415
|
+
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
416
|
+
ref: "confirmRef",
|
|
417
|
+
type: "primary",
|
|
418
|
+
loading: _ctx.confirmButtonLoading,
|
|
419
|
+
class: vue.normalizeClass([_ctx.confirmButtonClasses]),
|
|
420
|
+
round: _ctx.roundButton,
|
|
421
|
+
disabled: _ctx.confirmButtonDisabled,
|
|
422
|
+
size: _ctx.btnSize,
|
|
423
|
+
onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleAction("confirm")),
|
|
424
|
+
onKeydown: _cache[6] || (_cache[6] = vue.withKeys(vue.withModifiers(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"]))
|
|
346
425
|
}, {
|
|
347
426
|
default: vue.withCtx(() => [
|
|
348
|
-
|
|
427
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)
|
|
349
428
|
]),
|
|
350
429
|
_: 1
|
|
351
|
-
}, 8, ["class"
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
!_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_7, vue.toDisplayString(_ctx.message), 1)) : (vue.openBlock(), vue.createElementBlock("p", {
|
|
355
|
-
key: 1,
|
|
356
|
-
innerHTML: _ctx.message
|
|
357
|
-
}, null, 8, _hoisted_8))
|
|
358
|
-
])
|
|
359
|
-
])) : vue.createCommentVNode("v-if", true)
|
|
360
|
-
]),
|
|
361
|
-
vue.withDirectives(vue.createElementVNode("div", _hoisted_9, [
|
|
362
|
-
vue.createVNode(_component_el_input, {
|
|
363
|
-
ref: "inputRef",
|
|
364
|
-
modelValue: _ctx.inputValue,
|
|
365
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.inputValue = $event),
|
|
366
|
-
type: _ctx.inputType,
|
|
367
|
-
placeholder: _ctx.inputPlaceholder,
|
|
368
|
-
class: vue.normalizeClass({ invalid: _ctx.validateError }),
|
|
369
|
-
onKeydown: vue.withKeys(vue.withModifiers(_ctx.handleInputEnter, ["prevent"]), ["enter"])
|
|
370
|
-
}, null, 8, ["modelValue", "type", "placeholder", "class", "onKeydown"]),
|
|
371
|
-
vue.createElementVNode("div", {
|
|
372
|
-
class: "el-message-box__errormsg",
|
|
373
|
-
style: vue.normalizeStyle({
|
|
374
|
-
visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden"
|
|
375
|
-
})
|
|
376
|
-
}, vue.toDisplayString(_ctx.editorErrorMessage), 5)
|
|
377
|
-
], 512), [
|
|
378
|
-
[vue.vShow, _ctx.showInput]
|
|
379
|
-
])
|
|
380
|
-
]),
|
|
381
|
-
vue.createElementVNode("div", _hoisted_10, [
|
|
382
|
-
_ctx.showCancelButton ? (vue.openBlock(), vue.createBlock(_component_el_button, {
|
|
383
|
-
key: 0,
|
|
384
|
-
loading: _ctx.cancelButtonLoading,
|
|
385
|
-
class: vue.normalizeClass([_ctx.cancelButtonClass]),
|
|
386
|
-
round: _ctx.roundButton,
|
|
387
|
-
size: _ctx.btnSize,
|
|
388
|
-
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleAction("cancel")),
|
|
389
|
-
onKeydown: _cache[4] || (_cache[4] = vue.withKeys(vue.withModifiers(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"]))
|
|
390
|
-
}, {
|
|
391
|
-
default: vue.withCtx(() => [
|
|
392
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)
|
|
393
|
-
]),
|
|
394
|
-
_: 1
|
|
395
|
-
}, 8, ["loading", "class", "round", "size"])) : vue.createCommentVNode("v-if", true),
|
|
396
|
-
vue.withDirectives(vue.createVNode(_component_el_button, {
|
|
397
|
-
ref: "confirmRef",
|
|
398
|
-
type: "primary",
|
|
399
|
-
loading: _ctx.confirmButtonLoading,
|
|
400
|
-
class: vue.normalizeClass([_ctx.confirmButtonClasses]),
|
|
401
|
-
round: _ctx.roundButton,
|
|
402
|
-
disabled: _ctx.confirmButtonDisabled,
|
|
403
|
-
size: _ctx.btnSize,
|
|
404
|
-
onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleAction("confirm")),
|
|
405
|
-
onKeydown: _cache[6] || (_cache[6] = vue.withKeys(vue.withModifiers(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"]))
|
|
406
|
-
}, {
|
|
407
|
-
default: vue.withCtx(() => [
|
|
408
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)
|
|
409
|
-
]),
|
|
410
|
-
_: 1
|
|
411
|
-
}, 8, ["loading", "class", "round", "disabled", "size"]), [
|
|
412
|
-
[vue.vShow, _ctx.showConfirmButton]
|
|
430
|
+
}, 8, ["loading", "class", "round", "disabled", "size"]), [
|
|
431
|
+
[vue.vShow, _ctx.showConfirmButton]
|
|
432
|
+
])
|
|
413
433
|
])
|
|
434
|
+
], 14, _hoisted_1)), [
|
|
435
|
+
[_directive_trap_focus]
|
|
414
436
|
])
|
|
415
|
-
],
|
|
416
|
-
[_directive_trap_focus]
|
|
417
|
-
])
|
|
437
|
+
], 32)
|
|
418
438
|
]),
|
|
419
439
|
_: 3
|
|
420
|
-
}, 8, ["z-index", "overlay-class", "mask"
|
|
440
|
+
}, 8, ["z-index", "overlay-class", "mask"]), [
|
|
421
441
|
[vue.vShow, _ctx.visible]
|
|
422
442
|
])
|
|
423
443
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"['is-message-box', modalClass]\"\n :mask=\"modal\"\n @click.self=\"handleWrapperClick\"\n >\n <div\n ref=\"root\"\n v-trap-focus\n role=\"dialog\"\n :aria-label=\"title || 'dialog'\"\n aria-modal=\"true\"\n :class=\"[\n 'el-message-box',\n customClass,\n { 'el-message-box--center': center },\n ]\"\n :style=\"customStyle\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n class=\"el-message-box__header\"\n >\n <div class=\"el-message-box__title\">\n <el-icon\n v-if=\"iconComponent && center\"\n class=\"el-message-box__status\"\n :class=\"typeClass\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n class=\"el-message-box__headerbtn\"\n aria-label=\"Close\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon class=\"el-message-box__close\"><close /></el-icon>\n </button>\n </div>\n <div class=\"el-message-box__content\">\n <div class=\"el-message-box__container\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n class=\"el-message-box__status\"\n :class=\"typeClass\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" class=\"el-message-box__message\">\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\">{{ message }}</p>\n <p v-else v-html=\"message\"></p>\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" class=\"el-message-box__input\">\n <el-input\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :class=\"{ invalid: validateError }\"\n @keydown.prevent.enter=\"handleInputEnter\"\n />\n <div\n class=\"el-message-box__errormsg\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div class=\"el-message-box__btns\">\n <el-button\n v-if=\"showCancelButton\"\n :loading=\"cancelButtonLoading\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n type=\"primary\"\n :loading=\"confirmButtonLoading\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-overlay>\n </transition>\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n nextTick,\n onMounted,\n onBeforeUnmount,\n computed,\n watch,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useModal,\n useLockscreen,\n useLocale,\n useRestoreActive,\n usePreventGlobal,\n useSize,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport { PopupManager } from '@element-plus/utils/popup-manager'\nimport { on, off } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\nimport { isValidComponentSize } from '@element-plus/utils/validators'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils/icon'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/utils/types'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents,\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n closeOnHashChange: {\n type: Boolean,\n default: true,\n },\n center: Boolean,\n roundButton: {\n default: false,\n type: Boolean,\n },\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n // const popup = usePopup(props, doClose)\n const { t } = useLocale()\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: null,\n inputValidator: null,\n inputErrorMessage: '',\n message: null,\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: PopupManager.nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return type && TypeComponentsMap[type]\n ? `el-message-box-icon--${type}`\n : ''\n })\n\n const btnSize = useSize(\n computed(() => props.buttonSize),\n { prop: true, form: true, formItem: true }\n )\n\n const iconComponent = computed(\n () => state.icon || TypeComponentsMap[state.type] || ''\n )\n const hasMessage = computed(() => !!state.message)\n const inputRef = ref<ComponentPublicInstance>(null)\n const confirmRef = ref<ComponentPublicInstance>(null)\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val !== null) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType === 'alert' || props.boxType === 'confirm') {\n nextTick().then(() => {\n confirmRef.value?.$el?.focus?.()\n })\n }\n state.zIndex = PopupManager.nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n getInputElement().focus()\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n on(window, 'hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n off(window, 'hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const handleInputEnter = () => {\n if (state.inputType !== 'textarea') {\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (typeof inputValidator === 'function') {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (typeof validateResult === 'string') {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value.$refs\n return (inputRefs.input || inputRefs.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event liek this\n // to dispatch, it could callout another message box.\n if (props.closeOnPressEscape) {\n useModal(\n {\n handleClose,\n },\n visible\n )\n } else {\n usePreventGlobal(\n visible,\n 'keydown',\n (e: KeyboardEvent) => e.code === EVENT_CODE.esc\n )\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible)\n }\n\n // restore to prev active element.\n useRestoreActive(visible)\n\n return {\n ...toRefs(state),\n visible,\n hasMessage,\n typeClass,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n inputRef,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"names":["defineComponent","TrapFocus","ElButton","ElInput","ElOverlay","ElIcon","TypeComponents","isValidComponentSize","useLocale","ref","reactive","PopupManager","computed","TypeComponentsMap","useSize","nextTick","_withCtx"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"['is-message-box', modalClass]\"\n :mask=\"modal\"\n >\n <div\n class=\"el-overlay-message-box\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <div\n ref=\"rootRef\"\n v-trap-focus\n role=\"dialog\"\n :aria-label=\"title || 'dialog'\"\n aria-modal=\"true\"\n :class=\"[\n 'el-message-box',\n customClass,\n { 'el-message-box--center': center, 'is-draggable': draggable },\n ]\"\n :style=\"customStyle\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n class=\"el-message-box__header\"\n >\n <div class=\"el-message-box__title\">\n <el-icon\n v-if=\"iconComponent && center\"\n class=\"el-message-box__status\"\n :class=\"typeClass\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n class=\"el-message-box__headerbtn\"\n aria-label=\"Close\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon class=\"el-message-box__close\">\n <close />\n </el-icon>\n </button>\n </div>\n <div class=\"el-message-box__content\">\n <div class=\"el-message-box__container\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n class=\"el-message-box__status\"\n :class=\"typeClass\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" class=\"el-message-box__message\">\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\">{{ message }}</p>\n <p v-else v-html=\"message\"></p>\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" class=\"el-message-box__input\">\n <el-input\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :class=\"{ invalid: validateError }\"\n @keydown.prevent.enter=\"handleInputEnter\"\n />\n <div\n class=\"el-message-box__errormsg\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div class=\"el-message-box__btns\">\n <el-button\n v-if=\"showCancelButton\"\n :loading=\"cancelButtonLoading\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n type=\"primary\"\n :loading=\"confirmButtonLoading\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </div>\n </el-overlay>\n </transition>\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n nextTick,\n onMounted,\n onBeforeUnmount,\n computed,\n watch,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useModal,\n useLockscreen,\n useLocale,\n useRestoreActive,\n usePreventGlobal,\n useSize,\n useDraggable,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport { PopupManager } from '@element-plus/utils/popup-manager'\nimport { on, off } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\nimport { isValidComponentSize } from '@element-plus/utils/validators'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils/icon'\n\nimport type { PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/utils/types'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents,\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n closeOnHashChange: {\n type: Boolean,\n default: true,\n },\n center: Boolean,\n draggable: Boolean,\n roundButton: {\n default: false,\n type: Boolean,\n },\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n // const popup = usePopup(props, doClose)\n const { t } = useLocale()\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: null,\n inputValidator: null,\n inputErrorMessage: '',\n message: null,\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: PopupManager.nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return type && TypeComponentsMap[type]\n ? `el-message-box-icon--${type}`\n : ''\n })\n\n const btnSize = useSize(\n computed(() => props.buttonSize),\n { prop: true, form: true, formItem: true }\n )\n\n const iconComponent = computed(\n () => state.icon || TypeComponentsMap[state.type] || ''\n )\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const inputRef = ref<HTMLElement>()\n const confirmRef = ref<HTMLElement>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val !== null) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType === 'alert' || props.boxType === 'confirm') {\n nextTick().then(() => {\n confirmRef.value?.$el?.focus?.()\n })\n }\n state.zIndex = PopupManager.nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n getInputElement().focus()\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n useDraggable(rootRef, headerRef, draggable)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n on(window, 'hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n off(window, 'hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick)\n\n const handleInputEnter = () => {\n if (state.inputType !== 'textarea') {\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (typeof inputValidator === 'function') {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (typeof validateResult === 'string') {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value.$refs\n return (inputRefs.input || inputRefs.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event liek this\n // to dispatch, it could callout another message box.\n if (props.closeOnPressEscape) {\n useModal(\n {\n handleClose,\n },\n visible\n )\n } else {\n usePreventGlobal(\n visible,\n 'keydown',\n (e: KeyboardEvent) => e.code === EVENT_CODE.esc\n )\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible)\n }\n\n // restore to prev active element.\n useRestoreActive(visible)\n\n return {\n ...toRefs(state),\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n headerRef,\n inputRef,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"names":["defineComponent","TrapFocus","ElButton","ElInput","ElOverlay","ElIcon","TypeComponents","isValidComponentSize","useLocale","ref","reactive","PopupManager","computed","TypeComponentsMap","useSize","nextTick"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
2
|
import type { ComponentSize } from 'element-plus/es/utils/types';
|
|
3
3
|
import type { Action, MessageBoxState, MessageBoxType } from './message-box.type';
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -31,6 +31,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
31
|
default: boolean;
|
|
32
32
|
};
|
|
33
33
|
center: BooleanConstructor;
|
|
34
|
+
draggable: BooleanConstructor;
|
|
34
35
|
roundButton: {
|
|
35
36
|
default: boolean;
|
|
36
37
|
type: BooleanConstructor;
|
|
@@ -44,14 +45,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
45
|
default: string;
|
|
45
46
|
};
|
|
46
47
|
}, {
|
|
48
|
+
overlayEvent: {
|
|
49
|
+
onClick: (e: MouseEvent) => void;
|
|
50
|
+
onMousedown: (e: MouseEvent) => void;
|
|
51
|
+
onMouseup: (e: MouseEvent) => void;
|
|
52
|
+
};
|
|
47
53
|
visible: import("vue").Ref<boolean>;
|
|
48
54
|
hasMessage: import("vue").ComputedRef<boolean>;
|
|
49
55
|
typeClass: import("vue").ComputedRef<string>;
|
|
50
56
|
btnSize: import("vue").ComputedRef<ComponentSize>;
|
|
51
57
|
iconComponent: import("vue").ComputedRef<any>;
|
|
52
58
|
confirmButtonClasses: import("vue").ComputedRef<string>;
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
rootRef: import("vue").Ref<HTMLElement | undefined>;
|
|
60
|
+
headerRef: import("vue").Ref<HTMLElement | undefined>;
|
|
61
|
+
inputRef: import("vue").Ref<HTMLElement | undefined>;
|
|
62
|
+
confirmRef: import("vue").Ref<HTMLElement | undefined>;
|
|
55
63
|
doClose: () => void;
|
|
56
64
|
handleClose: () => void;
|
|
57
65
|
handleWrapperClick: () => void;
|
|
@@ -220,7 +228,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
220
228
|
unmounted?: (() => void) | undefined;
|
|
221
229
|
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | undefined;
|
|
222
230
|
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | undefined;
|
|
223
|
-
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | undefined;
|
|
231
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | undefined;
|
|
224
232
|
delimiters?: [string, string] | undefined;
|
|
225
233
|
__differentiator?: string | number | symbol | undefined;
|
|
226
234
|
__isBuiltIn?: boolean | undefined;
|
|
@@ -1825,6 +1833,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1825
1833
|
default: boolean;
|
|
1826
1834
|
};
|
|
1827
1835
|
center: BooleanConstructor;
|
|
1836
|
+
draggable: BooleanConstructor;
|
|
1828
1837
|
roundButton: {
|
|
1829
1838
|
default: boolean;
|
|
1830
1839
|
type: BooleanConstructor;
|
|
@@ -1842,6 +1851,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1842
1851
|
onAction?: ((...args: any[]) => any) | undefined;
|
|
1843
1852
|
}, {
|
|
1844
1853
|
center: boolean;
|
|
1854
|
+
draggable: boolean;
|
|
1845
1855
|
showClose: boolean;
|
|
1846
1856
|
closeOnClickModal: boolean;
|
|
1847
1857
|
closeOnPressEscape: boolean;
|
|
@@ -65,6 +65,8 @@ export interface ElMessageBoxOptions {
|
|
|
65
65
|
confirmButtonClass?: string;
|
|
66
66
|
/** Whether to align the content in center */
|
|
67
67
|
center?: boolean;
|
|
68
|
+
/** Whether MessageBox can be drag */
|
|
69
|
+
draggable?: boolean;
|
|
68
70
|
/** Content of the MessageBox */
|
|
69
71
|
message?: string | VNode;
|
|
70
72
|
/** Title of the MessageBox */
|
|
@@ -40,10 +40,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
const _hoisted_1 =
|
|
43
|
+
const _hoisted_1 = ["disabled"];
|
|
44
44
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
45
45
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
46
|
-
return vue.openBlock(), vue.createElementBlock("span",
|
|
46
|
+
return vue.openBlock(), vue.createElementBlock("span", {
|
|
47
|
+
class: "el-pagination__jump",
|
|
48
|
+
disabled: _ctx.disabled
|
|
49
|
+
}, [
|
|
47
50
|
vue.createTextVNode(vue.toDisplayString(_ctx.t("el.pagination.goto")) + " ", 1),
|
|
48
51
|
vue.createVNode(_component_el_input, {
|
|
49
52
|
size: "small",
|
|
@@ -57,7 +60,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
57
60
|
onChange: _ctx.handleChange
|
|
58
61
|
}, null, 8, ["max", "disabled", "model-value", "onUpdate:modelValue", "onChange"]),
|
|
59
62
|
vue.createTextVNode(" " + vue.toDisplayString(_ctx.t("el.pagination.pageClassifier")), 1)
|
|
60
|
-
]);
|
|
63
|
+
], 8, _hoisted_1);
|
|
61
64
|
}
|
|
62
65
|
var Jumper = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render]]);
|
|
63
66
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jumper.js","sources":["../../../../../../../packages/components/pagination/src/components/jumper.vue"],"sourcesContent":["<template>\n <span class=\"el-pagination__jump\">\n {{ t('el.pagination.goto') }}\n <el-input\n size=\"small\"\n class=\"el-pagination__editor is-in-pagination\"\n :min=\"1\"\n :max=\"pageCount\"\n :disabled=\"disabled\"\n :model-value=\"innerValue\"\n type=\"number\"\n @update:model-value=\"handleInput\"\n @change=\"handleChange\"\n />\n {{ t('el.pagination.pageClassifier') }}\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, ref } from 'vue'\nimport { useLocale } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { usePagination } from '../usePagination'\n\nexport default defineComponent({\n name: 'ElPaginationJumper',\n components: {\n ElInput,\n },\n\n setup() {\n const { t } = useLocale()\n const { pageCount, disabled, currentPage, changeEvent } = usePagination()\n const userInput = ref<number>()\n const innerValue = computed(() => userInput.value ?? currentPage?.value)\n\n function handleInput(val: number | string) {\n userInput.value = +val\n }\n\n function handleChange(val: number | string) {\n val = Math.trunc(+val)\n changeEvent?.(+val)\n userInput.value = undefined\n }\n\n return {\n pageCount,\n disabled,\n innerValue,\n\n t,\n handleInput,\n handleChange,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElInput","useLocale","usePagination","ref","computed"],"mappings":";;;;;;;;;;;AAwBA,MAAK,YAAaA,oBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,aACVC;AAAA;AAAA,EAGF,QAAQ;AACN,UAAM,EAAE,MAAMC;AACd,UAAM,EAAE,WAAW,UAAU,aAAa,gBAAgBC;AAC1D,UAAM,YAAYC;AAClB,UAAM,aAAaC,aAAS,MAAM;AAElC;AACE,gBAAU;AAAS;AAGrB;AACE,wBAAkB;AAClB;AACA;AAAkB;AAGpB;AAAO,MACL;AAAA;AACA;AACA,MAEA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;;
|
|
1
|
+
{"version":3,"file":"jumper.js","sources":["../../../../../../../packages/components/pagination/src/components/jumper.vue"],"sourcesContent":["<template>\n <span class=\"el-pagination__jump\" :disabled=\"disabled\">\n {{ t('el.pagination.goto') }}\n <el-input\n size=\"small\"\n class=\"el-pagination__editor is-in-pagination\"\n :min=\"1\"\n :max=\"pageCount\"\n :disabled=\"disabled\"\n :model-value=\"innerValue\"\n type=\"number\"\n @update:model-value=\"handleInput\"\n @change=\"handleChange\"\n />\n {{ t('el.pagination.pageClassifier') }}\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, ref } from 'vue'\nimport { useLocale } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { usePagination } from '../usePagination'\n\nexport default defineComponent({\n name: 'ElPaginationJumper',\n components: {\n ElInput,\n },\n\n setup() {\n const { t } = useLocale()\n const { pageCount, disabled, currentPage, changeEvent } = usePagination()\n const userInput = ref<number>()\n const innerValue = computed(() => userInput.value ?? currentPage?.value)\n\n function handleInput(val: number | string) {\n userInput.value = +val\n }\n\n function handleChange(val: number | string) {\n val = Math.trunc(+val)\n changeEvent?.(+val)\n userInput.value = undefined\n }\n\n return {\n pageCount,\n disabled,\n innerValue,\n\n t,\n handleInput,\n handleChange,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElInput","useLocale","usePagination","ref","computed"],"mappings":";;;;;;;;;;;AAwBA,MAAK,YAAaA,oBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,aACVC;AAAA;AAAA,EAGF,QAAQ;AACN,UAAM,EAAE,MAAMC;AACd,UAAM,EAAE,WAAW,UAAU,aAAa,gBAAgBC;AAC1D,UAAM,YAAYC;AAClB,UAAM,aAAaC,aAAS,MAAM;AAElC;AACE,gBAAU;AAAS;AAGrB;AACE,wBAAkB;AAClB;AACA;AAAkB;AAGpB;AAAO,MACL;AAAA;AACA;AACA,MAEA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;;AApD6B;AAAE;;IAEjC;AAUE;AATY;AACP;AACE;AACD,MACL;AAAU,MACV;AAAa,MACd;AAAa,MACZ;AAAA,MACA,uBAAQ;AAAY;;AAEnB;;;;;;;;;;"}
|
|
@@ -28,7 +28,11 @@ const paginationSizesProps = props.buildProps({
|
|
|
28
28
|
type: String,
|
|
29
29
|
default: ""
|
|
30
30
|
},
|
|
31
|
-
disabled: Boolean
|
|
31
|
+
disabled: Boolean,
|
|
32
|
+
size: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "default"
|
|
35
|
+
}
|
|
32
36
|
});
|
|
33
37
|
const _sfc_main = vue.defineComponent({
|
|
34
38
|
name: "ElPaginationSizes",
|
|
@@ -78,7 +82,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
78
82
|
"model-value": _ctx.innerPageSize,
|
|
79
83
|
disabled: _ctx.disabled,
|
|
80
84
|
"popper-class": _ctx.popperClass,
|
|
81
|
-
size:
|
|
85
|
+
size: _ctx.size,
|
|
82
86
|
onChange: _ctx.handleChange
|
|
83
87
|
}, {
|
|
84
88
|
default: vue.withCtx(() => [
|
|
@@ -91,7 +95,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
91
95
|
}), 128))
|
|
92
96
|
]),
|
|
93
97
|
_: 1
|
|
94
|
-
}, 8, ["model-value", "disabled", "popper-class", "onChange"])
|
|
98
|
+
}, 8, ["model-value", "disabled", "popper-class", "size", "onChange"])
|
|
95
99
|
]);
|
|
96
100
|
}
|
|
97
101
|
var Sizes = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render]]);
|