@element-plus/nightly 0.0.20260406 → 0.0.20260408
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 +37 -8
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +6 -6
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +37 -8
- 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 +3 -3
- package/es/components/affix/src/affix.vue.d.ts +1 -1
- package/es/components/alert/src/alert.vue.d.ts +1 -1
- package/es/components/anchor/src/anchor.d.ts +1 -1
- package/es/components/anchor/src/anchor.vue.d.ts +4 -4
- package/es/components/autocomplete/src/autocomplete.d.ts +1 -1
- package/es/components/autocomplete/src/autocomplete.vue_vue_type_script_setup_true_lang.mjs +4 -2
- package/es/components/autocomplete/src/autocomplete.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/badge/src/badge.vue.d.ts +1 -1
- package/es/components/calendar/style/css.mjs +1 -1
- package/es/components/calendar/style/index.mjs +1 -1
- package/es/components/carousel/src/carousel.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +2 -2
- package/es/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +1 -1
- package/es/components/col/src/col.vue.d.ts +1 -1
- package/es/components/countdown/src/countdown.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/descriptions/src/description.d.ts +1 -1
- package/es/components/descriptions/src/description.vue.d.ts +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +1 -1
- 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 +2 -2
- package/es/components/dropdown/src/dropdown.vue.d.ts +6 -6
- package/es/components/dropdown/style/css.mjs +1 -1
- package/es/components/dropdown/style/index.mjs +1 -1
- package/es/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/es/components/index.mjs +6 -6
- package/es/components/input/src/input.d.ts +1 -1
- package/es/components/link/src/link.vue.d.ts +1 -1
- package/es/components/mention/src/mention.d.ts +1 -1
- package/es/components/mention/src/mention.vue_vue_type_script_setup_true_lang.mjs +5 -3
- package/es/components/mention/src/mention.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs.map +1 -1
- package/es/components/menu/src/menu.d.ts +4 -4
- 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/message.vue.d.ts +3 -3
- package/es/components/message/src/message.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/message/src/message.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/message/src/message2.mjs.map +1 -1
- package/es/components/notification/src/notification.vue.d.ts +4 -4
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +1 -1
- package/es/components/popover/src/popover.vue.d.ts +1 -1
- package/es/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/es/components/popper/src/content.vue.d.ts +1 -1
- package/es/components/progress/src/progress.vue.d.ts +1 -1
- package/es/components/radio/src/radio-group.vue.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.vue.d.ts +2 -2
- package/es/components/segmented/src/segmented.d.ts +1 -1
- package/es/components/select/src/option.vue.d.ts +1 -0
- package/es/components/select/src/option.vue_vue_type_script_lang.mjs +11 -0
- package/es/components/select/src/option.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/select/src/option2.mjs +2 -1
- package/es/components/select/src/option2.mjs.map +1 -1
- package/es/components/select/src/select.vue.d.ts +6 -5
- package/es/components/select/src/type.d.ts +1 -0
- package/es/components/select-v2/src/option-item.mjs +2 -1
- package/es/components/select-v2/src/option-item.mjs.map +1 -1
- package/es/components/select-v2/src/option-item.vue_vue_type_script_lang.mjs +13 -1
- package/es/components/select-v2/src/option-item.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +5 -5
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/slider.vue.d.ts +1 -1
- package/es/components/space/src/space.d.ts +4 -4
- package/es/components/splitter/src/splitter.d.ts +1 -1
- package/es/components/steps/src/steps.d.ts +1 -1
- package/es/components/steps/src/steps.vue.d.ts +1 -1
- package/es/components/table/src/table-column/index.d.ts +1 -1
- package/es/components/table/src/table.vue.d.ts +2 -2
- package/es/components/tooltip/src/content.vue.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +1 -1
- package/es/components/tree-select/src/tree-select.vue.d.ts +2 -2
- package/es/components/virtual-list/src/builders/build-grid.d.ts +1 -1
- package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +4 -4
- package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +4 -4
- package/es/components/virtual-list/src/props.d.ts +2 -2
- package/es/constants/index.mjs +2 -2
- package/es/directives/trap-focus/index.mjs +1 -1
- package/es/index.mjs +9 -9
- package/es/plugin.mjs +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/component.js +107 -107
- package/lib/components/affix/src/affix.vue.d.ts +1 -1
- package/lib/components/alert/src/alert.vue.d.ts +1 -1
- package/lib/components/anchor/src/anchor.d.ts +1 -1
- package/lib/components/anchor/src/anchor.vue.d.ts +4 -4
- package/lib/components/autocomplete/src/autocomplete.d.ts +1 -1
- package/lib/components/autocomplete/src/autocomplete.vue_vue_type_script_setup_true_lang.js +4 -2
- package/lib/components/autocomplete/src/autocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +1 -1
- package/lib/components/calendar/style/css.js +1 -1
- package/lib/components/calendar/style/index.js +1 -1
- package/lib/components/carousel/src/carousel.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +2 -2
- package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js +12 -12
- 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 +11 -11
- package/lib/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +1 -1
- package/lib/components/col/src/col.vue.d.ts +1 -1
- package/lib/components/countdown/src/countdown.vue_vue_type_script_setup_true_lang.js +1 -1
- package/lib/components/descriptions/src/description.d.ts +1 -1
- package/lib/components/descriptions/src/description.vue.d.ts +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +1 -1
- 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 +2 -2
- package/lib/components/dropdown/src/dropdown.vue.d.ts +6 -6
- package/lib/components/dropdown/style/css.js +1 -1
- package/lib/components/dropdown/style/index.js +1 -1
- package/lib/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/lib/components/index.js +123 -123
- package/lib/components/input/src/input.d.ts +1 -1
- package/lib/components/link/src/link.vue.d.ts +1 -1
- package/lib/components/mention/src/mention.d.ts +1 -1
- package/lib/components/mention/src/mention.vue_vue_type_script_setup_true_lang.js +4 -2
- package/lib/components/mention/src/mention.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/mention/src/mention2.js.map +1 -1
- package/lib/components/menu/src/menu.d.ts +4 -4
- 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/message.vue.d.ts +3 -3
- package/lib/components/message/src/message.vue_vue_type_script_setup_true_lang.js +1 -1
- package/lib/components/message/src/message.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/message/src/message2.js.map +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +4 -4
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +1 -1
- package/lib/components/popover/src/popover.vue.d.ts +1 -1
- package/lib/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/lib/components/popper/src/content.vue.d.ts +1 -1
- package/lib/components/progress/src/progress.vue.d.ts +1 -1
- package/lib/components/radio/src/radio-group.vue.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.vue.d.ts +2 -2
- package/lib/components/segmented/src/segmented.d.ts +1 -1
- package/lib/components/select/src/option.vue.d.ts +1 -0
- package/lib/components/select/src/option.vue_vue_type_script_lang.js +11 -0
- package/lib/components/select/src/option.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/select/src/option2.js +2 -1
- package/lib/components/select/src/option2.js.map +1 -1
- package/lib/components/select/src/select.vue.d.ts +6 -5
- package/lib/components/select/src/type.d.ts +1 -0
- package/lib/components/select-v2/src/option-item.js +2 -1
- package/lib/components/select-v2/src/option-item.js.map +1 -1
- package/lib/components/select-v2/src/option-item.vue_vue_type_script_lang.js +13 -1
- package/lib/components/select-v2/src/option-item.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +5 -5
- package/lib/components/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +1 -1
- package/lib/components/space/src/space.d.ts +4 -4
- package/lib/components/splitter/src/splitter.d.ts +1 -1
- package/lib/components/steps/src/steps.d.ts +1 -1
- package/lib/components/steps/src/steps.vue.d.ts +1 -1
- package/lib/components/table/src/table-column/index.d.ts +1 -1
- package/lib/components/table/src/table.vue.d.ts +2 -2
- package/lib/components/tooltip/src/content.vue.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +1 -1
- package/lib/components/tree-select/src/tree-select.vue.d.ts +2 -2
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +1 -1
- package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +4 -4
- package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +4 -4
- package/lib/components/virtual-list/src/props.d.ts +2 -2
- 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/index.js +126 -126
- package/lib/plugin.js +12 -12
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -53,9 +53,9 @@ declare const __VLS_base: vue.DefineComponent<CascaderComponentProps, {
|
|
|
53
53
|
onExpandChange?: ((val: CascaderValue) => any) | undefined;
|
|
54
54
|
onRemoveTag?: ((val: CascaderNodeValue | CascaderNodePathValue) => any) | undefined;
|
|
55
55
|
}>, {
|
|
56
|
-
effect: PopperEffect;
|
|
57
|
-
props: CascaderProps;
|
|
58
56
|
teleported: boolean;
|
|
57
|
+
props: CascaderProps;
|
|
58
|
+
effect: PopperEffect;
|
|
59
59
|
disabled: boolean;
|
|
60
60
|
clearIcon: IconPropType;
|
|
61
61
|
validateEvent: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { focusNode, getSibling } from "../../../utils/dom/aria.mjs";
|
|
2
1
|
import { EVENT_CODE } from "../../../constants/aria.mjs";
|
|
3
2
|
import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from "../../../constants/event.mjs";
|
|
3
|
+
import { focusNode, getSibling } from "../../../utils/dom/aria.mjs";
|
|
4
4
|
import { isClient as isClient$1 } from "../../../utils/browser.mjs";
|
|
5
5
|
import { getEventCode } from "../../../utils/dom/event.mjs";
|
|
6
6
|
import { isPromise } from "../../../utils/types.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { focusNode, getSibling } from "../../../utils/dom/aria.mjs";
|
|
2
1
|
import { EVENT_CODE } from "../../../constants/aria.mjs";
|
|
3
2
|
import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from "../../../constants/event.mjs";
|
|
3
|
+
import { focusNode, getSibling } from "../../../utils/dom/aria.mjs";
|
|
4
4
|
import { isClient } from "../../../utils/browser.mjs";
|
|
5
5
|
import { getEventCode } from "../../../utils/dom/event.mjs";
|
|
6
6
|
import { isEmpty } from "../../../utils/types.mjs";
|
|
@@ -15,12 +15,12 @@ declare const __VLS_base: vue.DefineComponent<CheckboxGroupProps, {}, {}, {}, {}
|
|
|
15
15
|
onChange?: ((val: CheckboxValueType[]) => any) | undefined;
|
|
16
16
|
"onUpdate:modelValue"?: ((val: CheckboxGroupValueType) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
|
-
type: "checkbox" | "button";
|
|
19
18
|
props: {
|
|
20
19
|
value?: string;
|
|
21
20
|
label?: string;
|
|
22
21
|
disabled?: string;
|
|
23
22
|
};
|
|
23
|
+
type: "checkbox" | "button";
|
|
24
24
|
disabled: boolean;
|
|
25
25
|
modelValue: CheckboxGroupValueType;
|
|
26
26
|
validateEvent: boolean;
|
|
@@ -7,8 +7,8 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
default?: (props: typeof __VLS_8) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: vue.DefineComponent<ColProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<ColProps> & Readonly<{}>, {
|
|
10
|
-
push: number;
|
|
11
10
|
offset: number;
|
|
11
|
+
push: number;
|
|
12
12
|
tag: string;
|
|
13
13
|
span: number;
|
|
14
14
|
pull: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CHANGE_EVENT } from "../../../constants/event.mjs";
|
|
2
2
|
import { cAF, rAF } from "../../../utils/raf.mjs";
|
|
3
|
-
import { countdownEmits, countdownProps } from "./countdown.mjs";
|
|
4
3
|
import { ElStatistic } from "../../statistic/index.mjs";
|
|
4
|
+
import { countdownEmits, countdownProps } from "./countdown.mjs";
|
|
5
5
|
import { formatTime, getTime } from "./utils.mjs";
|
|
6
6
|
import { computed, createBlock, createSlots, defineComponent, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, unref, watch, withCtx } from "vue";
|
|
7
7
|
|
|
@@ -48,7 +48,7 @@ interface DescriptionProps {
|
|
|
48
48
|
declare const descriptionProps: {
|
|
49
49
|
readonly border: BooleanConstructor;
|
|
50
50
|
readonly column: EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
|
|
51
|
-
readonly direction: EpPropFinalized<StringConstructor, "
|
|
51
|
+
readonly direction: EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
|
|
52
52
|
readonly size: {
|
|
53
53
|
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
54
54
|
readonly required: false;
|
|
@@ -10,8 +10,8 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: vue.DefineComponent<DescriptionProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<DescriptionProps> & Readonly<{}>, {
|
|
12
12
|
title: string;
|
|
13
|
-
direction: "horizontal" | "vertical";
|
|
14
13
|
column: number;
|
|
14
|
+
direction: "horizontal" | "vertical";
|
|
15
15
|
extra: string;
|
|
16
16
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
17
17
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -38,8 +38,8 @@ declare const __VLS_base: vue.DefineComponent<DialogProps, {
|
|
|
38
38
|
onOpenAutoFocus?: (() => any) | undefined;
|
|
39
39
|
onCloseAutoFocus?: (() => any) | undefined;
|
|
40
40
|
}>, {
|
|
41
|
-
title: string;
|
|
42
41
|
appendTo: string | HTMLElement;
|
|
42
|
+
title: string;
|
|
43
43
|
transition: DialogTransition;
|
|
44
44
|
overflow: boolean;
|
|
45
45
|
closeOnClickModal: boolean;
|
|
@@ -23,7 +23,7 @@ interface DividerProps {
|
|
|
23
23
|
* @deprecated Removed after 3.0.0, Use `DividerProps` instead.
|
|
24
24
|
*/
|
|
25
25
|
declare const dividerProps: {
|
|
26
|
-
readonly direction: EpPropFinalized<StringConstructor, "
|
|
26
|
+
readonly direction: EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
|
|
27
27
|
readonly contentPosition: EpPropFinalized<StringConstructor, "center" | "left" | "right", unknown, "center", boolean>;
|
|
28
28
|
readonly borderStyle: EpPropFinalized<(new (...args: any[]) => string) | (() => string) | (((new (...args: any[]) => string) | (() => string)) | null)[], unknown, unknown, "solid", boolean>;
|
|
29
29
|
};
|
|
@@ -7,8 +7,8 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
default?: (props: typeof __VLS_1) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: vue.DefineComponent<DividerProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<DividerProps> & Readonly<{}>, {
|
|
10
|
-
direction: "horizontal" | "vertical";
|
|
11
10
|
borderStyle: BorderStyle;
|
|
11
|
+
direction: "horizontal" | "vertical";
|
|
12
12
|
contentPosition: "left" | "center" | "right";
|
|
13
13
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -45,11 +45,11 @@ declare const __VLS_base: vue.DefineComponent<DrawerProps, {
|
|
|
45
45
|
"onResize-start"?: ((evt: MouseEvent, size: number) => any) | undefined;
|
|
46
46
|
"onResize-end"?: ((evt: MouseEvent, size: number) => any) | undefined;
|
|
47
47
|
}>, {
|
|
48
|
-
title: string;
|
|
49
|
-
direction: "ltr" | "rtl" | "ttb" | "btt";
|
|
50
48
|
appendTo: string | HTMLElement;
|
|
49
|
+
title: string;
|
|
51
50
|
size: string | number;
|
|
52
51
|
transition: DialogTransition;
|
|
52
|
+
direction: "ltr" | "rtl" | "ttb" | "btt";
|
|
53
53
|
overflow: boolean;
|
|
54
54
|
closeOnClickModal: boolean;
|
|
55
55
|
closeOnPressEscape: boolean;
|
|
@@ -399,8 +399,8 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
399
399
|
"onVisible-change"?: ((...args: any[]) => any) | undefined;
|
|
400
400
|
onCommand?: ((...args: any[]) => any) | undefined;
|
|
401
401
|
}>, {
|
|
402
|
-
readonly effect: EpPropMergeType<(new (...args: any[]) => string) | (() => PopperEffect) | (((new (...args: any[]) => string) | (() => PopperEffect)) | null)[], unknown, unknown>;
|
|
403
402
|
readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
403
|
+
readonly effect: EpPropMergeType<(new (...args: any[]) => string) | (() => PopperEffect) | (((new (...args: any[]) => string) | (() => PopperEffect)) | null)[], unknown, unknown>;
|
|
404
404
|
readonly size: string;
|
|
405
405
|
readonly disabled: boolean;
|
|
406
406
|
readonly tabindex: EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>;
|
|
@@ -688,9 +688,9 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
688
688
|
"before-show": (...args: any[]) => void;
|
|
689
689
|
"before-hide": (...args: any[]) => void;
|
|
690
690
|
}, vue.PublicProps, {
|
|
691
|
-
effect: PopperEffect;
|
|
692
691
|
offset: number;
|
|
693
692
|
teleported: boolean;
|
|
693
|
+
effect: PopperEffect;
|
|
694
694
|
visible: boolean | null;
|
|
695
695
|
content: string;
|
|
696
696
|
style: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
@@ -739,9 +739,9 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
739
739
|
onClose: (event?: Event, delay?: number) => void;
|
|
740
740
|
hide: (event?: Event) => void;
|
|
741
741
|
}, {}, {}, {}, {
|
|
742
|
-
effect: PopperEffect;
|
|
743
742
|
offset: number;
|
|
744
743
|
teleported: boolean;
|
|
744
|
+
effect: PopperEffect;
|
|
745
745
|
visible: boolean | null;
|
|
746
746
|
content: string;
|
|
747
747
|
style: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
@@ -795,9 +795,9 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
795
795
|
"before-show": (...args: any[]) => void;
|
|
796
796
|
"before-hide": (...args: any[]) => void;
|
|
797
797
|
}, string, {
|
|
798
|
-
effect: PopperEffect;
|
|
799
798
|
offset: number;
|
|
800
799
|
teleported: boolean;
|
|
800
|
+
effect: PopperEffect;
|
|
801
801
|
visible: boolean | null;
|
|
802
802
|
content: string;
|
|
803
803
|
style: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
@@ -863,7 +863,7 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
863
863
|
loop: BooleanConstructor;
|
|
864
864
|
dir: EpPropFinalized<StringConstructor, string, unknown, string, boolean>;
|
|
865
865
|
orientation: {
|
|
866
|
-
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => "
|
|
866
|
+
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical" | undefined) | (((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical" | undefined)) | null)[], unknown, unknown>>;
|
|
867
867
|
readonly required: false;
|
|
868
868
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
869
869
|
__epPropKey: true;
|
|
@@ -888,7 +888,7 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
888
888
|
loop: BooleanConstructor;
|
|
889
889
|
dir: EpPropFinalized<StringConstructor, string, unknown, string, boolean>;
|
|
890
890
|
orientation: {
|
|
891
|
-
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => "
|
|
891
|
+
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical" | undefined) | (((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical" | undefined)) | null)[], unknown, unknown>>;
|
|
892
892
|
readonly required: false;
|
|
893
893
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
894
894
|
__epPropKey: true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../base/style/css.mjs";
|
|
2
2
|
import "../../scrollbar/style/css.mjs";
|
|
3
3
|
import "../../popper/style/css.mjs";
|
|
4
|
-
import "../../button-group/style/css.mjs";
|
|
5
4
|
import "../../button/style/css.mjs";
|
|
5
|
+
import "../../button-group/style/css.mjs";
|
|
6
6
|
import "@element-plus/nightly/theme-chalk/el-dropdown.css";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../base/style/index.mjs";
|
|
2
2
|
import "../../scrollbar/style/index.mjs";
|
|
3
3
|
import "../../popper/style/index.mjs";
|
|
4
|
-
import "../../button-group/style/index.mjs";
|
|
5
4
|
import "../../button/style/index.mjs";
|
|
5
|
+
import "../../button-group/style/index.mjs";
|
|
6
6
|
import "@element-plus/nightly/theme-chalk/src/dropdown.scss";
|
|
@@ -31,7 +31,7 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
31
31
|
}>, {
|
|
32
32
|
loop: boolean;
|
|
33
33
|
trapped: boolean;
|
|
34
|
-
focusStartEl: HTMLElement | "
|
|
34
|
+
focusStartEl: HTMLElement | "first" | "container";
|
|
35
35
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
36
36
|
//#endregion
|
|
37
37
|
export { _default };
|
package/es/components/index.mjs
CHANGED
|
@@ -103,10 +103,6 @@ import { ElColorPickerPanel } from "./color-picker-panel/index.mjs";
|
|
|
103
103
|
import { colorPickerEmits, colorPickerProps, colorPickerPropsDefaults } from "./color-picker/src/color-picker.mjs";
|
|
104
104
|
import { ElColorPicker } from "./color-picker/index.mjs";
|
|
105
105
|
import { ElAside, ElContainer, ElFooter, ElHeader, ElMain } from "./container/index.mjs";
|
|
106
|
-
import { countdownEmits, countdownProps } from "./countdown/src/countdown.mjs";
|
|
107
|
-
import { statisticProps } from "./statistic/src/statistic.mjs";
|
|
108
|
-
import { ElStatistic } from "./statistic/index.mjs";
|
|
109
|
-
import { ElCountdown } from "./countdown/index.mjs";
|
|
110
106
|
import { datePickerPanelProps } from "./date-picker-panel/src/props/date-picker-panel.mjs";
|
|
111
107
|
import { ROOT_PICKER_INJECTION_KEY, ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY } from "./date-picker-panel/src/constants.mjs";
|
|
112
108
|
import { ElDatePickerPanel } from "./date-picker-panel/index.mjs";
|
|
@@ -153,6 +149,8 @@ import { paginationEmits, paginationProps } from "./pagination/src/pagination.mj
|
|
|
153
149
|
import { ElPagination } from "./pagination/index.mjs";
|
|
154
150
|
import { popconfirmEmits, popconfirmProps } from "./popconfirm/src/popconfirm.mjs";
|
|
155
151
|
import { ElPopconfirm } from "./popconfirm/index.mjs";
|
|
152
|
+
import { popoverEmits, popoverProps, popoverPropsDefaults } from "./popover/src/popover.mjs";
|
|
153
|
+
import { ElPopover, ElPopoverDirective } from "./popover/index.mjs";
|
|
156
154
|
import { progressProps } from "./progress/src/progress.mjs";
|
|
157
155
|
import { ElProgress } from "./progress/index.mjs";
|
|
158
156
|
import { rateEmits, rateProps } from "./rate/src/rate.mjs";
|
|
@@ -176,6 +174,10 @@ import { spaceItemProps } from "./space/src/item.mjs";
|
|
|
176
174
|
import { useSpace } from "./space/src/use-space.mjs";
|
|
177
175
|
import { spaceProps } from "./space/src/space.mjs";
|
|
178
176
|
import { ElSpace } from "./space/index.mjs";
|
|
177
|
+
import { statisticProps } from "./statistic/src/statistic.mjs";
|
|
178
|
+
import { ElStatistic } from "./statistic/index.mjs";
|
|
179
|
+
import { countdownEmits, countdownProps } from "./countdown/src/countdown.mjs";
|
|
180
|
+
import { ElCountdown } from "./countdown/index.mjs";
|
|
179
181
|
import { stepsEmits, stepsProps } from "./steps/src/steps.mjs";
|
|
180
182
|
import { STEPS_INJECTION_KEY } from "./steps/src/tokens.mjs";
|
|
181
183
|
import { stepProps } from "./steps/src/item.mjs";
|
|
@@ -241,7 +243,5 @@ import { ElMessage } from "./message/index.mjs";
|
|
|
241
243
|
import { ElMessageBox } from "./message-box/index.mjs";
|
|
242
244
|
import { notificationEmits, notificationProps, notificationTypes } from "./notification/src/notification.mjs";
|
|
243
245
|
import { ElNotification } from "./notification/index.mjs";
|
|
244
|
-
import { popoverEmits, popoverProps, popoverPropsDefaults } from "./popover/src/popover.mjs";
|
|
245
|
-
import { ElPopover, ElPopoverDirective } from "./popover/index.mjs";
|
|
246
246
|
|
|
247
247
|
export { BAR_MAP, CAROUSEL_ITEM_NAME, CASCADER_PANEL_INJECTION_KEY, picker_default as CommonPicker, CommonProps, DEFAULT_DIALOG_TRANSITION, DEFAULT_FORMATS_DATE, DEFAULT_FORMATS_DATEPICKER, DEFAULT_FORMATS_TIME, DEFAULT_STEP, DROPDOWN_INJECTION_KEY, DROPDOWN_INSTANCE_INJECTION_KEY, DefaultProps, DynamicSizeGrid, DynamicSizeList, Effect, ElAffix, ElAlert, ElAnchor, ElAnchorLink, ElAside, ElAutoResizer, ElAutocomplete, ElAvatar, ElAvatarGroup, ElBacktop, ElBadge, ElBreadcrumb, ElBreadcrumbItem, ElButton, ElButtonGroup, ElCalendar, ElCard, ElCarousel, ElCarouselItem, ElCascader, ElCascaderPanel, ElCheckTag, ElCheckbox, ElCheckboxButton, ElCheckboxGroup, ElCol, ElCollapse, ElCollapseItem, ElCollapseTransition, ElColorPicker, ElColorPickerPanel, ElConfigProvider, ElContainer, ElCountdown, ElDatePicker, ElDatePickerPanel, ElDescriptions, ElDescriptionsItem, ElDialog, ElDivider, ElDrawer, ElDropdown, ElDropdownItem, ElDropdownMenu, ElEmpty, ElFooter, ElForm, ElFormItem, ElHeader, ElIcon, ElImage, ElImageViewer, ElInfiniteScroll, ElInput, ElInputNumber, ElInputTag, ElLink, ElLoading, vLoading as ElLoadingDirective, vLoading, Loading as ElLoadingService, ElMain, ElMention, ElMenu, ElMenuItem, ElMenuItemGroup, ElMessage, ElMessageBox, ElNotification, ElOption, ElOptionGroup, ElOverlay, ElPageHeader, ElPagination, ElPopconfirm, ElPopover, ElPopoverDirective, ElPopper, arrow_default as ElPopperArrow, content_default as ElPopperContent, trigger_default as ElPopperTrigger, ElProgress, ElRadio, ElRadioButton, ElRadioGroup, ElRate, ElResult, ElRow, ElScrollbar, ElSegmented, ElSelect, ElSelectV2, ElSkeleton, ElSkeletonItem, ElSlider, ElSpace, ElSplitter, ElSplitterPanel, ElStatistic, ElStep, ElSteps, ElSubMenu, ElSwitch, ElTabPane, ElTable, ElTableColumn, ElTableV2, ElTabs, ElTag, ElText, ElTimePicker, ElTimeSelect, ElTimeline, ElTimelineItem, ElTooltip, ElTour, ElTourStep, ElTransfer, ElTree, ElTreeSelect, ElTreeV2, ElUpload, ElWatermark, FIRST_KEYS, FIRST_LAST_KEYS, FixedSizeGrid, FixedSizeList, GAP, IconComponentMap, IconMap, LAST_KEYS, LEFT_CHECK_CHANGE_EVENT, MENU_INJECTION_KEY, MESSAGE_DEFAULT_PLACEMENT, NODE_INSTANCE_INJECTION_KEY, PICKER_BASE_INJECTION_KEY, PICKER_POPPER_OPTIONS_INJECTION_KEY, POPPER_CONTENT_INJECTION_KEY, POPPER_INJECTION_KEY, RIGHT_CHECK_CHANGE_EVENT, ROOT_COMMON_COLOR_INJECTION_KEY, ROOT_COMMON_PICKER_INJECTION_KEY, ROOT_PICKER_INJECTION_KEY, ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, ROOT_TREE_INJECTION_KEY, RowAlign, RowJustify, STEPS_INJECTION_KEY, SUB_MENU_INJECTION_KEY, TIMELINE_INJECTION_KEY, TOOLTIP_INJECTION_KEY, TREE_NODE_MAP_INJECTION_KEY, TableV2, Alignment as TableV2Alignment, FixedDir as TableV2FixedDir, placeholderSign as TableV2Placeholder, SortOrder as TableV2SortOrder, panel_time_pick_default as TimePickPanel, affixEmits, affixProps, alertEffects, alertEmits, alertProps, anchorEmits, anchorProps, autoResizerProps, autocompleteEmits, autocompleteProps, avatarEmits, avatarGroupContextKey, avatarGroupProps, avatarProps, backtopEmits, backtopProps, badgeProps, breadcrumbItemProps, breadcrumbKey, breadcrumbProps, buildTimeList, buttonEmits, buttonGroupContextKey, buttonNativeTypes, buttonProps, buttonTypes, calendarEmits, calendarProps, cardContextKey, cardProps, carouselContextKey, carouselEmits, carouselItemProps, carouselProps, cascaderEmits, cascaderPanelEmits, cascaderPanelProps, cascaderProps, checkTagEmits, checkTagProps, checkboxDefaultProps, checkboxEmits, checkboxGroupContextKey, checkboxGroupEmits, checkboxGroupProps, checkboxProps, checkboxPropsDefaults, colProps, collapseContextKey, collapseEmits, collapseItemProps, collapseProps, colorPickerEmits, colorPickerPanelContextKey, colorPickerPanelEmits, colorPickerPanelProps, colorPickerProps, colorPickerPropsDefaults, configProviderContextKey, configProviderProps, countdownEmits, countdownProps, dateEquals, datePickerPanelProps, datePickerProps, dayOrDaysToDate, defaultProps, descriptionItemProps, descriptionProps, dialogContextKey, dialogEmits, dialogInjectionKey, dialogProps, dialogPropsDefaults, dividerProps, drawerEmits, drawerProps, dropdownItemProps, dropdownMenuProps, dropdownProps, elPaginationKey, emitChangeFn, emptyProps, extractDateFormat, extractTimeFormat, formContextKey, formEmits, formItemContextKey, formItemProps, formItemValidateStates, formMetaProps, formProps, formatter, genFileId, iconProps, imageEmits, imageProps, imageViewerEmits, imageViewerProps, inputEmits, inputNumberEmits, inputNumberProps, inputProps, inputPropsDefaults, inputTagEmits, inputTagProps, linkEmits, linkProps, makeList, mentionDefaultProps, mentionEmits, mentionProps, menuEmits, menuItemEmits, menuItemGroupProps, menuItemProps, menuProps, messageConfig, messageDefaults, messageEmits, messagePlacement, messageProps, messageTypes, notificationEmits, notificationProps, notificationTypes, overlayEmits, overlayProps, pageHeaderEmits, pageHeaderProps, paginationEmits, paginationProps, parseDate, popconfirmEmits, popconfirmProps, popoverEmits, popoverProps, popoverPropsDefaults, popperArrowProps, popperArrowPropsDefaults, popperContentEmits, popperContentProps, popperContentPropsDefaults, popperCoreConfigProps, popperCoreConfigPropsDefaults, popperProps, popperTriggerProps, progressProps, provideGlobalConfig, radioButtonProps, radioButtonPropsDefaults, radioDefaultProps, radioEmits, radioGroupEmits, radioGroupKey, radioGroupProps, radioGroupPropsDefaults, radioProps, radioPropsBase, radioPropsDefaults, rangeArr, rateEmits, rateProps, renderThumbStyle, resultProps, roleTypes, rowContextKey, rowProps, scrollbarContextKey, scrollbarEmits, scrollbarProps, segmentedEmits, segmentedProps, selectEmits, selectGroupKey, selectKey, selectProps, selectV2InjectionKey, skeletonItemProps, skeletonProps, sliderContextKey, sliderEmits, sliderProps, spaceItemProps, spaceProps, splitterEmits, splitterPanelEmits, splitterPanelProps, splitterProps, statisticProps, stepProps, stepsEmits, stepsProps, subMenuProps, switchEmits, switchProps, tabBarProps, tabNavEmits, tabNavProps, tabPaneProps, tableV2Props, tableV2RowProps, tabsEmits, tabsProps, tabsRootContextKey, tagEmits, tagProps, textProps, thumbProps, timePickerDefaultProps, timePickerRangeTriggerProps, timePickerRngeTriggerProps, timeSelectProps, timeUnits, timelineItemProps, timelineProps, tooltipEmits, tourContentEmits, tourContentProps, tourEmits, tourPlacements, tourProps, tourStepEmits, tourStepProps, tourStrategies, transferCheckedChangeFn, transferEmits, transferProps, treeEmits, treeProps, uploadBaseProps, uploadBasePropsDefaults, uploadContentProps, uploadContentPropsDefaults, uploadContextKey, uploadDraggerEmits, uploadDraggerProps, uploadListEmits, uploadListProps, uploadListTypes, uploadProps, uploadPropsDefaults, useCascaderConfig, useDialog, useDisabled, useFormDisabled, useFormItem, useFormItemInputId, useFormSize, useGlobalComponentSettings, useGlobalConfig, usePopperArrowProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps, usePopperProps, usePopperTriggerProps, useSize, useSpace, useTooltipContentProps, useTooltipContentPropsDefaults, useTooltipModelToggle, useTooltipModelToggleEmits, useTooltipModelToggleProps, useTooltipProps, useTooltipTriggerProps, useTooltipTriggerPropsDefaults, valueEquals, virtualizedGridProps, virtualizedListProps, virtualizedProps, virtualizedScrollbarProps, watermarkProps };
|
|
@@ -183,7 +183,7 @@ declare const inputProps: {
|
|
|
183
183
|
};
|
|
184
184
|
readonly type: EpPropFinalized<(new (...args: any[]) => string) | (() => InputType) | (((new (...args: any[]) => string) | (() => InputType)) | null)[], unknown, unknown, "text", boolean>;
|
|
185
185
|
readonly resize: {
|
|
186
|
-
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "
|
|
186
|
+
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "none" | "both" | "horizontal" | "vertical", unknown>>;
|
|
187
187
|
readonly required: false;
|
|
188
188
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
189
189
|
__epPropKey: true;
|
|
@@ -13,10 +13,10 @@ declare const __VLS_base: vue.DefineComponent<LinkProps, {}, {}, {}, {}, vue.Com
|
|
|
13
13
|
}, string, vue.PublicProps, Readonly<LinkProps> & Readonly<{
|
|
14
14
|
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
+
target: "_blank" | "_parent" | "_self" | "_top" | (string & NonNullable<unknown>);
|
|
16
17
|
type: "primary" | "success" | "warning" | "info" | "danger" | "default";
|
|
17
18
|
underline: boolean | "always" | "never" | "hover";
|
|
18
19
|
href: string;
|
|
19
|
-
target: "_blank" | "_parent" | "_self" | "_top" | (string & NonNullable<unknown>);
|
|
20
20
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
@@ -232,7 +232,7 @@ declare const mentionProps: {
|
|
|
232
232
|
};
|
|
233
233
|
type: EpPropFinalized<(new (...args: any[]) => string) | (() => InputType) | (((new (...args: any[]) => string) | (() => InputType)) | null)[], unknown, unknown, "text", boolean>;
|
|
234
234
|
resize: {
|
|
235
|
-
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "
|
|
235
|
+
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "none" | "both" | "horizontal" | "vertical", unknown>>;
|
|
236
236
|
readonly required: false;
|
|
237
237
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
238
238
|
__epPropKey: true;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { EVENT_CODE } from "../../../constants/aria.mjs";
|
|
2
2
|
import { INPUT_EVENT, UPDATE_MODEL_EVENT } from "../../../constants/event.mjs";
|
|
3
3
|
import { getEventCode } from "../../../utils/dom/event.mjs";
|
|
4
|
-
import { isFunction } from "../../../utils/types.mjs";
|
|
4
|
+
import { isArray, isFunction } from "../../../utils/types.mjs";
|
|
5
5
|
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
|
|
6
6
|
import { useId } from "../../../hooks/use-id/index.mjs";
|
|
7
7
|
import { useFocusController } from "../../../hooks/use-focus-controller/index.mjs";
|
|
8
8
|
import { useFormDisabled } from "../../form/src/hooks/use-form-common-props.mjs";
|
|
9
9
|
import { ElTooltip } from "../../tooltip/index.mjs";
|
|
10
|
-
import { inputProps } from "../../input/src/input.mjs";
|
|
11
10
|
import { ElInput } from "../../input/index.mjs";
|
|
12
11
|
import { getCursorPosition, getMentionCtx } from "./helper.mjs";
|
|
13
12
|
import { mentionDefaultProps, mentionEmits, mentionProps } from "./mention.mjs";
|
|
@@ -25,7 +24,10 @@ var mention_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
25
24
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
26
25
|
const props = __props;
|
|
27
26
|
const emit = __emit;
|
|
28
|
-
const passInputProps = computed(() =>
|
|
27
|
+
const passInputProps = computed(() => {
|
|
28
|
+
const inputProps = ElInput.props ?? [];
|
|
29
|
+
return pick(props, isArray(inputProps) ? inputProps : Object.keys(inputProps));
|
|
30
|
+
});
|
|
29
31
|
const ns = useNamespace("mention");
|
|
30
32
|
const disabled = useFormDisabled();
|
|
31
33
|
const contentId = useId();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mention.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs","$slots"],"sources":["../../../../../../packages/components/mention/src/mention.vue"],"sourcesContent":["<template>\n <div ref=\"wrapperRef\" :class=\"ns.b()\">\n <el-input\n v-bind=\"mergeProps(passInputProps, $attrs)\"\n ref=\"elInputRef\"\n :model-value=\"modelValue\"\n :disabled=\"disabled\"\n :role=\"dropdownVisible ? 'combobox' : undefined\"\n :aria-activedescendant=\"dropdownVisible ? hoveringId || '' : undefined\"\n :aria-controls=\"dropdownVisible ? contentId : undefined\"\n :aria-expanded=\"dropdownVisible || undefined\"\n :aria-label=\"ariaLabel\"\n :aria-autocomplete=\"dropdownVisible ? 'none' : undefined\"\n :aria-haspopup=\"dropdownVisible ? 'listbox' : undefined\"\n @input=\"handleInputChange\"\n @keydown=\"handleInputKeyDown\"\n @mousedown=\"handleInputMouseDown\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps\" />\n </template>\n </el-input>\n <el-tooltip\n ref=\"tooltipRef\"\n :visible=\"dropdownVisible\"\n :popper-class=\"[ns.e('popper'), popperClass!]\"\n :popper-style=\"popperStyle\"\n :popper-options=\"popperOptions\"\n :placement=\"computedPlacement\"\n :fallback-placements=\"computedFallbackPlacements\"\n effect=\"light\"\n pure\n :offset=\"offset\"\n :show-arrow=\"showArrow\"\n >\n <template #default>\n <div :style=\"cursorStyle\" />\n </template>\n <template #content>\n <el-mention-dropdown\n ref=\"dropdownRef\"\n :options=\"filteredOptions\"\n :disabled=\"disabled\"\n :loading=\"loading\"\n :content-id=\"contentId\"\n :aria-label=\"ariaLabel\"\n @select=\"handleSelect\"\n @click.stop=\"elInputRef?.focus()\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps\" />\n </template>\n </el-mention-dropdown>\n </template>\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\" setup generic=\"T extends MentionOption = MentionOption\">\nimport { computed, mergeProps, nextTick, ref } from 'vue'\nimport { pick } from 'lodash-unified'\nimport { useFocusController, useId, useNamespace } from '@element-plus/hooks'\nimport ElInput, {\n inputProps,\n inputPropsDefaults,\n} from '@element-plus/components/input'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport {\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useFormDisabled } from '@element-plus/components/form'\nimport { getEventCode, isFunction } from '@element-plus/utils'\nimport { mentionDefaultProps, mentionEmits } from './mention'\nimport { filterOption, getCursorPosition, getMentionCtx } from './helper'\nimport ElMentionDropdown from './mention-dropdown.vue'\n\nimport type { MentionProps } from './mention'\nimport type { Placement } from '@popperjs/core'\nimport type { CSSProperties } from 'vue'\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\nimport type { MentionCtx, MentionOption } from './types'\n\ndefineOptions({\n name: 'ElMention',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<MentionProps<T>>(), {\n ...inputPropsDefaults,\n options: () => [],\n prefix: '@',\n split: ' ',\n filterOption: () => filterOption,\n placement: 'bottom',\n offset: 0,\n popperOptions: () => ({}),\n props: () => mentionDefaultProps,\n})\nconst emit = defineEmits(mentionEmits)\ndefineSlots<\n InputInstance['$slots'] & {\n header?: () => any\n footer?: () => any\n loading?: () => any\n label?: (props: { item: T & MentionOption; index: number }) => any\n }\n>()\n\nconst passInputProps = computed(() => pick(props, Object.keys(inputProps)))\n\nconst ns = useNamespace('mention')\nconst disabled = useFormDisabled()\nconst contentId = useId()\n\nconst elInputRef = ref<InputInstance>()\nconst tooltipRef = ref<TooltipInstance>()\nconst dropdownRef = ref<InstanceType<typeof ElMentionDropdown>>()\n\nconst visible = ref(false)\nconst cursorStyle = ref<CSSProperties>()\nconst mentionCtx = ref<MentionCtx>()\n\nconst computedPlacement = computed<Placement>(() =>\n props.showArrow ? props.placement : `${props.placement}-start`\n)\n\nconst computedFallbackPlacements = computed<Placement[]>(() =>\n props.showArrow ? ['bottom', 'top'] : ['bottom-start', 'top-start']\n)\n\nconst aliasProps = computed(() => ({\n ...mentionDefaultProps,\n ...props.props,\n}))\n\nconst mapOption = (option: T) => {\n const base = {\n label: option[aliasProps.value.label],\n value: option[aliasProps.value.value],\n disabled: option[aliasProps.value.disabled],\n }\n return { ...option, ...base }\n}\n\nconst options = computed(() => props.options.map(mapOption))\n\nconst filteredOptions = computed(() => {\n const { filterOption } = props\n if (!mentionCtx.value || !filterOption) return options.value\n return options.value.filter((option) =>\n filterOption(mentionCtx.value!.pattern, option)\n )\n})\n\nconst dropdownVisible = computed(() => {\n return visible.value && (!!filteredOptions.value.length || props.loading)\n})\n\nconst hoveringId = computed(() => {\n return `${contentId.value}-${dropdownRef.value?.hoveringIndex}`\n})\n\nconst handleInputChange = (value: string) => {\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n syncAfterCursorMove()\n}\n\nconst handleInputKeyDown = (event: KeyboardEvent | Event) => {\n if (elInputRef.value?.isComposing) return\n const code = getEventCode(event as KeyboardEvent)\n\n switch (code) {\n case EVENT_CODE.left:\n case EVENT_CODE.right:\n syncAfterCursorMove()\n break\n case EVENT_CODE.up:\n case EVENT_CODE.down:\n if (!visible.value) return\n event.preventDefault()\n dropdownRef.value?.navigateOptions(\n code === EVENT_CODE.up ? 'prev' : 'next'\n )\n break\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n if (!visible.value) {\n props.type !== 'textarea' && syncAfterCursorMove()\n return\n }\n event.preventDefault()\n if (dropdownRef.value?.hoverOption) {\n dropdownRef.value?.selectHoverOption()\n } else {\n visible.value = false\n }\n break\n case EVENT_CODE.esc:\n if (!visible.value) return\n event.preventDefault()\n visible.value = false\n break\n case EVENT_CODE.backspace:\n if (props.whole && mentionCtx.value) {\n const { splitIndex, selectionEnd, pattern, prefixIndex, prefix } =\n mentionCtx.value\n const inputEl = getInputEl()\n if (!inputEl) return\n const inputValue = inputEl.value\n const matchOption = options.value.find((item) => item.value === pattern)\n const isWhole = isFunction(props.checkIsWhole)\n ? props.checkIsWhole(pattern, prefix)\n : matchOption\n if (isWhole && splitIndex !== -1 && splitIndex + 1 === selectionEnd) {\n event.preventDefault()\n const newValue =\n inputValue.slice(0, prefixIndex) + inputValue.slice(splitIndex + 1)\n emit(UPDATE_MODEL_EVENT, newValue)\n emit(INPUT_EVENT, newValue)\n emit('whole-remove', pattern, prefix)\n\n const newSelectionEnd = prefixIndex\n nextTick(() => {\n // input value is updated\n inputEl.selectionStart = newSelectionEnd\n inputEl.selectionEnd = newSelectionEnd\n syncDropdownVisible()\n })\n }\n }\n }\n}\n\nconst { wrapperRef } = useFocusController(elInputRef, {\n disabled,\n afterFocus() {\n syncAfterCursorMove()\n },\n beforeBlur(event) {\n return tooltipRef.value?.isFocusInsideContent(event)\n },\n afterBlur() {\n visible.value = false\n },\n})\n\nconst handleInputMouseDown = () => {\n syncAfterCursorMove()\n}\n\n// Ensure that the original option passed by users is returned\nconst getOriginalOption = (mentionOption: MentionOption) => {\n return props.options.find((option: MentionOption) => {\n return mentionOption.value === option[aliasProps.value.value]\n })\n}\n\nconst handleSelect = (item: MentionOption) => {\n if (!mentionCtx.value) return\n const inputEl = getInputEl()\n if (!inputEl) return\n const inputValue = inputEl.value\n const { split } = props\n\n const newEndPart = inputValue.slice(mentionCtx.value.end)\n const alreadySeparated = newEndPart.startsWith(split)\n const newMiddlePart = `${item.value}${alreadySeparated ? '' : split}`\n\n const newValue =\n inputValue.slice(0, mentionCtx.value.start) + newMiddlePart + newEndPart\n\n emit(UPDATE_MODEL_EVENT, newValue)\n emit(INPUT_EVENT, newValue)\n emit('select', getOriginalOption(item)!, mentionCtx.value.prefix)\n\n const newSelectionEnd =\n mentionCtx.value.start + newMiddlePart.length + (alreadySeparated ? 1 : 0)\n\n nextTick(() => {\n // input value is updated\n inputEl.selectionStart = newSelectionEnd\n inputEl.selectionEnd = newSelectionEnd\n inputEl.focus()\n syncDropdownVisible()\n })\n}\n\nconst getInputEl = () =>\n props.type === 'textarea'\n ? elInputRef.value?.textarea\n : elInputRef.value?.input\n\nconst syncAfterCursorMove = () => {\n // can't use nextTick(), get cursor position will be wrong\n setTimeout(() => {\n syncCursor()\n syncDropdownVisible()\n nextTick(() => tooltipRef.value?.updatePopper())\n }, 0)\n}\n\nconst syncCursor = () => {\n const inputEl = getInputEl()\n if (!inputEl) return\n\n const caretPosition = getCursorPosition(inputEl)\n const inputRect = inputEl.getBoundingClientRect()\n const wrapperRect = wrapperRef.value!.getBoundingClientRect()\n\n cursorStyle.value = {\n position: 'absolute',\n width: 0,\n height: `${caretPosition.height}px`,\n left: `${caretPosition.left + inputRect.left - wrapperRect.left}px`,\n top: `${caretPosition.top + inputRect.top - wrapperRect.top}px`,\n }\n}\n\nconst syncDropdownVisible = () => {\n const inputEl = getInputEl()\n if (document.activeElement !== inputEl) {\n visible.value = false\n return\n }\n const { prefix, split } = props\n mentionCtx.value = getMentionCtx(inputEl, prefix, split)\n if (mentionCtx.value && mentionCtx.value.splitIndex === -1) {\n visible.value = true\n emit('search', mentionCtx.value.pattern, mentionCtx.value.prefix)\n return\n }\n visible.value = false\n}\n\ndefineExpose({\n input: elInputRef,\n tooltip: tooltipRef,\n dropdownVisible,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA0FA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAUb,MAAM,iBAAiB,eAAe,KAAK,OAAO,OAAO,KAAK,WAAW,CAAC,CAAA;EAE1E,MAAM,KAAK,aAAa,UAAS;EACjC,MAAM,WAAW,iBAAgB;EACjC,MAAM,YAAY,OAAM;EAExB,MAAM,aAAa,KAAmB;EACtC,MAAM,aAAa,KAAqB;EACxC,MAAM,cAAc,KAA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,gBAAc,QAAA;IACd,kBAAgB,QAAA;IAChB,WAAW,kBAAA;IACX,uBAAqB,2BAAA;IACtB,QAAO;IACP,MAAA;IACC,QAAQ,QAAA;IACR,cAAY,QAAA;;IAEF,SAAO,cACY,CAA5B,mBAA4B,OAAA,EAAtB,OAAK,eAAE,YAAA,MAAW;IAEf,SAAO,cAcM,CAbtB,YAasB,0BAAA;cAZhB;KAAJ,KAAI;KACH,SAAS,gBAAA;KACT,UAAU,MAAA,SAAQ;KAClB,SAAS,QAAA;KACT,cAAY,MAAA,UAAS;KACrB,cAAY,QAAA;KACZ,UAAQ;KACR,SAAK,OAAA,OAAA,OAAA,KAAA,eAAA,WAAO,WAAA,OAAY,OAAK,EAAA,CAAA,OAAA,CAAA;yCAEAA,KAAAA,SAAZ,GAAG,SAAI;;MAAc;mBAAQ,cAAS,CACtD,WAAwC,KAAA,QAA3B,MAAI,eAAA,mBAAU,UAAS,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"mention.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs","$slots"],"sources":["../../../../../../packages/components/mention/src/mention.vue"],"sourcesContent":["<template>\n <div ref=\"wrapperRef\" :class=\"ns.b()\">\n <el-input\n v-bind=\"mergeProps(passInputProps, $attrs)\"\n ref=\"elInputRef\"\n :model-value=\"modelValue\"\n :disabled=\"disabled\"\n :role=\"dropdownVisible ? 'combobox' : undefined\"\n :aria-activedescendant=\"dropdownVisible ? hoveringId || '' : undefined\"\n :aria-controls=\"dropdownVisible ? contentId : undefined\"\n :aria-expanded=\"dropdownVisible || undefined\"\n :aria-label=\"ariaLabel\"\n :aria-autocomplete=\"dropdownVisible ? 'none' : undefined\"\n :aria-haspopup=\"dropdownVisible ? 'listbox' : undefined\"\n @input=\"handleInputChange\"\n @keydown=\"handleInputKeyDown\"\n @mousedown=\"handleInputMouseDown\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps\" />\n </template>\n </el-input>\n <el-tooltip\n ref=\"tooltipRef\"\n :visible=\"dropdownVisible\"\n :popper-class=\"[ns.e('popper'), popperClass!]\"\n :popper-style=\"popperStyle\"\n :popper-options=\"popperOptions\"\n :placement=\"computedPlacement\"\n :fallback-placements=\"computedFallbackPlacements\"\n effect=\"light\"\n pure\n :offset=\"offset\"\n :show-arrow=\"showArrow\"\n >\n <template #default>\n <div :style=\"cursorStyle\" />\n </template>\n <template #content>\n <el-mention-dropdown\n ref=\"dropdownRef\"\n :options=\"filteredOptions\"\n :disabled=\"disabled\"\n :loading=\"loading\"\n :content-id=\"contentId\"\n :aria-label=\"ariaLabel\"\n @select=\"handleSelect\"\n @click.stop=\"elInputRef?.focus()\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps\" />\n </template>\n </el-mention-dropdown>\n </template>\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\" setup generic=\"T extends MentionOption = MentionOption\">\nimport { computed, mergeProps, nextTick, ref } from 'vue'\nimport { pick } from 'lodash-unified'\nimport { useFocusController, useId, useNamespace } from '@element-plus/hooks'\nimport ElInput, { inputPropsDefaults } from '@element-plus/components/input'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport {\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useFormDisabled } from '@element-plus/components/form'\nimport { getEventCode, isArray, isFunction } from '@element-plus/utils'\nimport { mentionDefaultProps, mentionEmits } from './mention'\nimport { filterOption, getCursorPosition, getMentionCtx } from './helper'\nimport ElMentionDropdown from './mention-dropdown.vue'\n\nimport type { MentionProps } from './mention'\nimport type { Placement } from '@popperjs/core'\nimport type { CSSProperties } from 'vue'\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\nimport type { MentionCtx, MentionOption } from './types'\n\ndefineOptions({\n name: 'ElMention',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<MentionProps<T>>(), {\n ...inputPropsDefaults,\n options: () => [],\n prefix: '@',\n split: ' ',\n filterOption: () => filterOption,\n placement: 'bottom',\n offset: 0,\n popperOptions: () => ({}),\n props: () => mentionDefaultProps,\n})\nconst emit = defineEmits(mentionEmits)\ndefineSlots<\n InputInstance['$slots'] & {\n header?: () => any\n footer?: () => any\n loading?: () => any\n label?: (props: { item: T & MentionOption; index: number }) => any\n }\n>()\n\nconst passInputProps = computed(() => {\n const inputProps = ElInput.props ?? []\n const keys = isArray(inputProps) ? inputProps : Object.keys(inputProps)\n return pick(props, keys)\n})\n\nconst ns = useNamespace('mention')\nconst disabled = useFormDisabled()\nconst contentId = useId()\n\nconst elInputRef = ref<InputInstance>()\nconst tooltipRef = ref<TooltipInstance>()\nconst dropdownRef = ref<InstanceType<typeof ElMentionDropdown>>()\n\nconst visible = ref(false)\nconst cursorStyle = ref<CSSProperties>()\nconst mentionCtx = ref<MentionCtx>()\n\nconst computedPlacement = computed<Placement>(() =>\n props.showArrow ? props.placement : `${props.placement}-start`\n)\n\nconst computedFallbackPlacements = computed<Placement[]>(() =>\n props.showArrow ? ['bottom', 'top'] : ['bottom-start', 'top-start']\n)\n\nconst aliasProps = computed(() => ({\n ...mentionDefaultProps,\n ...props.props,\n}))\n\nconst mapOption = (option: T) => {\n const base = {\n label: option[aliasProps.value.label],\n value: option[aliasProps.value.value],\n disabled: option[aliasProps.value.disabled],\n }\n return { ...option, ...base }\n}\n\nconst options = computed(() => props.options.map(mapOption))\n\nconst filteredOptions = computed(() => {\n const { filterOption } = props\n if (!mentionCtx.value || !filterOption) return options.value\n return options.value.filter((option) =>\n filterOption(mentionCtx.value!.pattern, option)\n )\n})\n\nconst dropdownVisible = computed(() => {\n return visible.value && (!!filteredOptions.value.length || props.loading)\n})\n\nconst hoveringId = computed(() => {\n return `${contentId.value}-${dropdownRef.value?.hoveringIndex}`\n})\n\nconst handleInputChange = (value: string) => {\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n syncAfterCursorMove()\n}\n\nconst handleInputKeyDown = (event: KeyboardEvent | Event) => {\n if (elInputRef.value?.isComposing) return\n const code = getEventCode(event as KeyboardEvent)\n\n switch (code) {\n case EVENT_CODE.left:\n case EVENT_CODE.right:\n syncAfterCursorMove()\n break\n case EVENT_CODE.up:\n case EVENT_CODE.down:\n if (!visible.value) return\n event.preventDefault()\n dropdownRef.value?.navigateOptions(\n code === EVENT_CODE.up ? 'prev' : 'next'\n )\n break\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n if (!visible.value) {\n props.type !== 'textarea' && syncAfterCursorMove()\n return\n }\n event.preventDefault()\n if (dropdownRef.value?.hoverOption) {\n dropdownRef.value?.selectHoverOption()\n } else {\n visible.value = false\n }\n break\n case EVENT_CODE.esc:\n if (!visible.value) return\n event.preventDefault()\n visible.value = false\n break\n case EVENT_CODE.backspace:\n if (props.whole && mentionCtx.value) {\n const { splitIndex, selectionEnd, pattern, prefixIndex, prefix } =\n mentionCtx.value\n const inputEl = getInputEl()\n if (!inputEl) return\n const inputValue = inputEl.value\n const matchOption = options.value.find((item) => item.value === pattern)\n const isWhole = isFunction(props.checkIsWhole)\n ? props.checkIsWhole(pattern, prefix)\n : matchOption\n if (isWhole && splitIndex !== -1 && splitIndex + 1 === selectionEnd) {\n event.preventDefault()\n const newValue =\n inputValue.slice(0, prefixIndex) + inputValue.slice(splitIndex + 1)\n emit(UPDATE_MODEL_EVENT, newValue)\n emit(INPUT_EVENT, newValue)\n emit('whole-remove', pattern, prefix)\n\n const newSelectionEnd = prefixIndex\n nextTick(() => {\n // input value is updated\n inputEl.selectionStart = newSelectionEnd\n inputEl.selectionEnd = newSelectionEnd\n syncDropdownVisible()\n })\n }\n }\n }\n}\n\nconst { wrapperRef } = useFocusController(elInputRef, {\n disabled,\n afterFocus() {\n syncAfterCursorMove()\n },\n beforeBlur(event) {\n return tooltipRef.value?.isFocusInsideContent(event)\n },\n afterBlur() {\n visible.value = false\n },\n})\n\nconst handleInputMouseDown = () => {\n syncAfterCursorMove()\n}\n\n// Ensure that the original option passed by users is returned\nconst getOriginalOption = (mentionOption: MentionOption) => {\n return props.options.find((option: MentionOption) => {\n return mentionOption.value === option[aliasProps.value.value]\n })\n}\n\nconst handleSelect = (item: MentionOption) => {\n if (!mentionCtx.value) return\n const inputEl = getInputEl()\n if (!inputEl) return\n const inputValue = inputEl.value\n const { split } = props\n\n const newEndPart = inputValue.slice(mentionCtx.value.end)\n const alreadySeparated = newEndPart.startsWith(split)\n const newMiddlePart = `${item.value}${alreadySeparated ? '' : split}`\n\n const newValue =\n inputValue.slice(0, mentionCtx.value.start) + newMiddlePart + newEndPart\n\n emit(UPDATE_MODEL_EVENT, newValue)\n emit(INPUT_EVENT, newValue)\n emit('select', getOriginalOption(item)!, mentionCtx.value.prefix)\n\n const newSelectionEnd =\n mentionCtx.value.start + newMiddlePart.length + (alreadySeparated ? 1 : 0)\n\n nextTick(() => {\n // input value is updated\n inputEl.selectionStart = newSelectionEnd\n inputEl.selectionEnd = newSelectionEnd\n inputEl.focus()\n syncDropdownVisible()\n })\n}\n\nconst getInputEl = () =>\n props.type === 'textarea'\n ? elInputRef.value?.textarea\n : elInputRef.value?.input\n\nconst syncAfterCursorMove = () => {\n // can't use nextTick(), get cursor position will be wrong\n setTimeout(() => {\n syncCursor()\n syncDropdownVisible()\n nextTick(() => tooltipRef.value?.updatePopper())\n }, 0)\n}\n\nconst syncCursor = () => {\n const inputEl = getInputEl()\n if (!inputEl) return\n\n const caretPosition = getCursorPosition(inputEl)\n const inputRect = inputEl.getBoundingClientRect()\n const wrapperRect = wrapperRef.value!.getBoundingClientRect()\n\n cursorStyle.value = {\n position: 'absolute',\n width: 0,\n height: `${caretPosition.height}px`,\n left: `${caretPosition.left + inputRect.left - wrapperRect.left}px`,\n top: `${caretPosition.top + inputRect.top - wrapperRect.top}px`,\n }\n}\n\nconst syncDropdownVisible = () => {\n const inputEl = getInputEl()\n if (document.activeElement !== inputEl) {\n visible.value = false\n return\n }\n const { prefix, split } = props\n mentionCtx.value = getMentionCtx(inputEl, prefix, split)\n if (mentionCtx.value && mentionCtx.value.splitIndex === -1) {\n visible.value = true\n emit('search', mentionCtx.value.pattern, mentionCtx.value.prefix)\n return\n }\n visible.value = false\n}\n\ndefineExpose({\n input: elInputRef,\n tooltip: tooltipRef,\n dropdownVisible,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAuFA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAUb,MAAM,iBAAiB,eAAe;GACpC,MAAM,aAAa,QAAQ,SAAS,EAAC;AAErC,UAAO,KAAK,OADC,QAAQ,WAAW,GAAG,aAAa,OAAO,KAAK,WAAU,CAC/C;IACxB;EAED,MAAM,KAAK,aAAa,UAAS;EACjC,MAAM,WAAW,iBAAgB;EACjC,MAAM,YAAY,OAAM;EAExB,MAAM,aAAa,KAAmB;EACtC,MAAM,aAAa,KAAqB;EACxC,MAAM,cAAc,KAA4C;EAEhE,MAAM,UAAU,IAAI,MAAK;EACzB,MAAM,cAAc,KAAmB;EACvC,MAAM,aAAa,KAAgB;EAEnC,MAAM,oBAAoB,eACxB,MAAM,YAAY,MAAM,YAAY,GAAG,MAAM,UAAU,QACzD;EAEA,MAAM,6BAA6B,eACjC,MAAM,YAAY,CAAC,UAAU,MAAM,GAAG,CAAC,gBAAgB,YAAW,CACpE;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG;GACH,GAAG,MAAM;GACV,EAAC;EAEF,MAAM,aAAa,WAAc;GAC/B,MAAM,OAAO;IACX,OAAO,OAAO,WAAW,MAAM;IAC/B,OAAO,OAAO,WAAW,MAAM;IAC/B,UAAU,OAAO,WAAW,MAAM;IACpC;AACA,UAAO;IAAE,GAAG;IAAQ,GAAG;IAAK;;EAG9B,MAAM,UAAU,eAAe,MAAM,QAAQ,IAAI,UAAU,CAAA;EAE3D,MAAM,kBAAkB,eAAe;GACrC,MAAM,EAAE,iBAAi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
|
|
1
|
-
{"version":3,"file":"mention2.mjs","names":[],"sources":["../../../../../../packages/components/mention/src/mention.vue"],"sourcesContent":["<template>\n <div ref=\"wrapperRef\" :class=\"ns.b()\">\n <el-input\n v-bind=\"mergeProps(passInputProps, $attrs)\"\n ref=\"elInputRef\"\n :model-value=\"modelValue\"\n :disabled=\"disabled\"\n :role=\"dropdownVisible ? 'combobox' : undefined\"\n :aria-activedescendant=\"dropdownVisible ? hoveringId || '' : undefined\"\n :aria-controls=\"dropdownVisible ? contentId : undefined\"\n :aria-expanded=\"dropdownVisible || undefined\"\n :aria-label=\"ariaLabel\"\n :aria-autocomplete=\"dropdownVisible ? 'none' : undefined\"\n :aria-haspopup=\"dropdownVisible ? 'listbox' : undefined\"\n @input=\"handleInputChange\"\n @keydown=\"handleInputKeyDown\"\n @mousedown=\"handleInputMouseDown\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps\" />\n </template>\n </el-input>\n <el-tooltip\n ref=\"tooltipRef\"\n :visible=\"dropdownVisible\"\n :popper-class=\"[ns.e('popper'), popperClass!]\"\n :popper-style=\"popperStyle\"\n :popper-options=\"popperOptions\"\n :placement=\"computedPlacement\"\n :fallback-placements=\"computedFallbackPlacements\"\n effect=\"light\"\n pure\n :offset=\"offset\"\n :show-arrow=\"showArrow\"\n >\n <template #default>\n <div :style=\"cursorStyle\" />\n </template>\n <template #content>\n <el-mention-dropdown\n ref=\"dropdownRef\"\n :options=\"filteredOptions\"\n :disabled=\"disabled\"\n :loading=\"loading\"\n :content-id=\"contentId\"\n :aria-label=\"ariaLabel\"\n @select=\"handleSelect\"\n @click.stop=\"elInputRef?.focus()\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps\" />\n </template>\n </el-mention-dropdown>\n </template>\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\" setup generic=\"T extends MentionOption = MentionOption\">\nimport { computed, mergeProps, nextTick, ref } from 'vue'\nimport { pick } from 'lodash-unified'\nimport { useFocusController, useId, useNamespace } from '@element-plus/hooks'\nimport ElInput, {\n inputProps,\n inputPropsDefaults,\n} from '@element-plus/components/input'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport {\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useFormDisabled } from '@element-plus/components/form'\nimport { getEventCode, isFunction } from '@element-plus/utils'\nimport { mentionDefaultProps, mentionEmits } from './mention'\nimport { filterOption, getCursorPosition, getMentionCtx } from './helper'\nimport ElMentionDropdown from './mention-dropdown.vue'\n\nimport type { MentionProps } from './mention'\nimport type { Placement } from '@popperjs/core'\nimport type { CSSProperties } from 'vue'\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\nimport type { MentionCtx, MentionOption } from './types'\n\ndefineOptions({\n name: 'ElMention',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<MentionProps<T>>(), {\n ...inputPropsDefaults,\n options: () => [],\n prefix: '@',\n split: ' ',\n filterOption: () => filterOption,\n placement: 'bottom',\n offset: 0,\n popperOptions: () => ({}),\n props: () => mentionDefaultProps,\n})\nconst emit = defineEmits(mentionEmits)\ndefineSlots<\n InputInstance['$slots'] & {\n header?: () => any\n footer?: () => any\n loading?: () => any\n label?: (props: { item: T & MentionOption; index: number }) => any\n }\n>()\n\nconst passInputProps = computed(() => pick(props, Object.keys(inputProps)))\n\nconst ns = useNamespace('mention')\nconst disabled = useFormDisabled()\nconst contentId = useId()\n\nconst elInputRef = ref<InputInstance>()\nconst tooltipRef = ref<TooltipInstance>()\nconst dropdownRef = ref<InstanceType<typeof ElMentionDropdown>>()\n\nconst visible = ref(false)\nconst cursorStyle = ref<CSSProperties>()\nconst mentionCtx = ref<MentionCtx>()\n\nconst computedPlacement = computed<Placement>(() =>\n props.showArrow ? props.placement : `${props.placement}-start`\n)\n\nconst computedFallbackPlacements = computed<Placement[]>(() =>\n props.showArrow ? ['bottom', 'top'] : ['bottom-start', 'top-start']\n)\n\nconst aliasProps = computed(() => ({\n ...mentionDefaultProps,\n ...props.props,\n}))\n\nconst mapOption = (option: T) => {\n const base = {\n label: option[aliasProps.value.label],\n value: option[aliasProps.value.value],\n disabled: option[aliasProps.value.disabled],\n }\n return { ...option, ...base }\n}\n\nconst options = computed(() => props.options.map(mapOption))\n\nconst filteredOptions = computed(() => {\n const { filterOption } = props\n if (!mentionCtx.value || !filterOption) return options.value\n return options.value.filter((option) =>\n filterOption(mentionCtx.value!.pattern, option)\n )\n})\n\nconst dropdownVisible = computed(() => {\n return visible.value && (!!filteredOptions.value.length || props.loading)\n})\n\nconst hoveringId = computed(() => {\n return `${contentId.value}-${dropdownRef.value?.hoveringIndex}`\n})\n\nconst handleInputChange = (value: string) => {\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n syncAfterCursorMove()\n}\n\nconst handleInputKeyDown = (event: KeyboardEvent | Event) => {\n if (elInputRef.value?.isComposing) return\n const code = getEventCode(event as KeyboardEvent)\n\n switch (code) {\n case EVENT_CODE.left:\n case EVENT_CODE.right:\n syncAfterCursorMove()\n break\n case EVENT_CODE.up:\n case EVENT_CODE.down:\n if (!visible.value) return\n event.preventDefault()\n dropdownRef.value?.navigateOptions(\n code === EVENT_CODE.up ? 'prev' : 'next'\n )\n break\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n if (!visible.value) {\n props.type !== 'textarea' && syncAfterCursorMove()\n return\n }\n event.preventDefault()\n if (dropdownRef.value?.hoverOption) {\n dropdownRef.value?.selectHoverOption()\n } else {\n visible.value = false\n }\n break\n case EVENT_CODE.esc:\n if (!visible.value) return\n event.preventDefault()\n visible.value = false\n break\n case EVENT_CODE.backspace:\n if (props.whole && mentionCtx.value) {\n const { splitIndex, selectionEnd, pattern, prefixIndex, prefix } =\n mentionCtx.value\n const inputEl = getInputEl()\n if (!inputEl) return\n const inputValue = inputEl.value\n const matchOption = options.value.find((item) => item.value === pattern)\n const isWhole = isFunction(props.checkIsWhole)\n ? props.checkIsWhole(pattern, prefix)\n : matchOption\n if (isWhole && splitIndex !== -1 && splitIndex + 1 === selectionEnd) {\n event.preventDefault()\n const newValue =\n inputValue.slice(0, prefixIndex) + inputValue.slice(splitIndex + 1)\n emit(UPDATE_MODEL_EVENT, newValue)\n emit(INPUT_EVENT, newValue)\n emit('whole-remove', pattern, prefix)\n\n const newSelectionEnd = prefixIndex\n nextTick(() => {\n // input value is updated\n inputEl.selectionStart = newSelectionEnd\n inputEl.selectionEnd = newSelectionEnd\n syncDropdownVisible()\n })\n }\n }\n }\n}\n\nconst { wrapperRef } = useFocusController(elInputRef, {\n disabled,\n afterFocus() {\n syncAfterCursorMove()\n },\n beforeBlur(event) {\n return tooltipRef.value?.isFocusInsideContent(event)\n },\n afterBlur() {\n visible.value = false\n },\n})\n\nconst handleInputMouseDown = () => {\n syncAfterCursorMove()\n}\n\n// Ensure that the original option passed by users is returned\nconst getOriginalOption = (mentionOption: MentionOption) => {\n return props.options.find((option: MentionOption) => {\n return mentionOption.value === option[aliasProps.value.value]\n })\n}\n\nconst handleSelect = (item: MentionOption) => {\n if (!mentionCtx.value) return\n const inputEl = getInputEl()\n if (!inputEl) return\n const inputValue = inputEl.value\n const { split } = props\n\n const newEndPart = inputValue.slice(mentionCtx.value.end)\n const alreadySeparated = newEndPart.startsWith(split)\n const newMiddlePart = `${item.value}${alreadySeparated ? '' : split}`\n\n const newValue =\n inputValue.slice(0, mentionCtx.value.start) + newMiddlePart + newEndPart\n\n emit(UPDATE_MODEL_EVENT, newValue)\n emit(INPUT_EVENT, newValue)\n emit('select', getOriginalOption(item)!, mentionCtx.value.prefix)\n\n const newSelectionEnd =\n mentionCtx.value.start + newMiddlePart.length + (alreadySeparated ? 1 : 0)\n\n nextTick(() => {\n // input value is updated\n inputEl.selectionStart = newSelectionEnd\n inputEl.selectionEnd = newSelectionEnd\n inputEl.focus()\n syncDropdownVisible()\n })\n}\n\nconst getInputEl = () =>\n props.type === 'textarea'\n ? elInputRef.value?.textarea\n : elInputRef.value?.input\n\nconst syncAfterCursorMove = () => {\n // can't use nextTick(), get cursor position will be wrong\n setTimeout(() => {\n syncCursor()\n syncDropdownVisible()\n nextTick(() => tooltipRef.value?.updatePopper())\n }, 0)\n}\n\nconst syncCursor = () => {\n const inputEl = getInputEl()\n if (!inputEl) return\n\n const caretPosition = getCursorPosition(inputEl)\n const inputRect = inputEl.getBoundingClientRect()\n const wrapperRect = wrapperRef.value!.getBoundingClientRect()\n\n cursorStyle.value = {\n position: 'absolute',\n width: 0,\n height: `${caretPosition.height}px`,\n left: `${caretPosition.left + inputRect.left - wrapperRect.left}px`,\n top: `${caretPosition.top + inputRect.top - wrapperRect.top}px`,\n }\n}\n\nconst syncDropdownVisible = () => {\n const inputEl = getInputEl()\n if (document.activeElement !== inputEl) {\n visible.value = false\n return\n }\n const { prefix, split } = props\n mentionCtx.value = getMentionCtx(inputEl, prefix, split)\n if (mentionCtx.value && mentionCtx.value.splitIndex === -1) {\n visible.value = true\n emit('search', mentionCtx.value.pattern, mentionCtx.value.prefix)\n return\n }\n visible.value = false\n}\n\ndefineExpose({\n input: elInputRef,\n tooltip: tooltipRef,\n dropdownVisible,\n})\n</script>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"mention2.mjs","names":[],"sources":["../../../../../../packages/components/mention/src/mention.vue"],"sourcesContent":["<template>\n <div ref=\"wrapperRef\" :class=\"ns.b()\">\n <el-input\n v-bind=\"mergeProps(passInputProps, $attrs)\"\n ref=\"elInputRef\"\n :model-value=\"modelValue\"\n :disabled=\"disabled\"\n :role=\"dropdownVisible ? 'combobox' : undefined\"\n :aria-activedescendant=\"dropdownVisible ? hoveringId || '' : undefined\"\n :aria-controls=\"dropdownVisible ? contentId : undefined\"\n :aria-expanded=\"dropdownVisible || undefined\"\n :aria-label=\"ariaLabel\"\n :aria-autocomplete=\"dropdownVisible ? 'none' : undefined\"\n :aria-haspopup=\"dropdownVisible ? 'listbox' : undefined\"\n @input=\"handleInputChange\"\n @keydown=\"handleInputKeyDown\"\n @mousedown=\"handleInputMouseDown\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps\" />\n </template>\n </el-input>\n <el-tooltip\n ref=\"tooltipRef\"\n :visible=\"dropdownVisible\"\n :popper-class=\"[ns.e('popper'), popperClass!]\"\n :popper-style=\"popperStyle\"\n :popper-options=\"popperOptions\"\n :placement=\"computedPlacement\"\n :fallback-placements=\"computedFallbackPlacements\"\n effect=\"light\"\n pure\n :offset=\"offset\"\n :show-arrow=\"showArrow\"\n >\n <template #default>\n <div :style=\"cursorStyle\" />\n </template>\n <template #content>\n <el-mention-dropdown\n ref=\"dropdownRef\"\n :options=\"filteredOptions\"\n :disabled=\"disabled\"\n :loading=\"loading\"\n :content-id=\"contentId\"\n :aria-label=\"ariaLabel\"\n @select=\"handleSelect\"\n @click.stop=\"elInputRef?.focus()\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps\" />\n </template>\n </el-mention-dropdown>\n </template>\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\" setup generic=\"T extends MentionOption = MentionOption\">\nimport { computed, mergeProps, nextTick, ref } from 'vue'\nimport { pick } from 'lodash-unified'\nimport { useFocusController, useId, useNamespace } from '@element-plus/hooks'\nimport ElInput, { inputPropsDefaults } from '@element-plus/components/input'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport {\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useFormDisabled } from '@element-plus/components/form'\nimport { getEventCode, isArray, isFunction } from '@element-plus/utils'\nimport { mentionDefaultProps, mentionEmits } from './mention'\nimport { filterOption, getCursorPosition, getMentionCtx } from './helper'\nimport ElMentionDropdown from './mention-dropdown.vue'\n\nimport type { MentionProps } from './mention'\nimport type { Placement } from '@popperjs/core'\nimport type { CSSProperties } from 'vue'\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\nimport type { MentionCtx, MentionOption } from './types'\n\ndefineOptions({\n name: 'ElMention',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<MentionProps<T>>(), {\n ...inputPropsDefaults,\n options: () => [],\n prefix: '@',\n split: ' ',\n filterOption: () => filterOption,\n placement: 'bottom',\n offset: 0,\n popperOptions: () => ({}),\n props: () => mentionDefaultProps,\n})\nconst emit = defineEmits(mentionEmits)\ndefineSlots<\n InputInstance['$slots'] & {\n header?: () => any\n footer?: () => any\n loading?: () => any\n label?: (props: { item: T & MentionOption; index: number }) => any\n }\n>()\n\nconst passInputProps = computed(() => {\n const inputProps = ElInput.props ?? []\n const keys = isArray(inputProps) ? inputProps : Object.keys(inputProps)\n return pick(props, keys)\n})\n\nconst ns = useNamespace('mention')\nconst disabled = useFormDisabled()\nconst contentId = useId()\n\nconst elInputRef = ref<InputInstance>()\nconst tooltipRef = ref<TooltipInstance>()\nconst dropdownRef = ref<InstanceType<typeof ElMentionDropdown>>()\n\nconst visible = ref(false)\nconst cursorStyle = ref<CSSProperties>()\nconst mentionCtx = ref<MentionCtx>()\n\nconst computedPlacement = computed<Placement>(() =>\n props.showArrow ? props.placement : `${props.placement}-start`\n)\n\nconst computedFallbackPlacements = computed<Placement[]>(() =>\n props.showArrow ? ['bottom', 'top'] : ['bottom-start', 'top-start']\n)\n\nconst aliasProps = computed(() => ({\n ...mentionDefaultProps,\n ...props.props,\n}))\n\nconst mapOption = (option: T) => {\n const base = {\n label: option[aliasProps.value.label],\n value: option[aliasProps.value.value],\n disabled: option[aliasProps.value.disabled],\n }\n return { ...option, ...base }\n}\n\nconst options = computed(() => props.options.map(mapOption))\n\nconst filteredOptions = computed(() => {\n const { filterOption } = props\n if (!mentionCtx.value || !filterOption) return options.value\n return options.value.filter((option) =>\n filterOption(mentionCtx.value!.pattern, option)\n )\n})\n\nconst dropdownVisible = computed(() => {\n return visible.value && (!!filteredOptions.value.length || props.loading)\n})\n\nconst hoveringId = computed(() => {\n return `${contentId.value}-${dropdownRef.value?.hoveringIndex}`\n})\n\nconst handleInputChange = (value: string) => {\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n syncAfterCursorMove()\n}\n\nconst handleInputKeyDown = (event: KeyboardEvent | Event) => {\n if (elInputRef.value?.isComposing) return\n const code = getEventCode(event as KeyboardEvent)\n\n switch (code) {\n case EVENT_CODE.left:\n case EVENT_CODE.right:\n syncAfterCursorMove()\n break\n case EVENT_CODE.up:\n case EVENT_CODE.down:\n if (!visible.value) return\n event.preventDefault()\n dropdownRef.value?.navigateOptions(\n code === EVENT_CODE.up ? 'prev' : 'next'\n )\n break\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n if (!visible.value) {\n props.type !== 'textarea' && syncAfterCursorMove()\n return\n }\n event.preventDefault()\n if (dropdownRef.value?.hoverOption) {\n dropdownRef.value?.selectHoverOption()\n } else {\n visible.value = false\n }\n break\n case EVENT_CODE.esc:\n if (!visible.value) return\n event.preventDefault()\n visible.value = false\n break\n case EVENT_CODE.backspace:\n if (props.whole && mentionCtx.value) {\n const { splitIndex, selectionEnd, pattern, prefixIndex, prefix } =\n mentionCtx.value\n const inputEl = getInputEl()\n if (!inputEl) return\n const inputValue = inputEl.value\n const matchOption = options.value.find((item) => item.value === pattern)\n const isWhole = isFunction(props.checkIsWhole)\n ? props.checkIsWhole(pattern, prefix)\n : matchOption\n if (isWhole && splitIndex !== -1 && splitIndex + 1 === selectionEnd) {\n event.preventDefault()\n const newValue =\n inputValue.slice(0, prefixIndex) + inputValue.slice(splitIndex + 1)\n emit(UPDATE_MODEL_EVENT, newValue)\n emit(INPUT_EVENT, newValue)\n emit('whole-remove', pattern, prefix)\n\n const newSelectionEnd = prefixIndex\n nextTick(() => {\n // input value is updated\n inputEl.selectionStart = newSelectionEnd\n inputEl.selectionEnd = newSelectionEnd\n syncDropdownVisible()\n })\n }\n }\n }\n}\n\nconst { wrapperRef } = useFocusController(elInputRef, {\n disabled,\n afterFocus() {\n syncAfterCursorMove()\n },\n beforeBlur(event) {\n return tooltipRef.value?.isFocusInsideContent(event)\n },\n afterBlur() {\n visible.value = false\n },\n})\n\nconst handleInputMouseDown = () => {\n syncAfterCursorMove()\n}\n\n// Ensure that the original option passed by users is returned\nconst getOriginalOption = (mentionOption: MentionOption) => {\n return props.options.find((option: MentionOption) => {\n return mentionOption.value === option[aliasProps.value.value]\n })\n}\n\nconst handleSelect = (item: MentionOption) => {\n if (!mentionCtx.value) return\n const inputEl = getInputEl()\n if (!inputEl) return\n const inputValue = inputEl.value\n const { split } = props\n\n const newEndPart = inputValue.slice(mentionCtx.value.end)\n const alreadySeparated = newEndPart.startsWith(split)\n const newMiddlePart = `${item.value}${alreadySeparated ? '' : split}`\n\n const newValue =\n inputValue.slice(0, mentionCtx.value.start) + newMiddlePart + newEndPart\n\n emit(UPDATE_MODEL_EVENT, newValue)\n emit(INPUT_EVENT, newValue)\n emit('select', getOriginalOption(item)!, mentionCtx.value.prefix)\n\n const newSelectionEnd =\n mentionCtx.value.start + newMiddlePart.length + (alreadySeparated ? 1 : 0)\n\n nextTick(() => {\n // input value is updated\n inputEl.selectionStart = newSelectionEnd\n inputEl.selectionEnd = newSelectionEnd\n inputEl.focus()\n syncDropdownVisible()\n })\n}\n\nconst getInputEl = () =>\n props.type === 'textarea'\n ? elInputRef.value?.textarea\n : elInputRef.value?.input\n\nconst syncAfterCursorMove = () => {\n // can't use nextTick(), get cursor position will be wrong\n setTimeout(() => {\n syncCursor()\n syncDropdownVisible()\n nextTick(() => tooltipRef.value?.updatePopper())\n }, 0)\n}\n\nconst syncCursor = () => {\n const inputEl = getInputEl()\n if (!inputEl) return\n\n const caretPosition = getCursorPosition(inputEl)\n const inputRect = inputEl.getBoundingClientRect()\n const wrapperRect = wrapperRef.value!.getBoundingClientRect()\n\n cursorStyle.value = {\n position: 'absolute',\n width: 0,\n height: `${caretPosition.height}px`,\n left: `${caretPosition.left + inputRect.left - wrapperRect.left}px`,\n top: `${caretPosition.top + inputRect.top - wrapperRect.top}px`,\n }\n}\n\nconst syncDropdownVisible = () => {\n const inputEl = getInputEl()\n if (document.activeElement !== inputEl) {\n visible.value = false\n return\n }\n const { prefix, split } = props\n mentionCtx.value = getMentionCtx(inputEl, prefix, split)\n if (mentionCtx.value && mentionCtx.value.splitIndex === -1) {\n visible.value = true\n emit('search', mentionCtx.value.pattern, mentionCtx.value.prefix)\n return\n }\n visible.value = false\n}\n\ndefineExpose({\n input: elInputRef,\n tooltip: tooltipRef,\n dropdownVisible,\n})\n</script>\n"],"mappings":""}
|
|
@@ -9,7 +9,7 @@ import { NavigationFailure } from "vue-router";
|
|
|
9
9
|
|
|
10
10
|
//#region ../../packages/components/menu/src/menu.d.ts
|
|
11
11
|
declare const menuProps: {
|
|
12
|
-
readonly mode: EpPropFinalized<StringConstructor, "
|
|
12
|
+
readonly mode: EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
13
13
|
readonly defaultActive: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
14
14
|
readonly defaultOpeneds: EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
15
15
|
readonly uniqueOpened: BooleanConstructor;
|
|
@@ -45,7 +45,7 @@ declare const menuEmits: {
|
|
|
45
45
|
};
|
|
46
46
|
type MenuEmits = typeof menuEmits;
|
|
47
47
|
declare const _default: vue.DefineComponent<ExtractPropTypes<{
|
|
48
|
-
readonly mode: EpPropFinalized<StringConstructor, "
|
|
48
|
+
readonly mode: EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
49
49
|
readonly defaultActive: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
50
50
|
readonly defaultOpeneds: EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
51
51
|
readonly uniqueOpened: BooleanConstructor;
|
|
@@ -78,7 +78,7 @@ declare const _default: vue.DefineComponent<ExtractPropTypes<{
|
|
|
78
78
|
open: (index: string, indexPath: string[]) => boolean;
|
|
79
79
|
select: (index: string, indexPath: string[], item: MenuItemClicked, routerResult?: Promise<void | NavigationFailure>) => boolean;
|
|
80
80
|
}, string, vue.PublicProps, Readonly<ExtractPropTypes<{
|
|
81
|
-
readonly mode: EpPropFinalized<StringConstructor, "
|
|
81
|
+
readonly mode: EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
82
82
|
readonly defaultActive: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
83
83
|
readonly defaultOpeneds: EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
84
84
|
readonly uniqueOpened: BooleanConstructor;
|
|
@@ -112,7 +112,7 @@ declare const _default: vue.DefineComponent<ExtractPropTypes<{
|
|
|
112
112
|
readonly collapse: boolean;
|
|
113
113
|
readonly ellipsis: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
114
114
|
readonly persistent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
115
|
-
readonly mode: EpPropMergeType<StringConstructor, "
|
|
115
|
+
readonly mode: EpPropMergeType<StringConstructor, "horizontal" | "vertical", unknown>;
|
|
116
116
|
readonly showTimeout: number;
|
|
117
117
|
readonly hideTimeout: number;
|
|
118
118
|
readonly defaultActive: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { triggerEvent } from "../../../../utils/dom/aria.mjs";
|
|
2
1
|
import { EVENT_CODE } from "../../../../constants/aria.mjs";
|
|
2
|
+
import { triggerEvent } from "../../../../utils/dom/aria.mjs";
|
|
3
3
|
import { getEventCode } from "../../../../utils/dom/event.mjs";
|
|
4
4
|
import SubMenu from "./submenu.mjs";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { triggerEvent } from "../../../../utils/dom/aria.mjs";
|
|
2
1
|
import { EVENT_CODE } from "../../../../constants/aria.mjs";
|
|
2
|
+
import { triggerEvent } from "../../../../utils/dom/aria.mjs";
|
|
3
3
|
import { getEventCode } from "../../../../utils/dom/event.mjs";
|
|
4
4
|
|
|
5
5
|
//#region ../../packages/components/menu/src/utils/submenu.ts
|
|
@@ -18,17 +18,17 @@ declare const __VLS_base: vue.DefineComponent<MessageProps, {
|
|
|
18
18
|
}, string, vue.PublicProps, Readonly<MessageProps> & Readonly<{
|
|
19
19
|
onDestroy?: (() => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
|
+
zIndex: number;
|
|
22
|
+
offset: number;
|
|
21
23
|
type: MessageType;
|
|
22
24
|
onClose: () => void;
|
|
23
|
-
offset: number;
|
|
24
|
-
duration: number;
|
|
25
|
-
zIndex: number;
|
|
26
25
|
id: string;
|
|
27
26
|
icon: IconPropType;
|
|
28
27
|
placement: MessagePlacement;
|
|
29
28
|
plain: boolean;
|
|
30
29
|
message: string | vue.VNode | (() => vue.VNode);
|
|
31
30
|
showClose: boolean;
|
|
31
|
+
duration: number;
|
|
32
32
|
customClass: string;
|
|
33
33
|
dangerouslyUseHTMLString: boolean;
|
|
34
34
|
grouping: boolean;
|
|
@@ -37,7 +37,7 @@ var message_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
37
37
|
const placement = computed(() => props.placement || MESSAGE_DEFAULT_PLACEMENT);
|
|
38
38
|
const lastOffset = computed(() => getLastOffset(props.id, placement.value));
|
|
39
39
|
const offset = computed(() => {
|
|
40
|
-
return getOffsetOrSpace(props.id, props.offset, placement.value) + lastOffset.value;
|
|
40
|
+
return Math.max(getOffsetOrSpace(props.id, props.offset, placement.value) + lastOffset.value, props.offset);
|
|
41
41
|
});
|
|
42
42
|
const bottom = computed(() => height.value + offset.value);
|
|
43
43
|
const horizontalClass = computed(() => {
|