@element-plus/nightly 0.0.20260416 → 0.0.20260418
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.full.js +90 -52
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +90 -52
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/affix/src/affix.vue.d.ts +4 -4
- package/es/components/alert/src/alert.d.ts +2 -2
- package/es/components/alert/src/alert.vue.d.ts +1 -1
- package/es/components/anchor/src/anchor.vue.d.ts +3 -3
- package/es/components/autocomplete/src/autocomplete.d.ts +4 -4
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
- package/es/components/avatar/src/avatar-group-props.d.ts +1 -1
- package/es/components/avatar/src/avatar-group.d.ts +2 -2
- package/es/components/avatar/src/avatar.d.ts +2 -2
- package/es/components/backtop/src/backtop.vue.d.ts +1 -1
- package/es/components/badge/src/badge.d.ts +1 -1
- package/es/components/badge/src/badge.vue.d.ts +1 -1
- package/es/components/button/src/button-group.vue.d.ts +1 -1
- package/es/components/button/src/button.d.ts +2 -2
- package/es/components/button/src/button.vue.d.ts +5 -5
- package/es/components/calendar/src/calendar.d.ts +1 -1
- package/es/components/calendar/src/calendar.vue.d.ts +1 -1
- package/es/components/card/src/card.d.ts +1 -1
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel-item.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.d.ts +2 -2
- package/es/components/carousel/src/carousel.vue.d.ts +1 -1
- package/es/components/cascader/src/cascader.d.ts +4 -4
- package/es/components/cascader/src/cascader.vue.d.ts +14 -14
- package/es/components/cascader-panel/src/index.vue.d.ts +2 -2
- package/es/components/check-tag/src/check-tag.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +4 -4
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
- package/es/components/checkbox/src/checkbox.d.ts +8 -8
- package/es/components/checkbox/src/checkbox.vue.d.ts +4 -4
- package/es/components/col/src/col.vue.d.ts +2 -2
- package/es/components/collapse/src/collapse-item.vue.d.ts +1 -1
- package/es/components/color-picker/src/color-picker.vue.d.ts +11 -11
- package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/es/components/countdown/src/countdown.vue.d.ts +2 -2
- package/es/components/date-picker/src/date-picker.d.ts +9 -9
- package/es/components/date-picker/src/props.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +5 -5
- package/es/components/descriptions/src/description-item.d.ts +19 -19
- package/es/components/dialog/src/dialog.vue.d.ts +4 -4
- package/es/components/divider/src/divider.d.ts +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +7 -7
- package/es/components/dropdown/src/dropdown-item.vue.d.ts +4 -4
- package/es/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.d.ts +4 -4
- package/es/components/dropdown/src/dropdown.vue.d.ts +89 -89
- package/es/components/empty/src/empty.vue.d.ts +1 -1
- package/es/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/es/components/form/src/form.vue.d.ts +1 -1
- package/es/components/image/src/image.d.ts +1 -1
- package/es/components/image/src/image.vue.d.ts +4 -4
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +3 -3
- package/es/components/index.d.ts +2 -2
- package/es/components/input/src/input.d.ts +3 -3
- package/es/components/input/src/input.vue.d.ts +12 -12
- package/es/components/input-number/src/input-number.d.ts +2 -2
- package/es/components/input-number/src/input-number.vue.d.ts +8 -8
- package/es/components/input-otp/src/input-otp.vue.d.ts +7 -7
- package/es/components/input-tag/src/input-tag.d.ts +3 -3
- package/es/components/input-tag/src/input-tag.vue.d.ts +12 -12
- package/es/components/link/src/link.d.ts +2 -2
- package/es/components/link/src/link.vue.d.ts +1 -1
- package/es/components/mention/src/mention.d.ts +3 -3
- package/es/components/mention/src/mention.vue.d.ts +4 -4
- package/es/components/menu/src/menu-item.d.ts +8 -5
- package/es/components/menu/src/menu-item.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item.vue.d.ts +1 -3
- package/es/components/menu/src/menu-item.vue_vue_type_script_setup_true_lang.mjs +1 -3
- package/es/components/menu/src/menu-item.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/menu/src/menu.d.ts +6 -6
- package/es/components/menu/src/sub-menu.d.ts +1 -1
- package/es/components/menu/src/utils/menu-bar.mjs.map +1 -1
- package/es/components/menu/src/utils/menu-item.mjs +2 -3
- package/es/components/menu/src/utils/menu-item.mjs.map +1 -1
- package/es/components/menu/src/utils/submenu.mjs +1 -5
- package/es/components/menu/src/utils/submenu.mjs.map +1 -1
- package/es/components/message/src/message.d.ts +1 -1
- package/es/components/message/src/message.vue.d.ts +5 -5
- package/es/components/notification/src/notification.d.ts +1 -1
- package/es/components/notification/src/notification.vue.d.ts +4 -4
- package/es/components/page-header/src/page-header.vue.d.ts +1 -1
- package/es/components/pagination/src/pagination.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
- package/es/components/popover/src/popover.d.ts +2 -2
- package/es/components/popover/src/popover.vue.d.ts +5 -5
- package/es/components/popper/src/composables/use-content.d.ts +1 -1
- package/es/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/es/components/popper/src/content.d.ts +4 -4
- package/es/components/popper/src/content.vue.d.ts +8 -8
- package/es/components/popper/src/popper.d.ts +2 -2
- package/es/components/progress/src/progress.d.ts +1 -1
- package/es/components/progress/src/progress.vue.d.ts +1 -1
- package/es/components/radio/src/radio-button.d.ts +3 -3
- package/es/components/radio/src/radio-button.vue.d.ts +2 -2
- package/es/components/radio/src/radio-group.vue.d.ts +3 -3
- package/es/components/radio/src/radio.d.ts +6 -6
- package/es/components/radio/src/radio.vue.d.ts +3 -3
- package/es/components/rate/src/rate.vue.d.ts +1 -1
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/result/src/result.vue.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.vue.d.ts +2 -2
- package/es/components/row/src/row.d.ts +1 -1
- package/es/components/row/src/row.vue.d.ts +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +5 -5
- package/es/components/segmented/index.d.ts +1 -1
- package/es/components/segmented/src/segmented.d.ts +1 -1
- package/es/components/select/src/option.d.ts +2 -2
- package/es/components/select/src/option.vue.d.ts +5 -5
- package/es/components/select/src/select.d.ts +8 -5
- package/es/components/select/src/select.mjs +1 -0
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/select.vue.d.ts +100 -98
- package/es/components/select/src/select.vue_vue_type_script_lang.mjs +2 -1
- package/es/components/select/src/select.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/select/src/select2.mjs +4 -2
- package/es/components/select/src/select2.mjs.map +1 -1
- package/es/components/select/src/useSelect.mjs +4 -0
- package/es/components/select/src/useSelect.mjs.map +1 -1
- package/es/components/select-v2/src/defaults.d.ts +4 -3
- package/es/components/select-v2/src/defaults.mjs +2 -0
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/components/select-v2/src/select-dropdown.d.ts +1 -0
- package/es/components/select-v2/src/select-dropdown.mjs +7 -1
- package/es/components/select-v2/src/select-dropdown.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +4 -2
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +78 -70
- package/es/components/select-v2/src/select.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/select-v2/src/useSelect.mjs +4 -0
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/slider.vue.d.ts +5 -5
- package/es/components/steps/src/item.d.ts +1 -1
- package/es/components/steps/src/item.vue.d.ts +1 -1
- package/es/components/steps/src/steps.d.ts +2 -2
- package/es/components/switch/src/switch.vue.d.ts +3 -3
- package/es/components/table/src/table-column/index.d.ts +18 -18
- package/es/components/table/src/table-header/index.d.ts +12 -12
- package/es/components/table/src/table.vue.d.ts +44 -44
- package/es/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +1 -1
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/tag/src/tag.vue.d.ts +2 -2
- package/es/components/text/src/text.d.ts +1 -1
- package/es/components/text/src/text.vue.d.ts +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +17 -17
- package/es/components/time-picker/src/common/props.d.ts +1 -1
- package/es/components/time-picker/src/time-picker.d.ts +9 -9
- package/es/components/time-select/src/time-select.vue.d.ts +12 -12
- package/es/components/timeline/src/timeline-item.d.ts +1 -1
- package/es/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/es/components/tooltip/src/content.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +6 -6
- package/es/components/tooltip/src/tooltip.d.ts +3 -3
- package/es/components/tooltip/src/tooltip.vue.d.ts +15 -15
- package/es/components/tooltip/src/trigger.d.ts +1 -1
- package/es/components/tour/src/content.d.ts +1 -1
- package/es/components/tour/src/step.vue.d.ts +1 -1
- package/es/components/tour/src/tour.vue.d.ts +7 -7
- package/es/components/tree/src/tree.vue.d.ts +13 -13
- package/es/components/tree-select/src/tree-select.vue.d.ts +27 -27
- package/es/components/upload/src/upload-content.vue.d.ts +1 -1
- package/es/components/upload/src/upload.vue.d.ts +2 -2
- package/es/components/virtual-list/index.d.ts +2 -2
- package/es/components/virtual-list/src/builders/build-grid.d.ts +1 -1
- package/es/components/virtual-list/src/builders/build-list.mjs +60 -36
- package/es/components/virtual-list/src/builders/build-list.mjs.map +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 +8 -7
- 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 +8 -7
- package/es/components/virtual-list/src/defaults.mjs +2 -1
- package/es/components/virtual-list/src/defaults.mjs.map +1 -1
- package/es/components/virtual-list/src/types.d.ts +7 -7
- package/es/components/watermark/src/watermark.vue.d.ts +1 -1
- package/es/hooks/use-popper/index.d.ts +1 -1
- package/es/index.d.ts +2 -2
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/src/affix.vue.d.ts +4 -4
- package/lib/components/alert/src/alert.d.ts +2 -2
- package/lib/components/alert/src/alert.vue.d.ts +1 -1
- package/lib/components/anchor/src/anchor.vue.d.ts +3 -3
- package/lib/components/autocomplete/src/autocomplete.d.ts +4 -4
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
- package/lib/components/avatar/src/avatar-group-props.d.ts +1 -1
- package/lib/components/avatar/src/avatar-group.d.ts +2 -2
- package/lib/components/avatar/src/avatar.d.ts +2 -2
- package/lib/components/backtop/src/backtop.vue.d.ts +1 -1
- package/lib/components/badge/src/badge.d.ts +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +1 -1
- package/lib/components/button/src/button-group.vue.d.ts +1 -1
- package/lib/components/button/src/button.d.ts +2 -2
- package/lib/components/button/src/button.vue.d.ts +5 -5
- package/lib/components/calendar/src/calendar.d.ts +1 -1
- package/lib/components/calendar/src/calendar.vue.d.ts +1 -1
- package/lib/components/card/src/card.d.ts +1 -1
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel-item.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.d.ts +2 -2
- package/lib/components/carousel/src/carousel.vue.d.ts +1 -1
- package/lib/components/cascader/src/cascader.d.ts +4 -4
- package/lib/components/cascader/src/cascader.vue.d.ts +14 -14
- package/lib/components/cascader-panel/src/index.vue.d.ts +2 -2
- package/lib/components/check-tag/src/check-tag.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +4 -4
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
- package/lib/components/checkbox/src/checkbox.d.ts +8 -8
- package/lib/components/checkbox/src/checkbox.vue.d.ts +4 -4
- package/lib/components/col/src/col.vue.d.ts +2 -2
- package/lib/components/collapse/src/collapse-item.vue.d.ts +1 -1
- package/lib/components/color-picker/src/color-picker.vue.d.ts +11 -11
- package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/lib/components/countdown/src/countdown.vue.d.ts +2 -2
- package/lib/components/date-picker/src/date-picker.d.ts +9 -9
- package/lib/components/date-picker/src/props.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +5 -5
- package/lib/components/descriptions/src/description-item.d.ts +19 -19
- package/lib/components/dialog/src/dialog.vue.d.ts +4 -4
- package/lib/components/divider/src/divider.d.ts +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +7 -7
- package/lib/components/dropdown/src/dropdown-item.vue.d.ts +4 -4
- package/lib/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.d.ts +4 -4
- package/lib/components/dropdown/src/dropdown.vue.d.ts +89 -89
- package/lib/components/empty/src/empty.vue.d.ts +1 -1
- package/lib/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/lib/components/form/src/form.vue.d.ts +1 -1
- package/lib/components/image/src/image.d.ts +1 -1
- package/lib/components/image/src/image.vue.d.ts +4 -4
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +3 -3
- package/lib/components/index.d.ts +2 -2
- package/lib/components/input/src/input.d.ts +3 -3
- package/lib/components/input/src/input.vue.d.ts +12 -12
- package/lib/components/input-number/src/input-number.d.ts +2 -2
- package/lib/components/input-number/src/input-number.vue.d.ts +8 -8
- package/lib/components/input-otp/src/input-otp.vue.d.ts +7 -7
- package/lib/components/input-tag/src/input-tag.d.ts +3 -3
- package/lib/components/input-tag/src/input-tag.vue.d.ts +12 -12
- package/lib/components/link/src/link.d.ts +2 -2
- package/lib/components/link/src/link.vue.d.ts +1 -1
- package/lib/components/mention/src/mention.d.ts +3 -3
- package/lib/components/mention/src/mention.vue.d.ts +4 -4
- package/lib/components/menu/src/menu-item.d.ts +8 -5
- package/lib/components/menu/src/menu-item.js +2 -2
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item.vue.d.ts +1 -3
- package/lib/components/menu/src/menu-item.vue_vue_type_script_setup_true_lang.js +0 -2
- package/lib/components/menu/src/menu-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/menu/src/menu.d.ts +6 -6
- package/lib/components/menu/src/sub-menu.d.ts +1 -1
- package/lib/components/menu/src/utils/menu-bar.js.map +1 -1
- package/lib/components/menu/src/utils/menu-item.js +2 -3
- package/lib/components/menu/src/utils/menu-item.js.map +1 -1
- package/lib/components/menu/src/utils/submenu.js +1 -5
- package/lib/components/menu/src/utils/submenu.js.map +1 -1
- package/lib/components/message/src/message.d.ts +1 -1
- package/lib/components/message/src/message.vue.d.ts +5 -5
- package/lib/components/notification/src/notification.d.ts +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +4 -4
- package/lib/components/page-header/src/page-header.vue.d.ts +1 -1
- package/lib/components/pagination/src/pagination.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
- package/lib/components/popover/src/popover.d.ts +2 -2
- package/lib/components/popover/src/popover.vue.d.ts +5 -5
- package/lib/components/popper/src/composables/use-content.d.ts +1 -1
- package/lib/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/lib/components/popper/src/content.d.ts +4 -4
- package/lib/components/popper/src/content.vue.d.ts +8 -8
- package/lib/components/popper/src/popper.d.ts +2 -2
- package/lib/components/progress/src/progress.d.ts +1 -1
- package/lib/components/progress/src/progress.vue.d.ts +1 -1
- package/lib/components/radio/src/radio-button.d.ts +3 -3
- package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
- package/lib/components/radio/src/radio-group.vue.d.ts +3 -3
- package/lib/components/radio/src/radio.d.ts +6 -6
- package/lib/components/radio/src/radio.vue.d.ts +3 -3
- package/lib/components/rate/src/rate.vue.d.ts +1 -1
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/result/src/result.vue.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.vue.d.ts +2 -2
- package/lib/components/row/src/row.d.ts +1 -1
- package/lib/components/row/src/row.vue.d.ts +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +5 -5
- package/lib/components/segmented/index.d.ts +1 -1
- package/lib/components/segmented/src/segmented.d.ts +1 -1
- package/lib/components/select/src/option.d.ts +2 -2
- package/lib/components/select/src/option.vue.d.ts +5 -5
- package/lib/components/select/src/select.d.ts +8 -5
- package/lib/components/select/src/select.js +1 -0
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/select.vue.d.ts +100 -98
- package/lib/components/select/src/select.vue_vue_type_script_lang.js +2 -1
- package/lib/components/select/src/select.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/select/src/select2.js +4 -2
- package/lib/components/select/src/select2.js.map +1 -1
- package/lib/components/select/src/useSelect.js +4 -0
- package/lib/components/select/src/useSelect.js.map +1 -1
- package/lib/components/select-v2/src/defaults.d.ts +4 -3
- package/lib/components/select-v2/src/defaults.js +2 -0
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/components/select-v2/src/select-dropdown.d.ts +1 -0
- package/lib/components/select-v2/src/select-dropdown.js +7 -1
- package/lib/components/select-v2/src/select-dropdown.js.map +1 -1
- package/lib/components/select-v2/src/select.js +4 -2
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +78 -70
- package/lib/components/select-v2/src/select.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.js +4 -0
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +5 -5
- package/lib/components/steps/src/item.d.ts +1 -1
- package/lib/components/steps/src/item.vue.d.ts +1 -1
- package/lib/components/steps/src/steps.d.ts +2 -2
- package/lib/components/switch/src/switch.vue.d.ts +3 -3
- package/lib/components/table/src/table-column/index.d.ts +18 -18
- package/lib/components/table/src/table-header/index.d.ts +12 -12
- package/lib/components/table/src/table.vue.d.ts +44 -44
- package/lib/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +1 -1
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/tag/src/tag.vue.d.ts +2 -2
- package/lib/components/text/src/text.d.ts +1 -1
- package/lib/components/text/src/text.vue.d.ts +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +17 -17
- package/lib/components/time-picker/src/common/props.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker.d.ts +9 -9
- package/lib/components/time-select/src/time-select.vue.d.ts +12 -12
- package/lib/components/timeline/src/timeline-item.d.ts +1 -1
- package/lib/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/lib/components/tooltip/src/content.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +6 -6
- package/lib/components/tooltip/src/tooltip.d.ts +3 -3
- package/lib/components/tooltip/src/tooltip.vue.d.ts +15 -15
- package/lib/components/tooltip/src/trigger.d.ts +1 -1
- package/lib/components/tour/src/content.d.ts +1 -1
- package/lib/components/tour/src/step.vue.d.ts +1 -1
- package/lib/components/tour/src/tour.vue.d.ts +7 -7
- package/lib/components/tree/src/tree.vue.d.ts +13 -13
- package/lib/components/tree-select/src/tree-select.vue.d.ts +27 -27
- package/lib/components/upload/src/upload-content.vue.d.ts +1 -1
- package/lib/components/upload/src/upload.vue.d.ts +2 -2
- package/lib/components/virtual-list/index.d.ts +2 -2
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +1 -1
- package/lib/components/virtual-list/src/builders/build-list.js +57 -33
- package/lib/components/virtual-list/src/builders/build-list.js.map +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 +8 -7
- 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 +8 -7
- package/lib/components/virtual-list/src/defaults.js +2 -0
- package/lib/components/virtual-list/src/defaults.js.map +1 -1
- package/lib/components/virtual-list/src/types.d.ts +7 -7
- package/lib/components/watermark/src/watermark.vue.d.ts +1 -1
- package/lib/hooks/use-popper/index.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.mjs","names":[],"sources":["../../../../../../packages/components/select-v2/src/defaults.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n useAriaProps,\n useEmptyValuesProps,\n useSizeProp,\n} from '@element-plus/hooks'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport { ArrowDown, CircleClose } from '@element-plus/icons-vue'\nimport { tagProps } from '../../tag'\nimport { defaultProps } from './useProps'\n\nimport type SelectV2 from './select.vue'\nimport type { Option, OptionType } from './select.types'\nimport type { Props } from './useProps'\nimport type { EmitFn } from '@element-plus/utils/vue/typescript'\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\nimport type {\n Options,\n Placement,\n PopperEffect,\n} from '@element-plus/components/popper'\n\n/**\n * @description Tag tooltip configuration interface\n */\nexport interface TagTooltipProps {\n appendTo?: string | HTMLElement\n placement?: Placement\n fallbackPlacements?: Placement[]\n effect?: PopperEffect\n popperClass?: string\n popperStyle?: string | CSSProperties\n transition?: string\n teleported?: boolean\n popperOptions?: Partial<Options>\n showAfter?: number\n hideAfter?: number\n autoClose?: number\n offset?: number\n}\n\nexport const selectV2Props = buildProps({\n /**\n * @description whether creating new items is allowed. To use this, `filterable` must be true\n */\n allowCreate: Boolean,\n /**\n * @description autocomplete of select input\n */\n autocomplete: {\n type: definePropType<'none' | 'both' | 'list' | 'inline'>(String),\n default: 'none',\n },\n /**\n * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n */\n automaticDropdown: Boolean,\n /**\n * @description whether select can be cleared\n */\n clearable: Boolean,\n /**\n * @description custom clear icon\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n type: definePropType<PopperEffect>(String),\n default: 'light',\n },\n /**\n * @description whether to collapse tags to a text when multiple selecting\n */\n collapseTags: Boolean,\n /**\n * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n */\n collapseTagsTooltip: Boolean,\n /**\n * @description configuration object for the collapse-tags tooltip. To use this, `collapse-tags` and `collapse-tags-tooltip` must be true\n */\n tagTooltip: {\n type: definePropType<TagTooltipProps>(Object),\n default: () => ({}),\n },\n /**\n * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n */\n maxCollapseTags: {\n type: Number,\n default: 1,\n },\n /**\n * @description\n */\n defaultFirstOption: Boolean,\n /**\n * @description is disabled\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description Estimated item height for variable option sizes. Defaults to fixed `itemHeight` when omitted.\n */\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n /**\n * @description whether Select is filterable\n */\n filterable: Boolean,\n /**\n * @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true\n */\n filterMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description The height of the dropdown panel, 34px for each item\n */\n height: {\n type: Number,\n default: 274, // same as select dropdown menu\n },\n /**\n * @description The height of the dropdown item\n */\n itemHeight: {\n type: Number,\n default: 34,\n },\n /**\n * @description native input id\n */\n id: String,\n /**\n * @description whether Select is loading data from server\n */\n loading: Boolean,\n /**\n * @description displayed text while loading data from server, default is 'Loading'\n */\n loadingText: String,\n /**\n * @description biding value\n */\n modelValue: {\n type: definePropType<\n any[] | string | number | boolean | Record<string, any> | any\n >([Array, String, Number, Boolean, Object]),\n default: undefined,\n },\n /**\n * @description is multiple\n */\n multiple: Boolean,\n /**\n * @description maximum number of options user can select when multiple is true. No limit when set to 0\n */\n multipleLimit: {\n type: Number,\n default: 0,\n },\n /**\n * @description the name attribute of select input\n */\n name: String,\n /**\n * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n */\n noDataText: String,\n /**\n * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n */\n noMatchText: String,\n /**\n * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n */\n remoteMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description whether reserve the keyword after select filtered option.\n */\n reserveKeyword: {\n type: Boolean,\n default: true,\n },\n /**\n * @description data of the options, the key of `value` and `label` can be customize by `props`\n */\n options: {\n type: definePropType<OptionType[]>(Array),\n required: true,\n },\n /**\n * @description placeholder, the default is 'Please select'\n */\n placeholder: {\n type: String,\n },\n /**\n * @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported: useTooltipContentProps.teleported,\n /**\n * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom class name for Select's dropdown\n */\n popperClass: useTooltipContentProps.popperClass,\n /**\n * @description custom style for Select's dropdown\n */\n popperStyle: useTooltipContentProps.popperStyle,\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}) as Partial<Options>,\n },\n /**\n * @description whether search data from server\n */\n remote: Boolean,\n /**\n * @description debounce delay during remote search, in milliseconds\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description size of component\n */\n size: useSizeProp,\n /**\n * @description configuration options, see the following table\n */\n props: {\n type: definePropType<Props>(Object),\n default: () => defaultProps,\n },\n /**\n * @description unique identity key name for value, required when value is an object\n */\n valueKey: {\n type: String,\n default: 'value',\n },\n /**\n * @description Controls whether the scrollbar is always displayed\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the dropdown\n */\n offset: {\n type: Number,\n default: 12,\n },\n /**\n * @description in remote search method show suffix icon\n */\n remoteShowSuffix: Boolean,\n /**\n * @description Determines whether the arrow is displayed\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description position of dropdown\n */\n placement: {\n type: definePropType<Placement>(String),\n values: placements,\n default: 'bottom-start',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: ['bottom-start', 'top-start', 'right', 'left'],\n },\n /**\n * @description tag type\n */\n tagType: { ...tagProps.type, default: 'info' },\n /**\n * @description tag effect\n */\n tagEffect: { ...tagProps.effect, default: 'light' },\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description which element the select dropdown appends to\n */\n appendTo: useTooltipContentProps.appendTo,\n /**\n * @description if it is `true`, the width of the dropdown panel is the same as the input box.\n * if it is `false`, the width is automatically calculated based on the value of `label`,\n * or it can be set to a number to make it a fixed width\n */\n fitInputWidth: {\n type: [Boolean, Number],\n default: true,\n validator(val) {\n return isBoolean(val) || isNumber(val)\n },\n },\n suffixIcon: {\n type: iconPropType,\n default: ArrowDown,\n },\n ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const optionV2Props = buildProps({\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: {\n type: definePropType<Option>(Object),\n required: true,\n },\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean,\n} as const)\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectV2Emits = {\n [UPDATE_MODEL_EVENT]: (val: SelectV2Props['modelValue']) => true,\n [CHANGE_EVENT]: (val: SelectV2Props['modelValue']) => true,\n 'remove-tag': (val: unknown) => true,\n 'visible-change': (visible: boolean) => true,\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n}\nexport const optionV2Emits = {\n hover: (index?: number) => isNumber(index),\n select: (val: Option, index?: number) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nexport type SelectV2Props = ExtractPropTypes<typeof selectV2Props>\nexport type SelectV2PropsPublic = ExtractPublicPropTypes<typeof selectV2Props>\nexport type OptionV2Props = ExtractPropTypes<typeof optionV2Props>\nexport type OptionV2PropsPublic = ExtractPublicPropTypes<typeof optionV2Props>\nexport type SelectV2EmitFn = EmitFn<typeof selectV2Emits>\nexport type OptionV2EmitFn = EmitFn<typeof optionV2Emits>\n\nexport type SelectV2Instance = InstanceType<typeof SelectV2> & unknown\n"],"mappings":";;;;;;;;;;;;;;AAqDA,MAAa,gBAAgB,WAAW;CAItC,aAAa;CAIb,cAAc;EACZ,MAAM,eAAoD,OAAO;EACjE,SAAS;EACV;CAID,mBAAmB;CAInB,WAAW;CAIX,WAAW;EACT,MAAM;EACN,SAAS;EACV;CAID,QAAQ;EACN,MAAM,eAA6B,OAAO;EAC1C,SAAS;EACV;CAID,cAAc;CAId,qBAAqB;CAIrB,YAAY;EACV,MAAM,eAAgC,OAAO;EAC7C,gBAAgB,EAAE;EACnB;CAID,iBAAiB;EACf,MAAM;EACN,SAAS;EACV;CAID,oBAAoB;CAIpB,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,uBAAuB;EACrB,MAAM;EACN,SAAS;EACV;CAID,YAAY;CAIZ,cAAc,EACZ,MAAM,eAAwC,SAAS,EACxD;CAID,QAAQ;EACN,MAAM;EACN,SAAS;EACV;CAID,YAAY;EACV,MAAM;EACN,SAAS;EACV;CAID,IAAI;CAIJ,SAAS;CAIT,aAAa;CAIb,YAAY;EACV,MAAM,eAEJ;GAAC;GAAO;GAAQ;GAAQ;GAAS;GAAO,CAAC;EAC3C,SAAS;EACV;CAID,UAAU;C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,CAAU;AAEX,MAAa,gBAAgB,WAAW;CACtC,MAAM;CACN,UAAU;CACV,UAAU;CACV,MAAM;EACJ,MAAM,eAAuB,OAAO;EACpC,UAAU;EACX;CACD,OAAO;CACP,OAAO;CACP,UAAU;CACV,SAAS;CACV,CAAU;AAGX,MAAa,gBAAgB;EAC1B,sBAAsB,QAAqC;EAC3D,gBAAgB,QAAqC;CACtD,eAAe,QAAiB;CAChC,mBAAmB,YAAqB;CACxC,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,aAAa;CACd;AACD,MAAa,gBAAgB;CAC3B,QAAQ,UAAmB,SAAS,MAAM;CAC1C,SAAS,KAAa,UAAmB;CAC1C"}
|
|
1
|
+
{"version":3,"file":"defaults.mjs","names":[],"sources":["../../../../../../packages/components/select-v2/src/defaults.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n useAriaProps,\n useEmptyValuesProps,\n useSizeProp,\n} from '@element-plus/hooks'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { scrollbarEmits } from '@element-plus/components/scrollbar'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport { ArrowDown, CircleClose } from '@element-plus/icons-vue'\nimport { tagProps } from '../../tag'\nimport { defaultProps } from './useProps'\n\nimport type SelectV2 from './select.vue'\nimport type { Option, OptionType } from './select.types'\nimport type { Props } from './useProps'\nimport type { EmitFn } from '@element-plus/utils/vue/typescript'\nimport type {\n CSSProperties,\n ExtractPropTypes,\n ExtractPublicPropTypes,\n} from 'vue'\nimport type {\n Options,\n Placement,\n PopperEffect,\n} from '@element-plus/components/popper'\n\n/**\n * @description Tag tooltip configuration interface\n */\nexport interface TagTooltipProps {\n appendTo?: string | HTMLElement\n placement?: Placement\n fallbackPlacements?: Placement[]\n effect?: PopperEffect\n popperClass?: string\n popperStyle?: string | CSSProperties\n transition?: string\n teleported?: boolean\n popperOptions?: Partial<Options>\n showAfter?: number\n hideAfter?: number\n autoClose?: number\n offset?: number\n}\n\nexport const selectV2Props = buildProps({\n /**\n * @description whether creating new items is allowed. To use this, `filterable` must be true\n */\n allowCreate: Boolean,\n /**\n * @description autocomplete of select input\n */\n autocomplete: {\n type: definePropType<'none' | 'both' | 'list' | 'inline'>(String),\n default: 'none',\n },\n /**\n * @description for non-filterable Select, this prop decides if the option menu pops up when the input is focused\n */\n automaticDropdown: Boolean,\n /**\n * @description whether select can be cleared\n */\n clearable: Boolean,\n /**\n * @description custom clear icon\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description tooltip theme, built-in theme: `dark` / `light`\n */\n effect: {\n type: definePropType<PopperEffect>(String),\n default: 'light',\n },\n /**\n * @description whether to collapse tags to a text when multiple selecting\n */\n collapseTags: Boolean,\n /**\n * @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true\n */\n collapseTagsTooltip: Boolean,\n /**\n * @description configuration object for the collapse-tags tooltip. To use this, `collapse-tags` and `collapse-tags-tooltip` must be true\n */\n tagTooltip: {\n type: definePropType<TagTooltipProps>(Object),\n default: () => ({}),\n },\n /**\n * @description The max tags number to be shown. To use this, `collapse-tags` must be true\n */\n maxCollapseTags: {\n type: Number,\n default: 1,\n },\n /**\n * @description\n */\n defaultFirstOption: Boolean,\n /**\n * @description is disabled\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description Estimated item height for variable option sizes. Defaults to fixed `itemHeight` when omitted.\n */\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n /**\n * @description whether Select is filterable\n */\n filterable: Boolean,\n /**\n * @description custom filter method, the first parameter is the current input value. To use this, `filterable` must be true\n */\n filterMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description The height of the dropdown panel, 34px for each item\n */\n height: {\n type: Number,\n default: 274, // same as select dropdown menu\n },\n /**\n * @description The height of the dropdown item\n */\n itemHeight: {\n type: Number,\n default: 34,\n },\n /**\n * @description native input id\n */\n id: String,\n /**\n * @description whether Select is loading data from server\n */\n loading: Boolean,\n /**\n * @description displayed text while loading data from server, default is 'Loading'\n */\n loadingText: String,\n /**\n * @description biding value\n */\n modelValue: {\n type: definePropType<\n any[] | string | number | boolean | Record<string, any> | any\n >([Array, String, Number, Boolean, Object]),\n default: undefined,\n },\n /**\n * @description is multiple\n */\n multiple: Boolean,\n /**\n * @description maximum number of options user can select when multiple is true. No limit when set to 0\n */\n multipleLimit: {\n type: Number,\n default: 0,\n },\n /**\n * @description the name attribute of select input\n */\n name: String,\n /**\n * @description displayed text when there is no options, you can also use slot empty, the default is 'No Data'\n */\n noDataText: String,\n /**\n * @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data'\n */\n noMatchText: String,\n /**\n * @description function that gets called when the input value changes. Its parameter is the current input value. To use this, `filterable` must be true\n */\n remoteMethod: {\n type: definePropType<(query: string) => void>(Function),\n },\n /**\n * @description whether reserve the keyword after select filtered option.\n */\n reserveKeyword: {\n type: Boolean,\n default: true,\n },\n /**\n * @description data of the options, the key of `value` and `label` can be customize by `props`\n */\n options: {\n type: definePropType<OptionType[]>(Array),\n required: true,\n },\n /**\n * @description placeholder, the default is 'Please select'\n */\n placeholder: {\n type: String,\n },\n /**\n * @description whether select dropdown is teleported, if `true` it will be teleported to where `append-to` sets\n */\n teleported: useTooltipContentProps.teleported,\n /**\n * @description when select dropdown is inactive and `persistent` is `false`, select dropdown will be destroyed\n */\n persistent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom class name for Select's dropdown\n */\n popperClass: useTooltipContentProps.popperClass,\n /**\n * @description custom style for Select's dropdown\n */\n popperStyle: useTooltipContentProps.popperStyle,\n /**\n * @description [popper.js](https://popper.js.org/docs/v2/) parameters\n */\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}) as Partial<Options>,\n },\n /**\n * @description whether search data from server\n */\n remote: Boolean,\n /**\n * @description debounce delay during remote search, in milliseconds\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @description size of component\n */\n size: useSizeProp,\n /**\n * @description configuration options, see the following table\n */\n props: {\n type: definePropType<Props>(Object),\n default: () => defaultProps,\n },\n /**\n * @description unique identity key name for value, required when value is an object\n */\n valueKey: {\n type: String,\n default: 'value',\n },\n /**\n * @description Controls whether the scrollbar is always displayed\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description offset of the dropdown\n */\n offset: {\n type: Number,\n default: 12,\n },\n /**\n * @description in remote search method show suffix icon\n */\n remoteShowSuffix: Boolean,\n /**\n * @description Determines whether the arrow is displayed\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description position of dropdown\n */\n placement: {\n type: definePropType<Placement>(String),\n values: placements,\n default: 'bottom-start',\n },\n /**\n * @description list of possible positions for dropdown\n */\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: ['bottom-start', 'top-start', 'right', 'left'],\n },\n /**\n * @description tag type\n */\n tagType: { ...tagProps.type, default: 'info' },\n /**\n * @description tag effect\n */\n tagEffect: { ...tagProps.effect, default: 'light' },\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description which element the select dropdown appends to\n */\n appendTo: useTooltipContentProps.appendTo,\n /**\n * @description if it is `true`, the width of the dropdown panel is the same as the input box.\n * if it is `false`, the width is automatically calculated based on the value of `label`,\n * or it can be set to a number to make it a fixed width\n */\n fitInputWidth: {\n type: [Boolean, Number],\n default: true,\n validator(val) {\n return isBoolean(val) || isNumber(val)\n },\n },\n suffixIcon: {\n type: iconPropType,\n default: ArrowDown,\n },\n ...useEmptyValuesProps,\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const optionV2Props = buildProps({\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: {\n type: definePropType<Option>(Object),\n required: true,\n },\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean,\n} as const)\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectV2Emits = {\n [UPDATE_MODEL_EVENT]: (val: SelectV2Props['modelValue']) => true,\n [CHANGE_EVENT]: (val: SelectV2Props['modelValue']) => true,\n 'end-reached': scrollbarEmits['end-reached'],\n 'remove-tag': (val: unknown) => true,\n 'visible-change': (visible: boolean) => true,\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n}\nexport const optionV2Emits = {\n hover: (index?: number) => isNumber(index),\n select: (val: Option, index?: number) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nexport type SelectV2Props = ExtractPropTypes<typeof selectV2Props>\nexport type SelectV2PropsPublic = ExtractPublicPropTypes<typeof selectV2Props>\nexport type OptionV2Props = ExtractPropTypes<typeof optionV2Props>\nexport type OptionV2PropsPublic = ExtractPublicPropTypes<typeof optionV2Props>\nexport type SelectV2EmitFn = EmitFn<typeof selectV2Emits>\nexport type OptionV2EmitFn = EmitFn<typeof optionV2Emits>\n\nexport type SelectV2Instance = InstanceType<typeof SelectV2> & unknown\n"],"mappings":";;;;;;;;;;;;;;;AAsDA,MAAa,gBAAgB,WAAW;CAItC,aAAa;CAIb,cAAc;EACZ,MAAM,eAAoD,OAAO;EACjE,SAAS;EACV;CAID,mBAAmB;CAInB,WAAW;CAIX,WAAW;EACT,MAAM;EACN,SAAS;EACV;CAID,QAAQ;EACN,MAAM,eAA6B,OAAO;EAC1C,SAAS;EACV;CAID,cAAc;CAId,qBAAqB;CAIrB,YAAY;EACV,MAAM,eAAgC,OAAO;EAC7C,gBAAgB,EAAE;EACnB;CAID,iBAAiB;EACf,MAAM;EACN,SAAS;EACV;CAID,oBAAoB;CAIpB,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,uBAAuB;EACrB,MAAM;EACN,SAAS;EAC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ACR,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,UAAU,uBAAuB;CAMjC,eAAe;EACb,MAAM,CAAC,SAAS,OAAO;EACvB,SAAS;EACT,UAAU,KAAK;AACb,UAAO,UAAU,IAAI,IAAI,SAAS,IAAI;;EAEzC;CACD,YAAY;EACV,MAAM;EACN,SAAS;EACV;CACD,GAAG;CACH,GAAG,aAAa,CAAC,YAAY,CAAC;CAC/B,CAAU;AAEX,MAAa,gBAAgB,WAAW;CACtC,MAAM;CACN,UAAU;CACV,UAAU;CACV,MAAM;EACJ,MAAM,eAAuB,OAAO;EACpC,UAAU;EACX;CACD,OAAO;CACP,OAAO;CACP,UAAU;CACV,SAAS;CACV,CAAU;AAGX,MAAa,gBAAgB;EAC1B,sBAAsB,QAAqC;EAC3D,gBAAgB,QAAqC;CACtD,eAAe,eAAe;CAC9B,eAAe,QAAiB;CAChC,mBAAmB,YAAqB;CACxC,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,aAAa;CACd;AACD,MAAa,gBAAgB;CAC3B,QAAQ,UAAmB,SAAS,MAAM;CAC1C,SAAS,KAAa,UAAmB;CAC1C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../../scrollbar/index.js";
|
|
1
2
|
import { Option } from "./select.types.js";
|
|
2
3
|
import { FixedSizeListInstance } from "../../virtual-list/src/components/fixed-size-list.js";
|
|
3
4
|
import { DynamicSizeListInstance } from "../../virtual-list/src/components/dynamic-size-list.js";
|
|
@@ -3,6 +3,7 @@ import { isIOS } from "../../../utils/browser.mjs";
|
|
|
3
3
|
import { getEventCode } from "../../../utils/dom/event.mjs";
|
|
4
4
|
import { isObject, isUndefined as isUndefined$1 } from "../../../utils/types.mjs";
|
|
5
5
|
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
|
|
6
|
+
import { scrollbarEmits } from "../../scrollbar/src/scrollbar.mjs";
|
|
6
7
|
import { useProps } from "./useProps.mjs";
|
|
7
8
|
import FixedSizeList from "../../virtual-list/src/components/fixed-size-list.mjs";
|
|
8
9
|
import DynamicSizeList from "../../virtual-list/src/components/dynamic-size-list.mjs";
|
|
@@ -27,7 +28,8 @@ const props = {
|
|
|
27
28
|
var select_dropdown_default = /* @__PURE__ */ defineComponent({
|
|
28
29
|
name: "ElSelectDropdown",
|
|
29
30
|
props,
|
|
30
|
-
|
|
31
|
+
emits: { "end-reached": scrollbarEmits["end-reached"] },
|
|
32
|
+
setup(props, { slots, expose, emit }) {
|
|
31
33
|
const select = inject(selectV2InjectionKey);
|
|
32
34
|
const ns = useNamespace("select");
|
|
33
35
|
const { getLabel, getValue, getDisabled } = useProps(select.props);
|
|
@@ -148,6 +150,9 @@ var select_dropdown_default = /* @__PURE__ */ defineComponent({
|
|
|
148
150
|
break;
|
|
149
151
|
}
|
|
150
152
|
};
|
|
153
|
+
const onEndReached = (direction) => {
|
|
154
|
+
emit("end-reached", direction);
|
|
155
|
+
};
|
|
151
156
|
return () => {
|
|
152
157
|
const { data, width } = props;
|
|
153
158
|
const { height, multiple, scrollbarAlwaysOn } = select.props;
|
|
@@ -172,6 +177,7 @@ var select_dropdown_default = /* @__PURE__ */ defineComponent({
|
|
|
172
177
|
"aria-label": props.ariaLabel,
|
|
173
178
|
"aria-orientation": "vertical"
|
|
174
179
|
},
|
|
180
|
+
"onEndReached": onEndReached,
|
|
175
181
|
"onKeydown": onKeydown
|
|
176
182
|
}), { default: (props) => createVNode(Item, props, null) }),
|
|
177
183
|
slots.footer?.()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-dropdown.mjs","names":["computed","defineComponent","inject","ref","toRaw","unref","watch","createVNode","_createVNode","mergeProps","_mergeProps","get","getEventCode","isIOS","isObject","isUndefined","DynamicSizeList","FixedSizeList","useNamespace","EVENT_CODE","GroupItem","OptionItem","useProps","selectV2InjectionKey","props","loading","Boolean","data","type","Array","required","hoveringIndex","Number","width","id","String","ariaLabel","name","setup","slots","expose","select","ns","getLabel","getValue","getDisabled","cachedHeights","listRef","size","length","value","tooltipRef","updatePopper","isSized","estimatedOptionHeight","listProps","itemSize","itemHeight","estimatedSize","idx","contains","arr","target","valueKey","includes","some","item","isEqual","selected","isItemSelected","modelValue","multiple","isItemDisabled","disabled","multipleLimit","isItemHovering","scrollToItem","index","list","resetScrollTop","exposed","Item","itemProps","style","sized","onSelect","onHover","isSelected","isDisabled","isHovering","created","default","onKeyboardNavigate","onKeyboardSelect","onForward","onBackward","onEscOrTab","onKeydown","e","code","tab","esc","down","up","enter","numpadEnter","preventDefault","stopPropagation","height","scrollbarAlwaysOn","isScrollbarAlwaysOn","List","b","is","header","empty","be","role","footer"],"sources":["../../../../../../packages/components/select-v2/src/select-dropdown.tsx"],"sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n ref,\n toRaw,\n unref,\n watch,\n} from 'vue'\nimport { get } from 'lodash-unified'\nimport { getEventCode, isIOS, isObject, isUndefined } from '@element-plus/utils'\nimport {\n DynamicSizeList,\n FixedSizeList,\n} from '@element-plus/components/virtual-list'\nimport { useNamespace } from '@element-plus/hooks'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport GroupItem from './group-item.vue'\nimport OptionItem from './option-item.vue'\nimport { useProps } from './useProps'\nimport { selectV2InjectionKey } from './token'\n\nimport type {\n DynamicSizeListInstance,\n FixedSizeListInstance,\n ItemProps,\n} from '@element-plus/components/virtual-list'\nimport type { Option, OptionItemProps } from './select.types'\nimport type {\n ComponentPublicInstance,\n ComputedRef,\n ExtractPropTypes,\n Ref,\n} from 'vue'\n\nconst props = {\n loading: Boolean,\n data: {\n type: Array,\n required: true as const,\n },\n hoveringIndex: Number,\n width: Number,\n id: String,\n ariaLabel: String,\n}\ninterface SelectDropdownExposed {\n listRef: Ref<FixedSizeListInstance | DynamicSizeListInstance | undefined>\n isSized: ComputedRef<boolean>\n isItemDisabled: (modelValue: any[] | any, selected: boolean) => boolean\n isItemHovering: (target: number) => boolean\n isItemSelected: (modelValue: any[] | any, target: Option) => boolean\n scrollToItem: (index: number) => void\n resetScrollTop: () => void\n}\nexport type SelectDropdownInstance = ComponentPublicInstance<\n ExtractPropTypes<typeof props>,\n SelectDropdownExposed\n>\nexport default defineComponent({\n name: 'ElSelectDropdown',\n props,\n setup(props, { slots, expose }) {\n const select = inject(selectV2InjectionKey)!\n const ns = useNamespace('select')\n const { getLabel, getValue, getDisabled } = useProps(select.props)\n\n const cachedHeights = ref<Array<number>>([])\n\n const listRef = ref<FixedSizeListInstance | DynamicSizeListInstance>()\n\n const size = computed(() => props.data.length)\n watch(\n () => size.value,\n () => {\n select.tooltipRef.value?.updatePopper?.()\n }\n )\n\n const isSized = computed(() =>\n isUndefined(select.props.estimatedOptionHeight)\n )\n const listProps = computed(() => {\n if (isSized.value) {\n return {\n itemSize: select.props.itemHeight,\n }\n }\n\n return {\n estimatedSize: select.props.estimatedOptionHeight,\n itemSize: (idx: number) => cachedHeights.value[idx],\n }\n })\n\n const contains = (arr: Array<any> = [], target: any) => {\n const {\n props: { valueKey },\n } = select\n\n if (!isObject(target)) {\n return arr.includes(target)\n }\n\n return (\n arr &&\n arr.some((item) => {\n return toRaw(get(item, valueKey)) === get(target, valueKey)\n })\n )\n }\n const isEqual = (selected: unknown, target: unknown) => {\n if (!isObject(target)) {\n return selected === target\n } else {\n const { valueKey } = select.props\n return get(selected, valueKey) === get(target, valueKey)\n }\n }\n\n const isItemSelected: SelectDropdownExposed['isItemSelected'] = (\n modelValue,\n target\n ) => {\n if (select.props.multiple) {\n return contains(modelValue, getValue(target))\n }\n return isEqual(modelValue, getValue(target))\n }\n\n const isItemDisabled: SelectDropdownExposed['isItemDisabled'] = (\n modelValue,\n selected\n ) => {\n const { disabled, multiple, multipleLimit } = select.props\n return (\n disabled ||\n (!selected &&\n (multiple\n ? multipleLimit > 0 && modelValue.length >= multipleLimit\n : false))\n )\n }\n\n const isItemHovering: SelectDropdownExposed['isItemHovering'] = (target) =>\n props.hoveringIndex === target\n\n const scrollToItem: SelectDropdownExposed['scrollToItem'] = (index) => {\n const list = listRef.value\n if (list) {\n list.scrollToItem(index)\n }\n }\n\n const resetScrollTop: SelectDropdownExposed['resetScrollTop'] = () => {\n const list = listRef.value\n if (list) {\n list.resetScrollTop()\n }\n }\n const exposed: SelectDropdownExposed = {\n listRef,\n isSized,\n\n isItemDisabled,\n isItemHovering,\n isItemSelected,\n scrollToItem,\n resetScrollTop,\n }\n expose(exposed)\n\n const Item = (itemProps: ItemProps<any>) => {\n const { index, data, style } = itemProps\n const sized = unref(isSized)\n const { itemSize, estimatedSize } = unref(listProps)\n const { modelValue } = select.props\n const { onSelect, onHover } = select\n const item = data[index]\n if (item.type === 'Group') {\n return (\n <GroupItem\n item={item}\n style={style}\n height={sized ? (itemSize as number) : estimatedSize}\n />\n )\n }\n\n const isSelected = isItemSelected(modelValue, item)\n const isDisabled = isItemDisabled(modelValue, isSelected)\n const isHovering = isItemHovering(index)\n return (\n <OptionItem\n {...itemProps}\n selected={isSelected}\n disabled={getDisabled(item) || isDisabled}\n created={!!item.created}\n hovering={isHovering}\n item={item}\n onSelect={onSelect}\n onHover={onHover}\n >\n {{\n default: (props: OptionItemProps) =>\n slots.default?.(props) || <span>{getLabel(item)}</span>,\n }}\n </OptionItem>\n )\n }\n\n // computed\n const { onKeyboardNavigate, onKeyboardSelect } = select\n\n const onForward = () => {\n onKeyboardNavigate('forward')\n }\n\n const onBackward = () => {\n onKeyboardNavigate('backward')\n }\n\n const onEscOrTab = () => {\n // The following line actually doesn't work. Fixing it may introduce a small breaking change for some users, so just comment it out for now.\n // select.expanded = false\n }\n\n const onKeydown = (e: KeyboardEvent) => {\n const code = getEventCode(e)\n const { tab, esc, down, up, enter, numpadEnter } = EVENT_CODE\n if ([esc, down, up, enter, numpadEnter].includes(code)) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n switch (code) {\n case tab:\n case esc:\n onEscOrTab()\n break\n case down:\n onForward()\n break\n case up:\n onBackward()\n break\n case enter:\n case numpadEnter:\n onKeyboardSelect()\n break\n }\n }\n\n return () => {\n const { data, width } = props\n const { height, multiple, scrollbarAlwaysOn } = select.props\n\n // fix https://github.com/element-plus/element-plus/issues/19127\n const isScrollbarAlwaysOn = isIOS ? true : scrollbarAlwaysOn\n\n const List = unref(isSized) ? FixedSizeList : DynamicSizeList\n\n return (\n <div\n class={[ns.b('dropdown'), ns.is('multiple', multiple)]}\n style={{\n width: `${width}px`,\n }}\n >\n {slots.header?.()}\n {slots.loading?.() || slots.empty?.() || (\n <List\n ref={listRef}\n {...unref(listProps)}\n className={ns.be('dropdown', 'list')}\n scrollbarAlwaysOn={isScrollbarAlwaysOn}\n data={data}\n height={height}\n width={width}\n total={data.length}\n innerElement=\"ul\"\n innerProps={{\n id: props.id,\n role: 'listbox',\n 'aria-label': props.ariaLabel,\n 'aria-orientation': 'vertical',\n }}\n // @ts-ignore - dts problem\n onKeydown={onKeydown}\n >\n {{\n default: (props: ItemProps<any>) => <Item {...props} />,\n }}\n </List>\n )}\n {slots.footer?.()}\n </div>\n )\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;AAmCA,MAAMwB,QAAQ;CACZC,SAASC;CACTC,MAAM;EACJC,MAAMC;EACNC,UAAU;EACX;CACDC,eAAeC;CACfC,OAAOD;CACPE,IAAIC;CACJC,WAAWD;CACZ;AAcD,8BAAelC,gCAAgB;CAC7BoC,MAAM;CACNb;CACAc,MAAMd,OAAO,EAAEe,OAAOC,UAAU;EAC9B,MAAMC,SAASvC,OAAOqB,qBAAsB;EAC5C,MAAMmB,KAAKxB,aAAa,SAAS;EACjC,MAAM,EAAEyB,UAAUC,UAAUC,gBAAgBvB,SAASmB,OAAOjB,MAAM;EAElE,MAAMsB,gBAAgB3C,IAAmB,EAAE,CAAC;EAE5C,MAAM4C,UAAU5C,KAAsD;EAEtE,MAAM6C,OAAOhD,eAAewB,MAAMG,KAAKsB,OAAO;AAC9C3C,cACQ0C,KAAKE,aACL;AACJT,UAAOU,WAAWD,OAAOE,gBAAgB;I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mjs","names":["computed","defineComponent","inject","ref","toRaw","unref","watch","createVNode","_createVNode","mergeProps","_mergeProps","get","getEventCode","isIOS","isObject","isUndefined","DynamicSizeList","FixedSizeList","useNamespace","EVENT_CODE","GroupItem","OptionItem","useProps","selectV2InjectionKey","scrollbarEmits","props","loading","Boolean","data","type","Array","required","hoveringIndex","Number","width","id","String","ariaLabel","name","emits","setup","slots","expose","emit","select","ns","getLabel","getValue","getDisabled","cachedHeights","listRef","size","length","value","tooltipRef","updatePopper","isSized","estimatedOptionHeight","listProps","itemSize","itemHeight","estimatedSize","idx","contains","arr","target","valueKey","includes","some","item","isEqual","selected","isItemSelected","modelValue","multiple","isItemDisabled","disabled","multipleLimit","isItemHovering","scrollToItem","index","list","resetScrollTop","exposed","Item","itemProps","style","sized","onSelect","onHover","isSelected","isDisabled","isHovering","created","default","onKeyboardNavigate","onKeyboardSelect","onForward","onBackward","onEscOrTab","onKeydown","e","code","tab","esc","down","up","enter","numpadEnter","preventDefault","stopPropagation","onEndReached","direction","height","scrollbarAlwaysOn","isScrollbarAlwaysOn","List","b","is","header","empty","be","role","footer"],"sources":["../../../../../../packages/components/select-v2/src/select-dropdown.tsx"],"sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n ref,\n toRaw,\n unref,\n watch,\n} from 'vue'\nimport { get } from 'lodash-unified'\nimport { getEventCode, isIOS, isObject, isUndefined } from '@element-plus/utils'\nimport {\n DynamicSizeList,\n FixedSizeList,\n} from '@element-plus/components/virtual-list'\nimport { useNamespace } from '@element-plus/hooks'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport GroupItem from './group-item.vue'\nimport OptionItem from './option-item.vue'\nimport { useProps } from './useProps'\nimport { selectV2InjectionKey } from './token'\nimport { scrollbarEmits } from '@element-plus/components/scrollbar'\n\nimport type { ScrollbarDirection } from '@element-plus/components/scrollbar'\nimport type {\n DynamicSizeListInstance,\n FixedSizeListInstance,\n ItemProps,\n} from '@element-plus/components/virtual-list'\nimport type { Option, OptionItemProps } from './select.types'\nimport type {\n ComponentPublicInstance,\n ComputedRef,\n ExtractPropTypes,\n Ref,\n} from 'vue'\n\nconst props = {\n loading: Boolean,\n data: {\n type: Array,\n required: true as const,\n },\n hoveringIndex: Number,\n width: Number,\n id: String,\n ariaLabel: String,\n}\ninterface SelectDropdownExposed {\n listRef: Ref<FixedSizeListInstance | DynamicSizeListInstance | undefined>\n isSized: ComputedRef<boolean>\n isItemDisabled: (modelValue: any[] | any, selected: boolean) => boolean\n isItemHovering: (target: number) => boolean\n isItemSelected: (modelValue: any[] | any, target: Option) => boolean\n scrollToItem: (index: number) => void\n resetScrollTop: () => void\n}\nexport type SelectDropdownInstance = ComponentPublicInstance<\n ExtractPropTypes<typeof props>,\n SelectDropdownExposed\n>\nexport default defineComponent({\n name: 'ElSelectDropdown',\n props,\n emits: {\n 'end-reached': scrollbarEmits['end-reached'],\n },\n setup(props, { slots, expose, emit }) {\n const select = inject(selectV2InjectionKey)!\n const ns = useNamespace('select')\n const { getLabel, getValue, getDisabled } = useProps(select.props)\n\n const cachedHeights = ref<Array<number>>([])\n\n const listRef = ref<FixedSizeListInstance | DynamicSizeListInstance>()\n\n const size = computed(() => props.data.length)\n watch(\n () => size.value,\n () => {\n select.tooltipRef.value?.updatePopper?.()\n }\n )\n\n const isSized = computed(() =>\n isUndefined(select.props.estimatedOptionHeight)\n )\n const listProps = computed(() => {\n if (isSized.value) {\n return {\n itemSize: select.props.itemHeight,\n }\n }\n\n return {\n estimatedSize: select.props.estimatedOptionHeight,\n itemSize: (idx: number) => cachedHeights.value[idx],\n }\n })\n\n const contains = (arr: Array<any> = [], target: any) => {\n const {\n props: { valueKey },\n } = select\n\n if (!isObject(target)) {\n return arr.includes(target)\n }\n\n return (\n arr &&\n arr.some((item) => {\n return toRaw(get(item, valueKey)) === get(target, valueKey)\n })\n )\n }\n const isEqual = (selected: unknown, target: unknown) => {\n if (!isObject(target)) {\n return selected === target\n } else {\n const { valueKey } = select.props\n return get(selected, valueKey) === get(target, valueKey)\n }\n }\n\n const isItemSelected: SelectDropdownExposed['isItemSelected'] = (\n modelValue,\n target\n ) => {\n if (select.props.multiple) {\n return contains(modelValue, getValue(target))\n }\n return isEqual(modelValue, getValue(target))\n }\n\n const isItemDisabled: SelectDropdownExposed['isItemDisabled'] = (\n modelValue,\n selected\n ) => {\n const { disabled, multiple, multipleLimit } = select.props\n return (\n disabled ||\n (!selected &&\n (multiple\n ? multipleLimit > 0 && modelValue.length >= multipleLimit\n : false))\n )\n }\n\n const isItemHovering: SelectDropdownExposed['isItemHovering'] = (target) =>\n props.hoveringIndex === target\n\n const scrollToItem: SelectDropdownExposed['scrollToItem'] = (index) => {\n const list = listRef.value\n if (list) {\n list.scrollToItem(index)\n }\n }\n\n const resetScrollTop: SelectDropdownExposed['resetScrollTop'] = () => {\n const list = listRef.value\n if (list) {\n list.resetScrollTop()\n }\n }\n const exposed: SelectDropdownExposed = {\n listRef,\n isSized,\n\n isItemDisabled,\n isItemHovering,\n isItemSelected,\n scrollToItem,\n resetScrollTop,\n }\n expose(exposed)\n\n const Item = (itemProps: ItemProps<any>) => {\n const { index, data, style } = itemProps\n const sized = unref(isSized)\n const { itemSize, estimatedSize } = unref(listProps)\n const { modelValue } = select.props\n const { onSelect, onHover } = select\n const item = data[index]\n if (item.type === 'Group') {\n return (\n <GroupItem\n item={item}\n style={style}\n height={sized ? (itemSize as number) : estimatedSize}\n />\n )\n }\n\n const isSelected = isItemSelected(modelValue, item)\n const isDisabled = isItemDisabled(modelValue, isSelected)\n const isHovering = isItemHovering(index)\n return (\n <OptionItem\n {...itemProps}\n selected={isSelected}\n disabled={getDisabled(item) || isDisabled}\n created={!!item.created}\n hovering={isHovering}\n item={item}\n onSelect={onSelect}\n onHover={onHover}\n >\n {{\n default: (props: OptionItemProps) =>\n slots.default?.(props) || <span>{getLabel(item)}</span>,\n }}\n </OptionItem>\n )\n }\n\n // computed\n const { onKeyboardNavigate, onKeyboardSelect } = select\n\n const onForward = () => {\n onKeyboardNavigate('forward')\n }\n\n const onBackward = () => {\n onKeyboardNavigate('backward')\n }\n\n const onEscOrTab = () => {\n // The following line actually doesn't work. Fixing it may introduce a small breaking change for some users, so just comment it out for now.\n // select.expanded = false\n }\n\n const onKeydown = (e: KeyboardEvent) => {\n const code = getEventCode(e)\n const { tab, esc, down, up, enter, numpadEnter } = EVENT_CODE\n if ([esc, down, up, enter, numpadEnter].includes(code)) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n switch (code) {\n case tab:\n case esc:\n onEscOrTab()\n break\n case down:\n onForward()\n break\n case up:\n onBackward()\n break\n case enter:\n case numpadEnter:\n onKeyboardSelect()\n break\n }\n }\n\n const onEndReached = (direction: ScrollbarDirection) => {\n emit('end-reached', direction)\n }\n\n return () => {\n const { data, width } = props\n const { height, multiple, scrollbarAlwaysOn } = select.props\n\n // fix https://github.com/element-plus/element-plus/issues/19127\n const isScrollbarAlwaysOn = isIOS ? true : scrollbarAlwaysOn\n\n const List = unref(isSized) ? FixedSizeList : DynamicSizeList\n\n return (\n <div\n class={[ns.b('dropdown'), ns.is('multiple', multiple)]}\n style={{\n width: `${width}px`,\n }}\n >\n {slots.header?.()}\n {slots.loading?.() || slots.empty?.() || (\n <List\n ref={listRef}\n {...unref(listProps)}\n className={ns.be('dropdown', 'list')}\n scrollbarAlwaysOn={isScrollbarAlwaysOn}\n data={data}\n height={height}\n width={width}\n total={data.length}\n innerElement=\"ul\"\n innerProps={{\n id: props.id,\n role: 'listbox',\n 'aria-label': props.ariaLabel,\n 'aria-orientation': 'vertical',\n }}\n // @ts-ignore - dts problem\n onEndReached={onEndReached}\n // @ts-ignore - dts problem\n onKeydown={onKeydown}\n >\n {{\n default: (props: ItemProps<any>) => <Item {...props} />,\n }}\n </List>\n )}\n {slots.footer?.()}\n </div>\n )\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,MAAMyB,QAAQ;CACZC,SAASC;CACTC,MAAM;EACJC,MAAMC;EACNC,UAAU;EACX;CACDC,eAA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,EACLxC,OAAO,GAAGA,MAAK,KACjB;IAAC,EAAA;IAEAO,MAAM8E,UAAU;IAChB9E,MAAMf,WAAW,IAAIe,MAAM+E,SAAS,IAAAhH,YAAA4G,MAAA1G,WAAA,EAAA,OAE5BwC,SAAO,EACR7C,MAAMqD,UAAU,EAAA;KAAA,aACTb,GAAG4E,GAAG,YAAY,OAAO;KAAA,qBACjBN;KAAmB,QAChCvF;KAAI,UACFqF;KAAM,SACP/E;KAAK,SACLN,KAAKwB;KAAM,gBAAA;KAAA,cAEN;MACVjB,IAAIV,MAAMU;MACVuF,MAAM;MACN,cAAcjG,MAAMY;MACpB,oBAAoB;MACrB;KAAA,gBAEa0E;KAAY,aAEfX;KAAS,CAAA,EAAA,EAGlBN,UAAUrE,UAAqBjB,YAAA4E,MAAe3D,OAAK,KAAA,EAAI,CAG5D;IACAgB,MAAMkF,UAAU;IAAA,CAAA;;;CAK1B,CAAC"}
|
|
@@ -298,7 +298,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
298
298
|
width: _ctx.popperSize - _ctx.BORDER_HORIZONTAL_WIDTH,
|
|
299
299
|
"hovering-index": _ctx.states.hoveringIndex,
|
|
300
300
|
"scrollbar-always-on": _ctx.scrollbarAlwaysOn,
|
|
301
|
-
"aria-label": _ctx.ariaLabel
|
|
301
|
+
"aria-label": _ctx.ariaLabel,
|
|
302
|
+
onEndReached: _ctx.onEndReached
|
|
302
303
|
}, createSlots({
|
|
303
304
|
default: withCtx((scope) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))]),
|
|
304
305
|
_: 2
|
|
@@ -334,7 +335,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
334
335
|
"width",
|
|
335
336
|
"hovering-index",
|
|
336
337
|
"scrollbar-always-on",
|
|
337
|
-
"aria-label"
|
|
338
|
+
"aria-label",
|
|
339
|
+
"onEndReached"
|
|
338
340
|
])]),
|
|
339
341
|
_: 3
|
|
340
342
|
}, 8, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.mjs","names":[],"sources":["../../../../../../packages/components/select-v2/src/select.vue"],"sourcesContent":["<template>\n <div\n ref=\"selectRef\"\n v-click-outside:[popperRef]=\"handleClickOutside\"\n :class=\"[nsSelect.b(), nsSelect.m(selectSize)]\"\n @mouseenter=\"states.inputHovering = true\"\n @mouseleave=\"states.inputHovering = false\"\n >\n <el-tooltip\n ref=\"tooltipRef\"\n :visible=\"dropdownMenuVisible\"\n :teleported=\"teleported\"\n :popper-class=\"[nsSelect.e('popper'), popperClass!]\"\n :popper-style=\"popperStyle\"\n :gpu-acceleration=\"false\"\n :stop-popper-mouse-event=\"false\"\n :popper-options=\"popperOptions\"\n :fallback-placements=\"fallbackPlacements\"\n :effect=\"effect\"\n :placement=\"placement\"\n pure\n :transition=\"`${nsSelect.namespace.value}-zoom-in-top`\"\n trigger=\"click\"\n :persistent=\"persistent\"\n :append-to=\"appendTo\"\n :show-arrow=\"showArrow\"\n :offset=\"offset\"\n @before-show=\"handleMenuEnter\"\n @hide=\"states.isBeforeHide = false\"\n >\n <template #default>\n <div\n ref=\"wrapperRef\"\n :class=\"[\n nsSelect.e('wrapper'),\n nsSelect.is('focused', isFocused),\n nsSelect.is('hovering', states.inputHovering),\n nsSelect.is('filterable', filterable),\n nsSelect.is('disabled', selectDisabled),\n ]\"\n @click.prevent=\"toggleMenu\"\n >\n <div\n v-if=\"$slots.prefix\"\n ref=\"prefixRef\"\n :class=\"nsSelect.e('prefix')\"\n >\n <slot name=\"prefix\" />\n </div>\n <div\n ref=\"selectionRef\"\n :class=\"[\n nsSelect.e('selection'),\n nsSelect.is(\n 'near',\n multiple && !$slots.prefix && !!modelValue.length\n ),\n ]\"\n >\n <slot\n v-if=\"multiple\"\n name=\"tag\"\n :data=\"states.cachedOptions\"\n :delete-tag=\"deleteTag\"\n :select-disabled=\"selectDisabled\"\n >\n <div\n v-for=\"item in showTagList\"\n :key=\"getValueKey(getValue(item))\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n :closable=\"!selectDisabled && !getDisabled(item)\"\n :size=\"collapseTagSize\"\n :type=\"tagType\"\n :effect=\"tagEffect\"\n disable-transitions\n :style=\"tagStyle\"\n @close=\"deleteTag($event, item)\"\n >\n <span :class=\"nsSelect.e('tags-text')\">\n <slot\n name=\"label\"\n :index=\"getIndex(item)\"\n :label=\"getLabel(item)\"\n :value=\"getValue(item)\"\n >\n {{ getLabel(item) }}\n </slot>\n </span>\n </el-tag>\n </div>\n\n <el-tooltip\n v-if=\"\n collapseTags && states.cachedOptions.length > maxCollapseTags\n \"\n ref=\"tagTooltipRef\"\n :disabled=\"dropdownMenuVisible || !collapseTagsTooltip\"\n :fallback-placements=\"\n tagTooltip?.fallbackPlacements ?? [\n 'bottom',\n 'top',\n 'right',\n 'left',\n ]\n \"\n :effect=\"tagTooltip?.effect ?? effect\"\n :placement=\"tagTooltip?.placement ?? 'bottom'\"\n :popper-class=\"tagTooltip?.popperClass ?? popperClass\"\n :popper-style=\"tagTooltip?.popperStyle ?? popperStyle\"\n :teleported=\"tagTooltip?.teleported ?? teleported\"\n :append-to=\"tagTooltip?.appendTo ?? appendTo\"\n :popper-options=\"tagTooltip?.popperOptions ?? popperOptions\"\n :transition=\"tagTooltip?.transition\"\n :show-after=\"tagTooltip?.showAfter\"\n :hide-after=\"tagTooltip?.hideAfter\"\n :auto-close=\"tagTooltip?.autoClose\"\n :offset=\"tagTooltip?.offset\"\n >\n <template #default>\n <div\n ref=\"collapseItemRef\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n :closable=\"false\"\n :size=\"collapseTagSize\"\n :type=\"tagType\"\n :effect=\"tagEffect\"\n :style=\"collapseTagStyle\"\n disable-transitions\n >\n <span :class=\"nsSelect.e('tags-text')\">\n + {{ states.cachedOptions.length - maxCollapseTags }}\n </span>\n </el-tag>\n </div>\n </template>\n <template #content>\n <div ref=\"tagMenuRef\" :class=\"nsSelect.e('selection')\">\n <div\n v-for=\"selected in collapseTagList\"\n :key=\"getValueKey(getValue(selected))\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n class=\"in-tooltip\"\n :closable=\"!selectDisabled && !getDisabled(selected)\"\n :size=\"collapseTagSize\"\n :type=\"tagType\"\n :effect=\"tagEffect\"\n disable-transitions\n @close=\"deleteTag($event, selected)\"\n >\n <span :class=\"nsSelect.e('tags-text')\">\n <slot\n name=\"label\"\n :index=\"getIndex(selected)\"\n :label=\"getLabel(selected)\"\n :value=\"getValue(selected)\"\n >\n {{ getLabel(selected) }}\n </slot>\n </span>\n </el-tag>\n </div>\n </div>\n </template>\n </el-tooltip>\n </slot>\n <div\n :class=\"[\n nsSelect.e('selected-item'),\n nsSelect.e('input-wrapper'),\n nsSelect.is(\n 'hidden',\n !filterable ||\n selectDisabled ||\n (!states.inputValue && !isFocused)\n ),\n ]\"\n >\n <input\n :id=\"inputId\"\n ref=\"inputRef\"\n :value=\"states.inputValue\"\n :style=\"inputStyle\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n autocapitalize=\"off\"\n :aria-expanded=\"expanded\"\n :aria-label=\"ariaLabel\"\n :class=\"[nsSelect.e('input'), nsSelect.is(selectSize)]\"\n :disabled=\"selectDisabled\"\n role=\"combobox\"\n :aria-controls=\"contentId\"\n :aria-activedescendant=\"\n states.hoveringIndex >= 0\n ? `${contentId}-${states.hoveringIndex}`\n : ''\n \"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :name=\"name\"\n @input=\"onInput\"\n @change.stop\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @keydown.up.stop.prevent=\"onKeyboardNavigate('backward')\"\n @keydown.down.stop.prevent=\"onKeyboardNavigate('forward')\"\n @keydown.enter.stop.prevent=\"onKeyboardSelect\"\n @keydown.esc.stop.prevent=\"handleEsc\"\n @keydown.delete.stop=\"handleDel\"\n @click.stop=\"toggleMenu\"\n />\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n :class=\"nsSelect.e('input-calculator')\"\n v-text=\"states.inputValue\"\n />\n </div>\n <div\n v-if=\"shouldShowPlaceholder\"\n :class=\"[\n nsSelect.e('selected-item'),\n nsSelect.e('placeholder'),\n nsSelect.is(\n 'transparent',\n !hasModelValue || (expanded && !states.inputValue)\n ),\n ]\"\n >\n <slot\n v-if=\"hasModelValue\"\n name=\"label\"\n :index=\"allOptionsValueMap.get(modelValue)?.index ?? -1\"\n :label=\"currentPlaceholder\"\n :value=\"modelValue\"\n >\n <span>{{ currentPlaceholder }}</span>\n </slot>\n <span v-else>{{ currentPlaceholder }}</span>\n </div>\n </div>\n <div ref=\"suffixRef\" :class=\"nsSelect.e('suffix')\">\n <el-icon\n v-if=\"iconComponent\"\n v-show=\"!showClearBtn\"\n :class=\"[nsSelect.e('caret'), nsInput.e('icon'), iconReverse]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <el-icon\n v-if=\"showClearBtn && clearIcon\"\n :class=\"[\n nsSelect.e('caret'),\n nsInput.e('icon'),\n nsSelect.e('clear'),\n ]\"\n @click.prevent.stop=\"handleClear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <el-icon\n v-if=\"validateState && validateIcon && needStatusIcon\"\n :class=\"[\n nsInput.e('icon'),\n nsInput.e('validateIcon'),\n nsInput.is('loading', validateState === 'validating'),\n ]\"\n >\n <component :is=\"validateIcon\" />\n </el-icon>\n </div>\n </div>\n </template>\n <template #content>\n <el-select-menu\n :id=\"contentId\"\n ref=\"menuRef\"\n :data=\"filteredOptions\"\n :width=\"popperSize - BORDER_HORIZONTAL_WIDTH\"\n :hovering-index=\"states.hoveringIndex\"\n :scrollbar-always-on=\"scrollbarAlwaysOn\"\n :aria-label=\"ariaLabel\"\n >\n <template v-if=\"$slots.header\" #header>\n <div :class=\"nsSelect.be('dropdown', 'header')\" @click.stop>\n <slot name=\"header\" />\n </div>\n </template>\n <template #default=\"scope\">\n <slot v-bind=\"scope\" />\n </template>\n <template v-if=\"$slots.loading && loading\" #loading>\n <div :class=\"nsSelect.be('dropdown', 'loading')\">\n <slot name=\"loading\" />\n </div>\n </template>\n <template v-else-if=\"loading || filteredOptions.length === 0\" #empty>\n <div :class=\"nsSelect.be('dropdown', 'empty')\">\n <slot name=\"empty\">\n <span>{{ emptyText }}</span>\n </slot>\n </div>\n </template>\n <template v-if=\"$slots.footer\" #footer>\n <div :class=\"nsSelect.be('dropdown', 'footer')\" @click.stop>\n <slot name=\"footer\" />\n </div>\n </template>\n </el-select-menu>\n </template>\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, provide, reactive, toRefs } from 'vue'\nimport { isArray } from '@element-plus/utils'\nimport { ClickOutside } from '@element-plus/directives'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport ElTag from '@element-plus/components/tag'\nimport ElIcon from '@element-plus/components/icon'\nimport { useCalcInputWidth, useId } from '@element-plus/hooks'\nimport ElSelectMenu from './select-dropdown'\nimport useSelect from './useSelect'\nimport { selectV2Emits, selectV2Props } from './defaults'\nimport { selectV2InjectionKey } from './token'\nimport { BORDER_HORIZONTAL_WIDTH } from '@element-plus/constants'\n\nexport default defineComponent({\n name: 'ElSelectV2',\n components: {\n ElSelectMenu,\n ElTag,\n ElTooltip,\n ElIcon,\n },\n directives: { ClickOutside },\n props: selectV2Props,\n emits: selectV2Emits,\n setup(props, { emit }) {\n const modelValue = computed(() => {\n const { modelValue: rawModelValue, multiple } = props\n const fallback = multiple ? [] : undefined\n // When it is array, we check if this is multi-select.\n // Based on the result we get\n if (isArray(rawModelValue)) {\n return multiple ? rawModelValue : fallback\n }\n return multiple ? fallback : rawModelValue\n })\n\n const API = useSelect(\n reactive({\n ...toRefs(props),\n modelValue,\n }),\n emit\n )\n const { calculatorRef, inputStyle } = useCalcInputWidth()\n const contentId = useId()\n\n provide(selectV2InjectionKey, {\n props: reactive({\n ...toRefs(props),\n height: API.popupHeight,\n modelValue,\n }),\n expanded: API.expanded,\n tooltipRef: API.tooltipRef,\n contentId,\n onSelect: API.onSelect,\n onHover: API.onHover,\n onKeyboardNavigate: API.onKeyboardNavigate,\n onKeyboardSelect: API.onKeyboardSelect,\n })\n\n const selectedLabel = computed(() => {\n if (!props.multiple) {\n return API.states.selectedLabel\n }\n return API.states.cachedOptions.map((i) => API.getLabel(i) as string)\n })\n\n return {\n ...API,\n modelValue,\n selectedLabel,\n calculatorRef,\n inputStyle,\n contentId,\n BORDER_HORIZONTAL_WIDTH,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;qCACE,mBAgUM,OAAA;EA/TJ,KAAI;EAEH,OAAK,eAAA,CAAG,KAAA,SAAS,GAAC,EAAI,KAAA,SAAS,EAAE,KAAA,WAAU,CAAA,CAAA;EAC3C,cAAU,OAAA,QAAA,OAAA,OAAA,WAAE,KAAA,OAAO,gBAAa;EAChC,cAAU,OAAA,QAAA,OAAA,OAAA,WAAE,KAAA,OAAO,gBAAa;KAEjC,YAwTa,uBAAA;EAvTX,KAAI;EACH,SAAS,KAAA;EACT,YAAY,KAAA;EACZ,gBAAY,CAAG,KAAA,SAAS,EAAC,SAAA,EAAY,KAAA,YAAW;EAChD,gBAAc,KAAA;EACd,oBAAkB;EAClB,2BAAyB;EACzB,kBAAgB,KAAA;EAChB,uBAAqB,KAAA;EACrB,QAAQ,KAAA;EACR,WAAW,KAAA;EACZ,MAAA;EACC,YAAU,GAAK,KAAA,SAAS,UAAU,MAAK;EACxC,SAAQ;EACP,YAAY,KAAA;EACZ,aAAW,KAAA;EACX,cAAY,KAAA;EACZ,QAAQ,KAAA;EACR,cAAa,KAAA;EACb,QAAI,OAAA,QAAA,OAAA,OAAA,WAAE,KAAA,OAAO,eAAY;;EAEf,SAAO,cA2PV,CA1PN,mBA0P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,KAAA,SAAS,GAAE,YAAA,QAAA,CAAA,EAAA,GACtB,WAEO,KAAA,QAAA,SAAA,EAAA,QAAA,CADL,mBAA4B,QAAA,MAAA,gBAAnB,KAAA,UAAS,EAAA,EAAA,CAAA,CAAA,CAAA;;;GAIR,KAAA,OAAO,SAAA;UAAS;sBAGxB,CAFN,mBAEM,OAAA;KAFA,OAAK,eAAE,KAAA,SAAS,GAAE,YAAA,SAAA,CAAA;KAAyB,SAAK,OAAA,QAAA,OAAA,MAAA,oBAAN,IAAW,CAAA,OAAA,CAAA;QACzD,WAAsB,KAAA,QAAA,SAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAxTH,KAAA;EAAb,KAAA;EAAW,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"select.mjs","names":[],"sources":["../../../../../../packages/components/select-v2/src/select.vue"],"sourcesContent":["<template>\n <div\n ref=\"selectRef\"\n v-click-outside:[popperRef]=\"handleClickOutside\"\n :class=\"[nsSelect.b(), nsSelect.m(selectSize)]\"\n @mouseenter=\"states.inputHovering = true\"\n @mouseleave=\"states.inputHovering = false\"\n >\n <el-tooltip\n ref=\"tooltipRef\"\n :visible=\"dropdownMenuVisible\"\n :teleported=\"teleported\"\n :popper-class=\"[nsSelect.e('popper'), popperClass!]\"\n :popper-style=\"popperStyle\"\n :gpu-acceleration=\"false\"\n :stop-popper-mouse-event=\"false\"\n :popper-options=\"popperOptions\"\n :fallback-placements=\"fallbackPlacements\"\n :effect=\"effect\"\n :placement=\"placement\"\n pure\n :transition=\"`${nsSelect.namespace.value}-zoom-in-top`\"\n trigger=\"click\"\n :persistent=\"persistent\"\n :append-to=\"appendTo\"\n :show-arrow=\"showArrow\"\n :offset=\"offset\"\n @before-show=\"handleMenuEnter\"\n @hide=\"states.isBeforeHide = false\"\n >\n <template #default>\n <div\n ref=\"wrapperRef\"\n :class=\"[\n nsSelect.e('wrapper'),\n nsSelect.is('focused', isFocused),\n nsSelect.is('hovering', states.inputHovering),\n nsSelect.is('filterable', filterable),\n nsSelect.is('disabled', selectDisabled),\n ]\"\n @click.prevent=\"toggleMenu\"\n >\n <div\n v-if=\"$slots.prefix\"\n ref=\"prefixRef\"\n :class=\"nsSelect.e('prefix')\"\n >\n <slot name=\"prefix\" />\n </div>\n <div\n ref=\"selectionRef\"\n :class=\"[\n nsSelect.e('selection'),\n nsSelect.is(\n 'near',\n multiple && !$slots.prefix && !!modelValue.length\n ),\n ]\"\n >\n <slot\n v-if=\"multiple\"\n name=\"tag\"\n :data=\"states.cachedOptions\"\n :delete-tag=\"deleteTag\"\n :select-disabled=\"selectDisabled\"\n >\n <div\n v-for=\"item in showTagList\"\n :key=\"getValueKey(getValue(item))\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n :closable=\"!selectDisabled && !getDisabled(item)\"\n :size=\"collapseTagSize\"\n :type=\"tagType\"\n :effect=\"tagEffect\"\n disable-transitions\n :style=\"tagStyle\"\n @close=\"deleteTag($event, item)\"\n >\n <span :class=\"nsSelect.e('tags-text')\">\n <slot\n name=\"label\"\n :index=\"getIndex(item)\"\n :label=\"getLabel(item)\"\n :value=\"getValue(item)\"\n >\n {{ getLabel(item) }}\n </slot>\n </span>\n </el-tag>\n </div>\n\n <el-tooltip\n v-if=\"\n collapseTags && states.cachedOptions.length > maxCollapseTags\n \"\n ref=\"tagTooltipRef\"\n :disabled=\"dropdownMenuVisible || !collapseTagsTooltip\"\n :fallback-placements=\"\n tagTooltip?.fallbackPlacements ?? [\n 'bottom',\n 'top',\n 'right',\n 'left',\n ]\n \"\n :effect=\"tagTooltip?.effect ?? effect\"\n :placement=\"tagTooltip?.placement ?? 'bottom'\"\n :popper-class=\"tagTooltip?.popperClass ?? popperClass\"\n :popper-style=\"tagTooltip?.popperStyle ?? popperStyle\"\n :teleported=\"tagTooltip?.teleported ?? teleported\"\n :append-to=\"tagTooltip?.appendTo ?? appendTo\"\n :popper-options=\"tagTooltip?.popperOptions ?? popperOptions\"\n :transition=\"tagTooltip?.transition\"\n :show-after=\"tagTooltip?.showAfter\"\n :hide-after=\"tagTooltip?.hideAfter\"\n :auto-close=\"tagTooltip?.autoClose\"\n :offset=\"tagTooltip?.offset\"\n >\n <template #default>\n <div\n ref=\"collapseItemRef\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n :closable=\"false\"\n :size=\"collapseTagSize\"\n :type=\"tagType\"\n :effect=\"tagEffect\"\n :style=\"collapseTagStyle\"\n disable-transitions\n >\n <span :class=\"nsSelect.e('tags-text')\">\n + {{ states.cachedOptions.length - maxCollapseTags }}\n </span>\n </el-tag>\n </div>\n </template>\n <template #content>\n <div ref=\"tagMenuRef\" :class=\"nsSelect.e('selection')\">\n <div\n v-for=\"selected in collapseTagList\"\n :key=\"getValueKey(getValue(selected))\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n class=\"in-tooltip\"\n :closable=\"!selectDisabled && !getDisabled(selected)\"\n :size=\"collapseTagSize\"\n :type=\"tagType\"\n :effect=\"tagEffect\"\n disable-transitions\n @close=\"deleteTag($event, selected)\"\n >\n <span :class=\"nsSelect.e('tags-text')\">\n <slot\n name=\"label\"\n :index=\"getIndex(selected)\"\n :label=\"getLabel(selected)\"\n :value=\"getValue(selected)\"\n >\n {{ getLabel(selected) }}\n </slot>\n </span>\n </el-tag>\n </div>\n </div>\n </template>\n </el-tooltip>\n </slot>\n <div\n :class=\"[\n nsSelect.e('selected-item'),\n nsSelect.e('input-wrapper'),\n nsSelect.is(\n 'hidden',\n !filterable ||\n selectDisabled ||\n (!states.inputValue && !isFocused)\n ),\n ]\"\n >\n <input\n :id=\"inputId\"\n ref=\"inputRef\"\n :value=\"states.inputValue\"\n :style=\"inputStyle\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n autocapitalize=\"off\"\n :aria-expanded=\"expanded\"\n :aria-label=\"ariaLabel\"\n :class=\"[nsSelect.e('input'), nsSelect.is(selectSize)]\"\n :disabled=\"selectDisabled\"\n role=\"combobox\"\n :aria-controls=\"contentId\"\n :aria-activedescendant=\"\n states.hoveringIndex >= 0\n ? `${contentId}-${states.hoveringIndex}`\n : ''\n \"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :name=\"name\"\n @input=\"onInput\"\n @change.stop\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @keydown.up.stop.prevent=\"onKeyboardNavigate('backward')\"\n @keydown.down.stop.prevent=\"onKeyboardNavigate('forward')\"\n @keydown.enter.stop.prevent=\"onKeyboardSelect\"\n @keydown.esc.stop.prevent=\"handleEsc\"\n @keydown.delete.stop=\"handleDel\"\n @click.stop=\"toggleMenu\"\n />\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n :class=\"nsSelect.e('input-calculator')\"\n v-text=\"states.inputValue\"\n />\n </div>\n <div\n v-if=\"shouldShowPlaceholder\"\n :class=\"[\n nsSelect.e('selected-item'),\n nsSelect.e('placeholder'),\n nsSelect.is(\n 'transparent',\n !hasModelValue || (expanded && !states.inputValue)\n ),\n ]\"\n >\n <slot\n v-if=\"hasModelValue\"\n name=\"label\"\n :index=\"allOptionsValueMap.get(modelValue)?.index ?? -1\"\n :label=\"currentPlaceholder\"\n :value=\"modelValue\"\n >\n <span>{{ currentPlaceholder }}</span>\n </slot>\n <span v-else>{{ currentPlaceholder }}</span>\n </div>\n </div>\n <div ref=\"suffixRef\" :class=\"nsSelect.e('suffix')\">\n <el-icon\n v-if=\"iconComponent\"\n v-show=\"!showClearBtn\"\n :class=\"[nsSelect.e('caret'), nsInput.e('icon'), iconReverse]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <el-icon\n v-if=\"showClearBtn && clearIcon\"\n :class=\"[\n nsSelect.e('caret'),\n nsInput.e('icon'),\n nsSelect.e('clear'),\n ]\"\n @click.prevent.stop=\"handleClear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <el-icon\n v-if=\"validateState && validateIcon && needStatusIcon\"\n :class=\"[\n nsInput.e('icon'),\n nsInput.e('validateIcon'),\n nsInput.is('loading', validateState === 'validating'),\n ]\"\n >\n <component :is=\"validateIcon\" />\n </el-icon>\n </div>\n </div>\n </template>\n <template #content>\n <el-select-menu\n :id=\"contentId\"\n ref=\"menuRef\"\n :data=\"filteredOptions\"\n :width=\"popperSize - BORDER_HORIZONTAL_WIDTH\"\n :hovering-index=\"states.hoveringIndex\"\n :scrollbar-always-on=\"scrollbarAlwaysOn\"\n :aria-label=\"ariaLabel\"\n @end-reached=\"onEndReached\"\n >\n <template v-if=\"$slots.header\" #header>\n <div :class=\"nsSelect.be('dropdown', 'header')\" @click.stop>\n <slot name=\"header\" />\n </div>\n </template>\n <template #default=\"scope\">\n <slot v-bind=\"scope\" />\n </template>\n <template v-if=\"$slots.loading && loading\" #loading>\n <div :class=\"nsSelect.be('dropdown', 'loading')\">\n <slot name=\"loading\" />\n </div>\n </template>\n <template v-else-if=\"loading || filteredOptions.length === 0\" #empty>\n <div :class=\"nsSelect.be('dropdown', 'empty')\">\n <slot name=\"empty\">\n <span>{{ emptyText }}</span>\n </slot>\n </div>\n </template>\n <template v-if=\"$slots.footer\" #footer>\n <div :class=\"nsSelect.be('dropdown', 'footer')\" @click.stop>\n <slot name=\"footer\" />\n </div>\n </template>\n </el-select-menu>\n </template>\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, provide, reactive, toRefs } from 'vue'\nimport { isArray } from '@element-plus/utils'\nimport { ClickOutside } from '@element-plus/directives'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport ElTag from '@element-plus/components/tag'\nimport ElIcon from '@element-plus/components/icon'\nimport { useCalcInputWidth, useId } from '@element-plus/hooks'\nimport ElSelectMenu from './select-dropdown'\nimport useSelect from './useSelect'\nimport { selectV2Emits, selectV2Props } from './defaults'\nimport { selectV2InjectionKey } from './token'\nimport { BORDER_HORIZONTAL_WIDTH } from '@element-plus/constants'\n\nexport default defineComponent({\n name: 'ElSelectV2',\n components: {\n ElSelectMenu,\n ElTag,\n ElTooltip,\n ElIcon,\n },\n directives: { ClickOutside },\n props: selectV2Props,\n emits: selectV2Emits,\n setup(props, { emit }) {\n const modelValue = computed(() => {\n const { modelValue: rawModelValue, multiple } = props\n const fallback = multiple ? [] : undefined\n // When it is array, we check if this is multi-select.\n // Based on the result we get\n if (isArray(rawModelValue)) {\n return multiple ? rawModelValue : fallback\n }\n return multiple ? fallback : rawModelValue\n })\n\n const API = useSelect(\n reactive({\n ...toRefs(props),\n modelValue,\n }),\n emit\n )\n const { calculatorRef, inputStyle } = useCalcInputWidth()\n const contentId = useId()\n\n provide(selectV2InjectionKey, {\n props: reactive({\n ...toRefs(props),\n height: API.popupHeight,\n modelValue,\n }),\n expanded: API.expanded,\n tooltipRef: API.tooltipRef,\n contentId,\n onSelect: API.onSelect,\n onHover: API.onHover,\n onKeyboardNavigate: API.onKeyboardNavigate,\n onKeyboardSelect: API.onKeyboardSelect,\n })\n\n const selectedLabel = computed(() => {\n if (!props.multiple) {\n return API.states.selectedLabel\n }\n return API.states.cachedOptions.map((i) => API.getLabel(i) as string)\n })\n\n return {\n ...API,\n modelValue,\n selectedLabel,\n calculatorRef,\n inputStyle,\n contentId,\n BORDER_HORIZONTAL_WIDTH,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;qCACE,mBAiUM,OAAA;EAhUJ,KAAI;EAEH,OAAK,eAAA,CAAG,KAAA,SAAS,GAAC,EAAI,KAAA,SAAS,EAAE,KAAA,WAAU,CAAA,CAAA;EAC3C,cAAU,OAAA,QAAA,OAAA,OAAA,WAAE,KAAA,OAAO,gBAAa;EAChC,cAAU,OAAA,QAAA,OAAA,OAAA,WAAE,KAAA,OAAO,gBAAa;KAEjC,YAyTa,uBAAA;EAxTX,KAAI;EACH,SAAS,KAAA;EACT,YA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