@element-plus/nightly 0.0.20251119 → 0.0.20251120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +17 -5
- package/dist/index.full.min.js +8 -8
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +17 -5
- 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/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +24 -129
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +129 -24
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +40 -96
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +96 -40
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/anchor/index.mjs +2 -2
- package/es/components/anchor/src/anchor.mjs +40 -207
- package/es/components/anchor/src/anchor.mjs.map +1 -1
- package/es/components/anchor/src/anchor2.mjs +207 -40
- package/es/components/anchor/src/anchor2.mjs.map +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +31 -65
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +65 -31
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/backtop/index.mjs +2 -2
- package/es/components/backtop/src/backtop.mjs +21 -53
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +53 -21
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +1 -1
- package/es/components/calendar/src/date-table.mjs +31 -89
- package/es/components/calendar/src/date-table.mjs.map +1 -1
- package/es/components/calendar/src/date-table2.mjs +89 -31
- package/es/components/calendar/src/date-table2.mjs.map +1 -1
- package/es/components/calendar/src/use-date-table.mjs +1 -1
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +14 -37
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +37 -14
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/image/index.mjs +2 -2
- package/es/components/image/src/image.mjs +69 -234
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +234 -69
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/index.mjs +12 -12
- package/es/components/mention/src/mention-dropdown.mjs +15 -166
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +166 -15
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +97 -16
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +16 -97
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +135 -50
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +50 -135
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-group.mjs +51 -86
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +86 -51
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/select/src/useSelect.mjs +8 -2
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/src/useSelect.mjs +7 -1
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +225 -72
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +72 -225
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/components/tooltip/src/trigger.mjs +16 -81
- package/es/components/tooltip/src/trigger.mjs.map +1 -1
- package/es/components/tooltip/src/trigger2.mjs +81 -16
- package/es/components/tooltip/src/trigger2.mjs.map +1 -1
- package/es/index.mjs +12 -12
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +25 -129
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +129 -25
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +41 -95
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +95 -41
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/anchor/index.js +2 -2
- package/lib/components/anchor/src/anchor.js +40 -206
- package/lib/components/anchor/src/anchor.js.map +1 -1
- package/lib/components/anchor/src/anchor2.js +206 -40
- package/lib/components/anchor/src/anchor2.js.map +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +32 -65
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +65 -32
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/backtop/index.js +2 -2
- package/lib/components/backtop/src/backtop.js +22 -53
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +53 -22
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +1 -1
- package/lib/components/calendar/src/date-table.js +35 -89
- package/lib/components/calendar/src/date-table.js.map +1 -1
- package/lib/components/calendar/src/date-table2.js +89 -35
- package/lib/components/calendar/src/date-table2.js.map +1 -1
- package/lib/components/calendar/src/use-date-table.js +1 -1
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +15 -37
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +37 -15
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/image/index.js +2 -2
- package/lib/components/image/src/image.js +69 -233
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/image/src/image2.js +233 -69
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/index.js +12 -12
- package/lib/components/mention/src/mention-dropdown.js +16 -166
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +166 -16
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +97 -17
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +17 -97
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +135 -51
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +51 -135
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-group.js +53 -86
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +86 -53
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/select/src/useSelect.js +8 -2
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.js +7 -1
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +224 -72
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +72 -224
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/tooltip/index.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/components/tooltip/src/trigger.js +16 -81
- package/lib/components/tooltip/src/trigger.js.map +1 -1
- package/lib/components/tooltip/src/trigger2.js +81 -16
- package/lib/components/tooltip/src/trigger2.js.map +1 -1
- package/lib/index.js +12 -12
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch2.mjs","sources":["../../../../../../packages/components/switch/src/switch.vue"],"sourcesContent":["<template>\n <div :class=\"switchKls\" @click.prevent=\"switchValue\">\n <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"ns.e('input')\"\n type=\"checkbox\"\n role=\"switch\"\n :aria-checked=\"checked\"\n :aria-disabled=\"switchDisabled\"\n :aria-label=\"ariaLabel\"\n :name=\"name\"\n :true-value=\"activeValue\"\n :false-value=\"inactiveValue\"\n :disabled=\"switchDisabled\"\n :tabindex=\"tabindex\"\n @change=\"handleChange\"\n @keydown.enter=\"switchValue\"\n />\n <span\n v-if=\"!inlinePrompt && (inactiveIcon || inactiveText)\"\n :class=\"labelLeftKls\"\n >\n <el-icon v-if=\"inactiveIcon\">\n <component :is=\"inactiveIcon\" />\n </el-icon>\n <span v-if=\"!inactiveIcon && inactiveText\" :aria-hidden=\"checked\">{{\n inactiveText\n }}</span>\n </span>\n <span :class=\"ns.e('core')\" :style=\"coreStyle\">\n <div v-if=\"inlinePrompt\" :class=\"ns.e('inner')\">\n <template v-if=\"activeIcon || inactiveIcon\">\n <el-icon :class=\"ns.is('icon')\">\n <component :is=\"checked ? activeIcon : inactiveIcon\" />\n </el-icon>\n </template>\n <template v-else-if=\"activeText || inactiveText\">\n <span :class=\"ns.is('text')\" :aria-hidden=\"!checked\">\n {{ checked ? activeText : inactiveText }}\n </span>\n </template>\n </div>\n <div :class=\"ns.e('action')\">\n <el-icon v-if=\"loading\" :class=\"ns.is('loading')\">\n <loading />\n </el-icon>\n <slot v-else-if=\"checked\" name=\"active-action\">\n <el-icon v-if=\"activeActionIcon\">\n <component :is=\"activeActionIcon\" />\n </el-icon>\n </slot>\n <slot v-else-if=\"!checked\" name=\"inactive-action\">\n <el-icon v-if=\"inactiveActionIcon\">\n <component :is=\"inactiveActionIcon\" />\n </el-icon>\n </slot>\n </div>\n </span>\n <span\n v-if=\"!inlinePrompt && (activeIcon || activeText)\"\n :class=\"labelRightKls\"\n >\n <el-icon v-if=\"activeIcon\">\n <component :is=\"activeIcon\" />\n </el-icon>\n <span v-if=\"!activeIcon && activeText\" :aria-hidden=\"!checked\">{{\n activeText\n }}</span>\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, nextTick, onMounted, ref, shallowRef, watch } from 'vue'\nimport {\n addUnit,\n debugWarn,\n isBoolean,\n isPromise,\n throwError,\n} from '@element-plus/utils'\nimport ElIcon from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { Loading } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport { switchEmits, switchProps } from './switch'\n\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElSwitch'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(switchProps)\nconst emit = defineEmits(switchEmits)\n\nconst { formItem } = useFormItem()\nconst switchSize = useFormSize()\nconst ns = useNamespace('switch')\n\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst switchDisabled = useFormDisabled(computed(() => props.loading))\nconst isControlled = ref(props.modelValue !== false)\nconst input = shallowRef<HTMLInputElement>()\n\nconst switchKls = computed(() => [\n ns.b(),\n ns.m(switchSize.value),\n ns.is('disabled', switchDisabled.value),\n ns.is('checked', checked.value),\n])\n\nconst labelLeftKls = computed(() => [\n ns.e('label'),\n ns.em('label', 'left'),\n ns.is('active', !checked.value),\n])\n\nconst labelRightKls = computed(() => [\n ns.e('label'),\n ns.em('label', 'right'),\n ns.is('active', checked.value),\n])\n\nconst coreStyle = computed<CSSProperties>(() => ({\n width: addUnit(props.width),\n}))\n\nwatch(\n () => props.modelValue,\n () => {\n isControlled.value = true\n }\n)\n\nconst actualValue = computed(() => {\n return isControlled.value ? props.modelValue : false\n})\n\nconst checked = computed(() => actualValue.value === props.activeValue)\n\nif (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {\n emit(UPDATE_MODEL_EVENT, props.inactiveValue)\n emit(CHANGE_EVENT, props.inactiveValue)\n emit(INPUT_EVENT, props.inactiveValue)\n}\n\nwatch(checked, (val) => {\n input.value!.checked = val\n\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n})\n\nconst handleChange = () => {\n const val = checked.value ? props.inactiveValue : props.activeValue\n emit(UPDATE_MODEL_EVENT, val)\n emit(CHANGE_EVENT, val)\n emit(INPUT_EVENT, val)\n nextTick(() => {\n input.value!.checked = checked.value\n })\n}\n\nconst switchValue = () => {\n if (switchDisabled.value) return\n\n const { beforeChange } = props\n if (!beforeChange) {\n handleChange()\n return\n }\n\n const shouldChange = beforeChange()\n\n const isPromiseOrBool = [\n isPromise(shouldChange),\n isBoolean(shouldChange),\n ].includes(true)\n if (!isPromiseOrBool) {\n throwError(\n COMPONENT_NAME,\n 'beforeChange must return type `Promise<boolean>` or `boolean`'\n )\n }\n\n if (isPromise(shouldChange)) {\n shouldChange\n .then((result) => {\n if (result) {\n handleChange()\n }\n })\n .catch((e) => {\n debugWarn(COMPONENT_NAME, `some error occurred: ${e}`)\n })\n } else if (shouldChange) {\n handleChange()\n }\n}\n\nconst focus = (): void => {\n input.value?.focus?.()\n}\n\nonMounted(() => {\n input.value!.checked = checked.value\n})\n\ndefineExpose({\n /**\n * @description manual focus to the switch component\n **/\n focus,\n /**\n * @description whether Switch is checked\n */\n checked,\n})\n</script>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_withModifiers","_createElementVNode"],"mappings":";;;;;;;;;;;;;;;mCAqGc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA,CAAA;AACjC,IAAA,MAAM,aAAa,WAAY,EAAA,CAAA;AAC/B,IAAM,MAAA,EAAA,G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CAAA;AACZ,OAAU;AAA2C,KAAA,CAAA;AACtD,IAAA,cACoB,MAAA;AACvB,MAAa,IAAA,EAAA,EAAA,EAAA,CAAA;AAAA,MACf,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAAA,KACF,CAAA;AAEA,IAAA,gBAA0B;AACxB,MAAA,KAAA,CAAM,aAAe,GAAA,OAAA,CAAA,KAAA,CAAA;AAAA,KACvB,CAAA,CAAA;AAEA,IAAA,MAAA,CAAA;AACE,MAAM,KAAA;AAAyB,MAChC,OAAA;AAED,KAAa,CAAA,CAAA;AAAA,IAAA,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MAAA,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;AAAA,QAAA,KAAA,EAAAC,cAAA,CAAAC,KAAA,CAAA,SAAA,CAAA,CAAA;AAAA,QAIX,OAAA,EAAAC,aAAA,CAAA,WAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,OAAA,EAAA;AAAA,QAAAC,kBAAA,CAAA,OAAA,EAAA;AAAA,UAAA,EAAA,EAAAF,KAAA,CAAA,OAAA,CAAA;AAAA,UAIA,OAAA,EAAA,OAAA;AAAA,UACD,GAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"switch2.mjs","sources":["../../../../../../packages/components/switch/src/switch.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useAriaProps } from '@element-plus/hooks'\n\nimport type { ComponentSize } from '@element-plus/constants'\nimport type Switch from './switch.vue'\nimport type { ExtractPropTypes, PropType, __ExtractPublicPropTypes } from 'vue'\n\nexport const switchProps = buildProps({\n /**\n * @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type\n */\n modelValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @description whether Switch is disabled\n */\n disabled: Boolean,\n /**\n * @description whether Switch is in loading state\n */\n loading: Boolean,\n /**\n * @description size of Switch\n */\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n /**\n * @description width of Switch\n */\n width: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether icon or text is displayed inside dot, only the first character will be rendered for text\n */\n inlinePrompt: Boolean,\n /**\n * @description component of the icon displayed in action when in `off` state\n */\n inactiveActionIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed in action when in `on` state\n */\n activeActionIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed when in `on` state, overrides `active-text`\n */\n activeIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed when in `off` state, overrides `inactive-text`\n */\n inactiveIcon: {\n type: iconPropType,\n },\n /**\n * @description text displayed when in `on` state\n */\n activeText: {\n type: String,\n default: '',\n },\n /**\n * @description text displayed when in `off` state\n */\n inactiveText: {\n type: String,\n default: '',\n },\n /**\n * @description switch value when in `on` state\n */\n activeValue: {\n type: [Boolean, String, Number],\n default: true,\n },\n /**\n * @description switch value when in `off` state\n */\n inactiveValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @description input name of Switch\n */\n name: {\n type: String,\n default: '',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching\n */\n beforeChange: {\n type: definePropType<() => Promise<boolean> | boolean>(Function),\n },\n /**\n * @description id for input\n */\n id: String,\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n },\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport type SwitchProps = ExtractPropTypes<typeof switchProps>\nexport type SwitchPropsPublic = __ExtractPublicPropTypes<typeof switchProps>\n\nexport const switchEmits = {\n [UPDATE_MODEL_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n [CHANGE_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n [INPUT_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n}\nexport type SwitchEmits = typeof switchEmits\n\nexport type SwitchInstance = InstanceType<typeof Switch> & unknown\n"],"names":[],"mappings":";;;;;;;;AAeY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAE,oBAAoB;AACnC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,YAAY,EAAE,OAAO;AACvB,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,YAAY,EAA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,CAAC,GAAG,CAAC;AAC3E,EAAE,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC1E;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Tooltip from './src/tooltip2.mjs';
|
|
2
2
|
export { tooltipEmits, useTooltipModelToggle, useTooltipModelToggleEmits, useTooltipModelToggleProps, useTooltipProps } from './src/tooltip.mjs';
|
|
3
|
-
export { useTooltipTriggerProps } from './src/
|
|
3
|
+
export { useTooltipTriggerProps } from './src/trigger.mjs';
|
|
4
4
|
export { useTooltipContentProps } from './src/content.mjs';
|
|
5
5
|
export { TOOLTIP_INJECTION_KEY } from './src/constants.mjs';
|
|
6
6
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTooltipContentProps } from './content.mjs';
|
|
2
|
-
import { useTooltipTriggerProps } from './
|
|
2
|
+
import { useTooltipTriggerProps } from './trigger.mjs';
|
|
3
3
|
import { popperProps } from '../../popper/src/popper.mjs';
|
|
4
4
|
import { popperArrowProps } from '../../popper/src/arrow.mjs';
|
|
5
5
|
import { createModelToggleComposable } from '../../../hooks/use-model-toggle/index.mjs';
|
|
@@ -2,7 +2,7 @@ import { defineComponent, ref, toRef, computed, provide, readonly, unref, watch,
|
|
|
2
2
|
import { ElPopper } from '../../popper/index.mjs';
|
|
3
3
|
import { TOOLTIP_INJECTION_KEY } from './constants.mjs';
|
|
4
4
|
import { useTooltipProps, tooltipEmits, useTooltipModelToggle } from './tooltip.mjs';
|
|
5
|
-
import ElTooltipTrigger from './
|
|
5
|
+
import ElTooltipTrigger from './trigger2.mjs';
|
|
6
6
|
import ElTooltipContent from './content2.mjs';
|
|
7
7
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
8
|
import { usePopperContainer } from '../../../hooks/use-popper-container/index.mjs';
|
|
@@ -1,85 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
4
|
-
import { useTooltipTriggerProps } from './trigger2.mjs';
|
|
5
|
-
import { whenTrigger } from './utils.mjs';
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
-
import ElPopperTrigger from '../../popper/src/trigger2.mjs';
|
|
8
|
-
import { composeEventHandlers, getEventCode } from '../../../utils/dom/event.mjs';
|
|
9
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
10
|
-
import { focusElement } from '../../../utils/dom/aria.mjs';
|
|
1
|
+
import { popperTriggerProps } from '../../popper/src/trigger.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { EVENT_CODE } from '../../../constants/aria.mjs';
|
|
11
4
|
|
|
12
|
-
const
|
|
13
|
-
|
|
5
|
+
const useTooltipTriggerProps = buildProps({
|
|
6
|
+
...popperTriggerProps,
|
|
7
|
+
disabled: Boolean,
|
|
8
|
+
trigger: {
|
|
9
|
+
type: definePropType([String, Array]),
|
|
10
|
+
default: "hover"
|
|
11
|
+
},
|
|
12
|
+
triggerKeys: {
|
|
13
|
+
type: definePropType(Array),
|
|
14
|
+
default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space]
|
|
15
|
+
},
|
|
16
|
+
focusOnTarget: Boolean
|
|
14
17
|
});
|
|
15
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
-
...__default__,
|
|
17
|
-
props: useTooltipTriggerProps,
|
|
18
|
-
setup(__props, { expose }) {
|
|
19
|
-
const props = __props;
|
|
20
|
-
const ns = useNamespace("tooltip");
|
|
21
|
-
const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
|
|
22
|
-
const triggerRef = ref(null);
|
|
23
|
-
const stopWhenControlledOrDisabled = () => {
|
|
24
|
-
if (unref(controlled) || props.disabled) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const trigger = toRef(props, "trigger");
|
|
29
|
-
const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", (e) => {
|
|
30
|
-
onOpen(e);
|
|
31
|
-
if (props.focusOnTarget && e.target) {
|
|
32
|
-
nextTick(() => {
|
|
33
|
-
focusElement(e.target, { preventScroll: true });
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}));
|
|
37
|
-
const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onClose));
|
|
38
|
-
const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "click", (e) => {
|
|
39
|
-
if (e.button === 0) {
|
|
40
|
-
onToggle(e);
|
|
41
|
-
}
|
|
42
|
-
}));
|
|
43
|
-
const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onOpen));
|
|
44
|
-
const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onClose));
|
|
45
|
-
const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "contextmenu", (e) => {
|
|
46
|
-
e.preventDefault();
|
|
47
|
-
onToggle(e);
|
|
48
|
-
}));
|
|
49
|
-
const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
|
|
50
|
-
const code = getEventCode(e);
|
|
51
|
-
if (props.triggerKeys.includes(code)) {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
onToggle(e);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
expose({
|
|
57
|
-
triggerRef
|
|
58
|
-
});
|
|
59
|
-
return (_ctx, _cache) => {
|
|
60
|
-
return openBlock(), createBlock(unref(ElPopperTrigger), {
|
|
61
|
-
id: unref(id),
|
|
62
|
-
"virtual-ref": _ctx.virtualRef,
|
|
63
|
-
open: unref(open),
|
|
64
|
-
"virtual-triggering": _ctx.virtualTriggering,
|
|
65
|
-
class: normalizeClass(unref(ns).e("trigger")),
|
|
66
|
-
onBlur: unref(onBlur),
|
|
67
|
-
onClick: unref(onClick),
|
|
68
|
-
onContextmenu: unref(onContextMenu),
|
|
69
|
-
onFocus: unref(onFocus),
|
|
70
|
-
onMouseenter: unref(onMouseenter),
|
|
71
|
-
onMouseleave: unref(onMouseleave),
|
|
72
|
-
onKeydown: unref(onKeydown)
|
|
73
|
-
}, {
|
|
74
|
-
default: withCtx(() => [
|
|
75
|
-
renderSlot(_ctx.$slots, "default")
|
|
76
|
-
]),
|
|
77
|
-
_: 3
|
|
78
|
-
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "trigger.vue"]]);
|
|
83
18
|
|
|
84
|
-
export {
|
|
19
|
+
export { useTooltipTriggerProps };
|
|
85
20
|
//# sourceMappingURL=trigger.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.mjs","sources":["../../../../../../packages/components/tooltip/src/trigger.
|
|
1
|
+
{"version":3,"file":"trigger.mjs","sources":["../../../../../../packages/components/tooltip/src/trigger.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport { popperTriggerProps } from '@element-plus/components/popper'\nimport { EVENT_CODE } from '@element-plus/constants'\n\nimport type { Arrayable } from '@element-plus/utils'\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport type TooltipTriggerType = 'hover' | 'focus' | 'click' | 'contextmenu'\n\nexport const useTooltipTriggerProps = buildProps({\n ...popperTriggerProps,\n /**\n * @description whether Tooltip is disabled\n */\n disabled: Boolean,\n /**\n * @description How should the tooltip be triggered (to show), not valid in controlled mode\n */\n trigger: {\n type: definePropType<Arrayable<TooltipTriggerType>>([String, Array]),\n default: 'hover',\n },\n /**\n * @description When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of tooltip through the keyboard, not valid in controlled mode\n */\n triggerKeys: {\n type: definePropType<string[]>(Array),\n default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space],\n },\n /**\n * @description when triggering tooltips through hover, whether to focus the trigger element, which improves accessibility\n */\n focusOnTarget: Boolean,\n} as const)\n\nexport type ElTooltipTriggerProps = ExtractPropTypes<\n typeof useTooltipTriggerProps\n>\n\nexport type ElTooltipTriggerPropsPublic = __ExtractPublicPropTypes<\n typeof useTooltipTriggerProps\n>\n"],"names":[],"mappings":";;;;AAGY,MAAC,sBAAsB,GAAG,UAAU,CAAC;AACjD,EAAE,GAAG,kBAAkB;AACvB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,KAAK,CAAC;AAC/E,GAAG;AACH,EAAE,aAAa,EAAE,OAAO;AACxB,CAAC;;;;"}
|
|
@@ -1,20 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent, inject, ref, toRef, openBlock, createBlock, unref, normalizeClass, withCtx, renderSlot, nextTick } from 'vue';
|
|
2
|
+
import '../../popper/index.mjs';
|
|
3
|
+
import { TOOLTIP_INJECTION_KEY } from './constants.mjs';
|
|
4
|
+
import { useTooltipTriggerProps } from './trigger.mjs';
|
|
5
|
+
import { whenTrigger } from './utils.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import ElPopperTrigger from '../../popper/src/trigger2.mjs';
|
|
8
|
+
import { composeEventHandlers, getEventCode } from '../../../utils/dom/event.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
10
|
+
import { focusElement } from '../../../utils/dom/aria.mjs';
|
|
4
11
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
disabled: Boolean,
|
|
8
|
-
trigger: {
|
|
9
|
-
type: definePropType([String, Array]),
|
|
10
|
-
default: "hover"
|
|
11
|
-
},
|
|
12
|
-
triggerKeys: {
|
|
13
|
-
type: definePropType(Array),
|
|
14
|
-
default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space]
|
|
15
|
-
},
|
|
16
|
-
focusOnTarget: Boolean
|
|
12
|
+
const __default__ = defineComponent({
|
|
13
|
+
name: "ElTooltipTrigger"
|
|
17
14
|
});
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...__default__,
|
|
17
|
+
props: useTooltipTriggerProps,
|
|
18
|
+
setup(__props, { expose }) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const ns = useNamespace("tooltip");
|
|
21
|
+
const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
|
|
22
|
+
const triggerRef = ref(null);
|
|
23
|
+
const stopWhenControlledOrDisabled = () => {
|
|
24
|
+
if (unref(controlled) || props.disabled) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const trigger = toRef(props, "trigger");
|
|
29
|
+
const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", (e) => {
|
|
30
|
+
onOpen(e);
|
|
31
|
+
if (props.focusOnTarget && e.target) {
|
|
32
|
+
nextTick(() => {
|
|
33
|
+
focusElement(e.target, { preventScroll: true });
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onClose));
|
|
38
|
+
const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "click", (e) => {
|
|
39
|
+
if (e.button === 0) {
|
|
40
|
+
onToggle(e);
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onOpen));
|
|
44
|
+
const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onClose));
|
|
45
|
+
const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "contextmenu", (e) => {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
onToggle(e);
|
|
48
|
+
}));
|
|
49
|
+
const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
|
|
50
|
+
const code = getEventCode(e);
|
|
51
|
+
if (props.triggerKeys.includes(code)) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
onToggle(e);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
expose({
|
|
57
|
+
triggerRef
|
|
58
|
+
});
|
|
59
|
+
return (_ctx, _cache) => {
|
|
60
|
+
return openBlock(), createBlock(unref(ElPopperTrigger), {
|
|
61
|
+
id: unref(id),
|
|
62
|
+
"virtual-ref": _ctx.virtualRef,
|
|
63
|
+
open: unref(open),
|
|
64
|
+
"virtual-triggering": _ctx.virtualTriggering,
|
|
65
|
+
class: normalizeClass(unref(ns).e("trigger")),
|
|
66
|
+
onBlur: unref(onBlur),
|
|
67
|
+
onClick: unref(onClick),
|
|
68
|
+
onContextmenu: unref(onContextMenu),
|
|
69
|
+
onFocus: unref(onFocus),
|
|
70
|
+
onMouseenter: unref(onMouseenter),
|
|
71
|
+
onMouseleave: unref(onMouseleave),
|
|
72
|
+
onKeydown: unref(onKeydown)
|
|
73
|
+
}, {
|
|
74
|
+
default: withCtx(() => [
|
|
75
|
+
renderSlot(_ctx.$slots, "default")
|
|
76
|
+
]),
|
|
77
|
+
_: 3
|
|
78
|
+
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "trigger.vue"]]);
|
|
18
83
|
|
|
19
|
-
export {
|
|
84
|
+
export { ElTooltipTrigger as default };
|
|
20
85
|
//# sourceMappingURL=trigger2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger2.mjs","sources":["../../../../../../packages/components/tooltip/src/trigger.
|
|
1
|
+
{"version":3,"file":"trigger2.mjs","sources":["../../../../../../packages/components/tooltip/src/trigger.vue"],"sourcesContent":["<template>\n <el-popper-trigger\n :id=\"id\"\n :virtual-ref=\"virtualRef\"\n :open=\"open\"\n :virtual-triggering=\"virtualTriggering\"\n :class=\"ns.e('trigger')\"\n @blur=\"onBlur\"\n @click=\"onClick\"\n @contextmenu=\"onContextMenu\"\n @focus=\"onFocus\"\n @mouseenter=\"onMouseenter\"\n @mouseleave=\"onMouseleave\"\n @keydown=\"onKeydown\"\n >\n <slot />\n </el-popper-trigger>\n</template>\n\n<script lang=\"ts\" setup>\nimport { inject, nextTick, ref, toRef, unref } from 'vue'\nimport { ElPopperTrigger } from '@element-plus/components/popper'\nimport {\n composeEventHandlers,\n focusElement,\n getEventCode,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { TOOLTIP_INJECTION_KEY } from './constants'\nimport { useTooltipTriggerProps } from './trigger'\nimport { whenTrigger } from './utils'\n\nimport type { OnlyChildExpose } from '@element-plus/components/slot'\n\ndefineOptions({\n name: 'ElTooltipTrigger',\n})\n\nconst props = defineProps(useTooltipTriggerProps)\n\nconst ns = useNamespace('tooltip')\nconst { controlled, id, open, onOpen, onClose, onToggle } = inject(\n TOOLTIP_INJECTION_KEY,\n undefined\n)!\n\nconst triggerRef = ref<OnlyChildExpose | null>(null)\n\nconst stopWhenControlledOrDisabled = () => {\n if (unref(controlled) || props.disabled) {\n return true\n }\n}\nconst trigger = toRef(props, 'trigger')\nconst onMouseenter = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'hover', (e) => {\n onOpen(e)\n\n if (props.focusOnTarget && e.target) {\n nextTick(() => {\n focusElement(e.target as HTMLElement, { preventScroll: true })\n })\n }\n })\n)\nconst onMouseleave = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'hover', onClose)\n)\nconst onClick = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'click', (e) => {\n // distinguish left click\n if ((e as MouseEvent).button === 0) {\n onToggle(e)\n }\n })\n)\n\nconst onFocus = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'focus', onOpen)\n)\n\nconst onBlur = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'focus', onClose)\n)\n\nconst onContextMenu = composeEventHandlers(\n stopWhenControlledOrDisabled,\n whenTrigger(trigger, 'contextmenu', (e: Event) => {\n e.preventDefault()\n onToggle(e)\n })\n)\n\nconst onKeydown = composeEventHandlers(\n stopWhenControlledOrDisabled,\n (e: KeyboardEvent) => {\n const code = getEventCode(e)\n if (props.triggerKeys.includes(code)) {\n e.preventDefault()\n onToggle(e)\n }\n }\n)\n\ndefineExpose({\n /**\n * @description trigger element\n */\n triggerRef,\n})\n</script>\n"],"names":["_openBlock","_createBlock","_unref","_normalizeClass","_withCtx","_renderSlot"],"mappings":";;;;;;;;;;;mCAkCc,CAAA;AAAA,EACZ,IAAM,EAAA,kBAAA;A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,cAAwB,CAAAD,KAAA,CAAA,EAAA,CAAA,CAAA,CAAC,CAAa,SAAA,CAAA,CAAA;AAChD,QAAA,MAAiB,EAAAA,KAAA,CAAA,MAAA,CAAA;AACjB,QAAA,OAAA,EAASA,KAAC,CAAA,OAAA,CAAA;AAAA,QACX,aAAA,EAAAA,KAAA,CAAA,aAAA,CAAA;AAAA,QACH,OAAA,EAAAA,KAAA,CAAA,OAAA,CAAA;AAEA,QAAA,YAAkB,EAAAA,KAAA,CAAA,YAAA,CAAA;AAAA,QAChB,YAAA,EAAAA,KAAA,CAAA,YAAA,CAAA;AAAA,QACsB,SAAA,EAAAA,KAAA,CAAA,SAAA,CAAA;AACpB,OAAM,EAAA;AACN,QAAA,OAAU,EAAAE,OAAA,CAAA,MAAqB;AAC7B,UAAAC,UAAiB,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AACjB,SAAA,CAAA;AAAU,QACZ,CAAA,EAAA,CAAA;AAAA,OACF,EAAA,CAAA,EAAA,CAAA,IAAA,EAAA,aAAA,EAAA,MAAA,EAAA,oBAAA,EAAA,OAAA,EAAA,QAAA,EAAA,SAAA,EAAA,eAAA,EAAA,SAAA,EAAA,cAAA,EAAA,cAAA,EAAA,WAAA,CAAA,CAAA,CAAA;AAAA,KACF,CAAA;AAEA,GAAa;AAAA,CAAA,CAAA,CAAA;AAAA,uBAAA,gBAAA,WAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,aAAA,CAAA,CAAA,CAAA;;;;"}
|
package/es/index.mjs
CHANGED
|
@@ -2,15 +2,15 @@ import installer from './defaults.mjs';
|
|
|
2
2
|
export { default } from './defaults.mjs';
|
|
3
3
|
export { makeInstaller } from './make-installer.mjs';
|
|
4
4
|
export { default as dayjs } from 'dayjs';
|
|
5
|
-
export { affixEmits, affixProps } from './components/affix/src/
|
|
5
|
+
export { affixEmits, affixProps } from './components/affix/src/affix.mjs';
|
|
6
6
|
export { ElAffix } from './components/affix/index.mjs';
|
|
7
|
-
export { alertEffects, alertEmits, alertProps } from './components/alert/src/
|
|
7
|
+
export { alertEffects, alertEmits, alertProps } from './components/alert/src/alert.mjs';
|
|
8
8
|
export { ElAlert } from './components/alert/index.mjs';
|
|
9
9
|
export { autocompleteEmits, autocompleteProps } from './components/autocomplete/src/autocomplete.mjs';
|
|
10
10
|
export { ElAutocomplete } from './components/autocomplete/index.mjs';
|
|
11
|
-
export { avatarEmits, avatarProps } from './components/avatar/src/
|
|
11
|
+
export { avatarEmits, avatarProps } from './components/avatar/src/avatar.mjs';
|
|
12
12
|
export { ElAvatar } from './components/avatar/index.mjs';
|
|
13
|
-
export { backtopEmits, backtopProps } from './components/backtop/src/
|
|
13
|
+
export { backtopEmits, backtopProps } from './components/backtop/src/backtop.mjs';
|
|
14
14
|
export { ElBacktop } from './components/backtop/index.mjs';
|
|
15
15
|
export { badgeProps } from './components/badge/src/badge.mjs';
|
|
16
16
|
export { ElBadge } from './components/badge/index.mjs';
|
|
@@ -34,7 +34,7 @@ export { ElCascader } from './components/cascader/index.mjs';
|
|
|
34
34
|
export { CASCADER_PANEL_INJECTION_KEY } from './components/cascader-panel/src/types.mjs';
|
|
35
35
|
export { CommonProps, DefaultProps, cascaderPanelEmits, cascaderPanelProps, useCascaderConfig } from './components/cascader-panel/src/config.mjs';
|
|
36
36
|
export { ElCascaderPanel } from './components/cascader-panel/index.mjs';
|
|
37
|
-
export { checkTagEmits, checkTagProps } from './components/check-tag/src/check-
|
|
37
|
+
export { checkTagEmits, checkTagProps } from './components/check-tag/src/check-tag.mjs';
|
|
38
38
|
export { ElCheckTag } from './components/check-tag/index.mjs';
|
|
39
39
|
export { checkboxDefaultProps, checkboxGroupEmits, checkboxGroupProps } from './components/checkbox/src/checkbox-group.mjs';
|
|
40
40
|
export { checkboxEmits, checkboxProps } from './components/checkbox/src/checkbox.mjs';
|
|
@@ -88,7 +88,7 @@ export { useFormItem, useFormItemInputId } from './components/form/src/hooks/use
|
|
|
88
88
|
export { ElForm, ElFormItem } from './components/form/index.mjs';
|
|
89
89
|
export { iconProps } from './components/icon/src/icon.mjs';
|
|
90
90
|
export { ElIcon } from './components/icon/index.mjs';
|
|
91
|
-
export { imageEmits, imageProps } from './components/image/src/
|
|
91
|
+
export { imageEmits, imageProps } from './components/image/src/image.mjs';
|
|
92
92
|
export { ElImage } from './components/image/index.mjs';
|
|
93
93
|
export { imageViewerEmits, imageViewerProps } from './components/image-viewer/src/image-viewer.mjs';
|
|
94
94
|
export { ElImageViewer } from './components/image-viewer/index.mjs';
|
|
@@ -108,12 +108,12 @@ export { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './components/menu/sr
|
|
|
108
108
|
export { ElMenu, ElMenuItem, ElMenuItemGroup, ElSubMenu } from './components/menu/index.mjs';
|
|
109
109
|
export { overlayEmits, overlayProps } from './components/overlay/src/overlay.mjs';
|
|
110
110
|
export { ElOverlay } from './components/overlay/index.mjs';
|
|
111
|
-
export { pageHeaderEmits, pageHeaderProps } from './components/page-header/src/page-
|
|
111
|
+
export { pageHeaderEmits, pageHeaderProps } from './components/page-header/src/page-header2.mjs';
|
|
112
112
|
export { ElPageHeader } from './components/page-header/index.mjs';
|
|
113
113
|
export { paginationEmits, paginationProps } from './components/pagination/src/pagination.mjs';
|
|
114
114
|
export { elPaginationKey } from './components/pagination/src/constants.mjs';
|
|
115
115
|
export { ElPagination } from './components/pagination/index.mjs';
|
|
116
|
-
export { popconfirmEmits, popconfirmProps } from './components/popconfirm/src/
|
|
116
|
+
export { popconfirmEmits, popconfirmProps } from './components/popconfirm/src/popconfirm2.mjs';
|
|
117
117
|
export { ElPopconfirm } from './components/popconfirm/index.mjs';
|
|
118
118
|
export { Effect, popperProps, roleTypes, usePopperProps } from './components/popper/src/popper.mjs';
|
|
119
119
|
export { popperTriggerProps, usePopperTriggerProps } from './components/popper/src/trigger.mjs';
|
|
@@ -127,7 +127,7 @@ export { ElPopper } from './components/popper/index.mjs';
|
|
|
127
127
|
export { progressProps } from './components/progress/src/progress.mjs';
|
|
128
128
|
export { ElProgress } from './components/progress/index.mjs';
|
|
129
129
|
export { radioEmits, radioProps, radioPropsBase } from './components/radio/src/radio.mjs';
|
|
130
|
-
export { radioDefaultProps, radioGroupEmits, radioGroupProps } from './components/radio/src/radio-
|
|
130
|
+
export { radioDefaultProps, radioGroupEmits, radioGroupProps } from './components/radio/src/radio-group.mjs';
|
|
131
131
|
export { radioButtonProps } from './components/radio/src/radio-button.mjs';
|
|
132
132
|
export { radioGroupKey } from './components/radio/src/constants.mjs';
|
|
133
133
|
export { ElRadio, ElRadioButton, ElRadioGroup } from './components/radio/index.mjs';
|
|
@@ -164,7 +164,7 @@ export { stepProps } from './components/steps/src/item2.mjs';
|
|
|
164
164
|
export { stepsEmits, stepsProps } from './components/steps/src/steps.mjs';
|
|
165
165
|
export { STEPS_INJECTION_KEY } from './components/steps/src/tokens.mjs';
|
|
166
166
|
export { ElStep, ElSteps } from './components/steps/index.mjs';
|
|
167
|
-
export { switchEmits, switchProps } from './components/switch/src/
|
|
167
|
+
export { switchEmits, switchProps } from './components/switch/src/switch2.mjs';
|
|
168
168
|
export { ElSwitch } from './components/switch/index.mjs';
|
|
169
169
|
export { ElTable, ElTableColumn } from './components/table/index.mjs';
|
|
170
170
|
export { Alignment as TableV2Alignment, FixedDir as TableV2FixedDir, SortOrder as TableV2SortOrder } from './components/table-v2/src/constants.mjs';
|
|
@@ -196,7 +196,7 @@ export { timelineItemProps } from './components/timeline/src/timeline-item.mjs';
|
|
|
196
196
|
export { TIMELINE_INJECTION_KEY } from './components/timeline/src/tokens.mjs';
|
|
197
197
|
export { ElTimeline, ElTimelineItem } from './components/timeline/index.mjs';
|
|
198
198
|
export { tooltipEmits, useTooltipModelToggle, useTooltipModelToggleEmits, useTooltipModelToggleProps, useTooltipProps } from './components/tooltip/src/tooltip.mjs';
|
|
199
|
-
export { useTooltipTriggerProps } from './components/tooltip/src/
|
|
199
|
+
export { useTooltipTriggerProps } from './components/tooltip/src/trigger.mjs';
|
|
200
200
|
export { useTooltipContentProps } from './components/tooltip/src/content.mjs';
|
|
201
201
|
export { TOOLTIP_INJECTION_KEY } from './components/tooltip/src/constants.mjs';
|
|
202
202
|
export { ElTooltip } from './components/tooltip/index.mjs';
|
|
@@ -224,7 +224,7 @@ export { tourEmits, tourProps } from './components/tour/src/tour.mjs';
|
|
|
224
224
|
export { tourStepEmits, tourStepProps } from './components/tour/src/step.mjs';
|
|
225
225
|
export { tourContentEmits, tourContentProps, tourPlacements, tourStrategies } from './components/tour/src/content.mjs';
|
|
226
226
|
export { ElTour, ElTourStep } from './components/tour/index.mjs';
|
|
227
|
-
export { anchorEmits, anchorProps } from './components/anchor/src/
|
|
227
|
+
export { anchorEmits, anchorProps } from './components/anchor/src/anchor.mjs';
|
|
228
228
|
export { ElAnchor, ElAnchorLink } from './components/anchor/index.mjs';
|
|
229
229
|
export { defaultProps, segmentedEmits, segmentedProps } from './components/segmented/src/segmented.mjs';
|
|
230
230
|
export { ElSegmented } from './components/segmented/index.mjs';
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20251120";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20251120'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var affix$1 = require('./src/
|
|
6
|
-
var affix = require('./src/
|
|
5
|
+
var affix$1 = require('./src/affix2.js');
|
|
6
|
+
var affix = require('./src/affix.js');
|
|
7
7
|
var install = require('../../utils/vue/install.js');
|
|
8
8
|
|
|
9
9
|
const ElAffix = install.withInstall(affix$1["default"]);
|
|
@@ -2,138 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var core = require('@vueuse/core');
|
|
7
|
-
var affix = require('./affix2.js');
|
|
8
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
9
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
10
|
-
var scroll = require('../../../utils/dom/scroll.js');
|
|
11
|
-
var style = require('../../../utils/dom/style.js');
|
|
12
5
|
var event = require('../../../constants/event.js');
|
|
13
|
-
var
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
7
|
+
var types = require('../../../utils/types.js');
|
|
14
8
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
width: rootWidth,
|
|
33
|
-
top: rootTop,
|
|
34
|
-
bottom: rootBottom,
|
|
35
|
-
update: updateRoot
|
|
36
|
-
} = core.useElementBounding(root, { windowScroll: false });
|
|
37
|
-
const targetRect = core.useElementBounding(target);
|
|
38
|
-
const fixed = vue.ref(false);
|
|
39
|
-
const scrollTop = vue.ref(0);
|
|
40
|
-
const transform = vue.ref(0);
|
|
41
|
-
const rootStyle = vue.computed(() => {
|
|
42
|
-
return {
|
|
43
|
-
height: fixed.value ? `${rootHeight.value}px` : "",
|
|
44
|
-
width: fixed.value ? `${rootWidth.value}px` : ""
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
const affixStyle = vue.computed(() => {
|
|
48
|
-
if (!fixed.value)
|
|
49
|
-
return {};
|
|
50
|
-
const offset = style.addUnit(props.offset);
|
|
51
|
-
return {
|
|
52
|
-
height: `${rootHeight.value}px`,
|
|
53
|
-
width: `${rootWidth.value}px`,
|
|
54
|
-
top: props.position === "top" ? offset : "",
|
|
55
|
-
bottom: props.position === "bottom" ? offset : "",
|
|
56
|
-
transform: transform.value ? `translateY(${transform.value}px)` : "",
|
|
57
|
-
zIndex: props.zIndex
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
const update = () => {
|
|
61
|
-
if (!scrollContainer.value)
|
|
62
|
-
return;
|
|
63
|
-
scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
|
|
64
|
-
const { position, target: target2, offset } = props;
|
|
65
|
-
const rootHeightOffset = offset + rootHeight.value;
|
|
66
|
-
if (position === "top") {
|
|
67
|
-
if (target2) {
|
|
68
|
-
const difference = targetRect.bottom.value - rootHeightOffset;
|
|
69
|
-
fixed.value = offset > rootTop.value && targetRect.bottom.value > 0;
|
|
70
|
-
transform.value = difference < 0 ? difference : 0;
|
|
71
|
-
} else {
|
|
72
|
-
fixed.value = offset > rootTop.value;
|
|
73
|
-
}
|
|
74
|
-
} else if (target2) {
|
|
75
|
-
const difference = windowHeight.value - targetRect.top.value - rootHeightOffset;
|
|
76
|
-
fixed.value = windowHeight.value - offset < rootBottom.value && windowHeight.value > targetRect.top.value;
|
|
77
|
-
transform.value = difference < 0 ? -difference : 0;
|
|
78
|
-
} else {
|
|
79
|
-
fixed.value = windowHeight.value - offset < rootBottom.value;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const updateRootRect = async () => {
|
|
83
|
-
if (!fixed.value) {
|
|
84
|
-
updateRoot();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
fixed.value = false;
|
|
88
|
-
await vue.nextTick();
|
|
89
|
-
updateRoot();
|
|
90
|
-
fixed.value = true;
|
|
91
|
-
};
|
|
92
|
-
const handleScroll = async () => {
|
|
93
|
-
updateRoot();
|
|
94
|
-
await vue.nextTick();
|
|
95
|
-
emit("scroll", {
|
|
96
|
-
scrollTop: scrollTop.value,
|
|
97
|
-
fixed: fixed.value
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
vue.watch(fixed, (val) => emit(event.CHANGE_EVENT, val));
|
|
101
|
-
vue.onMounted(() => {
|
|
102
|
-
var _a;
|
|
103
|
-
if (props.target) {
|
|
104
|
-
target.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
105
|
-
if (!target.value)
|
|
106
|
-
error.throwError(COMPONENT_NAME, `Target does not exist: ${props.target}`);
|
|
107
|
-
} else {
|
|
108
|
-
target.value = document.documentElement;
|
|
109
|
-
}
|
|
110
|
-
scrollContainer.value = scroll.getScrollContainer(root.value, true);
|
|
111
|
-
updateRoot();
|
|
112
|
-
});
|
|
113
|
-
core.useEventListener(scrollContainer, "scroll", handleScroll);
|
|
114
|
-
vue.watchEffect(update);
|
|
115
|
-
expose({
|
|
116
|
-
update,
|
|
117
|
-
updateRoot: updateRootRect
|
|
118
|
-
});
|
|
119
|
-
return (_ctx, _cache) => {
|
|
120
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
121
|
-
ref_key: "root",
|
|
122
|
-
ref: root,
|
|
123
|
-
class: vue.normalizeClass(vue.unref(ns).b()),
|
|
124
|
-
style: vue.normalizeStyle(vue.unref(rootStyle))
|
|
125
|
-
}, [
|
|
126
|
-
vue.createElementVNode("div", {
|
|
127
|
-
class: vue.normalizeClass({ [vue.unref(ns).m("fixed")]: fixed.value }),
|
|
128
|
-
style: vue.normalizeStyle(vue.unref(affixStyle))
|
|
129
|
-
}, [
|
|
130
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
131
|
-
], 6)
|
|
132
|
-
], 6);
|
|
133
|
-
};
|
|
9
|
+
const affixProps = runtime.buildProps({
|
|
10
|
+
zIndex: {
|
|
11
|
+
type: runtime.definePropType([Number, String]),
|
|
12
|
+
default: 100
|
|
13
|
+
},
|
|
14
|
+
target: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
offset: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 0
|
|
21
|
+
},
|
|
22
|
+
position: {
|
|
23
|
+
type: String,
|
|
24
|
+
values: ["top", "bottom"],
|
|
25
|
+
default: "top"
|
|
134
26
|
}
|
|
135
27
|
});
|
|
136
|
-
|
|
28
|
+
const affixEmits = {
|
|
29
|
+
scroll: ({ scrollTop, fixed }) => types.isNumber(scrollTop) && types.isBoolean(fixed),
|
|
30
|
+
[event.CHANGE_EVENT]: (fixed) => types.isBoolean(fixed)
|
|
31
|
+
};
|
|
137
32
|
|
|
138
|
-
exports
|
|
33
|
+
exports.affixEmits = affixEmits;
|
|
34
|
+
exports.affixProps = affixProps;
|
|
139
35
|
//# sourceMappingURL=affix.js.map
|