element-plus 2.10.5 → 2.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +162 -72
- package/dist/index.full.min.js +14 -14
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +13 -13
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +162 -72
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/anchor/src/anchor2.mjs +1 -1
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +2 -0
- package/es/components/autocomplete/src/autocomplete2.mjs +18 -2
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +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/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/date-picker/src/composables/use-range-picker.mjs +6 -1
- package/es/components/date-picker/src/composables/use-range-picker.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-range.mjs +10 -5
- package/es/components/date-picker/src/date-picker-com/panel-date-range.mjs.map +1 -1
- package/es/components/descriptions/index.mjs +2 -2
- package/es/components/descriptions/src/description.mjs +26 -127
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +127 -26
- package/es/components/descriptions/src/description2.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content.mjs +88 -29
- package/es/components/dialog/src/dialog-content.mjs.map +1 -1
- package/es/components/dialog/src/dialog-content2.mjs +29 -88
- 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/divider/index.mjs +2 -2
- package/es/components/divider/src/divider.mjs +16 -34
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider2.mjs +34 -16
- package/es/components/divider/src/divider2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +35 -8
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +8 -35
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +12 -11
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +16 -16
- package/es/components/input-tag/src/input-tag.mjs +1 -1
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +25 -71
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +71 -25
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/mention/index.mjs +2 -2
- package/es/components/mention/src/mention.mjs +65 -285
- package/es/components/mention/src/mention.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +285 -65
- package/es/components/mention/src/mention2.mjs.map +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs +100 -15
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +15 -100
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/message-box/src/index.mjs +4 -8
- package/es/components/message-box/src/index.mjs.map +1 -1
- package/es/components/pagination/src/components/pager.mjs +210 -16
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +16 -210
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/arrow.mjs +7 -30
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +30 -7
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/popper/src/content.mjs +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 -74
- package/es/components/radio/src/radio.mjs.map +1 -1
- package/es/components/radio/src/radio2.mjs +74 -32
- package/es/components/radio/src/radio2.mjs.map +1 -1
- package/es/components/rate/index.mjs +2 -2
- package/es/components/rate/src/rate.mjs +83 -258
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate2.mjs +258 -83
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/select-v2/src/select.mjs +8 -4
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton.mjs +48 -18
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +18 -48
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/slider/src/button.mjs +19 -91
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +91 -19
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/splitter/src/splitter2.mjs +5 -4
- package/es/components/splitter/src/splitter2.mjs.map +1 -1
- package/es/components/table/src/table-column/render-helper.mjs +3 -2
- package/es/components/table/src/table-column/render-helper.mjs.map +1 -1
- package/es/components/tabs/index.mjs +3 -3
- package/es/components/tabs/src/tab-bar.mjs +87 -11
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +11 -87
- 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 +82 -13
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +13 -82
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +27 -99
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +99 -27
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +1 -1
- package/es/components/tooltip-v2/src/arrow.mjs +21 -37
- package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
- package/es/components/tooltip-v2/src/arrow2.mjs +37 -21
- package/es/components/tooltip-v2/src/arrow2.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/tour/src/helper.d.ts +1 -1
- package/es/components/tour/src/helper.mjs.map +1 -1
- package/es/components/tour/src/mask2.mjs +15 -16
- package/es/components/tour/src/mask2.mjs.map +1 -1
- package/es/components/tour/src/tour2.mjs.map +1 -1
- package/es/components/transfer/src/composables/use-check.mjs +1 -1
- package/es/components/transfer/src/transfer-panel.mjs +19 -130
- package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel2.mjs +130 -19
- package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs +1 -1
- package/es/components/watermark/src/useClips.d.ts +1 -1
- package/es/components/watermark/src/useClips.mjs +10 -2
- package/es/components/watermark/src/useClips.mjs.map +1 -1
- package/es/components/watermark/src/watermark2.mjs +5 -4
- package/es/components/watermark/src/watermark2.mjs.map +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.mjs +16 -16
- package/es/utils/index.mjs +1 -1
- package/es/utils/vue/index.mjs +1 -1
- package/es/utils/vue/vnode.d.ts +1 -0
- package/es/utils/vue/vnode.mjs +12 -1
- package/es/utils/vue/vnode.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/anchor/src/anchor2.js +1 -1
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +2 -0
- package/lib/components/autocomplete/src/autocomplete2.js +17 -1
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +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/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/date-picker/src/composables/use-range-picker.js +6 -1
- package/lib/components/date-picker/src/composables/use-range-picker.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.js +10 -5
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.js.map +1 -1
- package/lib/components/descriptions/index.js +2 -2
- package/lib/components/descriptions/src/description.js +26 -127
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +127 -26
- package/lib/components/descriptions/src/description2.js.map +1 -1
- package/lib/components/dialog/src/dialog-content.js +87 -29
- package/lib/components/dialog/src/dialog-content.js.map +1 -1
- package/lib/components/dialog/src/dialog-content2.js +29 -87
- 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/divider/index.js +2 -2
- package/lib/components/divider/src/divider.js +16 -34
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider2.js +34 -16
- package/lib/components/divider/src/divider2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +35 -8
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +8 -35
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/image/src/image2.js +11 -10
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +16 -16
- package/lib/components/input-tag/src/input-tag.js +1 -1
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +26 -71
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +71 -26
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/mention/index.js +2 -2
- package/lib/components/mention/src/mention.js +64 -283
- package/lib/components/mention/src/mention.js.map +1 -1
- package/lib/components/mention/src/mention2.js +283 -64
- package/lib/components/mention/src/mention2.js.map +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item.js +100 -16
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +16 -100
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/message-box/src/index.js +3 -7
- package/lib/components/message-box/src/index.js.map +1 -1
- package/lib/components/pagination/src/components/pager.js +210 -16
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +16 -210
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/arrow.js +8 -30
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +30 -8
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/popper/src/content.js +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 +33 -73
- package/lib/components/radio/src/radio.js.map +1 -1
- package/lib/components/radio/src/radio2.js +73 -33
- package/lib/components/radio/src/radio2.js.map +1 -1
- package/lib/components/rate/index.js +2 -2
- package/lib/components/rate/src/rate.js +83 -257
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate2.js +257 -83
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/select-v2/src/select.js +8 -4
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton.js +48 -18
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +18 -48
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/slider/src/button.js +20 -91
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +91 -20
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/splitter/src/splitter2.js +5 -4
- package/lib/components/splitter/src/splitter2.js.map +1 -1
- package/lib/components/table/src/table-column/render-helper.js +2 -1
- package/lib/components/table/src/table-column/render-helper.js.map +1 -1
- package/lib/components/tabs/index.js +3 -3
- package/lib/components/tabs/src/tab-bar.js +87 -11
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +11 -87
- 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 +82 -13
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +13 -82
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +28 -99
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +99 -28
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tooltip-v2/index.js +1 -1
- package/lib/components/tooltip-v2/src/arrow.js +22 -37
- package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
- package/lib/components/tooltip-v2/src/arrow2.js +37 -22
- package/lib/components/tooltip-v2/src/arrow2.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/tour/src/helper.d.ts +1 -1
- package/lib/components/tour/src/helper.js.map +1 -1
- package/lib/components/tour/src/mask2.js +15 -16
- package/lib/components/tour/src/mask2.js.map +1 -1
- package/lib/components/tour/src/tour2.js.map +1 -1
- package/lib/components/transfer/src/composables/use-check.js +1 -1
- package/lib/components/transfer/src/transfer-panel.js +21 -130
- package/lib/components/transfer/src/transfer-panel.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel2.js +130 -21
- package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js +1 -1
- package/lib/components/watermark/src/useClips.d.ts +1 -1
- package/lib/components/watermark/src/useClips.js +10 -2
- package/lib/components/watermark/src/useClips.js.map +1 -1
- package/lib/components/watermark/src/watermark2.js +5 -4
- package/lib/components/watermark/src/watermark2.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +16 -16
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/vue/index.js +1 -0
- package/lib/utils/vue/index.js.map +1 -1
- package/lib/utils/vue/vnode.d.ts +1 -0
- package/lib/utils/vue/vnode.js +12 -0
- package/lib/utils/vue/vnode.js.map +1 -1
- 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/theme-chalk/el-autocomplete.css +1 -1
- package/theme-chalk/el-segmented.css +1 -1
- package/theme-chalk/el-splitter.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/autocomplete.scss +10 -0
- package/theme-chalk/src/segmented.scss +4 -1
- package/theme-chalk/src/splitter.scss +4 -1
- package/web-types.json +1 -1
|
@@ -36,13 +36,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36
36
|
const _radius = radius.value;
|
|
37
37
|
return props.pos ? `${_path} M${props.pos.left + _radius},${props.pos.top} h${props.pos.width - _radius * 2} ${info.topRight} v${props.pos.height - _radius * 2} ${info.bottomRight} h${-props.pos.width + _radius * 2} ${info.bottomLeft} v${-props.pos.height + _radius * 2} ${info.topLeft} z` : _path;
|
|
38
38
|
});
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
const maskStyle = computed(() => ({
|
|
40
|
+
position: "fixed",
|
|
41
|
+
left: 0,
|
|
42
|
+
right: 0,
|
|
43
|
+
top: 0,
|
|
44
|
+
bottom: 0,
|
|
45
|
+
zIndex: props.zIndex,
|
|
46
|
+
pointerEvents: props.pos && props.targetAreaClickable ? "none" : "auto"
|
|
47
|
+
}));
|
|
48
|
+
const pathStyle = computed(() => ({
|
|
49
|
+
fill: props.fill,
|
|
50
|
+
pointerEvents: "auto",
|
|
51
|
+
cursor: "auto"
|
|
52
|
+
}));
|
|
46
53
|
useLockscreen(toRef(props, "visible"), {
|
|
47
54
|
ns
|
|
48
55
|
});
|
|
@@ -50,15 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
57
|
return _ctx.visible ? (openBlock(), createElementBlock("div", mergeProps({
|
|
51
58
|
key: 0,
|
|
52
59
|
class: unref(ns).e("mask"),
|
|
53
|
-
style:
|
|
54
|
-
position: "fixed",
|
|
55
|
-
left: 0,
|
|
56
|
-
right: 0,
|
|
57
|
-
top: 0,
|
|
58
|
-
bottom: 0,
|
|
59
|
-
zIndex: _ctx.zIndex,
|
|
60
|
-
pointerEvents: _ctx.pos && _ctx.targetAreaClickable ? "none" : "auto"
|
|
61
|
-
}
|
|
60
|
+
style: unref(maskStyle)
|
|
62
61
|
}, _ctx.$attrs), [
|
|
63
62
|
(openBlock(), createElementBlock("svg", { style: {
|
|
64
63
|
width: "100%",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask2.mjs","sources":["../../../../../../packages/components/tour/src/mask.vue"],"sourcesContent":["<template>\n <div
|
|
1
|
+
{"version":3,"file":"mask2.mjs","sources":["../../../../../../packages/components/tour/src/mask.vue"],"sourcesContent":["<template>\n <div v-if=\"visible\" :class=\"ns.e('mask')\" :style=\"maskStyle\" v-bind=\"$attrs\">\n <svg\n :style=\"{\n width: '100%',\n height: '100%',\n }\"\n >\n <path :class=\"ns.e('hollow')\" :style=\"pathStyle\" :d=\"path\" />\n </svg>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, toRef } from 'vue'\nimport { useLockscreen } from '@element-plus/hooks'\nimport { maskProps } from './mask'\nimport { tourKey } from './helper'\n\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElTourMask',\n inheritAttrs: false,\n})\n\nconst props = defineProps(maskProps)\n\nconst { ns } = inject(tourKey)!\nconst radius = computed(() => props.pos?.radius ?? 2)\nconst roundInfo = computed(() => {\n const v = radius.value\n const baseInfo = `a${v},${v} 0 0 1`\n return {\n topRight: `${baseInfo} ${v},${v}`,\n bottomRight: `${baseInfo} ${-v},${v}`,\n bottomLeft: `${baseInfo} ${-v},${-v}`,\n topLeft: `${baseInfo} ${v},${-v}`,\n }\n})\n\nconst path = computed(() => {\n const width = window.innerWidth\n const height = window.innerHeight\n const info = roundInfo.value\n const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`\n const _radius = radius.value\n return props.pos\n ? `${_path} M${props.pos.left + _radius},${props.pos.top} h${\n props.pos.width - _radius * 2\n } ${info.topRight} v${props.pos.height - _radius * 2} ${\n info.bottomRight\n } h${-props.pos.width + _radius * 2} ${info.bottomLeft} v${\n -props.pos.height + _radius * 2\n } ${info.topLeft} z`\n : _path\n})\n\nconst maskStyle = computed<CSSProperties>(() => ({\n position: 'fixed',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n zIndex: props.zIndex,\n pointerEvents: props.pos && props.targetAreaClickable ? 'none' : 'auto',\n}))\n\nconst pathStyle = computed<CSSProperties>(() => ({\n fill: props.fill,\n pointerEvents: 'auto',\n cursor: 'auto',\n}))\n\nuseLockscreen(toRef(props, 'visible'), {\n ns,\n})\n</script>\n"],"names":[],"mappings":";;;;;;mCAqBc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AAAA,EACN,YAAc,EAAA,KAAA;AAChB,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,EAAE,EAAA,EAAO,GAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAC7B,IAAA,MAAM,SAAS,QAAS,CAAA,MAAM;AAC9B,MAAM,IAAA,EAAA,EAAA,EAAA,CAAA;AACJ,MAAA,UAAU,GAAO,CAAA,EAAA,GAAA,KAAA,CAAA,GAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,KAAA,IAAA,GAAA,EAAA,GAAA,CAAA,CAAA;AACjB,KAAA,CAAA,CAAA;AACA,IAAO,MAAA,SAAA,GAAA,QAAA,CAAA,MAAA;AAAA,MAAA,gBACQ,CAAA,KAAA,CAAQ;AAAU,MAAA,iBACf,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAQ,UAAU;AAAC,MACnC,OAAA;AAAmC,QACnC,UAAY,CAAA,EAAA,YAAa,CAAA,CAAA,CAAA,EAAK,CAAC,CAAA,CAAA;AAAA,QACjC,WAAA,EAAA,CAAA,EAAA,QAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;AAAA,QACD,UAAA,EAAA,CAAA,EAAA,QAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAED,QAAM,OAAA,EAAO,WAAe,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAA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,QAAQ;AAAM,MACd,GAAe,EAAA,CAAA;AAAkD,MACjE,MAAA,EAAA,CAAA;AAEF,MAAM,MAAA,EAAA,KAAA,CAAA;AAA2C,MAC/C,aAAY,EAAA,KAAA,CAAA,GAAA,IAAA,KAAA,CAAA,mBAAA,GAAA,MAAA,GAAA,MAAA;AAAA,KAAA,CACZ,CAAe,CAAA;AAAA,IAAA,MACP,SAAA,GAAA,QAAA,CAAA,OAAA;AAAA,MACR,IAAA,EAAA,KAAA,CAAA,IAAA;AAEF,MAAc,aAAA,EAAA,MAAa;AAAY,MACrC,MAAA,EAAA,MAAA;AAAA,KACD,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tour2.mjs","sources":["../../../../../../packages/components/tour/src/tour.vue"],"sourcesContent":["<template>\n <el-teleport :to=\"appendTo\">\n <div :class=\"kls\" v-bind=\"$attrs\">\n <el-tour-mask\n :visible=\"mergedShowMask\"\n :fill=\"mergedMaskStyle?.color\"\n :style=\"mergedMaskStyle?.style\"\n :pos=\"pos\"\n :z-index=\"mergedZIndex\"\n :target-area-clickable=\"targetAreaClickable\"\n />\n <el-tour-content\n v-if=\"modelValue\"\n :key=\"current\"\n :reference=\"triggerTarget\"\n :placement=\"mergedPlacement\"\n :show-arrow=\"mergedShowArrow\"\n :z-index=\"mergedZIndex\"\n :style=\"mergedContentStyle\"\n @close=\"onEscClose\"\n >\n <el-tour-steps :current=\"current\" @update-total=\"onUpdateTotal\">\n <slot />\n </el-tour-steps>\n </el-tour-content>\n </div>\n </el-teleport>\n <!-- just for IDE -->\n <slot v-if=\"false\" name=\"indicators\" :current=\"current + 1\" :total=\"total\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, toRef, useSlots, watch } from 'vue'\nimport { useVModel } from '@vueuse/core'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport { isBoolean } from '@element-plus/utils'\nimport ElTeleport from '@element-plus/components/teleport'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport ElTourMask from './mask.vue'\nimport ElTourContent from './content.vue'\nimport ElTourSteps from './steps'\nimport { tourEmits, tourProps } from './tour'\nimport { tourKey, useTarget } from './helper'\n\nimport type { TourStepProps } from './step'\n\ndefineOptions({\n name: 'ElTour',\n})\n\nconst props = defineProps(tourProps)\nconst emit = defineEmits(tourEmits)\n\nconst ns = useNamespace('tour')\nconst total = ref(0)\nconst currentStep = ref<TourStepProps>()\n\nconst current = useVModel(props, 'current', emit, {\n passive: true,\n})\n\nconst currentTarget = computed(() => currentStep.value?.target)\n\nconst kls = computed(() => [\n ns.b(),\n mergedType.value === 'primary' ? ns.m('primary') : '',\n])\n\nconst mergedPlacement = computed(\n () => currentStep.value?.placement || props.placement\n)\n\nconst mergedContentStyle = computed(\n () => currentStep.value?.contentStyle ?? props.contentStyle\n)\n\nconst mergedMask = computed(() => currentStep.value?.mask ?? props.mask)\nconst mergedShowMask = computed(() => !!mergedMask.value && props.modelValue)\nconst mergedMaskStyle = computed(() =>\n isBoolean(mergedMask.value) ? undefined : mergedMask.value\n)\n\nconst mergedShowArrow = computed(\n () =>\n !!currentTarget.value && (currentStep.value?.showArrow ?? props.showArrow)\n)\n\nconst mergedScrollIntoViewOptions = computed(\n () => currentStep.value?.scrollIntoViewOptions ?? props.scrollIntoViewOptions\n)\nconst mergedType = computed(() => currentStep.value?.type ?? props.type)\n\nconst { nextZIndex } = useZIndex()\nconst nowZIndex = nextZIndex()\nconst mergedZIndex = computed(() => props.zIndex ?? nowZIndex)\n\nconst { mergedPosInfo: pos, triggerTarget } = useTarget(\n currentTarget,\n toRef(props, 'modelValue'),\n toRef(props, 'gap'),\n mergedMask,\n mergedScrollIntoViewOptions\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n if (!val) {\n current.value = 0\n }\n }\n)\n\nconst onEscClose = () => {\n if (props.closeOnPressEscape) {\n emit(UPDATE_MODEL_EVENT, false)\n emit('close', current.value)\n }\n}\n\nconst onUpdateTotal = (val: number) => {\n total.value = val\n}\n\nconst slots = useSlots()\n\nprovide(tourKey, {\n currentStep,\n current,\n total,\n showClose: toRef(props, 'showClose'),\n closeIcon: toRef(props, 'closeIcon')
|
|
1
|
+
{"version":3,"file":"tour2.mjs","sources":["../../../../../../packages/components/tour/src/tour.vue"],"sourcesContent":["<template>\n <el-teleport :to=\"appendTo\">\n <div :class=\"kls\" v-bind=\"$attrs\">\n <el-tour-mask\n :visible=\"mergedShowMask\"\n :fill=\"mergedMaskStyle?.color\"\n :style=\"mergedMaskStyle?.style\"\n :pos=\"pos\"\n :z-index=\"mergedZIndex\"\n :target-area-clickable=\"targetAreaClickable\"\n />\n <el-tour-content\n v-if=\"modelValue\"\n :key=\"current\"\n :reference=\"triggerTarget\"\n :placement=\"mergedPlacement\"\n :show-arrow=\"mergedShowArrow\"\n :z-index=\"mergedZIndex\"\n :style=\"mergedContentStyle\"\n @close=\"onEscClose\"\n >\n <el-tour-steps :current=\"current\" @update-total=\"onUpdateTotal\">\n <slot />\n </el-tour-steps>\n </el-tour-content>\n </div>\n </el-teleport>\n <!-- just for IDE -->\n <slot v-if=\"false\" name=\"indicators\" :current=\"current + 1\" :total=\"total\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, toRef, useSlots, watch } from 'vue'\nimport { useVModel } from '@vueuse/core'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport { isBoolean } from '@element-plus/utils'\nimport ElTeleport from '@element-plus/components/teleport'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport ElTourMask from './mask.vue'\nimport ElTourContent from './content.vue'\nimport ElTourSteps from './steps'\nimport { tourEmits, tourProps } from './tour'\nimport { tourKey, useTarget } from './helper'\n\nimport type { TourStepProps } from './step'\n\ndefineOptions({\n name: 'ElTour',\n})\n\nconst props = defineProps(tourProps)\nconst emit = defineEmits(tourEmits)\n\nconst ns = useNamespace('tour')\nconst total = ref(0)\nconst currentStep = ref<TourStepProps>()\n\nconst current = useVModel(props, 'current', emit, {\n passive: true,\n})\n\nconst currentTarget = computed(() => currentStep.value?.target)\n\nconst kls = computed(() => [\n ns.b(),\n mergedType.value === 'primary' ? ns.m('primary') : '',\n])\n\nconst mergedPlacement = computed(\n () => currentStep.value?.placement || props.placement\n)\n\nconst mergedContentStyle = computed(\n () => currentStep.value?.contentStyle ?? props.contentStyle\n)\n\nconst mergedMask = computed(() => currentStep.value?.mask ?? props.mask)\nconst mergedShowMask = computed(() => !!mergedMask.value && props.modelValue)\nconst mergedMaskStyle = computed(() =>\n isBoolean(mergedMask.value) ? undefined : mergedMask.value\n)\n\nconst mergedShowArrow = computed(\n () =>\n !!currentTarget.value && (currentStep.value?.showArrow ?? props.showArrow)\n)\n\nconst mergedScrollIntoViewOptions = computed(\n () => currentStep.value?.scrollIntoViewOptions ?? props.scrollIntoViewOptions\n)\nconst mergedType = computed(() => currentStep.value?.type ?? props.type)\n\nconst { nextZIndex } = useZIndex()\nconst nowZIndex = nextZIndex()\nconst mergedZIndex = computed(() => props.zIndex ?? nowZIndex)\n\nconst { mergedPosInfo: pos, triggerTarget } = useTarget(\n currentTarget,\n toRef(props, 'modelValue'),\n toRef(props, 'gap'),\n mergedMask,\n mergedScrollIntoViewOptions\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n if (!val) {\n current.value = 0\n }\n }\n)\n\nconst onEscClose = () => {\n if (props.closeOnPressEscape) {\n emit(UPDATE_MODEL_EVENT, false)\n emit('close', current.value)\n }\n}\n\nconst onUpdateTotal = (val: number) => {\n total.value = val\n}\n\nconst slots = useSlots()\n\nprovide(tourKey, {\n currentStep,\n current,\n total,\n showClose: toRef(props, 'showClose'),\n closeIcon: toRef(props, 'closeIcon'),\n mergedType,\n ns,\n slots,\n updateModelValue(modelValue) {\n emit(UPDATE_MODEL_EVENT, modelValue)\n },\n onClose() {\n emit('close', current.value)\n },\n onFinish()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AAEA,KAAA,CAAA;AAAiB,IACf,MAAA,aAAA,GAAA,CAAA,GAAA,KAAA;AAAA,MACA,KAAA,CAAA,KAAA,GAAA,GAAA,CAAA;AAAA,KACA,CAAA;AAAA,IACA,MAAA,KAAA,GAAiB,QAAA,EAAA,CAAA;AAAkB,IACnC,OAAA,CAAA,OAAiB,EAAA;AAAkB,MACnC,WAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,iBAAiB,KAAY,EAAA,WAAA,CAAA;AAC3B,MAAA,mCAAmC,CAAA;AAAA,MACrC,UAAA;AAAA,MACA,EAAU;AACR,MAAK,KAAA;AAAsB,MAC7B,gBAAA,CAAA,UAAA,EAAA;AAAA,QACW,IAAA,CAAA,kBAAA,EAAA,UAAA,CAAA,CAAA;AACT,OAAA;AAAa,MACf,OAAA,GAAA;AAAA,QACW,IAAA,CAAA,OAAA,EAAA,OAAA,CAAA,KAAA,CAAA,CAAA;AACT,OAAK;AAA2B,MAClC,QAAA,GAAA;AAAA,QACD,IAAA,CAAA,QAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, watch } from 'vue';
|
|
2
|
-
import { CHECKED_CHANGE_EVENT } from '../transfer-
|
|
2
|
+
import { CHECKED_CHANGE_EVENT } from '../transfer-panel.mjs';
|
|
3
3
|
import { usePropsAlias } from './use-props-alias.mjs';
|
|
4
4
|
import { isFunction } from '@vue/shared';
|
|
5
5
|
|
|
@@ -1,134 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ElInput } from '../../input/index.mjs';
|
|
4
|
-
import { Search } from '@element-plus/icons-vue';
|
|
5
|
-
import { transferPanelProps, transferPanelEmits } from './transfer-panel2.mjs';
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
-
import { usePropsAlias } from './composables/use-props-alias.mjs';
|
|
8
|
-
import { useCheck } from './composables/use-check.mjs';
|
|
9
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
10
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
11
|
-
import { isEmpty } from '../../../utils/types.mjs';
|
|
1
|
+
import { transferProps, transferCheckedChangeFn } from './transfer.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
12
3
|
|
|
13
|
-
const
|
|
14
|
-
|
|
4
|
+
const CHECKED_CHANGE_EVENT = "checked-change";
|
|
5
|
+
const transferPanelProps = buildProps({
|
|
6
|
+
data: transferProps.data,
|
|
7
|
+
optionRender: {
|
|
8
|
+
type: definePropType(Function)
|
|
9
|
+
},
|
|
10
|
+
placeholder: String,
|
|
11
|
+
title: String,
|
|
12
|
+
filterable: Boolean,
|
|
13
|
+
format: transferProps.format,
|
|
14
|
+
filterMethod: transferProps.filterMethod,
|
|
15
|
+
defaultChecked: transferProps.leftDefaultChecked,
|
|
16
|
+
props: transferProps.props
|
|
15
17
|
});
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
emits: transferPanelEmits,
|
|
20
|
-
setup(__props, { expose, emit }) {
|
|
21
|
-
const props = __props;
|
|
22
|
-
const slots = useSlots();
|
|
23
|
-
const OptionContent = ({ option }) => option;
|
|
24
|
-
const { t } = useLocale();
|
|
25
|
-
const ns = useNamespace("transfer");
|
|
26
|
-
const panelState = reactive({
|
|
27
|
-
checked: [],
|
|
28
|
-
allChecked: false,
|
|
29
|
-
query: "",
|
|
30
|
-
checkChangeByUser: true
|
|
31
|
-
});
|
|
32
|
-
const propsAlias = usePropsAlias(props);
|
|
33
|
-
const {
|
|
34
|
-
filteredData,
|
|
35
|
-
checkedSummary,
|
|
36
|
-
isIndeterminate,
|
|
37
|
-
handleAllCheckedChange
|
|
38
|
-
} = useCheck(props, panelState, emit);
|
|
39
|
-
const hasNoMatch = computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
|
|
40
|
-
const hasFooter = computed(() => !isEmpty(slots.default()[0].children));
|
|
41
|
-
const { checked, allChecked, query } = toRefs(panelState);
|
|
42
|
-
expose({
|
|
43
|
-
query
|
|
44
|
-
});
|
|
45
|
-
return (_ctx, _cache) => {
|
|
46
|
-
return openBlock(), createElementBlock("div", {
|
|
47
|
-
class: normalizeClass(unref(ns).b("panel"))
|
|
48
|
-
}, [
|
|
49
|
-
createElementVNode("p", {
|
|
50
|
-
class: normalizeClass(unref(ns).be("panel", "header"))
|
|
51
|
-
}, [
|
|
52
|
-
createVNode(unref(ElCheckbox), {
|
|
53
|
-
modelValue: unref(allChecked),
|
|
54
|
-
"onUpdate:modelValue": ($event) => isRef(allChecked) ? allChecked.value = $event : null,
|
|
55
|
-
indeterminate: unref(isIndeterminate),
|
|
56
|
-
"validate-event": false,
|
|
57
|
-
onChange: unref(handleAllCheckedChange)
|
|
58
|
-
}, {
|
|
59
|
-
default: withCtx(() => [
|
|
60
|
-
createTextVNode(toDisplayString(_ctx.title) + " ", 1),
|
|
61
|
-
createElementVNode("span", null, toDisplayString(unref(checkedSummary)), 1)
|
|
62
|
-
]),
|
|
63
|
-
_: 1
|
|
64
|
-
}, 8, ["modelValue", "onUpdate:modelValue", "indeterminate", "onChange"])
|
|
65
|
-
], 2),
|
|
66
|
-
createElementVNode("div", {
|
|
67
|
-
class: normalizeClass([unref(ns).be("panel", "body"), unref(ns).is("with-footer", unref(hasFooter))])
|
|
68
|
-
}, [
|
|
69
|
-
_ctx.filterable ? (openBlock(), createBlock(unref(ElInput), {
|
|
70
|
-
key: 0,
|
|
71
|
-
modelValue: unref(query),
|
|
72
|
-
"onUpdate:modelValue": ($event) => isRef(query) ? query.value = $event : null,
|
|
73
|
-
class: normalizeClass(unref(ns).be("panel", "filter")),
|
|
74
|
-
size: "default",
|
|
75
|
-
placeholder: _ctx.placeholder,
|
|
76
|
-
"prefix-icon": unref(Search),
|
|
77
|
-
clearable: "",
|
|
78
|
-
"validate-event": false
|
|
79
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder", "prefix-icon"])) : createCommentVNode("v-if", true),
|
|
80
|
-
withDirectives(createVNode(unref(ElCheckboxGroup), {
|
|
81
|
-
modelValue: unref(checked),
|
|
82
|
-
"onUpdate:modelValue": ($event) => isRef(checked) ? checked.value = $event : null,
|
|
83
|
-
"validate-event": false,
|
|
84
|
-
class: normalizeClass([unref(ns).is("filterable", _ctx.filterable), unref(ns).be("panel", "list")])
|
|
85
|
-
}, {
|
|
86
|
-
default: withCtx(() => [
|
|
87
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredData), (item) => {
|
|
88
|
-
return openBlock(), createBlock(unref(ElCheckbox), {
|
|
89
|
-
key: item[unref(propsAlias).key],
|
|
90
|
-
class: normalizeClass(unref(ns).be("panel", "item")),
|
|
91
|
-
value: item[unref(propsAlias).key],
|
|
92
|
-
disabled: item[unref(propsAlias).disabled],
|
|
93
|
-
"validate-event": false
|
|
94
|
-
}, {
|
|
95
|
-
default: withCtx(() => {
|
|
96
|
-
var _a;
|
|
97
|
-
return [
|
|
98
|
-
createVNode(OptionContent, {
|
|
99
|
-
option: (_a = _ctx.optionRender) == null ? void 0 : _a.call(_ctx, item)
|
|
100
|
-
}, null, 8, ["option"])
|
|
101
|
-
];
|
|
102
|
-
}),
|
|
103
|
-
_: 2
|
|
104
|
-
}, 1032, ["class", "value", "disabled"]);
|
|
105
|
-
}), 128))
|
|
106
|
-
]),
|
|
107
|
-
_: 1
|
|
108
|
-
}, 8, ["modelValue", "onUpdate:modelValue", "class"]), [
|
|
109
|
-
[vShow, !unref(hasNoMatch) && !unref(isEmpty)(_ctx.data)]
|
|
110
|
-
]),
|
|
111
|
-
withDirectives(createElementVNode("div", {
|
|
112
|
-
class: normalizeClass(unref(ns).be("panel", "empty"))
|
|
113
|
-
}, [
|
|
114
|
-
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
115
|
-
createTextVNode(toDisplayString(unref(hasNoMatch) ? unref(t)("el.transfer.noMatch") : unref(t)("el.transfer.noData")), 1)
|
|
116
|
-
])
|
|
117
|
-
], 2), [
|
|
118
|
-
[vShow, unref(hasNoMatch) || unref(isEmpty)(_ctx.data)]
|
|
119
|
-
])
|
|
120
|
-
], 2),
|
|
121
|
-
unref(hasFooter) ? (openBlock(), createElementBlock("p", {
|
|
122
|
-
key: 0,
|
|
123
|
-
class: normalizeClass(unref(ns).be("panel", "footer"))
|
|
124
|
-
}, [
|
|
125
|
-
renderSlot(_ctx.$slots, "default")
|
|
126
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
127
|
-
], 2);
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
var TransferPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "transfer-panel.vue"]]);
|
|
18
|
+
const transferPanelEmits = {
|
|
19
|
+
[CHECKED_CHANGE_EVENT]: transferCheckedChangeFn
|
|
20
|
+
};
|
|
132
21
|
|
|
133
|
-
export {
|
|
22
|
+
export { CHECKED_CHANGE_EVENT, transferPanelEmits, transferPanelProps };
|
|
134
23
|
//# sourceMappingURL=transfer-panel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer-panel.mjs","sources":["../../../../../../packages/components/transfer/src/transfer-panel.
|
|
1
|
+
{"version":3,"file":"transfer-panel.mjs","sources":["../../../../../../packages/components/transfer/src/transfer-panel.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { transferCheckedChangeFn, transferProps } from './transfer'\n\nimport type { ExtractPropTypes, VNode, __ExtractPublicPropTypes } from 'vue'\nimport type { TransferDataItem, TransferKey } from './transfer'\nimport type TransferPanel from './transfer-panel.vue'\n\nexport interface TransferPanelState {\n checked: TransferKey[]\n allChecked: boolean\n query: string\n checkChangeByUser: boolean\n}\n\nexport const CHECKED_CHANGE_EVENT = 'checked-change'\n\nexport const transferPanelProps = buildProps({\n data: transferProps.data,\n optionRender: {\n type: definePropType<(option: TransferDataItem) => VNode | VNode[]>(\n Function\n ),\n },\n placeholder: String,\n title: String,\n filterable: Boolean,\n format: transferProps.format,\n filterMethod: transferProps.filterMethod,\n defaultChecked: transferProps.leftDefaultChecked,\n props: transferProps.props,\n} as const)\nexport type TransferPanelProps = ExtractPropTypes<typeof transferPanelProps>\nexport type TransferPanelPropsPublic = __ExtractPublicPropTypes<\n typeof transferPanelProps\n>\n\nexport const transferPanelEmits = {\n [CHECKED_CHANGE_EVENT]: transferCheckedChangeFn,\n}\nexport type TransferPanelEmits = typeof transferPanelEmits\n\nexport type TransferPanelInstance = InstanceType<typeof TransferPanel> & unknown\n"],"names":[],"mappings":";;;AAEY,MAAC,oBAAoB,GAAG,iBAAiB;AACzC,MAAC,kBAAkB,GAAG,UAAU,CAAC;AAC7C,EAAE,IAAI,EAAE,aAAa,CAAC,IAAI;AAC1B,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,UAAU,EAAE,OAAO;AACrB,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM;AAC9B,EAAE,YAAY,EAAE,aAAa,CAAC,YAAY;AAC1C,EAAE,cAAc,EAAE,aAAa,CAAC,kBAAkB;AAClD,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK;AAC5B,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG;AAClC,EAAE,CAAC,oBAAoB,GAAG,uBAAuB;AACjD;;;;"}
|
|
@@ -1,23 +1,134 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, useSlots, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createVNode, isRef, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, withDirectives, Fragment, renderList, vShow, renderSlot } from 'vue';
|
|
2
|
+
import { ElCheckbox, ElCheckboxGroup } from '../../checkbox/index.mjs';
|
|
3
|
+
import { ElInput } from '../../input/index.mjs';
|
|
4
|
+
import { Search } from '@element-plus/icons-vue';
|
|
5
|
+
import { transferPanelProps, transferPanelEmits } from './transfer-panel.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { usePropsAlias } from './composables/use-props-alias.mjs';
|
|
8
|
+
import { useCheck } from './composables/use-check.mjs';
|
|
9
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
10
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
11
|
+
import { isEmpty } from '../../../utils/types.mjs';
|
|
3
12
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
data: transferProps.data,
|
|
7
|
-
optionRender: {
|
|
8
|
-
type: definePropType(Function)
|
|
9
|
-
},
|
|
10
|
-
placeholder: String,
|
|
11
|
-
title: String,
|
|
12
|
-
filterable: Boolean,
|
|
13
|
-
format: transferProps.format,
|
|
14
|
-
filterMethod: transferProps.filterMethod,
|
|
15
|
-
defaultChecked: transferProps.leftDefaultChecked,
|
|
16
|
-
props: transferProps.props
|
|
13
|
+
const __default__ = defineComponent({
|
|
14
|
+
name: "ElTransferPanel"
|
|
17
15
|
});
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: transferPanelProps,
|
|
19
|
+
emits: transferPanelEmits,
|
|
20
|
+
setup(__props, { expose, emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const slots = useSlots();
|
|
23
|
+
const OptionContent = ({ option }) => option;
|
|
24
|
+
const { t } = useLocale();
|
|
25
|
+
const ns = useNamespace("transfer");
|
|
26
|
+
const panelState = reactive({
|
|
27
|
+
checked: [],
|
|
28
|
+
allChecked: false,
|
|
29
|
+
query: "",
|
|
30
|
+
checkChangeByUser: true
|
|
31
|
+
});
|
|
32
|
+
const propsAlias = usePropsAlias(props);
|
|
33
|
+
const {
|
|
34
|
+
filteredData,
|
|
35
|
+
checkedSummary,
|
|
36
|
+
isIndeterminate,
|
|
37
|
+
handleAllCheckedChange
|
|
38
|
+
} = useCheck(props, panelState, emit);
|
|
39
|
+
const hasNoMatch = computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
|
|
40
|
+
const hasFooter = computed(() => !isEmpty(slots.default()[0].children));
|
|
41
|
+
const { checked, allChecked, query } = toRefs(panelState);
|
|
42
|
+
expose({
|
|
43
|
+
query
|
|
44
|
+
});
|
|
45
|
+
return (_ctx, _cache) => {
|
|
46
|
+
return openBlock(), createElementBlock("div", {
|
|
47
|
+
class: normalizeClass(unref(ns).b("panel"))
|
|
48
|
+
}, [
|
|
49
|
+
createElementVNode("p", {
|
|
50
|
+
class: normalizeClass(unref(ns).be("panel", "header"))
|
|
51
|
+
}, [
|
|
52
|
+
createVNode(unref(ElCheckbox), {
|
|
53
|
+
modelValue: unref(allChecked),
|
|
54
|
+
"onUpdate:modelValue": ($event) => isRef(allChecked) ? allChecked.value = $event : null,
|
|
55
|
+
indeterminate: unref(isIndeterminate),
|
|
56
|
+
"validate-event": false,
|
|
57
|
+
onChange: unref(handleAllCheckedChange)
|
|
58
|
+
}, {
|
|
59
|
+
default: withCtx(() => [
|
|
60
|
+
createTextVNode(toDisplayString(_ctx.title) + " ", 1),
|
|
61
|
+
createElementVNode("span", null, toDisplayString(unref(checkedSummary)), 1)
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "indeterminate", "onChange"])
|
|
65
|
+
], 2),
|
|
66
|
+
createElementVNode("div", {
|
|
67
|
+
class: normalizeClass([unref(ns).be("panel", "body"), unref(ns).is("with-footer", unref(hasFooter))])
|
|
68
|
+
}, [
|
|
69
|
+
_ctx.filterable ? (openBlock(), createBlock(unref(ElInput), {
|
|
70
|
+
key: 0,
|
|
71
|
+
modelValue: unref(query),
|
|
72
|
+
"onUpdate:modelValue": ($event) => isRef(query) ? query.value = $event : null,
|
|
73
|
+
class: normalizeClass(unref(ns).be("panel", "filter")),
|
|
74
|
+
size: "default",
|
|
75
|
+
placeholder: _ctx.placeholder,
|
|
76
|
+
"prefix-icon": unref(Search),
|
|
77
|
+
clearable: "",
|
|
78
|
+
"validate-event": false
|
|
79
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder", "prefix-icon"])) : createCommentVNode("v-if", true),
|
|
80
|
+
withDirectives(createVNode(unref(ElCheckboxGroup), {
|
|
81
|
+
modelValue: unref(checked),
|
|
82
|
+
"onUpdate:modelValue": ($event) => isRef(checked) ? checked.value = $event : null,
|
|
83
|
+
"validate-event": false,
|
|
84
|
+
class: normalizeClass([unref(ns).is("filterable", _ctx.filterable), unref(ns).be("panel", "list")])
|
|
85
|
+
}, {
|
|
86
|
+
default: withCtx(() => [
|
|
87
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredData), (item) => {
|
|
88
|
+
return openBlock(), createBlock(unref(ElCheckbox), {
|
|
89
|
+
key: item[unref(propsAlias).key],
|
|
90
|
+
class: normalizeClass(unref(ns).be("panel", "item")),
|
|
91
|
+
value: item[unref(propsAlias).key],
|
|
92
|
+
disabled: item[unref(propsAlias).disabled],
|
|
93
|
+
"validate-event": false
|
|
94
|
+
}, {
|
|
95
|
+
default: withCtx(() => {
|
|
96
|
+
var _a;
|
|
97
|
+
return [
|
|
98
|
+
createVNode(OptionContent, {
|
|
99
|
+
option: (_a = _ctx.optionRender) == null ? void 0 : _a.call(_ctx, item)
|
|
100
|
+
}, null, 8, ["option"])
|
|
101
|
+
];
|
|
102
|
+
}),
|
|
103
|
+
_: 2
|
|
104
|
+
}, 1032, ["class", "value", "disabled"]);
|
|
105
|
+
}), 128))
|
|
106
|
+
]),
|
|
107
|
+
_: 1
|
|
108
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "class"]), [
|
|
109
|
+
[vShow, !unref(hasNoMatch) && !unref(isEmpty)(_ctx.data)]
|
|
110
|
+
]),
|
|
111
|
+
withDirectives(createElementVNode("div", {
|
|
112
|
+
class: normalizeClass(unref(ns).be("panel", "empty"))
|
|
113
|
+
}, [
|
|
114
|
+
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
115
|
+
createTextVNode(toDisplayString(unref(hasNoMatch) ? unref(t)("el.transfer.noMatch") : unref(t)("el.transfer.noData")), 1)
|
|
116
|
+
])
|
|
117
|
+
], 2), [
|
|
118
|
+
[vShow, unref(hasNoMatch) || unref(isEmpty)(_ctx.data)]
|
|
119
|
+
])
|
|
120
|
+
], 2),
|
|
121
|
+
unref(hasFooter) ? (openBlock(), createElementBlock("p", {
|
|
122
|
+
key: 0,
|
|
123
|
+
class: normalizeClass(unref(ns).be("panel", "footer"))
|
|
124
|
+
}, [
|
|
125
|
+
renderSlot(_ctx.$slots, "default")
|
|
126
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
127
|
+
], 2);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
var TransferPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "transfer-panel.vue"]]);
|
|
21
132
|
|
|
22
|
-
export {
|
|
133
|
+
export { TransferPanel as default };
|
|
23
134
|
//# sourceMappingURL=transfer-panel2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer-panel2.mjs","sources":["../../../../../../packages/components/transfer/src/transfer-panel.
|
|
1
|
+
{"version":3,"file":"transfer-panel2.mjs","sources":["../../../../../../packages/components/transfer/src/transfer-panel.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b('panel')\">\n <p :class=\"ns.be('panel', 'header')\">\n <el-checkbox\n v-model=\"allChecked\"\n :indeterminate=\"isIndeterminate\"\n :validate-event=\"false\"\n @change=\"handleAllCheckedChange\"\n >\n {{ title }}\n <span>{{ checkedSummary }}</span>\n </el-checkbox>\n </p>\n\n <div :class=\"[ns.be('panel', 'body'), ns.is('with-footer', hasFooter)]\">\n <el-input\n v-if=\"filterable\"\n v-model=\"query\"\n :class=\"ns.be('panel', 'filter')\"\n size=\"default\"\n :placeholder=\"placeholder\"\n :prefix-icon=\"Search\"\n clearable\n :validate-event=\"false\"\n />\n <el-checkbox-group\n v-show=\"!hasNoMatch && !isEmpty(data)\"\n v-model=\"checked\"\n :validate-event=\"false\"\n :class=\"[ns.is('filterable', filterable), ns.be('panel', 'list')]\"\n >\n <el-checkbox\n v-for=\"item in filteredData\"\n :key=\"item[propsAlias.key]\"\n :class=\"ns.be('panel', 'item')\"\n :value=\"item[propsAlias.key]\"\n :disabled=\"item[propsAlias.disabled]\"\n :validate-event=\"false\"\n >\n <option-content :option=\"optionRender?.(item)\" />\n </el-checkbox>\n </el-checkbox-group>\n <div\n v-show=\"hasNoMatch || isEmpty(data)\"\n :class=\"ns.be('panel', 'empty')\"\n >\n <slot name=\"empty\">\n {{ hasNoMatch ? t('el.transfer.noMatch') : t('el.transfer.noData') }}\n </slot>\n </div>\n </div>\n <p v-if=\"hasFooter\" :class=\"ns.be('panel', 'footer')\">\n <slot />\n </p>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, reactive, toRefs, useSlots } from 'vue'\nimport { isEmpty } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { ElCheckbox, ElCheckboxGroup } from '@element-plus/components/checkbox'\nimport { ElInput } from '@element-plus/components/input'\nimport { Search } from '@element-plus/icons-vue'\nimport { transferPanelEmits, transferPanelProps } from './transfer-panel'\nimport { useCheck, usePropsAlias } from './composables'\n\nimport type { VNode } from 'vue'\nimport type { TransferPanelState } from './transfer-panel'\n\ndefineOptions({\n name: 'ElTransferPanel',\n})\n\nconst props = defineProps(transferPanelProps)\nconst emit = defineEmits(transferPanelEmits)\nconst slots = useSlots()\n\nconst OptionContent = ({ option }: { option?: VNode | VNode[] }) => option\n\nconst { t } = useLocale()\nconst ns = useNamespace('transfer')\n\nconst panelState = reactive<TransferPanelState>({\n checked: [],\n allChecked: false,\n query: '',\n checkChangeByUser: true,\n})\n\nconst propsAlias = usePropsAlias(props)\n\nconst {\n filteredData,\n checkedSummary,\n isIndeterminate,\n handleAllCheckedChange,\n} = useCheck(props, panelState, emit)\n\nconst hasNoMatch = computed(\n () => !isEmpty(panelState.query) && isEmpty(filteredData.value)\n)\n\nconst hasFooter = computed(() => !isEmpty(slots.default!()[0].children))\n\nconst { checked, allChecked, query } = toRefs(panelState)\n\ndefineExpose({\n /** @description filter keyword */\n query,\n})\n</script>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_unref"],"mappings":";;;;;;;;;;;;mCAsEc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,aAAgB,GAAA,CAAC,EAAE,MAAA,EAA2C,KAAA,MAAA,CAAA;AAEpE,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAElC,IAAA,MAAM,aAAa,QAA6B,CAAA;AAAA,MAC9C,SAAS,EAAC;AAAA,MACV,UAAY,EAAA,KAAA;AAAA,MACZ,KAAO,EAAA,EAAA;AAAA,MACP,iBAAmB,EAAA,IAAA;AAAA,KACpB,CAAA,CAAA;AAED,IAAM,MAAA,UAAA,GAAa,cAAc,KAAK,CAAA,CAAA;AAEtC,IAAM,MAAA;AAAA,MACJ,YAAA;AAAA,MACA,cAAA;AAAA,MACA,eAAA;AAAA,MACA,sBAAA;AAAA,KACE,GAAA,QAAA,CAAS,KAAO,EAAA,UAAA,EAAY,IAAI,CAAA,CAAA;AAEpC,IAAA,MAAM,UAAa,GAAA,QAAA,CAAA,MAAA,CAAA,OAAA,CAAA,UAAA,CAAA,KAAA,CAAA,IAAA,OAAA,CAAA,YAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA,IACjB,MAAA,SAAe,GAAA,QAAA,CAAA,MAAgB,CAAK,OAAA,CAAA,iBAAqB,CAAK,CAAA,QAAA,CAAA,CAAA,CAAA;AAAA,IAChE,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,KAAA,EAAA,GAAA,MAAA,CAAA,UAAA,CAAA,CAAA;AAEA,IAAM,MAAA,CAAA;AAEN,MAAA;AAEA,KAAa,CAAA,CAAA;AAAA,IAAA,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MAEX,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;AAAA,QACD,KAAA,EAAAC,cAAA,CAAAC,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import { ElButton } from '../../button/index.mjs';
|
|
|
3
3
|
import { ElIcon } from '../../icon/index.mjs';
|
|
4
4
|
import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
|
|
5
5
|
import { transferProps, transferEmits } from './transfer.mjs';
|
|
6
|
-
import TransferPanel from './transfer-
|
|
6
|
+
import TransferPanel from './transfer-panel2.mjs';
|
|
7
7
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
8
|
import { useComputedData } from './composables/use-computed-data.mjs';
|
|
9
9
|
import { useMove } from './composables/use-move.mjs';
|
|
@@ -4,4 +4,4 @@ export declare const FontGap = 3;
|
|
|
4
4
|
* Get the clips of text content.
|
|
5
5
|
* This is a lazy hook function since SSR no need this
|
|
6
6
|
*/
|
|
7
|
-
export default function useClips(): (content: NonNullable<WatermarkProps["content"]> | HTMLImageElement, rotate: number, ratio: number, width: number, height: number, font: Required<NonNullable<WatermarkProps["font"]>>, gapX: number, gapY: number) => [dataURL: string, finalWidth: number, finalHeight: number];
|
|
7
|
+
export default function useClips(): (content: NonNullable<WatermarkProps["content"]> | HTMLImageElement, rotate: number, ratio: number, width: number, height: number, font: Required<NonNullable<WatermarkProps["font"]>>, gapX: number, gapY: number, space: number) => [dataURL: string, finalWidth: number, finalHeight: number];
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { isArray } from '@vue/shared';
|
|
2
2
|
|
|
3
3
|
const FontGap = 3;
|
|
4
|
+
const TEXT_ALIGN_RATIO_MAP = {
|
|
5
|
+
left: [0, 0.5],
|
|
6
|
+
start: [0, 0.5],
|
|
7
|
+
center: [0.5, 0],
|
|
8
|
+
right: [1, -0.5],
|
|
9
|
+
end: [1, -0.5]
|
|
10
|
+
};
|
|
4
11
|
function prepareCanvas(width, height, ratio = 1) {
|
|
5
12
|
const canvas = document.createElement("canvas");
|
|
6
13
|
const ctx = canvas.getContext("2d");
|
|
@@ -12,7 +19,7 @@ function prepareCanvas(width, height, ratio = 1) {
|
|
|
12
19
|
return [ctx, canvas, realWidth, realHeight];
|
|
13
20
|
}
|
|
14
21
|
function useClips() {
|
|
15
|
-
function getClips(content, rotate, ratio, width, height, font, gapX, gapY) {
|
|
22
|
+
function getClips(content, rotate, ratio, width, height, font, gapX, gapY, space) {
|
|
16
23
|
const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(width, height, ratio);
|
|
17
24
|
if (content instanceof HTMLImageElement) {
|
|
18
25
|
ctx.drawImage(content, 0, 0, contentWidth, contentHeight);
|
|
@@ -33,7 +40,8 @@ function useClips() {
|
|
|
33
40
|
ctx.textBaseline = textBaseline;
|
|
34
41
|
const contents = isArray(content) ? content : [content];
|
|
35
42
|
contents == null ? void 0 : contents.forEach((item, index) => {
|
|
36
|
-
|
|
43
|
+
const [alignRatio, spaceRatio] = TEXT_ALIGN_RATIO_MAP[textAlign];
|
|
44
|
+
ctx.fillText(item != null ? item : "", contentWidth * alignRatio + space * spaceRatio, index * (mergedFontSize + FontGap * ratio));
|
|
37
45
|
});
|
|
38
46
|
}
|
|
39
47
|
const angle = Math.PI / 180 * Number(rotate);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClips.mjs","sources":["../../../../../../packages/components/watermark/src/useClips.ts"],"sourcesContent":["import { isArray } from '@element-plus/utils'\n\nimport type { WatermarkProps } from './watermark'\n\nexport const FontGap = 3\n\nfunction prepareCanvas(\n width: number,\n height: number,\n ratio = 1\n): [\n ctx: CanvasRenderingContext2D,\n canvas: HTMLCanvasElement,\n realWidth: number,\n realHeight: number\n] {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')!\n const realWidth = width * ratio\n const realHeight = height * ratio\n canvas.setAttribute('width', `${realWidth}px`)\n canvas.setAttribute('height', `${realHeight}px`)\n ctx.save()\n\n return [ctx, canvas, realWidth, realHeight]\n}\n\n/**\n * Get the clips of text content.\n * This is a lazy hook function since SSR no need this\n */\nexport default function useClips() {\n // Get single clips\n function getClips(\n content: NonNullable<WatermarkProps['content']> | HTMLImageElement,\n rotate: number,\n ratio: number,\n width: number,\n height: number,\n font: Required<NonNullable<WatermarkProps['font']>>,\n gapX: number,\n gapY: number\n ): [dataURL: string, finalWidth: number, finalHeight: number] {\n // ================= Text / Image =================\n const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(\n width,\n height,\n ratio\n )\n\n if (content instanceof HTMLImageElement) {\n // Image\n ctx.drawImage(content, 0, 0, contentWidth, contentHeight)\n } else {\n // Text\n const {\n color,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n textAlign,\n textBaseline,\n } = font\n const mergedFontSize = Number(fontSize) * ratio\n\n ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`\n ctx.fillStyle = color\n ctx.textAlign = textAlign\n ctx.textBaseline = textBaseline\n const contents = isArray(content) ? content : [content]\n contents?.forEach((item, index) => {\n ctx.fillText(\n item ?? '',\n contentWidth
|
|
1
|
+
{"version":3,"file":"useClips.mjs","sources":["../../../../../../packages/components/watermark/src/useClips.ts"],"sourcesContent":["import { isArray } from '@element-plus/utils'\n\nimport type { WatermarkProps } from './watermark'\n\nexport const FontGap = 3\n\n// [alignRatio, spaceRatio]\nconst TEXT_ALIGN_RATIO_MAP = {\n left: [0, 0.5],\n start: [0, 0.5],\n center: [0.5, 0],\n right: [1, -0.5],\n end: [1, -0.5],\n} as const\n\nfunction prepareCanvas(\n width: number,\n height: number,\n ratio = 1\n): [\n ctx: CanvasRenderingContext2D,\n canvas: HTMLCanvasElement,\n realWidth: number,\n realHeight: number\n] {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')!\n const realWidth = width * ratio\n const realHeight = height * ratio\n canvas.setAttribute('width', `${realWidth}px`)\n canvas.setAttribute('height', `${realHeight}px`)\n ctx.save()\n\n return [ctx, canvas, realWidth, realHeight]\n}\n\n/**\n * Get the clips of text content.\n * This is a lazy hook function since SSR no need this\n */\nexport default function useClips() {\n // Get single clips\n function getClips(\n content: NonNullable<WatermarkProps['content']> | HTMLImageElement,\n rotate: number,\n ratio: number,\n width: number,\n height: number,\n font: Required<NonNullable<WatermarkProps['font']>>,\n gapX: number,\n gapY: number,\n space: number\n ): [dataURL: string, finalWidth: number, finalHeight: number] {\n // ================= Text / Image =================\n const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(\n width,\n height,\n ratio\n )\n\n if (content instanceof HTMLImageElement) {\n // Image\n ctx.drawImage(content, 0, 0, contentWidth, contentHeight)\n } else {\n // Text\n const {\n color,\n fontSize,\n fontStyle,\n fontWeight,\n fontFamily,\n textAlign,\n textBaseline,\n } = font\n const mergedFontSize = Number(fontSize) * ratio\n\n ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`\n ctx.fillStyle = color\n ctx.textAlign = textAlign\n ctx.textBaseline = textBaseline\n const contents = isArray(content) ? content : [content]\n contents?.forEach((item, index) => {\n const [alignRatio, spaceRatio] = TEXT_ALIGN_RATIO_MAP[textAlign]\n ctx.fillText(\n item ?? '',\n contentWidth * alignRatio + space * spaceRatio,\n index * (mergedFontSize + FontGap * ratio)\n )\n })\n }\n\n // ==================== Rotate ====================\n const angle = (Math.PI / 180) * Number(rotate)\n const maxSize = Math.max(width, height)\n const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio)\n\n // Copy from `ctx` and rotate\n rCtx.translate(realMaxSize / 2, realMaxSize / 2)\n rCtx.rotate(angle)\n if (contentWidth > 0 && contentHeight > 0) {\n rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2)\n }\n\n // Get boundary of rotated text\n function getRotatePos(x: number, y: number) {\n const targetX = x * Math.cos(angle) - y * Math.sin(angle)\n const targetY = x * Math.sin(angle) + y * Math.cos(angle)\n return [targetX, targetY]\n }\n\n let left = 0\n let right = 0\n let top = 0\n let bottom = 0\n\n const halfWidth = contentWidth / 2\n const halfHeight = contentHeight / 2\n const points = [\n [0 - halfWidth, 0 - halfHeight],\n [0 + halfWidth, 0 - halfHeight],\n [0 + halfWidth, 0 + halfHeight],\n [0 - halfWidth, 0 + halfHeight],\n ]\n points.forEach(([x, y]) => {\n const [targetX, targetY] = getRotatePos(x, y)\n left = Math.min(left, targetX)\n right = Math.max(right, targetX)\n top = Math.min(top, targetY)\n bottom = Math.max(bottom, targetY)\n })\n\n const cutLeft = left + realMaxSize / 2\n const cutTop = top + realMaxSize / 2\n const cutWidth = right - left\n const cutHeight = bottom - top\n\n // ================ Fill Alternate ================\n const realGapX = gapX * ratio\n const realGapY = gapY * ratio\n const filledWidth = (cutWidth + realGapX) * 2\n const filledHeight = cutHeight + realGapY\n\n const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight)\n\n function drawImg(targetX = 0, targetY = 0) {\n fCtx.drawImage(\n rCanvas,\n cutLeft,\n cutTop,\n cutWidth,\n cutHeight,\n targetX,\n targetY,\n cutWidth,\n cutHeight\n )\n }\n drawImg()\n drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2)\n drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2)\n\n return [fCanvas.toDataURL(), filledWidth / ratio, filledHeight / ratio]\n }\n\n return getClips\n}\n"],"names":[],"mappings":";;AACY,MAAC,OAAO,GAAG,EAAE;AACzB,MAAM,oBAAoB,GAAG;AAC7B,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;AAChB,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;AACjB,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;AAClB,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC;AAClB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC;AAChB,CAAC,CAAC;AACF,SAAS,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE;AACjD,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAClD,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACtC,EAAE,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AAClC,EAAE,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AACpC,EAAE,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;AACjD,EAAE,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AACnD,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;AACb,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC9C,CAAC;AACc,S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}
|
|
@@ -111,6 +111,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
111
|
const getMarkSize = (ctx) => {
|
|
112
112
|
let defaultWidth = 120;
|
|
113
113
|
let defaultHeight = 64;
|
|
114
|
+
let space = 0;
|
|
114
115
|
const { image, content, width, height, rotate } = props;
|
|
115
116
|
if (!image && ctx.measureText) {
|
|
116
117
|
ctx.font = `${Number(fontSize.value)}px ${fontFamily.value}`;
|
|
@@ -134,10 +135,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
134
135
|
defaultWidth = maxWidth;
|
|
135
136
|
defaultHeight = maxHeight * contents.length + (contents.length - 1) * FontGap;
|
|
136
137
|
const angle = Math.PI / 180 * Number(rotate);
|
|
137
|
-
|
|
138
|
+
space = Math.ceil(Math.abs(Math.sin(angle) * defaultHeight) / 2);
|
|
138
139
|
defaultWidth += space;
|
|
139
140
|
}
|
|
140
|
-
return [width != null ? width : defaultWidth, height != null ? height : defaultHeight];
|
|
141
|
+
return [width != null ? width : defaultWidth, height != null ? height : defaultHeight, space];
|
|
141
142
|
};
|
|
142
143
|
const getClips = useClips();
|
|
143
144
|
const renderWatermark = () => {
|
|
@@ -151,7 +152,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
151
152
|
watermarkRef.value = document.createElement("div");
|
|
152
153
|
}
|
|
153
154
|
const ratio = getPixelRatio();
|
|
154
|
-
const [markWidth, markHeight] = getMarkSize(ctx);
|
|
155
|
+
const [markWidth, markHeight, space] = getMarkSize(ctx);
|
|
155
156
|
const drawCanvas = (drawContent) => {
|
|
156
157
|
const [textClips, clipWidth] = getClips(drawContent || "", rotate, ratio, markWidth, markHeight, {
|
|
157
158
|
color: color.value,
|
|
@@ -161,7 +162,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
161
162
|
fontFamily: fontFamily.value,
|
|
162
163
|
textAlign: textAlign.value,
|
|
163
164
|
textBaseline: textBaseline.value
|
|
164
|
-
}, gapX.value, gapY.value);
|
|
165
|
+
}, gapX.value, gapY.value, space);
|
|
165
166
|
appendWatermark(textClips, clipWidth);
|
|
166
167
|
};
|
|
167
168
|
if (image) {
|