@element-plus/nightly 0.0.20250916 → 0.0.20250918
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.full.js +68 -30
- package/dist/index.full.min.js +12 -12
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +13 -13
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +68 -30
- 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/anchor/index.mjs +1 -1
- package/es/components/anchor/src/anchor-link.mjs +5 -81
- package/es/components/anchor/src/anchor-link.mjs.map +1 -1
- package/es/components/anchor/src/anchor-link2.mjs +81 -5
- package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
- package/es/components/badge/index.mjs +2 -2
- package/es/components/badge/src/badge.mjs +71 -32
- package/es/components/badge/src/badge.mjs.map +1 -1
- package/es/components/badge/src/badge2.mjs +32 -71
- package/es/components/badge/src/badge2.mjs.map +1 -1
- package/es/components/button/index.mjs +2 -2
- package/es/components/button/src/button-group.mjs +1 -1
- package/es/components/button/src/button.mjs +65 -88
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +88 -65
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/cascader-panel/src/store.d.ts +1 -1
- package/es/components/cascader-panel/src/store.mjs.map +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +43 -64
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +64 -43
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse-item.mjs +95 -18
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item2.mjs +18 -95
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/countdown/index.mjs +2 -2
- package/es/components/countdown/src/countdown.mjs +79 -21
- package/es/components/countdown/src/countdown.mjs.map +1 -1
- package/es/components/countdown/src/countdown2.mjs +21 -79
- package/es/components/countdown/src/countdown2.mjs.map +1 -1
- package/es/components/date-picker/src/instance.d.ts +1 -1
- package/es/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -0
- package/es/components/date-picker-panel/src/composables/use-basic-date-table.mjs +4 -0
- package/es/components/date-picker-panel/src/composables/use-basic-date-table.mjs.map +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/basic-date-table.mjs +3 -2
- package/es/components/date-picker-panel/src/date-picker-com/basic-date-table.mjs.map +1 -1
- package/es/components/date-picker-panel/src/instance.d.ts +1 -1
- package/es/components/descriptions/index.mjs +2 -2
- package/es/components/descriptions/src/description.mjs +26 -127
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +127 -26
- package/es/components/descriptions/src/description2.mjs.map +1 -1
- package/es/components/divider/index.mjs +2 -2
- package/es/components/divider/src/divider.mjs +16 -34
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider2.mjs +34 -16
- package/es/components/divider/src/divider2.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +27 -192
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +192 -27
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/tokens.d.ts +1 -1
- package/es/components/dropdown/src/tokens.mjs.map +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.d.ts +1 -0
- package/es/components/image/src/image.mjs +69 -227
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image.vue.d.ts +7 -0
- package/es/components/image/src/image2.mjs +234 -65
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer.d.ts +2 -0
- package/es/components/image-viewer/src/image-viewer.mjs +5 -0
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +9 -0
- package/es/components/image-viewer/src/image-viewer2.mjs +35 -24
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +18 -18
- package/es/components/input-tag/src/composables/use-drag-tag.d.ts +1 -1
- package/es/components/input-tag/src/composables/use-drag-tag.mjs.map +1 -1
- package/es/components/mention/index.mjs +2 -2
- package/es/components/mention/src/mention-dropdown.mjs +166 -15
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +15 -166
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention.mjs +74 -303
- package/es/components/mention/src/mention.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +303 -74
- package/es/components/mention/src/mention2.mjs.map +1 -1
- package/es/components/pagination/src/components/next.mjs +35 -18
- package/es/components/pagination/src/components/next.mjs.map +1 -1
- package/es/components/pagination/src/components/next2.mjs +18 -35
- package/es/components/pagination/src/components/next2.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.mjs +71 -23
- package/es/components/pagination/src/components/sizes.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes2.mjs +23 -71
- package/es/components/pagination/src/components/sizes2.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/segmented/index.mjs +2 -2
- package/es/components/segmented/src/segmented.mjs +42 -170
- package/es/components/segmented/src/segmented.mjs.map +1 -1
- package/es/components/segmented/src/segmented2.mjs +170 -42
- package/es/components/segmented/src/segmented2.mjs.map +1 -1
- package/es/components/select/src/select.d.ts +1 -1
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/useSelect.d.ts +1 -1
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/src/defaults.d.ts +1 -1
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/components/skeleton/index.mjs +4 -4
- package/es/components/skeleton/src/skeleton-item.mjs +17 -22
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +22 -17
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton.mjs +18 -48
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +48 -18
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/slider/index.mjs +2 -2
- package/es/components/slider/src/slider.mjs +92 -238
- package/es/components/slider/src/slider.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +238 -92
- package/es/components/slider/src/slider2.mjs.map +1 -1
- package/es/components/splitter/index.mjs +2 -2
- package/es/components/splitter/src/split-panel.mjs +157 -17
- package/es/components/splitter/src/split-panel.mjs.map +1 -1
- package/es/components/splitter/src/split-panel2.mjs +17 -157
- package/es/components/splitter/src/split-panel2.mjs.map +1 -1
- package/es/components/splitter/src/splitter2.mjs.map +1 -1
- package/es/components/table/src/table-header/index.d.ts +1 -1
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table-v2/src/composables/use-styles.d.ts +1 -2
- package/es/components/table-v2/src/composables/use-styles.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar.d.ts +4 -4
- package/es/components/tabs/src/tab-bar.vue.d.ts +9 -9
- package/es/components/tabs/src/tab-nav.d.ts +15 -15
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/components/tabs/src/tab-nav.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane.d.ts +1 -1
- package/es/components/tabs/src/tab-pane.mjs +4 -1
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane.vue.d.ts +3 -3
- package/es/components/tabs/src/tab-pane2.mjs +4 -1
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tabs/src/tabs.d.ts +1 -1
- package/es/components/tooltip/index.mjs +2 -2
- package/es/components/tooltip/src/tooltip.mjs +166 -30
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +30 -166
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip-v2/index.mjs +2 -2
- package/es/components/tooltip-v2/src/content.mjs +110 -48
- package/es/components/tooltip-v2/src/content.mjs.map +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +48 -110
- package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root.mjs +79 -17
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +17 -79
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +2 -2
- package/es/components/tooltip-v2/src/tooltip2.mjs +4 -4
- package/es/components/tour/index.mjs +2 -2
- package/es/components/tour/src/tour.mjs +69 -154
- package/es/components/tour/src/tour.mjs.map +1 -1
- package/es/components/tour/src/tour2.mjs +154 -69
- package/es/components/tour/src/tour2.mjs.map +1 -1
- package/es/components/upload/index.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +25 -173
- package/es/components/upload/src/upload-list.mjs.map +1 -1
- package/es/components/upload/src/upload-list2.mjs +173 -25
- package/es/components/upload/src/upload-list2.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +1 -1
- package/es/hooks/use-id/index.d.ts +1 -1
- package/es/hooks/use-id/index.mjs.map +1 -1
- package/es/index.d.ts +53 -34
- package/es/index.mjs +18 -18
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/anchor/index.js +1 -1
- package/lib/components/anchor/src/anchor-link.js +5 -81
- package/lib/components/anchor/src/anchor-link.js.map +1 -1
- package/lib/components/anchor/src/anchor-link2.js +81 -5
- package/lib/components/anchor/src/anchor-link2.js.map +1 -1
- package/lib/components/badge/index.js +2 -2
- package/lib/components/badge/src/badge.js +71 -32
- package/lib/components/badge/src/badge.js.map +1 -1
- package/lib/components/badge/src/badge2.js +32 -71
- package/lib/components/badge/src/badge2.js.map +1 -1
- package/lib/components/button/index.js +2 -2
- package/lib/components/button/src/button-group.js +1 -1
- package/lib/components/button/src/button.js +68 -88
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +88 -68
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/cascader-panel/src/store.d.ts +1 -1
- package/lib/components/cascader-panel/src/store.js.map +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +43 -64
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +64 -43
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse-item.js +95 -18
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item2.js +18 -95
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/countdown/index.js +2 -2
- package/lib/components/countdown/src/countdown.js +79 -22
- package/lib/components/countdown/src/countdown.js.map +1 -1
- package/lib/components/countdown/src/countdown2.js +22 -79
- package/lib/components/countdown/src/countdown2.js.map +1 -1
- package/lib/components/date-picker/src/instance.d.ts +1 -1
- package/lib/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -0
- package/lib/components/date-picker-panel/src/composables/use-basic-date-table.js +4 -0
- package/lib/components/date-picker-panel/src/composables/use-basic-date-table.js.map +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/basic-date-table.js +3 -2
- package/lib/components/date-picker-panel/src/date-picker-com/basic-date-table.js.map +1 -1
- package/lib/components/date-picker-panel/src/instance.d.ts +1 -1
- package/lib/components/descriptions/index.js +2 -2
- package/lib/components/descriptions/src/description.js +26 -127
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +127 -26
- package/lib/components/descriptions/src/description2.js.map +1 -1
- package/lib/components/divider/index.js +2 -2
- package/lib/components/divider/src/divider.js +16 -34
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider2.js +34 -16
- package/lib/components/divider/src/divider2.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +28 -192
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +192 -28
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/tokens.d.ts +1 -1
- package/lib/components/dropdown/src/tokens.js.map +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.d.ts +1 -0
- package/lib/components/image/src/image.js +69 -226
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image.vue.d.ts +7 -0
- package/lib/components/image/src/image2.js +233 -65
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer.d.ts +2 -0
- package/lib/components/image-viewer/src/image-viewer.js +5 -0
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +9 -0
- package/lib/components/image-viewer/src/image-viewer2.js +33 -22
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +18 -18
- package/lib/components/input-tag/src/composables/use-drag-tag.d.ts +1 -1
- package/lib/components/input-tag/src/composables/use-drag-tag.js.map +1 -1
- package/lib/components/mention/index.js +2 -2
- package/lib/components/mention/src/mention-dropdown.js +166 -16
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +16 -166
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention.js +74 -301
- package/lib/components/mention/src/mention.js.map +1 -1
- package/lib/components/mention/src/mention2.js +301 -74
- package/lib/components/mention/src/mention2.js.map +1 -1
- package/lib/components/pagination/src/components/next.js +35 -18
- package/lib/components/pagination/src/components/next.js.map +1 -1
- package/lib/components/pagination/src/components/next2.js +18 -35
- package/lib/components/pagination/src/components/next2.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.js +71 -23
- package/lib/components/pagination/src/components/sizes.js.map +1 -1
- package/lib/components/pagination/src/components/sizes2.js +23 -71
- package/lib/components/pagination/src/components/sizes2.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/segmented/index.js +2 -2
- package/lib/components/segmented/src/segmented.js +44 -170
- package/lib/components/segmented/src/segmented.js.map +1 -1
- package/lib/components/segmented/src/segmented2.js +170 -44
- package/lib/components/segmented/src/segmented2.js.map +1 -1
- package/lib/components/select/src/select.d.ts +1 -1
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/useSelect.d.ts +1 -1
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/src/defaults.d.ts +1 -1
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/components/skeleton/index.js +4 -4
- package/lib/components/skeleton/src/skeleton-item.js +17 -22
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item2.js +22 -17
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton.js +18 -48
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +48 -18
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/slider/index.js +2 -2
- package/lib/components/slider/src/slider.js +93 -238
- package/lib/components/slider/src/slider.js.map +1 -1
- package/lib/components/slider/src/slider2.js +238 -93
- package/lib/components/slider/src/slider2.js.map +1 -1
- package/lib/components/splitter/index.js +2 -2
- package/lib/components/splitter/src/split-panel.js +157 -17
- package/lib/components/splitter/src/split-panel.js.map +1 -1
- package/lib/components/splitter/src/split-panel2.js +17 -157
- package/lib/components/splitter/src/split-panel2.js.map +1 -1
- package/lib/components/splitter/src/splitter2.js.map +1 -1
- package/lib/components/table/src/table-header/index.d.ts +1 -1
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table-v2/src/composables/use-styles.d.ts +1 -2
- package/lib/components/table-v2/src/composables/use-styles.js.map +1 -1
- package/lib/components/tabs/src/tab-bar.d.ts +4 -4
- package/lib/components/tabs/src/tab-bar.vue.d.ts +9 -9
- package/lib/components/tabs/src/tab-nav.d.ts +15 -15
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/components/tabs/src/tab-nav.js.map +1 -1
- package/lib/components/tabs/src/tab-pane.d.ts +1 -1
- package/lib/components/tabs/src/tab-pane.js +4 -1
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane.vue.d.ts +3 -3
- package/lib/components/tabs/src/tab-pane2.js +4 -1
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tabs/src/tabs.d.ts +1 -1
- package/lib/components/tooltip/index.js +2 -2
- package/lib/components/tooltip/src/tooltip.js +166 -34
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +34 -166
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip-v2/index.js +2 -2
- package/lib/components/tooltip-v2/src/content.js +110 -48
- package/lib/components/tooltip-v2/src/content.js.map +1 -1
- package/lib/components/tooltip-v2/src/content2.js +48 -110
- package/lib/components/tooltip-v2/src/content2.js.map +1 -1
- package/lib/components/tooltip-v2/src/root.js +79 -17
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +17 -79
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +2 -2
- package/lib/components/tooltip-v2/src/tooltip2.js +4 -4
- package/lib/components/tour/index.js +2 -2
- package/lib/components/tour/src/tour.js +69 -153
- package/lib/components/tour/src/tour.js.map +1 -1
- package/lib/components/tour/src/tour2.js +153 -69
- package/lib/components/tour/src/tour2.js.map +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/upload/src/upload-list.js +26 -173
- package/lib/components/upload/src/upload-list.js.map +1 -1
- package/lib/components/upload/src/upload-list2.js +173 -26
- package/lib/components/upload/src/upload-list2.js.map +1 -1
- package/lib/components/upload/src/upload2.js +1 -1
- package/lib/hooks/use-id/index.d.ts +1 -1
- package/lib/hooks/use-id/index.js.map +1 -1
- package/lib/index.d.ts +53 -34
- package/lib/index.js +18 -18
- 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/web-types.json +1 -1
@@ -2,74 +2,242 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var
|
6
|
-
var
|
5
|
+
var vue = require('vue');
|
6
|
+
var core = require('@vueuse/core');
|
7
|
+
var lodashUnified = require('lodash-unified');
|
8
|
+
var index$3 = require('../../image-viewer/index.js');
|
9
|
+
var image = require('./image.js');
|
10
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
7
11
|
var types = require('../../../utils/types.js');
|
12
|
+
var index = require('../../../hooks/use-locale/index.js');
|
13
|
+
var index$1 = require('../../../hooks/use-namespace/index.js');
|
14
|
+
var index$2 = require('../../../hooks/use-attrs/index.js');
|
15
|
+
var shared = require('@vue/shared');
|
16
|
+
var scroll = require('../../../utils/dom/scroll.js');
|
8
17
|
|
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
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
18
|
+
const __default__ = vue.defineComponent({
|
19
|
+
name: "ElImage",
|
20
|
+
inheritAttrs: false
|
21
|
+
});
|
22
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
23
|
+
...__default__,
|
24
|
+
props: image.imageProps,
|
25
|
+
emits: image.imageEmits,
|
26
|
+
setup(__props, { expose, emit }) {
|
27
|
+
const props = __props;
|
28
|
+
const { t } = index.useLocale();
|
29
|
+
const ns = index$1.useNamespace("image");
|
30
|
+
const rawAttrs = vue.useAttrs();
|
31
|
+
const containerAttrs = vue.computed(() => {
|
32
|
+
return lodashUnified.fromPairs(Object.entries(rawAttrs).filter(([key]) => /^(data-|on[A-Z])/i.test(key) || ["id", "style"].includes(key)));
|
33
|
+
});
|
34
|
+
const imgAttrs = index$2.useAttrs({
|
35
|
+
excludeListeners: true,
|
36
|
+
excludeKeys: vue.computed(() => {
|
37
|
+
return Object.keys(containerAttrs.value);
|
38
|
+
})
|
39
|
+
});
|
40
|
+
const imageSrc = vue.ref();
|
41
|
+
const hasLoadError = vue.ref(false);
|
42
|
+
const isLoading = vue.ref(true);
|
43
|
+
const showViewer = vue.ref(false);
|
44
|
+
const container = vue.ref();
|
45
|
+
const _scrollContainer = vue.ref();
|
46
|
+
const supportLoading = core.isClient && "loading" in HTMLImageElement.prototype;
|
47
|
+
let stopScrollListener;
|
48
|
+
const imageKls = vue.computed(() => [
|
49
|
+
ns.e("inner"),
|
50
|
+
preview.value && ns.e("preview"),
|
51
|
+
isLoading.value && ns.is("loading")
|
52
|
+
]);
|
53
|
+
const imageStyle = vue.computed(() => {
|
54
|
+
const { fit } = props;
|
55
|
+
if (core.isClient && fit) {
|
56
|
+
return { objectFit: fit };
|
57
|
+
}
|
58
|
+
return {};
|
59
|
+
});
|
60
|
+
const preview = vue.computed(() => {
|
61
|
+
const { previewSrcList } = props;
|
62
|
+
return shared.isArray(previewSrcList) && previewSrcList.length > 0;
|
63
|
+
});
|
64
|
+
const imageIndex = vue.computed(() => {
|
65
|
+
const { previewSrcList, initialIndex } = props;
|
66
|
+
let previewIndex = initialIndex;
|
67
|
+
if (initialIndex > previewSrcList.length - 1) {
|
68
|
+
previewIndex = 0;
|
69
|
+
}
|
70
|
+
return previewIndex;
|
71
|
+
});
|
72
|
+
const isManual = vue.computed(() => {
|
73
|
+
if (props.loading === "eager")
|
74
|
+
return false;
|
75
|
+
return !supportLoading && props.loading === "lazy" || props.lazy;
|
76
|
+
});
|
77
|
+
const loadImage = () => {
|
78
|
+
if (!core.isClient)
|
79
|
+
return;
|
80
|
+
isLoading.value = true;
|
81
|
+
hasLoadError.value = false;
|
82
|
+
imageSrc.value = props.src;
|
83
|
+
};
|
84
|
+
function handleLoad(event) {
|
85
|
+
isLoading.value = false;
|
86
|
+
hasLoadError.value = false;
|
87
|
+
emit("load", event);
|
88
|
+
}
|
89
|
+
function handleError(event) {
|
90
|
+
isLoading.value = false;
|
91
|
+
hasLoadError.value = true;
|
92
|
+
emit("error", event);
|
93
|
+
}
|
94
|
+
function handleLazyLoad(isIntersecting) {
|
95
|
+
if (isIntersecting) {
|
96
|
+
loadImage();
|
97
|
+
removeLazyLoadListener();
|
98
|
+
}
|
99
|
+
}
|
100
|
+
const lazyLoadHandler = core.useThrottleFn(handleLazyLoad, 200, true);
|
101
|
+
async function addLazyLoadListener() {
|
102
|
+
var _a;
|
103
|
+
if (!core.isClient)
|
104
|
+
return;
|
105
|
+
await vue.nextTick();
|
106
|
+
const { scrollContainer } = props;
|
107
|
+
if (types.isElement(scrollContainer)) {
|
108
|
+
_scrollContainer.value = scrollContainer;
|
109
|
+
} else if (shared.isString(scrollContainer) && scrollContainer !== "") {
|
110
|
+
_scrollContainer.value = (_a = document.querySelector(scrollContainer)) != null ? _a : void 0;
|
111
|
+
} else if (container.value) {
|
112
|
+
const scrollContainer2 = scroll.getScrollContainer(container.value);
|
113
|
+
_scrollContainer.value = types.isWindow(scrollContainer2) ? void 0 : scrollContainer2;
|
114
|
+
}
|
115
|
+
const { stop } = core.useIntersectionObserver(container, ([entry]) => {
|
116
|
+
lazyLoadHandler(entry.isIntersecting);
|
117
|
+
}, { root: _scrollContainer });
|
118
|
+
stopScrollListener = stop;
|
119
|
+
}
|
120
|
+
function removeLazyLoadListener() {
|
121
|
+
if (!core.isClient || !lazyLoadHandler)
|
122
|
+
return;
|
123
|
+
stopScrollListener == null ? void 0 : stopScrollListener();
|
124
|
+
_scrollContainer.value = void 0;
|
125
|
+
stopScrollListener = void 0;
|
126
|
+
}
|
127
|
+
function clickHandler() {
|
128
|
+
if (!preview.value)
|
129
|
+
return;
|
130
|
+
showViewer.value = true;
|
131
|
+
emit("show");
|
132
|
+
}
|
133
|
+
function closeViewer() {
|
134
|
+
showViewer.value = false;
|
135
|
+
emit("close");
|
136
|
+
}
|
137
|
+
function switchViewer(val) {
|
138
|
+
emit("switch", val);
|
139
|
+
}
|
140
|
+
vue.watch(() => props.src, () => {
|
141
|
+
if (isManual.value) {
|
142
|
+
isLoading.value = true;
|
143
|
+
hasLoadError.value = false;
|
144
|
+
removeLazyLoadListener();
|
145
|
+
addLazyLoadListener();
|
146
|
+
} else {
|
147
|
+
loadImage();
|
148
|
+
}
|
149
|
+
});
|
150
|
+
vue.onMounted(() => {
|
151
|
+
if (isManual.value) {
|
152
|
+
addLazyLoadListener();
|
153
|
+
} else {
|
154
|
+
loadImage();
|
155
|
+
}
|
156
|
+
});
|
157
|
+
expose({
|
158
|
+
showPreview: clickHandler
|
159
|
+
});
|
160
|
+
return (_ctx, _cache) => {
|
161
|
+
return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
162
|
+
ref_key: "container",
|
163
|
+
ref: container
|
164
|
+
}, vue.unref(containerAttrs), {
|
165
|
+
class: [vue.unref(ns).b(), _ctx.$attrs.class]
|
166
|
+
}), [
|
167
|
+
hasLoadError.value ? vue.renderSlot(_ctx.$slots, "error", { key: 0 }, () => [
|
168
|
+
vue.createElementVNode("div", {
|
169
|
+
class: vue.normalizeClass(vue.unref(ns).e("error"))
|
170
|
+
}, vue.toDisplayString(vue.unref(t)("el.image.error")), 3)
|
171
|
+
]) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
172
|
+
imageSrc.value !== void 0 ? (vue.openBlock(), vue.createElementBlock("img", vue.mergeProps({ key: 0 }, vue.unref(imgAttrs), {
|
173
|
+
src: imageSrc.value,
|
174
|
+
loading: _ctx.loading,
|
175
|
+
style: vue.unref(imageStyle),
|
176
|
+
class: vue.unref(imageKls),
|
177
|
+
crossorigin: _ctx.crossorigin,
|
178
|
+
onClick: clickHandler,
|
179
|
+
onLoad: handleLoad,
|
180
|
+
onError: handleError
|
181
|
+
}), null, 16, ["src", "loading", "crossorigin"])) : vue.createCommentVNode("v-if", true),
|
182
|
+
isLoading.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
183
|
+
key: 1,
|
184
|
+
class: vue.normalizeClass(vue.unref(ns).e("wrapper"))
|
185
|
+
}, [
|
186
|
+
vue.renderSlot(_ctx.$slots, "placeholder", {}, () => [
|
187
|
+
vue.createElementVNode("div", {
|
188
|
+
class: vue.normalizeClass(vue.unref(ns).e("placeholder"))
|
189
|
+
}, null, 2)
|
190
|
+
])
|
191
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
192
|
+
], 64)),
|
193
|
+
vue.unref(preview) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
194
|
+
showViewer.value ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.ElImageViewer), {
|
195
|
+
key: 0,
|
196
|
+
"z-index": _ctx.zIndex,
|
197
|
+
"initial-index": vue.unref(imageIndex),
|
198
|
+
infinite: _ctx.infinite,
|
199
|
+
"zoom-rate": _ctx.zoomRate,
|
200
|
+
"min-scale": _ctx.minScale,
|
201
|
+
"max-scale": _ctx.maxScale,
|
202
|
+
"show-progress": _ctx.showProgress,
|
203
|
+
"url-list": _ctx.previewSrcList,
|
204
|
+
scale: _ctx.scale,
|
205
|
+
crossorigin: _ctx.crossorigin,
|
206
|
+
"hide-on-click-modal": _ctx.hideOnClickModal,
|
207
|
+
teleported: _ctx.previewTeleported,
|
208
|
+
"close-on-press-escape": _ctx.closeOnPressEscape,
|
209
|
+
onClose: closeViewer,
|
210
|
+
onSwitch: switchViewer
|
211
|
+
}, vue.createSlots({
|
212
|
+
toolbar: vue.withCtx((toolbar) => [
|
213
|
+
vue.renderSlot(_ctx.$slots, "toolbar", vue.normalizeProps(vue.guardReactiveProps(toolbar)))
|
214
|
+
]),
|
215
|
+
default: vue.withCtx(() => [
|
216
|
+
_ctx.$slots.viewer ? (vue.openBlock(), vue.createElementBlock("div", { key: 0 }, [
|
217
|
+
vue.renderSlot(_ctx.$slots, "viewer")
|
218
|
+
])) : vue.createCommentVNode("v-if", true)
|
219
|
+
]),
|
220
|
+
_: 2
|
221
|
+
}, [
|
222
|
+
_ctx.$slots.progress ? {
|
223
|
+
name: "progress",
|
224
|
+
fn: vue.withCtx((progress) => [
|
225
|
+
vue.renderSlot(_ctx.$slots, "progress", vue.normalizeProps(vue.guardReactiveProps(progress)))
|
226
|
+
])
|
227
|
+
} : void 0,
|
228
|
+
_ctx.$slots["viewer-error"] ? {
|
229
|
+
name: "viewer-error",
|
230
|
+
fn: vue.withCtx((viewerError) => [
|
231
|
+
vue.renderSlot(_ctx.$slots, "viewer-error", vue.normalizeProps(vue.guardReactiveProps(viewerError)))
|
232
|
+
])
|
233
|
+
} : void 0
|
234
|
+
]), 1032, ["z-index", "initial-index", "infinite", "zoom-rate", "min-scale", "max-scale", "show-progress", "url-list", "scale", "crossorigin", "hide-on-click-modal", "teleported", "close-on-press-escape"])) : vue.createCommentVNode("v-if", true)
|
235
|
+
], 64)) : vue.createCommentVNode("v-if", true)
|
236
|
+
], 16);
|
237
|
+
};
|
63
238
|
}
|
64
239
|
});
|
65
|
-
|
66
|
-
load: (evt) => evt instanceof Event,
|
67
|
-
error: (evt) => evt instanceof Event,
|
68
|
-
switch: (val) => types.isNumber(val),
|
69
|
-
close: () => true,
|
70
|
-
show: () => true
|
71
|
-
};
|
240
|
+
var Image = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "image.vue"]]);
|
72
241
|
|
73
|
-
exports
|
74
|
-
exports.imageProps = imageProps;
|
242
|
+
exports["default"] = Image;
|
75
243
|
//# sourceMappingURL=image2.js.map
|
@@ -1 +1 @@
|
|
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 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,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC;AAClE,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;AAC7B,GAAG;AACH,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,cAAc,EAAE;AAClB,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,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":["<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,WAAA,EAAAF,YAAA,CAAA,MAAA;AAAA,QACD,OAAA,MAAA,CAAA,IAAA,CAAA,cAAA,CAAA,KAAA,CAAA,CAAA;AAED,OAAA,CAAA;AAA0B,KAAA,CACxB,CAAkB;AAAA,IAClB,MAAA,QAAA;AACE,IAAO,MAAA,YAAO,GAAKG,OAAA,CAAA,KAAA,CAAA,CAAA;AAAoB,IAAA,MACxC,SAAA,GAAAA,OAAA,CAAA,IAAA,CAAA,CAAA;AAAA,IACH,MAAC,UAAA,GAAAA,OAAA,CAAA,KAAA,CAAA,CAAA;AAED,IAAA,MAAM,YAAmCA,OAAA,EAAA,CAAA;AACzC,IAAM,MAAA,mBAAmBA,OAAK,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -15,6 +15,7 @@ export declare const imageViewerProps: {
|
|
15
15
|
readonly teleported: BooleanConstructor;
|
16
16
|
readonly closeOnPressEscape: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
17
17
|
readonly zoomRate: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1.2, boolean>;
|
18
|
+
readonly scale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
18
19
|
readonly minScale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0.2, boolean>;
|
19
20
|
readonly maxScale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
20
21
|
readonly showProgress: BooleanConstructor;
|
@@ -29,6 +30,7 @@ export type ImageViewerProps = ExtractPropTypes<typeof imageViewerProps>;
|
|
29
30
|
export type ImageViewerPropsPublic = __ExtractPublicPropTypes<typeof imageViewerProps>;
|
30
31
|
export declare const imageViewerEmits: {
|
31
32
|
close: () => boolean;
|
33
|
+
error: (evt: Event) => boolean;
|
32
34
|
switch: (index: number) => boolean;
|
33
35
|
rotate: (deg: number) => boolean;
|
34
36
|
};
|
@@ -32,6 +32,10 @@ const imageViewerProps = runtime.buildProps({
|
|
32
32
|
type: Number,
|
33
33
|
default: 1.2
|
34
34
|
},
|
35
|
+
scale: {
|
36
|
+
type: Number,
|
37
|
+
default: 1
|
38
|
+
},
|
35
39
|
minScale: {
|
36
40
|
type: Number,
|
37
41
|
default: 0.2
|
@@ -47,6 +51,7 @@ const imageViewerProps = runtime.buildProps({
|
|
47
51
|
});
|
48
52
|
const imageViewerEmits = {
|
49
53
|
close: () => true,
|
54
|
+
error: (evt) => evt instanceof Event,
|
50
55
|
switch: (index) => types.isNumber(index),
|
51
56
|
rotate: (deg) => types.isNumber(deg)
|
52
57
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"image-viewer.js","sources":["../../../../../../packages/components/image-viewer/src/image-viewer.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isNumber,\n mutable,\n} from '@element-plus/utils'\n\nimport type { Component, ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type ImageViewer from './image-viewer.vue'\n\nexport type ImageViewerAction =\n | 'zoomIn'\n | 'zoomOut'\n | 'clockwise'\n | 'anticlockwise'\n\nexport const imageViewerProps = buildProps({\n /**\n * @description preview link list.\n */\n urlList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description preview backdrop z-index.\n */\n zIndex: {\n type: Number,\n },\n /**\n * @description the initial preview image index, less than or equal to the length of `url-list`.\n */\n initialIndex: {\n type: Number,\n default: 0,\n },\n /**\n * @description whether preview is infinite.\n */\n infinite: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether user can emit close event when clicking backdrop.\n */\n hideOnClickModal: Boolean,\n /**\n * @description whether to append image itself to body. A nested parent element attribute transform should have this attribute set to `true`.\n */\n teleported: Boolean,\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 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 ImageViewerProps = ExtractPropTypes<typeof imageViewerProps>\nexport type ImageViewerPropsPublic = __ExtractPublicPropTypes<\n typeof imageViewerProps\n>\n\nexport const imageViewerEmits = {\n close: () => true,\n switch: (index: number) => isNumber(index),\n rotate: (deg: number) => isNumber(deg),\n}\nexport type ImageViewerEmits = typeof imageViewerEmits\n\nexport interface ImageViewerMode {\n name: string\n icon: Component\n}\n\nexport type ImageViewerInstance = InstanceType<typeof ImageViewer> & unknown\n"],"names":["buildProps","definePropType","mutable","isNumber"],"mappings":";;;;;;;;AAMY,MAAC,gBAAgB,GAAGA,kBAAU,CAAC;AAC3C,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAMC,kBAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,gBAAgB,EAAE,OAAO;AAC3B,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,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,gBAAgB,GAAG;AAChC,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB,EAAE,MAAM,EAAE,CAAC,KAAK,KAAKE,cAAQ,CAAC,KAAK,CAAC;AACpC,EAAE,MAAM,EAAE,CAAC,GAAG,KAAKA,cAAQ,CAAC,GAAG,CAAC;AAChC;;;;;"}
|
1
|
+
{"version":3,"file":"image-viewer.js","sources":["../../../../../../packages/components/image-viewer/src/image-viewer.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isNumber,\n mutable,\n} from '@element-plus/utils'\n\nimport type { Component, ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type ImageViewer from './image-viewer.vue'\n\nexport type ImageViewerAction =\n | 'zoomIn'\n | 'zoomOut'\n | 'clockwise'\n | 'anticlockwise'\n\nexport const imageViewerProps = buildProps({\n /**\n * @description preview link list.\n */\n urlList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description preview backdrop z-index.\n */\n zIndex: {\n type: Number,\n },\n /**\n * @description the initial preview image index, less than or equal to the length of `url-list`.\n */\n initialIndex: {\n type: Number,\n default: 0,\n },\n /**\n * @description whether preview is infinite.\n */\n infinite: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether user can emit close event when clicking backdrop.\n */\n hideOnClickModal: Boolean,\n /**\n * @description whether to append image itself to body. A nested parent element attribute transform should have this attribute set to `true`.\n */\n teleported: Boolean,\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 ImageViewerProps = ExtractPropTypes<typeof imageViewerProps>\nexport type ImageViewerPropsPublic = __ExtractPublicPropTypes<\n typeof imageViewerProps\n>\n\nexport const imageViewerEmits = {\n close: () => true,\n error: (evt: Event) => evt instanceof Event,\n switch: (index: number) => isNumber(index),\n rotate: (deg: number) => isNumber(deg),\n}\nexport type ImageViewerEmits = typeof imageViewerEmits\n\nexport interface ImageViewerMode {\n name: string\n icon: Component\n}\n\nexport type ImageViewerInstance = InstanceType<typeof ImageViewer> & unknown\n"],"names":["buildProps","definePropType","mutable","isNumber"],"mappings":";;;;;;;;AAMY,MAAC,gBAAgB,GAAGA,kBAAU,CAAC;AAC3C,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAMC,kBAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,gBAAgB,EAAE,OAAO;AAC3B,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,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,gBAAgB,GAAG;AAChC,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,KAAK;AACtC,EAAE,MAAM,EAAE,CAAC,KAAK,KAAKE,cAAQ,CAAC,KAAK,CAAC;AACpC,EAAE,MAAM,EAAE,CAAC,GAAG,KAAKA,cAAQ,CAAC,GAAG,CAAC;AAChC;;;;;"}
|
@@ -17,6 +17,10 @@ declare function __VLS_template(): {
|
|
17
17
|
activeIndex: number;
|
18
18
|
setActiveItem: typeof setActiveItem;
|
19
19
|
}): any;
|
20
|
+
"viewer-error"?(_: {
|
21
|
+
activeIndex: number;
|
22
|
+
src: string;
|
23
|
+
}): any;
|
20
24
|
default?(_: {}): any;
|
21
25
|
};
|
22
26
|
declare const __VLS_component: import("vue").DefineComponent<{
|
@@ -33,6 +37,7 @@ declare const __VLS_component: import("vue").DefineComponent<{
|
|
33
37
|
readonly teleported: BooleanConstructor;
|
34
38
|
readonly closeOnPressEscape: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
35
39
|
readonly zoomRate: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1.2, boolean>;
|
40
|
+
readonly scale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
36
41
|
readonly minScale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0.2, boolean>;
|
37
42
|
readonly maxScale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
38
43
|
readonly showProgress: BooleanConstructor;
|
@@ -51,6 +56,7 @@ declare const __VLS_component: import("vue").DefineComponent<{
|
|
51
56
|
switch: (index: number) => void;
|
52
57
|
rotate: (deg: number) => void;
|
53
58
|
close: () => void;
|
59
|
+
error: (evt: Event) => void;
|
54
60
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
55
61
|
readonly urlList: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => [], boolean>;
|
56
62
|
readonly zIndex: {
|
@@ -65,6 +71,7 @@ declare const __VLS_component: import("vue").DefineComponent<{
|
|
65
71
|
readonly teleported: BooleanConstructor;
|
66
72
|
readonly closeOnPressEscape: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
67
73
|
readonly zoomRate: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1.2, boolean>;
|
74
|
+
readonly scale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
68
75
|
readonly minScale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0.2, boolean>;
|
69
76
|
readonly maxScale: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
70
77
|
readonly showProgress: BooleanConstructor;
|
@@ -75,10 +82,12 @@ declare const __VLS_component: import("vue").DefineComponent<{
|
|
75
82
|
__epPropKey: true;
|
76
83
|
};
|
77
84
|
}>> & {
|
85
|
+
onError?: ((evt: Event) => any) | undefined;
|
78
86
|
onClose?: (() => any) | undefined;
|
79
87
|
onSwitch?: ((index: number) => any) | undefined;
|
80
88
|
onRotate?: ((deg: number) => any) | undefined;
|
81
89
|
}, {
|
90
|
+
readonly scale: number;
|
82
91
|
readonly infinite: import("@element-plus/nightly/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
83
92
|
readonly teleported: boolean;
|
84
93
|
readonly closeOnPressEscape: import("@element-plus/nightly/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
@@ -43,13 +43,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
43
43
|
const ns = index$1.useNamespace("image-viewer");
|
44
44
|
const { nextZIndex } = index$2.useZIndex();
|
45
45
|
const wrapper = vue.ref();
|
46
|
-
const
|
46
|
+
const imgRef = vue.ref();
|
47
47
|
const scopeEventListener = vue.effectScope();
|
48
|
+
const scaleClamped = vue.computed(() => {
|
49
|
+
const { scale, minScale, maxScale } = props;
|
50
|
+
return core.clamp(scale, minScale, maxScale);
|
51
|
+
});
|
48
52
|
const loading = vue.ref(true);
|
53
|
+
const loadError = vue.ref(false);
|
49
54
|
const activeIndex = vue.ref(props.initialIndex);
|
50
55
|
const mode = vue.shallowRef(modes.CONTAIN);
|
51
56
|
const transform = vue.ref({
|
52
|
-
scale:
|
57
|
+
scale: scaleClamped.value,
|
53
58
|
deg: 0,
|
54
59
|
offsetX: 0,
|
55
60
|
offsetY: 0,
|
@@ -140,7 +145,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
140
145
|
loading.value = false;
|
141
146
|
}
|
142
147
|
function handleImgError(e) {
|
148
|
+
loadError.value = true;
|
143
149
|
loading.value = false;
|
150
|
+
emit("error", e);
|
144
151
|
e.target.alt = t("el.image.error");
|
145
152
|
}
|
146
153
|
function handleMouseDown(e) {
|
@@ -165,7 +172,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
165
172
|
}
|
166
173
|
function reset() {
|
167
174
|
transform.value = {
|
168
|
-
scale:
|
175
|
+
scale: scaleClamped.value,
|
169
176
|
deg: 0,
|
170
177
|
offsetX: 0,
|
171
178
|
offsetY: 0,
|
@@ -173,7 +180,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
173
180
|
};
|
174
181
|
}
|
175
182
|
function toggleMode() {
|
176
|
-
if (loading.value)
|
183
|
+
if (loading.value || loadError.value)
|
177
184
|
return;
|
178
185
|
const modeNames = objects.keysOf(modes);
|
179
186
|
const modeValues = Object.values(modes);
|
@@ -184,6 +191,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
184
191
|
reset();
|
185
192
|
}
|
186
193
|
function setActiveItem(index) {
|
194
|
+
loadError.value = false;
|
187
195
|
const len = props.urlList.length;
|
188
196
|
activeIndex.value = (index + len) % len;
|
189
197
|
}
|
@@ -198,7 +206,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
198
206
|
setActiveItem(activeIndex.value + 1);
|
199
207
|
}
|
200
208
|
function handleActions(action, options = {}) {
|
201
|
-
if (loading.value)
|
209
|
+
if (loading.value || loadError.value)
|
202
210
|
return;
|
203
211
|
const { minScale, maxScale } = props;
|
204
212
|
const { zoomRate, rotateDeg, enableTransition } = {
|
@@ -251,9 +259,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
251
259
|
return false;
|
252
260
|
}
|
253
261
|
}
|
262
|
+
vue.watch(() => scaleClamped.value, (val) => {
|
263
|
+
transform.value.scale = val;
|
264
|
+
});
|
254
265
|
vue.watch(currentImg, () => {
|
255
266
|
vue.nextTick(() => {
|
256
|
-
const $img =
|
267
|
+
const $img = imgRef.value;
|
257
268
|
if (!($img == null ? void 0 : $img.complete)) {
|
258
269
|
loading.value = true;
|
259
270
|
}
|
@@ -419,22 +430,22 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
419
430
|
vue.createElementVNode("div", {
|
420
431
|
class: vue.normalizeClass(vue.unref(ns).e("canvas"))
|
421
432
|
}, [
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
}
|
433
|
+
loadError.value && _ctx.$slots["viewer-error"] ? vue.renderSlot(_ctx.$slots, "viewer-error", {
|
434
|
+
key: 0,
|
435
|
+
activeIndex: activeIndex.value,
|
436
|
+
src: vue.unref(currentImg)
|
437
|
+
}) : (vue.openBlock(), vue.createElementBlock("img", {
|
438
|
+
ref_key: "imgRef",
|
439
|
+
ref: imgRef,
|
440
|
+
key: vue.unref(currentImg),
|
441
|
+
src: vue.unref(currentImg),
|
442
|
+
style: vue.normalizeStyle(vue.unref(imgStyle)),
|
443
|
+
class: vue.normalizeClass(vue.unref(ns).e("img")),
|
444
|
+
crossorigin: _ctx.crossorigin,
|
445
|
+
onLoad: handleImgLoad,
|
446
|
+
onError: handleImgError,
|
447
|
+
onMousedown: handleMouseDown
|
448
|
+
}, null, 46, ["src", "crossorigin"]))
|
438
449
|
], 2),
|
439
450
|
vue.renderSlot(_ctx.$slots, "default")
|
440
451
|
]),
|