@element-plus/nightly 0.0.20251209 → 0.0.20251210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +40 -96
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +96 -40
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/anchor/index.mjs +2 -2
- package/es/components/anchor/src/anchor.mjs +213 -40
- package/es/components/anchor/src/anchor.mjs.map +1 -1
- package/es/components/anchor/src/anchor2.mjs +40 -213
- package/es/components/anchor/src/anchor2.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete.mjs +1 -1
- package/es/components/card/index.mjs +2 -2
- package/es/components/card/src/card.mjs +48 -23
- package/es/components/card/src/card.mjs.map +1 -1
- package/es/components/card/src/card2.mjs +23 -48
- package/es/components/card/src/card2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/checkbox/index.mjs +2 -2
- package/es/components/checkbox/src/checkbox-group.mjs +50 -94
- package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox-group2.mjs +94 -50
- package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker.mjs +1 -1
- package/es/components/dropdown/index.mjs +2 -2
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown-item.mjs +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +112 -258
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +258 -112
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +234 -69
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +69 -234
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +484 -51
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +51 -484
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +19 -19
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +71 -25
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +25 -71
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/mention/src/mention.mjs +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +73 -147
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +147 -73
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/pagination/src/components/pager.mjs +210 -16
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +16 -210
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/components/prev.mjs +35 -17
- package/es/components/pagination/src/components/prev.mjs.map +1 -1
- package/es/components/pagination/src/components/prev2.mjs +17 -35
- package/es/components/pagination/src/components/prev2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/components/popover/index.mjs +2 -2
- package/es/components/popover/src/popover.mjs +112 -66
- package/es/components/popover/src/popover.mjs.map +1 -1
- package/es/components/popover/src/popover2.mjs +66 -112
- package/es/components/popover/src/popover2.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-group.mjs +86 -54
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +54 -86
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/rate/index.mjs +2 -2
- package/es/components/rate/src/rate.mjs +255 -86
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate2.mjs +86 -255
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/scrollbar/src/bar.mjs +64 -10
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +10 -64
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
- package/es/components/segmented/index.mjs +2 -2
- package/es/components/segmented/src/segmented.mjs +171 -45
- package/es/components/segmented/src/segmented.mjs.map +1 -1
- package/es/components/segmented/src/segmented2.mjs +45 -171
- package/es/components/segmented/src/segmented2.mjs.map +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton-item.mjs +22 -17
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +17 -22
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +1 -1
- package/es/components/table/src/filter-panel.mjs +1 -1
- package/es/components/time-picker/src/common/props.mjs +1 -1
- package/es/components/timeline/index.mjs +2 -2
- package/es/components/timeline/src/timeline-item.mjs +72 -33
- package/es/components/timeline/src/timeline-item.mjs.map +1 -1
- package/es/components/timeline/src/timeline-item2.mjs +33 -72
- package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/content.mjs +203 -29
- package/es/components/tooltip/src/content.mjs.map +1 -1
- package/es/components/tooltip/src/content2.mjs +29 -203
- package/es/components/tooltip/src/content2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tour/index.mjs +3 -3
- package/es/components/tour/src/content.mjs +67 -43
- package/es/components/tour/src/content.mjs.map +1 -1
- package/es/components/tour/src/content2.mjs +43 -67
- package/es/components/tour/src/content2.mjs.map +1 -1
- package/es/components/tour/src/step.mjs +1 -1
- package/es/components/tour/src/tour.mjs +154 -69
- package/es/components/tour/src/tour.mjs.map +1 -1
- package/es/components/tour/src/tour2.mjs +69 -154
- package/es/components/tour/src/tour2.mjs.map +1 -1
- package/es/components/watermark/index.mjs +2 -2
- package/es/components/watermark/src/watermark.mjs +226 -27
- package/es/components/watermark/src/watermark.mjs.map +1 -1
- package/es/components/watermark/src/watermark2.mjs +27 -226
- package/es/components/watermark/src/watermark2.mjs.map +1 -1
- package/es/index.mjs +19 -19
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +41 -95
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +95 -41
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/anchor/index.js +2 -2
- package/lib/components/anchor/src/anchor.js +212 -40
- package/lib/components/anchor/src/anchor.js.map +1 -1
- package/lib/components/anchor/src/anchor2.js +40 -212
- package/lib/components/anchor/src/anchor2.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.js +1 -1
- package/lib/components/card/index.js +2 -2
- package/lib/components/card/src/card.js +48 -24
- package/lib/components/card/src/card.js.map +1 -1
- package/lib/components/card/src/card2.js +24 -48
- package/lib/components/card/src/card2.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/checkbox/index.js +2 -2
- package/lib/components/checkbox/src/checkbox-group.js +51 -93
- package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
- package/lib/components/checkbox/src/checkbox-group2.js +93 -51
- package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
- package/lib/components/color-picker/src/color-picker.js +1 -1
- package/lib/components/dropdown/index.js +2 -2
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown-item.js +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +117 -258
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/dropdown2.js +258 -117
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +233 -69
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +69 -233
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +484 -52
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +52 -484
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +19 -19
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +71 -26
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +26 -71
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/mention/src/mention.js +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +74 -146
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +146 -74
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/pagination/src/components/pager.js +210 -16
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +16 -210
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/components/prev.js +35 -18
- package/lib/components/pagination/src/components/prev.js.map +1 -1
- package/lib/components/pagination/src/components/prev2.js +18 -35
- package/lib/components/pagination/src/components/prev2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/components/popover/index.js +2 -2
- package/lib/components/popover/src/popover.js +112 -67
- package/lib/components/popover/src/popover.js.map +1 -1
- package/lib/components/popover/src/popover2.js +67 -112
- package/lib/components/popover/src/popover2.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-group.js +86 -56
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +56 -86
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/rate/index.js +2 -2
- package/lib/components/rate/src/rate.js +254 -86
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate2.js +86 -254
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/scrollbar/src/bar.js +64 -10
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +10 -64
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +1 -1
- package/lib/components/segmented/index.js +2 -2
- package/lib/components/segmented/src/segmented.js +171 -47
- package/lib/components/segmented/src/segmented.js.map +1 -1
- package/lib/components/segmented/src/segmented2.js +47 -171
- package/lib/components/segmented/src/segmented2.js.map +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton-item.js +22 -17
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item2.js +17 -22
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +1 -1
- package/lib/components/table/src/filter-panel.js +1 -1
- package/lib/components/time-picker/src/common/props.js +1 -1
- package/lib/components/timeline/index.js +2 -2
- package/lib/components/timeline/src/timeline-item.js +72 -33
- package/lib/components/timeline/src/timeline-item.js.map +1 -1
- package/lib/components/timeline/src/timeline-item2.js +33 -72
- package/lib/components/timeline/src/timeline-item2.js.map +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/content.js +203 -29
- package/lib/components/tooltip/src/content.js.map +1 -1
- package/lib/components/tooltip/src/content2.js +29 -203
- package/lib/components/tooltip/src/content2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tour/index.js +3 -3
- package/lib/components/tour/src/content.js +67 -46
- package/lib/components/tour/src/content.js.map +1 -1
- package/lib/components/tour/src/content2.js +46 -67
- package/lib/components/tour/src/content2.js.map +1 -1
- package/lib/components/tour/src/step.js +1 -1
- package/lib/components/tour/src/tour.js +152 -68
- package/lib/components/tour/src/tour.js.map +1 -1
- package/lib/components/tour/src/tour2.js +68 -152
- package/lib/components/tour/src/tour2.js.map +1 -1
- package/lib/components/watermark/index.js +2 -2
- package/lib/components/watermark/src/watermark.js +226 -27
- package/lib/components/watermark/src/watermark.js.map +1 -1
- package/lib/components/watermark/src/watermark2.js +27 -226
- package/lib/components/watermark/src/watermark2.js.map +1 -1
- package/lib/index.js +19 -19
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image2.js","sources":["../../../../../../packages/components/image/src/image.vue"],"sourcesContent":["<template>\n <div ref=\"container\" v-bind=\"containerAttrs\" :class=\"[ns.b(), $attrs.class]\">\n <slot v-if=\"hasLoadError\" name=\"error\">\n <div :class=\"ns.e('error')\">{{ t('el.image.error') }}</div>\n </slot>\n <template v-else>\n <img\n v-if=\"imageSrc !== undefined\"\n v-bind=\"imgAttrs\"\n :src=\"imageSrc\"\n :loading=\"loading\"\n :style=\"imageStyle\"\n :class=\"imageKls\"\n :crossorigin=\"crossorigin\"\n @click=\"clickHandler\"\n @load=\"handleLoad\"\n @error=\"handleError\"\n />\n <div v-if=\"isLoading\" :class=\"ns.e('wrapper')\">\n <slot name=\"placeholder\">\n <div :class=\"ns.e('placeholder')\" />\n </slot>\n </div>\n </template>\n <template v-if=\"preview\">\n <image-viewer\n v-if=\"showViewer\"\n :z-index=\"zIndex\"\n :initial-index=\"imageIndex\"\n :infinite=\"infinite\"\n :zoom-rate=\"zoomRate\"\n :min-scale=\"minScale\"\n :max-scale=\"maxScale\"\n :show-progress=\"showProgress\"\n :url-list=\"previewSrcList\"\n :scale=\"scale\"\n :crossorigin=\"crossorigin\"\n :hide-on-click-modal=\"hideOnClickModal\"\n :teleported=\"previewTeleported\"\n :close-on-press-escape=\"closeOnPressEscape\"\n @close=\"closeViewer\"\n @switch=\"switchViewer\"\n >\n <div v-if=\"$slots.viewer\">\n <slot name=\"viewer\" />\n </div>\n <template v-if=\"$slots.progress\" #progress=\"progress\">\n <slot name=\"progress\" v-bind=\"progress\" />\n </template>\n <template #toolbar=\"toolbar\">\n <slot name=\"toolbar\" v-bind=\"toolbar\" />\n </template>\n <template v-if=\"$slots['viewer-error']\" #viewer-error=\"viewerError\">\n <slot name=\"viewer-error\" v-bind=\"viewerError\" />\n </template>\n </image-viewer>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n ref,\n useAttrs as useRawAttrs,\n watch,\n} from 'vue'\nimport { useIntersectionObserver, useThrottleFn } from '@vueuse/core'\nimport { fromPairs } from 'lodash-unified'\nimport { useAttrs, useLocale, useNamespace } from '@element-plus/hooks'\nimport ImageViewer from '@element-plus/components/image-viewer'\nimport {\n getScrollContainer,\n isArray,\n isClient,\n isElement,\n isString,\n isWindow,\n} from '@element-plus/utils'\nimport { imageEmits, imageProps } from './image'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElImage',\n inheritAttrs: false,\n})\n\nconst props = defineProps(imageProps)\nconst emit = defineEmits(imageEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('image')\nconst rawAttrs = useRawAttrs()\n\nconst containerAttrs = computed(() => {\n return fromPairs(\n Object.entries(rawAttrs).filter(\n ([key]) => /^(data-|on[A-Z])/i.test(key) || ['id', 'style'].includes(key)\n )\n )\n})\n\nconst imgAttrs = useAttrs({\n excludeListeners: true,\n excludeKeys: computed<string[]>(() => {\n return Object.keys(containerAttrs.value)\n }),\n})\n\nconst imageSrc = ref<string | undefined>()\nconst hasLoadError = ref(false)\nconst isLoading = ref(true)\nconst showViewer = ref(false)\nconst container = ref<HTMLElement>()\nconst _scrollContainer = ref<HTMLElement | undefined>()\n\nconst supportLoading = isClient && 'loading' in HTMLImageElement.prototype\nlet stopScrollListener: (() => void) | undefined\n\nconst imageKls = computed(() => [\n ns.e('inner'),\n preview.value && ns.e('preview'),\n isLoading.value && ns.is('loading'),\n])\n\nconst imageStyle = computed<CSSProperties>(() => {\n const { fit } = props\n if (isClient && fit) {\n return { objectFit: fit }\n }\n return {}\n})\n\nconst preview = computed(() => {\n const { previewSrcList } = props\n return isArray(previewSrcList) && previewSrcList.length > 0\n})\n\nconst imageIndex = computed(() => {\n const { previewSrcList, initialIndex } = props\n let previewIndex = initialIndex\n if (initialIndex > previewSrcList.length - 1) {\n previewIndex = 0\n }\n return previewIndex\n})\n\nconst isManual = computed(() => {\n if (props.loading === 'eager') return false\n return (!supportLoading && props.loading === 'lazy') || props.lazy\n})\n\nconst loadImage = () => {\n if (!isClient) return\n\n // reset status\n isLoading.value = true\n hasLoadError.value = false\n imageSrc.value = props.src\n}\n\nfunction handleLoad(event: Event) {\n isLoading.value = false\n hasLoadError.value = false\n emit('load', event)\n}\n\nfunction handleError(event: Event) {\n isLoading.value = false\n hasLoadError.value = true\n emit('error', event)\n}\n\nfunction handleLazyLoad(isIntersecting: boolean) {\n if (isIntersecting) {\n loadImage()\n removeLazyLoadListener()\n }\n}\n\nconst lazyLoadHandler = useThrottleFn(handleLazyLoad, 200, true)\n\nasync function addLazyLoadListener() {\n if (!isClient) return\n\n await nextTick()\n\n const { scrollContainer } = props\n if (isElement(scrollContainer)) {\n _scrollContainer.value = scrollContainer\n } else if (isString(scrollContainer) && scrollContainer !== '') {\n _scrollContainer.value =\n document.querySelector<HTMLElement>(scrollContainer) ?? undefined\n } else if (container.value) {\n const scrollContainer = getScrollContainer(container.value)\n _scrollContainer.value = isWindow(scrollContainer)\n ? undefined\n : scrollContainer\n }\n\n const { stop } = useIntersectionObserver(\n container,\n ([entry]) => {\n lazyLoadHandler(entry.isIntersecting)\n },\n { root: _scrollContainer }\n )\n stopScrollListener = stop\n}\n\nfunction removeLazyLoadListener() {\n if (!isClient || !lazyLoadHandler) return\n\n stopScrollListener?.()\n _scrollContainer.value = undefined\n stopScrollListener = undefined\n}\n\nfunction clickHandler() {\n // don't show viewer when preview is false\n if (!preview.value) return\n showViewer.value = true\n emit('show')\n}\n\nfunction closeViewer() {\n showViewer.value = false\n emit('close')\n}\n\nfunction switchViewer(val: number) {\n emit('switch', val)\n}\n\nwatch(\n () => props.src,\n () => {\n if (isManual.value) {\n // reset status\n isLoading.value = true\n hasLoadError.value = false\n removeLazyLoadListener()\n addLazyLoadListener()\n } else {\n loadImage()\n }\n }\n)\n\nonMounted(() => {\n if (isManual.value) {\n addLazyLoadListener()\n } else {\n loadImage()\n }\n})\n\ndefineExpose({\n /** @description manually open preview */\n showPreview: clickHandler,\n})\n</script>\n"],"names":["useLocale","useNamespace","useRawAttrs","computed","fromPairs","useAttrs","ref","isClient","isArray","useThrottleFn","nextTick","isElement","isString","scrollContainer","getScrollContainer","isWindow","useIntersectionObserver","watch","onMounted","_openBlock","_createElementBlock","_mergeProps","_unref"],"mappings":";;;;;;;;;;;;;;;;;uCAqFc,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AAAA,EACN,YAAc,EAAA,KAAA;AAChB,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,OAAO,CAAA,CAAA;AAC/B,IAAA,MAAM,WAAWC,YAAY,EAAA,CAAA;AAE7B,IAAM,MAAA,cAAA,GAAiBC,aAAS,MAAM;AACpC,MAAO,OAAAC,uBAAA,CAAA,MAAA,CAAA,OAAA,CAAA,QAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,KAAA,mBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,IAAA,CAAA,IAAA,EAAA,OAAA,CAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,KACL,CAAA,CAAA;AAAyB,IAAA,MACvB,QAAK,GAAMC,gBAAoB,CAAA;AAAyC,MAC1E,gBAAA,EAAA,IAAA;AAAA,MACF,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AA;AACL,KAAU,CAAA,CAAA;AAAA,IACZ,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACD,OAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAAC,cAAA,CAAA;AAED,QAAa,OAAA,EAAA,WAAA;AAAA,QAAA,GAAA,EAAA,SAAA;AAAA,OAEE,EAAAC,SAAA,CAAA,cAAA,CAAA,EAAA;AAAA,QACd,KAAA,EAAA,CAAAA,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,IAAA,CAAA,MAAA,CAAA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"image2.js","sources":["../../../../../../packages/components/image/src/image.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isNumber,\n mutable,\n} from '@element-plus/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type Image from './image.vue'\n\nexport const imageProps = buildProps({\n /**\n * @description when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode.\n */\n hideOnClickModal: Boolean,\n /**\n * @description image source, same as native.\n */\n src: {\n type: String,\n default: '',\n },\n /**\n * @description indicate how the image should be resized to fit its container, same as [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit).\n */\n fit: {\n type: String,\n values: ['', 'contain', 'cover', 'fill', 'none', 'scale-down'],\n default: '',\n },\n /**\n * @description Indicates how the browser should load the image, same as [native](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#loading)\n */\n loading: {\n type: String,\n values: ['eager', 'lazy'],\n },\n /**\n * @description whether to use lazy load.\n */\n lazy: Boolean,\n /**\n * @description the container to add scroll listener when using lazy load.\n */\n scrollContainer: {\n type: definePropType<string | HTMLElement | undefined>([String, Object]),\n },\n /**\n * @description allow big image preview.\n */\n previewSrcList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`.\n */\n previewTeleported: Boolean,\n /**\n * @description set image preview z-index.\n */\n zIndex: {\n type: Number,\n },\n /**\n * @description initial preview image index, less than the length of `url-list`.\n */\n initialIndex: {\n type: Number,\n default: 0,\n },\n /**\n * @description whether the viewer preview is infinite.\n */\n infinite: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the image-viewer can be closed by pressing ESC.\n */\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n /**\n * @description the zoom rate of the image viewer zoom event\n */\n zoomRate: {\n type: Number,\n default: 1.2,\n },\n /**\n * @description preview image scale.\n */\n scale: {\n type: Number,\n default: 1,\n },\n /**\n * @description the min scale of the image viewer zoom event.\n */\n minScale: {\n type: Number,\n default: 0.2,\n },\n /**\n * @description the max scale of the image viewer zoom event.\n */\n maxScale: {\n type: Number,\n default: 7,\n },\n /**\n * @description show preview image progress content.\n */\n showProgress: Boolean,\n /**\n * @description set HTML attribute: crossorigin.\n */\n crossorigin: {\n type: definePropType<'anonymous' | 'use-credentials' | ''>(String),\n },\n} as const)\nexport type ImageProps = ExtractPropTypes<typeof imageProps>\nexport type ImagePropsPublic = __ExtractPublicPropTypes<typeof imageProps>\n\nexport const imageEmits = {\n load: (evt: Event) => evt instanceof Event,\n error: (evt: Event) => evt instanceof Event,\n switch: (val: number) => isNumber(val),\n close: () => true,\n show: () => true,\n}\nexport type ImageEmits = typeof imageEmits\nexport type ImageInstance = InstanceType<typeof Image> & unknown\n"],"names":["buildProps","definePropType","mutable","isNumber"],"mappings":";;;;;;;;AAMY,MAAC,UAAU,GAAGA,kBAAU,CAAC;AACrC,EAAE,gBAAgB,EAAE,OAAO;AAC3B,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,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,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,YAAY,EAAE,OAAO;AACvB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAED,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,KAAK;AACrC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,KAAK;AACtC,EAAE,MAAM,EAAE,CAAC,GAAG,KAAKE,cAAQ,CAAC,GAAG,CAAC;AAChC,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB,EAAE,IAAI,EAAE,MAAM,IAAI;AAClB;;;;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var imageViewer$1 = require('./src/image-
|
|
6
|
-
var imageViewer = require('./src/image-
|
|
5
|
+
var imageViewer$1 = require('./src/image-viewer.js');
|
|
6
|
+
var imageViewer = require('./src/image-viewer2.js');
|
|
7
7
|
var install = require('../../utils/vue/install.js');
|
|
8
8
|
|
|
9
9
|
const ElImageViewer = install.withInstall(imageViewer$1["default"]);
|
|
@@ -2,60 +2,492 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
7
|
+
var lodashUnified = require('lodash-unified');
|
|
8
|
+
var focusTrap = require('../../focus-trap/src/focus-trap.js');
|
|
9
|
+
var index$4 = require('../../teleport/index.js');
|
|
10
|
+
var index$5 = require('../../icon/index.js');
|
|
11
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
12
|
+
var imageViewer = require('./image-viewer2.js');
|
|
13
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
14
|
+
var index = require('../../../hooks/use-locale/index.js');
|
|
15
|
+
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
16
|
+
var index$2 = require('../../../hooks/use-z-index/index.js');
|
|
17
|
+
var index$3 = require('../../../hooks/use-lockscreen/index.js');
|
|
18
|
+
var event = require('../../../utils/dom/event.js');
|
|
19
|
+
var aria = require('../../../constants/aria.js');
|
|
20
|
+
var objects = require('../../../utils/objects.js');
|
|
8
21
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
const __default__ = vue.defineComponent({
|
|
23
|
+
name: "ElImageViewer"
|
|
24
|
+
});
|
|
25
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
26
|
+
...__default__,
|
|
27
|
+
props: imageViewer.imageViewerProps,
|
|
28
|
+
emits: imageViewer.imageViewerEmits,
|
|
29
|
+
setup(__props, { expose, emit }) {
|
|
30
|
+
var _a;
|
|
31
|
+
const props = __props;
|
|
32
|
+
const modes = {
|
|
33
|
+
CONTAIN: {
|
|
34
|
+
name: "contain",
|
|
35
|
+
icon: vue.markRaw(iconsVue.FullScreen)
|
|
36
|
+
},
|
|
37
|
+
ORIGINAL: {
|
|
38
|
+
name: "original",
|
|
39
|
+
icon: vue.markRaw(iconsVue.ScaleToOriginal)
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
let stopWheelListener;
|
|
43
|
+
const { t } = index.useLocale();
|
|
44
|
+
const ns = index$1.useNamespace("image-viewer");
|
|
45
|
+
const { nextZIndex } = index$2.useZIndex();
|
|
46
|
+
const wrapper = vue.ref();
|
|
47
|
+
const imgRef = vue.ref();
|
|
48
|
+
const scopeEventListener = vue.effectScope();
|
|
49
|
+
const scaleClamped = vue.computed(() => {
|
|
50
|
+
const { scale, minScale, maxScale } = props;
|
|
51
|
+
return core.clamp(scale, minScale, maxScale);
|
|
52
|
+
});
|
|
53
|
+
const loading = vue.ref(true);
|
|
54
|
+
const loadError = vue.ref(false);
|
|
55
|
+
const visible = vue.ref(false);
|
|
56
|
+
const activeIndex = vue.ref(props.initialIndex);
|
|
57
|
+
const mode = vue.shallowRef(modes.CONTAIN);
|
|
58
|
+
const transform = vue.ref({
|
|
59
|
+
scale: scaleClamped.value,
|
|
60
|
+
deg: 0,
|
|
61
|
+
offsetX: 0,
|
|
62
|
+
offsetY: 0,
|
|
63
|
+
enableTransition: false
|
|
64
|
+
});
|
|
65
|
+
const zIndex = vue.ref((_a = props.zIndex) != null ? _a : nextZIndex());
|
|
66
|
+
index$3.useLockscreen(visible, { ns });
|
|
67
|
+
const isSingle = vue.computed(() => {
|
|
68
|
+
const { urlList } = props;
|
|
69
|
+
return urlList.length <= 1;
|
|
70
|
+
});
|
|
71
|
+
const isFirst = vue.computed(() => activeIndex.value === 0);
|
|
72
|
+
const isLast = vue.computed(() => activeIndex.value === props.urlList.length - 1);
|
|
73
|
+
const currentImg = vue.computed(() => props.urlList[activeIndex.value]);
|
|
74
|
+
const arrowPrevKls = vue.computed(() => [
|
|
75
|
+
ns.e("btn"),
|
|
76
|
+
ns.e("prev"),
|
|
77
|
+
ns.is("disabled", !props.infinite && isFirst.value)
|
|
78
|
+
]);
|
|
79
|
+
const arrowNextKls = vue.computed(() => [
|
|
80
|
+
ns.e("btn"),
|
|
81
|
+
ns.e("next"),
|
|
82
|
+
ns.is("disabled", !props.infinite && isLast.value)
|
|
83
|
+
]);
|
|
84
|
+
const imgStyle = vue.computed(() => {
|
|
85
|
+
const { scale, deg, offsetX, offsetY, enableTransition } = transform.value;
|
|
86
|
+
let translateX = offsetX / scale;
|
|
87
|
+
let translateY = offsetY / scale;
|
|
88
|
+
const radian = deg * Math.PI / 180;
|
|
89
|
+
const cosRadian = Math.cos(radian);
|
|
90
|
+
const sinRadian = Math.sin(radian);
|
|
91
|
+
translateX = translateX * cosRadian + translateY * sinRadian;
|
|
92
|
+
translateY = translateY * cosRadian - offsetX / scale * sinRadian;
|
|
93
|
+
const style = {
|
|
94
|
+
transform: `scale(${scale}) rotate(${deg}deg) translate(${translateX}px, ${translateY}px)`,
|
|
95
|
+
transition: enableTransition ? "transform .3s" : ""
|
|
96
|
+
};
|
|
97
|
+
if (mode.value.name === modes.CONTAIN.name) {
|
|
98
|
+
style.maxWidth = style.maxHeight = "100%";
|
|
99
|
+
}
|
|
100
|
+
return style;
|
|
101
|
+
});
|
|
102
|
+
const progress = vue.computed(() => `${activeIndex.value + 1} / ${props.urlList.length}`);
|
|
103
|
+
function hide() {
|
|
104
|
+
unregisterEventListener();
|
|
105
|
+
stopWheelListener == null ? void 0 : stopWheelListener();
|
|
106
|
+
visible.value = false;
|
|
107
|
+
emit("close");
|
|
108
|
+
}
|
|
109
|
+
function registerEventListener() {
|
|
110
|
+
const keydownHandler = lodashUnified.throttle((e) => {
|
|
111
|
+
const code = event.getEventCode(e);
|
|
112
|
+
switch (code) {
|
|
113
|
+
case aria.EVENT_CODE.esc:
|
|
114
|
+
props.closeOnPressEscape && hide();
|
|
115
|
+
break;
|
|
116
|
+
case aria.EVENT_CODE.space:
|
|
117
|
+
toggleMode();
|
|
118
|
+
break;
|
|
119
|
+
case aria.EVENT_CODE.left:
|
|
120
|
+
prev();
|
|
121
|
+
break;
|
|
122
|
+
case aria.EVENT_CODE.up:
|
|
123
|
+
handleActions("zoomIn");
|
|
124
|
+
break;
|
|
125
|
+
case aria.EVENT_CODE.right:
|
|
126
|
+
next();
|
|
127
|
+
break;
|
|
128
|
+
case aria.EVENT_CODE.down:
|
|
129
|
+
handleActions("zoomOut");
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const mousewheelHandler = lodashUnified.throttle((e) => {
|
|
134
|
+
const delta = e.deltaY || e.deltaX;
|
|
135
|
+
handleActions(delta < 0 ? "zoomIn" : "zoomOut", {
|
|
136
|
+
zoomRate: props.zoomRate,
|
|
137
|
+
enableTransition: false
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
scopeEventListener.run(() => {
|
|
141
|
+
core.useEventListener(document, "keydown", keydownHandler);
|
|
142
|
+
core.useEventListener(wrapper, "wheel", mousewheelHandler);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function unregisterEventListener() {
|
|
146
|
+
scopeEventListener.stop();
|
|
147
|
+
}
|
|
148
|
+
function handleImgLoad() {
|
|
149
|
+
loading.value = false;
|
|
150
|
+
}
|
|
151
|
+
function handleImgError(e) {
|
|
152
|
+
loadError.value = true;
|
|
153
|
+
loading.value = false;
|
|
154
|
+
emit("error", e);
|
|
155
|
+
e.target.alt = t("el.image.error");
|
|
156
|
+
}
|
|
157
|
+
function handleMouseDown(e) {
|
|
158
|
+
if (loading.value || e.button !== 0 || !wrapper.value)
|
|
159
|
+
return;
|
|
160
|
+
transform.value.enableTransition = false;
|
|
161
|
+
const { offsetX, offsetY } = transform.value;
|
|
162
|
+
const startX = e.pageX;
|
|
163
|
+
const startY = e.pageY;
|
|
164
|
+
const dragHandler = lodashUnified.throttle((ev) => {
|
|
165
|
+
transform.value = {
|
|
166
|
+
...transform.value,
|
|
167
|
+
offsetX: offsetX + ev.pageX - startX,
|
|
168
|
+
offsetY: offsetY + ev.pageY - startY
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
const removeMousemove = core.useEventListener(document, "mousemove", dragHandler);
|
|
172
|
+
const removeMouseup = core.useEventListener(document, "mouseup", () => {
|
|
173
|
+
removeMousemove();
|
|
174
|
+
removeMouseup();
|
|
175
|
+
});
|
|
176
|
+
e.preventDefault();
|
|
177
|
+
}
|
|
178
|
+
function handleTouchStart(e) {
|
|
179
|
+
if (loading.value || !wrapper.value || e.touches.length !== 1)
|
|
180
|
+
return;
|
|
181
|
+
transform.value.enableTransition = false;
|
|
182
|
+
const { offsetX, offsetY } = transform.value;
|
|
183
|
+
const { pageX: startX, pageY: startY } = e.touches[0];
|
|
184
|
+
const dragHandler = lodashUnified.throttle((ev) => {
|
|
185
|
+
const targetTouch = ev.touches[0];
|
|
186
|
+
transform.value = {
|
|
187
|
+
...transform.value,
|
|
188
|
+
offsetX: offsetX + targetTouch.pageX - startX,
|
|
189
|
+
offsetY: offsetY + targetTouch.pageY - startY
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
const removeTouchmove = core.useEventListener(document, "touchmove", dragHandler);
|
|
193
|
+
const removeTouchend = core.useEventListener(document, "touchend", () => {
|
|
194
|
+
removeTouchmove();
|
|
195
|
+
removeTouchend();
|
|
196
|
+
});
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
}
|
|
199
|
+
function reset() {
|
|
200
|
+
transform.value = {
|
|
201
|
+
scale: scaleClamped.value,
|
|
202
|
+
deg: 0,
|
|
203
|
+
offsetX: 0,
|
|
204
|
+
offsetY: 0,
|
|
205
|
+
enableTransition: false
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function toggleMode() {
|
|
209
|
+
if (loading.value || loadError.value)
|
|
210
|
+
return;
|
|
211
|
+
const modeNames = objects.keysOf(modes);
|
|
212
|
+
const modeValues = Object.values(modes);
|
|
213
|
+
const currentMode = mode.value.name;
|
|
214
|
+
const index = modeValues.findIndex((i) => i.name === currentMode);
|
|
215
|
+
const nextIndex = (index + 1) % modeNames.length;
|
|
216
|
+
mode.value = modes[modeNames[nextIndex]];
|
|
217
|
+
reset();
|
|
218
|
+
}
|
|
219
|
+
function setActiveItem(index) {
|
|
220
|
+
loadError.value = false;
|
|
221
|
+
const len = props.urlList.length;
|
|
222
|
+
activeIndex.value = (index + len) % len;
|
|
223
|
+
}
|
|
224
|
+
function prev() {
|
|
225
|
+
if (isFirst.value && !props.infinite)
|
|
226
|
+
return;
|
|
227
|
+
setActiveItem(activeIndex.value - 1);
|
|
228
|
+
}
|
|
229
|
+
function next() {
|
|
230
|
+
if (isLast.value && !props.infinite)
|
|
231
|
+
return;
|
|
232
|
+
setActiveItem(activeIndex.value + 1);
|
|
233
|
+
}
|
|
234
|
+
function handleActions(action, options = {}) {
|
|
235
|
+
if (loading.value || loadError.value)
|
|
236
|
+
return;
|
|
237
|
+
const { minScale, maxScale } = props;
|
|
238
|
+
const { zoomRate, rotateDeg, enableTransition } = {
|
|
239
|
+
zoomRate: props.zoomRate,
|
|
240
|
+
rotateDeg: 90,
|
|
241
|
+
enableTransition: true,
|
|
242
|
+
...options
|
|
243
|
+
};
|
|
244
|
+
switch (action) {
|
|
245
|
+
case "zoomOut":
|
|
246
|
+
if (transform.value.scale > minScale) {
|
|
247
|
+
transform.value.scale = Number.parseFloat((transform.value.scale / zoomRate).toFixed(3));
|
|
248
|
+
}
|
|
249
|
+
break;
|
|
250
|
+
case "zoomIn":
|
|
251
|
+
if (transform.value.scale < maxScale) {
|
|
252
|
+
transform.value.scale = Number.parseFloat((transform.value.scale * zoomRate).toFixed(3));
|
|
253
|
+
}
|
|
254
|
+
break;
|
|
255
|
+
case "clockwise":
|
|
256
|
+
transform.value.deg += rotateDeg;
|
|
257
|
+
emit("rotate", transform.value.deg);
|
|
258
|
+
break;
|
|
259
|
+
case "anticlockwise":
|
|
260
|
+
transform.value.deg -= rotateDeg;
|
|
261
|
+
emit("rotate", transform.value.deg);
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
transform.value.enableTransition = enableTransition;
|
|
265
|
+
}
|
|
266
|
+
function onFocusoutPrevented(event) {
|
|
267
|
+
var _a2;
|
|
268
|
+
if (((_a2 = event.detail) == null ? void 0 : _a2.focusReason) === "pointer") {
|
|
269
|
+
event.preventDefault();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function onCloseRequested() {
|
|
273
|
+
if (props.closeOnPressEscape) {
|
|
274
|
+
hide();
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function wheelHandler(e) {
|
|
278
|
+
if (!e.ctrlKey)
|
|
279
|
+
return;
|
|
280
|
+
if (e.deltaY < 0) {
|
|
281
|
+
e.preventDefault();
|
|
282
|
+
return false;
|
|
283
|
+
} else if (e.deltaY > 0) {
|
|
284
|
+
e.preventDefault();
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
vue.watch(() => scaleClamped.value, (val) => {
|
|
289
|
+
transform.value.scale = val;
|
|
290
|
+
});
|
|
291
|
+
vue.watch(currentImg, () => {
|
|
292
|
+
vue.nextTick(() => {
|
|
293
|
+
const $img = imgRef.value;
|
|
294
|
+
if (!($img == null ? void 0 : $img.complete)) {
|
|
295
|
+
loading.value = true;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
vue.watch(activeIndex, (val) => {
|
|
300
|
+
reset();
|
|
301
|
+
emit("switch", val);
|
|
302
|
+
});
|
|
303
|
+
vue.onMounted(() => {
|
|
304
|
+
visible.value = true;
|
|
305
|
+
registerEventListener();
|
|
306
|
+
stopWheelListener = core.useEventListener("wheel", wheelHandler, {
|
|
307
|
+
passive: false
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
expose({
|
|
311
|
+
setActiveItem
|
|
312
|
+
});
|
|
313
|
+
return (_ctx, _cache) => {
|
|
314
|
+
return vue.openBlock(), vue.createBlock(vue.unref(index$4.ElTeleport), {
|
|
315
|
+
to: "body",
|
|
316
|
+
disabled: !_ctx.teleported
|
|
317
|
+
}, {
|
|
318
|
+
default: vue.withCtx(() => [
|
|
319
|
+
vue.createVNode(vue.Transition, {
|
|
320
|
+
name: "viewer-fade",
|
|
321
|
+
appear: ""
|
|
322
|
+
}, {
|
|
323
|
+
default: vue.withCtx(() => [
|
|
324
|
+
vue.createElementVNode("div", {
|
|
325
|
+
ref_key: "wrapper",
|
|
326
|
+
ref: wrapper,
|
|
327
|
+
tabindex: -1,
|
|
328
|
+
class: vue.normalizeClass(vue.unref(ns).e("wrapper")),
|
|
329
|
+
style: vue.normalizeStyle({ zIndex: zIndex.value })
|
|
330
|
+
}, [
|
|
331
|
+
vue.createVNode(vue.unref(focusTrap["default"]), {
|
|
332
|
+
loop: "",
|
|
333
|
+
trapped: "",
|
|
334
|
+
"focus-trap-el": wrapper.value,
|
|
335
|
+
"focus-start-el": "container",
|
|
336
|
+
onFocusoutPrevented,
|
|
337
|
+
onReleaseRequested: onCloseRequested
|
|
338
|
+
}, {
|
|
339
|
+
default: vue.withCtx(() => [
|
|
340
|
+
vue.createElementVNode("div", {
|
|
341
|
+
class: vue.normalizeClass(vue.unref(ns).e("mask")),
|
|
342
|
+
onClick: vue.withModifiers(($event) => _ctx.hideOnClickModal && hide(), ["self"])
|
|
343
|
+
}, null, 10, ["onClick"]),
|
|
344
|
+
vue.createCommentVNode(" CLOSE "),
|
|
345
|
+
vue.createElementVNode("span", {
|
|
346
|
+
class: vue.normalizeClass([vue.unref(ns).e("btn"), vue.unref(ns).e("close")]),
|
|
347
|
+
onClick: hide
|
|
348
|
+
}, [
|
|
349
|
+
vue.createVNode(vue.unref(index$5.ElIcon), null, {
|
|
350
|
+
default: vue.withCtx(() => [
|
|
351
|
+
vue.createVNode(vue.unref(iconsVue.Close))
|
|
352
|
+
]),
|
|
353
|
+
_: 1
|
|
354
|
+
})
|
|
355
|
+
], 2),
|
|
356
|
+
vue.createCommentVNode(" ARROW "),
|
|
357
|
+
!vue.unref(isSingle) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
358
|
+
vue.createElementVNode("span", {
|
|
359
|
+
class: vue.normalizeClass(vue.unref(arrowPrevKls)),
|
|
360
|
+
onClick: prev
|
|
361
|
+
}, [
|
|
362
|
+
vue.createVNode(vue.unref(index$5.ElIcon), null, {
|
|
363
|
+
default: vue.withCtx(() => [
|
|
364
|
+
vue.createVNode(vue.unref(iconsVue.ArrowLeft))
|
|
365
|
+
]),
|
|
366
|
+
_: 1
|
|
367
|
+
})
|
|
368
|
+
], 2),
|
|
369
|
+
vue.createElementVNode("span", {
|
|
370
|
+
class: vue.normalizeClass(vue.unref(arrowNextKls)),
|
|
371
|
+
onClick: next
|
|
372
|
+
}, [
|
|
373
|
+
vue.createVNode(vue.unref(index$5.ElIcon), null, {
|
|
374
|
+
default: vue.withCtx(() => [
|
|
375
|
+
vue.createVNode(vue.unref(iconsVue.ArrowRight))
|
|
376
|
+
]),
|
|
377
|
+
_: 1
|
|
378
|
+
})
|
|
379
|
+
], 2)
|
|
380
|
+
], 64)) : vue.createCommentVNode("v-if", true),
|
|
381
|
+
_ctx.$slots.progress || _ctx.showProgress ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
382
|
+
key: 1,
|
|
383
|
+
class: vue.normalizeClass([vue.unref(ns).e("btn"), vue.unref(ns).e("progress")])
|
|
384
|
+
}, [
|
|
385
|
+
vue.renderSlot(_ctx.$slots, "progress", {
|
|
386
|
+
activeIndex: activeIndex.value,
|
|
387
|
+
total: _ctx.urlList.length
|
|
388
|
+
}, () => [
|
|
389
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(progress)), 1)
|
|
390
|
+
])
|
|
391
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
392
|
+
vue.createCommentVNode(" ACTIONS "),
|
|
393
|
+
vue.createElementVNode("div", {
|
|
394
|
+
class: vue.normalizeClass([vue.unref(ns).e("btn"), vue.unref(ns).e("actions")])
|
|
395
|
+
}, [
|
|
396
|
+
vue.createElementVNode("div", {
|
|
397
|
+
class: vue.normalizeClass(vue.unref(ns).e("actions__inner"))
|
|
398
|
+
}, [
|
|
399
|
+
vue.renderSlot(_ctx.$slots, "toolbar", {
|
|
400
|
+
actions: handleActions,
|
|
401
|
+
prev,
|
|
402
|
+
next,
|
|
403
|
+
reset: toggleMode,
|
|
404
|
+
activeIndex: activeIndex.value,
|
|
405
|
+
setActiveItem
|
|
406
|
+
}, () => [
|
|
407
|
+
vue.createVNode(vue.unref(index$5.ElIcon), {
|
|
408
|
+
onClick: ($event) => handleActions("zoomOut")
|
|
409
|
+
}, {
|
|
410
|
+
default: vue.withCtx(() => [
|
|
411
|
+
vue.createVNode(vue.unref(iconsVue.ZoomOut))
|
|
412
|
+
]),
|
|
413
|
+
_: 1
|
|
414
|
+
}, 8, ["onClick"]),
|
|
415
|
+
vue.createVNode(vue.unref(index$5.ElIcon), {
|
|
416
|
+
onClick: ($event) => handleActions("zoomIn")
|
|
417
|
+
}, {
|
|
418
|
+
default: vue.withCtx(() => [
|
|
419
|
+
vue.createVNode(vue.unref(iconsVue.ZoomIn))
|
|
420
|
+
]),
|
|
421
|
+
_: 1
|
|
422
|
+
}, 8, ["onClick"]),
|
|
423
|
+
vue.createElementVNode("i", {
|
|
424
|
+
class: vue.normalizeClass(vue.unref(ns).e("actions__divider"))
|
|
425
|
+
}, null, 2),
|
|
426
|
+
vue.createVNode(vue.unref(index$5.ElIcon), { onClick: toggleMode }, {
|
|
427
|
+
default: vue.withCtx(() => [
|
|
428
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(mode).icon)))
|
|
429
|
+
]),
|
|
430
|
+
_: 1
|
|
431
|
+
}),
|
|
432
|
+
vue.createElementVNode("i", {
|
|
433
|
+
class: vue.normalizeClass(vue.unref(ns).e("actions__divider"))
|
|
434
|
+
}, null, 2),
|
|
435
|
+
vue.createVNode(vue.unref(index$5.ElIcon), {
|
|
436
|
+
onClick: ($event) => handleActions("anticlockwise")
|
|
437
|
+
}, {
|
|
438
|
+
default: vue.withCtx(() => [
|
|
439
|
+
vue.createVNode(vue.unref(iconsVue.RefreshLeft))
|
|
440
|
+
]),
|
|
441
|
+
_: 1
|
|
442
|
+
}, 8, ["onClick"]),
|
|
443
|
+
vue.createVNode(vue.unref(index$5.ElIcon), {
|
|
444
|
+
onClick: ($event) => handleActions("clockwise")
|
|
445
|
+
}, {
|
|
446
|
+
default: vue.withCtx(() => [
|
|
447
|
+
vue.createVNode(vue.unref(iconsVue.RefreshRight))
|
|
448
|
+
]),
|
|
449
|
+
_: 1
|
|
450
|
+
}, 8, ["onClick"])
|
|
451
|
+
])
|
|
452
|
+
], 2)
|
|
453
|
+
], 2),
|
|
454
|
+
vue.createCommentVNode(" CANVAS "),
|
|
455
|
+
vue.createElementVNode("div", {
|
|
456
|
+
class: vue.normalizeClass(vue.unref(ns).e("canvas"))
|
|
457
|
+
}, [
|
|
458
|
+
loadError.value && _ctx.$slots["viewer-error"] ? vue.renderSlot(_ctx.$slots, "viewer-error", {
|
|
459
|
+
key: 0,
|
|
460
|
+
activeIndex: activeIndex.value,
|
|
461
|
+
src: vue.unref(currentImg)
|
|
462
|
+
}) : (vue.openBlock(), vue.createElementBlock("img", {
|
|
463
|
+
ref_key: "imgRef",
|
|
464
|
+
ref: imgRef,
|
|
465
|
+
key: vue.unref(currentImg),
|
|
466
|
+
src: vue.unref(currentImg),
|
|
467
|
+
style: vue.normalizeStyle(vue.unref(imgStyle)),
|
|
468
|
+
class: vue.normalizeClass(vue.unref(ns).e("img")),
|
|
469
|
+
crossorigin: _ctx.crossorigin,
|
|
470
|
+
onLoad: handleImgLoad,
|
|
471
|
+
onError: handleImgError,
|
|
472
|
+
onMousedown: handleMouseDown,
|
|
473
|
+
onTouchstart: handleTouchStart
|
|
474
|
+
}, null, 46, ["src", "crossorigin"]))
|
|
475
|
+
], 2),
|
|
476
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
477
|
+
]),
|
|
478
|
+
_: 3
|
|
479
|
+
}, 8, ["focus-trap-el"])
|
|
480
|
+
], 6)
|
|
481
|
+
]),
|
|
482
|
+
_: 3
|
|
483
|
+
})
|
|
484
|
+
]),
|
|
485
|
+
_: 3
|
|
486
|
+
}, 8, ["disabled"]);
|
|
487
|
+
};
|
|
50
488
|
}
|
|
51
489
|
});
|
|
52
|
-
|
|
53
|
-
close: () => true,
|
|
54
|
-
error: (evt) => evt instanceof Event,
|
|
55
|
-
switch: (index) => types.isNumber(index),
|
|
56
|
-
rotate: (deg) => types.isNumber(deg)
|
|
57
|
-
};
|
|
490
|
+
var ImageViewer = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "image-viewer.vue"]]);
|
|
58
491
|
|
|
59
|
-
exports
|
|
60
|
-
exports.imageViewerProps = imageViewerProps;
|
|
492
|
+
exports["default"] = ImageViewer;
|
|
61
493
|
//# sourceMappingURL=image-viewer.js.map
|