@element-plus/nightly 0.0.20250102 → 0.0.20250105
Sign up to get free protection for your applications and to get access to all the features.
- package/attributes.json +1 -1
- package/dist/index.full.js +37 -23
- 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 +37 -23
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/anchor/index.mjs +1 -1
- package/es/components/anchor/src/anchor-link.mjs +81 -5
- package/es/components/anchor/src/anchor-link.mjs.map +1 -1
- package/es/components/anchor/src/anchor-link2.mjs +5 -81
- package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
- package/es/components/autocomplete/index.mjs +2 -2
- package/es/components/autocomplete/src/autocomplete.mjs +364 -79
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete2.mjs +79 -364
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +4 -4
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +8 -56
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +56 -8
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb.mjs +10 -37
- package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb2.mjs +37 -10
- package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
- package/es/components/button/index.mjs +1 -1
- package/es/components/button/src/button-group.mjs +6 -29
- package/es/components/button/src/button-group.mjs.map +1 -1
- package/es/components/button/src/button-group2.mjs +29 -6
- package/es/components/button/src/button-group2.mjs.map +1 -1
- package/es/components/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +16 -134
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +134 -16
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/card/index.mjs +2 -2
- package/es/components/card/src/card.mjs +42 -20
- package/es/components/card/src/card.mjs.map +1 -1
- package/es/components/card/src/card2.mjs +20 -42
- package/es/components/card/src/card2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +7 -69
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +69 -7
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs +1 -1
- package/es/components/cascader-panel/src/menu.mjs +1 -1
- package/es/components/cascader-panel/src/node.mjs +115 -206
- package/es/components/cascader-panel/src/node.mjs.map +1 -1
- package/es/components/cascader-panel/src/node2.mjs +206 -115
- package/es/components/cascader-panel/src/node2.mjs.map +1 -1
- package/es/components/cascader-panel/src/store.mjs +1 -1
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +14 -38
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +38 -14
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/checkbox/index.mjs +4 -4
- package/es/components/checkbox/src/checkbox-button.mjs +1 -1
- package/es/components/checkbox/src/checkbox-group.mjs +71 -29
- package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox-group2.mjs +29 -71
- package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox.mjs +119 -59
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox2.mjs +59 -119
- package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +64 -43
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +43 -64
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/color-picker/index.mjs +2 -2
- package/es/components/color-picker/src/color-picker.mjs +40 -402
- package/es/components/color-picker/src/color-picker.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +402 -40
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/color-picker/src/components/predefine.mjs +1 -1
- package/es/components/descriptions/index.mjs +2 -2
- package/es/components/descriptions/src/description.mjs +26 -126
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +126 -26
- package/es/components/descriptions/src/description2.mjs.map +1 -1
- package/es/components/descriptions/src/descriptions-cell.mjs +7 -0
- package/es/components/descriptions/src/descriptions-cell.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +26 -178
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +178 -26
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/index.mjs +2 -2
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown-item.mjs +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +102 -298
- package/es/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +298 -102
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +412 -45
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +45 -412
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +31 -31
- package/es/components/input/index.mjs +2 -2
- package/es/components/input/src/input.mjs +431 -102
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input2.mjs +102 -431
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +49 -24
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +24 -49
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/mention/src/mention.mjs +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +4 -34
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +34 -4
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper.mjs +7 -58
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/jumper2.mjs +58 -7
- package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
- package/es/components/pagination/src/components/pager.mjs +209 -16
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +16 -209
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +2 -2
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/popper/index.mjs +4 -4
- package/es/components/popper/src/popper.mjs +22 -32
- package/es/components/popper/src/popper.mjs.map +1 -1
- package/es/components/popper/src/popper2.mjs +32 -22
- package/es/components/popper/src/popper2.mjs.map +1 -1
- package/es/components/popper/src/trigger.mjs +31 -127
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +127 -31
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/radio/index.mjs +4 -4
- package/es/components/radio/src/radio-button.mjs +1 -1
- package/es/components/radio/src/radio-group.mjs +34 -65
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +65 -34
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/radio/src/radio.mjs +32 -73
- package/es/components/radio/src/radio.mjs.map +1 -1
- package/es/components/radio/src/radio2.mjs +73 -32
- package/es/components/radio/src/radio2.mjs.map +1 -1
- package/es/components/row/index.mjs +2 -2
- package/es/components/row/src/row.mjs +28 -44
- package/es/components/row/src/row.mjs.map +1 -1
- package/es/components/row/src/row2.mjs +44 -28
- package/es/components/row/src/row2.mjs.map +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- 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/skeleton2.mjs +1 -1
- package/es/components/statistic/index.mjs +2 -2
- package/es/components/statistic/src/statistic.mjs +69 -25
- package/es/components/statistic/src/statistic.mjs.map +1 -1
- package/es/components/statistic/src/statistic2.mjs +25 -69
- package/es/components/statistic/src/statistic2.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +228 -72
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +72 -228
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/src/store/watcher.mjs +15 -19
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table/defaults.d.ts +7 -0
- package/es/components/table/src/table/defaults.mjs +4 -0
- package/es/components/table/src/table/defaults.mjs.map +1 -1
- package/es/components/table/src/table-header/event-helper.mjs +2 -1
- package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
- package/es/components/table/src/table-header/index.d.ts +8 -0
- package/es/components/table/src/table-header/index.mjs +3 -0
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table/src/table.mjs +4 -2
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +13 -0
- package/es/components/tabs/index.mjs +3 -3
- package/es/components/tabs/src/tab-bar.mjs +7 -95
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +95 -7
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/components/tabs/src/tab-pane.mjs +71 -13
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +13 -71
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +2 -2
- package/es/components/tooltip/src/tooltip.mjs +30 -166
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +166 -30
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +1 -1
- package/es/components/tooltip/src/trigger2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +1 -1
- package/es/components/tooltip-v2/src/content2.mjs +1 -1
- package/es/components/tooltip-v2/src/root.mjs +17 -79
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +79 -17
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
- package/es/components/visual-hidden/index.mjs +3 -3
- package/es/components/visual-hidden/src/visual-hidden.mjs +6 -35
- package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
- package/es/components/visual-hidden/src/visual-hidden2.mjs +35 -6
- package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
- package/es/components/watermark/index.mjs +2 -2
- package/es/components/watermark/src/watermark.mjs +210 -27
- package/es/components/watermark/src/watermark.mjs.map +1 -1
- package/es/components/watermark/src/watermark2.mjs +27 -210
- package/es/components/watermark/src/watermark2.mjs.map +1 -1
- package/es/hooks/use-lockscreen/index.mjs +3 -3
- package/es/hooks/use-lockscreen/index.mjs.map +1 -1
- package/es/index.mjs +31 -31
- 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 +81 -5
- package/lib/components/anchor/src/anchor-link.js.map +1 -1
- package/lib/components/anchor/src/anchor-link2.js +5 -81
- package/lib/components/anchor/src/anchor-link2.js.map +1 -1
- package/lib/components/autocomplete/index.js +2 -2
- package/lib/components/autocomplete/src/autocomplete.js +363 -79
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete2.js +79 -363
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +4 -4
- package/lib/components/breadcrumb/src/breadcrumb-item.js +8 -56
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +56 -8
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb.js +10 -37
- package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb2.js +37 -10
- package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
- package/lib/components/button/index.js +1 -1
- package/lib/components/button/src/button-group.js +6 -29
- package/lib/components/button/src/button-group.js.map +1 -1
- package/lib/components/button/src/button-group2.js +29 -6
- package/lib/components/button/src/button-group2.js.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +17 -134
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +134 -17
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/card/index.js +2 -2
- package/lib/components/card/src/card.js +42 -20
- package/lib/components/card/src/card.js.map +1 -1
- package/lib/components/card/src/card2.js +20 -42
- package/lib/components/card/src/card2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +7 -69
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +69 -7
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js +1 -1
- package/lib/components/cascader-panel/src/menu.js +1 -1
- package/lib/components/cascader-panel/src/node.js +115 -206
- package/lib/components/cascader-panel/src/node.js.map +1 -1
- package/lib/components/cascader-panel/src/node2.js +206 -115
- package/lib/components/cascader-panel/src/node2.js.map +1 -1
- package/lib/components/cascader-panel/src/store.js +1 -1
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +15 -38
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +38 -15
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/checkbox/index.js +4 -4
- package/lib/components/checkbox/src/checkbox-button.js +1 -1
- package/lib/components/checkbox/src/checkbox-group.js +71 -30
- package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
- package/lib/components/checkbox/src/checkbox-group2.js +30 -71
- package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
- package/lib/components/checkbox/src/checkbox.js +119 -60
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox2.js +60 -119
- package/lib/components/checkbox/src/checkbox2.js.map +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +64 -43
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +43 -64
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/color-picker/index.js +2 -2
- package/lib/components/color-picker/src/color-picker.js +40 -400
- package/lib/components/color-picker/src/color-picker.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +400 -40
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/color-picker/src/components/predefine.js +1 -1
- package/lib/components/descriptions/index.js +2 -2
- package/lib/components/descriptions/src/description.js +26 -126
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +126 -26
- package/lib/components/descriptions/src/description2.js.map +1 -1
- package/lib/components/descriptions/src/descriptions-cell.js +7 -0
- package/lib/components/descriptions/src/descriptions-cell.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +27 -178
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +178 -27
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/index.js +2 -2
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown-item.js +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +111 -298
- package/lib/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/components/dropdown/src/dropdown2.js +298 -111
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +412 -46
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +46 -412
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +31 -31
- package/lib/components/input/index.js +2 -2
- package/lib/components/input/src/input.js +430 -102
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input2.js +102 -430
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +49 -25
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +25 -49
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/mention/src/mention.js +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +4 -34
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +34 -4
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/pagination/src/components/jumper.js +7 -58
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/jumper2.js +58 -7
- package/lib/components/pagination/src/components/jumper2.js.map +1 -1
- package/lib/components/pagination/src/components/pager.js +209 -16
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +16 -209
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +2 -2
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/popper/index.js +4 -4
- package/lib/components/popper/src/popper.js +25 -32
- package/lib/components/popper/src/popper.js.map +1 -1
- package/lib/components/popper/src/popper2.js +32 -25
- package/lib/components/popper/src/popper2.js.map +1 -1
- package/lib/components/popper/src/trigger.js +32 -127
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +127 -32
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/radio/index.js +4 -4
- package/lib/components/radio/src/radio-button.js +1 -1
- package/lib/components/radio/src/radio-group.js +35 -65
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +65 -35
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/radio/src/radio.js +34 -73
- package/lib/components/radio/src/radio.js.map +1 -1
- package/lib/components/radio/src/radio2.js +73 -34
- package/lib/components/radio/src/radio2.js.map +1 -1
- package/lib/components/row/index.js +2 -2
- package/lib/components/row/src/row.js +30 -44
- package/lib/components/row/src/row.js.map +1 -1
- package/lib/components/row/src/row2.js +44 -30
- package/lib/components/row/src/row2.js.map +1 -1
- package/lib/components/skeleton/index.js +2 -2
- 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/skeleton2.js +1 -1
- package/lib/components/statistic/index.js +2 -2
- package/lib/components/statistic/src/statistic.js +69 -25
- package/lib/components/statistic/src/statistic.js.map +1 -1
- package/lib/components/statistic/src/statistic2.js +25 -69
- package/lib/components/statistic/src/statistic2.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +227 -72
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +72 -227
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/src/store/watcher.js +13 -17
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table/defaults.d.ts +7 -0
- package/lib/components/table/src/table/defaults.js +4 -0
- package/lib/components/table/src/table/defaults.js.map +1 -1
- package/lib/components/table/src/table-header/event-helper.js +2 -1
- package/lib/components/table/src/table-header/event-helper.js.map +1 -1
- package/lib/components/table/src/table-header/index.d.ts +8 -0
- package/lib/components/table/src/table-header/index.js +3 -0
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table/src/table.js +4 -2
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +13 -0
- package/lib/components/tabs/index.js +3 -3
- package/lib/components/tabs/src/tab-bar.js +7 -95
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +95 -7
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/components/tabs/src/tab-pane.js +71 -13
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +13 -71
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tooltip/index.js +2 -2
- package/lib/components/tooltip/src/tooltip.js +34 -166
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +166 -34
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +1 -1
- package/lib/components/tooltip/src/trigger2.js +1 -1
- package/lib/components/tooltip-v2/index.js +1 -1
- package/lib/components/tooltip-v2/src/content2.js +1 -1
- package/lib/components/tooltip-v2/src/root.js +17 -79
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +79 -17
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
- package/lib/components/visual-hidden/index.js +2 -2
- package/lib/components/visual-hidden/src/visual-hidden.js +6 -35
- package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
- package/lib/components/visual-hidden/src/visual-hidden2.js +35 -6
- package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
- package/lib/components/watermark/index.js +2 -2
- package/lib/components/watermark/src/watermark.js +210 -27
- package/lib/components/watermark/src/watermark.js.map +1 -1
- package/lib/components/watermark/src/watermark2.js +27 -210
- package/lib/components/watermark/src/watermark2.js.map +1 -1
- package/lib/hooks/use-lockscreen/index.js +2 -2
- package/lib/hooks/use-lockscreen/index.js.map +1 -1
- package/lib/index.js +31 -31
- 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
@@ -1,84 +1,22 @@
|
|
1
|
-
import {
|
2
|
-
import { useTimeoutFn } from '@vueuse/core';
|
3
|
-
import { TOOLTIP_V2_OPEN, tooltipV2RootKey } from './constants.mjs';
|
4
|
-
import { tooltipV2RootProps } from './root2.mjs';
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
6
|
-
import { isPropAbsent, isNumber } from '../../../utils/types.mjs';
|
7
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
8
|
-
import { useId } from '../../../hooks/use-id/index.mjs';
|
1
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
9
2
|
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
(_a = props["onUpdate:open"]) == null ? void 0 : _a.call(props, open2);
|
26
|
-
}
|
27
|
-
});
|
28
|
-
const isOpenDelayed = computed(() => isNumber(props.delayDuration) && props.delayDuration > 0);
|
29
|
-
const { start: onDelayedOpen, stop: clearTimer } = useTimeoutFn(() => {
|
30
|
-
open.value = true;
|
31
|
-
}, computed(() => props.delayDuration), {
|
32
|
-
immediate: false
|
33
|
-
});
|
34
|
-
const ns = useNamespace("tooltip-v2");
|
35
|
-
const contentId = useId();
|
36
|
-
const onNormalOpen = () => {
|
37
|
-
clearTimer();
|
38
|
-
open.value = true;
|
39
|
-
};
|
40
|
-
const onDelayOpen = () => {
|
41
|
-
unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen();
|
42
|
-
};
|
43
|
-
const onOpen = onNormalOpen;
|
44
|
-
const onClose = () => {
|
45
|
-
clearTimer();
|
46
|
-
open.value = false;
|
47
|
-
};
|
48
|
-
const onChange = (open2) => {
|
49
|
-
var _a;
|
50
|
-
if (open2) {
|
51
|
-
document.dispatchEvent(new CustomEvent(TOOLTIP_V2_OPEN));
|
52
|
-
onOpen();
|
53
|
-
}
|
54
|
-
(_a = props.onOpenChange) == null ? void 0 : _a.call(props, open2);
|
55
|
-
};
|
56
|
-
watch(open, onChange);
|
57
|
-
onMounted(() => {
|
58
|
-
document.addEventListener(TOOLTIP_V2_OPEN, onClose);
|
59
|
-
});
|
60
|
-
onBeforeUnmount(() => {
|
61
|
-
clearTimer();
|
62
|
-
document.removeEventListener(TOOLTIP_V2_OPEN, onClose);
|
63
|
-
});
|
64
|
-
provide(tooltipV2RootKey, {
|
65
|
-
contentId,
|
66
|
-
triggerRef,
|
67
|
-
ns,
|
68
|
-
onClose,
|
69
|
-
onDelayOpen,
|
70
|
-
onOpen
|
71
|
-
});
|
72
|
-
expose({
|
73
|
-
onOpen,
|
74
|
-
onClose
|
75
|
-
});
|
76
|
-
return (_ctx, _cache) => {
|
77
|
-
return renderSlot(_ctx.$slots, "default", { open: unref(open) });
|
78
|
-
};
|
3
|
+
const tooltipV2RootProps = buildProps({
|
4
|
+
delayDuration: {
|
5
|
+
type: Number,
|
6
|
+
default: 300
|
7
|
+
},
|
8
|
+
defaultOpen: Boolean,
|
9
|
+
open: {
|
10
|
+
type: Boolean,
|
11
|
+
default: void 0
|
12
|
+
},
|
13
|
+
onOpenChange: {
|
14
|
+
type: definePropType(Function)
|
15
|
+
},
|
16
|
+
"onUpdate:open": {
|
17
|
+
type: definePropType(Function)
|
79
18
|
}
|
80
19
|
});
|
81
|
-
var TooltipV2Root = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "root.vue"]]);
|
82
20
|
|
83
|
-
export {
|
21
|
+
export { tooltipV2RootProps };
|
84
22
|
//# sourceMappingURL=root.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"root.mjs","sources":["../../../../../../packages/components/tooltip-v2/src/root.
|
1
|
+
{"version":3,"file":"root.mjs","sources":["../../../../../../packages/components/tooltip-v2/src/root.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\ntype StateUpdater = (state: boolean) => void\n\nexport const tooltipV2RootProps = buildProps({\n delayDuration: {\n type: Number,\n default: 300,\n },\n defaultOpen: Boolean,\n open: {\n type: Boolean,\n default: undefined,\n },\n onOpenChange: {\n type: definePropType<StateUpdater>(Function),\n },\n 'onUpdate:open': {\n type: definePropType<StateUpdater>(Function),\n },\n} as const)\n\nexport type TooltipV2RootProps = ExtractPropTypes<typeof tooltipV2RootProps>\n"],"names":[],"mappings":";;AACY,MAAC,kBAAkB,GAAG,UAAU,CAAC;AAC7C,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,WAAW,EAAE,OAAO;AACtB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,CAAC;;;;"}
|
@@ -1,22 +1,84 @@
|
|
1
|
-
import {
|
1
|
+
import { defineComponent, ref, computed, watch, onMounted, onBeforeUnmount, provide, renderSlot, unref } from 'vue';
|
2
|
+
import { useTimeoutFn } from '@vueuse/core';
|
3
|
+
import { TOOLTIP_V2_OPEN, tooltipV2RootKey } from './constants.mjs';
|
4
|
+
import { tooltipV2RootProps } from './root.mjs';
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
6
|
+
import { isPropAbsent, isNumber } from '../../../utils/types.mjs';
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
8
|
+
import { useId } from '../../../hooks/use-id/index.mjs';
|
2
9
|
|
3
|
-
const
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
const __default__ = defineComponent({
|
11
|
+
name: "ElTooltipV2Root"
|
12
|
+
});
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
14
|
+
...__default__,
|
15
|
+
props: tooltipV2RootProps,
|
16
|
+
setup(__props, { expose }) {
|
17
|
+
const props = __props;
|
18
|
+
const _open = ref(props.defaultOpen);
|
19
|
+
const triggerRef = ref(null);
|
20
|
+
const open = computed({
|
21
|
+
get: () => isPropAbsent(props.open) ? _open.value : props.open,
|
22
|
+
set: (open2) => {
|
23
|
+
var _a;
|
24
|
+
_open.value = open2;
|
25
|
+
(_a = props["onUpdate:open"]) == null ? void 0 : _a.call(props, open2);
|
26
|
+
}
|
27
|
+
});
|
28
|
+
const isOpenDelayed = computed(() => isNumber(props.delayDuration) && props.delayDuration > 0);
|
29
|
+
const { start: onDelayedOpen, stop: clearTimer } = useTimeoutFn(() => {
|
30
|
+
open.value = true;
|
31
|
+
}, computed(() => props.delayDuration), {
|
32
|
+
immediate: false
|
33
|
+
});
|
34
|
+
const ns = useNamespace("tooltip-v2");
|
35
|
+
const contentId = useId();
|
36
|
+
const onNormalOpen = () => {
|
37
|
+
clearTimer();
|
38
|
+
open.value = true;
|
39
|
+
};
|
40
|
+
const onDelayOpen = () => {
|
41
|
+
unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen();
|
42
|
+
};
|
43
|
+
const onOpen = onNormalOpen;
|
44
|
+
const onClose = () => {
|
45
|
+
clearTimer();
|
46
|
+
open.value = false;
|
47
|
+
};
|
48
|
+
const onChange = (open2) => {
|
49
|
+
var _a;
|
50
|
+
if (open2) {
|
51
|
+
document.dispatchEvent(new CustomEvent(TOOLTIP_V2_OPEN));
|
52
|
+
onOpen();
|
53
|
+
}
|
54
|
+
(_a = props.onOpenChange) == null ? void 0 : _a.call(props, open2);
|
55
|
+
};
|
56
|
+
watch(open, onChange);
|
57
|
+
onMounted(() => {
|
58
|
+
document.addEventListener(TOOLTIP_V2_OPEN, onClose);
|
59
|
+
});
|
60
|
+
onBeforeUnmount(() => {
|
61
|
+
clearTimer();
|
62
|
+
document.removeEventListener(TOOLTIP_V2_OPEN, onClose);
|
63
|
+
});
|
64
|
+
provide(tooltipV2RootKey, {
|
65
|
+
contentId,
|
66
|
+
triggerRef,
|
67
|
+
ns,
|
68
|
+
onClose,
|
69
|
+
onDelayOpen,
|
70
|
+
onOpen
|
71
|
+
});
|
72
|
+
expose({
|
73
|
+
onOpen,
|
74
|
+
onClose
|
75
|
+
});
|
76
|
+
return (_ctx, _cache) => {
|
77
|
+
return renderSlot(_ctx.$slots, "default", { open: unref(open) });
|
78
|
+
};
|
18
79
|
}
|
19
80
|
});
|
81
|
+
var TooltipV2Root = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "root.vue"]]);
|
20
82
|
|
21
|
-
export {
|
83
|
+
export { TooltipV2Root as default };
|
22
84
|
//# sourceMappingURL=root2.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"root2.mjs","sources":["../../../../../../packages/components/tooltip-v2/src/root.
|
1
|
+
{"version":3,"file":"root2.mjs","sources":["../../../../../../packages/components/tooltip-v2/src/root.vue"],"sourcesContent":["<template>\n <slot :open=\"open\" />\n</template>\n\n<script setup lang=\"ts\">\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n unref,\n watch,\n} from 'vue'\nimport { useTimeoutFn } from '@vueuse/core'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport { isNumber, isPropAbsent } from '@element-plus/utils'\nimport { TOOLTIP_V2_OPEN, tooltipV2RootKey } from './constants'\nimport { tooltipV2RootProps } from './root'\n\ndefineOptions({\n name: 'ElTooltipV2Root',\n})\n\nconst props = defineProps(tooltipV2RootProps)\n\n/**\n * internal open state, when no model value was provided, use this as indicator instead\n */\nconst _open = ref(props.defaultOpen)\nconst triggerRef = ref<HTMLElement | null>(null)\n\nconst open = computed<boolean>({\n get: () => (isPropAbsent(props.open) ? _open.value : props.open),\n set: (open) => {\n _open.value = open\n props['onUpdate:open']?.(open)\n },\n})\n\nconst isOpenDelayed = computed(\n () => isNumber(props.delayDuration) && props.delayDuration > 0\n)\n\nconst { start: onDelayedOpen, stop: clearTimer } = useTimeoutFn(\n () => {\n open.value = true\n },\n computed(() => props.delayDuration),\n {\n immediate: false,\n }\n)\n\nconst ns = useNamespace('tooltip-v2')\n\nconst contentId = useId()\n\nconst onNormalOpen = () => {\n clearTimer()\n open.value = true\n}\n\nconst onDelayOpen = () => {\n unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen()\n}\n\nconst onOpen = onNormalOpen\n\nconst onClose = () => {\n clearTimer()\n open.value = false\n}\n\nconst onChange = (open: boolean) => {\n if (open) {\n document.dispatchEvent(new CustomEvent(TOOLTIP_V2_OPEN))\n onOpen()\n }\n\n props.onOpenChange?.(open)\n}\n\nwatch(open, onChange)\n\nonMounted(() => {\n // Keeps only 1 tooltip open at a time\n document.addEventListener(TOOLTIP_V2_OPEN, onClose)\n})\n\nonBeforeUnmount(() => {\n clearTimer()\n document.removeEventListener(TOOLTIP_V2_OPEN, onClose)\n})\n\nprovide(tooltipV2RootKey, {\n contentId,\n triggerRef,\n ns,\n\n onClose,\n onDelayOpen,\n onOpen,\n})\n\ndefineExpose({\n /**\n * @description open tooltip programmatically\n */\n onOpen,\n\n /**\n * @description close tooltip programmatically\n */\n onClose,\n})\n</script>\n"],"names":["open","_renderSlot","_unref"],"mappings":";;;;;;;;;mCAoBc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAOA,IAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,KAAA,CAAM,WAAW,CAAA,CAAA;AACnC,IAAM,MAAA,UAAA,GAAa,IAAwB,IAAI,CAAA,CAAA;AAE/C,IAAA,MAAM,OAAO,QAAkB,CAAA;AAAA,MAC7B,GAAA,EAAK,MAAO,YAAa,CAAA,KAAA,CAAM,IAAI,CAAI,GAAA,KAAA,CAAM,QAAQ,KAAM,CAAA,IAAA;AAAA,MAC3D,GAAA,EAAK,CAACA,KAAS,KAAA;AACb,QAAA,IAAA,EAAM,CAAQA;AACd,QAAM,KAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AAAuB,QAC/B,CAAA,EAAA,GAAA,KAAA,CAAA,eAAA,CAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA;AAAA,OACD;AAED,KAAA,CAAA,CAAA;AAAsB,IAAA,mBACL,GAAA,QAAmB,CAAA,MAAA,cAA2B,CAAA,aAAA,CAAA,IAAA,KAAA,CAAA,aAAA,GAAA,CAAA,CAAA,CAAA;AAAA,IAC/D,MAAA,EAAA,KAAA,EAAA,aAAA,EAAA,IAAA,EAAA,UAAA,EAAA,GAAA,YAAA,CAAA,MAAA;AAEA,MAAA,IAAM,CAAE,KAAA,GAAO,IAAe,CAAA;AAAqB,KAAA,EAC3C,QAAA,CAAA,MAAA,KAAA,CAAA,aAAA,CAAA,EAAA;AACJ,MAAA,SAAa,EAAA,KAAA;AAAA,KACf,CAAA,CAAA;AAAA,IACA,MAAA,EAAA,GAAS,YAAY,CAAa,YAAA,CAAA,CAAA;AAAA,IAClC,MAAA,SAAA,GAAA,KAAA,EAAA,CAAA;AAAA,IAAA,MACa,YAAA,GAAA,MAAA;AAAA,MACb,UAAA,EAAA,CAAA;AAAA,MACF,IAAA,CAAA,KAAA,GAAA,IAAA,CAAA;AAEA,KAAM,CAAA;AAEN,IAAA,MAAM,cAAkB,MAAA;AAExB,MAAA,mBAAqB,CAAM,GAAA,aAAA,EAAA,GAAA,YAAA,EAAA,CAAA;AACzB,KAAW,CAAA;AACX,IAAA,MAAA,MAAa,GAAA,YAAA,CAAA;AAAA,IACf,MAAA,OAAA,GAAA,MAAA;AAEA,MAAA;AACE,MAAA,IAAA,CAAA,KAAmB,GAAA,KAAA,CAAA;AAAmC,KACxD,CAAA;AAEA,IAAA,MAAM,QAAS,GAAA,CAAA,KAAA,KAAA;AAEf,MAAA,IAAM;AACJ,MAAW,IAAA,KAAA,EAAA;AACX,QAAA,QAAa,CAAA,aAAA,CAAA,IAAA,WAAA,CAAA,eAAA,CAAA,CAAA,CAAA;AAAA,QACf,MAAA,EAAA,CAAA;AAEA,OAAM;AACJ,MAAA,CAAA,EAAA,GAAU,KAAA,CAAA,YAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA;AACR,KAAA,CAAA;AACA,IAAO,KAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AAAA,IACT,SAAA,CAAA,MAAA;AAEA,MAAA,yBAAyB,CAAA,eAAA,EAAA,OAAA,CAAA,CAAA;AAAA,KAC3B,CAAA,CAAA;AAEA,IAAA,eAAoB,CAAA,MAAA;AAEpB,MAAA,UAAgB,EAAA,CAAA;AAEd,MAAS,QAAA,CAAA,mCAAyC,EAAA,OAAA,CAAA,CAAA;AAAA,KACnD,CAAA,CAAA;AAED,IAAA,OAAA,CAAA,gBAAsB,EAAA;AACpB,MAAW,SAAA;AACX,MAAS,UAAA;AAA4C,MACtD,EAAA;AAED,MAAA,OAA0B;AAAA,MACxB,WAAA;AAAA,MACA,MAAA;AAAA,KACA,CAAA,CAAA;AAAA,IAEA,MAAA,CAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAa,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MAAA,OAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,IAAA,EAAAC,KAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAAA,KAAA,CAAA;AAAA,GAAA;AAAA,CAIX,CAAA,CAAA;AAAA,oBAAA,gBAAA,WAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,UAAA,CAAA,CAAA,CAAA;;;;"}
|
@@ -3,10 +3,10 @@ import { pick } from 'lodash-unified';
|
|
3
3
|
import { ElTeleport } from '../../teleport/index.mjs';
|
4
4
|
import { tooltipV2ArrowProps } from './arrow.mjs';
|
5
5
|
import { tooltipV2ContentProps } from './content.mjs';
|
6
|
-
import { tooltipV2RootProps } from './
|
6
|
+
import { tooltipV2RootProps } from './root.mjs';
|
7
7
|
import { tooltipV2Props } from './tooltip.mjs';
|
8
8
|
import { tooltipV2TriggerProps } from './trigger.mjs';
|
9
|
-
import TooltipV2Root from './
|
9
|
+
import TooltipV2Root from './root2.mjs';
|
10
10
|
import TooltipV2Arrow from './arrow2.mjs';
|
11
11
|
import TooltipV2Content from './content2.mjs';
|
12
12
|
import TooltipV2Trigger from './trigger2.mjs';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import ElVisuallyHidden from './src/visual-
|
2
|
-
export { default as ElVisuallyHidden, default } from './src/visual-
|
3
|
-
export { visualHiddenProps } from './src/visual-
|
1
|
+
import ElVisuallyHidden from './src/visual-hidden2.mjs';
|
2
|
+
export { default as ElVisuallyHidden, default } from './src/visual-hidden2.mjs';
|
3
|
+
export { visualHiddenProps } from './src/visual-hidden.mjs';
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
@@ -1,40 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
import { visualHiddenProps } from './visual-hidden2.mjs';
|
3
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
1
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
4
2
|
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
...__default__,
|
10
|
-
props: visualHiddenProps,
|
11
|
-
setup(__props) {
|
12
|
-
const props = __props;
|
13
|
-
const computedStyle = computed(() => {
|
14
|
-
return [
|
15
|
-
props.style,
|
16
|
-
{
|
17
|
-
position: "absolute",
|
18
|
-
border: 0,
|
19
|
-
width: 1,
|
20
|
-
height: 1,
|
21
|
-
padding: 0,
|
22
|
-
margin: -1,
|
23
|
-
overflow: "hidden",
|
24
|
-
clip: "rect(0, 0, 0, 0)",
|
25
|
-
whiteSpace: "nowrap",
|
26
|
-
wordWrap: "normal"
|
27
|
-
}
|
28
|
-
];
|
29
|
-
});
|
30
|
-
return (_ctx, _cache) => {
|
31
|
-
return openBlock(), createElementBlock("span", mergeProps(_ctx.$attrs, { style: unref(computedStyle) }), [
|
32
|
-
renderSlot(_ctx.$slots, "default")
|
33
|
-
], 16);
|
34
|
-
};
|
3
|
+
const visualHiddenProps = buildProps({
|
4
|
+
style: {
|
5
|
+
type: definePropType([String, Object, Array]),
|
6
|
+
default: () => ({})
|
35
7
|
}
|
36
8
|
});
|
37
|
-
var ElVisuallyHidden = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "visual-hidden.vue"]]);
|
38
9
|
|
39
|
-
export {
|
10
|
+
export { visualHiddenProps };
|
40
11
|
//# sourceMappingURL=visual-hidden.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"visual-hidden.mjs","sources":["../../../../../../packages/components/visual-hidden/src/visual-hidden.
|
1
|
+
{"version":3,"file":"visual-hidden.mjs","sources":["../../../../../../packages/components/visual-hidden/src/visual-hidden.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { StyleValue } from 'vue'\n\nexport const visualHiddenProps = buildProps({\n style: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: () => ({}),\n },\n} as const)\n"],"names":[],"mappings":";;AACY,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACjD,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;AACvB,GAAG;AACH,CAAC;;;;"}
|
@@ -1,11 +1,40 @@
|
|
1
|
-
import {
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, mergeProps, unref, renderSlot } from 'vue';
|
2
|
+
import { visualHiddenProps } from './visual-hidden.mjs';
|
3
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
2
4
|
|
3
|
-
const
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
const __default__ = defineComponent({
|
6
|
+
name: "ElVisuallyHidden"
|
7
|
+
});
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
9
|
+
...__default__,
|
10
|
+
props: visualHiddenProps,
|
11
|
+
setup(__props) {
|
12
|
+
const props = __props;
|
13
|
+
const computedStyle = computed(() => {
|
14
|
+
return [
|
15
|
+
props.style,
|
16
|
+
{
|
17
|
+
position: "absolute",
|
18
|
+
border: 0,
|
19
|
+
width: 1,
|
20
|
+
height: 1,
|
21
|
+
padding: 0,
|
22
|
+
margin: -1,
|
23
|
+
overflow: "hidden",
|
24
|
+
clip: "rect(0, 0, 0, 0)",
|
25
|
+
whiteSpace: "nowrap",
|
26
|
+
wordWrap: "normal"
|
27
|
+
}
|
28
|
+
];
|
29
|
+
});
|
30
|
+
return (_ctx, _cache) => {
|
31
|
+
return openBlock(), createElementBlock("span", mergeProps(_ctx.$attrs, { style: unref(computedStyle) }), [
|
32
|
+
renderSlot(_ctx.$slots, "default")
|
33
|
+
], 16);
|
34
|
+
};
|
7
35
|
}
|
8
36
|
});
|
37
|
+
var ElVisuallyHidden = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "visual-hidden.vue"]]);
|
9
38
|
|
10
|
-
export {
|
39
|
+
export { ElVisuallyHidden as default };
|
11
40
|
//# sourceMappingURL=visual-hidden2.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"visual-hidden2.mjs","sources":["../../../../../../packages/components/visual-hidden/src/visual-hidden.
|
1
|
+
{"version":3,"file":"visual-hidden2.mjs","sources":["../../../../../../packages/components/visual-hidden/src/visual-hidden.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\" :style=\"computedStyle\">\n <slot />\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { visualHiddenProps } from './visual-hidden'\nimport type { StyleValue } from 'vue'\nconst props = defineProps(visualHiddenProps)\n\ndefineOptions({\n name: 'ElVisuallyHidden',\n})\n\nconst computedStyle = computed<StyleValue>(() => {\n return [\n props.style,\n {\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n },\n ]\n})\n</script>\n"],"names":[],"mappings":";;;;mCAYc,CAAA;AAAA,EACZ,IAAM,EAAA,kBAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAEA,IAAM,MAAA,aAAA,GAAgB,SAAqB,MAAM;AAC/C,MAAO,OAAA;AAAA,QACL,KAAM,CAAA,KAAA;AAAA,QACN;AAAA,UACE,QAAU,EAAA,UAAA;AAAA,UACV,MAAQ,EAAA,CAAA;AAAA,UACR,KAAO,EAAA,CAAA;AAAA,UACP,MAAQ,EAAA,CAAA;AAAA,UACR,OAAS,EAAA,CAAA;AAAA,UACT,MAAQ,EAAA,CAAA,CAAA;AAAA,UACR,QAAU,EAAA,QAAA;AAAA,UACV,IAAM,EAAA,kBAAA;AAAA,UACN,UAAY,EAAA,QAAA;AAAA,UACZ,QAAU,EAAA,QAAA;AAAA,SACZ;AAAA,OACF,CAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import Watermark from './src/
|
2
|
-
export { watermarkProps } from './src/
|
1
|
+
import Watermark from './src/watermark.mjs';
|
2
|
+
export { watermarkProps } from './src/watermark2.mjs';
|
3
3
|
import { withInstall } from '../../utils/vue/install.mjs';
|
4
4
|
|
5
5
|
const ElWatermark = withInstall(Watermark);
|
@@ -1,32 +1,215 @@
|
|
1
|
-
import {
|
1
|
+
import { defineComponent, computed, shallowRef, ref, onMounted, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeStyle, renderSlot } from 'vue';
|
2
|
+
import { useMutationObserver } from '@vueuse/core';
|
3
|
+
import { watermarkProps } from './watermark2.mjs';
|
4
|
+
import { reRendering, getStyleStr, getPixelRatio } from './utils.mjs';
|
5
|
+
import useClips, { FontGap } from './useClips.mjs';
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
7
|
+
import { isArray } from '@vue/shared';
|
2
8
|
|
3
|
-
const
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
9
|
+
const __default__ = defineComponent({
|
10
|
+
name: "ElWatermark"
|
11
|
+
});
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
13
|
+
...__default__,
|
14
|
+
props: watermarkProps,
|
15
|
+
setup(__props) {
|
16
|
+
const props = __props;
|
17
|
+
const style = {
|
18
|
+
position: "relative"
|
19
|
+
};
|
20
|
+
const color = computed(() => {
|
21
|
+
var _a, _b;
|
22
|
+
return (_b = (_a = props.font) == null ? void 0 : _a.color) != null ? _b : "rgba(0,0,0,.15)";
|
23
|
+
});
|
24
|
+
const fontSize = computed(() => {
|
25
|
+
var _a, _b;
|
26
|
+
return (_b = (_a = props.font) == null ? void 0 : _a.fontSize) != null ? _b : 16;
|
27
|
+
});
|
28
|
+
const fontWeight = computed(() => {
|
29
|
+
var _a, _b;
|
30
|
+
return (_b = (_a = props.font) == null ? void 0 : _a.fontWeight) != null ? _b : "normal";
|
31
|
+
});
|
32
|
+
const fontStyle = computed(() => {
|
33
|
+
var _a, _b;
|
34
|
+
return (_b = (_a = props.font) == null ? void 0 : _a.fontStyle) != null ? _b : "normal";
|
35
|
+
});
|
36
|
+
const fontFamily = computed(() => {
|
37
|
+
var _a, _b;
|
38
|
+
return (_b = (_a = props.font) == null ? void 0 : _a.fontFamily) != null ? _b : "sans-serif";
|
39
|
+
});
|
40
|
+
const textAlign = computed(() => {
|
41
|
+
var _a, _b;
|
42
|
+
return (_b = (_a = props.font) == null ? void 0 : _a.textAlign) != null ? _b : "center";
|
43
|
+
});
|
44
|
+
const textBaseline = computed(() => {
|
45
|
+
var _a, _b;
|
46
|
+
return (_b = (_a = props.font) == null ? void 0 : _a.textBaseline) != null ? _b : "hanging";
|
47
|
+
});
|
48
|
+
const gapX = computed(() => props.gap[0]);
|
49
|
+
const gapY = computed(() => props.gap[1]);
|
50
|
+
const gapXCenter = computed(() => gapX.value / 2);
|
51
|
+
const gapYCenter = computed(() => gapY.value / 2);
|
52
|
+
const offsetLeft = computed(() => {
|
53
|
+
var _a, _b;
|
54
|
+
return (_b = (_a = props.offset) == null ? void 0 : _a[0]) != null ? _b : gapXCenter.value;
|
55
|
+
});
|
56
|
+
const offsetTop = computed(() => {
|
57
|
+
var _a, _b;
|
58
|
+
return (_b = (_a = props.offset) == null ? void 0 : _a[1]) != null ? _b : gapYCenter.value;
|
59
|
+
});
|
60
|
+
const getMarkStyle = () => {
|
61
|
+
const markStyle = {
|
62
|
+
zIndex: props.zIndex,
|
63
|
+
position: "absolute",
|
64
|
+
left: 0,
|
65
|
+
top: 0,
|
66
|
+
width: "100%",
|
67
|
+
height: "100%",
|
68
|
+
pointerEvents: "none",
|
69
|
+
backgroundRepeat: "repeat"
|
70
|
+
};
|
71
|
+
let positionLeft = offsetLeft.value - gapXCenter.value;
|
72
|
+
let positionTop = offsetTop.value - gapYCenter.value;
|
73
|
+
if (positionLeft > 0) {
|
74
|
+
markStyle.left = `${positionLeft}px`;
|
75
|
+
markStyle.width = `calc(100% - ${positionLeft}px)`;
|
76
|
+
positionLeft = 0;
|
77
|
+
}
|
78
|
+
if (positionTop > 0) {
|
79
|
+
markStyle.top = `${positionTop}px`;
|
80
|
+
markStyle.height = `calc(100% - ${positionTop}px)`;
|
81
|
+
positionTop = 0;
|
82
|
+
}
|
83
|
+
markStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;
|
84
|
+
return markStyle;
|
85
|
+
};
|
86
|
+
const containerRef = shallowRef(null);
|
87
|
+
const watermarkRef = shallowRef();
|
88
|
+
const stopObservation = ref(false);
|
89
|
+
const destroyWatermark = () => {
|
90
|
+
if (watermarkRef.value) {
|
91
|
+
watermarkRef.value.remove();
|
92
|
+
watermarkRef.value = void 0;
|
93
|
+
}
|
94
|
+
};
|
95
|
+
const appendWatermark = (base64Url, markWidth) => {
|
96
|
+
var _a;
|
97
|
+
if (containerRef.value && watermarkRef.value) {
|
98
|
+
stopObservation.value = true;
|
99
|
+
watermarkRef.value.setAttribute("style", getStyleStr({
|
100
|
+
...getMarkStyle(),
|
101
|
+
backgroundImage: `url('${base64Url}')`,
|
102
|
+
backgroundSize: `${Math.floor(markWidth)}px`
|
103
|
+
}));
|
104
|
+
(_a = containerRef.value) == null ? void 0 : _a.append(watermarkRef.value);
|
105
|
+
setTimeout(() => {
|
106
|
+
stopObservation.value = false;
|
107
|
+
});
|
108
|
+
}
|
109
|
+
};
|
110
|
+
const getMarkSize = (ctx) => {
|
111
|
+
let defaultWidth = 120;
|
112
|
+
let defaultHeight = 64;
|
113
|
+
const image = props.image;
|
114
|
+
const content = props.content;
|
115
|
+
const width = props.width;
|
116
|
+
const height = props.height;
|
117
|
+
if (!image && ctx.measureText) {
|
118
|
+
ctx.font = `${Number(fontSize.value)}px ${fontFamily.value}`;
|
119
|
+
const contents = isArray(content) ? content : [content];
|
120
|
+
const sizes = contents.map((item) => {
|
121
|
+
const metrics = ctx.measureText(item);
|
122
|
+
return [
|
123
|
+
metrics.width,
|
124
|
+
metrics.fontBoundingBoxAscent !== void 0 ? metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent : metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent
|
125
|
+
];
|
126
|
+
});
|
127
|
+
defaultWidth = Math.ceil(Math.max(...sizes.map((size) => size[0])));
|
128
|
+
defaultHeight = Math.ceil(Math.max(...sizes.map((size) => size[1]))) * contents.length + (contents.length - 1) * FontGap;
|
129
|
+
}
|
130
|
+
return [width != null ? width : defaultWidth, height != null ? height : defaultHeight];
|
131
|
+
};
|
132
|
+
const getClips = useClips();
|
133
|
+
const renderWatermark = () => {
|
134
|
+
const canvas = document.createElement("canvas");
|
135
|
+
const ctx = canvas.getContext("2d");
|
136
|
+
const image = props.image;
|
137
|
+
const content = props.content;
|
138
|
+
const rotate = props.rotate;
|
139
|
+
if (ctx) {
|
140
|
+
if (!watermarkRef.value) {
|
141
|
+
watermarkRef.value = document.createElement("div");
|
142
|
+
}
|
143
|
+
const ratio = getPixelRatio();
|
144
|
+
const [markWidth, markHeight] = getMarkSize(ctx);
|
145
|
+
const drawCanvas = (drawContent) => {
|
146
|
+
const [textClips, clipWidth] = getClips(drawContent || "", rotate, ratio, markWidth, markHeight, {
|
147
|
+
color: color.value,
|
148
|
+
fontSize: fontSize.value,
|
149
|
+
fontStyle: fontStyle.value,
|
150
|
+
fontWeight: fontWeight.value,
|
151
|
+
fontFamily: fontFamily.value,
|
152
|
+
textAlign: textAlign.value,
|
153
|
+
textBaseline: textBaseline.value
|
154
|
+
}, gapX.value, gapY.value);
|
155
|
+
appendWatermark(textClips, clipWidth);
|
156
|
+
};
|
157
|
+
if (image) {
|
158
|
+
const img = new Image();
|
159
|
+
img.onload = () => {
|
160
|
+
drawCanvas(img);
|
161
|
+
};
|
162
|
+
img.onerror = () => {
|
163
|
+
drawCanvas(content);
|
164
|
+
};
|
165
|
+
img.crossOrigin = "anonymous";
|
166
|
+
img.referrerPolicy = "no-referrer";
|
167
|
+
img.src = image;
|
168
|
+
} else {
|
169
|
+
drawCanvas(content);
|
170
|
+
}
|
171
|
+
}
|
172
|
+
};
|
173
|
+
onMounted(() => {
|
174
|
+
renderWatermark();
|
175
|
+
});
|
176
|
+
watch(() => props, () => {
|
177
|
+
renderWatermark();
|
178
|
+
}, {
|
179
|
+
deep: true,
|
180
|
+
flush: "post"
|
181
|
+
});
|
182
|
+
onBeforeUnmount(() => {
|
183
|
+
destroyWatermark();
|
184
|
+
});
|
185
|
+
const onMutate = (mutations) => {
|
186
|
+
if (stopObservation.value) {
|
187
|
+
return;
|
188
|
+
}
|
189
|
+
mutations.forEach((mutation) => {
|
190
|
+
if (reRendering(mutation, watermarkRef.value)) {
|
191
|
+
destroyWatermark();
|
192
|
+
renderWatermark();
|
193
|
+
}
|
194
|
+
});
|
195
|
+
};
|
196
|
+
useMutationObserver(containerRef, onMutate, {
|
197
|
+
attributes: true,
|
198
|
+
subtree: true,
|
199
|
+
childList: true
|
200
|
+
});
|
201
|
+
return (_ctx, _cache) => {
|
202
|
+
return openBlock(), createElementBlock("div", {
|
203
|
+
ref_key: "containerRef",
|
204
|
+
ref: containerRef,
|
205
|
+
style: normalizeStyle([style])
|
206
|
+
}, [
|
207
|
+
renderSlot(_ctx.$slots, "default")
|
208
|
+
], 4);
|
209
|
+
};
|
28
210
|
}
|
29
211
|
});
|
212
|
+
var Watermark = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "watermark.vue"]]);
|
30
213
|
|
31
|
-
export {
|
214
|
+
export { Watermark as default };
|
32
215
|
//# sourceMappingURL=watermark.mjs.map
|