element-pe 2.14.2-3 → 2.14.2-4
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 +32 -110
- package/dist/index.full.min.js +8 -8
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +32 -110
- 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/component.mjs +4 -4
- package/es/components/affix/src/affix.d.ts +1 -1
- package/es/components/affix/src/affix.vue.d.ts +3 -3
- package/es/components/alert/src/alert.d.ts +1 -1
- package/es/components/alert/src/alert.vue.d.ts +2 -2
- package/es/components/anchor/src/anchor.vue.d.ts +1 -1
- package/es/components/autocomplete/src/autocomplete.d.ts +3 -3
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +3 -3
- package/es/components/avatar/src/avatar-group.d.ts +1 -1
- package/es/components/avatar/src/avatar.d.ts +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +2 -2
- package/es/components/button/src/button-group.d.ts +1 -1
- package/es/components/button/src/button-group.vue.d.ts +1 -1
- package/es/components/button/src/button.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +3 -3
- package/es/components/button/src/use-button.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +3 -3
- package/es/components/cascader/src/cascader.d.ts +2 -2
- package/es/components/cascader/src/cascader.vue.d.ts +14 -14
- package/es/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +2 -2
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
- package/es/components/checkbox/src/checkbox.vue.d.ts +2 -2
- package/es/components/col/src/col.vue.d.ts +1 -1
- package/es/components/collapse/src/collapse.d.ts +1 -1
- package/es/components/color-picker/src/color-picker.vue.d.ts +10 -10
- 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 +2 -2
- package/es/components/countdown/src/countdown.vue.d.ts +1 -1
- package/es/components/countdown/src/countdown.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +15 -15
- 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 +1 -1
- 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_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +4 -4
- package/es/components/date-picker-panel/src/panel-utils.d.ts +3 -3
- package/es/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/es/components/descriptions/src/description-item.d.ts +9 -9
- package/es/components/descriptions/src/description.vue.d.ts +1 -1
- package/es/components/dialog/src/dialog-content.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 +5 -5
- 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 +62 -62
- package/es/components/form/src/form-item.d.ts +1 -1
- package/es/components/form/src/form.d.ts +2 -2
- package/es/components/image/src/image.vue.d.ts +4 -4
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/es/components/index.mjs +10 -10
- package/es/components/input/src/input.d.ts +2 -2
- package/es/components/input/src/input.vue.d.ts +7 -7
- package/es/components/input-number/src/input-number.d.ts +3 -3
- package/es/components/input-number/src/input-number.vue.d.ts +8 -8
- 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 +1 -1
- package/es/components/input-tag/src/input-tag.d.ts +1 -1
- package/es/components/input-tag/src/input-tag.vue.d.ts +11 -11
- package/es/components/link/src/link.d.ts +1 -1
- package/es/components/link/src/link.vue.d.ts +2 -2
- package/es/components/mention/src/mention.d.ts +3 -3
- package/es/components/mention/src/mention.vue.d.ts +3 -3
- package/es/components/menu/src/menu.d.ts +3 -3
- package/es/components/menu/src/menu.mjs +1 -1
- package/es/components/menu/src/sub-menu.d.ts +1 -1
- package/es/components/menu/src/utils/menu-item.mjs +1 -1
- package/es/components/menu/src/utils/submenu.mjs +1 -1
- package/es/components/message/src/instance.d.ts +1 -1
- package/es/components/message/src/message.d.ts +1 -1
- package/es/components/message/src/message.vue.d.ts +6 -6
- package/es/components/message-box/src/index.vue.d.ts +33 -33
- 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/page-header/src/page-header.vue.d.ts +1 -1
- package/es/components/pagination/src/components/sizes.vue.d.ts +1 -1
- package/es/components/pagination/src/pagination.d.ts +3 -3
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +2 -2
- package/es/components/popover/src/popover.d.ts +1 -1
- package/es/components/popover/src/popover.vue.d.ts +8 -8
- package/es/components/popper/src/composables/use-content.d.ts +4 -4
- package/es/components/popper/src/content.vue.d.ts +5 -5
- package/es/components/popper/src/popper.d.ts +2 -2
- package/es/components/progress/src/progress.d.ts +1 -1
- package/es/components/progress/src/progress.vue.d.ts +3 -3
- package/es/components/radio/src/radio-button.vue.d.ts +1 -1
- package/es/components/radio/src/radio-group.vue.d.ts +3 -3
- package/es/components/radio/src/radio.vue.d.ts +1 -1
- package/es/components/rate/src/rate.vue.d.ts +2 -2
- package/es/components/resizable-columns/index.d.ts +2 -2
- package/es/components/resizable-columns/src/resizable-column.vue.d.ts +1 -1
- package/es/components/result/src/result.vue.d.ts +1 -1
- package/es/components/row/src/row.d.ts +2 -2
- package/es/components/row/src/row.vue.d.ts +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
- package/es/components/segmented/index.d.ts +1 -1
- package/es/components/select/src/select.d.ts +2 -2
- package/es/components/select/src/select.vue.d.ts +60 -60
- 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 +54 -54
- package/es/components/select-v2/src/select.vue_vue_type_script_lang.mjs +1 -1
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/slider.vue.d.ts +5 -5
- package/es/components/space/src/space.d.ts +3 -3
- package/es/components/splitter/src/split-bar.vue.d.ts +1 -1
- package/es/components/statistic/src/statistic.vue.d.ts +2 -2
- package/es/components/steps/src/item.vue.d.ts +1 -1
- package/es/components/steps/src/steps.vue.d.ts +1 -1
- package/es/components/switch/src/switch.vue.d.ts +1 -1
- package/es/components/table/src/filter-panel.vue.d.ts +49 -49
- package/es/components/table/src/store/helper.d.ts +0 -12
- package/es/components/table/src/store/index.d.ts +0 -24
- package/es/components/table/src/store/watcher.d.ts +0 -2
- package/es/components/table/src/store/watcher.mjs +0 -64
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table/style-helper.d.ts +1 -1
- package/es/components/table/src/table/style-helper.mjs +0 -4
- package/es/components/table/src/table/style-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/defaults.d.ts +1 -2
- package/es/components/table/src/table-body/defaults.mjs +1 -2
- package/es/components/table/src/table-body/defaults.mjs.map +1 -1
- package/es/components/table/src/table-body/index.mjs +1 -1
- package/es/components/table/src/table-body/render-helper.mjs +2 -11
- package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/styles-helper.mjs.map +1 -1
- package/es/components/table/src/table-footer/index.d.ts +1 -1
- package/es/components/table/src/table-header/index.d.ts +7 -7
- package/es/components/table/src/table-header/index.mjs +1 -1
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +4 -17
- package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs +5 -7
- package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs.map +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/time-picker/src/common/picker.vue.d.ts +17 -17
- 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-com/panel-time-pick.vue.d.ts +3 -3
- package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +3 -3
- package/es/components/time-picker/src/time-picker.d.ts +15 -15
- package/es/components/time-select/src/time-select.vue.d.ts +7 -7
- package/es/components/timeline/src/timeline-item.d.ts +1 -1
- package/es/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +4 -4
- package/es/components/tooltip/src/tooltip.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +10 -10
- package/es/components/tour/src/content.d.ts +1 -1
- package/es/components/tour/src/content.vue.d.ts +1 -1
- 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 +4 -4
- package/es/components/tree/src/tree-node.vue.d.ts +6 -6
- package/es/components/tree/src/tree.vue.d.ts +9 -9
- package/es/components/tree-select/src/tree-select.vue.d.ts +26 -26
- package/es/components/tree-v2/src/composables/useTree.d.ts +6 -6
- package/es/components/upload/src/upload.vue.d.ts +1 -1
- package/es/components/virtual-list/src/builders/build-list.d.ts +3 -3
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +3 -3
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +3 -3
- package/es/constants/index.mjs +2 -2
- package/es/directives/trap-focus/index.mjs +1 -1
- package/es/hooks/use-floating/index.d.ts +20 -20
- package/es/hooks/use-popper/index.d.ts +4 -4
- package/es/index.mjs +17 -17
- package/es/plugin.mjs +1 -1
- package/es/utils/vue/size.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/component.js +111 -111
- package/lib/components/affix/src/affix.d.ts +1 -1
- package/lib/components/affix/src/affix.vue.d.ts +3 -3
- package/lib/components/alert/src/alert.d.ts +1 -1
- package/lib/components/alert/src/alert.vue.d.ts +2 -2
- package/lib/components/anchor/src/anchor.vue.d.ts +1 -1
- package/lib/components/autocomplete/src/autocomplete.d.ts +3 -3
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +3 -3
- package/lib/components/avatar/src/avatar-group.d.ts +1 -1
- package/lib/components/avatar/src/avatar.d.ts +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +2 -2
- package/lib/components/button/src/button-group.d.ts +1 -1
- package/lib/components/button/src/button-group.vue.d.ts +1 -1
- package/lib/components/button/src/button.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +3 -3
- package/lib/components/button/src/use-button.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +3 -3
- package/lib/components/cascader/src/cascader.d.ts +2 -2
- package/lib/components/cascader/src/cascader.vue.d.ts +14 -14
- package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js +40 -40
- 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_vue_type_script_setup_true_lang.js +12 -12
- package/lib/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +2 -2
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
- package/lib/components/checkbox/src/checkbox.vue.d.ts +2 -2
- package/lib/components/col/src/col.vue.d.ts +1 -1
- package/lib/components/collapse/src/collapse.d.ts +1 -1
- package/lib/components/color-picker/src/color-picker.vue.d.ts +10 -10
- 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 +2 -2
- package/lib/components/countdown/src/countdown.vue.d.ts +1 -1
- package/lib/components/countdown/src/countdown.vue_vue_type_script_setup_true_lang.js +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +15 -15
- 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 +1 -1
- 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_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-panel.d.ts +4 -4
- package/lib/components/date-picker-panel/src/panel-utils.d.ts +3 -3
- package/lib/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/lib/components/descriptions/src/description-item.d.ts +9 -9
- package/lib/components/descriptions/src/description.vue.d.ts +1 -1
- package/lib/components/dialog/src/dialog-content.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 +5 -5
- 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 +62 -62
- package/lib/components/form/src/form-item.d.ts +1 -1
- package/lib/components/form/src/form.d.ts +2 -2
- package/lib/components/image/src/image.vue.d.ts +4 -4
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/lib/components/index.js +134 -134
- package/lib/components/input/src/input.d.ts +2 -2
- package/lib/components/input/src/input.vue.d.ts +7 -7
- package/lib/components/input-number/src/input-number.d.ts +3 -3
- package/lib/components/input-number/src/input-number.vue.d.ts +8 -8
- 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 +1 -1
- package/lib/components/input-tag/src/input-tag.d.ts +1 -1
- package/lib/components/input-tag/src/input-tag.vue.d.ts +11 -11
- package/lib/components/link/src/link.d.ts +1 -1
- package/lib/components/link/src/link.vue.d.ts +2 -2
- package/lib/components/mention/src/mention.d.ts +3 -3
- package/lib/components/mention/src/mention.vue.d.ts +3 -3
- package/lib/components/menu/src/menu.d.ts +3 -3
- 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/menu/src/utils/menu-item.js +11 -11
- package/lib/components/menu/src/utils/menu-item.js.map +1 -1
- package/lib/components/menu/src/utils/submenu.js +9 -9
- package/lib/components/menu/src/utils/submenu.js.map +1 -1
- package/lib/components/message/src/instance.d.ts +1 -1
- package/lib/components/message/src/message.d.ts +1 -1
- package/lib/components/message/src/message.vue.d.ts +6 -6
- package/lib/components/message-box/src/index.vue.d.ts +33 -33
- 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/page-header/src/page-header.vue.d.ts +1 -1
- package/lib/components/pagination/src/components/sizes.vue.d.ts +1 -1
- package/lib/components/pagination/src/pagination.d.ts +3 -3
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +2 -2
- package/lib/components/popover/src/popover.d.ts +1 -1
- package/lib/components/popover/src/popover.vue.d.ts +8 -8
- package/lib/components/popper/src/composables/use-content.d.ts +4 -4
- package/lib/components/popper/src/content.vue.d.ts +5 -5
- package/lib/components/popper/src/popper.d.ts +2 -2
- package/lib/components/progress/src/progress.d.ts +1 -1
- package/lib/components/progress/src/progress.vue.d.ts +3 -3
- package/lib/components/radio/src/radio-button.vue.d.ts +1 -1
- package/lib/components/radio/src/radio-group.vue.d.ts +3 -3
- package/lib/components/radio/src/radio.vue.d.ts +1 -1
- package/lib/components/rate/src/rate.vue.d.ts +2 -2
- package/lib/components/resizable-columns/index.d.ts +2 -2
- package/lib/components/resizable-columns/src/resizable-column.vue.d.ts +1 -1
- package/lib/components/result/src/result.vue.d.ts +1 -1
- package/lib/components/row/src/row.d.ts +2 -2
- package/lib/components/row/src/row.vue.d.ts +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
- package/lib/components/segmented/index.d.ts +1 -1
- package/lib/components/select/src/select.d.ts +2 -2
- package/lib/components/select/src/select.vue.d.ts +60 -60
- 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 +54 -54
- 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/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +5 -5
- package/lib/components/space/src/space.d.ts +3 -3
- package/lib/components/splitter/src/split-bar.vue.d.ts +1 -1
- package/lib/components/statistic/src/statistic.vue.d.ts +2 -2
- package/lib/components/steps/src/item.vue.d.ts +1 -1
- package/lib/components/steps/src/steps.vue.d.ts +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +1 -1
- package/lib/components/table/src/filter-panel.vue.d.ts +49 -49
- package/lib/components/table/src/store/helper.d.ts +0 -12
- package/lib/components/table/src/store/index.d.ts +0 -24
- package/lib/components/table/src/store/watcher.d.ts +0 -2
- package/lib/components/table/src/store/watcher.js +0 -64
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table/style-helper.d.ts +1 -1
- package/lib/components/table/src/table/style-helper.js +0 -4
- package/lib/components/table/src/table/style-helper.js.map +1 -1
- package/lib/components/table/src/table-body/defaults.d.ts +1 -2
- package/lib/components/table/src/table-body/defaults.js +0 -2
- package/lib/components/table/src/table-body/defaults.js.map +1 -1
- package/lib/components/table/src/table-body/index.js +1 -1
- package/lib/components/table/src/table-body/render-helper.js +2 -11
- package/lib/components/table/src/table-body/render-helper.js.map +1 -1
- package/lib/components/table/src/table-body/styles-helper.js.map +1 -1
- package/lib/components/table/src/table-footer/index.d.ts +1 -1
- package/lib/components/table/src/table-header/index.d.ts +7 -7
- package/lib/components/table/src/table-header/index.js +1 -1
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +4 -17
- package/lib/components/table/src/table.vue_vue_type_script_setup_true_lang.js +13 -15
- package/lib/components/table/src/table.vue_vue_type_script_setup_true_lang.js.map +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/time-picker/src/common/picker.vue.d.ts +17 -17
- 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-com/panel-time-pick.vue.d.ts +3 -3
- package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +3 -3
- package/lib/components/time-picker/src/time-picker.d.ts +15 -15
- package/lib/components/time-select/src/time-select.vue.d.ts +7 -7
- package/lib/components/timeline/src/timeline-item.d.ts +1 -1
- package/lib/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +4 -4
- package/lib/components/tooltip/src/tooltip.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +10 -10
- package/lib/components/tour/src/content.d.ts +1 -1
- package/lib/components/tour/src/content.vue.d.ts +1 -1
- 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 +4 -4
- package/lib/components/tree/src/tree-node.vue.d.ts +6 -6
- package/lib/components/tree/src/tree.vue.d.ts +9 -9
- package/lib/components/tree-select/src/tree-select.vue.d.ts +26 -26
- package/lib/components/tree-v2/src/composables/useTree.d.ts +6 -6
- package/lib/components/upload/src/upload.vue.d.ts +1 -1
- package/lib/components/virtual-list/src/builders/build-list.d.ts +3 -3
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +3 -3
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +3 -3
- package/lib/constants/index.js +2 -2
- package/lib/directives/trap-focus/index.js +5 -5
- package/lib/directives/trap-focus/index.js.map +1 -1
- package/lib/hooks/use-floating/index.d.ts +20 -20
- package/lib/hooks/use-popper/index.d.ts +4 -4
- package/lib/index.js +278 -278
- package/lib/plugin.js +12 -12
- package/lib/plugin.js.map +1 -1
- package/lib/utils/vue/size.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
package/lib/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-number.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('view-mode', !!inputNumberViewMode),\n ns.is('table-input', isTableInput),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ns.is(align, !!align),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n :type=\"formatter ? 'text' : 'number'\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :view-mode=\"inputNumberViewMode\"\n :table-input=\"isTableInput\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n :inputmode=\"inputmode\"\n :formatter=\"formatter\"\n :parser=\"parser\"\n :tabindex=\"tabindex\"\n @keydown=\"handleKeydown\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n >\n <template v-if=\"$slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"$slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n </el-input>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onMounted, onUpdated, reactive, ref } from 'vue'\nimport { watch } from '../../config-provider'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormViewMode,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n NOOP,\n debugWarn,\n getEventCode,\n getEventKey,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits } from './input-number'\nimport { TABLE_INJECTION_KEY } from '../../table/src/tokens'\n\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { InputNumberProps } from './input-number'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n id: undefined,\n disabled: undefined,\n step: 1,\n max: Number.MAX_SAFE_INTEGER,\n min: Number.MIN_SAFE_INTEGER,\n stepStrictly: false,\n readonly: false,\n controls: true,\n controlsPosition: '',\n valueOnClear: null,\n validateEvent: true,\n inputmode: undefined,\n align: 'center',\n tabindex: 0,\n})\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\nconst table = inject(TABLE_INJECTION_KEY, undefined)\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst isTableInput = computed(() => table && props.tableInput)\nconst inputNumberSize = computed(() => {\n if (isTableInput.value) {\n return table!.props.size === 'small' ? 'small' : ''\n } else {\n const formSize = useFormSize()\n return formSize.value\n }\n})\nconst inputNumberDisabled = useFormDisabled()\nconst inputNumberViewMode = useFormViewMode() as any\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the maximum safe integer limit.'\n )\n return val\n } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the minimum safe integer limit.'\n )\n return val\n }\n\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst handleKeydown = (event: KeyboardEvent | Event) => {\n const code = getEventCode(event as KeyboardEvent)\n const key = getEventKey(event as KeyboardEvent)\n\n if (props.disabledScientific && ['e', 'E'].includes(key)) {\n event.preventDefault()\n return\n }\n\n switch (code) {\n case EVENT_CODE.up: {\n event.preventDefault()\n increase()\n break\n }\n case EVENT_CODE.down: {\n event.preventDefault()\n decrease()\n break\n }\n }\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || inputNumberViewMode.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || inputNumberViewMode.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = !value ? Number(value) : Number.parseFloat(String(value))\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(\n Math.round(toPrecision(newVal / step)) * step,\n precision\n )\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n data.userInput = null\n if (oldVal === newVal && value) return\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch(NOOP)\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n let newVal = value === '' ? null : Number.parseFloat(value)\n if (Number.isNaN(newVal)) {\n newVal = null\n }\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number.parseFloat(value) : ''\n if (\n (isNumber(newVal) && !Number.isNaN(newVal)) ||\n (props.formatter && Number.isNaN(newVal)) ||\n newVal === ''\n ) {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n // When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = props.formatter?.('') ?? ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.precision,\n () => {\n data.currentValue = verifyValue(props.modelValue)\n }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n innerInput.setAttribute('aria-view-mode', String(inputNumberViewMode.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0HA,MAAM,QAAQ;EAgBd,MAAM,OAAO;EAEb,MAAM,EAAE,MAAM,gBAAA,UAAU;EACxB,MAAM,KAAK,gBAAA,aAAa,cAAc;EACtC,MAAM,SAAA,GAAA,IAAA,IAAA,CAA2B;EACjC,MAAM,SAAA,GAAA,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,GAAA,MAAA;qCAF2B,CAAnB,gBAAA,UAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAAA,IAAA,MAAA,CAAmB,wBAAA,OAAA,GAAA,EAAA,KAAA,EAAA,CAAA,OAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAAA,IAAA,MAAA,CACpB,wBAAA,IAAA,GAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA;;2EATH,QAAQ,CAAA,CAAA,KAAA,GAAA,IAAA,mBAAA,CAAA,QAAA,IAAA;wCA8Cf,gBAAA,OAAA,GAAA;KAhCR,IAAI,QAAA;cACD;KAAJ,KAAI;KACH,MAAM,QAAA,YAAS,SAAA;KACf,MAAM,QAAA;KACN,eAAa,aAAA;KACb,aAAa,QAAA;KACb,UAAU,QAAA;KACV,WAAA,GAAA,IAAA,MAAA,CAAU,mBAAA;KACV,cAAA,GAAA,IAAA,MAAA,CAAW,mBAAA;KACX,eAAa,aAAA;KACb,MAAM,gBAAA;KACN,KAAK,QAAA;KACL,KAAK,QAAA;KACL,MAAM,QAAA;KACN,cAAY,QAAA;KACZ,kBAAgB;KAChB,WAAW,QAAA;KACX,WAAW,QAAA;KACX,QAAQ,QAAA;KACR,UAAU,QAAA;KACV,WAAS;KACT,QAAM;KACN,SAAO;KACP,SAAO;KACP,UAAQ;uCAEOA,KAAAA,OAAO,SAAA;WAAS;gCACR,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,QAAA,CAAA,CAAA;;gBAERA,KAAAA,OAAO,SAAA;WAAS;gCACR,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,QAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"input-number.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('view-mode', !!inputNumberViewMode),\n ns.is('table-input', isTableInput),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ns.is(align, !!align),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n :type=\"formatter ? 'text' : 'number'\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :view-mode=\"inputNumberViewMode\"\n :table-input=\"isTableInput\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n :inputmode=\"inputmode\"\n :formatter=\"formatter\"\n :parser=\"parser\"\n :tabindex=\"tabindex\"\n @keydown=\"handleKeydown\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n >\n <template v-if=\"$slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"$slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n </el-input>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onMounted, onUpdated, reactive, ref } from 'vue'\nimport { watch } from '../../config-provider'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormViewMode,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n NOOP,\n debugWarn,\n getEventCode,\n getEventKey,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits } from './input-number'\nimport { TABLE_INJECTION_KEY } from '../../table/src/tokens'\n\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { InputNumberProps } from './input-number'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n id: undefined,\n disabled: undefined,\n step: 1,\n max: Number.MAX_SAFE_INTEGER,\n min: Number.MIN_SAFE_INTEGER,\n stepStrictly: false,\n readonly: false,\n controls: true,\n controlsPosition: '',\n valueOnClear: null,\n validateEvent: true,\n inputmode: undefined,\n align: 'center',\n tabindex: 0,\n})\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\nconst table = inject(TABLE_INJECTION_KEY, undefined)\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst isTableInput = computed(() => table && props.tableInput)\nconst inputNumberSize = computed(() => {\n if (isTableInput.value) {\n return table!.props.size === 'small' ? 'small' : ''\n } else {\n const formSize = useFormSize()\n return formSize.value\n }\n})\nconst inputNumberDisabled = useFormDisabled()\nconst inputNumberViewMode = useFormViewMode() as any\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the maximum safe integer limit.'\n )\n return val\n } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the minimum safe integer limit.'\n )\n return val\n }\n\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst handleKeydown = (event: KeyboardEvent | Event) => {\n const code = getEventCode(event as KeyboardEvent)\n const key = getEventKey(event as KeyboardEvent)\n\n if (props.disabledScientific && ['e', 'E'].includes(key)) {\n event.preventDefault()\n return\n }\n\n switch (code) {\n case EVENT_CODE.up: {\n event.preventDefault()\n increase()\n break\n }\n case EVENT_CODE.down: {\n event.preventDefault()\n decrease()\n break\n }\n }\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || inputNumberViewMode.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || inputNumberViewMode.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = !value ? Number(value) : Number.parseFloat(String(value))\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(\n Math.round(toPrecision(newVal / step)) * step,\n precision\n )\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n data.userInput = null\n if (oldVal === newVal && value) return\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch(NOOP)\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n let newVal = value === '' ? null : Number.parseFloat(value)\n if (Number.isNaN(newVal)) {\n newVal = null\n }\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number.parseFloat(value) : ''\n if (\n (isNumber(newVal) && !Number.isNaN(newVal)) ||\n (props.formatter && Number.isNaN(newVal)) ||\n newVal === ''\n ) {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n // When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = props.formatter?.('') ?? ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => props.precision,\n () => {\n data.currentValue = verifyValue(props.modelValue)\n }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n innerInput.setAttribute('aria-view-mode', String(inputNumberViewMode.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0HA,MAAM,QAAQ;EAgBd,MAAM,OAAO;EAEb,MAAM,EAAE,MAAM,cAAA,UAAU;EACxB,MAAM,KAAK,gBAAA,aAAa,cAAc;EACtC,MAAM,SAAA,GAAA,IAAA,IAAA,CAA2B;EACjC,MAAM,SAAA,GAAA,IAAA,OAAA,CAAe,eAAA,qBAAqB,KAAA,CAAS;EAMnD,MAAM,QAAA,GAAA,IAAA,SAAA,CAAsB;GAC1B,cAAc,MAAM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,MAAA,CAAmB,wBAAA,OAAA,GAAA,EAAA,KAAA,EAAA,CAAA,OAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAAA,IAAA,MAAA,CACpB,wBAAA,IAAA,GAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA;;6EATH,QAAQ,CAAA,CAAA,KAAA,GAAA,IAAA,mBAAA,CAAA,QAAA,IAAA;wCA8Cf,gBAAA,OAAA,GAAA;KAhCR,IAAI,QAAA;cACD;KAAJ,KAAI;KACH,MAAM,QAAA,YAAS,SAAA;KACf,MAAM,QAAA;KACN,eAAa,aAAA;KACb,aAAa,QAAA;KACb,UAAU,QAAA;KACV,WAAA,GAAA,IAAA,MAAA,CAAU,mBAAA;KACV,cAAA,GAAA,IAAA,MAAA,CAAW,mBAAA;KACX,eAAa,aAAA;KACb,MAAM,gBAAA;KACN,KAAK,QAAA;KACL,KAAK,QAAA;KACL,MAAM,QAAA;KACN,cAAY,QAAA;KACZ,kBAAgB;KAChB,WAAW,QAAA;KACX,WAAW,QAAA;KACX,QAAQ,QAAA;KACR,UAAU,QAAA;KACV,WAAS;KACT,QAAM;KACN,SAAO;KACP,SAAO;KACP,UAAQ;uCAEOA,KAAAA,OAAO,SAAA;WAAS;gCACR,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,QAAA,CAAA,CAAA;;gBAERA,KAAAA,OAAO,SAAA;WAAS;gCACR,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,QAAA,CAAA,CAAA"}
|
|
@@ -35,10 +35,10 @@ declare const __VLS_base: import("vue").DefineComponent<InputOtpProps, {
|
|
|
35
35
|
}>, {
|
|
36
36
|
type: "outlined" | "filled" | "underlined";
|
|
37
37
|
length: number;
|
|
38
|
-
validator: (char: string, index: number) => boolean;
|
|
39
38
|
size: ComponentSize;
|
|
40
39
|
disabled: boolean;
|
|
41
40
|
validateEvent: boolean;
|
|
41
|
+
validator: (char: string, index: number) => boolean;
|
|
42
42
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
43
43
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
44
44
|
declare const _default: typeof __VLS_export;
|
|
@@ -131,7 +131,7 @@ declare const inputTagProps: {
|
|
|
131
131
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
132
132
|
readonly __epPropKey: true;
|
|
133
133
|
};
|
|
134
|
-
readonly tagEffect: EpPropFinalized<StringConstructor, "
|
|
134
|
+
readonly tagEffect: EpPropFinalized<StringConstructor, "dark" | "light" | "plain", unknown, "light", boolean>;
|
|
135
135
|
readonly effect: EpPropFinalized<(new (...args: any[]) => string) | (() => PopperEffect) | (((new (...args: any[]) => string) | (() => PopperEffect)) | null)[], unknown, unknown, "light", boolean>;
|
|
136
136
|
readonly trigger: EpPropFinalized<(new (...args: any[]) => "Enter" | "Space") | (() => "Enter" | "Space") | (((new (...args: any[]) => "Enter" | "Space") | (() => "Enter" | "Space")) | null)[], unknown, unknown, string, boolean>;
|
|
137
137
|
readonly draggable: BooleanConstructor;
|
|
@@ -22,39 +22,39 @@ declare const __VLS_base: import("vue").DefineComponent<InputTagProps, {
|
|
|
22
22
|
focus: () => void;
|
|
23
23
|
blur: () => void;
|
|
24
24
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
clear: () => void;
|
|
25
26
|
"update:modelValue": (value?: string[] | undefined) => void;
|
|
26
27
|
change: (value?: string[] | undefined) => void;
|
|
27
|
-
input: (value: string) => void;
|
|
28
|
-
clear: () => void;
|
|
29
28
|
focus: (evt: FocusEvent) => void;
|
|
30
29
|
blur: (evt: FocusEvent) => void;
|
|
30
|
+
input: (value: string) => void;
|
|
31
31
|
"add-tag": (value: string | string[]) => void;
|
|
32
32
|
"remove-tag": (value: string, index: number) => void;
|
|
33
33
|
"drag-tag": (oldIndex: number, newIndex: number, value: string) => void;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<InputTagProps> & Readonly<{
|
|
35
|
+
onClear?: (() => any) | undefined;
|
|
35
36
|
"onUpdate:modelValue"?: ((value?: string[] | undefined) => any) | undefined;
|
|
36
37
|
onChange?: ((value?: string[] | undefined) => any) | undefined;
|
|
37
|
-
onInput?: ((value: string) => any) | undefined;
|
|
38
|
-
onClear?: (() => any) | undefined;
|
|
39
38
|
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
40
39
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
40
|
+
onInput?: ((value: string) => any) | undefined;
|
|
41
41
|
"onAdd-tag"?: ((value: string | string[]) => any) | undefined;
|
|
42
42
|
"onRemove-tag"?: ((value: string, index: number) => any) | undefined;
|
|
43
43
|
"onDrag-tag"?: ((oldIndex: number, newIndex: number, value: string) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
|
-
effect: PopperEffect;
|
|
46
|
-
id: string;
|
|
47
45
|
disabled: boolean;
|
|
48
|
-
|
|
49
|
-
clearIcon: IconPropType;
|
|
46
|
+
id: string;
|
|
50
47
|
tabindex: string | number;
|
|
51
48
|
validateEvent: boolean;
|
|
49
|
+
effect: PopperEffect;
|
|
50
|
+
autocomplete: string;
|
|
51
|
+
clearIcon: IconPropType;
|
|
52
|
+
saveOnBlur: boolean;
|
|
52
53
|
trigger: "Enter" | "Space";
|
|
53
|
-
maxCollapseTags: number;
|
|
54
54
|
tagType: "info" | "primary" | "success" | "warning" | "danger";
|
|
55
|
-
tagEffect: "
|
|
56
|
-
saveOnBlur: boolean;
|
|
55
|
+
tagEffect: "dark" | "light" | "plain";
|
|
57
56
|
delimiter: string | RegExp;
|
|
57
|
+
maxCollapseTags: number;
|
|
58
58
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
59
59
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
60
60
|
declare const _default: typeof __VLS_export;
|
|
@@ -34,7 +34,7 @@ interface LinkProps {
|
|
|
34
34
|
* @deprecated Removed after 3.0.0, Use `LinkProps` instead.
|
|
35
35
|
*/
|
|
36
36
|
declare const linkProps: {
|
|
37
|
-
readonly type: EpPropFinalized<StringConstructor, "
|
|
37
|
+
readonly type: EpPropFinalized<StringConstructor, "info" | "default" | "primary" | "success" | "warning" | "danger", unknown, undefined, boolean>;
|
|
38
38
|
readonly underline: EpPropFinalized<readonly [BooleanConstructor, StringConstructor], boolean | "always" | "never" | "hover", unknown, undefined, boolean>;
|
|
39
39
|
readonly disabled: BooleanConstructor;
|
|
40
40
|
readonly href: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -12,10 +12,10 @@ declare const __VLS_base: import("vue").DefineComponent<LinkProps, {}, {}, {}, {
|
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{
|
|
13
13
|
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
-
underline: boolean | "always" | "never" | "hover";
|
|
16
15
|
type: "primary" | "success" | "warning" | "info" | "danger" | "default";
|
|
17
|
-
|
|
16
|
+
underline: boolean | "always" | "never" | "hover";
|
|
18
17
|
href: string;
|
|
18
|
+
target: "_blank" | "_parent" | "_self" | "_top" | (string & NonNullable<unknown>);
|
|
19
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
@@ -80,7 +80,7 @@ declare const mentionProps: {
|
|
|
80
80
|
prefix: EpPropFinalized<(new (...args: any[]) => string | string[]) | (() => string | string[]) | (((new (...args: any[]) => string | string[]) | (() => string | string[])) | null)[], unknown, unknown, string, boolean>;
|
|
81
81
|
split: EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
82
82
|
filterOption: EpPropFinalized<(new (...args: any[]) => false | (<T extends MentionOption = MentionOption>(pattern: string, option: T & MentionOption) => boolean)) | (() => false | (<T extends MentionOption = MentionOption>(pattern: string, option: T & MentionOption) => boolean)) | (((new (...args: any[]) => false | (<T extends MentionOption = MentionOption>(pattern: string, option: T & MentionOption) => boolean)) | (() => false | (<T extends MentionOption = MentionOption>(pattern: string, option: T & MentionOption) => boolean))) | null)[], unknown, unknown, () => <T extends MentionOption = MentionOption>(pattern: string, option: T & MentionOption) => boolean, boolean>;
|
|
83
|
-
placement: EpPropFinalized<(new (...args: any[]) => "
|
|
83
|
+
placement: EpPropFinalized<(new (...args: any[]) => "bottom" | "top") | (() => "bottom" | "top") | (((new (...args: any[]) => "bottom" | "top") | (() => "bottom" | "top")) | null)[], unknown, unknown, string, boolean>;
|
|
84
84
|
showArrow: BooleanConstructor;
|
|
85
85
|
offset: EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
86
86
|
whole: BooleanConstructor;
|
|
@@ -197,7 +197,7 @@ declare const mentionProps: {
|
|
|
197
197
|
popperStyle: EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue)) | null)[], unknown, unknown, undefined, boolean>;
|
|
198
198
|
popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | (((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>)) | null)[], unknown, unknown, () => Partial<Options>, boolean>;
|
|
199
199
|
props: EpPropFinalized<(new (...args: any[]) => MentionOptionProps) | (() => MentionOptionProps) | (((new (...args: any[]) => MentionOptionProps) | (() => MentionOptionProps)) | null)[], unknown, unknown, () => Required<MentionOptionProps>, boolean>;
|
|
200
|
-
inputmode: EpPropFinalized<(new (...args: any[]) => "text" | "
|
|
200
|
+
inputmode: EpPropFinalized<(new (...args: any[]) => "text" | "search" | "email" | "tel" | "url" | "none" | "numeric" | "decimal") | (() => "text" | "search" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined) | (((new (...args: any[]) => "text" | "search" | "email" | "tel" | "url" | "none" | "numeric" | "decimal") | (() => "text" | "search" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined)) | null)[], unknown, unknown, undefined, boolean>;
|
|
201
201
|
name: StringConstructor;
|
|
202
202
|
ariaLabel: StringConstructor;
|
|
203
203
|
id: EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
@@ -230,7 +230,7 @@ declare const mentionProps: {
|
|
|
230
230
|
};
|
|
231
231
|
type: EpPropFinalized<(new (...args: any[]) => string) | (() => InputType) | (((new (...args: any[]) => string) | (() => InputType)) | null)[], unknown, unknown, "text", boolean>;
|
|
232
232
|
resize: {
|
|
233
|
-
readonly type: import("vue").PropType<EpPropMergeType<StringConstructor, "
|
|
233
|
+
readonly type: import("vue").PropType<EpPropMergeType<StringConstructor, "horizontal" | "vertical" | "none" | "both", unknown>>;
|
|
234
234
|
readonly required: false;
|
|
235
235
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
236
236
|
__epPropKey: true;
|
|
@@ -7,11 +7,11 @@ import { MentionProps } from "./mention.js";
|
|
|
7
7
|
declare const __VLS_export: <T extends MentionOption = MentionOption>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
8
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<MentionProps<T> & {
|
|
9
9
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
10
|
-
onInput?: ((value: string) => any) | undefined;
|
|
11
10
|
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
12
11
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
13
|
-
onSelect?: ((option: MentionOption, prefix: string) => any) | undefined;
|
|
14
12
|
onSearch?: ((pattern: string, prefix: string) => any) | undefined;
|
|
13
|
+
onInput?: ((value: string) => any) | undefined;
|
|
14
|
+
onSelect?: ((option: MentionOption, prefix: string) => any) | undefined;
|
|
15
15
|
"onWhole-remove"?: ((pattern: string, prefix: string) => any) | undefined;
|
|
16
16
|
}> & (typeof globalThis extends {
|
|
17
17
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -45,7 +45,7 @@ declare const __VLS_export: <T extends MentionOption = MentionOption>(__VLS_prop
|
|
|
45
45
|
index: number;
|
|
46
46
|
}) => any;
|
|
47
47
|
};
|
|
48
|
-
emit: ((event: "update:modelValue", value: string) => void) & ((event: "
|
|
48
|
+
emit: ((event: "update:modelValue", value: string) => void) & ((event: "focus", evt: FocusEvent) => void) & ((event: "blur", evt: FocusEvent) => void) & ((event: "search", pattern: string, prefix: string) => void) & ((event: "input", value: string) => void) & ((event: "select", option: MentionOption, prefix: string) => void) & ((event: "whole-remove", pattern: string, prefix: string) => void);
|
|
49
49
|
}>) => import("vue").VNode & {
|
|
50
50
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
51
51
|
};
|
|
@@ -105,13 +105,13 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
105
105
|
readonly persistent: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
106
106
|
readonly widget: StringConstructor;
|
|
107
107
|
}>> & Readonly<{
|
|
108
|
-
onClose?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
109
|
-
onSelect?: ((index: string, indexPath: string[], item: MenuItemClicked, routerResult?: Promise<void | NavigationFailure> | undefined) => any) | undefined;
|
|
110
108
|
onOpen?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
109
|
+
onSelect?: ((index: string, indexPath: string[], item: MenuItemClicked, routerResult?: Promise<void | NavigationFailure> | undefined) => any) | undefined;
|
|
110
|
+
onClose?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
111
111
|
}>, {
|
|
112
|
+
readonly persistent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
112
113
|
readonly collapse: boolean;
|
|
113
114
|
readonly ellipsis: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
114
|
-
readonly persistent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
115
115
|
readonly mode: EpPropMergeType<StringConstructor, "horizontal" | "vertical", unknown>;
|
|
116
116
|
readonly showTimeout: number;
|
|
117
117
|
readonly hideTimeout: number;
|
|
@@ -7,10 +7,10 @@ const require_runtime = require("../../../utils/vue/props/runtime.js");
|
|
|
7
7
|
const require_icon = require("../../../utils/vue/icon.js");
|
|
8
8
|
const require_vnode = require("../../../utils/vue/vnode.js");
|
|
9
9
|
const require_typescript = require("../../../utils/typescript.js");
|
|
10
|
-
const require_index = require("../../../
|
|
11
|
-
const require_index$1 = require("../../../hooks/use-namespace/index.js");
|
|
10
|
+
const require_index = require("../../../hooks/use-namespace/index.js");
|
|
12
11
|
const require_for_editor = require("../../config-provider/src/for-editor.js");
|
|
13
|
-
const require_index$
|
|
12
|
+
const require_index$1 = require("../../icon/index.js");
|
|
13
|
+
const require_index$2 = require("../../../directives/click-outside/index.js");
|
|
14
14
|
const require_menu_bar = require("./utils/menu-bar.js");
|
|
15
15
|
const require_menu_collapse_transition = require("./menu-collapse-transition.js");
|
|
16
16
|
const require_use_menu_css_var = require("./use-menu-css-var.js");
|
|
@@ -166,8 +166,8 @@ var menu_default = (0, vue.defineComponent)({
|
|
|
166
166
|
const router = instance.appContext.config.globalProperties.$router;
|
|
167
167
|
const menu = (0, vue.ref)();
|
|
168
168
|
const subMenu = (0, vue.ref)();
|
|
169
|
-
const nsMenu = require_index
|
|
170
|
-
const nsSubMenu = require_index
|
|
169
|
+
const nsMenu = require_index.useNamespace("menu");
|
|
170
|
+
const nsSubMenu = require_index.useNamespace("sub-menu");
|
|
171
171
|
let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH;
|
|
172
172
|
const sliceIndex = (0, vue.ref)(-1);
|
|
173
173
|
const openedMenus = (0, vue.ref)(props.defaultOpeneds && !props.collapse ? props.defaultOpeneds.slice(0) : []);
|
|
@@ -355,12 +355,12 @@ var menu_default = (0, vue.defineComponent)({
|
|
|
355
355
|
class: nsSubMenu.e("hide-arrow"),
|
|
356
356
|
popperOffset: props.popperOffset
|
|
357
357
|
}, {
|
|
358
|
-
title: () => (0, vue.h)(require_index$
|
|
358
|
+
title: () => (0, vue.h)(require_index$1.ElIcon, { class: nsSubMenu.e("icon-more") }, { default: () => (0, vue.h)(props.ellipsisIcon) }),
|
|
359
359
|
default: () => slotMore
|
|
360
360
|
}));
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
const directives = props.closeOnClickOutside ? [[require_index.default, () => {
|
|
363
|
+
const directives = props.closeOnClickOutside ? [[require_index$2.default, () => {
|
|
364
364
|
if (!openedMenus.value.length) return;
|
|
365
365
|
if (!mouseInChild.value) {
|
|
366
366
|
openedMenus.value.forEach((openedMenu) => emit("close", openedMenu, getIndexPath(openedMenu)));
|
|
@@ -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,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;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B,cAAc,MAAM;KACtB,GACA;MACE,cAAA,GAAA,IAAA,EAAA,CAEIC,gBAAAA,QACA,EACE,OAAO,UAAU,EAAE,WAAW,EAChC,GACA,EACE,gBAAA,GAAA,IAAA,EAAA,CAAiB,MAAM,YAAyB,EAClD,CACF;MACF,eAAe;KACjB,CACF,CACF;IACF;GACF;GAEA,MAAM,aAAiC,MAAM,sBACzC,CACE,CACEC,cAAAA,eACM;IACJ,IAAI,CAAC,YAAY,MAAM,QAAQ;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"}
|
|
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,SA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epPropKey: true;
|
|
138
138
|
};
|
|
139
139
|
}>> & Readonly<{}>, {
|
|
140
|
-
readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
141
140
|
readonly disabled: boolean;
|
|
141
|
+
readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
142
142
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
143
143
|
//#endregion
|
|
144
144
|
export { SubMenuProps, SubMenuPropsPublic, _default as default, subMenuProps };
|
|
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_aria = require("../../../../
|
|
6
|
-
const require_aria$1 = require("../../../../
|
|
5
|
+
const require_aria = require("../../../../constants/aria.js");
|
|
6
|
+
const require_aria$1 = require("../../../../utils/dom/aria.js");
|
|
7
7
|
const require_event = require("../../../../utils/dom/event.js");
|
|
8
8
|
const require_submenu = require("./submenu.js");
|
|
9
9
|
//#region ../../packages/components/menu/src/utils/menu-item.ts
|
|
@@ -24,22 +24,22 @@ var MenuItem = class {
|
|
|
24
24
|
const code = require_event.getEventCode(event);
|
|
25
25
|
let prevDef = false;
|
|
26
26
|
switch (code) {
|
|
27
|
-
case require_aria
|
|
28
|
-
require_aria.triggerEvent(event.currentTarget, "mouseenter");
|
|
27
|
+
case require_aria.EVENT_CODE.down:
|
|
28
|
+
require_aria$1.triggerEvent(event.currentTarget, "mouseenter");
|
|
29
29
|
this.submenu?.gotoSubIndex(0);
|
|
30
30
|
prevDef = true;
|
|
31
31
|
break;
|
|
32
|
-
case require_aria
|
|
33
|
-
require_aria.triggerEvent(event.currentTarget, "mouseenter");
|
|
32
|
+
case require_aria.EVENT_CODE.up:
|
|
33
|
+
require_aria$1.triggerEvent(event.currentTarget, "mouseenter");
|
|
34
34
|
this.submenu?.gotoSubIndex(this.submenu.subMenuItems.length - 1);
|
|
35
35
|
prevDef = true;
|
|
36
36
|
break;
|
|
37
|
-
case require_aria
|
|
38
|
-
require_aria.triggerEvent(event.currentTarget, "mouseleave");
|
|
37
|
+
case require_aria.EVENT_CODE.tab:
|
|
38
|
+
require_aria$1.triggerEvent(event.currentTarget, "mouseleave");
|
|
39
39
|
break;
|
|
40
|
-
case require_aria
|
|
41
|
-
case require_aria
|
|
42
|
-
case require_aria
|
|
40
|
+
case require_aria.EVENT_CODE.enter:
|
|
41
|
+
case require_aria.EVENT_CODE.numpadEnter:
|
|
42
|
+
case require_aria.EVENT_CODE.space:
|
|
43
43
|
prevDef = true;
|
|
44
44
|
event.currentTarget.click();
|
|
45
45
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.js","names":["SubMenu","getEventCode","EVENT_CODE"],"sources":["../../../../../../../packages/components/menu/src/utils/menu-item.ts"],"sourcesContent":["import { getEventCode, triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport SubMenu from './submenu'\n\nclass MenuItem {\n public submenu: SubMenu | null\n constructor(\n public domNode: HTMLElement,\n namespace: string\n ) {\n this.submenu = null\n this.init(namespace)\n }\n\n init(namespace: string): void {\n this.domNode.setAttribute('tabindex', '0')\n const menuChild = this.domNode.querySelector(`.${namespace}-menu`)\n if (menuChild) {\n this.submenu = new SubMenu(this, menuChild)\n }\n this.addListeners()\n }\n\n addListeners() {\n this.domNode.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = getEventCode(event)\n let prevDef = false\n\n switch (code) {\n case EVENT_CODE.down: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu?.gotoSubIndex(0)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu?.gotoSubIndex(this.submenu.subMenuItems.length - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n }\n })\n }\n}\n\nexport default MenuItem\n"],"mappings":";;;;;;;;;AAIA,IAAM,WAAN,MAAe;CAEb,YACE,SACA,WACA;EAFO,KAAA,UAAA;EAGP,KAAK,UAAU;EACf,KAAK,KAAK,SAAS;CACrB;CAEA,KAAK,WAAyB;EAC5B,KAAK,QAAQ,aAAa,YAAY,GAAG;EACzC,MAAM,YAAY,KAAK,QAAQ,cAAc,IAAI,UAAU,MAAM;EACjE,IAAI,WACF,KAAK,UAAU,IAAIA,gBAAAA,QAAQ,MAAM,SAAS;EAE5C,KAAK,aAAa;CACpB;CAEA,eAAe;EACb,KAAK,QAAQ,iBAAiB,YAAY,UAAyB;GACjE,MAAM,OAAOC,cAAAA,aAAa,KAAK;GAC/B,IAAI,UAAU;GAEd,QAAQ,MAAR;IACE,KAAKC,
|
|
1
|
+
{"version":3,"file":"menu-item.js","names":["SubMenu","getEventCode","EVENT_CODE"],"sources":["../../../../../../../packages/components/menu/src/utils/menu-item.ts"],"sourcesContent":["import { getEventCode, triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport SubMenu from './submenu'\n\nclass MenuItem {\n public submenu: SubMenu | null\n constructor(\n public domNode: HTMLElement,\n namespace: string\n ) {\n this.submenu = null\n this.init(namespace)\n }\n\n init(namespace: string): void {\n this.domNode.setAttribute('tabindex', '0')\n const menuChild = this.domNode.querySelector(`.${namespace}-menu`)\n if (menuChild) {\n this.submenu = new SubMenu(this, menuChild)\n }\n this.addListeners()\n }\n\n addListeners() {\n this.domNode.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = getEventCode(event)\n let prevDef = false\n\n switch (code) {\n case EVENT_CODE.down: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu?.gotoSubIndex(0)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseenter')\n this.submenu?.gotoSubIndex(this.submenu.subMenuItems.length - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(event.currentTarget as HTMLElement, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n }\n })\n }\n}\n\nexport default MenuItem\n"],"mappings":";;;;;;;;;AAIA,IAAM,WAAN,MAAe;CAEb,YACE,SACA,WACA;EAFO,KAAA,UAAA;EAGP,KAAK,UAAU;EACf,KAAK,KAAK,SAAS;CACrB;CAEA,KAAK,WAAyB;EAC5B,KAAK,QAAQ,aAAa,YAAY,GAAG;EACzC,MAAM,YAAY,KAAK,QAAQ,cAAc,IAAI,UAAU,MAAM;EACjE,IAAI,WACF,KAAK,UAAU,IAAIA,gBAAAA,QAAQ,MAAM,SAAS;EAE5C,KAAK,aAAa;CACpB;CAEA,eAAe;EACb,KAAK,QAAQ,iBAAiB,YAAY,UAAyB;GACjE,MAAM,OAAOC,cAAAA,aAAa,KAAK;GAC/B,IAAI,UAAU;GAEd,QAAQ,MAAR;IACE,KAAKC,aAAAA,WAAW;KACd,eAAA,aAAa,MAAM,eAA8B,YAAY;KAC7D,KAAK,SAAS,aAAa,CAAC;KAC5B,UAAU;KACV;IAEF,KAAKA,aAAAA,WAAW;KACd,eAAA,aAAa,MAAM,eAA8B,YAAY;KAC7D,KAAK,SAAS,aAAa,KAAK,QAAQ,aAAa,SAAS,CAAC;KAC/D,UAAU;KACV;IAEF,KAAKA,aAAAA,WAAW;KACd,eAAA,aAAa,MAAM,eAA8B,YAAY;KAC7D;IAEF,KAAKA,aAAAA,WAAW;IAChB,KAAKA,aAAAA,WAAW;IAChB,KAAKA,aAAAA,WAAW;KACd,UAAU;KACT,MAAO,cAA8B,MAAM;KAC5C;GAEJ;GACA,IAAI,SACF,MAAM,eAAe;EAEzB,CAAC;CACH;AACF"}
|
|
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_aria = require("../../../../
|
|
6
|
-
const require_aria$1 = require("../../../../
|
|
5
|
+
const require_aria = require("../../../../constants/aria.js");
|
|
6
|
+
const require_aria$1 = require("../../../../utils/dom/aria.js");
|
|
7
7
|
const require_event = require("../../../../utils/dom/event.js");
|
|
8
8
|
//#region ../../packages/components/menu/src/utils/submenu.ts
|
|
9
9
|
var SubMenu = class {
|
|
@@ -27,20 +27,20 @@ var SubMenu = class {
|
|
|
27
27
|
const code = require_event.getEventCode(event);
|
|
28
28
|
let prevDef = false;
|
|
29
29
|
switch (code) {
|
|
30
|
-
case require_aria
|
|
30
|
+
case require_aria.EVENT_CODE.down:
|
|
31
31
|
this.gotoSubIndex(this.subIndex + 1);
|
|
32
32
|
prevDef = true;
|
|
33
33
|
break;
|
|
34
|
-
case require_aria
|
|
34
|
+
case require_aria.EVENT_CODE.up:
|
|
35
35
|
this.gotoSubIndex(this.subIndex - 1);
|
|
36
36
|
prevDef = true;
|
|
37
37
|
break;
|
|
38
|
-
case require_aria
|
|
39
|
-
require_aria.triggerEvent(parentNode, "mouseleave");
|
|
38
|
+
case require_aria.EVENT_CODE.tab:
|
|
39
|
+
require_aria$1.triggerEvent(parentNode, "mouseleave");
|
|
40
40
|
break;
|
|
41
|
-
case require_aria
|
|
42
|
-
case require_aria
|
|
43
|
-
case require_aria
|
|
41
|
+
case require_aria.EVENT_CODE.enter:
|
|
42
|
+
case require_aria.EVENT_CODE.numpadEnter:
|
|
43
|
+
case require_aria.EVENT_CODE.space:
|
|
44
44
|
prevDef = true;
|
|
45
45
|
event.currentTarget.click();
|
|
46
46
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submenu.js","names":["getEventCode","EVENT_CODE"],"sources":["../../../../../../../packages/components/menu/src/utils/submenu.ts"],"sourcesContent":["import { getEventCode, triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\n\nimport type MenuItem from './menu-item'\n\nclass SubMenu {\n public subMenuItems: NodeListOf<HTMLLIElement>\n public subIndex: number\n constructor(\n public parent: MenuItem,\n public domNode: ParentNode\n ) {\n this.subIndex = 0\n this.subMenuItems = this.domNode.querySelectorAll('li')\n this.addListeners()\n }\n\n gotoSubIndex(idx: number) {\n if (idx === this.subMenuItems.length) {\n idx = 0\n } else if (idx < 0) {\n idx = this.subMenuItems.length - 1\n }\n this.subMenuItems[idx].focus()\n this.subIndex = idx\n }\n\n addListeners() {\n const parentNode = this.parent.domNode\n this.subMenuItems.forEach((el) => {\n el.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = getEventCode(event)\n let prevDef = false\n\n switch (code) {\n case EVENT_CODE.down: {\n this.gotoSubIndex(this.subIndex + 1)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n this.gotoSubIndex(this.subIndex - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(parentNode, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n event.stopPropagation()\n }\n return false\n })\n })\n }\n}\n\nexport default SubMenu\n"],"mappings":";;;;;;;;AAKA,IAAM,UAAN,MAAc;CAGZ,YACE,QACA,SACA;EAFO,KAAA,SAAA;EACA,KAAA,UAAA;EAEP,KAAK,WAAW;EAChB,KAAK,eAAe,KAAK,QAAQ,iBAAiB,IAAI;EACtD,KAAK,aAAa;CACpB;CAEA,aAAa,KAAa;EACxB,IAAI,QAAQ,KAAK,aAAa,QAC5B,MAAM;OACD,IAAI,MAAM,GACf,MAAM,KAAK,aAAa,SAAS;EAEnC,KAAK,aAAa,IAAI,CAAC,MAAM;EAC7B,KAAK,WAAW;CAClB;CAEA,eAAe;EACb,MAAM,aAAa,KAAK,OAAO;EAC/B,KAAK,aAAa,SAAS,OAAO;GAChC,GAAG,iBAAiB,YAAY,UAAyB;IACvD,MAAM,OAAOA,cAAAA,aAAa,KAAK;IAC/B,IAAI,UAAU;IAEd,QAAQ,MAAR;KACE,KAAKC,
|
|
1
|
+
{"version":3,"file":"submenu.js","names":["getEventCode","EVENT_CODE"],"sources":["../../../../../../../packages/components/menu/src/utils/submenu.ts"],"sourcesContent":["import { getEventCode, triggerEvent } from '@element-plus/utils'\nimport { EVENT_CODE } from '@element-plus/constants'\n\nimport type MenuItem from './menu-item'\n\nclass SubMenu {\n public subMenuItems: NodeListOf<HTMLLIElement>\n public subIndex: number\n constructor(\n public parent: MenuItem,\n public domNode: ParentNode\n ) {\n this.subIndex = 0\n this.subMenuItems = this.domNode.querySelectorAll('li')\n this.addListeners()\n }\n\n gotoSubIndex(idx: number) {\n if (idx === this.subMenuItems.length) {\n idx = 0\n } else if (idx < 0) {\n idx = this.subMenuItems.length - 1\n }\n this.subMenuItems[idx].focus()\n this.subIndex = idx\n }\n\n addListeners() {\n const parentNode = this.parent.domNode\n this.subMenuItems.forEach((el) => {\n el.addEventListener('keydown', (event: KeyboardEvent) => {\n const code = getEventCode(event)\n let prevDef = false\n\n switch (code) {\n case EVENT_CODE.down: {\n this.gotoSubIndex(this.subIndex + 1)\n prevDef = true\n break\n }\n case EVENT_CODE.up: {\n this.gotoSubIndex(this.subIndex - 1)\n prevDef = true\n break\n }\n case EVENT_CODE.tab: {\n triggerEvent(parentNode, 'mouseleave')\n break\n }\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n case EVENT_CODE.space: {\n prevDef = true\n ;(event.currentTarget as HTMLElement).click()\n break\n }\n }\n if (prevDef) {\n event.preventDefault()\n event.stopPropagation()\n }\n return false\n })\n })\n }\n}\n\nexport default SubMenu\n"],"mappings":";;;;;;;;AAKA,IAAM,UAAN,MAAc;CAGZ,YACE,QACA,SACA;EAFO,KAAA,SAAA;EACA,KAAA,UAAA;EAEP,KAAK,WAAW;EAChB,KAAK,eAAe,KAAK,QAAQ,iBAAiB,IAAI;EACtD,KAAK,aAAa;CACpB;CAEA,aAAa,KAAa;EACxB,IAAI,QAAQ,KAAK,aAAa,QAC5B,MAAM;OACD,IAAI,MAAM,GACf,MAAM,KAAK,aAAa,SAAS;EAEnC,KAAK,aAAa,IAAI,CAAC,MAAM;EAC7B,KAAK,WAAW;CAClB;CAEA,eAAe;EACb,MAAM,aAAa,KAAK,OAAO;EAC/B,KAAK,aAAa,SAAS,OAAO;GAChC,GAAG,iBAAiB,YAAY,UAAyB;IACvD,MAAM,OAAOA,cAAAA,aAAa,KAAK;IAC/B,IAAI,UAAU;IAEd,QAAQ,MAAR;KACE,KAAKC,aAAAA,WAAW;MACd,KAAK,aAAa,KAAK,WAAW,CAAC;MACnC,UAAU;MACV;KAEF,KAAKA,aAAAA,WAAW;MACd,KAAK,aAAa,KAAK,WAAW,CAAC;MACnC,UAAU;MACV;KAEF,KAAKA,aAAAA,WAAW;MACd,eAAA,aAAa,YAAY,YAAY;MACrC;KAEF,KAAKA,aAAAA,WAAW;KAChB,KAAKA,aAAAA,WAAW;KAChB,KAAKA,aAAAA,WAAW;MACd,UAAU;MACT,MAAO,cAA8B,MAAM;MAC5C;IAEJ;IACA,IAAI,SAAS;KACX,MAAM,eAAe;KACrB,MAAM,gBAAgB;IACxB;IACA,OAAO;GACT,CAAC;EACH,CAAC;CACH;AACF"}
|
|
@@ -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<"bottom" | "top" | "top-right" | "top-left" | "bottom-right" | "bottom-left", MessageContext[]>>;
|
|
14
14
|
declare const getOrCreatePlacementInstances: (placement: MessagePlacement) => MessageContext[];
|
|
15
15
|
declare const getInstance: (id: string, placement: MessagePlacement) => {
|
|
16
16
|
current: MessageContext;
|