@element-plus/nightly 0.0.20240926 → 0.0.20240927
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 +23 -4
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +23 -4
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +119 -26
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +26 -119
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/autocomplete/index.mjs +2 -2
- package/es/components/autocomplete/src/autocomplete.mjs +81 -365
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete2.mjs +365 -81
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +1 -1
- package/es/components/calendar/src/date-table.mjs +33 -85
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +85 -33
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/calendar/src/use-date-table.mjs +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel.mjs +205 -62
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel2.mjs +62 -205
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +39 -15
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +15 -39
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/checkbox/index.mjs +2 -2
- package/es/components/checkbox/src/checkbox-group.mjs +73 -30
- package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox-group2.mjs +30 -73
- package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse-item.mjs +90 -19
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item2.mjs +19 -90
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/collection/index.mjs +1 -1
- package/es/components/collection/src/collection.mjs +10 -62
- package/es/components/collection/src/collection.mjs.map +1 -1
- package/es/components/collection/src/collection2.mjs +62 -10
- package/es/components/collection/src/collection2.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker.mjs +1 -1
- package/es/components/dialog/src/dialog-content.mjs +26 -89
- package/es/components/dialog/src/dialog-content.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content2.mjs +89 -26
- package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/dialog/src/dialog2.mjs +1 -1
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +2 -2
- package/es/components/index.mjs +24 -24
- package/es/components/input-number/index.mjs +2 -2
- package/es/components/input-number/src/input-number.mjs +345 -60
- package/es/components/input-number/src/input-number.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs +60 -345
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +4 -35
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +35 -4
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +64 -145
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +145 -64
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +17 -102
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +102 -17
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper.mjs +59 -9
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +9 -59
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.mjs +71 -25
- package/es/components/pagination/src/components/sizes.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes2.mjs +25 -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/popover/src/popover.mjs +1 -1
- package/es/components/popper/index.mjs +4 -4
- package/es/components/popper/src/content.mjs +93 -137
- package/es/components/popper/src/content.mjs.map +1 -1
- package/es/components/popper/src/content2.mjs +137 -93
- package/es/components/popper/src/content2.mjs.map +1 -1
- package/es/components/popper/src/popper.mjs +25 -32
- package/es/components/popper/src/popper.mjs.map +1 -1
- package/es/components/popper/src/popper2.mjs +32 -25
- package/es/components/popper/src/popper2.mjs.map +1 -1
- package/es/components/radio/index.mjs +4 -4
- package/es/components/radio/src/radio-button.mjs +66 -6
- package/es/components/radio/src/radio-button.mjs.map +1 -1
- package/es/components/radio/src/radio-button2.mjs +6 -66
- package/es/components/radio/src/radio-button2.mjs.map +1 -1
- package/es/components/radio/src/radio-group.mjs +1 -1
- package/es/components/radio/src/radio.mjs +34 -73
- package/es/components/radio/src/radio.mjs.map +1 -1
- package/es/components/radio/src/radio2.mjs +73 -34
- package/es/components/radio/src/radio2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
- package/es/components/scrollbar/index.mjs +1 -1
- package/es/components/scrollbar/src/bar.mjs +64 -11
- package/es/components/scrollbar/src/bar.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +11 -64
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
- package/es/components/scrollbar/src/thumb.mjs +11 -130
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +130 -11
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/steps.mjs +36 -39
- package/es/components/steps/src/steps.mjs.map +1 -1
- package/es/components/steps/src/steps2.mjs +39 -36
- package/es/components/steps/src/steps2.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +229 -72
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +72 -229
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/src/store/tree.mjs +11 -0
- package/es/components/table/src/store/tree.mjs.map +1 -1
- package/es/components/table/src/store/watcher.mjs +2 -0
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table/utils-helper.d.ts +1 -0
- package/es/components/table/src/table/utils-helper.mjs +5 -1
- package/es/components/table/src/table/utils-helper.mjs.map +1 -1
- package/es/components/table/src/table.mjs +3 -1
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +22 -4
- package/es/components/tabs/index.mjs +2 -2
- package/es/components/tabs/src/tab-pane.mjs +72 -13
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +13 -72
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/content.mjs +183 -29
- package/es/components/tooltip/src/content.mjs.map +1 -1
- package/es/components/tooltip/src/content2.mjs +29 -183
- package/es/components/tooltip/src/content2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +2 -2
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tour/index.mjs +3 -3
- package/es/components/tour/src/content.mjs +44 -68
- package/es/components/tour/src/content.mjs.map +1 -1
- package/es/components/tour/src/content2.mjs +68 -44
- package/es/components/tour/src/content2.mjs.map +1 -1
- package/es/components/tour/src/step.mjs +44 -169
- package/es/components/tour/src/step.mjs.map +1 -1
- package/es/components/tour/src/step2.mjs +169 -44
- package/es/components/tour/src/step2.mjs.map +1 -1
- package/es/components/tour/src/tour.mjs +1 -1
- package/es/components/tour/src/tour2.mjs +1 -1
- package/es/components/transfer/src/composables/use-check.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +19 -128
- package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel2.mjs +128 -19
- package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +1 -1
- package/es/components/upload/index.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +29 -175
- package/es/components/upload/src/upload-list.mjs.map +1 -1
- package/es/components/upload/src/upload-list2.mjs +175 -29
- package/es/components/upload/src/upload-list2.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +1 -1
- package/es/components/watermark/index.mjs +2 -2
- package/es/components/watermark/src/watermark.mjs +28 -209
- package/es/components/watermark/src/watermark.mjs.map +1 -1
- package/es/components/watermark/src/watermark2.mjs +209 -28
- package/es/components/watermark/src/watermark2.mjs.map +1 -1
- package/es/index.mjs +24 -24
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +119 -27
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +27 -119
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/autocomplete/index.js +2 -2
- package/lib/components/autocomplete/src/autocomplete.js +80 -363
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete2.js +363 -80
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +1 -1
- package/lib/components/calendar/src/date-table.js +37 -85
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +85 -37
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/calendar/src/use-date-table.js +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel.js +205 -63
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel2.js +63 -205
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +39 -16
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +16 -39
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/checkbox/index.js +2 -2
- package/lib/components/checkbox/src/checkbox-group.js +73 -31
- package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
- package/lib/components/checkbox/src/checkbox-group2.js +31 -73
- package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse-item.js +90 -19
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item2.js +19 -90
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/collection/index.js +1 -1
- package/lib/components/collection/src/collection.js +9 -62
- package/lib/components/collection/src/collection.js.map +1 -1
- package/lib/components/collection/src/collection2.js +62 -9
- package/lib/components/collection/src/collection2.js.map +1 -1
- package/lib/components/color-picker/src/color-picker.js +1 -1
- package/lib/components/dialog/src/dialog-content.js +26 -88
- package/lib/components/dialog/src/dialog-content.js.map +1 -1
- package/lib/components/dialog/src/dialog-content2.js +88 -26
- package/lib/components/dialog/src/dialog-content2.js.map +1 -1
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/dialog/src/dialog2.js +1 -1
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +2 -2
- package/lib/components/index.js +24 -24
- package/lib/components/input-number/index.js +2 -2
- package/lib/components/input-number/src/input-number.js +343 -59
- package/lib/components/input-number/src/input-number.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js +59 -343
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +4 -35
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +35 -4
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +65 -144
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +144 -65
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +18 -102
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +102 -18
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/pagination/src/components/jumper.js +59 -9
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/jumper2.js +9 -59
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.js +71 -25
- package/lib/components/pagination/src/components/sizes.js.map +1 -1
- package/lib/components/pagination/src/components/sizes2.js +25 -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/popover/src/popover.js +1 -1
- package/lib/components/popper/index.js +4 -4
- package/lib/components/popper/src/content.js +98 -137
- package/lib/components/popper/src/content.js.map +1 -1
- package/lib/components/popper/src/content2.js +137 -98
- package/lib/components/popper/src/content2.js.map +1 -1
- package/lib/components/popper/src/popper.js +28 -32
- package/lib/components/popper/src/popper.js.map +1 -1
- package/lib/components/popper/src/popper2.js +32 -28
- package/lib/components/popper/src/popper2.js.map +1 -1
- package/lib/components/radio/index.js +4 -4
- package/lib/components/radio/src/radio-button.js +66 -6
- package/lib/components/radio/src/radio-button.js.map +1 -1
- package/lib/components/radio/src/radio-button2.js +6 -66
- package/lib/components/radio/src/radio-button2.js.map +1 -1
- package/lib/components/radio/src/radio-group.js +1 -1
- package/lib/components/radio/src/radio.js +36 -73
- package/lib/components/radio/src/radio.js.map +1 -1
- package/lib/components/radio/src/radio2.js +73 -36
- package/lib/components/radio/src/radio2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
- package/lib/components/scrollbar/index.js +1 -1
- package/lib/components/scrollbar/src/bar.js +64 -11
- package/lib/components/scrollbar/src/bar.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +11 -64
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +1 -1
- package/lib/components/scrollbar/src/thumb.js +11 -130
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +130 -11
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/steps.js +37 -39
- package/lib/components/steps/src/steps.js.map +1 -1
- package/lib/components/steps/src/steps2.js +39 -37
- package/lib/components/steps/src/steps2.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +228 -72
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +72 -228
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/src/store/tree.js +11 -0
- package/lib/components/table/src/store/tree.js.map +1 -1
- package/lib/components/table/src/store/watcher.js +2 -0
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table/utils-helper.d.ts +1 -0
- package/lib/components/table/src/table/utils-helper.js +5 -1
- package/lib/components/table/src/table/utils-helper.js.map +1 -1
- package/lib/components/table/src/table.js +3 -1
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +22 -4
- package/lib/components/tabs/index.js +2 -2
- package/lib/components/tabs/src/tab-pane.js +72 -13
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +13 -72
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/content.js +183 -29
- package/lib/components/tooltip/src/content.js.map +1 -1
- package/lib/components/tooltip/src/content2.js +29 -183
- package/lib/components/tooltip/src/content2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +2 -2
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tour/index.js +3 -3
- package/lib/components/tour/src/content.js +47 -68
- package/lib/components/tour/src/content.js.map +1 -1
- package/lib/components/tour/src/content2.js +68 -47
- package/lib/components/tour/src/content2.js.map +1 -1
- package/lib/components/tour/src/step.js +44 -168
- package/lib/components/tour/src/step.js.map +1 -1
- package/lib/components/tour/src/step2.js +168 -44
- package/lib/components/tour/src/step2.js.map +1 -1
- package/lib/components/tour/src/tour.js +1 -1
- package/lib/components/tour/src/tour2.js +1 -1
- package/lib/components/transfer/src/composables/use-check.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +21 -128
- package/lib/components/transfer/src/transfer-panel.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel2.js +128 -21
- package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/upload/src/upload-list.js +30 -175
- package/lib/components/upload/src/upload-list.js.map +1 -1
- package/lib/components/upload/src/upload-list2.js +175 -30
- package/lib/components/upload/src/upload-list2.js.map +1 -1
- package/lib/components/upload/src/upload2.js +1 -1
- package/lib/components/watermark/index.js +2 -2
- package/lib/components/watermark/src/watermark.js +28 -209
- package/lib/components/watermark/src/watermark.js.map +1 -1
- package/lib/components/watermark/src/watermark2.js +209 -28
- package/lib/components/watermark/src/watermark2.js.map +1 -1
- package/lib/index.js +24 -24
- 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
|
@@ -2,38 +2,183 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index$2 = require('../../icon/index.js');
|
|
7
|
+
var iconsVue = require('@element-plus/icons-vue');
|
|
8
|
+
require('../../../hooks/index.js');
|
|
9
|
+
var index$3 = require('../../progress/index.js');
|
|
10
|
+
require('../../form/index.js');
|
|
11
|
+
var uploadList = require('./upload-list.js');
|
|
12
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
13
|
+
var index = require('../../../hooks/use-locale/index.js');
|
|
14
|
+
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
15
|
+
var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
|
|
10
16
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
const __default__ = vue.defineComponent({
|
|
18
|
+
name: "ElUploadList"
|
|
19
|
+
});
|
|
20
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
21
|
+
...__default__,
|
|
22
|
+
props: uploadList.uploadListProps,
|
|
23
|
+
emits: uploadList.uploadListEmits,
|
|
24
|
+
setup(__props, { emit }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const { t } = index.useLocale();
|
|
27
|
+
const nsUpload = index$1.useNamespace("upload");
|
|
28
|
+
const nsIcon = index$1.useNamespace("icon");
|
|
29
|
+
const nsList = index$1.useNamespace("list");
|
|
30
|
+
const disabled = useFormCommonProps.useFormDisabled();
|
|
31
|
+
const focusing = vue.ref(false);
|
|
32
|
+
const containerKls = vue.computed(() => [
|
|
33
|
+
nsUpload.b("list"),
|
|
34
|
+
nsUpload.bm("list", props.listType),
|
|
35
|
+
nsUpload.is("disabled", props.disabled)
|
|
36
|
+
]);
|
|
37
|
+
const handleRemove = (file) => {
|
|
38
|
+
emit("remove", file);
|
|
39
|
+
};
|
|
40
|
+
return (_ctx, _cache) => {
|
|
41
|
+
return vue.openBlock(), vue.createBlock(vue.TransitionGroup, {
|
|
42
|
+
tag: "ul",
|
|
43
|
+
class: vue.normalizeClass(vue.unref(containerKls)),
|
|
44
|
+
name: vue.unref(nsList).b()
|
|
45
|
+
}, {
|
|
46
|
+
default: vue.withCtx(() => [
|
|
47
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.files, (file, index) => {
|
|
48
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
49
|
+
key: file.uid || file.name,
|
|
50
|
+
class: vue.normalizeClass([
|
|
51
|
+
vue.unref(nsUpload).be("list", "item"),
|
|
52
|
+
vue.unref(nsUpload).is(file.status),
|
|
53
|
+
{ focusing: focusing.value }
|
|
54
|
+
]),
|
|
55
|
+
tabindex: "0",
|
|
56
|
+
onKeydown: vue.withKeys(($event) => !vue.unref(disabled) && handleRemove(file), ["delete"]),
|
|
57
|
+
onFocus: ($event) => focusing.value = true,
|
|
58
|
+
onBlur: ($event) => focusing.value = false,
|
|
59
|
+
onClick: ($event) => focusing.value = false
|
|
60
|
+
}, [
|
|
61
|
+
vue.renderSlot(_ctx.$slots, "default", {
|
|
62
|
+
file,
|
|
63
|
+
index
|
|
64
|
+
}, () => [
|
|
65
|
+
_ctx.listType === "picture" || file.status !== "uploading" && _ctx.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-thumbnail")),
|
|
68
|
+
src: file.url,
|
|
69
|
+
crossorigin: _ctx.crossorigin,
|
|
70
|
+
alt: ""
|
|
71
|
+
}, null, 10, ["src", "crossorigin"])) : vue.createCommentVNode("v-if", true),
|
|
72
|
+
file.status === "uploading" || _ctx.listType !== "picture-card" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
73
|
+
key: 1,
|
|
74
|
+
class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-info"))
|
|
75
|
+
}, [
|
|
76
|
+
vue.createElementVNode("a", {
|
|
77
|
+
class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-name")),
|
|
78
|
+
onClick: vue.withModifiers(($event) => _ctx.handlePreview(file), ["prevent"])
|
|
79
|
+
}, [
|
|
80
|
+
vue.createVNode(vue.unref(index$2.ElIcon), {
|
|
81
|
+
class: vue.normalizeClass(vue.unref(nsIcon).m("document"))
|
|
82
|
+
}, {
|
|
83
|
+
default: vue.withCtx(() => [
|
|
84
|
+
vue.createVNode(vue.unref(iconsVue.Document))
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 8, ["class"]),
|
|
88
|
+
vue.createElementVNode("span", {
|
|
89
|
+
class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-file-name")),
|
|
90
|
+
title: file.name
|
|
91
|
+
}, vue.toDisplayString(file.name), 11, ["title"])
|
|
92
|
+
], 10, ["onClick"]),
|
|
93
|
+
file.status === "uploading" ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.ElProgress), {
|
|
94
|
+
key: 0,
|
|
95
|
+
type: _ctx.listType === "picture-card" ? "circle" : "line",
|
|
96
|
+
"stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
|
|
97
|
+
percentage: Number(file.percentage),
|
|
98
|
+
style: vue.normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
99
|
+
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : vue.createCommentVNode("v-if", true)
|
|
100
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
101
|
+
vue.createElementVNode("label", {
|
|
102
|
+
class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-status-label"))
|
|
103
|
+
}, [
|
|
104
|
+
_ctx.listType === "text" ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ElIcon), {
|
|
105
|
+
key: 0,
|
|
106
|
+
class: vue.normalizeClass([vue.unref(nsIcon).m("upload-success"), vue.unref(nsIcon).m("circle-check")])
|
|
107
|
+
}, {
|
|
108
|
+
default: vue.withCtx(() => [
|
|
109
|
+
vue.createVNode(vue.unref(iconsVue.CircleCheck))
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
}, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ElIcon), {
|
|
113
|
+
key: 1,
|
|
114
|
+
class: vue.normalizeClass([vue.unref(nsIcon).m("upload-success"), vue.unref(nsIcon).m("check")])
|
|
115
|
+
}, {
|
|
116
|
+
default: vue.withCtx(() => [
|
|
117
|
+
vue.createVNode(vue.unref(iconsVue.Check))
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true)
|
|
121
|
+
], 2),
|
|
122
|
+
!vue.unref(disabled) ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.ElIcon), {
|
|
123
|
+
key: 2,
|
|
124
|
+
class: vue.normalizeClass(vue.unref(nsIcon).m("close")),
|
|
125
|
+
onClick: ($event) => handleRemove(file)
|
|
126
|
+
}, {
|
|
127
|
+
default: vue.withCtx(() => [
|
|
128
|
+
vue.createVNode(vue.unref(iconsVue.Close))
|
|
129
|
+
]),
|
|
130
|
+
_: 2
|
|
131
|
+
}, 1032, ["class", "onClick"])) : vue.createCommentVNode("v-if", true),
|
|
132
|
+
vue.createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
|
|
133
|
+
vue.createCommentVNode(" This is a bug which needs to be fixed "),
|
|
134
|
+
vue.createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
|
|
135
|
+
!vue.unref(disabled) ? (vue.openBlock(), vue.createElementBlock("i", {
|
|
136
|
+
key: 3,
|
|
137
|
+
class: vue.normalizeClass(vue.unref(nsIcon).m("close-tip"))
|
|
138
|
+
}, vue.toDisplayString(vue.unref(t)("el.upload.deleteTip")), 3)) : vue.createCommentVNode("v-if", true),
|
|
139
|
+
_ctx.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
140
|
+
key: 4,
|
|
141
|
+
class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-actions"))
|
|
142
|
+
}, [
|
|
143
|
+
vue.createElementVNode("span", {
|
|
144
|
+
class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-preview")),
|
|
145
|
+
onClick: ($event) => _ctx.handlePreview(file)
|
|
146
|
+
}, [
|
|
147
|
+
vue.createVNode(vue.unref(index$2.ElIcon), {
|
|
148
|
+
class: vue.normalizeClass(vue.unref(nsIcon).m("zoom-in"))
|
|
149
|
+
}, {
|
|
150
|
+
default: vue.withCtx(() => [
|
|
151
|
+
vue.createVNode(vue.unref(iconsVue.ZoomIn))
|
|
152
|
+
]),
|
|
153
|
+
_: 1
|
|
154
|
+
}, 8, ["class"])
|
|
155
|
+
], 10, ["onClick"]),
|
|
156
|
+
!vue.unref(disabled) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
157
|
+
key: 0,
|
|
158
|
+
class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-delete")),
|
|
159
|
+
onClick: ($event) => handleRemove(file)
|
|
160
|
+
}, [
|
|
161
|
+
vue.createVNode(vue.unref(index$2.ElIcon), {
|
|
162
|
+
class: vue.normalizeClass(vue.unref(nsIcon).m("delete"))
|
|
163
|
+
}, {
|
|
164
|
+
default: vue.withCtx(() => [
|
|
165
|
+
vue.createVNode(vue.unref(iconsVue.Delete))
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}, 8, ["class"])
|
|
169
|
+
], 10, ["onClick"])) : vue.createCommentVNode("v-if", true)
|
|
170
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
171
|
+
])
|
|
172
|
+
], 42, ["onKeydown", "onFocus", "onBlur", "onClick"]);
|
|
173
|
+
}), 128)),
|
|
174
|
+
vue.renderSlot(_ctx.$slots, "append")
|
|
175
|
+
]),
|
|
176
|
+
_: 3
|
|
177
|
+
}, 8, ["class", "name"]);
|
|
178
|
+
};
|
|
31
179
|
}
|
|
32
180
|
});
|
|
33
|
-
|
|
34
|
-
remove: (file) => !!file
|
|
35
|
-
};
|
|
181
|
+
var UploadList = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "upload-list.vue"]]);
|
|
36
182
|
|
|
37
|
-
exports
|
|
38
|
-
exports.uploadListProps = uploadListProps;
|
|
183
|
+
exports["default"] = UploadList;
|
|
39
184
|
//# sourceMappingURL=upload-list2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-list2.js","sources":["../../../../../../packages/components/upload/src/upload-list.
|
|
1
|
+
{"version":3,"file":"upload-list2.js","sources":["../../../../../../packages/components/upload/src/upload-list.vue"],"sourcesContent":["<template>\n <transition-group tag=\"ul\" :class=\"containerKls\" :name=\"nsList.b()\">\n <li\n v-for=\"(file, index) in files\"\n :key=\"file.uid || file.name\"\n :class=\"[\n nsUpload.be('list', 'item'),\n nsUpload.is(file.status),\n { focusing },\n ]\"\n tabindex=\"0\"\n @keydown.delete=\"!disabled && handleRemove(file)\"\n @focus=\"focusing = true\"\n @blur=\"focusing = false\"\n @click=\"focusing = false\"\n >\n <slot :file=\"file\" :index=\"index\">\n <img\n v-if=\"\n listType === 'picture' ||\n (file.status !== 'uploading' && listType === 'picture-card')\n \"\n :class=\"nsUpload.be('list', 'item-thumbnail')\"\n :src=\"file.url\"\n :crossorigin=\"crossorigin\"\n alt=\"\"\n />\n <div\n v-if=\"file.status === 'uploading' || listType !== 'picture-card'\"\n :class=\"nsUpload.be('list', 'item-info')\"\n >\n <a\n :class=\"nsUpload.be('list', 'item-name')\"\n @click.prevent=\"handlePreview(file)\"\n >\n <el-icon :class=\"nsIcon.m('document')\">\n <Document />\n </el-icon>\n <span\n :class=\"nsUpload.be('list', 'item-file-name')\"\n :title=\"file.name\"\n >\n {{ file.name }}\n </span>\n </a>\n <el-progress\n v-if=\"file.status === 'uploading'\"\n :type=\"listType === 'picture-card' ? 'circle' : 'line'\"\n :stroke-width=\"listType === 'picture-card' ? 6 : 2\"\n :percentage=\"Number(file.percentage)\"\n :style=\"listType === 'picture-card' ? '' : 'margin-top: 0.5rem'\"\n />\n </div>\n\n <label :class=\"nsUpload.be('list', 'item-status-label')\">\n <el-icon\n v-if=\"listType === 'text'\"\n :class=\"[nsIcon.m('upload-success'), nsIcon.m('circle-check')]\"\n >\n <circle-check />\n </el-icon>\n <el-icon\n v-else-if=\"['picture-card', 'picture'].includes(listType)\"\n :class=\"[nsIcon.m('upload-success'), nsIcon.m('check')]\"\n >\n <Check />\n </el-icon>\n </label>\n <el-icon\n v-if=\"!disabled\"\n :class=\"nsIcon.m('close')\"\n @click=\"handleRemove(file)\"\n >\n <Close />\n </el-icon>\n <!-- Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn-->\n <!-- This is a bug which needs to be fixed -->\n <!-- TODO: Fix the incorrect navigation interaction -->\n <i v-if=\"!disabled\" :class=\"nsIcon.m('close-tip')\">{{\n t('el.upload.deleteTip')\n }}</i>\n <span\n v-if=\"listType === 'picture-card'\"\n :class=\"nsUpload.be('list', 'item-actions')\"\n >\n <span\n :class=\"nsUpload.be('list', 'item-preview')\"\n @click=\"handlePreview(file)\"\n >\n <el-icon :class=\"nsIcon.m('zoom-in')\"><zoom-in /></el-icon>\n </span>\n <span\n v-if=\"!disabled\"\n :class=\"nsUpload.be('list', 'item-delete')\"\n @click=\"handleRemove(file)\"\n >\n <el-icon :class=\"nsIcon.m('delete')\">\n <Delete />\n </el-icon>\n </span>\n </span>\n </slot>\n </li>\n <slot name=\"append\" />\n </transition-group>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n Check,\n CircleCheck,\n Close,\n Delete,\n Document,\n ZoomIn,\n} from '@element-plus/icons-vue'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElProgress from '@element-plus/components/progress'\nimport { useFormDisabled } from '@element-plus/components/form'\n\nimport { uploadListEmits, uploadListProps } from './upload-list'\nimport type { UploadFile } from './upload'\n\ndefineOptions({\n name: 'ElUploadList',\n})\n\nconst props = defineProps(uploadListProps)\nconst emit = defineEmits(uploadListEmits)\n\nconst { t } = useLocale()\nconst nsUpload = useNamespace('upload')\nconst nsIcon = useNamespace('icon')\nconst nsList = useNamespace('list')\nconst disabled = useFormDisabled()\n\nconst focusing = ref(false)\n\nconst containerKls = computed(() => [\n nsUpload.b('list'),\n nsUpload.bm('list', props.listType),\n nsUpload.is('disabled', props.disabled),\n])\n\nconst handleRemove = (file: UploadFile) => {\n emit('remove', file)\n}\n</script>\n"],"names":["useLocale","useNamespace","useFormDisabled","ref","computed"],"mappings":";;;;;;;;;;;;;;;;uCA4Hc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,MAAMA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,QAAA,GAAWC,qBAAa,QAAQ,CAAA,CAAA;AACtC,IAAM,MAAA,MAAA,GAASA,qBAAa,MAAM,CAAA,CAAA;AAClC,IAAM,MAAA,MAAA,GAASA,qBAAa,MAAM,CAAA,CAAA;AAClC,IAAA,MAAM,WAAWC,kCAAgB,EAAA,CAAA;AAEjC,IAAM,MAAA,QAAA,GAAWC,QAAI,KAAK,CAAA,CAAA;AAE1B,IAAM,MAAA,YAAA,GAAeC,aAAS,MAAM;AAAA,MAClC,QAAA,CAAS,EAAE,MAAM,CAAA;AAAA,MACjB,QAAS,CAAA,EAAA,CAAG,MAAQ,EAAA,KAAA,CAAM,QAAQ,CAAA;AAAA,MAClC,QAAS,CAAA,EAAA,CAAG,UAAY,EAAA,KAAA,CAAM,QAAQ,CAAA;AAAA,KACvC,CAAA,CAAA;AAED,IAAM,MAAA,YAAA,GAAe,CAAC,IAAqB,KAAA;AACzC,MAAA,IAAA,CAAK,UAAU,IAAI,CAAA,CAAA;AAAA,KACrB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
require('../../form/index.js');
|
|
7
7
|
var constants = require('./constants.js');
|
|
8
|
-
var uploadList = require('./upload-
|
|
8
|
+
var uploadList = require('./upload-list2.js');
|
|
9
9
|
var uploadContent = require('./upload-content2.js');
|
|
10
10
|
var useHandlers = require('./use-handlers.js');
|
|
11
11
|
var upload = require('./upload.js');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var watermark$1 = require('./src/
|
|
7
|
-
var watermark = require('./src/
|
|
6
|
+
var watermark$1 = require('./src/watermark2.js');
|
|
7
|
+
var watermark = require('./src/watermark.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElWatermark = install.withInstall(watermark$1["default"]);
|
|
@@ -2,217 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
var watermark = require('./watermark2.js');
|
|
8
|
-
var utils = require('./utils.js');
|
|
9
|
-
var useClips = require('./useClips.js');
|
|
10
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
5
|
+
require('../../../utils/index.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
11
7
|
|
|
12
|
-
const
|
|
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
|
-
return (_b = (_a = props.font) == null ? void 0 : _a.fontStyle) != null ? _b : "normal";
|
|
38
|
-
});
|
|
39
|
-
const fontFamily = vue.computed(() => {
|
|
40
|
-
var _a, _b;
|
|
41
|
-
return (_b = (_a = props.font) == null ? void 0 : _a.fontFamily) != null ? _b : "sans-serif";
|
|
42
|
-
});
|
|
43
|
-
const textAlign = vue.computed(() => {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
return (_b = (_a = props.font) == null ? void 0 : _a.textAlign) != null ? _b : "center";
|
|
46
|
-
});
|
|
47
|
-
const textBaseline = vue.computed(() => {
|
|
48
|
-
var _a, _b;
|
|
49
|
-
return (_b = (_a = props.font) == null ? void 0 : _a.textBaseline) != null ? _b : "hanging";
|
|
50
|
-
});
|
|
51
|
-
const gapX = vue.computed(() => props.gap[0]);
|
|
52
|
-
const gapY = vue.computed(() => props.gap[1]);
|
|
53
|
-
const gapXCenter = vue.computed(() => gapX.value / 2);
|
|
54
|
-
const gapYCenter = vue.computed(() => gapY.value / 2);
|
|
55
|
-
const offsetLeft = vue.computed(() => {
|
|
56
|
-
var _a, _b;
|
|
57
|
-
return (_b = (_a = props.offset) == null ? void 0 : _a[0]) != null ? _b : gapXCenter.value;
|
|
58
|
-
});
|
|
59
|
-
const offsetTop = vue.computed(() => {
|
|
60
|
-
var _a, _b;
|
|
61
|
-
return (_b = (_a = props.offset) == null ? void 0 : _a[1]) != null ? _b : gapYCenter.value;
|
|
62
|
-
});
|
|
63
|
-
const getMarkStyle = () => {
|
|
64
|
-
const markStyle = {
|
|
65
|
-
zIndex: props.zIndex,
|
|
66
|
-
position: "absolute",
|
|
67
|
-
left: 0,
|
|
68
|
-
top: 0,
|
|
69
|
-
width: "100%",
|
|
70
|
-
height: "100%",
|
|
71
|
-
pointerEvents: "none",
|
|
72
|
-
backgroundRepeat: "repeat"
|
|
73
|
-
};
|
|
74
|
-
let positionLeft = offsetLeft.value - gapXCenter.value;
|
|
75
|
-
let positionTop = offsetTop.value - gapYCenter.value;
|
|
76
|
-
if (positionLeft > 0) {
|
|
77
|
-
markStyle.left = `${positionLeft}px`;
|
|
78
|
-
markStyle.width = `calc(100% - ${positionLeft}px)`;
|
|
79
|
-
positionLeft = 0;
|
|
80
|
-
}
|
|
81
|
-
if (positionTop > 0) {
|
|
82
|
-
markStyle.top = `${positionTop}px`;
|
|
83
|
-
markStyle.height = `calc(100% - ${positionTop}px)`;
|
|
84
|
-
positionTop = 0;
|
|
85
|
-
}
|
|
86
|
-
markStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;
|
|
87
|
-
return markStyle;
|
|
88
|
-
};
|
|
89
|
-
const containerRef = vue.shallowRef(null);
|
|
90
|
-
const watermarkRef = vue.shallowRef();
|
|
91
|
-
const stopObservation = vue.ref(false);
|
|
92
|
-
const destroyWatermark = () => {
|
|
93
|
-
if (watermarkRef.value) {
|
|
94
|
-
watermarkRef.value.remove();
|
|
95
|
-
watermarkRef.value = void 0;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const appendWatermark = (base64Url, markWidth) => {
|
|
99
|
-
var _a;
|
|
100
|
-
if (containerRef.value && watermarkRef.value) {
|
|
101
|
-
stopObservation.value = true;
|
|
102
|
-
watermarkRef.value.setAttribute("style", utils.getStyleStr({
|
|
103
|
-
...getMarkStyle(),
|
|
104
|
-
backgroundImage: `url('${base64Url}')`,
|
|
105
|
-
backgroundSize: `${Math.floor(markWidth)}px`
|
|
106
|
-
}));
|
|
107
|
-
(_a = containerRef.value) == null ? void 0 : _a.append(watermarkRef.value);
|
|
108
|
-
setTimeout(() => {
|
|
109
|
-
stopObservation.value = false;
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const getMarkSize = (ctx) => {
|
|
114
|
-
let defaultWidth = 120;
|
|
115
|
-
let defaultHeight = 64;
|
|
116
|
-
const image = props.image;
|
|
117
|
-
const content = props.content;
|
|
118
|
-
const width = props.width;
|
|
119
|
-
const height = props.height;
|
|
120
|
-
if (!image && ctx.measureText) {
|
|
121
|
-
ctx.font = `${Number(fontSize.value)}px ${fontFamily.value}`;
|
|
122
|
-
const contents = Array.isArray(content) ? content : [content];
|
|
123
|
-
const sizes = contents.map((item) => {
|
|
124
|
-
const metrics = ctx.measureText(item);
|
|
125
|
-
return [
|
|
126
|
-
metrics.width,
|
|
127
|
-
metrics.fontBoundingBoxAscent !== void 0 ? metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent : metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent
|
|
128
|
-
];
|
|
129
|
-
});
|
|
130
|
-
defaultWidth = Math.ceil(Math.max(...sizes.map((size) => size[0])));
|
|
131
|
-
defaultHeight = Math.ceil(Math.max(...sizes.map((size) => size[1]))) * contents.length + (contents.length - 1) * useClips.FontGap;
|
|
132
|
-
}
|
|
133
|
-
return [width != null ? width : defaultWidth, height != null ? height : defaultHeight];
|
|
134
|
-
};
|
|
135
|
-
const getClips = useClips["default"]();
|
|
136
|
-
const renderWatermark = () => {
|
|
137
|
-
const canvas = document.createElement("canvas");
|
|
138
|
-
const ctx = canvas.getContext("2d");
|
|
139
|
-
const image = props.image;
|
|
140
|
-
const content = props.content;
|
|
141
|
-
const rotate = props.rotate;
|
|
142
|
-
if (ctx) {
|
|
143
|
-
if (!watermarkRef.value) {
|
|
144
|
-
watermarkRef.value = document.createElement("div");
|
|
145
|
-
}
|
|
146
|
-
const ratio = utils.getPixelRatio();
|
|
147
|
-
const [markWidth, markHeight] = getMarkSize(ctx);
|
|
148
|
-
const drawCanvas = (drawContent) => {
|
|
149
|
-
const [textClips, clipWidth] = getClips(drawContent || "", rotate, ratio, markWidth, markHeight, {
|
|
150
|
-
color: color.value,
|
|
151
|
-
fontSize: fontSize.value,
|
|
152
|
-
fontStyle: fontStyle.value,
|
|
153
|
-
fontWeight: fontWeight.value,
|
|
154
|
-
fontFamily: fontFamily.value,
|
|
155
|
-
textAlign: textAlign.value,
|
|
156
|
-
textBaseline: textBaseline.value
|
|
157
|
-
}, gapX.value, gapY.value);
|
|
158
|
-
appendWatermark(textClips, clipWidth);
|
|
159
|
-
};
|
|
160
|
-
if (image) {
|
|
161
|
-
const img = new Image();
|
|
162
|
-
img.onload = () => {
|
|
163
|
-
drawCanvas(img);
|
|
164
|
-
};
|
|
165
|
-
img.onerror = () => {
|
|
166
|
-
drawCanvas(content);
|
|
167
|
-
};
|
|
168
|
-
img.crossOrigin = "anonymous";
|
|
169
|
-
img.referrerPolicy = "no-referrer";
|
|
170
|
-
img.src = image;
|
|
171
|
-
} else {
|
|
172
|
-
drawCanvas(content);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
vue.onMounted(() => {
|
|
177
|
-
renderWatermark();
|
|
178
|
-
});
|
|
179
|
-
vue.watch(() => props, () => {
|
|
180
|
-
renderWatermark();
|
|
181
|
-
}, {
|
|
182
|
-
deep: true,
|
|
183
|
-
flush: "post"
|
|
184
|
-
});
|
|
185
|
-
vue.onBeforeUnmount(() => {
|
|
186
|
-
destroyWatermark();
|
|
187
|
-
});
|
|
188
|
-
const onMutate = (mutations) => {
|
|
189
|
-
if (stopObservation.value) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
mutations.forEach((mutation) => {
|
|
193
|
-
if (utils.reRendering(mutation, watermarkRef.value)) {
|
|
194
|
-
destroyWatermark();
|
|
195
|
-
renderWatermark();
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
core.useMutationObserver(containerRef, onMutate, {
|
|
200
|
-
attributes: true,
|
|
201
|
-
subtree: true,
|
|
202
|
-
childList: true
|
|
203
|
-
});
|
|
204
|
-
return (_ctx, _cache) => {
|
|
205
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
206
|
-
ref_key: "containerRef",
|
|
207
|
-
ref: containerRef,
|
|
208
|
-
style: vue.normalizeStyle([style])
|
|
209
|
-
}, [
|
|
210
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
211
|
-
], 4);
|
|
212
|
-
};
|
|
8
|
+
const watermarkProps = runtime.buildProps({
|
|
9
|
+
zIndex: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 9
|
|
12
|
+
},
|
|
13
|
+
rotate: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: -22
|
|
16
|
+
},
|
|
17
|
+
width: Number,
|
|
18
|
+
height: Number,
|
|
19
|
+
image: String,
|
|
20
|
+
content: {
|
|
21
|
+
type: runtime.definePropType([String, Array]),
|
|
22
|
+
default: "Element Plus"
|
|
23
|
+
},
|
|
24
|
+
font: {
|
|
25
|
+
type: runtime.definePropType(Object)
|
|
26
|
+
},
|
|
27
|
+
gap: {
|
|
28
|
+
type: runtime.definePropType(Array),
|
|
29
|
+
default: () => [100, 100]
|
|
30
|
+
},
|
|
31
|
+
offset: {
|
|
32
|
+
type: runtime.definePropType(Array)
|
|
213
33
|
}
|
|
214
34
|
});
|
|
215
|
-
var Watermark = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "watermark.vue"]]);
|
|
216
35
|
|
|
217
|
-
exports
|
|
36
|
+
exports.watermarkProps = watermarkProps;
|
|
218
37
|
//# sourceMappingURL=watermark.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watermark.js","sources":["../../../../../../packages/components/watermark/src/watermark.vue"],"sourcesContent":["<template>\n <div ref=\"containerRef\" :style=\"[style]\">\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n watch,\n} from 'vue'\nimport { useMutationObserver } from '@vueuse/core'\nimport { watermarkProps } from './watermark'\nimport { getPixelRatio, getStyleStr, reRendering } from './utils'\nimport useClips, { FontGap } from './useClips'\nimport type { WatermarkProps } from './watermark'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElWatermark',\n})\n\nconst style: CSSProperties = {\n position: 'relative',\n}\n\nconst props = defineProps(watermarkProps)\nconst color = computed(() => props.font?.color ?? 'rgba(0,0,0,.15)')\nconst fontSize = computed(() => props.font?.fontSize ?? 16)\nconst fontWeight = computed(() => props.font?.fontWeight ?? 'normal')\nconst fontStyle = computed(() => props.font?.fontStyle ?? 'normal')\nconst fontFamily = computed(() => props.font?.fontFamily ?? 'sans-serif')\nconst textAlign = computed(() => props.font?.textAlign ?? 'center')\nconst textBaseline = computed(() => props.font?.textBaseline ?? 'hanging')\n\nconst gapX = computed(() => props.gap[0])\nconst gapY = computed(() => props.gap[1])\nconst gapXCenter = computed(() => gapX.value / 2)\nconst gapYCenter = computed(() => gapY.value / 2)\nconst offsetLeft = computed(() => props.offset?.[0] ?? gapXCenter.value)\nconst offsetTop = computed(() => props.offset?.[1] ?? gapYCenter.value)\n\nconst getMarkStyle = () => {\n const markStyle: CSSProperties = {\n zIndex: props.zIndex,\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n backgroundRepeat: 'repeat',\n }\n\n /** Calculate the style of the offset */\n let positionLeft = offsetLeft.value - gapXCenter.value\n let positionTop = offsetTop.value - gapYCenter.value\n if (positionLeft > 0) {\n markStyle.left = `${positionLeft}px`\n markStyle.width = `calc(100% - ${positionLeft}px)`\n positionLeft = 0\n }\n if (positionTop > 0) {\n markStyle.top = `${positionTop}px`\n markStyle.height = `calc(100% - ${positionTop}px)`\n positionTop = 0\n }\n markStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`\n\n return markStyle\n}\n\nconst containerRef = shallowRef<HTMLDivElement | null>(null)\nconst watermarkRef = shallowRef<HTMLDivElement>()\nconst stopObservation = ref(false)\n\nconst destroyWatermark = () => {\n if (watermarkRef.value) {\n watermarkRef.value.remove()\n watermarkRef.value = undefined\n }\n}\nconst appendWatermark = (base64Url: string, markWidth: number) => {\n if (containerRef.value && watermarkRef.value) {\n stopObservation.value = true\n watermarkRef.value.setAttribute(\n 'style',\n getStyleStr({\n ...getMarkStyle(),\n backgroundImage: `url('${base64Url}')`,\n backgroundSize: `${Math.floor(markWidth)}px`,\n })\n )\n containerRef.value?.append(watermarkRef.value)\n // Delayed execution\n setTimeout(() => {\n stopObservation.value = false\n })\n }\n}\n\n/**\n * Get the width and height of the watermark. The default values are as follows\n * Image: [120, 64]; Content: It's calculated by content;\n */\nconst getMarkSize = (ctx: CanvasRenderingContext2D) => {\n let defaultWidth = 120\n let defaultHeight = 64\n const image = props.image\n const content = props.content\n const width = props.width\n const height = props.height\n if (!image && ctx.measureText) {\n ctx.font = `${Number(fontSize.value)}px ${fontFamily.value}`\n const contents = Array.isArray(content) ? content : [content]\n const sizes = contents.map((item) => {\n const metrics = ctx.measureText(item!)\n\n return [\n metrics.width,\n // Using `actualBoundingBoxAscent` to be compatible with lower version browsers (eg: Firefox < 116)\n metrics.fontBoundingBoxAscent !== undefined\n ? metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent\n : metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n ]\n })\n defaultWidth = Math.ceil(Math.max(...sizes.map((size) => size[0])))\n defaultHeight =\n Math.ceil(Math.max(...sizes.map((size) => size[1]))) * contents.length +\n (contents.length - 1) * FontGap\n }\n return [width ?? defaultWidth, height ?? defaultHeight] as const\n}\n\nconst getClips = useClips()\n\nconst renderWatermark = () => {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const image = props.image\n const content = props.content\n const rotate = props.rotate\n\n if (ctx) {\n if (!watermarkRef.value) {\n watermarkRef.value = document.createElement('div')\n }\n\n const ratio = getPixelRatio()\n const [markWidth, markHeight] = getMarkSize(ctx)\n\n const drawCanvas = (\n drawContent?: NonNullable<WatermarkProps['content']> | HTMLImageElement\n ) => {\n const [textClips, clipWidth] = getClips(\n drawContent || '',\n rotate,\n ratio,\n markWidth,\n markHeight,\n {\n color: color.value,\n fontSize: fontSize.value,\n fontStyle: fontStyle.value,\n fontWeight: fontWeight.value,\n fontFamily: fontFamily.value,\n textAlign: textAlign.value,\n textBaseline: textBaseline.value,\n },\n gapX.value,\n gapY.value\n )\n\n appendWatermark(textClips, clipWidth)\n }\n\n if (image) {\n const img = new Image()\n img.onload = () => {\n drawCanvas(img)\n }\n img.onerror = () => {\n drawCanvas(content)\n }\n img.crossOrigin = 'anonymous'\n img.referrerPolicy = 'no-referrer'\n img.src = image\n } else {\n drawCanvas(content)\n }\n }\n}\n\nonMounted(() => {\n renderWatermark()\n})\n\nwatch(\n () => props,\n () => {\n renderWatermark()\n },\n {\n deep: true,\n flush: 'post',\n }\n)\n\nonBeforeUnmount(() => {\n destroyWatermark()\n})\n\nconst onMutate = (mutations: MutationRecord[]) => {\n if (stopObservation.value) {\n return\n }\n mutations.forEach((mutation) => {\n if (reRendering(mutation, watermarkRef.value)) {\n destroyWatermark()\n renderWatermark()\n }\n })\n}\n\nuseMutationObserver(containerRef, onMutate, {\n attributes: true,\n subtree: true,\n childList: true,\n})\n</script>\n"],"names":["computed","shallowRef","ref","getStyleStr","FontGap","useClips","getPixelRatio"],"mappings":";;;;;;;;;;;uCAsBc,CAAA;AAAA,EACZ,IAAM,EAAA,aAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAEA,IAAA,MAAM,KAAuB,GAAA;AAAA,MAC3B,QAAU,EAAA,UAAA;AAAA,KACZ,CAAA;AAGA,IAAA,MAAM,QAAQA,YAAS,CAAA,MAAM;AAC7B,MAAA,IAAM;AACN,MAAA,mBAA4B,KAAA,CAAA,IAAA,KAAY,IAAA,GAAA,iBAAoB,KAAQ,IAAA,GAAA,EAAA,GAAA,iBAAA,CAAA;AACpE,KAAA,CAAA,CAAA;AACA,IAAA,MAAM,uBAAsB,CAAA,MAAA;AAC5B,MAAA,IAAM;AACN,MAAA,mBAAqB,KAAS,CAAA,IAAA,KAAM,IAAM,GAAA,KAAM,oBAAyB,IAAA,GAAA,EAAA,GAAA,EAAA,CAAA;AAEzE,KAAA,CAAA,CAAA;AACA,IAAA,MAAM,UAAO,GAAAA,YAAe,CAAA,MAAM;AAClC,MAAA,IAAM,EAAa,EAAA,EAAA,CAAA;AACnB,MAAA,OAAmB,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAA,IAAe,KAAA,YAAc,CAAA,GAAA,EAAA,CAAA,UAAA,KAAA,IAAA,GAAA,EAAA,GAAA,QAAA,CAAA;AAChD,KAAA,CAAA,CAAA;AACA,IAAA,MAAM,YAAYA,YAAS,CAAA,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MAAA;AAA4C,UAC9B,UAAA,CAAA,OAAA,CAAA,CAAA;AAAA,SACH;AAAA,OACE;AAAA,KACZ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"watermark.js","sources":["../../../../../../packages/components/watermark/src/watermark.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Watermark from './watermark.vue'\n\nexport interface WatermarkFontType {\n color?: string\n fontSize?: number | string\n fontWeight?: 'normal' | 'light' | 'weight' | number\n fontStyle?: 'none' | 'normal' | 'italic' | 'oblique'\n fontFamily?: string\n textAlign?: 'start' | 'end' | 'left' | 'right' | 'center'\n textBaseline?:\n | 'top'\n | 'hanging'\n | 'middle'\n | 'alphabetic'\n | 'ideographic'\n | 'bottom'\n}\n\nexport const watermarkProps = buildProps({\n /**\n * @description The z-index of the appended watermark element\n */\n zIndex: {\n type: Number,\n default: 9,\n },\n /**\n * @description The rotation angle of the watermark\n */\n rotate: {\n type: Number,\n default: -22,\n },\n /**\n * @description The width of the watermark\n */\n width: Number,\n /**\n * @description The height of the watermark\n */\n height: Number,\n /**\n * @description Image source, it is recommended to export 2x or 3x image, high priority (support base64 format)\n */\n image: String,\n /**\n * @description Watermark text content\n */\n content: {\n type: definePropType<string | string[]>([String, Array]),\n default: 'Element Plus',\n },\n /**\n * @description Text style\n */\n font: {\n type: definePropType<WatermarkFontType>(Object),\n },\n /**\n * @description The spacing between watermarks\n */\n gap: {\n type: definePropType<[number, number]>(Array),\n default: () => [100, 100],\n },\n /**\n * @description The offset of the watermark from the upper left corner of the container. The default is gap/2\n */\n offset: {\n type: definePropType<[number, number]>(Array),\n },\n} as const)\n\nexport type WatermarkProps = ExtractPropTypes<typeof watermarkProps>\nexport type WatermarkInstance = InstanceType<typeof Watermark>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,cAAc,GAAGA,kBAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC,EAAE;AAChB,GAAG;AACH,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,cAAc;AAC3B,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEA,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;AAC7B,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,CAAC;;;;"}
|