@element-plus/nightly 0.0.20251120 → 0.0.20251122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.full.js +37 -17
- package/dist/index.full.min.js +13 -13
- 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 +37 -17
- 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/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +96 -40
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +40 -96
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +65 -31
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +31 -65
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/index.mjs +9 -9
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs +101 -15
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +15 -101
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +16 -97
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +97 -16
- package/es/components/page-header/src/page-header2.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/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +50 -135
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +135 -50
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/select/src/useOption.mjs +1 -1
- package/es/components/select/src/useOption.mjs.map +1 -1
- package/es/components/select/src/useSelect.mjs +1 -1
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/src/useSelect.mjs +10 -2
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/slider/src/button.mjs +91 -19
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +19 -91
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/steps/index.mjs +2 -2
- package/es/components/steps/src/item.mjs +19 -198
- package/es/components/steps/src/item.mjs.map +1 -1
- package/es/components/steps/src/item2.mjs +198 -19
- package/es/components/steps/src/item2.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +72 -225
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +225 -72
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/src/table/style-helper.mjs +7 -9
- package/es/components/table/src/table/style-helper.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +9 -3
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tabs.d.ts +18 -0
- package/es/components/tabs/src/tabs.mjs +10 -2
- package/es/components/tabs/src/tabs.mjs.map +1 -1
- package/es/components/tooltip/index.mjs +2 -2
- package/es/components/tooltip/src/tooltip.mjs +167 -30
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +30 -167
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger2.mjs.map +1 -1
- package/es/components/upload/index.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-dragger.mjs +61 -8
- package/es/components/upload/src/upload-dragger.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger2.mjs +8 -61
- package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
- package/es/index.mjs +9 -9
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +95 -41
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +41 -95
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +65 -32
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +32 -65
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/index.js +9 -9
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item.js +101 -16
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +16 -101
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +17 -97
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +97 -17
- package/lib/components/page-header/src/page-header2.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/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +51 -135
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +135 -51
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/select/src/useOption.js +1 -1
- package/lib/components/select/src/useOption.js.map +1 -1
- package/lib/components/select/src/useSelect.js +1 -1
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.js +10 -2
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/slider/src/button.js +91 -20
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +20 -91
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/steps/index.js +2 -2
- package/lib/components/steps/src/item.js +19 -198
- package/lib/components/steps/src/item.js.map +1 -1
- package/lib/components/steps/src/item2.js +198 -19
- package/lib/components/steps/src/item2.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +72 -224
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +224 -72
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/src/table/style-helper.js +6 -8
- package/lib/components/table/src/table/style-helper.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +8 -2
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tabs.d.ts +18 -0
- package/lib/components/tabs/src/tabs.js +10 -2
- package/lib/components/tabs/src/tabs.js.map +1 -1
- package/lib/components/tooltip/index.js +2 -2
- package/lib/components/tooltip/src/tooltip.js +167 -34
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +34 -167
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip/src/trigger2.js.map +1 -1
- package/lib/components/upload/index.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-dragger.js +61 -9
- package/lib/components/upload/src/upload-dragger.js.map +1 -1
- package/lib/components/upload/src/upload-dragger2.js +9 -61
- package/lib/components/upload/src/upload-dragger2.js.map +1 -1
- package/lib/index.js +9 -9
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,71 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { avatarProps, avatarEmits } from './avatar.mjs';
|
|
4
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
6
|
-
import { isString } from '@vue/shared';
|
|
1
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
2
|
+
import { componentSizes } from '../../../constants/size.mjs';
|
|
7
3
|
import { isNumber } from '../../../utils/types.mjs';
|
|
8
|
-
import {
|
|
4
|
+
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
9
5
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return isNumber(size) ? ns.cssVarBlock({
|
|
35
|
-
size: addUnit(size)
|
|
36
|
-
}) : void 0;
|
|
37
|
-
});
|
|
38
|
-
const fitStyle = computed(() => ({
|
|
39
|
-
objectFit: props.fit
|
|
40
|
-
}));
|
|
41
|
-
watch(() => props.src, () => hasLoadError.value = false);
|
|
42
|
-
function handleError(e) {
|
|
43
|
-
hasLoadError.value = true;
|
|
44
|
-
emit("error", e);
|
|
45
|
-
}
|
|
46
|
-
return (_ctx, _cache) => {
|
|
47
|
-
return openBlock(), createElementBlock("span", {
|
|
48
|
-
class: normalizeClass(unref(avatarClass)),
|
|
49
|
-
style: normalizeStyle(unref(sizeStyle))
|
|
50
|
-
}, [
|
|
51
|
-
(_ctx.src || _ctx.srcSet) && !hasLoadError.value ? (openBlock(), createElementBlock("img", {
|
|
52
|
-
key: 0,
|
|
53
|
-
src: _ctx.src,
|
|
54
|
-
alt: _ctx.alt,
|
|
55
|
-
srcset: _ctx.srcSet,
|
|
56
|
-
style: normalizeStyle(unref(fitStyle)),
|
|
57
|
-
onError: handleError
|
|
58
|
-
}, null, 44, ["src", "alt", "srcset"])) : _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
59
|
-
default: withCtx(() => [
|
|
60
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
|
|
61
|
-
]),
|
|
62
|
-
_: 1
|
|
63
|
-
})) : renderSlot(_ctx.$slots, "default", { key: 2 })
|
|
64
|
-
], 6);
|
|
65
|
-
};
|
|
6
|
+
const avatarProps = buildProps({
|
|
7
|
+
size: {
|
|
8
|
+
type: [Number, String],
|
|
9
|
+
values: componentSizes,
|
|
10
|
+
default: "",
|
|
11
|
+
validator: (val) => isNumber(val)
|
|
12
|
+
},
|
|
13
|
+
shape: {
|
|
14
|
+
type: String,
|
|
15
|
+
values: ["circle", "square"],
|
|
16
|
+
default: "circle"
|
|
17
|
+
},
|
|
18
|
+
icon: {
|
|
19
|
+
type: iconPropType
|
|
20
|
+
},
|
|
21
|
+
src: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
},
|
|
25
|
+
alt: String,
|
|
26
|
+
srcSet: String,
|
|
27
|
+
fit: {
|
|
28
|
+
type: definePropType(String),
|
|
29
|
+
default: "cover"
|
|
66
30
|
}
|
|
67
31
|
});
|
|
68
|
-
|
|
32
|
+
const avatarEmits = {
|
|
33
|
+
error: (evt) => evt instanceof Event
|
|
34
|
+
};
|
|
69
35
|
|
|
70
|
-
export {
|
|
36
|
+
export { avatarEmits, avatarProps };
|
|
71
37
|
//# sourceMappingURL=avatar2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar2.mjs","sources":["../../../../../../packages/components/avatar/src/avatar.
|
|
1
|
+
{"version":3,"file":"avatar2.mjs","sources":["../../../../../../packages/components/avatar/src/avatar.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isNumber,\n} from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type { ObjectFitProperty } from 'csstype'\n\nexport const avatarProps = buildProps({\n /**\n * @description avatar size.\n */\n size: {\n type: [Number, String],\n values: componentSizes,\n default: '',\n validator: (val: unknown): val is number => isNumber(val),\n },\n /**\n * @description avatar shape.\n */\n shape: {\n type: String,\n values: ['circle', 'square'],\n default: 'circle',\n },\n /**\n * @description representation type to icon, more info on icon component.\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description the source of the image for an image avatar.\n */\n src: {\n type: String,\n default: '',\n },\n /**\n * @description native attribute `alt` of image avatar.\n */\n alt: String,\n /**\n * @description native attribute srcset of image avatar.\n */\n srcSet: String,\n /**\n * @description set how the image fit its container for an image avatar.\n */\n fit: {\n type: definePropType<ObjectFitProperty>(String),\n default: 'cover',\n },\n} as const)\nexport type AvatarProps = ExtractPropTypes<typeof avatarProps>\nexport type AvatarPropsPublic = __ExtractPublicPropTypes<typeof avatarProps>\n\nexport const avatarEmits = {\n error: (evt: Event) => evt instanceof Event,\n}\nexport type AvatarEmits = typeof avatarEmits\n"],"names":[],"mappings":";;;;;AAOY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,IAAI,SAAS,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC;AACrC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAChC,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;AAC3B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,KAAK;AACtC;;;;"}
|
package/es/components/index.mjs
CHANGED
|
@@ -88,9 +88,9 @@ export { default as DynamicSizeGrid } from './virtual-list/src/components/dynami
|
|
|
88
88
|
export { default as ElLoadingDirective, default as vLoading } from './loading/src/directive.mjs';
|
|
89
89
|
export { default as ElLoadingService } from './loading/src/service.mjs';
|
|
90
90
|
export { affixEmits, affixProps } from './affix/src/affix.mjs';
|
|
91
|
-
export { alertEffects, alertEmits, alertProps } from './alert/src/
|
|
91
|
+
export { alertEffects, alertEmits, alertProps } from './alert/src/alert2.mjs';
|
|
92
92
|
export { autocompleteEmits, autocompleteProps } from './autocomplete/src/autocomplete.mjs';
|
|
93
|
-
export { avatarEmits, avatarProps } from './avatar/src/
|
|
93
|
+
export { avatarEmits, avatarProps } from './avatar/src/avatar2.mjs';
|
|
94
94
|
export { backtopEmits, backtopProps } from './backtop/src/backtop.mjs';
|
|
95
95
|
export { badgeProps } from './badge/src/badge.mjs';
|
|
96
96
|
export { breadcrumbProps } from './breadcrumb/src/breadcrumb.mjs';
|
|
@@ -147,15 +147,15 @@ export { inputNumberEmits, inputNumberProps } from './input-number/src/input-num
|
|
|
147
147
|
export { inputTagEmits, inputTagProps } from './input-tag/src/input-tag.mjs';
|
|
148
148
|
export { linkEmits, linkProps } from './link/src/link.mjs';
|
|
149
149
|
export { menuEmits, menuProps } from './menu/src/menu.mjs';
|
|
150
|
-
export { menuItemEmits, menuItemProps } from './menu/src/menu-
|
|
150
|
+
export { menuItemEmits, menuItemProps } from './menu/src/menu-item2.mjs';
|
|
151
151
|
export { menuItemGroupProps } from './menu/src/menu-item-group.mjs';
|
|
152
152
|
export { subMenuProps } from './menu/src/sub-menu.mjs';
|
|
153
153
|
export { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './menu/src/tokens.mjs';
|
|
154
154
|
export { overlayEmits, overlayProps } from './overlay/src/overlay.mjs';
|
|
155
|
-
export { pageHeaderEmits, pageHeaderProps } from './page-header/src/page-
|
|
155
|
+
export { pageHeaderEmits, pageHeaderProps } from './page-header/src/page-header.mjs';
|
|
156
156
|
export { paginationEmits, paginationProps } from './pagination/src/pagination.mjs';
|
|
157
157
|
export { elPaginationKey } from './pagination/src/constants.mjs';
|
|
158
|
-
export { popconfirmEmits, popconfirmProps } from './popconfirm/src/
|
|
158
|
+
export { popconfirmEmits, popconfirmProps } from './popconfirm/src/popconfirm.mjs';
|
|
159
159
|
export { Effect, popperProps, roleTypes, usePopperProps } from './popper/src/popper.mjs';
|
|
160
160
|
export { popperTriggerProps, usePopperTriggerProps } from './popper/src/trigger.mjs';
|
|
161
161
|
export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './popper/src/content.mjs';
|
|
@@ -188,10 +188,10 @@ export { spaceProps } from './space/src/space.mjs';
|
|
|
188
188
|
export { spaceItemProps } from './space/src/item.mjs';
|
|
189
189
|
export { useSpace } from './space/src/use-space.mjs';
|
|
190
190
|
export { statisticProps } from './statistic/src/statistic.mjs';
|
|
191
|
-
export { stepProps } from './steps/src/
|
|
191
|
+
export { stepProps } from './steps/src/item.mjs';
|
|
192
192
|
export { stepsEmits, stepsProps } from './steps/src/steps.mjs';
|
|
193
193
|
export { STEPS_INJECTION_KEY } from './steps/src/tokens.mjs';
|
|
194
|
-
export { switchEmits, switchProps } from './switch/src/
|
|
194
|
+
export { switchEmits, switchProps } from './switch/src/switch.mjs';
|
|
195
195
|
export { Alignment as TableV2Alignment, FixedDir as TableV2FixedDir, SortOrder as TableV2SortOrder } from './table-v2/src/constants.mjs';
|
|
196
196
|
export { default as TableV2 } from './table-v2/src/table-v2.mjs';
|
|
197
197
|
export { placeholderSign as TableV2Placeholder } from './table-v2/src/private.mjs';
|
|
@@ -213,7 +213,7 @@ export { default as TimePickPanel } from './time-picker/src/time-picker-com/pane
|
|
|
213
213
|
export { timeSelectProps } from './time-select/src/time-select.mjs';
|
|
214
214
|
export { timelineItemProps } from './timeline/src/timeline-item.mjs';
|
|
215
215
|
export { TIMELINE_INJECTION_KEY } from './timeline/src/tokens.mjs';
|
|
216
|
-
export { tooltipEmits, useTooltipModelToggle, useTooltipModelToggleEmits, useTooltipModelToggleProps, useTooltipProps } from './tooltip/src/
|
|
216
|
+
export { tooltipEmits, useTooltipModelToggle, useTooltipModelToggleEmits, useTooltipModelToggleProps, useTooltipProps } from './tooltip/src/tooltip2.mjs';
|
|
217
217
|
export { useTooltipTriggerProps } from './tooltip/src/trigger.mjs';
|
|
218
218
|
export { useTooltipContentProps } from './tooltip/src/content.mjs';
|
|
219
219
|
export { TOOLTIP_INJECTION_KEY } from './tooltip/src/constants.mjs';
|
|
@@ -223,7 +223,7 @@ export { treeEmits } from './tree/src/tree.mjs';
|
|
|
223
223
|
export { genFileId, uploadBaseProps, uploadListTypes, uploadProps } from './upload/src/upload.mjs';
|
|
224
224
|
export { uploadContentProps } from './upload/src/upload-content.mjs';
|
|
225
225
|
export { uploadListEmits, uploadListProps } from './upload/src/upload-list.mjs';
|
|
226
|
-
export { uploadDraggerEmits, uploadDraggerProps } from './upload/src/upload-
|
|
226
|
+
export { uploadDraggerEmits, uploadDraggerProps } from './upload/src/upload-dragger2.mjs';
|
|
227
227
|
export { uploadContextKey } from './upload/src/constants.mjs';
|
|
228
228
|
export { default as FixedSizeList } from './virtual-list/src/components/fixed-size-list.mjs';
|
|
229
229
|
export { default as DynamicSizeList } from './virtual-list/src/components/dynamic-size-list.mjs';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import Menu from './src/menu.mjs';
|
|
2
2
|
export { menuEmits, menuProps } from './src/menu.mjs';
|
|
3
|
-
import MenuItem from './src/menu-
|
|
3
|
+
import MenuItem from './src/menu-item.mjs';
|
|
4
4
|
import MenuItemGroup from './src/menu-item-group2.mjs';
|
|
5
5
|
import SubMenu from './src/sub-menu.mjs';
|
|
6
6
|
export { subMenuProps } from './src/sub-menu.mjs';
|
|
7
|
-
export { menuItemEmits, menuItemProps } from './src/menu-
|
|
7
|
+
export { menuItemEmits, menuItemProps } from './src/menu-item2.mjs';
|
|
8
8
|
export { menuItemGroupProps } from './src/menu-item-group.mjs';
|
|
9
9
|
export { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './src/tokens.mjs';
|
|
10
10
|
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
|
|
@@ -1,19 +1,105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, getCurrentInstance, inject, toRef, computed, reactive, onMounted, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, unref, createBlock, withCtx, renderSlot, createElementVNode, Fragment } from 'vue';
|
|
2
|
+
import { ElTooltip } from '../../tooltip/index.mjs';
|
|
3
|
+
import useMenu from './use-menu.mjs';
|
|
4
|
+
import { menuItemProps, menuItemEmits } from './menu-item2.mjs';
|
|
5
|
+
import { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './tokens.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { isPropAbsent } from '../../../utils/types.mjs';
|
|
8
|
+
import { debugWarn, throwError } from '../../../utils/error.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
3
10
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
default: null
|
|
8
|
-
},
|
|
9
|
-
route: {
|
|
10
|
-
type: definePropType([String, Object])
|
|
11
|
-
},
|
|
12
|
-
disabled: Boolean
|
|
11
|
+
const COMPONENT_NAME = "ElMenuItem";
|
|
12
|
+
const __default__ = defineComponent({
|
|
13
|
+
name: COMPONENT_NAME
|
|
13
14
|
});
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
...__default__,
|
|
17
|
+
props: menuItemProps,
|
|
18
|
+
emits: menuItemEmits,
|
|
19
|
+
setup(__props, { expose, emit }) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
isPropAbsent(props.index) && debugWarn(COMPONENT_NAME, 'Missing required prop: "index"');
|
|
22
|
+
const instance = getCurrentInstance();
|
|
23
|
+
const rootMenu = inject(MENU_INJECTION_KEY);
|
|
24
|
+
const nsMenu = useNamespace("menu");
|
|
25
|
+
const nsMenuItem = useNamespace("menu-item");
|
|
26
|
+
if (!rootMenu)
|
|
27
|
+
throwError(COMPONENT_NAME, "can not inject root menu");
|
|
28
|
+
const { parentMenu, indexPath } = useMenu(instance, toRef(props, "index"));
|
|
29
|
+
const subMenu = inject(`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`);
|
|
30
|
+
if (!subMenu)
|
|
31
|
+
throwError(COMPONENT_NAME, "can not inject sub menu");
|
|
32
|
+
const active = computed(() => props.index === rootMenu.activeIndex);
|
|
33
|
+
const item = reactive({
|
|
34
|
+
index: props.index,
|
|
35
|
+
indexPath,
|
|
36
|
+
active
|
|
37
|
+
});
|
|
38
|
+
const handleClick = () => {
|
|
39
|
+
if (!props.disabled) {
|
|
40
|
+
rootMenu.handleMenuItemClick({
|
|
41
|
+
index: props.index,
|
|
42
|
+
indexPath: indexPath.value,
|
|
43
|
+
route: props.route
|
|
44
|
+
});
|
|
45
|
+
emit("click", item);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
onMounted(() => {
|
|
49
|
+
subMenu.addSubMenu(item);
|
|
50
|
+
rootMenu.addMenuItem(item);
|
|
51
|
+
});
|
|
52
|
+
onBeforeUnmount(() => {
|
|
53
|
+
subMenu.removeSubMenu(item);
|
|
54
|
+
rootMenu.removeMenuItem(item);
|
|
55
|
+
});
|
|
56
|
+
expose({
|
|
57
|
+
parentMenu,
|
|
58
|
+
rootMenu,
|
|
59
|
+
active,
|
|
60
|
+
nsMenu,
|
|
61
|
+
nsMenuItem,
|
|
62
|
+
handleClick
|
|
63
|
+
});
|
|
64
|
+
return (_ctx, _cache) => {
|
|
65
|
+
return openBlock(), createElementBlock("li", {
|
|
66
|
+
class: normalizeClass([
|
|
67
|
+
unref(nsMenuItem).b(),
|
|
68
|
+
unref(nsMenuItem).is("active", unref(active)),
|
|
69
|
+
unref(nsMenuItem).is("disabled", _ctx.disabled)
|
|
70
|
+
]),
|
|
71
|
+
role: "menuitem",
|
|
72
|
+
tabindex: "-1",
|
|
73
|
+
onClick: handleClick
|
|
74
|
+
}, [
|
|
75
|
+
unref(parentMenu).type.name === "ElMenu" && unref(rootMenu).props.collapse && _ctx.$slots.title ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
76
|
+
key: 0,
|
|
77
|
+
effect: unref(rootMenu).props.popperEffect,
|
|
78
|
+
placement: "right",
|
|
79
|
+
"fallback-placements": ["left"],
|
|
80
|
+
persistent: unref(rootMenu).props.persistent,
|
|
81
|
+
"focus-on-target": ""
|
|
82
|
+
}, {
|
|
83
|
+
content: withCtx(() => [
|
|
84
|
+
renderSlot(_ctx.$slots, "title")
|
|
85
|
+
]),
|
|
86
|
+
default: withCtx(() => [
|
|
87
|
+
createElementVNode("div", {
|
|
88
|
+
class: normalizeClass(unref(nsMenu).be("tooltip", "trigger"))
|
|
89
|
+
}, [
|
|
90
|
+
renderSlot(_ctx.$slots, "default")
|
|
91
|
+
], 2)
|
|
92
|
+
]),
|
|
93
|
+
_: 3
|
|
94
|
+
}, 8, ["effect", "persistent"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
95
|
+
renderSlot(_ctx.$slots, "default"),
|
|
96
|
+
renderSlot(_ctx.$slots, "title")
|
|
97
|
+
], 64))
|
|
98
|
+
], 2);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
var MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "menu-item.vue"]]);
|
|
17
103
|
|
|
18
|
-
export {
|
|
104
|
+
export { MenuItem as default };
|
|
19
105
|
//# sourceMappingURL=menu-item.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.mjs","sources":["../../../../../../packages/components/menu/src/menu-item.
|
|
1
|
+
{"version":3,"file":"menu-item.mjs","sources":["../../../../../../packages/components/menu/src/menu-item.vue"],"sourcesContent":["<template>\n <li\n :class=\"[\n nsMenuItem.b(),\n nsMenuItem.is('active', active),\n nsMenuItem.is('disabled', disabled),\n ]\"\n role=\"menuitem\"\n tabindex=\"-1\"\n @click=\"handleClick\"\n >\n <el-tooltip\n v-if=\"\n parentMenu.type.name === 'ElMenu' &&\n rootMenu.props.collapse &&\n $slots.title\n \"\n :effect=\"rootMenu.props.popperEffect\"\n placement=\"right\"\n :fallback-placements=\"['left']\"\n :persistent=\"rootMenu.props.persistent\"\n focus-on-target\n >\n <template #content>\n <slot name=\"title\" />\n </template>\n <div :class=\"nsMenu.be('tooltip', 'trigger')\">\n <slot />\n </div>\n </el-tooltip>\n <template v-else>\n <slot />\n <slot name=\"title\" />\n </template>\n </li>\n</template>\n\n<script lang=\"ts\" setup>\n// @ts-nocheck\nimport {\n computed,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n reactive,\n toRef,\n} from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { debugWarn, isPropAbsent, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport useMenu from './use-menu'\nimport { menuItemEmits, menuItemProps } from './menu-item'\nimport { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './tokens'\n\nimport type { MenuItemRegistered, MenuProvider, SubMenuProvider } from './types'\n\nconst COMPONENT_NAME = 'ElMenuItem'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = defineProps(menuItemProps)\nconst emit = defineEmits(menuItemEmits)\n\nisPropAbsent(props.index) &&\n debugWarn(COMPONENT_NAME, 'Missing required prop: \"index\"')\n\nconst instance = getCurrentInstance()!\nconst rootMenu = inject<MenuProvider>(MENU_INJECTION_KEY)\nconst nsMenu = useNamespace('menu')\nconst nsMenuItem = useNamespace('menu-item')\nif (!rootMenu) throwError(COMPONENT_NAME, 'can not inject root menu')\n\nconst { parentMenu, indexPath } = useMenu(instance, toRef(props, 'index'))\n\nconst subMenu = inject<SubMenuProvider>(\n `${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`\n)\nif (!subMenu) throwError(COMPONENT_NAME, 'can not inject sub menu')\n\nconst active = computed(() => props.index === rootMenu.activeIndex)\nconst item: MenuItemRegistered = reactive({\n index: props.index,\n indexPath,\n active,\n})\n\nconst handleClick = () => {\n if (!props.disabled) {\n rootMenu.handleMenuItemClick({\n index: props.index,\n indexPath: indexPath.value,\n route: props.route,\n })\n emit('click', item)\n }\n}\n\nonMounted(() => {\n subMenu.addSubMenu(item)\n rootMenu.addMenuItem(item)\n})\n\nonBeforeUnmount(() => {\n subMenu.removeSubMenu(item)\n rootMenu.removeMenuItem(item)\n})\n\ndefineExpose({\n parentMenu,\n rootMenu,\n active,\n nsMenu,\n nsMenuItem,\n handleClick,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;mCA0Dc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAIA,IAAA,YAAA,CAAa,KAAM,CAAA,KAAK,CACtB,IAAA,SAAA,CAAU,gBAAgB,gCAAgC,CAAA,CAAA;AAE5D,IAAA,MAAM,WAAW,kBAAmB,EAAA,CAAA;AACpC,IAAM,MAAA,QAAA,GAAW,OAAqB,kBAAkB,CAAA,CAAA;AACxD,IAAM,MAAA,MAAA,GAAS,aAAa,MAAM,CAAA,CAAA;AAClC,IAAM,MAAA,UAAA,GAAa,aAAa,WAAW,CAAA,CAAA;AAC3C,IAAA,IAAI,CAAC,QAAA;AAEL,MAAM,yBAAwB,EAAA,0BAAsB,CAAA,CAAA;AAEpD,IAAA,MAAM,EAAU,UAAA,EAAA,SAAA,EAAA,GAAA,OAAA,CAAA,QAAA,EAAA,KAAA,CAAA,KAAA,EAAA,OAAA,CAAA,CAAA,CAAA;AAAA,IAAA,MACX,OAAA,GAAA,MAAA,CAAA,CAAA,EAAA,sBAA6C,CAAA,EAAA,UAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AAAA,IAClD,IAAA,CAAA,OAAA;AACA,MAAA,UAAK,CAAS,cAAW,EAAA,yBAAyC,CAAA,CAAA;AAElE,IAAA,MAAM,SAAS,QAAS,CAAA,MAAM,KAAM,CAAA,KAAA,KAAU,SAAS,WAAW,CAAA,CAAA;AAClE,IAAA,MAAM,OAA2B,QAAS,CAAA;AAAA,MACxC,OAAO,KAAM,CAAA,KAAA;AAAA,MACb,SAAA;AAAA,MACA,MAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,MAAM,cAAc,MAAM;AACxB,MAAI,IAAA,CAAC,MAAM,QAAU,EAAA;AACnB,QAAA,QAAA,CAAS,mBAAoB,CAAA;AAAA,UAC3B,OAAO,KAAM,CAAA,KAAA;AAAA,UACb,WAAW,SAAU,CAAA,KAAA;AAAA,UACrB,OAAO,KAAM,CAAA,KAAA;AAAA,SACd,CAAA,CAAA;AACD,QAAA,IAAA,CAAK,SAAS,IAAI,CAAA,CAAA;AAAA,OACpB;AAAA,KACF,CAAA;AAEA,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,OAAA,CAAQ,WAAW,IAAI,CAAA,CAAA;AACvB,MAAA,QAAA,CAAS,YAAY,IAAI,CAAA,CAAA;AAAA,KAC1B,CAAA,CAAA;AAED,IAAA,eAAA,CAAgB,MAAM;AACpB,MAAA,OAAA,CAAQ,cAAc,IAAI,CAAA,CAAA;AAC1B,MAAA,QAAA,CAAS,eAAe,IAAI,CAAA,CAAA;AAAA,KAC7B,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MACX,UAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,105 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import useMenu from './use-menu.mjs';
|
|
4
|
-
import { menuItemProps, menuItemEmits } from './menu-item.mjs';
|
|
5
|
-
import { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './tokens.mjs';
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
-
import { isPropAbsent } from '../../../utils/types.mjs';
|
|
8
|
-
import { debugWarn, throwError } from '../../../utils/error.mjs';
|
|
9
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
2
|
+
import { isString, isArray } from '@vue/shared';
|
|
10
3
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
const menuItemProps = buildProps({
|
|
5
|
+
index: {
|
|
6
|
+
type: definePropType([String, null]),
|
|
7
|
+
default: null
|
|
8
|
+
},
|
|
9
|
+
route: {
|
|
10
|
+
type: definePropType([String, Object])
|
|
11
|
+
},
|
|
12
|
+
disabled: Boolean
|
|
14
13
|
});
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
emits: menuItemEmits,
|
|
19
|
-
setup(__props, { expose, emit }) {
|
|
20
|
-
const props = __props;
|
|
21
|
-
isPropAbsent(props.index) && debugWarn(COMPONENT_NAME, 'Missing required prop: "index"');
|
|
22
|
-
const instance = getCurrentInstance();
|
|
23
|
-
const rootMenu = inject(MENU_INJECTION_KEY);
|
|
24
|
-
const nsMenu = useNamespace("menu");
|
|
25
|
-
const nsMenuItem = useNamespace("menu-item");
|
|
26
|
-
if (!rootMenu)
|
|
27
|
-
throwError(COMPONENT_NAME, "can not inject root menu");
|
|
28
|
-
const { parentMenu, indexPath } = useMenu(instance, toRef(props, "index"));
|
|
29
|
-
const subMenu = inject(`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`);
|
|
30
|
-
if (!subMenu)
|
|
31
|
-
throwError(COMPONENT_NAME, "can not inject sub menu");
|
|
32
|
-
const active = computed(() => props.index === rootMenu.activeIndex);
|
|
33
|
-
const item = reactive({
|
|
34
|
-
index: props.index,
|
|
35
|
-
indexPath,
|
|
36
|
-
active
|
|
37
|
-
});
|
|
38
|
-
const handleClick = () => {
|
|
39
|
-
if (!props.disabled) {
|
|
40
|
-
rootMenu.handleMenuItemClick({
|
|
41
|
-
index: props.index,
|
|
42
|
-
indexPath: indexPath.value,
|
|
43
|
-
route: props.route
|
|
44
|
-
});
|
|
45
|
-
emit("click", item);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
onMounted(() => {
|
|
49
|
-
subMenu.addSubMenu(item);
|
|
50
|
-
rootMenu.addMenuItem(item);
|
|
51
|
-
});
|
|
52
|
-
onBeforeUnmount(() => {
|
|
53
|
-
subMenu.removeSubMenu(item);
|
|
54
|
-
rootMenu.removeMenuItem(item);
|
|
55
|
-
});
|
|
56
|
-
expose({
|
|
57
|
-
parentMenu,
|
|
58
|
-
rootMenu,
|
|
59
|
-
active,
|
|
60
|
-
nsMenu,
|
|
61
|
-
nsMenuItem,
|
|
62
|
-
handleClick
|
|
63
|
-
});
|
|
64
|
-
return (_ctx, _cache) => {
|
|
65
|
-
return openBlock(), createElementBlock("li", {
|
|
66
|
-
class: normalizeClass([
|
|
67
|
-
unref(nsMenuItem).b(),
|
|
68
|
-
unref(nsMenuItem).is("active", unref(active)),
|
|
69
|
-
unref(nsMenuItem).is("disabled", _ctx.disabled)
|
|
70
|
-
]),
|
|
71
|
-
role: "menuitem",
|
|
72
|
-
tabindex: "-1",
|
|
73
|
-
onClick: handleClick
|
|
74
|
-
}, [
|
|
75
|
-
unref(parentMenu).type.name === "ElMenu" && unref(rootMenu).props.collapse && _ctx.$slots.title ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
76
|
-
key: 0,
|
|
77
|
-
effect: unref(rootMenu).props.popperEffect,
|
|
78
|
-
placement: "right",
|
|
79
|
-
"fallback-placements": ["left"],
|
|
80
|
-
persistent: unref(rootMenu).props.persistent,
|
|
81
|
-
"focus-on-target": ""
|
|
82
|
-
}, {
|
|
83
|
-
content: withCtx(() => [
|
|
84
|
-
renderSlot(_ctx.$slots, "title")
|
|
85
|
-
]),
|
|
86
|
-
default: withCtx(() => [
|
|
87
|
-
createElementVNode("div", {
|
|
88
|
-
class: normalizeClass(unref(nsMenu).be("tooltip", "trigger"))
|
|
89
|
-
}, [
|
|
90
|
-
renderSlot(_ctx.$slots, "default")
|
|
91
|
-
], 2)
|
|
92
|
-
]),
|
|
93
|
-
_: 3
|
|
94
|
-
}, 8, ["effect", "persistent"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
95
|
-
renderSlot(_ctx.$slots, "default"),
|
|
96
|
-
renderSlot(_ctx.$slots, "title")
|
|
97
|
-
], 64))
|
|
98
|
-
], 2);
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
var MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "menu-item.vue"]]);
|
|
14
|
+
const menuItemEmits = {
|
|
15
|
+
click: (item) => isString(item.index) && isArray(item.indexPath)
|
|
16
|
+
};
|
|
103
17
|
|
|
104
|
-
export {
|
|
18
|
+
export { menuItemEmits, menuItemProps };
|
|
105
19
|
//# sourceMappingURL=menu-item2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item2.mjs","sources":["../../../../../../packages/components/menu/src/menu-item.
|
|
1
|
+
{"version":3,"file":"menu-item2.mjs","sources":["../../../../../../packages/components/menu/src/menu-item.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isArray,\n isString,\n} from '@element-plus/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport type { MenuItemRegistered } from './types'\n\nexport const menuItemProps = buildProps({\n /**\n * @description unique identification\n */\n index: {\n type: definePropType<string | null>([String, null]),\n // will be required in the next major version\n // required: true,\n default: null,\n },\n /**\n * @description Vue Router object\n */\n route: {\n type: definePropType<RouteLocationRaw>([String, Object]),\n },\n /**\n * @description whether disabled\n */\n disabled: Boolean,\n} as const)\nexport type MenuItemProps = ExtractPropTypes<typeof menuItemProps>\nexport type MenuItemPropsPublic = __ExtractPublicPropTypes<typeof menuItemProps>\n\nexport const menuItemEmits = {\n click: (item: MenuItemRegistered) =>\n isString(item.index) && isArray(item.indexPath),\n}\nexport type MenuItemEmits = typeof menuItemEmits\n"],"names":[],"mappings":";;;AAMY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACxC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,KAAK,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;AAClE;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PageHeader from './src/page-
|
|
2
|
-
export { pageHeaderEmits, pageHeaderProps } from './src/page-
|
|
1
|
+
import PageHeader from './src/page-header2.mjs';
|
|
2
|
+
export { pageHeaderEmits, pageHeaderProps } from './src/page-header.mjs';
|
|
3
3
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
4
4
|
|
|
5
5
|
const ElPageHeader = withInstall(PageHeader);
|
|
@@ -1,102 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { pageHeaderProps, pageHeaderEmits } from './page-header2.mjs';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
7
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import { Back } from '@element-plus/icons-vue';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
3
|
+
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
8
4
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const ns = useNamespace("page-header");
|
|
19
|
-
function handleClick() {
|
|
20
|
-
emit("back");
|
|
21
|
-
}
|
|
22
|
-
return (_ctx, _cache) => {
|
|
23
|
-
return openBlock(), createElementBlock("div", {
|
|
24
|
-
class: normalizeClass([
|
|
25
|
-
unref(ns).b(),
|
|
26
|
-
unref(ns).is("contentful", !!_ctx.$slots.default),
|
|
27
|
-
{
|
|
28
|
-
[unref(ns).m("has-breadcrumb")]: !!_ctx.$slots.breadcrumb,
|
|
29
|
-
[unref(ns).m("has-extra")]: !!_ctx.$slots.extra
|
|
30
|
-
}
|
|
31
|
-
])
|
|
32
|
-
}, [
|
|
33
|
-
_ctx.$slots.breadcrumb ? (openBlock(), createElementBlock("div", {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: normalizeClass(unref(ns).e("breadcrumb"))
|
|
36
|
-
}, [
|
|
37
|
-
renderSlot(_ctx.$slots, "breadcrumb")
|
|
38
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
39
|
-
createElementVNode("div", {
|
|
40
|
-
class: normalizeClass(unref(ns).e("header"))
|
|
41
|
-
}, [
|
|
42
|
-
createElementVNode("div", {
|
|
43
|
-
class: normalizeClass(unref(ns).e("left"))
|
|
44
|
-
}, [
|
|
45
|
-
createElementVNode("div", {
|
|
46
|
-
class: normalizeClass(unref(ns).e("back")),
|
|
47
|
-
role: "button",
|
|
48
|
-
tabindex: "0",
|
|
49
|
-
onClick: handleClick
|
|
50
|
-
}, [
|
|
51
|
-
_ctx.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", {
|
|
52
|
-
key: 0,
|
|
53
|
-
"aria-label": _ctx.title || unref(t)("el.pageHeader.title"),
|
|
54
|
-
class: normalizeClass(unref(ns).e("icon"))
|
|
55
|
-
}, [
|
|
56
|
-
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
57
|
-
_ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
58
|
-
default: withCtx(() => [
|
|
59
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
|
|
60
|
-
]),
|
|
61
|
-
_: 1
|
|
62
|
-
})) : createCommentVNode("v-if", true)
|
|
63
|
-
])
|
|
64
|
-
], 10, ["aria-label"])) : createCommentVNode("v-if", true),
|
|
65
|
-
createElementVNode("div", {
|
|
66
|
-
class: normalizeClass(unref(ns).e("title"))
|
|
67
|
-
}, [
|
|
68
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
69
|
-
createTextVNode(toDisplayString(_ctx.title || unref(t)("el.pageHeader.title")), 1)
|
|
70
|
-
])
|
|
71
|
-
], 2)
|
|
72
|
-
], 2),
|
|
73
|
-
createVNode(unref(ElDivider), { direction: "vertical" }),
|
|
74
|
-
createElementVNode("div", {
|
|
75
|
-
class: normalizeClass(unref(ns).e("content"))
|
|
76
|
-
}, [
|
|
77
|
-
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
78
|
-
createTextVNode(toDisplayString(_ctx.content), 1)
|
|
79
|
-
])
|
|
80
|
-
], 2)
|
|
81
|
-
], 2),
|
|
82
|
-
_ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
|
|
83
|
-
key: 0,
|
|
84
|
-
class: normalizeClass(unref(ns).e("extra"))
|
|
85
|
-
}, [
|
|
86
|
-
renderSlot(_ctx.$slots, "extra")
|
|
87
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
88
|
-
], 2),
|
|
89
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("div", {
|
|
90
|
-
key: 1,
|
|
91
|
-
class: normalizeClass(unref(ns).e("main"))
|
|
92
|
-
}, [
|
|
93
|
-
renderSlot(_ctx.$slots, "default")
|
|
94
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
95
|
-
], 2);
|
|
96
|
-
};
|
|
5
|
+
const pageHeaderProps = buildProps({
|
|
6
|
+
icon: {
|
|
7
|
+
type: iconPropType,
|
|
8
|
+
default: () => Back
|
|
9
|
+
},
|
|
10
|
+
title: String,
|
|
11
|
+
content: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
97
14
|
}
|
|
98
15
|
});
|
|
99
|
-
|
|
16
|
+
const pageHeaderEmits = {
|
|
17
|
+
back: () => true
|
|
18
|
+
};
|
|
100
19
|
|
|
101
|
-
export {
|
|
20
|
+
export { pageHeaderEmits, pageHeaderProps };
|
|
102
21
|
//# sourceMappingURL=page-header.mjs.map
|