@element-plus/nightly 0.0.20241119 → 0.0.20241120
Sign up to get free protection for your applications and to get access to all the features.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +150 -124
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +12 -12
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +150 -124
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/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/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/anchor/index.mjs +2 -2
- package/es/components/anchor/src/anchor.mjs +193 -38
- package/es/components/anchor/src/anchor.mjs.map +1 -1
- package/es/components/anchor/src/anchor2.mjs +38 -193
- package/es/components/anchor/src/anchor2.mjs.map +1 -1
- package/es/components/badge/index.mjs +2 -2
- package/es/components/badge/src/badge.mjs +69 -32
- package/es/components/badge/src/badge.mjs.map +1 -1
- package/es/components/badge/src/badge2.mjs +32 -69
- package/es/components/badge/src/badge2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +45 -392
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +415 -45
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +13 -13
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +25 -50
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +50 -25
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown.mjs +167 -15
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +15 -167
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +35 -4
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +4 -35
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +17 -102
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +102 -17
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +115 -47
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +47 -115
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/content.mjs +137 -93
- package/es/components/popper/src/content.mjs.map +1 -1
- package/es/components/popper/src/content2.mjs +93 -137
- package/es/components/popper/src/content2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +29 -63
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +63 -29
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/scrollbar/index.mjs +1 -1
- package/es/components/scrollbar/src/bar2.mjs +1 -1
- package/es/components/scrollbar/src/thumb.mjs +11 -130
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +130 -11
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/slider/src/button.mjs +21 -91
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +91 -21
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/statistic/index.mjs +2 -2
- package/es/components/statistic/src/statistic.mjs +70 -25
- package/es/components/statistic/src/statistic.mjs.map +1 -1
- package/es/components/statistic/src/statistic2.mjs +25 -70
- package/es/components/statistic/src/statistic2.mjs.map +1 -1
- package/es/components/table/src/table.mjs +5 -3
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +2 -1
- package/es/components/tag/src/tag2.mjs +4 -1
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/tooltip/src/content.mjs +1 -1
- package/es/components/tooltip/src/content2.mjs +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +98 -126
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +126 -98
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/index.mjs +13 -13
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/global.d.ts +2 -0
- package/lib/components/anchor/index.js +2 -2
- package/lib/components/anchor/src/anchor.js +192 -38
- package/lib/components/anchor/src/anchor.js.map +1 -1
- package/lib/components/anchor/src/anchor2.js +38 -192
- package/lib/components/anchor/src/anchor2.js.map +1 -1
- package/lib/components/badge/index.js +2 -2
- package/lib/components/badge/src/badge.js +69 -32
- package/lib/components/badge/src/badge.js.map +1 -1
- package/lib/components/badge/src/badge2.js +32 -69
- package/lib/components/badge/src/badge2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +46 -392
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +415 -46
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +13 -13
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +26 -50
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +50 -26
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown.js +167 -16
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +16 -167
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +35 -4
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +4 -35
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +18 -102
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +102 -18
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +115 -48
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +48 -115
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/content.js +137 -98
- package/lib/components/popper/src/content.js.map +1 -1
- package/lib/components/popper/src/content2.js +98 -137
- package/lib/components/popper/src/content2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +31 -63
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +63 -31
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/scrollbar/index.js +1 -1
- package/lib/components/scrollbar/src/bar2.js +1 -1
- package/lib/components/scrollbar/src/thumb.js +11 -130
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +130 -11
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/slider/src/button.js +22 -91
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +91 -22
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/statistic/index.js +2 -2
- package/lib/components/statistic/src/statistic.js +70 -25
- package/lib/components/statistic/src/statistic.js.map +1 -1
- package/lib/components/statistic/src/statistic2.js +25 -70
- package/lib/components/statistic/src/statistic2.js.map +1 -1
- package/lib/components/table/src/table.js +5 -3
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +2 -1
- package/lib/components/tag/src/tag2.js +4 -1
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/tooltip/src/content.js +1 -1
- package/lib/components/tooltip/src/content2.js +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +101 -126
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +126 -101
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/index.js +13 -13
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-image-viewer.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/image-viewer.scss +4 -0
- package/web-types.json +1 -1
@@ -1,99 +1,143 @@
|
|
1
|
-
import {
|
1
|
+
import { defineComponent, inject, ref, provide, onMounted, watch, unref, onBeforeUnmount, openBlock, createElementBlock, mergeProps, createVNode, withCtx, renderSlot } from 'vue';
|
2
|
+
import { isNil } from 'lodash-unified';
|
2
3
|
import '../../../utils/index.mjs';
|
3
|
-
import '
|
4
|
-
import
|
5
|
-
import {
|
4
|
+
import '../../focus-trap/index.mjs';
|
5
|
+
import '../../form/index.mjs';
|
6
|
+
import { POPPER_CONTENT_INJECTION_KEY } from './constants.mjs';
|
7
|
+
import { popperContentProps, popperContentEmits } from './content2.mjs';
|
8
|
+
import './composables/index.mjs';
|
9
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
10
|
+
import { usePopperContentFocusTrap } from './composables/use-focus-trap.mjs';
|
11
|
+
import { usePopperContent } from './composables/use-content.mjs';
|
12
|
+
import { usePopperContentDOM } from './composables/use-content-dom.mjs';
|
13
|
+
import { formItemContextKey } from '../../form/src/constants.mjs';
|
14
|
+
import { NOOP } from '@vue/shared';
|
15
|
+
import { isElement } from '../../../utils/types.mjs';
|
16
|
+
import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
|
6
17
|
|
7
|
-
const
|
8
|
-
|
9
|
-
boundariesPadding: {
|
10
|
-
type: Number,
|
11
|
-
default: 0
|
12
|
-
},
|
13
|
-
fallbackPlacements: {
|
14
|
-
type: definePropType(Array),
|
15
|
-
default: void 0
|
16
|
-
},
|
17
|
-
gpuAcceleration: {
|
18
|
-
type: Boolean,
|
19
|
-
default: true
|
20
|
-
},
|
21
|
-
offset: {
|
22
|
-
type: Number,
|
23
|
-
default: 12
|
24
|
-
},
|
25
|
-
placement: {
|
26
|
-
type: String,
|
27
|
-
values: placements,
|
28
|
-
default: "bottom"
|
29
|
-
},
|
30
|
-
popperOptions: {
|
31
|
-
type: definePropType(Object),
|
32
|
-
default: () => ({})
|
33
|
-
},
|
34
|
-
strategy: {
|
35
|
-
type: String,
|
36
|
-
values: POSITIONING_STRATEGIES,
|
37
|
-
default: "absolute"
|
38
|
-
}
|
18
|
+
const __default__ = defineComponent({
|
19
|
+
name: "ElPopperContent"
|
39
20
|
});
|
40
|
-
const
|
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
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
21
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
22
|
+
...__default__,
|
23
|
+
props: popperContentProps,
|
24
|
+
emits: popperContentEmits,
|
25
|
+
setup(__props, { expose, emit }) {
|
26
|
+
const props = __props;
|
27
|
+
const {
|
28
|
+
focusStartRef,
|
29
|
+
trapped,
|
30
|
+
onFocusAfterReleased,
|
31
|
+
onFocusAfterTrapped,
|
32
|
+
onFocusInTrap,
|
33
|
+
onFocusoutPrevented,
|
34
|
+
onReleaseRequested
|
35
|
+
} = usePopperContentFocusTrap(props, emit);
|
36
|
+
const { attributes, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props);
|
37
|
+
const {
|
38
|
+
ariaModal,
|
39
|
+
arrowStyle,
|
40
|
+
contentAttrs,
|
41
|
+
contentClass,
|
42
|
+
contentStyle,
|
43
|
+
updateZIndex
|
44
|
+
} = usePopperContentDOM(props, {
|
45
|
+
styles,
|
46
|
+
attributes,
|
47
|
+
role
|
48
|
+
});
|
49
|
+
const formItemContext = inject(formItemContextKey, void 0);
|
50
|
+
const arrowOffset = ref();
|
51
|
+
provide(POPPER_CONTENT_INJECTION_KEY, {
|
52
|
+
arrowStyle,
|
53
|
+
arrowRef,
|
54
|
+
arrowOffset
|
55
|
+
});
|
56
|
+
if (formItemContext) {
|
57
|
+
provide(formItemContextKey, {
|
58
|
+
...formItemContext,
|
59
|
+
addInputId: NOOP,
|
60
|
+
removeInputId: NOOP
|
61
|
+
});
|
62
|
+
}
|
63
|
+
let triggerTargetAriaStopWatch = void 0;
|
64
|
+
const updatePopper = (shouldUpdateZIndex = true) => {
|
65
|
+
update();
|
66
|
+
shouldUpdateZIndex && updateZIndex();
|
67
|
+
};
|
68
|
+
const togglePopperAlive = () => {
|
69
|
+
updatePopper(false);
|
70
|
+
if (props.visible && props.focusOnShow) {
|
71
|
+
trapped.value = true;
|
72
|
+
} else if (props.visible === false) {
|
73
|
+
trapped.value = false;
|
74
|
+
}
|
75
|
+
};
|
76
|
+
onMounted(() => {
|
77
|
+
watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
|
78
|
+
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
79
|
+
triggerTargetAriaStopWatch = void 0;
|
80
|
+
const el = unref(triggerTargetEl || contentRef.value);
|
81
|
+
const prevEl = unref(prevTriggerTargetEl || contentRef.value);
|
82
|
+
if (isElement(el)) {
|
83
|
+
triggerTargetAriaStopWatch = watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
|
84
|
+
;
|
85
|
+
["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
|
86
|
+
isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
87
|
+
});
|
88
|
+
}, { immediate: true });
|
89
|
+
}
|
90
|
+
if (prevEl !== el && isElement(prevEl)) {
|
91
|
+
;
|
92
|
+
["role", "aria-label", "aria-modal", "id"].forEach((key) => {
|
93
|
+
prevEl.removeAttribute(key);
|
94
|
+
});
|
95
|
+
}
|
96
|
+
}, { immediate: true });
|
97
|
+
watch(() => props.visible, togglePopperAlive, { immediate: true });
|
98
|
+
});
|
99
|
+
onBeforeUnmount(() => {
|
100
|
+
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
101
|
+
triggerTargetAriaStopWatch = void 0;
|
102
|
+
});
|
103
|
+
expose({
|
104
|
+
popperContentRef: contentRef,
|
105
|
+
popperInstanceRef: instanceRef,
|
106
|
+
updatePopper,
|
107
|
+
contentStyle
|
108
|
+
});
|
109
|
+
return (_ctx, _cache) => {
|
110
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
111
|
+
ref_key: "contentRef",
|
112
|
+
ref: contentRef
|
113
|
+
}, unref(contentAttrs), {
|
114
|
+
style: unref(contentStyle),
|
115
|
+
class: unref(contentClass),
|
116
|
+
tabindex: "-1",
|
117
|
+
onMouseenter: (e) => _ctx.$emit("mouseenter", e),
|
118
|
+
onMouseleave: (e) => _ctx.$emit("mouseleave", e)
|
119
|
+
}), [
|
120
|
+
createVNode(unref(ElFocusTrap), {
|
121
|
+
trapped: unref(trapped),
|
122
|
+
"trap-on-focus-in": true,
|
123
|
+
"focus-trap-el": unref(contentRef),
|
124
|
+
"focus-start-el": unref(focusStartRef),
|
125
|
+
onFocusAfterTrapped: unref(onFocusAfterTrapped),
|
126
|
+
onFocusAfterReleased: unref(onFocusAfterReleased),
|
127
|
+
onFocusin: unref(onFocusInTrap),
|
128
|
+
onFocusoutPrevented: unref(onFocusoutPrevented),
|
129
|
+
onReleaseRequested: unref(onReleaseRequested)
|
130
|
+
}, {
|
131
|
+
default: withCtx(() => [
|
132
|
+
renderSlot(_ctx.$slots, "default")
|
133
|
+
]),
|
134
|
+
_: 3
|
135
|
+
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
|
136
|
+
], 16, ["onMouseenter", "onMouseleave"]);
|
137
|
+
};
|
138
|
+
}
|
86
139
|
});
|
87
|
-
|
88
|
-
mouseenter: (evt) => evt instanceof MouseEvent,
|
89
|
-
mouseleave: (evt) => evt instanceof MouseEvent,
|
90
|
-
focus: () => true,
|
91
|
-
blur: () => true,
|
92
|
-
close: () => true
|
93
|
-
};
|
94
|
-
const usePopperCoreConfigProps = popperCoreConfigProps;
|
95
|
-
const usePopperContentProps = popperContentProps;
|
96
|
-
const usePopperContentEmits = popperContentEmits;
|
140
|
+
var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "content.vue"]]);
|
97
141
|
|
98
|
-
export {
|
142
|
+
export { ElPopperContent as default };
|
99
143
|
//# sourceMappingURL=content.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/popper/src/content.
|
1
|
+
{"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/popper/src/content.vue"],"sourcesContent":["<template>\n <div\n ref=\"contentRef\"\n v-bind=\"contentAttrs\"\n :style=\"contentStyle\"\n :class=\"contentClass\"\n tabindex=\"-1\"\n @mouseenter=\"(e) => $emit('mouseenter', e)\"\n @mouseleave=\"(e) => $emit('mouseleave', e)\"\n >\n <el-focus-trap\n :trapped=\"trapped\"\n :trap-on-focus-in=\"true\"\n :focus-trap-el=\"contentRef\"\n :focus-start-el=\"focusStartRef\"\n @focus-after-trapped=\"onFocusAfterTrapped\"\n @focus-after-released=\"onFocusAfterReleased\"\n @focusin=\"onFocusInTrap\"\n @focusout-prevented=\"onFocusoutPrevented\"\n @release-requested=\"onReleaseRequested\"\n >\n <slot />\n </el-focus-trap>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n unref,\n watch,\n} from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { NOOP, isElement } from '@element-plus/utils'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { formItemContextKey } from '@element-plus/components/form'\nimport { POPPER_CONTENT_INJECTION_KEY } from './constants'\nimport { popperContentEmits, popperContentProps } from './content'\nimport {\n usePopperContent,\n usePopperContentDOM,\n usePopperContentFocusTrap,\n} from './composables'\n\nimport type { WatchStopHandle } from 'vue'\n\ndefineOptions({\n name: 'ElPopperContent',\n})\n\nconst emit = defineEmits(popperContentEmits)\n\nconst props = defineProps(popperContentProps)\n\nconst {\n focusStartRef,\n trapped,\n\n onFocusAfterReleased,\n onFocusAfterTrapped,\n onFocusInTrap,\n onFocusoutPrevented,\n onReleaseRequested,\n} = usePopperContentFocusTrap(props, emit)\n\nconst { attributes, arrowRef, contentRef, styles, instanceRef, role, update } =\n usePopperContent(props)\n\nconst {\n ariaModal,\n arrowStyle,\n contentAttrs,\n contentClass,\n contentStyle,\n updateZIndex,\n} = usePopperContentDOM(props, {\n styles,\n attributes,\n role,\n})\n\nconst formItemContext = inject(formItemContextKey, undefined)\nconst arrowOffset = ref<number>()\n\nprovide(POPPER_CONTENT_INJECTION_KEY, {\n arrowStyle,\n arrowRef,\n arrowOffset,\n})\n\nif (formItemContext) {\n // disallow auto-id from inside popper content\n provide(formItemContextKey, {\n ...formItemContext,\n addInputId: NOOP,\n removeInputId: NOOP,\n })\n}\n\nlet triggerTargetAriaStopWatch: WatchStopHandle | undefined = undefined\n\nconst updatePopper = (shouldUpdateZIndex = true) => {\n update()\n shouldUpdateZIndex && updateZIndex()\n}\n\nconst togglePopperAlive = () => {\n updatePopper(false)\n if (props.visible && props.focusOnShow) {\n trapped.value = true\n } else if (props.visible === false) {\n trapped.value = false\n }\n}\n\nonMounted(() => {\n watch(\n () => props.triggerTargetEl,\n (triggerTargetEl, prevTriggerTargetEl) => {\n triggerTargetAriaStopWatch?.()\n triggerTargetAriaStopWatch = undefined\n\n const el = unref(triggerTargetEl || contentRef.value)\n const prevEl = unref(prevTriggerTargetEl || contentRef.value)\n\n if (isElement(el)) {\n triggerTargetAriaStopWatch = watch(\n [role, () => props.ariaLabel, ariaModal, () => props.id],\n (watches) => {\n ;['role', 'aria-label', 'aria-modal', 'id'].forEach((key, idx) => {\n isNil(watches[idx])\n ? el.removeAttribute(key)\n : el.setAttribute(key, watches[idx]!)\n })\n },\n { immediate: true }\n )\n }\n if (prevEl !== el && isElement(prevEl)) {\n ;['role', 'aria-label', 'aria-modal', 'id'].forEach((key) => {\n prevEl.removeAttribute(key)\n })\n }\n },\n { immediate: true }\n )\n\n watch(() => props.visible, togglePopperAlive, { immediate: true })\n})\n\nonBeforeUnmount(() => {\n triggerTargetAriaStopWatch?.()\n triggerTargetAriaStopWatch = undefined\n})\n\ndefineExpose({\n /**\n * @description popper content element\n */\n popperContentRef: contentRef,\n /**\n * @description popperjs instance\n */\n popperInstanceRef: instanceRef,\n /**\n * @description method for updating popper\n */\n updatePopper,\n\n /**\n * @description content style\n */\n contentStyle,\n})\n</script>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_unref","_createVNode"],"mappings":";;;;;;;;;;;;;;;;;mCAkDc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAMA,IAAM,MAAA;AAAA,MACJ,aAAA;AAAA,MACA,OAAA;AAAA,MAEA,oBAAA;AAAA,MACA,mBAAA;AAAA,MACA,aAAA;AAAA,MACA,mBAAA;AAAA,MACA,kBAAA;AAAA,KACF,GAAI,yBAA0B,CAAA,KAAA,EAAO,IAAI,CAAA,CAAA;AAEzC,IAAM,MAAA,EAAE,UAAY,EAAA,QAAA,EAAU,UAAY,EAAA,MAAA,EAAQ,aAAa,IAAM,EAAA,MAAA,EACnE,GAAA,gBAAA,CAAiB,KAAK,CAAA,CAAA;AAExB,IAAM,MAAA;AAAA,MACJ,SAAA;AAAA,MACA,UAAA;AAAA,MACA,YAAA;AAAA,MACA,YAAA;AAAA,MACA,YAAA;AAAA,MACA,YAAA;AAAA,KACF,GAAI,oBAAoB,KAAO,EAAA;AAAA,MAC7B,MAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,eAAA,GAAkB,MAAO,CAAA,kBAAA,EAAoB,KAAS,CAAA,CAAA,CAAA;AAC5D,IAAA,MAAM,cAAc,GAAY,EAAA,CAAA;AAEhC,IAAA,OAAA,CAAQ,4BAA8B,EAAA;AAAA,MACpC,UAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,IAAI,eAAiB,EAAA;AAEnB,MAAA,OAAA,CAAQ,kBAAoB,EAAA;AAAA,QAC1B,GAAG,eAAA;AAAA,QACH,UAAY,EAAA,IAAA;AAAA,QACZ,aAAe,EAAA,IAAA;AAAA,OAChB,CAAA,CAAA;AAAA,KACH;AAEA,IAAA,IAAI,0BAA0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AA,CAAA,EAAA;AAAA,QAAA,KAAA,EAAAA,KAAA,CAAA,YAAA,CAAA;AAAA,QAIO,KAAA,EAAAA,KAAA,CAAA,YAAA,CAAA;AAAA,QAAA,QAAA,EAAA,IAAA;AAAA,QAAA,YAAA,EAAA,CAAA,CAAA,KAAA,IAAA,CAAA,KAAA,CAAA,YAAA,EAAA,CAAA,CAAA;AAAA,QAAA,YAAA,EAAA,CAAA,CAAA,KAAA,IAAA,CAAA,KAAA,CAAA,YAAA,EAAA,CAAA,CAAA;AAAA,OAIC,CAAA,EAAA;AAAA,QAAAC,WAAA,CAAAD,KAAA,CAAA,WAAA,CAAA,EAAA;AAAA,UAAA,OAAA,EAAAA,KAAA,CAAA,OAAA,CAAA;AAAA,UAAA,kBAAA,EAAA,IAAA;AAAA,UAInB,eAAA,EAAAA,KAAA,CAAA,UAAA,CAAA;AAAA,UAAA,gBAAA,EAAAA,KAAA,CAAA,aAAA,CAAA;AAAA,UAAA,mBAAA,EAAAA,KAAA,CAAA,mBAAA,CAAA;AAAA,UAAA,oBAAA,EAAAA,KAAA,CAAA,oBAAA,CAAA;AAAA,UAKA,SAAA,EAAAA,KAAA,CAAA,aAAA,CAAA;AAAA,UACD,mBAAA,EAAAA,KAAA,CAAA,mBAAA,CAAA;;;;;;;;;;;;;;;;"}
|
@@ -1,143 +1,99 @@
|
|
1
|
-
import {
|
2
|
-
import { isNil } from 'lodash-unified';
|
1
|
+
import { placements } from '@popperjs/core';
|
3
2
|
import '../../../utils/index.mjs';
|
4
|
-
import '
|
5
|
-
import '
|
6
|
-
import {
|
7
|
-
import { popperContentProps, popperContentEmits } from './content.mjs';
|
8
|
-
import './composables/index.mjs';
|
9
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
10
|
-
import { usePopperContentFocusTrap } from './composables/use-focus-trap.mjs';
|
11
|
-
import { usePopperContent } from './composables/use-content.mjs';
|
12
|
-
import { usePopperContentDOM } from './composables/use-content-dom.mjs';
|
13
|
-
import { formItemContextKey } from '../../form/src/constants.mjs';
|
14
|
-
import { NOOP } from '@vue/shared';
|
15
|
-
import { isElement } from '../../../utils/types.mjs';
|
16
|
-
import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
|
3
|
+
import '../../../hooks/index.mjs';
|
4
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
5
|
+
import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
|
17
6
|
|
18
|
-
const
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
const formItemContext = inject(formItemContextKey, void 0);
|
50
|
-
const arrowOffset = ref();
|
51
|
-
provide(POPPER_CONTENT_INJECTION_KEY, {
|
52
|
-
arrowStyle,
|
53
|
-
arrowRef,
|
54
|
-
arrowOffset
|
55
|
-
});
|
56
|
-
if (formItemContext) {
|
57
|
-
provide(formItemContextKey, {
|
58
|
-
...formItemContext,
|
59
|
-
addInputId: NOOP,
|
60
|
-
removeInputId: NOOP
|
61
|
-
});
|
62
|
-
}
|
63
|
-
let triggerTargetAriaStopWatch = void 0;
|
64
|
-
const updatePopper = (shouldUpdateZIndex = true) => {
|
65
|
-
update();
|
66
|
-
shouldUpdateZIndex && updateZIndex();
|
67
|
-
};
|
68
|
-
const togglePopperAlive = () => {
|
69
|
-
updatePopper(false);
|
70
|
-
if (props.visible && props.focusOnShow) {
|
71
|
-
trapped.value = true;
|
72
|
-
} else if (props.visible === false) {
|
73
|
-
trapped.value = false;
|
74
|
-
}
|
75
|
-
};
|
76
|
-
onMounted(() => {
|
77
|
-
watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
|
78
|
-
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
79
|
-
triggerTargetAriaStopWatch = void 0;
|
80
|
-
const el = unref(triggerTargetEl || contentRef.value);
|
81
|
-
const prevEl = unref(prevTriggerTargetEl || contentRef.value);
|
82
|
-
if (isElement(el)) {
|
83
|
-
triggerTargetAriaStopWatch = watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
|
84
|
-
;
|
85
|
-
["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
|
86
|
-
isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
87
|
-
});
|
88
|
-
}, { immediate: true });
|
89
|
-
}
|
90
|
-
if (prevEl !== el && isElement(prevEl)) {
|
91
|
-
;
|
92
|
-
["role", "aria-label", "aria-modal", "id"].forEach((key) => {
|
93
|
-
prevEl.removeAttribute(key);
|
94
|
-
});
|
95
|
-
}
|
96
|
-
}, { immediate: true });
|
97
|
-
watch(() => props.visible, togglePopperAlive, { immediate: true });
|
98
|
-
});
|
99
|
-
onBeforeUnmount(() => {
|
100
|
-
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
101
|
-
triggerTargetAriaStopWatch = void 0;
|
102
|
-
});
|
103
|
-
expose({
|
104
|
-
popperContentRef: contentRef,
|
105
|
-
popperInstanceRef: instanceRef,
|
106
|
-
updatePopper,
|
107
|
-
contentStyle
|
108
|
-
});
|
109
|
-
return (_ctx, _cache) => {
|
110
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
111
|
-
ref_key: "contentRef",
|
112
|
-
ref: contentRef
|
113
|
-
}, unref(contentAttrs), {
|
114
|
-
style: unref(contentStyle),
|
115
|
-
class: unref(contentClass),
|
116
|
-
tabindex: "-1",
|
117
|
-
onMouseenter: (e) => _ctx.$emit("mouseenter", e),
|
118
|
-
onMouseleave: (e) => _ctx.$emit("mouseleave", e)
|
119
|
-
}), [
|
120
|
-
createVNode(unref(ElFocusTrap), {
|
121
|
-
trapped: unref(trapped),
|
122
|
-
"trap-on-focus-in": true,
|
123
|
-
"focus-trap-el": unref(contentRef),
|
124
|
-
"focus-start-el": unref(focusStartRef),
|
125
|
-
onFocusAfterTrapped: unref(onFocusAfterTrapped),
|
126
|
-
onFocusAfterReleased: unref(onFocusAfterReleased),
|
127
|
-
onFocusin: unref(onFocusInTrap),
|
128
|
-
onFocusoutPrevented: unref(onFocusoutPrevented),
|
129
|
-
onReleaseRequested: unref(onReleaseRequested)
|
130
|
-
}, {
|
131
|
-
default: withCtx(() => [
|
132
|
-
renderSlot(_ctx.$slots, "default")
|
133
|
-
]),
|
134
|
-
_: 3
|
135
|
-
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
|
136
|
-
], 16, ["onMouseenter", "onMouseleave"]);
|
137
|
-
};
|
7
|
+
const POSITIONING_STRATEGIES = ["fixed", "absolute"];
|
8
|
+
const popperCoreConfigProps = buildProps({
|
9
|
+
boundariesPadding: {
|
10
|
+
type: Number,
|
11
|
+
default: 0
|
12
|
+
},
|
13
|
+
fallbackPlacements: {
|
14
|
+
type: definePropType(Array),
|
15
|
+
default: void 0
|
16
|
+
},
|
17
|
+
gpuAcceleration: {
|
18
|
+
type: Boolean,
|
19
|
+
default: true
|
20
|
+
},
|
21
|
+
offset: {
|
22
|
+
type: Number,
|
23
|
+
default: 12
|
24
|
+
},
|
25
|
+
placement: {
|
26
|
+
type: String,
|
27
|
+
values: placements,
|
28
|
+
default: "bottom"
|
29
|
+
},
|
30
|
+
popperOptions: {
|
31
|
+
type: definePropType(Object),
|
32
|
+
default: () => ({})
|
33
|
+
},
|
34
|
+
strategy: {
|
35
|
+
type: String,
|
36
|
+
values: POSITIONING_STRATEGIES,
|
37
|
+
default: "absolute"
|
138
38
|
}
|
139
39
|
});
|
140
|
-
|
40
|
+
const popperContentProps = buildProps({
|
41
|
+
...popperCoreConfigProps,
|
42
|
+
id: String,
|
43
|
+
style: {
|
44
|
+
type: definePropType([String, Array, Object])
|
45
|
+
},
|
46
|
+
className: {
|
47
|
+
type: definePropType([String, Array, Object])
|
48
|
+
},
|
49
|
+
effect: {
|
50
|
+
type: definePropType(String),
|
51
|
+
default: "dark"
|
52
|
+
},
|
53
|
+
visible: Boolean,
|
54
|
+
enterable: {
|
55
|
+
type: Boolean,
|
56
|
+
default: true
|
57
|
+
},
|
58
|
+
pure: Boolean,
|
59
|
+
focusOnShow: {
|
60
|
+
type: Boolean,
|
61
|
+
default: false
|
62
|
+
},
|
63
|
+
trapping: {
|
64
|
+
type: Boolean,
|
65
|
+
default: false
|
66
|
+
},
|
67
|
+
popperClass: {
|
68
|
+
type: definePropType([String, Array, Object])
|
69
|
+
},
|
70
|
+
popperStyle: {
|
71
|
+
type: definePropType([String, Array, Object])
|
72
|
+
},
|
73
|
+
referenceEl: {
|
74
|
+
type: definePropType(Object)
|
75
|
+
},
|
76
|
+
triggerTargetEl: {
|
77
|
+
type: definePropType(Object)
|
78
|
+
},
|
79
|
+
stopPopperMouseEvent: {
|
80
|
+
type: Boolean,
|
81
|
+
default: true
|
82
|
+
},
|
83
|
+
virtualTriggering: Boolean,
|
84
|
+
zIndex: Number,
|
85
|
+
...useAriaProps(["ariaLabel"])
|
86
|
+
});
|
87
|
+
const popperContentEmits = {
|
88
|
+
mouseenter: (evt) => evt instanceof MouseEvent,
|
89
|
+
mouseleave: (evt) => evt instanceof MouseEvent,
|
90
|
+
focus: () => true,
|
91
|
+
blur: () => true,
|
92
|
+
close: () => true
|
93
|
+
};
|
94
|
+
const usePopperCoreConfigProps = popperCoreConfigProps;
|
95
|
+
const usePopperContentProps = popperContentProps;
|
96
|
+
const usePopperContentEmits = popperContentEmits;
|
141
97
|
|
142
|
-
export {
|
98
|
+
export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps };
|
143
99
|
//# sourceMappingURL=content2.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"content2.mjs","sources":["../../../../../../packages/components/popper/src/content.
|
1
|
+
{"version":3,"file":"content2.mjs","sources":["../../../../../../packages/components/popper/src/content.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport { buildProps, definePropType } from '@element-plus/utils'\nimport { useAriaProps } from '@element-plus/hooks'\n\nimport type { PopperEffect } from './popper'\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type { Options, Placement } from '@popperjs/core'\nimport type { Measurable } from './constants'\nimport type Content from './content.vue'\n\ntype ClassObjectType = Record<string, boolean>\ntype ClassType = string | ClassObjectType | ClassType[]\n\nconst POSITIONING_STRATEGIES = ['fixed', 'absolute'] as const\n\nexport interface CreatePopperInstanceParams {\n referenceEl: Measurable\n popperContentEl: HTMLElement\n arrowEl: HTMLElement | undefined\n}\n\nexport const popperCoreConfigProps = buildProps({\n boundariesPadding: {\n type: Number,\n default: 0,\n },\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: undefined,\n },\n gpuAcceleration: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the Tooltip\n */\n offset: {\n type: Number,\n default: 12,\n },\n /**\n * @description position of Tooltip\n */\n placement: {\n type: String,\n values: placements,\n default: 'bottom',\n },\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}),\n },\n strategy: {\n type: String,\n values: POSITIONING_STRATEGIES,\n default: 'absolute',\n },\n} as const)\nexport type PopperCoreConfigProps = ExtractPropTypes<\n typeof popperCoreConfigProps\n>\n\nexport const popperContentProps = buildProps({\n ...popperCoreConfigProps,\n id: String,\n style: {\n type: definePropType<StyleValue>([String, Array, Object]),\n },\n className: {\n type: definePropType<ClassType>([String, Array, Object]),\n },\n effect: {\n type: definePropType<PopperEffect | string>(String),\n default: 'dark',\n },\n visible: Boolean,\n enterable: {\n type: Boolean,\n default: true,\n },\n pure: Boolean,\n focusOnShow: {\n type: Boolean,\n default: false,\n },\n trapping: {\n type: Boolean,\n default: false,\n },\n popperClass: {\n type: definePropType<ClassType>([String, Array, Object]),\n },\n popperStyle: {\n type: definePropType<StyleValue>([String, Array, Object]),\n },\n referenceEl: {\n type: definePropType<HTMLElement>(Object),\n },\n triggerTargetEl: {\n type: definePropType<HTMLElement>(Object),\n },\n stopPopperMouseEvent: {\n type: Boolean,\n default: true,\n },\n virtualTriggering: Boolean,\n zIndex: Number,\n ...useAriaProps(['ariaLabel']),\n} as const)\nexport type PopperContentProps = ExtractPropTypes<typeof popperContentProps>\n\nexport const popperContentEmits = {\n mouseenter: (evt: MouseEvent) => evt instanceof MouseEvent,\n mouseleave: (evt: MouseEvent) => evt instanceof MouseEvent,\n focus: () => true,\n blur: () => true,\n close: () => true,\n}\nexport type PopperContentEmits = typeof popperContentEmits\n\nexport type PopperContentInstance = InstanceType<typeof Content>\n\n/** @deprecated use `popperCoreConfigProps` instead, and it will be deprecated in the next major version */\nexport const usePopperCoreConfigProps = popperCoreConfigProps\n\n/** @deprecated use `popperContentProps` instead, and it will be deprecated in the next major version */\nexport const usePopperContentProps = popperContentProps\n\n/** @deprecated use `popperContentEmits` instead, and it will be deprecated in the next major version */\nexport const usePopperContentEmits = popperContentEmits\n\n/** @deprecated use `PopperCoreConfigProps` instead, and it will be deprecated in the next major version */\nexport type UsePopperCoreConfigProps = PopperCoreConfigProps\n\n/** @deprecated use `PopperContentProps` instead, and it will be deprecated in the next major version */\nexport type UsePopperContentProps = PopperContentProps\n\n/** @deprecated use `PopperContentInstance` instead, and it will be deprecated in the next major version */\nexport type ElPopperArrowContent = PopperContentInstance\n"],"names":[],"mappings":";;;;;;AAGA,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,MAAC,qBAAqB,GAAG,UAAU,CAAC;AAChD,EAAE,iBAAiB,EAAE;AACrB,IAAI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wBAAwB,GAAG,sBAAsB;AAClD,MAAC,qBAAqB,GAAG,mBAAmB;AAC5C,MAAC,qBAAqB,GAAG;;;;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import '../../utils/index.mjs';
|
2
|
-
import Result from './src/
|
3
|
-
export { IconComponentMap, IconMap, resultProps } from './src/
|
2
|
+
import Result from './src/result2.mjs';
|
3
|
+
export { IconComponentMap, IconMap, resultProps } from './src/result.mjs';
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
5
5
|
|
6
6
|
const ElResult = withInstall(Result);
|