element-pe 2.14.2-1 → 2.14.2-2
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 +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- 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/src/affix.d.ts +1 -1
- package/es/components/affix/src/affix.vue.d.ts +4 -4
- package/es/components/alert/src/alert.d.ts +2 -2
- package/es/components/alert/src/alert.vue.d.ts +1 -1
- package/es/components/anchor/src/anchor.d.ts +1 -1
- package/es/components/anchor/src/anchor.vue.d.ts +2 -2
- package/es/components/autocomplete/src/autocomplete.d.ts +3 -3
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +6 -6
- package/es/components/avatar/src/avatar-group.d.ts +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +1 -1
- package/es/components/badge/src/badge.vue.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +4 -4
- package/es/components/button/src/use-button.d.ts +1 -1
- package/es/components/calendar/src/calendar.d.ts +1 -1
- package/es/components/calendar/src/calendar.vue.d.ts +1 -1
- package/es/components/calendar/src/select-controller.vue.d.ts +2 -2
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +2 -2
- package/es/components/cascader/src/cascader.d.ts +2 -2
- package/es/components/cascader/src/cascader.vue.d.ts +20 -20
- package/es/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/cascader-panel/src/index.vue.d.ts +5 -5
- package/es/components/cascader-panel/src/menu.vue.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
- package/es/components/checkbox/src/checkbox.vue.d.ts +6 -6
- package/es/components/col/src/col.vue.d.ts +2 -2
- package/es/components/collapse/src/collapse.vue.d.ts +2 -2
- package/es/components/color-picker/src/color-picker.vue.d.ts +12 -12
- package/es/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/es/components/config-provider/src/config-provider.d.ts +1 -1
- package/es/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/es/components/countdown/src/countdown.vue.d.ts +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +12 -12
- package/es/components/date-picker/src/props.d.ts +2 -2
- package/es/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +2 -2
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-month-range.vue.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-year-range.vue.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +5 -5
- package/es/components/date-picker-panel/src/panel-utils.d.ts +12 -12
- package/es/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/es/components/descriptions/src/description-item.d.ts +8 -8
- package/es/components/descriptions/src/description.vue.d.ts +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +4 -4
- package/es/components/divider/src/divider.d.ts +1 -1
- package/es/components/divider/src/divider.vue.d.ts +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +6 -6
- package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +2 -2
- package/es/components/dropdown/src/dropdown-item.vue.d.ts +6 -6
- package/es/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.d.ts +3 -3
- package/es/components/dropdown/src/dropdown.vue.d.ts +84 -84
- package/es/components/empty/src/empty.vue.d.ts +1 -1
- package/es/components/form/src/form-item.d.ts +1 -1
- package/es/components/form/src/form-item.vue.d.ts +1 -1
- package/es/components/image/src/image.vue.d.ts +3 -3
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +3 -3
- package/es/components/input/src/input.d.ts +2 -2
- package/es/components/input/src/input.vue.d.ts +16 -16
- package/es/components/input-number/src/input-number.d.ts +3 -3
- package/es/components/input-number/src/input-number.vue.d.ts +11 -11
- package/es/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/input-otp/src/input-otp.vue.d.ts +7 -7
- package/es/components/input-tag/src/input-tag.d.ts +2 -2
- package/es/components/input-tag/src/input-tag.vue.d.ts +13 -13
- package/es/components/link/src/link.vue.d.ts +1 -1
- package/es/components/mention/src/mention.d.ts +3 -3
- package/es/components/mention/src/mention.vue.d.ts +5 -5
- package/es/components/menu/src/menu.d.ts +6 -6
- package/es/components/menu/src/menu.mjs +1 -1
- package/es/components/menu/src/sub-menu.d.ts +1 -1
- package/es/components/message/src/instance.d.ts +1 -1
- package/es/components/message/src/message.d.ts +2 -2
- package/es/components/message/src/message.vue.d.ts +5 -5
- package/es/components/message-box/src/index.vue.d.ts +55 -55
- package/es/components/message-box/src/index.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/notification/src/notification.d.ts +1 -1
- package/es/components/notification/src/notification.vue.d.ts +4 -4
- package/es/components/pagination/src/components/sizes.vue.d.ts +1 -1
- package/es/components/pagination/src/pagination.d.ts +4 -4
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +5 -5
- package/es/components/popover/src/popover.d.ts +2 -2
- package/es/components/popover/src/popover.vue.d.ts +16 -16
- package/es/components/popper/src/composables/use-content.d.ts +10 -10
- package/es/components/popper/src/content.d.ts +4 -4
- package/es/components/popper/src/content.vue.d.ts +15 -15
- package/es/components/popper/src/popper.d.ts +2 -2
- package/es/components/progress/src/progress.vue.d.ts +3 -3
- package/es/components/radio/src/radio-button.vue.d.ts +3 -3
- package/es/components/radio/src/radio-group.vue.d.ts +5 -5
- package/es/components/radio/src/radio.vue.d.ts +6 -6
- package/es/components/rate/src/rate.vue.d.ts +3 -3
- package/es/components/resizable-columns/index.d.ts +4 -4
- package/es/components/resizable-columns/src/resizable-column.vue.d.ts +2 -2
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.vue.d.ts +1 -1
- package/es/components/row/src/row.d.ts +2 -2
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/es/components/segmented/index.d.ts +4 -4
- package/es/components/segmented/src/segmented.vue.d.ts +2 -2
- package/es/components/select/src/select.d.ts +2 -2
- package/es/components/select/src/select.vue.d.ts +83 -83
- package/es/components/select/src/select.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/select/src/useSelect.d.ts +1 -1
- package/es/components/select-v2/src/defaults.d.ts +2 -2
- package/es/components/select-v2/src/select.vue.d.ts +81 -81
- package/es/components/select-v2/src/select.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/select-v2/src/useSelect.d.ts +1 -1
- package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/slider.vue.d.ts +8 -8
- package/es/components/space/src/space.d.ts +3 -3
- package/es/components/statistic/src/statistic.vue.d.ts +2 -2
- package/es/components/steps/src/item.d.ts +1 -1
- package/es/components/steps/src/item.vue.d.ts +1 -1
- package/es/components/steps/src/steps.d.ts +2 -2
- package/es/components/steps/src/steps.vue.d.ts +1 -1
- package/es/components/switch/src/switch.vue.d.ts +5 -5
- package/es/components/table/src/filter-panel.vue.d.ts +82 -82
- package/es/components/table/src/table-header/index.d.ts +17 -17
- package/es/components/table/src/table.vue.d.ts +1 -1
- package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/table-v2/src/components/header.d.ts +1 -1
- package/es/components/table-v2/src/components/row.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +3 -3
- package/es/components/table-v2/src/table-v2.d.ts +5 -5
- package/es/components/tabs/src/tab-nav.d.ts +1 -1
- package/es/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +5 -5
- package/es/components/tag/src/tag.d.ts +1 -1
- package/es/components/tag/src/tag.vue.d.ts +2 -2
- package/es/components/time-picker/src/common/picker-range-trigger.vue.d.ts +6 -6
- package/es/components/time-picker/src/common/picker.vue.d.ts +18 -18
- package/es/components/time-picker/src/common/props.d.ts +2 -2
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/time-picker/src/time-picker.d.ts +12 -12
- package/es/components/time-select/src/time-select.vue.d.ts +12 -12
- package/es/components/timeline/src/timeline-item.d.ts +2 -2
- package/es/components/tooltip/src/content.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +16 -16
- package/es/components/tooltip/src/tooltip.d.ts +3 -3
- package/es/components/tooltip/src/tooltip.vue.d.ts +17 -17
- package/es/components/tooltip/src/trigger.d.ts +1 -1
- package/es/components/tour/src/content.d.ts +2 -2
- package/es/components/tour/src/mask.vue.d.ts +1 -1
- package/es/components/tour/src/step.d.ts +1 -1
- package/es/components/tour/src/step.vue.d.ts +1 -1
- package/es/components/tour/src/tour.d.ts +1 -1
- package/es/components/tour/src/tour.vue.d.ts +5 -5
- package/es/components/transfer/src/transfer.vue.d.ts +2 -2
- package/es/components/tree/src/tree-node.vue.d.ts +18 -18
- package/es/components/tree/src/tree.vue.d.ts +23 -23
- package/es/components/tree-select/src/tree-select.vue.d.ts +23 -23
- package/es/components/tree-v2/src/composables/useTree.d.ts +12 -12
- package/es/components/tree-v2/src/tree.vue.d.ts +7 -7
- package/es/components/upload/src/upload-content.d.ts +1 -1
- package/es/components/upload/src/upload-content.vue.d.ts +3 -3
- package/es/components/upload/src/upload-list.d.ts +1 -1
- package/es/components/upload/src/upload.d.ts +2 -2
- package/es/components/upload/src/upload.vue.d.ts +4 -4
- package/es/components/virtual-list/src/builders/build-grid.d.ts +6 -6
- package/es/components/virtual-list/src/builders/build-list.d.ts +6 -6
- package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +6 -6
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +6 -6
- package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +6 -6
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +6 -6
- package/es/components/virtual-list/src/utils.d.ts +1 -1
- package/es/components/watermark/src/watermark.vue.d.ts +2 -2
- package/es/hooks/use-floating/index.d.ts +4 -4
- package/es/hooks/use-popper/index.d.ts +10 -10
- package/es/index.mjs +4 -4
- package/es/utils/vue/vnode.d.ts +4 -4
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/src/affix.d.ts +1 -1
- package/lib/components/affix/src/affix.vue.d.ts +4 -4
- package/lib/components/alert/src/alert.d.ts +2 -2
- package/lib/components/alert/src/alert.vue.d.ts +1 -1
- package/lib/components/anchor/src/anchor.d.ts +1 -1
- package/lib/components/anchor/src/anchor.vue.d.ts +2 -2
- package/lib/components/autocomplete/src/autocomplete.d.ts +3 -3
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +6 -6
- package/lib/components/avatar/src/avatar-group.d.ts +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +4 -4
- package/lib/components/button/src/use-button.d.ts +1 -1
- package/lib/components/calendar/src/calendar.d.ts +1 -1
- package/lib/components/calendar/src/calendar.vue.d.ts +1 -1
- package/lib/components/calendar/src/select-controller.vue.d.ts +2 -2
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +2 -2
- package/lib/components/cascader/src/cascader.d.ts +2 -2
- package/lib/components/cascader/src/cascader.vue.d.ts +20 -20
- package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js +26 -26
- package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/cascader-panel/src/index.vue.d.ts +5 -5
- package/lib/components/cascader-panel/src/menu.vue.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
- package/lib/components/checkbox/src/checkbox.vue.d.ts +6 -6
- package/lib/components/col/src/col.vue.d.ts +2 -2
- package/lib/components/collapse/src/collapse.vue.d.ts +2 -2
- package/lib/components/color-picker/src/color-picker.vue.d.ts +12 -12
- package/lib/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.js +18 -18
- package/lib/components/color-picker/src/color-picker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider.d.ts +1 -1
- package/lib/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/lib/components/countdown/src/countdown.vue.d.ts +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +12 -12
- package/lib/components/date-picker/src/props.d.ts +2 -2
- package/lib/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +2 -2
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.js +18 -18
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.js +23 -23
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-month-range.vue.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-year-range.vue.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +5 -5
- package/lib/components/date-picker-panel/src/panel-utils.d.ts +12 -12
- package/lib/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/lib/components/descriptions/src/description-item.d.ts +8 -8
- package/lib/components/descriptions/src/description.vue.d.ts +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +4 -4
- package/lib/components/divider/src/divider.d.ts +1 -1
- package/lib/components/divider/src/divider.vue.d.ts +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +6 -6
- package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +2 -2
- package/lib/components/dropdown/src/dropdown-item.vue.d.ts +6 -6
- package/lib/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.d.ts +3 -3
- package/lib/components/dropdown/src/dropdown.vue.d.ts +84 -84
- package/lib/components/empty/src/empty.vue.d.ts +1 -1
- package/lib/components/form/src/form-item.d.ts +1 -1
- package/lib/components/form/src/form-item.vue.d.ts +1 -1
- package/lib/components/image/src/image.vue.d.ts +3 -3
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +3 -3
- package/lib/components/input/src/input.d.ts +2 -2
- package/lib/components/input/src/input.vue.d.ts +16 -16
- package/lib/components/input-number/src/input-number.d.ts +3 -3
- package/lib/components/input-number/src/input-number.vue.d.ts +11 -11
- package/lib/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js +12 -12
- package/lib/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/input-otp/src/input-otp.vue.d.ts +7 -7
- package/lib/components/input-tag/src/input-tag.d.ts +2 -2
- package/lib/components/input-tag/src/input-tag.vue.d.ts +13 -13
- package/lib/components/link/src/link.vue.d.ts +1 -1
- package/lib/components/mention/src/mention.d.ts +3 -3
- package/lib/components/mention/src/mention.vue.d.ts +5 -5
- package/lib/components/menu/src/menu.d.ts +6 -6
- package/lib/components/menu/src/menu.js +7 -7
- package/lib/components/menu/src/menu.js.map +1 -1
- package/lib/components/menu/src/sub-menu.d.ts +1 -1
- package/lib/components/message/src/instance.d.ts +1 -1
- package/lib/components/message/src/message.d.ts +2 -2
- package/lib/components/message/src/message.vue.d.ts +5 -5
- package/lib/components/message-box/src/index.vue.d.ts +55 -55
- package/lib/components/message-box/src/index.vue_vue_type_script_lang.js +19 -19
- package/lib/components/message-box/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/notification/src/notification.d.ts +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +4 -4
- package/lib/components/pagination/src/components/sizes.vue.d.ts +1 -1
- package/lib/components/pagination/src/pagination.d.ts +4 -4
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +5 -5
- package/lib/components/popover/src/popover.d.ts +2 -2
- package/lib/components/popover/src/popover.vue.d.ts +16 -16
- package/lib/components/popper/src/composables/use-content.d.ts +10 -10
- package/lib/components/popper/src/content.d.ts +4 -4
- package/lib/components/popper/src/content.vue.d.ts +15 -15
- package/lib/components/popper/src/popper.d.ts +2 -2
- package/lib/components/progress/src/progress.vue.d.ts +3 -3
- package/lib/components/radio/src/radio-button.vue.d.ts +3 -3
- package/lib/components/radio/src/radio-group.vue.d.ts +5 -5
- package/lib/components/radio/src/radio.vue.d.ts +6 -6
- package/lib/components/rate/src/rate.vue.d.ts +3 -3
- package/lib/components/resizable-columns/index.d.ts +4 -4
- package/lib/components/resizable-columns/src/resizable-column.vue.d.ts +2 -2
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.vue.d.ts +1 -1
- package/lib/components/row/src/row.d.ts +2 -2
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +4 -4
- package/lib/components/segmented/src/segmented.vue.d.ts +2 -2
- package/lib/components/select/src/select.d.ts +2 -2
- package/lib/components/select/src/select.vue.d.ts +83 -83
- package/lib/components/select/src/select.vue_vue_type_script_lang.js +10 -10
- package/lib/components/select/src/select.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/select/src/useSelect.d.ts +1 -1
- package/lib/components/select-v2/src/defaults.d.ts +2 -2
- package/lib/components/select-v2/src/select.vue.d.ts +81 -81
- package/lib/components/select-v2/src/select.vue_vue_type_script_lang.js +10 -10
- package/lib/components/select-v2/src/select.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +8 -8
- package/lib/components/space/src/space.d.ts +3 -3
- package/lib/components/statistic/src/statistic.vue.d.ts +2 -2
- package/lib/components/steps/src/item.d.ts +1 -1
- package/lib/components/steps/src/item.vue.d.ts +1 -1
- package/lib/components/steps/src/steps.d.ts +2 -2
- package/lib/components/steps/src/steps.vue.d.ts +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +5 -5
- package/lib/components/table/src/filter-panel.vue.d.ts +82 -82
- package/lib/components/table/src/table-header/index.d.ts +17 -17
- package/lib/components/table/src/table.vue.d.ts +1 -1
- package/lib/components/table/src/table.vue_vue_type_script_setup_true_lang.js +9 -9
- package/lib/components/table/src/table.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/table-v2/src/components/header.d.ts +1 -1
- package/lib/components/table-v2/src/components/row.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +3 -3
- package/lib/components/table-v2/src/table-v2.d.ts +5 -5
- package/lib/components/tabs/src/tab-nav.d.ts +1 -1
- package/lib/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +5 -5
- package/lib/components/tag/src/tag.d.ts +1 -1
- package/lib/components/tag/src/tag.vue.d.ts +2 -2
- package/lib/components/time-picker/src/common/picker-range-trigger.vue.d.ts +6 -6
- package/lib/components/time-picker/src/common/picker.vue.d.ts +18 -18
- package/lib/components/time-picker/src/common/props.d.ts +2 -2
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.js +10 -10
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/time-picker/src/time-picker.d.ts +12 -12
- package/lib/components/time-select/src/time-select.vue.d.ts +12 -12
- package/lib/components/timeline/src/timeline-item.d.ts +2 -2
- package/lib/components/tooltip/src/content.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +16 -16
- package/lib/components/tooltip/src/tooltip.d.ts +3 -3
- package/lib/components/tooltip/src/tooltip.vue.d.ts +17 -17
- package/lib/components/tooltip/src/trigger.d.ts +1 -1
- package/lib/components/tour/src/content.d.ts +2 -2
- package/lib/components/tour/src/mask.vue.d.ts +1 -1
- package/lib/components/tour/src/step.d.ts +1 -1
- package/lib/components/tour/src/step.vue.d.ts +1 -1
- package/lib/components/tour/src/tour.d.ts +1 -1
- package/lib/components/tour/src/tour.vue.d.ts +5 -5
- package/lib/components/transfer/src/transfer.vue.d.ts +2 -2
- package/lib/components/tree/src/tree-node.vue.d.ts +18 -18
- package/lib/components/tree/src/tree.vue.d.ts +23 -23
- package/lib/components/tree-select/src/tree-select.vue.d.ts +23 -23
- package/lib/components/tree-v2/src/composables/useTree.d.ts +12 -12
- package/lib/components/tree-v2/src/tree.vue.d.ts +7 -7
- package/lib/components/upload/src/upload-content.d.ts +1 -1
- package/lib/components/upload/src/upload-content.vue.d.ts +3 -3
- package/lib/components/upload/src/upload-list.d.ts +1 -1
- package/lib/components/upload/src/upload.d.ts +2 -2
- package/lib/components/upload/src/upload.vue.d.ts +4 -4
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/builders/build-list.d.ts +6 -6
- package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +6 -6
- package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +6 -6
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +6 -6
- package/lib/components/virtual-list/src/utils.d.ts +1 -1
- package/lib/components/watermark/src/watermark.vue.d.ts +2 -2
- package/lib/hooks/use-floating/index.d.ts +4 -4
- package/lib/hooks/use-popper/index.d.ts +10 -10
- package/lib/index.js +141 -141
- package/lib/utils/vue/vnode.d.ts +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +6 -6
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","names":["buildProps","definePropType","mutable","iconPropType","More","isUndefined","useNamespace","MENU_INJECTION_KEY","SUB_MENU_INJECTION_KEY","Menubar","useMenuCssVar","flattedChildren","ElSubMenu","ElIcon","vClickoutside","ElMenuCollapseTransition"],"sources":["../../../../../../packages/components/menu/src/menu.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n nextTick,\n onMounted,\n provide,\n reactive,\n ref,\n withDirectives,\n} from 'vue'\nimport { watch, watchEffect } from '../../config-provider'\nimport { unrefElement, useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport ElIcon from '@element-plus/components/icon'\nimport { More } from '@element-plus/icons-vue'\nimport {\n buildProps,\n definePropType,\n flattedChildren,\n iconPropType,\n isArray,\n isObject,\n isString,\n isUndefined,\n mutable,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { ClickOutside as vClickoutside } from '@element-plus/directives'\nimport Menubar from './utils/menu-bar'\nimport ElMenuCollapseTransition from './menu-collapse-transition.vue'\nimport ElSubMenu from './sub-menu'\nimport { useMenuCssVar } from './use-menu-css-var'\nimport { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './tokens'\n\nimport type { PopperEffect } from '@element-plus/components/popper'\nimport type { MenuItemClicked, MenuProvider, SubMenuProvider } from './types'\nimport type { NavigationFailure, Router } from 'vue-router'\nimport type {\n CSSProperties,\n Component,\n DirectiveArguments,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n VNode,\n VNodeArrayChildren,\n} from 'vue'\nimport type { UseResizeObserverReturn } from '@vueuse/core'\n\nexport const menuProps = buildProps({\n /**\n * @description menu display mode\n */\n mode: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'vertical',\n },\n /**\n * @description index of active menu on page load\n */\n defaultActive: {\n type: String,\n default: '',\n },\n /**\n * @description array that contains indexes of currently active sub-menus\n */\n defaultOpeneds: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description whether only one sub-menu can be active\n */\n uniqueOpened: Boolean,\n /**\n * @description whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load.\n */\n router: Boolean,\n /**\n * @description how sub-menus are triggered, only works when `mode` is 'horizontal'\n */\n menuTrigger: {\n type: String,\n values: ['hover', 'click'],\n default: 'hover',\n },\n /**\n * @description whether the menu is collapsed (available only in vertical mode)\n */\n collapse: Boolean,\n /**\n * @description background color of Menu (hex format) (deprecated, use `--bg-color` instead)\n * @deprecated use `--bg-color` instead\n */\n backgroundColor: String,\n /**\n * @description text color of Menu (hex format) (deprecated, use `--text-color` instead)\n * @deprecated use `--text-color` instead\n */\n textColor: String,\n /**\n * @description text color of currently active menu item (hex format) (deprecated, use `--active-color` instead)\n * @deprecated use `--active-color` instead\n */\n activeTextColor: String,\n /**\n * @description optional, whether menu is collapsed when clicking outside\n */\n closeOnClickOutside: Boolean,\n /**\n * @description whether to enable the collapse transition\n */\n collapseTransition: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the menu is ellipsis (available only in horizontal mode)\n */\n ellipsis: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the popper (effective for all submenus)\n */\n popperOffset: {\n type: Number,\n default: 6,\n },\n /**\n * @description custom ellipsis icon (available only in horizontal mode and ellipsis is true)\n */\n ellipsisIcon: {\n type: iconPropType,\n default: () => More,\n },\n /**\n * @description Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed\n */\n popperEffect: {\n type: definePropType<PopperEffect>(String),\n default: 'dark',\n },\n /**\n * @description custom class name for all popup menus\n */\n popperClass: String,\n /**\n * @description custom style for all popup menus\n */\n popperStyle: {\n type: definePropType<string | CSSProperties>([String, Object]),\n },\n /**\n * @description control timeout for all menus before showing\n */\n showTimeout: {\n type: Number,\n default: 300,\n },\n /**\n * @description control timeout for all menus before hiding\n */\n hideTimeout: {\n type: Number,\n default: 300,\n },\n /**\n * @description when menu inactive and `persistent` is `false` , dropdown menu will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n widget: String,\n} as const)\nexport type MenuProps = ExtractPropTypes<typeof menuProps>\nexport type MenuPropsPublic = ExtractPublicPropTypes<typeof menuProps>\n\nconst checkIndexPath = (indexPath: unknown): indexPath is string[] =>\n isArray(indexPath) && indexPath.every((path) => isString(path))\n\nexport const menuEmits = {\n close: (index: string, indexPath: string[]) =>\n isString(index) && checkIndexPath(indexPath),\n\n open: (index: string, indexPath: string[]) =>\n isString(index) && checkIndexPath(indexPath),\n\n select: (\n index: string,\n indexPath: string[],\n item: MenuItemClicked,\n routerResult?: Promise<void | NavigationFailure>\n ) =>\n isString(index) &&\n checkIndexPath(indexPath) &&\n isObject(item) &&\n (isUndefined(routerResult) || routerResult instanceof Promise),\n}\nexport type MenuEmits = typeof menuEmits\n\nconst DEFAULT_MORE_ITEM_WIDTH = 64\n\nexport default defineComponent({\n name: 'ElMenu',\n\n props: menuProps,\n emits: menuEmits,\n\n setup(props, { emit, slots, expose }) {\n const instance = getCurrentInstance()!\n const router = instance.appContext.config.globalProperties.$router as Router\n const menu = ref<HTMLUListElement>()\n const subMenu = ref<HTMLElement>()\n const nsMenu = useNamespace('menu')\n const nsSubMenu = useNamespace('sub-menu')\n let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH\n\n // data\n const sliceIndex = ref(-1)\n\n const openedMenus = ref<MenuProvider['openedMenus']>(\n props.defaultOpeneds && !props.collapse\n ? props.defaultOpeneds.slice(0)\n : []\n )\n const activeIndex = ref<MenuProvider['activeIndex']>(props.defaultActive)\n const items = ref<MenuProvider['items']>({})\n const subMenus = ref<MenuProvider['subMenus']>({})\n\n // computed\n const isMenuPopup = computed<MenuProvider['isMenuPopup']>(\n () =>\n props.mode === 'horizontal' ||\n (props.mode === 'vertical' && props.collapse)\n )\n\n // methods\n const initMenu = () => {\n const activeItem = activeIndex.value && items.value[activeIndex.value]\n if (!activeItem || props.mode === 'horizontal' || props.collapse) return\n\n const indexPath = activeItem.indexPath\n\n // 展开该菜单项的路径上所有子菜单\n // expand all subMenus of the menu item\n indexPath.forEach((index) => {\n const subMenu = subMenus.value[index]\n subMenu && openMenu(index, subMenu.indexPath)\n })\n }\n\n const openMenu: MenuProvider['openMenu'] = (index, indexPath) => {\n if (openedMenus.value.includes(index)) return\n // 将不在该菜单路径下的其余菜单收起\n // collapse all menu that are not under current menu item\n if (props.uniqueOpened) {\n openedMenus.value = openedMenus.value.filter((index: string) =>\n indexPath.includes(index)\n )\n }\n openedMenus.value.push(index)\n emit('open', index, indexPath)\n }\n\n const close = (index: string) => {\n const i = openedMenus.value.indexOf(index)\n if (i !== -1) {\n openedMenus.value.splice(i, 1)\n }\n }\n\n const closeMenu: MenuProvider['closeMenu'] = (index, indexPath) => {\n close(index)\n emit('close', index, indexPath)\n }\n\n const handleSubMenuClick: MenuProvider['handleSubMenuClick'] = ({\n index,\n indexPath,\n }) => {\n const isOpened = openedMenus.value.includes(index)\n\n isOpened ? closeMenu(index, indexPath) : openMenu(index, indexPath)\n }\n\n const handleMenuItemClick: MenuProvider['handleMenuItemClick'] = (\n menuItem\n ) => {\n if (props.mode === 'horizontal' || props.collapse) {\n openedMenus.value = []\n }\n const { index, indexPath } = menuItem\n if (isNil(index) || isNil(indexPath)) return\n\n if (props.router && router) {\n const route = menuItem.route || index\n const routerResult = router.push(route).then((res) => {\n if (!res) activeIndex.value = index\n return res\n })\n emit(\n 'select',\n index,\n indexPath,\n { index, indexPath, route },\n routerResult\n )\n } else {\n activeIndex.value = index\n emit('select', index, indexPath, { index, indexPath })\n }\n }\n\n const updateActiveIndex = (val: string) => {\n const itemsInData = items.value\n const item =\n itemsInData[val] ||\n (activeIndex.value && itemsInData[activeIndex.value]) ||\n itemsInData[props.defaultActive]\n\n activeIndex.value = item?.index ?? val\n }\n\n const calcMenuItemWidth = (menuItem: HTMLElement) => {\n const computedStyle = getComputedStyle(menuItem)\n const marginLeft = Number.parseInt(computedStyle.marginLeft, 10)\n const marginRight = Number.parseInt(computedStyle.marginRight, 10)\n return menuItem.offsetWidth + marginLeft + marginRight || 0\n }\n\n const calcSliceIndex = () => {\n if (!menu.value) return -1\n\n const items = Array.from(menu.value.childNodes).filter(\n (item) =>\n item.nodeName !== '#comment' &&\n (item.nodeName !== '#text' || item.nodeValue)\n ) as HTMLElement[]\n\n const computedMenuStyle = getComputedStyle(menu.value)\n const paddingLeft = Number.parseInt(computedMenuStyle.paddingLeft, 10)\n const paddingRight = Number.parseInt(computedMenuStyle.paddingRight, 10)\n const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight\n\n let calcWidth = 0\n let sliceIndex = 0\n items.forEach((item, index) => {\n calcWidth += calcMenuItemWidth(item)\n if (calcWidth <= menuWidth - moreItemWidth) {\n sliceIndex = index + 1\n }\n })\n return sliceIndex === items.length ? -1 : sliceIndex\n }\n\n const getIndexPath = (index: string) => subMenus.value[index].indexPath\n\n // Common computer monitor FPS is 60Hz, which means 60 redraws per second. Calculation formula: 1000ms/60 ≈ 16.67ms, In order to avoid a certain chance of repeated triggering when `resize`, set wait to 16.67 * 2 = 33.34\n const debounce = (fn: () => void, wait = 33.34) => {\n let timer: ReturnType<typeof setTimeout> | null\n return () => {\n timer && clearTimeout(timer)\n timer = setTimeout(() => {\n fn()\n }, wait)\n }\n }\n\n let isFirstTimeRender = true\n const handleResize = () => {\n const el = unrefElement(subMenu)\n if (el) moreItemWidth = calcMenuItemWidth(el) || DEFAULT_MORE_ITEM_WIDTH\n if (sliceIndex.value === calcSliceIndex()) return\n const callback = () => {\n sliceIndex.value = -1\n nextTick(() => {\n sliceIndex.value = calcSliceIndex()\n })\n }\n // execute callback directly when first time resize to avoid shaking\n isFirstTimeRender ? callback() : debounce(callback)()\n isFirstTimeRender = false\n }\n\n watch(\n () => props.defaultActive,\n (currentActive) => {\n if (!items.value[currentActive]) {\n activeIndex.value = ''\n }\n updateActiveIndex(currentActive)\n }\n )\n\n watch(\n () => props.collapse,\n (value) => {\n if (value) openedMenus.value = []\n }\n )\n\n watch(items.value, initMenu)\n\n let resizeStopper: UseResizeObserverReturn['stop']\n watchEffect(() => {\n if (props.mode === 'horizontal' && props.ellipsis)\n resizeStopper = useResizeObserver(menu, handleResize).stop\n else resizeStopper?.()\n })\n\n const mouseInChild = ref(false)\n\n // provide\n {\n const addSubMenu: MenuProvider['addSubMenu'] = (item) => {\n subMenus.value[item.index] = item\n }\n\n const removeSubMenu: MenuProvider['removeSubMenu'] = (item) => {\n delete subMenus.value[item.index]\n }\n\n const addMenuItem: MenuProvider['addMenuItem'] = (item) => {\n items.value[item.index] = item\n }\n\n const removeMenuItem: MenuProvider['removeMenuItem'] = (item) => {\n delete items.value[item.index]\n }\n\n provide<MenuProvider>(\n MENU_INJECTION_KEY,\n reactive({\n props,\n openedMenus,\n items,\n subMenus,\n activeIndex,\n isMenuPopup,\n\n addMenuItem,\n removeMenuItem,\n addSubMenu,\n removeSubMenu,\n openMenu,\n closeMenu,\n handleMenuItemClick,\n handleSubMenuClick,\n })\n )\n\n provide<SubMenuProvider>(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {\n addSubMenu,\n removeSubMenu,\n mouseInChild,\n level: 0,\n })\n }\n\n // lifecycle\n onMounted(() => {\n if (props.mode === 'horizontal') {\n new Menubar(instance.vnode.el!, nsMenu.namespace.value)\n }\n })\n\n {\n const open = (index: string) => {\n const { indexPath } = subMenus.value[index]\n indexPath.forEach((i) => openMenu(i, indexPath))\n }\n\n expose({\n open,\n close,\n updateActiveIndex,\n handleResize,\n })\n }\n\n const ulStyle = useMenuCssVar(props, 0)\n\n return () => {\n let slot: VNodeArrayChildren = slots.default?.() ?? []\n const vShowMore: VNode[] = []\n\n if (props.mode === 'horizontal' && menu.value) {\n const originalSlot = (\n flattedChildren(slot) as VNodeArrayChildren\n ).filter((vnode) => {\n // Filter text and comment nodes (https://github.com/vuejs/core/blob/c875019d49b4c36a88d929ccadc31ad414747c7b/packages/shared/src/shapeFlags.ts#L5)\n return (vnode as VNode)?.shapeFlag !== 8\n })\n const slotDefault =\n sliceIndex.value === -1\n ? originalSlot\n : originalSlot.slice(0, sliceIndex.value)\n\n const slotMore =\n sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value)\n\n if (slotMore?.length && props.ellipsis) {\n slot = slotDefault\n vShowMore.push(\n h(\n ElSubMenu,\n {\n ref: subMenu,\n index: 'sub-menu-more',\n class: nsSubMenu.e('hide-arrow'),\n popperOffset: props.popperOffset,\n },\n {\n title: () =>\n h(\n ElIcon,\n {\n class: nsSubMenu.e('icon-more'),\n },\n {\n default: () => h(props.ellipsisIcon as Component),\n }\n ),\n default: () => slotMore,\n }\n )\n )\n }\n }\n\n const directives: DirectiveArguments = props.closeOnClickOutside\n ? [\n [\n vClickoutside,\n () => {\n if (!openedMenus.value.length) return\n\n if (!mouseInChild.value) {\n openedMenus.value.forEach((openedMenu) =>\n emit('close', openedMenu, getIndexPath(openedMenu))\n )\n\n openedMenus.value = []\n }\n },\n ],\n ]\n : []\n\n const vMenu = withDirectives(\n h(\n 'ul',\n {\n key: String(props.collapse),\n role: 'menubar',\n ref: menu,\n style: ulStyle.value,\n class: {\n [nsMenu.b()]: true,\n [nsMenu.m(props.mode)]: true,\n [nsMenu.m('collapse')]: props.collapse,\n },\n widget: props.widget,\n },\n [...slot, ...vShowMore]\n ),\n directives\n )\n\n if (props.collapseTransition && props.mode === 'vertical') {\n return h(ElMenuCollapseTransition, () => vMenu)\n }\n\n return vMenu\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAa,YAAYA,gBAAAA,WAAW;;;;CAIlC,MAAM;EACJ,MAAM;EACN,QAAQ,CAAC,cAAc,UAAU;EACjC,S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A;IACE,KAAK,OAAO,MAAM,QAAQ;IAC1B,MAAM;IACN,KAAK;IACL,OAAO,QAAQ;IACf,OAAO;MACJ,OAAO,EAAE,IAAI;MACb,OAAO,EAAE,MAAM,IAAI,IAAI;MACvB,OAAO,EAAE,UAAU,IAAI,MAAM;IAChC;IACA,QAAQ,MAAM;GAChB,GACA,CAAC,GAAG,MAAM,GAAG,SAAS,CACxB,GACA,UACF;GAEA,IAAI,MAAM,sBAAsB,MAAM,SAAS,YAC7C,QAAA,GAAA,IAAA,EAAA,CAASC,iCAAAA,eAAgC,KAAK;GAGhD,OAAO;EACT;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"menu.js","names":["buildProps","definePropType","mutable","iconPropType","More","isUndefined","useNamespace","MENU_INJECTION_KEY","SUB_MENU_INJECTION_KEY","Menubar","useMenuCssVar","flattedChildren","ElSubMenu","ElIcon","vClickoutside","ElMenuCollapseTransition"],"sources":["../../../../../../packages/components/menu/src/menu.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n nextTick,\n onMounted,\n provide,\n reactive,\n ref,\n withDirectives,\n} from 'vue'\nimport { watch, watchEffect } from '../../config-provider'\nimport { unrefElement, useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport ElIcon from '@element-plus/components/icon'\nimport { More } from '@element-plus/icons-vue'\nimport {\n buildProps,\n definePropType,\n flattedChildren,\n iconPropType,\n isArray,\n isObject,\n isString,\n isUndefined,\n mutable,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { ClickOutside as vClickoutside } from '@element-plus/directives'\nimport Menubar from './utils/menu-bar'\nimport ElMenuCollapseTransition from './menu-collapse-transition.vue'\nimport ElSubMenu from './sub-menu'\nimport { useMenuCssVar } from './use-menu-css-var'\nimport { MENU_INJECTION_KEY, SUB_MENU_INJECTION_KEY } from './tokens'\n\nimport type { PopperEffect } from '@element-plus/components/popper'\nimport type { MenuItemClicked, MenuProvider, SubMenuProvider } from './types'\nimport type { NavigationFailure, Router } from 'vue-router'\nimport type {\n CSSProperties,\n Component,\n DirectiveArguments,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n VNode,\n VNodeArrayChildren,\n} from 'vue'\nimport type { UseResizeObserverReturn } from '@vueuse/core'\n\nexport const menuProps = buildProps({\n /**\n * @description menu display mode\n */\n mode: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'vertical',\n },\n /**\n * @description index of active menu on page load\n */\n defaultActive: {\n type: String,\n default: '',\n },\n /**\n * @description array that contains indexes of currently active sub-menus\n */\n defaultOpeneds: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n /**\n * @description whether only one sub-menu can be active\n */\n uniqueOpened: Boolean,\n /**\n * @description whether `vue-router` mode is activated. If true, index will be used as 'path' to activate the route action. Use with `default-active` to set the active item on load.\n */\n router: Boolean,\n /**\n * @description how sub-menus are triggered, only works when `mode` is 'horizontal'\n */\n menuTrigger: {\n type: String,\n values: ['hover', 'click'],\n default: 'hover',\n },\n /**\n * @description whether the menu is collapsed (available only in vertical mode)\n */\n collapse: Boolean,\n /**\n * @description background color of Menu (hex format) (deprecated, use `--bg-color` instead)\n * @deprecated use `--bg-color` instead\n */\n backgroundColor: String,\n /**\n * @description text color of Menu (hex format) (deprecated, use `--text-color` instead)\n * @deprecated use `--text-color` instead\n */\n textColor: String,\n /**\n * @description text color of currently active menu item (hex format) (deprecated, use `--active-color` instead)\n * @deprecated use `--active-color` instead\n */\n activeTextColor: String,\n /**\n * @description optional, whether menu is collapsed when clicking outside\n */\n closeOnClickOutside: Boolean,\n /**\n * @description whether to enable the collapse transition\n */\n collapseTransition: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether the menu is ellipsis (available only in horizontal mode)\n */\n ellipsis: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the popper (effective for all submenus)\n */\n popperOffset: {\n type: Number,\n default: 6,\n },\n /**\n * @description custom ellipsis icon (available only in horizontal mode and ellipsis is true)\n */\n ellipsisIcon: {\n type: iconPropType,\n default: () => More,\n },\n /**\n * @description Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed\n */\n popperEffect: {\n type: definePropType<PopperEffect>(String),\n default: 'dark',\n },\n /**\n * @description custom class name for all popup menus\n */\n popperClass: String,\n /**\n * @description custom style for all popup menus\n */\n popperStyle: {\n type: definePropType<string | CSSProperties>([String, Object]),\n },\n /**\n * @description control timeout for all menus before showing\n */\n showTimeout: {\n type: Number,\n default: 300,\n },\n /**\n * @description control timeout for all menus before hiding\n */\n hideTimeout: {\n type: Number,\n default: 300,\n },\n /**\n * @description when menu inactive and `persistent` is `false` , dropdown menu will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n widget: String,\n} as const)\nexport type MenuProps = ExtractPropTypes<typeof menuProps>\nexport type MenuPropsPublic = ExtractPublicPropTypes<typeof menuProps>\n\nconst checkIndexPath = (indexPath: unknown): indexPath is string[] =>\n isArray(indexPath) && indexPath.every((path) => isString(path))\n\nexport const menuEmits = {\n close: (index: string, indexPath: string[]) =>\n isString(index) && checkIndexPath(indexPath),\n\n open: (index: string, indexPath: string[]) =>\n isString(index) && checkIndexPath(indexPath),\n\n select: (\n index: string,\n indexPath: string[],\n item: MenuItemClicked,\n routerResult?: Promise<void | NavigationFailure>\n ) =>\n isString(index) &&\n checkIndexPath(indexPath) &&\n isObject(item) &&\n (isUndefined(routerResult) || routerResult instanceof Promise),\n}\nexport type MenuEmits = typeof menuEmits\n\nconst DEFAULT_MORE_ITEM_WIDTH = 64\n\nexport default defineComponent({\n name: 'ElMenu',\n\n props: menuProps,\n emits: menuEmits,\n\n setup(props, { emit, slots, expose }) {\n const instance = getCurrentInstance()!\n const router = instance.appContext.config.globalProperties.$router as Router\n const menu = ref<HTMLUListElement>()\n const subMenu = ref<HTMLElement>()\n const nsMenu = useNamespace('menu')\n const nsSubMenu = useNamespace('sub-menu')\n let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH\n\n // data\n const sliceIndex = ref(-1)\n\n const openedMenus = ref<MenuProvider['openedMenus']>(\n props.defaultOpeneds && !props.collapse\n ? props.defaultOpeneds.slice(0)\n : []\n )\n const activeIndex = ref<MenuProvider['activeIndex']>(props.defaultActive)\n const items = ref<MenuProvider['items']>({})\n const subMenus = ref<MenuProvider['subMenus']>({})\n\n // computed\n const isMenuPopup = computed<MenuProvider['isMenuPopup']>(\n () =>\n props.mode === 'horizontal' ||\n (props.mode === 'vertical' && props.collapse)\n )\n\n // methods\n const initMenu = () => {\n const activeItem = activeIndex.value && items.value[activeIndex.value]\n if (!activeItem || props.mode === 'horizontal' || props.collapse) return\n\n const indexPath = activeItem.indexPath\n\n // 展开该菜单项的路径上所有子菜单\n // expand all subMenus of the menu item\n indexPath.forEach((index) => {\n const subMenu = subMenus.value[index]\n subMenu && openMenu(index, subMenu.indexPath)\n })\n }\n\n const openMenu: MenuProvider['openMenu'] = (index, indexPath) => {\n if (openedMenus.value.includes(index)) return\n // 将不在该菜单路径下的其余菜单收起\n // collapse all menu that are not under current menu item\n if (props.uniqueOpened) {\n openedMenus.value = openedMenus.value.filter((index: string) =>\n indexPath.includes(index)\n )\n }\n openedMenus.value.push(index)\n emit('open', index, indexPath)\n }\n\n const close = (index: string) => {\n const i = openedMenus.value.indexOf(index)\n if (i !== -1) {\n openedMenus.value.splice(i, 1)\n }\n }\n\n const closeMenu: MenuProvider['closeMenu'] = (index, indexPath) => {\n close(index)\n emit('close', index, indexPath)\n }\n\n const handleSubMenuClick: MenuProvider['handleSubMenuClick'] = ({\n index,\n indexPath,\n }) => {\n const isOpened = openedMenus.value.includes(index)\n\n isOpened ? closeMenu(index, indexPath) : openMenu(index, indexPath)\n }\n\n const handleMenuItemClick: MenuProvider['handleMenuItemClick'] = (\n menuItem\n ) => {\n if (props.mode === 'horizontal' || props.collapse) {\n openedMenus.value = []\n }\n const { index, indexPath } = menuItem\n if (isNil(index) || isNil(indexPath)) return\n\n if (props.router && router) {\n const route = menuItem.route || index\n const routerResult = router.push(route).then((res) => {\n if (!res) activeIndex.value = index\n return res\n })\n emit(\n 'select',\n index,\n indexPath,\n { index, indexPath, route },\n routerResult\n )\n } else {\n activeIndex.value = index\n emit('select', index, indexPath, { index, indexPath })\n }\n }\n\n const updateActiveIndex = (val: string) => {\n const itemsInData = items.value\n const item =\n itemsInData[val] ||\n (activeIndex.value && itemsInData[activeIndex.value]) ||\n itemsInData[props.defaultActive]\n\n activeIndex.value = item?.index ?? val\n }\n\n const calcMenuItemWidth = (menuItem: HTMLElement) => {\n const computedStyle = getComputedStyle(menuItem)\n const marginLeft = Number.parseInt(computedStyle.marginLeft, 10)\n const marginRight = Number.parseInt(computedStyle.marginRight, 10)\n return menuItem.offsetWidth + marginLeft + marginRight || 0\n }\n\n const calcSliceIndex = () => {\n if (!menu.value) return -1\n\n const items = Array.from(menu.value.childNodes).filter(\n (item) =>\n item.nodeName !== '#comment' &&\n (item.nodeName !== '#text' || item.nodeValue)\n ) as HTMLElement[]\n\n const computedMenuStyle = getComputedStyle(menu.value)\n const paddingLeft = Number.parseInt(computedMenuStyle.paddingLeft, 10)\n const paddingRight = Number.parseInt(computedMenuStyle.paddingRight, 10)\n const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight\n\n let calcWidth = 0\n let sliceIndex = 0\n items.forEach((item, index) => {\n calcWidth += calcMenuItemWidth(item)\n if (calcWidth <= menuWidth - moreItemWidth) {\n sliceIndex = index + 1\n }\n })\n return sliceIndex === items.length ? -1 : sliceIndex\n }\n\n const getIndexPath = (index: string) => subMenus.value[index].indexPath\n\n // Common computer monitor FPS is 60Hz, which means 60 redraws per second. Calculation formula: 1000ms/60 ≈ 16.67ms, In order to avoid a certain chance of repeated triggering when `resize`, set wait to 16.67 * 2 = 33.34\n const debounce = (fn: () => void, wait = 33.34) => {\n let timer: ReturnType<typeof setTimeout> | null\n return () => {\n timer && clearTimeout(timer)\n timer = setTimeout(() => {\n fn()\n }, wait)\n }\n }\n\n let isFirstTimeRender = true\n const handleResize = () => {\n const el = unrefElement(subMenu)\n if (el) moreItemWidth = calcMenuItemWidth(el) || DEFAULT_MORE_ITEM_WIDTH\n if (sliceIndex.value === calcSliceIndex()) return\n const callback = () => {\n sliceIndex.value = -1\n nextTick(() => {\n sliceIndex.value = calcSliceIndex()\n })\n }\n // execute callback directly when first time resize to avoid shaking\n isFirstTimeRender ? callback() : debounce(callback)()\n isFirstTimeRender = false\n }\n\n watch(\n () => props.defaultActive,\n (currentActive) => {\n if (!items.value[currentActive]) {\n activeIndex.value = ''\n }\n updateActiveIndex(currentActive)\n }\n )\n\n watch(\n () => props.collapse,\n (value) => {\n if (value) openedMenus.value = []\n }\n )\n\n watch(items.value, initMenu)\n\n let resizeStopper: UseResizeObserverReturn['stop']\n watchEffect(() => {\n if (props.mode === 'horizontal' && props.ellipsis)\n resizeStopper = useResizeObserver(menu, handleResize).stop\n else resizeStopper?.()\n })\n\n const mouseInChild = ref(false)\n\n // provide\n {\n const addSubMenu: MenuProvider['addSubMenu'] = (item) => {\n subMenus.value[item.index] = item\n }\n\n const removeSubMenu: MenuProvider['removeSubMenu'] = (item) => {\n delete subMenus.value[item.index]\n }\n\n const addMenuItem: MenuProvider['addMenuItem'] = (item) => {\n items.value[item.index] = item\n }\n\n const removeMenuItem: MenuProvider['removeMenuItem'] = (item) => {\n delete items.value[item.index]\n }\n\n provide<MenuProvider>(\n MENU_INJECTION_KEY,\n reactive({\n props,\n openedMenus,\n items,\n subMenus,\n activeIndex,\n isMenuPopup,\n\n addMenuItem,\n removeMenuItem,\n addSubMenu,\n removeSubMenu,\n openMenu,\n closeMenu,\n handleMenuItemClick,\n handleSubMenuClick,\n })\n )\n\n provide<SubMenuProvider>(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {\n addSubMenu,\n removeSubMenu,\n mouseInChild,\n level: 0,\n })\n }\n\n // lifecycle\n onMounted(() => {\n if (props.mode === 'horizontal') {\n new Menubar(instance.vnode.el!, nsMenu.namespace.value)\n }\n })\n\n {\n const open = (index: string) => {\n const { indexPath } = subMenus.value[index]\n indexPath.forEach((i) => openMenu(i, indexPath))\n }\n\n expose({\n open,\n close,\n updateActiveIndex,\n handleResize,\n })\n }\n\n const ulStyle = useMenuCssVar(props, 0)\n\n return () => {\n let slot: VNodeArrayChildren = slots.default?.() ?? []\n const vShowMore: VNode[] = []\n\n if (props.mode === 'horizontal' && menu.value) {\n const originalSlot = (\n flattedChildren(slot) as VNodeArrayChildren\n ).filter((vnode) => {\n // Filter text and comment nodes (https://github.com/vuejs/core/blob/c875019d49b4c36a88d929ccadc31ad414747c7b/packages/shared/src/shapeFlags.ts#L5)\n return (vnode as VNode)?.shapeFlag !== 8\n })\n const slotDefault =\n sliceIndex.value === -1\n ? originalSlot\n : originalSlot.slice(0, sliceIndex.value)\n\n const slotMore =\n sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value)\n\n if (slotMore?.length && props.ellipsis) {\n slot = slotDefault\n vShowMore.push(\n h(\n ElSubMenu,\n {\n ref: subMenu,\n index: 'sub-menu-more',\n class: nsSubMenu.e('hide-arrow'),\n popperOffset: props.popperOffset,\n },\n {\n title: () =>\n h(\n ElIcon,\n {\n class: nsSubMenu.e('icon-more'),\n },\n {\n default: () => h(props.ellipsisIcon as Component),\n }\n ),\n default: () => slotMore,\n }\n )\n )\n }\n }\n\n const directives: DirectiveArguments = props.closeOnClickOutside\n ? [\n [\n vClickoutside,\n () => {\n if (!openedMenus.value.length) return\n\n if (!mouseInChild.value) {\n openedMenus.value.forEach((openedMenu) =>\n emit('close', openedMenu, getIndexPath(openedMenu))\n )\n\n openedMenus.value = []\n }\n },\n ],\n ]\n : []\n\n const vMenu = withDirectives(\n h(\n 'ul',\n {\n key: String(props.collapse),\n role: 'menubar',\n ref: menu,\n style: ulStyle.value,\n class: {\n [nsMenu.b()]: true,\n [nsMenu.m(props.mode)]: true,\n [nsMenu.m('collapse')]: props.collapse,\n },\n widget: props.widget,\n },\n [...slot, ...vShowMore]\n ),\n directives\n )\n\n if (props.collapseTransition && props.mode === 'vertical') {\n return h(ElMenuCollapseTransition, () => vMenu)\n }\n\n return vMenu\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAa,YAAYA,gBAAAA,WAAW;;;;CAIlC,MAAM;EACJ,MAAM;EACN,QAAQ,CAAC,cAAc,UAAU;EACjC,SAAS;CACX;;;;CAIA,eAAe;EACb,MAAM;EACN,SAAS;CACX;;;;CAIA,gBAAgB;EACd,MAAMC,gBAAAA,eAAyB,KAAK;EACpC,eAAeC,mBAAAA,QAAQ,CAAC,CAAU;CACpC;;;;CAIA,cAAc;;;;CAId,QAAQ;;;;CAIR,aAAa;EACX,MAAM;EACN,QAAQ,CAAC,SAAS,OAAO;EACzB,SAAS;CACX;;;;CAIA,UAAU;;;;;CAKV,iBAAiB;;;;;CAKjB,WAAW;;;;;CAKX,iBAAiB;;;;CAIjB,qBAAqB;;;;CAIrB,oBAAoB;EAClB,MAAM;EACN,SAAS;CACX;;;;CAIA,UAAU;EACR,MAAM;EACN,SAAS;CACX;;;;CAIA,cAAc;EACZ,MAAM;EACN,SAAS;CACX;;;;CAIA,cAAc;EACZ,MAAMC,aAAAA;EACN,eAAeC,wBAAAA;CACjB;;;;CAIA,cAAc;EACZ,MAAMH,gBAAAA,eAA6B,MAAM;EACzC,SAAS;CACX;;;;CAIA,aAAa;;;;CAIb,aAAa,EACX,MAAMA,gBAAAA,eAAuC,CAAC,QAAQ,MAAM,CAAC,EAC/D;;;;CAIA,aAAa;EACX,MAAM;EACN,SAAS;CACX;;;;CAIA,aAAa;EACX,MAAM;EACN,SAAS;CACX;;;;CAIA,YAAY;EACV,MAAM;EACN,SAAS;CACX;CACA,QAAQ;AACV,CAAU;AAIV,MAAM,kBAAkB,eAAA,GAAA,YAAA,QAAA,CACd,SAAS,KAAK,UAAU,OAAO,UAAA,GAAA,YAAA,SAAA,CAAkB,IAAI,CAAC;AAEhE,MAAa,YAAY;CACvB,QAAQ,OAAe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;IAE/B,IAAI,CAAC,aAAa,OAAO;KACvB,YAAY,MAAM,SAAS,eACzB,KAAK,SAAS,YAAY,aAAa,UAAU,CAAC,CACpD;KAEA,YAAY,QAAQ,CAAC;IACvB;GACF,CACF,CACF,IACA,CAAC;GAEL,MAAM,SAAA,GAAA,IAAA,eAAA,EAAA,GAAA,IAAA,EAAA,CAEF,MACA;IACE,KAAK,OAAO,MAAM,QAAQ;IAC1B,MAAM;IACN,KAAK;IACL,OAAO,QAAQ;IACf,OAAO;MACJ,OAAO,EAAE,IAAI;MACb,OAAO,EAAE,MAAM,IAAI,IAAI;MACvB,OAAO,EAAE,UAAU,IAAI,MAAM;IAChC;IACA,QAAQ,MAAM;GAChB,GACA,CAAC,GAAG,MAAM,GAAG,SAAS,CACxB,GACA,UACF;GAEA,IAAI,MAAM,sBAAsB,MAAM,SAAS,YAC7C,QAAA,GAAA,IAAA,EAAA,CAASC,iCAAAA,eAAgC,KAAK;GAGhD,OAAO;EACT;CACF;AACF,CAAC"}
|
|
@@ -137,8 +137,8 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
137
137
|
__epPropKey: true;
|
|
138
138
|
};
|
|
139
139
|
}>> & Readonly<{}>, {
|
|
140
|
-
readonly disabled: boolean;
|
|
141
140
|
readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
141
|
+
readonly disabled: boolean;
|
|
142
142
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
143
143
|
//#endregion
|
|
144
144
|
export { SubMenuProps, SubMenuPropsPublic, _default as default, subMenuProps };
|
|
@@ -10,7 +10,7 @@ type MessageContext = {
|
|
|
10
10
|
vm: ComponentInternalInstance;
|
|
11
11
|
props: Mutable<MessageProps>;
|
|
12
12
|
};
|
|
13
|
-
declare const placementInstances: import("vue").ShallowReactive<Record<"
|
|
13
|
+
declare const placementInstances: import("vue").ShallowReactive<Record<"top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", MessageContext[]>>;
|
|
14
14
|
declare const getOrCreatePlacementInstances: (placement: MessagePlacement) => MessageContext[];
|
|
15
15
|
declare const getInstance: (id: string, placement: MessagePlacement) => {
|
|
16
16
|
current: MessageContext;
|
|
@@ -129,10 +129,10 @@ declare const messageProps: {
|
|
|
129
129
|
readonly prototype: any;
|
|
130
130
|
}) | null)[], unknown, unknown, undefined, boolean>;
|
|
131
131
|
readonly showClose: EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
132
|
-
readonly type: EpPropFinalized<StringConstructor, "
|
|
132
|
+
readonly type: EpPropFinalized<StringConstructor, "info" | "primary" | "success" | "warning" | "error", unknown, "info", boolean>;
|
|
133
133
|
readonly plain: EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
134
134
|
readonly offset: EpPropFinalized<NumberConstructor, unknown, unknown, 16, boolean>;
|
|
135
|
-
readonly placement: EpPropFinalized<StringConstructor, "
|
|
135
|
+
readonly placement: EpPropFinalized<StringConstructor, "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right", unknown, undefined, boolean>;
|
|
136
136
|
readonly zIndex: EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
137
137
|
readonly grouping: EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
138
138
|
readonly repeatNum: EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
|
|
@@ -15,17 +15,17 @@ declare const __VLS_base: import("vue").DefineComponent<MessageProps, {
|
|
|
15
15
|
}, string, import("vue").PublicProps, Readonly<MessageProps> & Readonly<{
|
|
16
16
|
onDestroy?: (() => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
|
+
zIndex: number;
|
|
19
|
+
offset: number;
|
|
18
20
|
type: MessageType;
|
|
19
21
|
onClose: () => void;
|
|
22
|
+
id: string;
|
|
20
23
|
icon: IconPropType;
|
|
21
|
-
zIndex: number;
|
|
22
|
-
offset: number;
|
|
23
24
|
placement: MessagePlacement;
|
|
24
|
-
id: string;
|
|
25
|
-
duration: number;
|
|
26
|
-
message: string | import("vue").VNode | (() => import("vue").VNode);
|
|
27
25
|
plain: boolean;
|
|
26
|
+
message: string | import("vue").VNode | (() => import("vue").VNode);
|
|
28
27
|
showClose: boolean;
|
|
28
|
+
duration: number;
|
|
29
29
|
customClass: string;
|
|
30
30
|
dangerouslyUseHTMLString: boolean;
|
|
31
31
|
grouping: boolean;
|
|
@@ -85,7 +85,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
85
85
|
}>;
|
|
86
86
|
contentId: import("vue").Ref<string, string>;
|
|
87
87
|
inputId: import("vue").Ref<string, string>;
|
|
88
|
-
btnSize: import("vue").ComputedRef<"
|
|
88
|
+
btnSize: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
89
89
|
iconComponent: import("vue").ComputedRef<string | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
90
90
|
new (...args: any[]): any;
|
|
91
91
|
__isFragment?: never;
|
|
@@ -225,7 +225,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
225
225
|
autofocus: import("vue").Ref<boolean, boolean>;
|
|
226
226
|
title: import("vue").Ref<string | undefined, string | undefined>;
|
|
227
227
|
message: import("vue").Ref<string, string>;
|
|
228
|
-
type: import("vue").Ref<"" | "
|
|
228
|
+
type: import("vue").Ref<"" | "info" | "primary" | "success" | "warning" | "error", "" | "info" | "primary" | "success" | "warning" | "error">;
|
|
229
229
|
icon: import("vue").Ref<string | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
230
230
|
new (...args: any[]): any;
|
|
231
231
|
__isFragment?: never;
|
|
@@ -4574,9 +4574,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4574
4574
|
onAction?: ((...args: any[]) => any) | undefined;
|
|
4575
4575
|
onVanish?: ((...args: any[]) => any) | undefined;
|
|
4576
4576
|
}>, {
|
|
4577
|
-
overflow: boolean;
|
|
4578
4577
|
center: boolean;
|
|
4579
4578
|
container: string;
|
|
4579
|
+
overflow: boolean;
|
|
4580
4580
|
closeOnClickModal: boolean;
|
|
4581
4581
|
closeOnPressEscape: boolean;
|
|
4582
4582
|
lockScroll: boolean;
|
|
@@ -4598,22 +4598,22 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4598
4598
|
}>, {
|
|
4599
4599
|
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
4600
4600
|
size: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
4601
|
-
type: import("vue").ComputedRef<"
|
|
4601
|
+
type: import("vue").ComputedRef<"" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
4602
4602
|
disabled: import("vue").ComputedRef<boolean>;
|
|
4603
4603
|
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
4604
4604
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4605
4605
|
click: (evt: MouseEvent) => void;
|
|
4606
4606
|
}, import("vue").PublicProps, {
|
|
4607
|
-
type: ButtonType;
|
|
4608
4607
|
text: boolean;
|
|
4608
|
+
type: ButtonType;
|
|
4609
|
+
disabled: boolean;
|
|
4609
4610
|
round: boolean;
|
|
4610
4611
|
dashed: boolean;
|
|
4611
|
-
disabled: boolean;
|
|
4612
|
-
tag: string | import("vue").Component;
|
|
4613
4612
|
nativeType: ButtonNativeType;
|
|
4614
4613
|
loadingIcon: IconPropType;
|
|
4615
4614
|
plain: boolean;
|
|
4616
4615
|
autoInsertSpace: boolean;
|
|
4616
|
+
tag: string | import("vue").Component;
|
|
4617
4617
|
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
4618
4618
|
P: {};
|
|
4619
4619
|
B: {};
|
|
@@ -4626,20 +4626,20 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4626
4626
|
}>, {
|
|
4627
4627
|
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
4628
4628
|
size: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
4629
|
-
type: import("vue").ComputedRef<"
|
|
4629
|
+
type: import("vue").ComputedRef<"" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
4630
4630
|
disabled: import("vue").ComputedRef<boolean>;
|
|
4631
4631
|
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
4632
4632
|
}, {}, {}, {}, {
|
|
4633
|
-
type: ButtonType;
|
|
4634
4633
|
text: boolean;
|
|
4634
|
+
type: ButtonType;
|
|
4635
|
+
disabled: boolean;
|
|
4635
4636
|
round: boolean;
|
|
4636
4637
|
dashed: boolean;
|
|
4637
|
-
disabled: boolean;
|
|
4638
|
-
tag: string | import("vue").Component;
|
|
4639
4638
|
nativeType: ButtonNativeType;
|
|
4640
4639
|
loadingIcon: IconPropType;
|
|
4641
4640
|
plain: boolean;
|
|
4642
4641
|
autoInsertSpace: boolean;
|
|
4642
|
+
tag: string | import("vue").Component;
|
|
4643
4643
|
}>;
|
|
4644
4644
|
__isFragment?: never;
|
|
4645
4645
|
__isTeleport?: never;
|
|
@@ -4649,22 +4649,22 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4649
4649
|
}>, {
|
|
4650
4650
|
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
4651
4651
|
size: import("vue").ComputedRef<"" | "default" | "small" | "large">;
|
|
4652
|
-
type: import("vue").ComputedRef<"
|
|
4652
|
+
type: import("vue").ComputedRef<"" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
4653
4653
|
disabled: import("vue").ComputedRef<boolean>;
|
|
4654
4654
|
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
4655
4655
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4656
4656
|
click: (evt: MouseEvent) => void;
|
|
4657
4657
|
}, string, {
|
|
4658
|
-
type: ButtonType;
|
|
4659
4658
|
text: boolean;
|
|
4659
|
+
type: ButtonType;
|
|
4660
|
+
disabled: boolean;
|
|
4660
4661
|
round: boolean;
|
|
4661
4662
|
dashed: boolean;
|
|
4662
|
-
disabled: boolean;
|
|
4663
|
-
tag: string | import("vue").Component;
|
|
4664
4663
|
nativeType: ButtonNativeType;
|
|
4665
4664
|
loadingIcon: IconPropType;
|
|
4666
4665
|
plain: boolean;
|
|
4667
4666
|
autoInsertSpace: boolean;
|
|
4667
|
+
tag: string | import("vue").Component;
|
|
4668
4668
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
4669
4669
|
$slots: {
|
|
4670
4670
|
loading?: (props: {}) => any;
|
|
@@ -4746,18 +4746,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4746
4746
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
4747
4747
|
ElInput: SFCWithInstall<{
|
|
4748
4748
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<InputProps> & Readonly<{
|
|
4749
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4750
|
+
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4749
4751
|
onInput?: ((value: string) => any) | undefined;
|
|
4752
|
+
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4753
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
4750
4754
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
4751
|
-
|
|
4752
|
-
|
|
4755
|
+
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4756
|
+
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4757
|
+
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4753
4758
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
4754
4759
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
4755
|
-
|
|
4756
|
-
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4757
|
-
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4758
|
-
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4759
|
-
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4760
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4760
|
+
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
4761
4761
|
}>, {
|
|
4762
4762
|
input: import("vue").ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
4763
4763
|
textarea: import("vue").ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
@@ -4772,18 +4772,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4772
4772
|
clear: (evt?: MouseEvent) => void;
|
|
4773
4773
|
resizeTextarea: () => void;
|
|
4774
4774
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4775
|
+
"update:modelValue": (value: string) => void;
|
|
4776
|
+
change: (value: string, evt?: Event | undefined) => void;
|
|
4775
4777
|
input: (value: string) => void;
|
|
4778
|
+
clear: (evt: MouseEvent | undefined) => void;
|
|
4779
|
+
focus: (evt: FocusEvent) => void;
|
|
4776
4780
|
blur: (evt: FocusEvent) => void;
|
|
4777
|
-
|
|
4778
|
-
|
|
4781
|
+
mouseleave: (evt: MouseEvent) => void;
|
|
4782
|
+
mouseenter: (evt: MouseEvent) => void;
|
|
4783
|
+
keydown: (evt: Event | KeyboardEvent) => void;
|
|
4779
4784
|
compositionstart: (evt: CompositionEvent) => void;
|
|
4780
4785
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
4781
|
-
|
|
4782
|
-
keydown: (evt: Event | KeyboardEvent) => void;
|
|
4783
|
-
mouseenter: (evt: MouseEvent) => void;
|
|
4784
|
-
mouseleave: (evt: MouseEvent) => void;
|
|
4785
|
-
clear: (evt: MouseEvent | undefined) => void;
|
|
4786
|
-
"update:modelValue": (value: string) => void;
|
|
4786
|
+
compositionend: (evt: CompositionEvent) => void;
|
|
4787
4787
|
}, import("vue").PublicProps, {
|
|
4788
4788
|
type: InputType;
|
|
4789
4789
|
disabled: boolean;
|
|
@@ -4804,18 +4804,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4804
4804
|
M: {};
|
|
4805
4805
|
Defaults: {};
|
|
4806
4806
|
}, Readonly<InputProps> & Readonly<{
|
|
4807
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4808
|
+
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4807
4809
|
onInput?: ((value: string) => any) | undefined;
|
|
4810
|
+
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4811
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
4808
4812
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
4809
|
-
|
|
4810
|
-
|
|
4813
|
+
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4814
|
+
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4815
|
+
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4811
4816
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
4812
4817
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
4813
|
-
|
|
4814
|
-
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4815
|
-
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4816
|
-
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4817
|
-
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4818
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4818
|
+
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
4819
4819
|
}>, {
|
|
4820
4820
|
input: import("vue").ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
4821
4821
|
textarea: import("vue").ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
@@ -4846,18 +4846,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4846
4846
|
__isTeleport?: never;
|
|
4847
4847
|
__isSuspense?: never;
|
|
4848
4848
|
} & import("vue").ComponentOptionsBase<Readonly<InputProps> & Readonly<{
|
|
4849
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4850
|
+
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4849
4851
|
onInput?: ((value: string) => any) | undefined;
|
|
4852
|
+
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4853
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
4850
4854
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
4851
|
-
|
|
4852
|
-
|
|
4855
|
+
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4856
|
+
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4857
|
+
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4853
4858
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
4854
4859
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
4855
|
-
|
|
4856
|
-
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4857
|
-
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4858
|
-
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4859
|
-
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4860
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4860
|
+
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
4861
4861
|
}>, {
|
|
4862
4862
|
input: import("vue").ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
4863
4863
|
textarea: import("vue").ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
@@ -4872,18 +4872,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
4872
4872
|
clear: (evt?: MouseEvent) => void;
|
|
4873
4873
|
resizeTextarea: () => void;
|
|
4874
4874
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4875
|
+
"update:modelValue": (value: string) => void;
|
|
4876
|
+
change: (value: string, evt?: Event | undefined) => void;
|
|
4875
4877
|
input: (value: string) => void;
|
|
4878
|
+
clear: (evt: MouseEvent | undefined) => void;
|
|
4879
|
+
focus: (evt: FocusEvent) => void;
|
|
4876
4880
|
blur: (evt: FocusEvent) => void;
|
|
4877
|
-
|
|
4878
|
-
|
|
4881
|
+
mouseleave: (evt: MouseEvent) => void;
|
|
4882
|
+
mouseenter: (evt: MouseEvent) => void;
|
|
4883
|
+
keydown: (evt: Event | KeyboardEvent) => void;
|
|
4879
4884
|
compositionstart: (evt: CompositionEvent) => void;
|
|
4880
4885
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
4881
|
-
|
|
4882
|
-
keydown: (evt: Event | KeyboardEvent) => void;
|
|
4883
|
-
mouseenter: (evt: MouseEvent) => void;
|
|
4884
|
-
mouseleave: (evt: MouseEvent) => void;
|
|
4885
|
-
clear: (evt: MouseEvent | undefined) => void;
|
|
4886
|
-
"update:modelValue": (value: string) => void;
|
|
4886
|
+
compositionend: (evt: CompositionEvent) => void;
|
|
4887
4887
|
}, string, {
|
|
4888
4888
|
type: InputType;
|
|
4889
4889
|
disabled: boolean;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
const require_icon = require("../../../utils/vue/icon.js");
|
|
2
2
|
const require_validator = require("../../../utils/vue/validator.js");
|
|
3
|
-
const require_index = require("../../../
|
|
4
|
-
const require_index$1 = require("../../../hooks/use-
|
|
5
|
-
const require_index$2 = require("../../../hooks/use-
|
|
6
|
-
const require_index$3 = require("../../../hooks/use-
|
|
3
|
+
const require_index = require("../../../directives/trap-focus/index.js");
|
|
4
|
+
const require_index$1 = require("../../../hooks/use-draggable/index.js");
|
|
5
|
+
const require_index$2 = require("../../../hooks/use-lockscreen/index.js");
|
|
6
|
+
const require_index$3 = require("../../../hooks/use-same-target/index.js");
|
|
7
|
+
const require_index$4 = require("../../../hooks/use-id/index.js");
|
|
7
8
|
const require_use_global_config = require("../../config-provider/src/hooks/use-global-config.js");
|
|
8
9
|
const require_for_editor = require("../../config-provider/src/for-editor.js");
|
|
9
|
-
const require_index$
|
|
10
|
-
const require_index$
|
|
11
|
-
const require_index$
|
|
12
|
-
const require_index$
|
|
13
|
-
const require_index$8 = require("../../../directives/trap-focus/index.js");
|
|
10
|
+
const require_index$5 = require("../../icon/index.js");
|
|
11
|
+
const require_index$6 = require("../../focus-trap/index.js");
|
|
12
|
+
const require_index$7 = require("../../input/index.js");
|
|
13
|
+
const require_index$8 = require("../../button/index.js");
|
|
14
14
|
const require_index$9 = require("../../overlay/index.js");
|
|
15
15
|
let _element_plus_icons_vue = require("@element-plus/icons-vue");
|
|
16
16
|
let vue = require("vue");
|
|
@@ -18,13 +18,13 @@ let _vue_shared = require("@vue/shared");
|
|
|
18
18
|
//#region ../../packages/components/message-box/src/index.vue?vue&type=script&lang.ts
|
|
19
19
|
var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
|
|
20
20
|
name: "ElMessageBox",
|
|
21
|
-
directives: { TrapFocus: require_index
|
|
21
|
+
directives: { TrapFocus: require_index.default },
|
|
22
22
|
components: {
|
|
23
|
-
ElButton: require_index$
|
|
24
|
-
ElFocusTrap: require_index$
|
|
25
|
-
ElInput: require_index$
|
|
23
|
+
ElButton: require_index$8.ElButton,
|
|
24
|
+
ElFocusTrap: require_index$6.default,
|
|
25
|
+
ElInput: require_index$7.ElInput,
|
|
26
26
|
ElOverlay: require_index$9.ElOverlay,
|
|
27
|
-
ElIcon: require_index$
|
|
27
|
+
ElIcon: require_index$5.ElIcon,
|
|
28
28
|
...require_icon.TypeComponents
|
|
29
29
|
},
|
|
30
30
|
inheritAttrs: false,
|
|
@@ -121,8 +121,8 @@ var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
|
|
|
121
121
|
const type = state.type;
|
|
122
122
|
return { [ns.bm("icon", type)]: type && require_icon.TypeComponentsMap[type] };
|
|
123
123
|
});
|
|
124
|
-
const contentId = require_index$
|
|
125
|
-
const inputId = require_index$
|
|
124
|
+
const contentId = require_index$4.useId();
|
|
125
|
+
const inputId = require_index$4.useId();
|
|
126
126
|
const iconComponent = (0, vue.computed)(() => {
|
|
127
127
|
const type = state.type;
|
|
128
128
|
return state.icon || type && require_icon.TypeComponentsMap[type] || "";
|
|
@@ -154,7 +154,7 @@ var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
|
|
|
154
154
|
state.validateError = false;
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
const { isDragging } = require_index.useDraggable(rootRef, headerRef, (0, vue.computed)(() => props.draggable), (0, vue.computed)(() => props.overflow));
|
|
157
|
+
const { isDragging } = require_index$1.useDraggable(rootRef, headerRef, (0, vue.computed)(() => props.draggable), (0, vue.computed)(() => props.overflow));
|
|
158
158
|
(0, vue.onMounted)(async () => {
|
|
159
159
|
await (0, vue.nextTick)();
|
|
160
160
|
if (props.closeOnHashChange) window.addEventListener("hashchange", doClose);
|
|
@@ -172,7 +172,7 @@ var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
|
|
|
172
172
|
const handleWrapperClick = () => {
|
|
173
173
|
if (props.closeOnClickModal) handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
|
|
174
174
|
};
|
|
175
|
-
const overlayEvent = require_index$
|
|
175
|
+
const overlayEvent = require_index$3.useSameTarget(handleWrapperClick, forEditor.value);
|
|
176
176
|
const handleInputEnter = (e) => {
|
|
177
177
|
if (state.inputType !== "textarea" && !inputRef.value?.isComposing) {
|
|
178
178
|
e.preventDefault();
|
|
@@ -222,7 +222,7 @@ var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
|
|
|
222
222
|
const onCloseRequested = () => {
|
|
223
223
|
if (props.closeOnPressEscape) handleClose();
|
|
224
224
|
};
|
|
225
|
-
if (props.lockScroll) require_index$
|
|
225
|
+
if (props.lockScroll) require_index$2.useLockscreen(visible, { ns });
|
|
226
226
|
return {
|
|
227
227
|
forEditor,
|
|
228
228
|
...(0, vue.toRefs)(state),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue_vue_type_script_lang.js","names":[],"sources":["../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition :duration=\"forEditor ? -1 : 0\" name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"[ns.is('message-box'), modalClass]\"\n :mask=\"modal\"\n >\n <div\n role=\"dialog\"\n :aria-label=\"title\"\n aria-modal=\"true\"\n :aria-describedby=\"!showInput ? contentId : undefined\"\n :class=\"`${ns.namespace.value}-overlay-message-box`\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"rootRef\"\n :focus-start-el=\"focusStartRef\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"rootRef\"\n :class=\"[\n ns.b(),\n customClass,\n ns.is('draggable', draggable),\n ns.is('dragging', isDragging),\n { [ns.m('center')]: center },\n ]\"\n :style=\"customStyle\"\n tabindex=\"-1\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n :class=\"[ns.e('header'), { 'show-close': showClose }]\"\n >\n <div :class=\"ns.e('title')\">\n <el-icon\n v-if=\"iconComponent && center\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n :class=\"ns.e('headerbtn')\"\n :aria-label=\"t('el.messagebox.close')\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || 'close'\" />\n </el-icon>\n </button>\n </div>\n <div :id=\"contentId\" :class=\"ns.e('content')\">\n <div :class=\"ns.e('container')\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" :class=\"ns.e('message')\">\n <slot>\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-if=\"!dangerouslyUseHTMLString\"\n :for=\"showInput ? inputId : undefined\"\n v-text=\"message\"\n />\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-else\n :for=\"showInput ? inputId : undefined\"\n v-html=\"message\"\n />\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" :class=\"ns.e('input')\">\n <el-input\n :id=\"inputId\"\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :aria-invalid=\"validateError\"\n :class=\"{ invalid: validateError }\"\n @keydown.enter=\"handleInputEnter\"\n />\n <div\n :class=\"ns.e('errormsg')\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div\n v-if=\"showCancelButton || showConfirmButton\"\n :class=\"ns.e('btns')\"\n >\n <el-button\n v-if=\"showCancelButton\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n :loading=\"cancelButtonLoading\"\n :loading-icon=\"cancelButtonLoadingIcon\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n :loading=\"confirmButtonLoading\"\n :loading-icon=\"confirmButtonLoadingIcon\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { watch } from '../../config-provider'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useDraggable,\n useId,\n useLockscreen,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport {\n TypeComponents,\n TypeComponentsMap,\n isFunction,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Loading } from '@element-plus/icons-vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useGlobalComponentSettings, useGlobalConfig } from '../../config-provider'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\nimport type { InputInstance } from '@element-plus/components/input'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\n ElFocusTrap,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents,\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n closeOnHashChange: {\n type: Boolean,\n default: true,\n },\n center: Boolean,\n draggable: Boolean,\n overflow: Boolean,\n roundButton: Boolean,\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n const forEditor = useGlobalConfig('forEditor')\n\n // const popup = usePopup(props, doClose)\n const {\n locale,\n zIndex,\n ns,\n size: btnSize,\n } = useGlobalComponentSettings(\n 'message-box',\n computed(() => props.buttonSize)\n )\n\n const { t } = locale\n const { nextZIndex } = zIndex\n\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n // autofocus element when open message-box\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n cancelButtonType: '',\n confirmButtonType: 'primary',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n closeIcon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: '',\n inputValidator: undefined,\n inputErrorMessage: '',\n message: '',\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n })\n\n const contentId = useId()\n const inputId = useId()\n\n const iconComponent = computed(() => {\n const type = state.type\n return state.icon || (type && TypeComponentsMap[type]) || ''\n })\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const focusStartRef = ref<HTMLElement>()\n const inputRef = ref<InputInstance>()\n const confirmRef = ref<ComponentPublicInstance>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType !== 'prompt') {\n if (state.autofocus) {\n focusStartRef.value = confirmRef.value?.$el ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n state.zIndex = nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n if (state.autofocus) {\n focusStartRef.value = getInputElement() ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n const overflow = computed(() => props.overflow)\n const { isDragging } = useDraggable(rootRef, headerRef, draggable, overflow)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n window.addEventListener('hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n window.removeEventListener('hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick, forEditor.value)\n\n const handleInputEnter = (e: KeyboardEvent | Event) => {\n if (state.inputType !== 'textarea' && !inputRef.value?.isComposing) {\n e.preventDefault()\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (isFunction(inputValidator)) {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (isString(validateResult)) {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value?.$refs\n return (inputRefs?.input ?? inputRefs?.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event like this\n // to dispatch, it could callout another message box.\n const onCloseRequested = () => {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible, { ns })\n }\n\n return {\n forEditor,\n ...toRefs(state),\n ns,\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n contentId,\n inputId,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n focusStartRef,\n headerRef,\n inputRef,\n isDragging,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n onCloseRequested,\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyMA,IAAA,0CAAA,GAAA,IAAA,gBAAA,CAA+B;CAC7B,MAAM;CACN,YAAY,EACV,WAAA,gBAAA,QACF;CACA,YAAY;EACV,UAAA,gBAAA;EACA,aAAA,gBAAA;EACA,SAAA,gBAAA;EACA,WAAA,gBAAA;EACA,QAAA,gBAAA;EACA,GAAG,aAAA;CACL;CACA,cAAc;CACd,OAAO;EACL,YAAY;GACV,MAAM;GACN,WAAW,kBAAA;EACb;EACA,OAAO;GACL,MAAM;GACN,SAAS;EACX;EACA,YAAY;GACV,MAAM;GACN,SAAS;EACX;EACA,WAAW;GACT,MAAM;GACN,SAAS;EACX;EACA,mBAAmB;GACjB,MAAM;GACN,SAAS;EACX;EACA,oBAAoB;GAClB,MAAM;GACN,SAAS;EACX;EACA,mBAAmB;GACjB,MAAM;GACN,SAAS;EACX;EACA,QAAQ;EACR,WAAW;EACX,UAAU;EACV,aAAa;EACb,WAAW;GACT,MAAM;GACN,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,SAAS;EACX;CACF;CACA,OAAO,CAAC,UAAU,QAAQ;CAC1B,MAAM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tB,OAAO;KACT;KACA,KAAA,GAAA,YAAA,SAAA,CAAa,cAAc,GAAG;MAC5B,MAAM,qBAAqB;MAC3B,MAAM,gBAAgB;MACtB,OAAO;KACT;IACF;GACF;GACA,MAAM,qBAAqB;GAC3B,MAAM,gBAAgB;GACtB,OAAO;EACT;EAEA,MAAM,wBAAwB;GAC5B,MAAM,YAAY,SAAS,OAAO;GAClC,OAAQ,WAAW,SAAS,WAAW;EACzC;EAEA,MAAM,oBAAoB;GACxB,aAAa,OAAO;EACtB;EAQA,MAAM,yBAAyB;GAC7B,IAAI,MAAM,oBACR,YAAY;EAEhB;EAGA,IAAI,MAAM,YACR,gBAAA,cAAc,SAAS,EAAE,GAAG,CAAC;EAG/B,OAAO;GACL;GACA,IAAA,GAAA,IAAA,OAAA,CAAU,KAAK;GACf;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.vue_vue_type_script_lang.js","names":[],"sources":["../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition :duration=\"forEditor ? -1 : 0\" name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"[ns.is('message-box'), modalClass]\"\n :mask=\"modal\"\n >\n <div\n role=\"dialog\"\n :aria-label=\"title\"\n aria-modal=\"true\"\n :aria-describedby=\"!showInput ? contentId : undefined\"\n :class=\"`${ns.namespace.value}-overlay-message-box`\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"rootRef\"\n :focus-start-el=\"focusStartRef\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"rootRef\"\n :class=\"[\n ns.b(),\n customClass,\n ns.is('draggable', draggable),\n ns.is('dragging', isDragging),\n { [ns.m('center')]: center },\n ]\"\n :style=\"customStyle\"\n tabindex=\"-1\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n :class=\"[ns.e('header'), { 'show-close': showClose }]\"\n >\n <div :class=\"ns.e('title')\">\n <el-icon\n v-if=\"iconComponent && center\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n :class=\"ns.e('headerbtn')\"\n :aria-label=\"t('el.messagebox.close')\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || 'close'\" />\n </el-icon>\n </button>\n </div>\n <div :id=\"contentId\" :class=\"ns.e('content')\">\n <div :class=\"ns.e('container')\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" :class=\"ns.e('message')\">\n <slot>\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-if=\"!dangerouslyUseHTMLString\"\n :for=\"showInput ? inputId : undefined\"\n v-text=\"message\"\n />\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-else\n :for=\"showInput ? inputId : undefined\"\n v-html=\"message\"\n />\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" :class=\"ns.e('input')\">\n <el-input\n :id=\"inputId\"\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :aria-invalid=\"validateError\"\n :class=\"{ invalid: validateError }\"\n @keydown.enter=\"handleInputEnter\"\n />\n <div\n :class=\"ns.e('errormsg')\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div\n v-if=\"showCancelButton || showConfirmButton\"\n :class=\"ns.e('btns')\"\n >\n <el-button\n v-if=\"showCancelButton\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n :loading=\"cancelButtonLoading\"\n :loading-icon=\"cancelButtonLoadingIcon\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n :loading=\"confirmButtonLoading\"\n :loading-icon=\"confirmButtonLoadingIcon\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { watch } from '../../config-provider'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useDraggable,\n useId,\n useLockscreen,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport {\n TypeComponents,\n TypeComponentsMap,\n isFunction,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Loading } from '@element-plus/icons-vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useGlobalComponentSettings, useGlobalConfig } from '../../config-provider'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\nimport type { InputInstance } from '@element-plus/components/input'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\n ElFocusTrap,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents,\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n closeOnHashChange: {\n type: Boolean,\n default: true,\n },\n center: Boolean,\n draggable: Boolean,\n overflow: Boolean,\n roundButton: Boolean,\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n const forEditor = useGlobalConfig('forEditor')\n\n // const popup = usePopup(props, doClose)\n const {\n locale,\n zIndex,\n ns,\n size: btnSize,\n } = useGlobalComponentSettings(\n 'message-box',\n computed(() => props.buttonSize)\n )\n\n const { t } = locale\n const { nextZIndex } = zIndex\n\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n // autofocus element when open message-box\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n cancelButtonType: '',\n confirmButtonType: 'primary',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n closeIcon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: '',\n inputValidator: undefined,\n inputErrorMessage: '',\n message: '',\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n })\n\n const contentId = useId()\n const inputId = useId()\n\n const iconComponent = computed(() => {\n const type = state.type\n return state.icon || (type && TypeComponentsMap[type]) || ''\n })\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const focusStartRef = ref<HTMLElement>()\n const inputRef = ref<InputInstance>()\n const confirmRef = ref<ComponentPublicInstance>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType !== 'prompt') {\n if (state.autofocus) {\n focusStartRef.value = confirmRef.value?.$el ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n state.zIndex = nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n if (state.autofocus) {\n focusStartRef.value = getInputElement() ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n const overflow = computed(() => props.overflow)\n const { isDragging } = useDraggable(rootRef, headerRef, draggable, overflow)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n window.addEventListener('hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n window.removeEventListener('hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick, forEditor.value)\n\n const handleInputEnter = (e: KeyboardEvent | Event) => {\n if (state.inputType !== 'textarea' && !inputRef.value?.isComposing) {\n e.preventDefault()\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (isFunction(inputValidator)) {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (isString(validateResult)) {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value?.$refs\n return (inputRefs?.input ?? inputRefs?.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event like this\n // to dispatch, it could callout another message box.\n const onCloseRequested = () => {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible, { ns })\n }\n\n return {\n forEditor,\n ...toRefs(state),\n ns,\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n contentId,\n inputId,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n focusStartRef,\n headerRef,\n inputRef,\n isDragging,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n onCloseRequested,\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyMA,IAAA,0CAAA,GAAA,IAAA,gBAAA,CAA+B;CAC7B,MAAM;CACN,YAAY,EACV,WAAA,cAAA,QACF;CACA,YAAY;EACV,UAAA,gBAAA;EACA,aAAA,gBAAA;EACA,SAAA,gBAAA;EACA,WAAA,gBAAA;EACA,QAAA,gBAAA;EACA,GAAG,aAAA;CACL;CACA,cAAc;CACd,OAAO;EACL,YAAY;GACV,MAAM;GACN,WAAW,kBAAA;EACb;EACA,OAAO;GACL,MAAM;GACN,SAAS;EACX;EACA,YAAY;GACV,MAAM;GACN,SAAS;EACX;EACA,WAAW;GACT,MAAM;GACN,SAAS;EACX;EACA,mBAAmB;GACjB,MAAM;GACN,SAAS;EACX;EACA,oBAAoB;GAClB,MAAM;GACN,SAAS;EACX;EACA,mBAAmB;GACjB,MAAM;GACN,SAAS;EACX;EACA,QAAQ;EACR,WAAW;EACX,UAAU;EACV,aAAa;EACb,WAAW;GACT,MAAM;GACN,SAAS;EACX;EACA,SAAS;GACP,MAAM;GACN,SA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