@element-plus/nightly 0.0.20260415 → 0.0.20260417
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 +2 -2
- package/es/components/alert/src/alert.d.ts +1 -1
- 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/avatar/src/avatar.vue.d.ts +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +2 -2
- 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/card/src/card.d.ts +1 -1
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +1 -1
- package/es/components/cascader/src/cascader.d.ts +4 -4
- package/es/components/cascader/src/cascader.vue.d.ts +13 -13
- package/es/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/es/components/check-tag/src/check-tag.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +3 -3
- package/es/components/checkbox/src/checkbox-group.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
- package/es/components/checkbox/src/checkbox.d.ts +9 -9
- package/es/components/checkbox/src/checkbox.vue.d.ts +3 -3
- package/es/components/checkbox/src/composables/use-checkbox-status.d.ts +2 -2
- package/es/components/checkbox/src/composables/use-checkbox.d.ts +2 -2
- package/es/components/col/src/col.vue.d.ts +1 -1
- package/es/components/collapse/src/collapse.d.ts +1 -1
- package/es/components/color-picker/src/color-picker.d.ts +1 -1
- package/es/components/color-picker/src/color-picker.vue.d.ts +7 -7
- package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/es/components/config-provider/src/config-provider-props.d.ts +1 -1
- package/es/components/config-provider/src/config-provider.d.ts +3 -3
- package/es/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +13 -13
- package/es/components/date-picker/src/props.d.ts +2 -2
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +4 -4
- package/es/components/descriptions/src/description-item.d.ts +19 -19
- package/es/components/descriptions/src/description.d.ts +1 -1
- package/es/components/descriptions/src/description.vue.d.ts +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +3 -3
- package/es/components/divider/src/divider.d.ts +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +6 -6
- 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 +3 -3
- package/es/components/dropdown/src/dropdown.vue.d.ts +54 -54
- package/es/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/es/components/form/src/form-item.d.ts +3 -3
- package/es/components/form/src/form-item.vue.d.ts +2 -2
- package/es/components/form/src/form.d.ts +4 -4
- package/es/components/form/src/form.vue.d.ts +1 -1
- package/es/components/form/src/hooks/use-form-common-props.d.ts +2 -2
- package/es/components/image/src/image.d.ts +1 -1
- package/es/components/image/src/image.vue.d.ts +3 -3
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +2 -2
- 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 +19 -19
- package/es/components/input-number/src/input-number.d.ts +4 -4
- package/es/components/input-number/src/input-number.vue.d.ts +8 -8
- package/es/components/input-otp/src/input-otp.vue.d.ts +5 -5
- package/es/components/input-tag/src/composables/use-input-tag.d.ts +1 -1
- package/es/components/input-tag/src/input-tag.d.ts +3 -3
- package/es/components/input-tag/src/input-tag.vue.d.ts +13 -13
- package/es/components/link/src/link.d.ts +2 -2
- package/es/components/mention/src/mention.d.ts +3 -3
- package/es/components/mention/src/mention.vue.d.ts +5 -5
- package/es/components/menu/src/menu-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 +2 -2
- 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/pagination/src/pagination.d.ts +7 -7
- 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 +6 -6
- package/es/components/popper/src/composables/use-content.d.ts +4 -4
- 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 +7 -7
- package/es/components/popper/src/popper.d.ts +2 -2
- package/es/components/progress/src/progress.vue.d.ts +1 -1
- package/es/components/radio/src/radio-button.d.ts +4 -4
- package/es/components/radio/src/radio-button.vue.d.ts +2 -2
- package/es/components/radio/src/radio-group.d.ts +1 -1
- package/es/components/radio/src/radio-group.vue.d.ts +4 -4
- package/es/components/radio/src/radio.d.ts +8 -8
- package/es/components/radio/src/radio.vue.d.ts +2 -2
- package/es/components/rate/src/rate.d.ts +1 -1
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
- package/es/components/row/src/row.d.ts +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/es/components/segmented/index.d.ts +2 -2
- package/es/components/segmented/src/segmented.d.ts +2 -2
- 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 +71 -69
- 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 +64 -56
- 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 +2 -2
- package/es/components/slider/src/slider.d.ts +2 -2
- package/es/components/slider/src/slider.vue.d.ts +11 -11
- package/es/components/space/src/space.d.ts +4 -4
- package/es/components/steps/src/item.d.ts +1 -1
- package/es/components/steps/src/steps.d.ts +2 -2
- package/es/components/steps/src/steps.vue.d.ts +1 -1
- package/es/components/switch/src/switch.d.ts +1 -1
- package/es/components/switch/src/switch.vue.d.ts +4 -4
- package/es/components/table/src/table-column/index.d.ts +14 -14
- package/es/components/table/src/table-header/index.d.ts +9 -9
- package/es/components/table/src/table.vue.d.ts +41 -41
- package/es/components/table-v2/src/components/row.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +3 -3
- package/es/components/table-v2/src/table-v2.d.ts +4 -4
- package/es/components/tabs/src/tab-nav.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +6 -6
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/tag/src/tag.vue.d.ts +1 -1
- package/es/components/text/src/text.d.ts +2 -2
- package/es/components/text/src/text.vue.d.ts +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +19 -19
- package/es/components/time-picker/src/common/props.d.ts +2 -2
- package/es/components/time-picker/src/time-picker.d.ts +13 -13
- package/es/components/time-select/src/time-select.d.ts +1 -1
- package/es/components/time-select/src/time-select.vue.d.ts +10 -10
- package/es/components/timeline/src/timeline-item.d.ts +2 -2
- package/es/components/timeline/src/timeline-item.vue.d.ts +2 -2
- package/es/components/tooltip/src/content.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +2 -2
- package/es/components/tooltip/src/tooltip.d.ts +3 -3
- package/es/components/tooltip/src/tooltip.vue.d.ts +8 -8
- package/es/components/tooltip/src/trigger.d.ts +1 -1
- package/es/components/tour/src/content.d.ts +2 -2
- package/es/components/tour/src/step.d.ts +1 -1
- package/es/components/tour/src/tour.d.ts +1 -1
- package/es/components/tour/src/tour.vue.d.ts +3 -3
- package/es/components/tree/src/tree.vue.d.ts +18 -18
- package/es/components/tree-select/src/tree-select.vue.d.ts +42 -42
- package/es/components/tree-v2/src/tree.vue.d.ts +6 -6
- package/es/components/upload/src/upload-content.vue.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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-floating/index.d.ts +8 -8
- package/es/hooks/use-popper/index.d.ts +4 -4
- package/es/hooks/use-size/index.d.ts +3 -3
- package/es/index.d.ts +2 -2
- package/es/utils/vue/size.d.ts +1 -1
- package/es/utils/vue/vnode.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 +2 -2
- package/lib/components/alert/src/alert.d.ts +1 -1
- 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/avatar/src/avatar.vue.d.ts +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +2 -2
- 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/card/src/card.d.ts +1 -1
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +1 -1
- package/lib/components/cascader/src/cascader.d.ts +4 -4
- package/lib/components/cascader/src/cascader.vue.d.ts +13 -13
- package/lib/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/lib/components/check-tag/src/check-tag.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +3 -3
- package/lib/components/checkbox/src/checkbox-group.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
- package/lib/components/checkbox/src/checkbox.d.ts +9 -9
- package/lib/components/checkbox/src/checkbox.vue.d.ts +3 -3
- package/lib/components/checkbox/src/composables/use-checkbox-status.d.ts +2 -2
- package/lib/components/checkbox/src/composables/use-checkbox.d.ts +2 -2
- package/lib/components/col/src/col.vue.d.ts +1 -1
- package/lib/components/collapse/src/collapse.d.ts +1 -1
- package/lib/components/color-picker/src/color-picker.d.ts +1 -1
- package/lib/components/color-picker/src/color-picker.vue.d.ts +7 -7
- package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider-props.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider.d.ts +3 -3
- package/lib/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +13 -13
- package/lib/components/date-picker/src/props.d.ts +2 -2
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +4 -4
- package/lib/components/descriptions/src/description-item.d.ts +19 -19
- package/lib/components/descriptions/src/description.d.ts +1 -1
- package/lib/components/descriptions/src/description.vue.d.ts +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +3 -3
- package/lib/components/divider/src/divider.d.ts +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +6 -6
- 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 +3 -3
- package/lib/components/dropdown/src/dropdown.vue.d.ts +54 -54
- package/lib/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/lib/components/form/src/form-item.d.ts +3 -3
- package/lib/components/form/src/form-item.vue.d.ts +2 -2
- package/lib/components/form/src/form.d.ts +4 -4
- package/lib/components/form/src/form.vue.d.ts +1 -1
- package/lib/components/form/src/hooks/use-form-common-props.d.ts +2 -2
- package/lib/components/image/src/image.d.ts +1 -1
- package/lib/components/image/src/image.vue.d.ts +3 -3
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +2 -2
- 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 +19 -19
- package/lib/components/input-number/src/input-number.d.ts +4 -4
- package/lib/components/input-number/src/input-number.vue.d.ts +8 -8
- package/lib/components/input-otp/src/input-otp.vue.d.ts +5 -5
- package/lib/components/input-tag/src/composables/use-input-tag.d.ts +1 -1
- package/lib/components/input-tag/src/input-tag.d.ts +3 -3
- package/lib/components/input-tag/src/input-tag.vue.d.ts +13 -13
- package/lib/components/link/src/link.d.ts +2 -2
- package/lib/components/mention/src/mention.d.ts +3 -3
- package/lib/components/mention/src/mention.vue.d.ts +5 -5
- package/lib/components/menu/src/menu-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 +2 -2
- 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/pagination/src/pagination.d.ts +7 -7
- 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 +6 -6
- package/lib/components/popper/src/composables/use-content.d.ts +4 -4
- 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 +7 -7
- package/lib/components/popper/src/popper.d.ts +2 -2
- package/lib/components/progress/src/progress.vue.d.ts +1 -1
- package/lib/components/radio/src/radio-button.d.ts +4 -4
- package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
- package/lib/components/radio/src/radio-group.d.ts +1 -1
- package/lib/components/radio/src/radio-group.vue.d.ts +4 -4
- package/lib/components/radio/src/radio.d.ts +8 -8
- package/lib/components/radio/src/radio.vue.d.ts +2 -2
- package/lib/components/rate/src/rate.d.ts +1 -1
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.vue.d.ts +1 -1
- package/lib/components/row/src/row.d.ts +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +2 -2
- package/lib/components/segmented/src/segmented.d.ts +2 -2
- 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 +71 -69
- 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 +64 -56
- 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 +2 -2
- package/lib/components/slider/src/slider.d.ts +2 -2
- package/lib/components/slider/src/slider.vue.d.ts +11 -11
- package/lib/components/space/src/space.d.ts +4 -4
- package/lib/components/steps/src/item.d.ts +1 -1
- package/lib/components/steps/src/steps.d.ts +2 -2
- package/lib/components/steps/src/steps.vue.d.ts +1 -1
- package/lib/components/switch/src/switch.d.ts +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +4 -4
- package/lib/components/table/src/table-column/index.d.ts +14 -14
- package/lib/components/table/src/table-header/index.d.ts +9 -9
- package/lib/components/table/src/table.vue.d.ts +41 -41
- package/lib/components/table-v2/src/components/row.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +3 -3
- package/lib/components/table-v2/src/table-v2.d.ts +4 -4
- package/lib/components/tabs/src/tab-nav.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +6 -6
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/tag/src/tag.vue.d.ts +1 -1
- package/lib/components/text/src/text.d.ts +2 -2
- package/lib/components/text/src/text.vue.d.ts +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +19 -19
- package/lib/components/time-picker/src/common/props.d.ts +2 -2
- package/lib/components/time-picker/src/time-picker.d.ts +13 -13
- package/lib/components/time-select/src/time-select.d.ts +1 -1
- package/lib/components/time-select/src/time-select.vue.d.ts +10 -10
- package/lib/components/timeline/src/timeline-item.d.ts +2 -2
- package/lib/components/timeline/src/timeline-item.vue.d.ts +2 -2
- package/lib/components/tooltip/src/content.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +2 -2
- package/lib/components/tooltip/src/tooltip.d.ts +3 -3
- package/lib/components/tooltip/src/tooltip.vue.d.ts +8 -8
- package/lib/components/tooltip/src/trigger.d.ts +1 -1
- package/lib/components/tour/src/content.d.ts +2 -2
- package/lib/components/tour/src/step.d.ts +1 -1
- package/lib/components/tour/src/tour.d.ts +1 -1
- package/lib/components/tour/src/tour.vue.d.ts +3 -3
- package/lib/components/tree/src/tree.vue.d.ts +18 -18
- package/lib/components/tree-select/src/tree-select.vue.d.ts +42 -42
- package/lib/components/tree-v2/src/tree.vue.d.ts +6 -6
- package/lib/components/upload/src/upload-content.vue.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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-floating/index.d.ts +8 -8
- package/lib/hooks/use-popper/index.d.ts +4 -4
- package/lib/hooks/use-size/index.d.ts +3 -3
- package/lib/index.d.ts +2 -2
- package/lib/utils/vue/size.d.ts +1 -1
- package/lib/utils/vue/vnode.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":"select2.mjs","names":[],"sources":["../../../../../../packages/components/select/src/select.vue"],"sourcesContent":["<template>\n <div\n ref=\"selectRef\"\n v-click-outside:[popperRef]=\"handleClickOutside\"\n :class=\"[nsSelect.b(), nsSelect.m(selectSize)]\"\n @[mouseEnterEventName]=\"states.inputHovering = true\"\n @mouseleave=\"states.inputHovering = false\"\n >\n <el-tooltip\n ref=\"tooltipRef\"\n :visible=\"dropdownMenuVisible\"\n :placement=\"placement\"\n :teleported=\"teleported\"\n :popper-class=\"[nsSelect.e('popper'), popperClass]\"\n :popper-style=\"popperStyle\"\n :popper-options=\"popperOptions\"\n :fallback-placements=\"fallbackPlacements\"\n :effect=\"effect\"\n pure\n trigger=\"click\"\n :transition=\"`${nsSelect.namespace.value}-zoom-in-top`\"\n :stop-popper-mouse-event=\"false\"\n :gpu-acceleration=\"false\"\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 && !!states.selected.length\n ),\n ]\"\n >\n <slot\n v-if=\"multiple\"\n name=\"tag\"\n :data=\"states.selected\"\n :delete-tag=\"deleteTag\"\n :select-disabled=\"selectDisabled\"\n >\n <div\n v-for=\"item in showTagList\"\n :key=\"getValueKey(item)\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n :closable=\"!selectDisabled && !item.isDisabled\"\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=\"item.index\"\n :label=\"item.currentLabel\"\n :value=\"item.value\"\n >\n {{ item.currentLabel }}\n </slot>\n </span>\n </el-tag>\n </div>\n\n <el-tooltip\n v-if=\"collapseTags && states.selected.length > maxCollapseTags\"\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 disable-transitions\n :style=\"collapseTagStyle\"\n >\n <span :class=\"nsSelect.e('tags-text')\">\n + {{ states.selected.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=\"item in collapseTagList\"\n :key=\"getValueKey(item)\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n class=\"in-tooltip\"\n :closable=\"!selectDisabled && !item.isDisabled\"\n :size=\"collapseTagSize\"\n :type=\"tagType\"\n :effect=\"tagEffect\"\n disable-transitions\n @close=\"deleteTag($event, item)\"\n >\n <span :class=\"nsSelect.e('tags-text')\">\n <slot\n name=\"label\"\n :index=\"item.index\"\n :label=\"item.currentLabel\"\n :value=\"item.value\"\n >\n {{ item.currentLabel }}\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 type=\"text\"\n :name=\"name\"\n :class=\"[nsSelect.e('input'), nsSelect.is(selectSize)]\"\n :disabled=\"selectDisabled\"\n :autocomplete=\"autocomplete\"\n :style=\"inputStyle\"\n :tabindex=\"tabindex\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n :aria-activedescendant=\"hoverOption?.id || ''\"\n :aria-controls=\"contentId\"\n :aria-expanded=\"dropdownMenuVisible\"\n :aria-label=\"ariaLabel\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n @keydown=\"handleKeydown\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"onInput\"\n @change.stop\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=\"getOption(modelValue!).index\"\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 && !showClearBtn\"\n :class=\"[nsSelect.e('caret'), nsSelect.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 nsSelect.e('icon'),\n nsSelect.e('clear'),\n ]\"\n @click=\"handleClearClick\"\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 ref=\"menuRef\">\n <div\n v-if=\"$slots.header\"\n :class=\"nsSelect.be('dropdown', 'header')\"\n @click.stop\n >\n <slot name=\"header\" />\n </div>\n <el-scrollbar\n v-show=\"states.options.size > 0 && !loading\"\n :id=\"contentId\"\n ref=\"scrollbarRef\"\n tag=\"ul\"\n :wrap-class=\"nsSelect.be('dropdown', 'wrap')\"\n :view-class=\"nsSelect.be('dropdown', 'list')\"\n :class=\"[nsSelect.is('empty', filteredOptionsCount === 0)]\"\n role=\"listbox\"\n :aria-label=\"ariaLabel\"\n aria-orientation=\"vertical\"\n @scroll=\"popupScroll\"\n >\n <el-option\n v-if=\"showNewOption\"\n :value=\"states.inputValue\"\n :created=\"true\"\n />\n <el-options>\n <slot>\n <template v-for=\"(option, index) in options\" :key=\"index\">\n <el-option-group\n v-if=\"getOptions(option)?.length\"\n :label=\"getLabel(option)\"\n :disabled=\"getDisabled(option)\"\n >\n <el-option\n v-for=\"item in getOptions(option)\"\n :key=\"getValue(item)\"\n v-bind=\"getOptionProps(item)\"\n />\n </el-option-group>\n <el-option v-else v-bind=\"getOptionProps(option)\" />\n </template>\n </slot>\n </el-options>\n </el-scrollbar>\n <div\n v-if=\"$slots.loading && loading\"\n :class=\"nsSelect.be('dropdown', 'loading')\"\n >\n <slot name=\"loading\" />\n </div>\n <div\n v-else-if=\"loading || filteredOptionsCount === 0\"\n :class=\"nsSelect.be('dropdown', 'empty')\"\n >\n <slot name=\"empty\">\n <span>{{ emptyText }}</span>\n </slot>\n </div>\n <div\n v-if=\"$slots.footer\"\n :class=\"nsSelect.be('dropdown', 'footer')\"\n @click.stop\n >\n <slot name=\"footer\" />\n </div>\n </el-select-menu>\n </template>\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n onBeforeUnmount,\n provide,\n reactive,\n toRefs,\n watch,\n} from 'vue'\nimport { ClickOutside } from '@element-plus/directives'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport ElTag from '@element-plus/components/tag'\nimport ElIcon from '@element-plus/components/icon'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { flattedChildren, isArray, isObject } from '@element-plus/utils'\nimport { useCalcInputWidth } from '@element-plus/hooks'\nimport { useProps } from '@element-plus/components/select-v2/src/useProps'\nimport ElOption from './option.vue'\nimport ElSelectMenu from './select-dropdown.vue'\nimport { useSelect } from './useSelect'\nimport { selectKey } from './token'\nimport ElOptions from './options'\nimport { selectProps } from './select'\nimport ElOptionGroup from './option-group.vue'\n\nimport type { AppConfig, AppContext, VNode } from 'vue'\nimport type { SelectContext } from './type'\n\nconst COMPONENT_NAME = 'ElSelect'\n\ntype WarnHandler = AppConfig['warnHandler']\n\ninterface WarnHandlerRecord {\n originalWarnHandler: WarnHandler\n handler: WarnHandler\n count: number\n}\n\nconst warnHandlerMap = new WeakMap<AppContext, WarnHandlerRecord>()\n\nconst createSelectWarnHandler = (appContext: AppContext): WarnHandler => {\n return (...args) => {\n // Overrides warnings about slots not being executable outside of a render function.\n // We call slot below just to simulate data when persist is false, this warning message should be ignored\n const message = args[0]\n if (\n !message ||\n (message.includes(\n 'Slot \"default\" invoked outside of the render function'\n ) &&\n args[2]?.includes('ElTreeSelect'))\n )\n return\n const original = warnHandlerMap.get(appContext)?.originalWarnHandler\n if (original) {\n original(...args)\n return\n }\n // eslint-disable-next-line no-console\n console.warn(...args)\n }\n}\n\nconst getWarnHandlerRecord = (appContext: AppContext): WarnHandlerRecord => {\n let record = warnHandlerMap.get(appContext)\n if (!record) {\n record = {\n originalWarnHandler: appContext.config.warnHandler,\n handler: createSelectWarnHandler(appContext),\n count: 0,\n }\n warnHandlerMap.set(appContext, record)\n }\n return record\n}\nexport default defineComponent({\n name: COMPONENT_NAME,\n componentName: COMPONENT_NAME,\n components: {\n ElSelectMenu,\n ElOption,\n ElOptions,\n ElOptionGroup,\n ElTag,\n ElScrollbar,\n ElTooltip,\n ElIcon,\n },\n directives: { ClickOutside },\n props: selectProps,\n emits: [\n UPDATE_MODEL_EVENT,\n CHANGE_EVENT,\n 'remove-tag',\n 'clear',\n 'visible-change',\n 'focus',\n 'blur',\n 'popup-scroll',\n ],\n\n setup(props, { emit, slots }) {\n const instance = getCurrentInstance()!\n const warnRecord = getWarnHandlerRecord(instance.appContext)\n warnRecord.count += 1\n instance.appContext.config.warnHandler = warnRecord.handler\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\n return multiple ? fallback : rawModelValue\n })\n\n const _props = reactive({\n ...toRefs(props),\n modelValue,\n })\n\n const API = useSelect(_props, emit)\n const { calculatorRef, inputStyle } = useCalcInputWidth()\n const { getLabel, getValue, getOptions, getDisabled } = useProps(props)\n\n const getOptionProps = (option: Record<string, any>) => ({\n label: getLabel(option),\n value: getValue(option),\n disabled: getDisabled(option),\n })\n\n const flatTreeSelectData = (data: any[]) => {\n return data.reduce((acc, item) => {\n acc.push(item)\n if (item.children && item.children.length > 0) {\n acc.push(...flatTreeSelectData(item.children))\n }\n return acc\n }, [])\n }\n\n const manuallyRenderSlots = (vnodes: VNode[] | undefined) => {\n // After option rendering is completed, the useSelect internal state can collect the value of each option.\n // If the persistent value is false, option will not be rendered by default, so in this case,\n // manually render and load option data here.\n const children = flattedChildren(vnodes || []) as VNode[]\n children.forEach((item) => {\n if (\n isObject(item) &&\n // @ts-expect-error\n (item.type.name === 'ElOption' || item.type.name === 'ElTree')\n ) {\n // @ts-expect-error\n const _name = item.type.name\n if (_name === 'ElTree') {\n // tree-select component is a special case.\n // So we need to handle it separately.\n const treeData = item.props?.data || []\n const flatData = flatTreeSelectData(treeData)\n flatData.forEach((treeItem: any) => {\n treeItem.currentLabel =\n treeItem.label ??\n (isObject(treeItem.value) ? '' : treeItem.value)\n API.onOptionCreate(treeItem)\n })\n } else if (_name === 'ElOption') {\n const obj = { ...item.props } as any\n obj.currentLabel =\n obj.label ?? (isObject(obj.value) ? '' : obj.value)\n API.onOptionCreate(obj)\n }\n }\n })\n }\n watch(\n () => [\n props.persistent || API.expanded.value || !slots.default\n ? undefined\n : slots.default?.(),\n modelValue.value,\n ],\n () => {\n // When persistent is false and the dropdown is closed, the menu is unmounted.\n // We should always re-hydrate option data from slots so labels stay in sync\n // with dynamic option list updates. Skip only when persistent is true or\n // when the dropdown is currently expanded (mounted options will manage themselves).\n if (props.persistent || API.expanded.value) {\n // If persistent is true, we don't need to manually render slots.\n return\n }\n // When using :options prop (no slot content), el-option components register\n // and unregister themselves via onOptionCreate/onOptionDestroy lifecycle hooks.\n // Calling options.clear() here would prematurely wipe options that are still\n // mounted, causing a \"No Data\" flash during rapid open/close toggling.\n if (!slots.default) {\n return\n }\n // Reset current options snapshot before re-collecting from slots.\n API.states.options.clear()\n manuallyRenderSlots(slots.default?.())\n },\n {\n immediate: true,\n }\n )\n\n provide(\n selectKey,\n reactive({\n props: _props,\n states: API.states,\n selectRef: API.selectRef,\n optionsArray: API.optionsArray,\n setSelected: API.setSelected,\n handleOptionSelect: API.handleOptionSelect,\n onOptionCreate: API.onOptionCreate,\n onOptionDestroy: API.onOptionDestroy,\n }) satisfies SelectContext\n )\n\n const selectedLabel = computed(() => {\n if (!props.multiple) {\n return API.states.selectedLabel\n }\n return API.states.selected.map((i) => i.currentLabel as string)\n })\n\n onBeforeUnmount(() => {\n // https://github.com/element-plus/element-plus/issues/21279\n const record = warnHandlerMap.get(instance.appContext)\n if (!record) return\n record.count -= 1\n if (record.count <= 0) {\n instance.appContext.config.warnHandler = record.originalWarnHandler\n warnHandlerMap.delete(instance.appContext)\n }\n })\n\n return {\n ...API,\n modelValue,\n selectedLabel,\n calculatorRef,\n inputStyle,\n getLabel,\n getValue,\n getOptions,\n getDisabled,\n getOptionProps,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCACE,mBAoVM,OApVN,WAoVM;EAnVJ,KAAI;EAEH,OAAK,CAAG,KAAA,SAAS,GAAC,EAAI,KAAA,SAAS,EAAE,KAAA,WAAU,CAAA;oBAC3C,KAAA,oBA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select2.mjs","names":[],"sources":["../../../../../../packages/components/select/src/select.vue"],"sourcesContent":["<template>\n <div\n ref=\"selectRef\"\n v-click-outside:[popperRef]=\"handleClickOutside\"\n :class=\"[nsSelect.b(), nsSelect.m(selectSize)]\"\n @[mouseEnterEventName]=\"states.inputHovering = true\"\n @mouseleave=\"states.inputHovering = false\"\n >\n <el-tooltip\n ref=\"tooltipRef\"\n :visible=\"dropdownMenuVisible\"\n :placement=\"placement\"\n :teleported=\"teleported\"\n :popper-class=\"[nsSelect.e('popper'), popperClass]\"\n :popper-style=\"popperStyle\"\n :popper-options=\"popperOptions\"\n :fallback-placements=\"fallbackPlacements\"\n :effect=\"effect\"\n pure\n trigger=\"click\"\n :transition=\"`${nsSelect.namespace.value}-zoom-in-top`\"\n :stop-popper-mouse-event=\"false\"\n :gpu-acceleration=\"false\"\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 && !!states.selected.length\n ),\n ]\"\n >\n <slot\n v-if=\"multiple\"\n name=\"tag\"\n :data=\"states.selected\"\n :delete-tag=\"deleteTag\"\n :select-disabled=\"selectDisabled\"\n >\n <div\n v-for=\"item in showTagList\"\n :key=\"getValueKey(item)\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n :closable=\"!selectDisabled && !item.isDisabled\"\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=\"item.index\"\n :label=\"item.currentLabel\"\n :value=\"item.value\"\n >\n {{ item.currentLabel }}\n </slot>\n </span>\n </el-tag>\n </div>\n\n <el-tooltip\n v-if=\"collapseTags && states.selected.length > maxCollapseTags\"\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 disable-transitions\n :style=\"collapseTagStyle\"\n >\n <span :class=\"nsSelect.e('tags-text')\">\n + {{ states.selected.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=\"item in collapseTagList\"\n :key=\"getValueKey(item)\"\n :class=\"nsSelect.e('selected-item')\"\n >\n <el-tag\n class=\"in-tooltip\"\n :closable=\"!selectDisabled && !item.isDisabled\"\n :size=\"collapseTagSize\"\n :type=\"tagType\"\n :effect=\"tagEffect\"\n disable-transitions\n @close=\"deleteTag($event, item)\"\n >\n <span :class=\"nsSelect.e('tags-text')\">\n <slot\n name=\"label\"\n :index=\"item.index\"\n :label=\"item.currentLabel\"\n :value=\"item.value\"\n >\n {{ item.currentLabel }}\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 type=\"text\"\n :name=\"name\"\n :class=\"[nsSelect.e('input'), nsSelect.is(selectSize)]\"\n :disabled=\"selectDisabled\"\n :autocomplete=\"autocomplete\"\n :style=\"inputStyle\"\n :tabindex=\"tabindex\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n :aria-activedescendant=\"hoverOption?.id || ''\"\n :aria-controls=\"contentId\"\n :aria-expanded=\"dropdownMenuVisible\"\n :aria-label=\"ariaLabel\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"listbox\"\n @keydown=\"handleKeydown\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"onInput\"\n @change.stop\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=\"getOption(modelValue!).index\"\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 && !showClearBtn\"\n :class=\"[nsSelect.e('caret'), nsSelect.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 nsSelect.e('icon'),\n nsSelect.e('clear'),\n ]\"\n @click=\"handleClearClick\"\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 ref=\"menuRef\">\n <div\n v-if=\"$slots.header\"\n :class=\"nsSelect.be('dropdown', 'header')\"\n @click.stop\n >\n <slot name=\"header\" />\n </div>\n <el-scrollbar\n v-show=\"states.options.size > 0 && !loading\"\n :id=\"contentId\"\n ref=\"scrollbarRef\"\n tag=\"ul\"\n :wrap-class=\"nsSelect.be('dropdown', 'wrap')\"\n :view-class=\"nsSelect.be('dropdown', 'list')\"\n :class=\"[nsSelect.is('empty', filteredOptionsCount === 0)]\"\n role=\"listbox\"\n :aria-label=\"ariaLabel\"\n aria-orientation=\"vertical\"\n @scroll=\"popupScroll\"\n @end-reached=\"endReached\"\n >\n <el-option\n v-if=\"showNewOption\"\n :value=\"states.inputValue\"\n :created=\"true\"\n />\n <el-options>\n <slot>\n <template v-for=\"(option, index) in options\" :key=\"index\">\n <el-option-group\n v-if=\"getOptions(option)?.length\"\n :label=\"getLabel(option)\"\n :disabled=\"getDisabled(option)\"\n >\n <el-option\n v-for=\"item in getOptions(option)\"\n :key=\"getValue(item)\"\n v-bind=\"getOptionProps(item)\"\n />\n </el-option-group>\n <el-option v-else v-bind=\"getOptionProps(option)\" />\n </template>\n </slot>\n </el-options>\n </el-scrollbar>\n <div\n v-if=\"$slots.loading && loading\"\n :class=\"nsSelect.be('dropdown', 'loading')\"\n >\n <slot name=\"loading\" />\n </div>\n <div\n v-else-if=\"loading || filteredOptionsCount === 0\"\n :class=\"nsSelect.be('dropdown', 'empty')\"\n >\n <slot name=\"empty\">\n <span>{{ emptyText }}</span>\n </slot>\n </div>\n <div\n v-if=\"$slots.footer\"\n :class=\"nsSelect.be('dropdown', 'footer')\"\n @click.stop\n >\n <slot name=\"footer\" />\n </div>\n </el-select-menu>\n </template>\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n onBeforeUnmount,\n provide,\n reactive,\n toRefs,\n watch,\n} from 'vue'\nimport { ClickOutside } from '@element-plus/directives'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport ElTag from '@element-plus/components/tag'\nimport ElIcon from '@element-plus/components/icon'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { flattedChildren, isArray, isObject } from '@element-plus/utils'\nimport { useCalcInputWidth } from '@element-plus/hooks'\nimport { useProps } from '@element-plus/components/select-v2/src/useProps'\nimport ElOption from './option.vue'\nimport ElSelectMenu from './select-dropdown.vue'\nimport { useSelect } from './useSelect'\nimport { selectKey } from './token'\nimport ElOptions from './options'\nimport { selectProps } from './select'\nimport ElOptionGroup from './option-group.vue'\n\nimport type { AppConfig, AppContext, VNode } from 'vue'\nimport type { SelectContext } from './type'\n\nconst COMPONENT_NAME = 'ElSelect'\n\ntype WarnHandler = AppConfig['warnHandler']\n\ninterface WarnHandlerRecord {\n originalWarnHandler: WarnHandler\n handler: WarnHandler\n count: number\n}\n\nconst warnHandlerMap = new WeakMap<AppContext, WarnHandlerRecord>()\n\nconst createSelectWarnHandler = (appContext: AppContext): WarnHandler => {\n return (...args) => {\n // Overrides warnings about slots not being executable outside of a render function.\n // We call slot below just to simulate data when persist is false, this warning message should be ignored\n const message = args[0]\n if (\n !message ||\n (message.includes(\n 'Slot \"default\" invoked outside of the render function'\n ) &&\n args[2]?.includes('ElTreeSelect'))\n )\n return\n const original = warnHandlerMap.get(appContext)?.originalWarnHandler\n if (original) {\n original(...args)\n return\n }\n // eslint-disable-next-line no-console\n console.warn(...args)\n }\n}\n\nconst getWarnHandlerRecord = (appContext: AppContext): WarnHandlerRecord => {\n let record = warnHandlerMap.get(appContext)\n if (!record) {\n record = {\n originalWarnHandler: appContext.config.warnHandler,\n handler: createSelectWarnHandler(appContext),\n count: 0,\n }\n warnHandlerMap.set(appContext, record)\n }\n return record\n}\nexport default defineComponent({\n name: COMPONENT_NAME,\n componentName: COMPONENT_NAME,\n components: {\n ElSelectMenu,\n ElOption,\n ElOptions,\n ElOptionGroup,\n ElTag,\n ElScrollbar,\n ElTooltip,\n ElIcon,\n },\n directives: { ClickOutside },\n props: selectProps,\n emits: [\n UPDATE_MODEL_EVENT,\n CHANGE_EVENT,\n 'remove-tag',\n 'clear',\n 'visible-change',\n 'focus',\n 'blur',\n 'popup-scroll',\n 'end-reached',\n ],\n\n setup(props, { emit, slots }) {\n const instance = getCurrentInstance()!\n const warnRecord = getWarnHandlerRecord(instance.appContext)\n warnRecord.count += 1\n instance.appContext.config.warnHandler = warnRecord.handler\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\n return multiple ? fallback : rawModelValue\n })\n\n const _props = reactive({\n ...toRefs(props),\n modelValue,\n })\n\n const API = useSelect(_props, emit)\n const { calculatorRef, inputStyle } = useCalcInputWidth()\n const { getLabel, getValue, getOptions, getDisabled } = useProps(props)\n\n const getOptionProps = (option: Record<string, any>) => ({\n label: getLabel(option),\n value: getValue(option),\n disabled: getDisabled(option),\n })\n\n const flatTreeSelectData = (data: any[]) => {\n return data.reduce((acc, item) => {\n acc.push(item)\n if (item.children && item.children.length > 0) {\n acc.push(...flatTreeSelectData(item.children))\n }\n return acc\n }, [])\n }\n\n const manuallyRenderSlots = (vnodes: VNode[] | undefined) => {\n // After option rendering is completed, the useSelect internal state can collect the value of each option.\n // If the persistent value is false, option will not be rendered by default, so in this case,\n // manually render and load option data here.\n const children = flattedChildren(vnodes || []) as VNode[]\n children.forEach((item) => {\n if (\n isObject(item) &&\n // @ts-expect-error\n (item.type.name === 'ElOption' || item.type.name === 'ElTree')\n ) {\n // @ts-expect-error\n const _name = item.type.name\n if (_name === 'ElTree') {\n // tree-select component is a special case.\n // So we need to handle it separately.\n const treeData = item.props?.data || []\n const flatData = flatTreeSelectData(treeData)\n flatData.forEach((treeItem: any) => {\n treeItem.currentLabel =\n treeItem.label ??\n (isObject(treeItem.value) ? '' : treeItem.value)\n API.onOptionCreate(treeItem)\n })\n } else if (_name === 'ElOption') {\n const obj = { ...item.props } as any\n obj.currentLabel =\n obj.label ?? (isObject(obj.value) ? '' : obj.value)\n API.onOptionCreate(obj)\n }\n }\n })\n }\n watch(\n () => [\n props.persistent || API.expanded.value || !slots.default\n ? undefined\n : slots.default?.(),\n modelValue.value,\n ],\n () => {\n // When persistent is false and the dropdown is closed, the menu is unmounted.\n // We should always re-hydrate option data from slots so labels stay in sync\n // with dynamic option list updates. Skip only when persistent is true or\n // when the dropdown is currently expanded (mounted options will manage themselves).\n if (props.persistent || API.expanded.value) {\n // If persistent is true, we don't need to manually render slots.\n return\n }\n // When using :options prop (no slot content), el-option components register\n // and unregister themselves via onOptionCreate/onOptionDestroy lifecycle hooks.\n // Calling options.clear() here would prematurely wipe options that are still\n // mounted, causing a \"No Data\" flash during rapid open/close toggling.\n if (!slots.default) {\n return\n }\n // Reset current options snapshot before re-collecting from slots.\n API.states.options.clear()\n manuallyRenderSlots(slots.default?.())\n },\n {\n immediate: true,\n }\n )\n\n provide(\n selectKey,\n reactive({\n props: _props,\n states: API.states,\n selectRef: API.selectRef,\n optionsArray: API.optionsArray,\n setSelected: API.setSelected,\n handleOptionSelect: API.handleOptionSelect,\n onOptionCreate: API.onOptionCreate,\n onOptionDestroy: API.onOptionDestroy,\n }) satisfies SelectContext\n )\n\n const selectedLabel = computed(() => {\n if (!props.multiple) {\n return API.states.selectedLabel\n }\n return API.states.selected.map((i) => i.currentLabel as string)\n })\n\n onBeforeUnmount(() => {\n // https://github.com/element-plus/element-plus/issues/21279\n const record = warnHandlerMap.get(instance.appContext)\n if (!record) return\n record.count -= 1\n if (record.count <= 0) {\n instance.appContext.config.warnHandler = record.originalWarnHandler\n warnHandlerMap.delete(instance.appContext)\n }\n })\n\n return {\n ...API,\n modelValue,\n selectedLabel,\n calculatorRef,\n inputStyle,\n getLabel,\n getValue,\n getOptions,\n getDisabled,\n getOptionProps,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCACE,mBAqVM,OArVN,WAqVM;EApVJ,KAAI;EAEH,OAAK,CAAG,KAAA,SAAS,GAAC,EAAI,KAAA,SAAS,EAAE,KAAA,WAAU,CAAA;oBAC3C,KAAA,oBAAqB,GAAA,OAAA,QAAA,OAAA,OAAA,WAAE,KAAA,OAAO,gBAAa,OAAA,EAAA,EAC3C,cAAU,OAAA,QAAA,OAAA,OAAA,WAAE,KAAA,OAAO,gBAAa,QAAA,CAAA,GAEjC,YA6Ua,uBAAA;EA5UX,KAAI;EACH,SAAS,KAAA;EACT,WAAW,KAAA;EACX,YAAY,KAAA;EACZ,gBAAY,CAAG,KAAA,SAAS,EAAC,SAAA,EAAY,KAAA,YAAW;EAChD,gBAAc,KAAA;EACd,kBAAgB,KAAA;EAChB,uBAAqB,KAAA;E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A,EAAA,MAAA,GAAA;;;wDAG/B,YAAoD,sBAApD,WAAoD;;;UAA1B,KAAA,eAAe,OAAM,CAAA,EAAA,MAAA,GAAA,EAAA;;;;;;;;;;;;;iBAhC7C,KAAA,OAAO,QAAQ,OAAI,KAAA,CAAS,KAAA,QAAO,CAAA,CAAA;IAsCrC,KAAA,OAAO,WAAW,KAAA,WAAA,WAAA,EAD1B,mBAKM,OAAA;;KAHH,OAAK,eAAE,KAAA,SAAS,GAAE,YAAA,UAAA,CAAA;QAEnB,WAAuB,KAAA,QAAA,UAAA,CAAA,QAGZ,KAAA,WAAW,KAAA,yBAAoB,KAAA,WAAA,EAD5C,mBAOM,OAAA;;KALH,OAAK,eAAE,KAAA,SAAS,GAAE,YAAA,QAAA,CAAA;QAEnB,WAEO,KAAA,QAAA,SAAA,EAAA,QAAA,CADL,mBAA4B,QAAA,MAAA,gBAAnB,KAAA,UAAS,EAAA,EAAA,CAAA,CAAA,CAAA;IAId,KAAA,OAAO,UAAA,WAAA,EADf,mBAMM,OAAA;;KAJH,OAAK,eAAE,KAAA,SAAS,GAAE,YAAA,SAAA,CAAA;KAClB,SAAK,OAAA,OAAA,OAAA,KAAA,oBAAN,IAAW,CAAA,OAAA,CAAA;QAEX,WAAsB,KAAA,QAAA,SAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;EA9UD,KAAA;EAAb,KAAA;EAAW,CAAA,CAAA"}
|
|
@@ -533,6 +533,9 @@ const useSelect = (props, emit) => {
|
|
|
533
533
|
const popupScroll = (data) => {
|
|
534
534
|
emit("popup-scroll", data);
|
|
535
535
|
};
|
|
536
|
+
const endReached = (direction) => {
|
|
537
|
+
emit("end-reached", direction);
|
|
538
|
+
};
|
|
536
539
|
useResizeObserver(selectionRef, resetSelectionWidth);
|
|
537
540
|
useResizeObserver(wrapperRef, updateTooltip);
|
|
538
541
|
useResizeObserver(tagMenuRef, updateTagTooltip);
|
|
@@ -607,6 +610,7 @@ const useSelect = (props, emit) => {
|
|
|
607
610
|
collapseTagList,
|
|
608
611
|
popupScroll,
|
|
609
612
|
getOption,
|
|
613
|
+
endReached,
|
|
610
614
|
tagStyle,
|
|
611
615
|
collapseTagStyle,
|
|
612
616
|
popperRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelect.mjs","names":["isUndefined","isClient","isPlainObject","clamp"],"sources":["../../../../../../packages/components/select/src/useSelect.ts"],"sourcesContent":["import {\n computed,\n nextTick,\n onMounted,\n reactive,\n ref,\n useSlots,\n watch,\n watchEffect,\n} from 'vue'\nimport { clamp, findLastIndex, get, isEqual, isNil } from 'lodash-unified'\nimport { useDebounceFn, useResizeObserver } from '@vueuse/core'\nimport {\n NOOP,\n ValidateComponentsMap,\n ensureArray,\n getEventCode,\n isArray,\n isClient,\n isEmpty,\n isFunction,\n isIOS,\n isNumber,\n isObject,\n isPlainObject,\n isUndefined,\n scrollIntoView,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n MINIMUM_INPUT_WIDTH,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport {\n useComposition,\n useEmptyValues,\n useFocusController,\n useId,\n useLocale,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\n\nimport type { Component } from 'vue'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\nimport type { ScrollbarInstance } from '@element-plus/components/scrollbar'\nimport type { SelectEmits, SelectProps } from './select'\nimport type {\n OptionBasic,\n OptionPublicInstance,\n OptionValue,\n SelectStates,\n} from './type'\n\nexport const useSelect = (props: SelectProps, emit: SelectEmits) => {\n const { t } = useLocale()\n const slots = useSlots()\n const contentId = useId()\n const nsSelect = useNamespace('select')\n const nsInput = useNamespace('input')\n\n const states = reactive<SelectStates>({\n inputValue: '',\n options: new Map(),\n cachedOptions: new Map(),\n optionValues: [], // sorted value of options\n selected: [],\n selectionWidth: 0,\n collapseItemWidth: 0,\n selectedLabel: '',\n hoveringIndex: -1,\n previousQuery: null,\n inputHovering: false,\n menuVisibleOnFocus: false,\n isBeforeHide: false,\n })\n\n // template refs\n const selectRef = ref<HTMLElement>()\n const selectionRef = ref<HTMLElement>()\n const tooltipRef = ref<TooltipInstance>()\n const tagTooltipRef = ref<TooltipInstance>()\n const inputRef = ref<HTMLInputElement>()\n const prefixRef = ref<HTMLElement>()\n const suffixRef = ref<HTMLElement>()\n const menuRef = ref<HTMLElement>()\n const tagMenuRef = ref<HTMLElement>()\n const collapseItemRef = ref<HTMLElement>()\n const scrollbarRef = ref<ScrollbarInstance>()\n // the controller of the expanded popup\n const expanded = ref(false)\n const hoverOption = ref()\n const debouncing = ref(false)\n\n const { form, formItem } = useFormItem()\n const { inputId } = useFormItemInputId(props, {\n formItemContext: formItem,\n })\n const { valueOnClear, isEmptyValue } = useEmptyValues(props)\n\n const {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n } = useComposition({\n afterComposition: (e) => onInput(e),\n })\n\n const selectDisabled = useFormDisabled()\n\n const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {\n disabled: selectDisabled,\n afterFocus() {\n if (props.automaticDropdown && !expanded.value) {\n expanded.value = true\n states.menuVisibleOnFocus = true\n }\n },\n beforeBlur(event) {\n return (\n tooltipRef.value?.isFocusInsideContent(event) ||\n tagTooltipRef.value?.isFocusInsideContent(event)\n )\n },\n afterBlur() {\n expanded.value = false\n states.menuVisibleOnFocus = false\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\n }\n },\n })\n\n const hasModelValue = computed(() => {\n return isArray(props.modelValue)\n ? props.modelValue.length > 0\n : !isEmptyValue(props.modelValue)\n })\n\n const needStatusIcon = computed(() => form?.statusIcon ?? false)\n\n const showClearBtn = computed(() => {\n return (\n props.clearable &&\n !selectDisabled.value &&\n hasModelValue.value &&\n (isFocused.value || states.inputHovering)\n )\n })\n const iconComponent = computed(() =>\n props.remote && props.filterable && !props.remoteShowSuffix\n ? ''\n : props.suffixIcon\n )\n const iconReverse = computed(() =>\n nsSelect.is('reverse', !!(iconComponent.value && expanded.value))\n )\n\n const validateState = computed(() => formItem?.validateState || '')\n const validateIcon = computed(\n () =>\n validateState.value &&\n (ValidateComponentsMap[validateState.value] as Component)\n )\n\n const debounce = computed(() => (props.remote ? props.debounce : 0))\n\n const isRemoteSearchEmpty = computed(\n () => props.remote && !states.inputValue && states.options.size === 0\n )\n\n const emptyText = computed(() => {\n if (props.loading) {\n return props.loadingText || t('el.select.loading')\n } else {\n if (\n props.filterable &&\n states.inputValue &&\n states.options.size > 0 &&\n filteredOptionsCount.value === 0\n ) {\n return props.noMatchText || t('el.select.noMatch')\n }\n if (states.options.size === 0) {\n return props.noDataText || t('el.select.noData')\n }\n }\n return null\n })\n\n const filteredOptionsCount = computed(\n () => optionsArray.value.filter((option) => option.visible).length\n )\n\n const optionsArray = computed(() => {\n const list = Array.from(states.options.values())\n const newList: OptionPublicInstance[] = []\n states.optionValues.forEach((item) => {\n const index = list.findIndex((i) => i.value === item)\n if (index > -1) {\n newList.push(list[index])\n }\n })\n return newList.length >= list.length ? newList : list\n })\n\n const cachedOptionsArray = computed(() =>\n Array.from(states.cachedOptions.values())\n )\n\n const showNewOption = computed(() => {\n const hasExistingOption = optionsArray.value\n .filter((option) => {\n return !option.created\n })\n .some((option) => {\n return option.currentLabel === states.inputValue\n })\n return (\n props.filterable &&\n props.allowCreate &&\n states.inputValue !== '' &&\n !hasExistingOption\n )\n })\n\n const updateOptions = () => {\n if (props.filterable && isFunction(props.filterMethod)) return\n if (props.filterable && props.remote && isFunction(props.remoteMethod))\n return\n optionsArray.value.forEach((option) => {\n option.updateOption?.(states.inputValue)\n })\n }\n\n const selectSize = useFormSize()\n\n const collapseTagSize = computed(() =>\n ['small'].includes(selectSize.value) ? 'small' : 'default'\n )\n\n const dropdownMenuVisible = computed({\n get() {\n return (\n expanded.value &&\n (props.loading ||\n !isRemoteSearchEmpty.value ||\n (props.remote && !!slots.empty)) &&\n (!debouncing.value ||\n !isEmpty(states.previousQuery) ||\n states.options.size > 0)\n )\n },\n set(val: boolean) {\n expanded.value = val\n },\n })\n\n const shouldShowPlaceholder = computed(() => {\n if (props.multiple && !isUndefined(props.modelValue)) {\n return ensureArray(props.modelValue).length === 0 && !states.inputValue\n }\n const value = isArray(props.modelValue)\n ? props.modelValue[0]\n : props.modelValue\n return props.filterable || isUndefined(value) ? !states.inputValue : true\n })\n\n const currentPlaceholder = computed(() => {\n const _placeholder = props.placeholder ?? t('el.select.placeholder')\n return props.multiple || !hasModelValue.value\n ? _placeholder\n : states.selectedLabel\n })\n\n // iOS Safari does not handle click events when a mouseenter event is registered and a DOM-change happens in a child\n // We use a Vue custom event binding to only register the event on non-iOS devices\n // ref.: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html\n // Github Issue: https://github.com/vuejs/vue/issues/9859\n const mouseEnterEventName = isIOS ? null : 'mouseenter'\n\n watch(\n () => props.modelValue,\n (val, oldVal) => {\n if (props.multiple) {\n if (props.filterable && !props.reserveKeyword) {\n states.inputValue = ''\n handleQueryChange('')\n }\n }\n setSelected()\n if (!isEqual(val, oldVal) && props.validateEvent) {\n formItem?.validate('change').catch(NOOP)\n }\n },\n {\n flush: 'post',\n deep: true,\n }\n )\n\n watch(\n () => expanded.value,\n (val) => {\n if (val) {\n handleQueryChange(states.inputValue)\n } else {\n states.inputValue = ''\n states.previousQuery = null\n states.isBeforeHide = true\n states.menuVisibleOnFocus = false\n }\n }\n )\n\n watch(\n // fix `Array.prototype.push/splice/..` cannot trigger non-deep watcher\n // https://github.com/vuejs/vue-next/issues/2116\n () => states.options.entries(),\n () => {\n if (!isClient) return\n // tooltipRef.value?.updatePopper?.()\n setSelected()\n if (\n props.defaultFirstOption &&\n (props.filterable || props.remote) &&\n filteredOptionsCount.value\n ) {\n checkDefaultFirstOption()\n }\n },\n {\n flush: 'post',\n }\n )\n\n watch([() => states.hoveringIndex, optionsArray], ([val]) => {\n if (isNumber(val) && val > -1) {\n hoverOption.value = optionsArray.value[val] || {}\n } else {\n hoverOption.value = {}\n }\n optionsArray.value.forEach((option) => {\n option.hover = hoverOption.value === option\n })\n })\n\n watchEffect(() => {\n // Anything could cause options changed, then update options\n // If you want to control it by condition, write here\n if (states.isBeforeHide) return\n updateOptions()\n })\n\n const handleQueryChange = (val: string) => {\n if (states.previousQuery === val || isComposing.value) {\n return\n }\n states.previousQuery = val\n if (props.filterable && isFunction(props.filterMethod)) {\n props.filterMethod(val)\n } else if (\n props.filterable &&\n props.remote &&\n isFunction(props.remoteMethod)\n ) {\n props.remoteMethod(val)\n }\n if (\n props.defaultFirstOption &&\n (props.filterable || props.remote) &&\n filteredOptionsCount.value\n ) {\n nextTick(checkDefaultFirstOption)\n } else {\n nextTick(updateHoveringIndex)\n }\n }\n\n /**\n * find and highlight first option as default selected\n * @remark\n * - if the first option in dropdown list is user-created,\n * it would be at the end of the optionsArray\n * so find it and set hover.\n * (NOTE: there must be only one user-created option in dropdown list with query)\n * - if there's no user-created option in list, just find the first one as usual\n * (NOTE: exclude options that are disabled or in disabled-group)\n */\n const checkDefaultFirstOption = () => {\n const optionsInDropdown = optionsArray.value.filter(\n (n) => n.visible && !n.disabled && !n.states.groupDisabled\n )\n const userCreatedOption = optionsInDropdown.find((n) => n.created)\n const firstOriginOption = optionsInDropdown[0]\n const valueList = optionsArray.value.map((item) => item.value)\n states.hoveringIndex = getValueIndex(\n valueList,\n userCreatedOption || firstOriginOption\n )\n }\n\n const setSelected = () => {\n if (!props.multiple) {\n const value = isArray(props.modelValue)\n ? props.modelValue[0]\n : props.modelValue\n const option = getOption(value)\n states.selectedLabel = option.currentLabel\n states.selected = [option]\n return\n } else {\n states.selectedLabel = ''\n }\n const result: SelectStates['selected'] = []\n if (!isUndefined(props.modelValue)) {\n ensureArray(props.modelValue).forEach((value) => {\n result.push(getOption(value))\n })\n }\n states.selected = result\n }\n\n const getOption = (value: OptionValue) => {\n let option\n const isObjectValue = isPlainObject(value)\n\n for (let i = states.cachedOptions.size - 1; i >= 0; i--) {\n const cachedOption = cachedOptionsArray.value[i]\n const isEqualValue = isObjectValue\n ? get(cachedOption.value, props.valueKey) === get(value, props.valueKey)\n : cachedOption.value === value\n if (isEqualValue) {\n option = {\n index: optionsArray.value\n .filter((opt) => !opt.created)\n .indexOf(cachedOption),\n value,\n currentLabel: cachedOption.currentLabel,\n get isDisabled() {\n return cachedOption.isDisabled\n },\n }\n break\n }\n }\n if (option) return option\n const label = isObjectValue ? value.label : (value ?? '')\n const newOption = {\n index: -1,\n value,\n currentLabel: label,\n }\n return newOption\n }\n\n const updateHoveringIndex = () => {\n const length = states.selected.length\n if (length > 0) {\n const lastOption = states.selected[length - 1]\n states.hoveringIndex = optionsArray.value.findIndex(\n (item) => getValueKey(lastOption) === getValueKey(item)\n )\n } else {\n states.hoveringIndex = -1\n }\n }\n\n const resetSelectionWidth = () => {\n states.selectionWidth = Number.parseFloat(\n window.getComputedStyle(selectionRef.value!).width\n )\n }\n\n const resetCollapseItemWidth = () => {\n states.collapseItemWidth =\n collapseItemRef.value!.getBoundingClientRect().width\n }\n\n const updateTooltip = () => {\n tooltipRef.value?.updatePopper?.()\n }\n\n const updateTagTooltip = () => {\n tagTooltipRef.value?.updatePopper?.()\n }\n\n const onInputChange = () => {\n if (states.inputValue.length > 0 && !expanded.value) {\n expanded.value = true\n }\n handleQueryChange(states.inputValue)\n }\n\n const onInput = (event: Event) => {\n states.inputValue = (event.target as HTMLInputElement).value\n if (props.remote) {\n debouncing.value = true\n debouncedOnInputChange()\n } else {\n return onInputChange()\n }\n }\n\n const debouncedOnInputChange = useDebounceFn(() => {\n onInputChange()\n debouncing.value = false\n }, debounce)\n\n const emitChange = (val: OptionValue | OptionValue[]) => {\n if (!isEqual(props.modelValue, val)) {\n emit(CHANGE_EVENT, val)\n }\n }\n\n const getLastNotDisabledIndex = (value: OptionValue[]) =>\n findLastIndex(value, (it) => {\n const option = states.cachedOptions.get(it)\n return !option?.disabled && !option?.states.groupDisabled\n })\n\n const deletePrevTag = (e: KeyboardEvent) => {\n const code = getEventCode(e)\n if (!props.multiple) return\n if (code === EVENT_CODE.delete) return\n if ((e.target as HTMLInputElement).value.length <= 0) {\n const value = ensureArray(props.modelValue).slice()\n const lastNotDisabledIndex = getLastNotDisabledIndex(value)\n if (lastNotDisabledIndex < 0) return\n const removeTagValue = value[lastNotDisabledIndex]\n value.splice(lastNotDisabledIndex, 1)\n emit(UPDATE_MODEL_EVENT, value)\n emitChange(value)\n emit('remove-tag', removeTagValue)\n }\n }\n\n const deleteTag = (event: MouseEvent, tag: OptionBasic) => {\n const index = states.selected.indexOf(tag)\n if (index > -1 && !selectDisabled.value) {\n const value = ensureArray(props.modelValue).slice()\n value.splice(index, 1)\n emit(UPDATE_MODEL_EVENT, value)\n emitChange(value)\n emit('remove-tag', tag.value)\n }\n event.stopPropagation()\n focus()\n }\n\n const deleteSelected = (event: Event) => {\n event.stopPropagation()\n const value = props.multiple ? [] : valueOnClear.value\n if (props.multiple) {\n for (const item of states.selected) {\n if (item.isDisabled) value.push(item.value)\n }\n }\n emit(UPDATE_MODEL_EVENT, value)\n emitChange(value)\n states.hoveringIndex = -1\n expanded.value = false\n emit('clear')\n focus()\n }\n\n const handleOptionSelect = (option: OptionPublicInstance) => {\n if (props.multiple) {\n const value = ensureArray(props.modelValue ?? []).slice()\n const optionIndex = getValueIndex(value, option)\n if (optionIndex > -1) {\n value.splice(optionIndex, 1)\n } else if (\n props.multipleLimit <= 0 ||\n value.length < props.multipleLimit\n ) {\n value.push(option.value)\n }\n emit(UPDATE_MODEL_EVENT, value)\n emitChange(value)\n if (option.created) {\n handleQueryChange('')\n }\n if (props.filterable && (option.created || !props.reserveKeyword)) {\n states.inputValue = ''\n }\n } else {\n !isEqual(props.modelValue, option.value) &&\n emit(UPDATE_MODEL_EVENT, option.value)\n emitChange(option.value)\n expanded.value = false\n }\n focus()\n if (expanded.value) return\n nextTick(() => {\n scrollToOption(option)\n })\n }\n\n const getValueIndex = (arr: OptionValue[], option: OptionPublicInstance) => {\n if (isUndefined(option)) return -1\n if (!isObject(option.value)) return arr.indexOf(option.value)\n\n return arr.findIndex((item) => {\n return isEqual(get(item, props.valueKey), getValueKey(option))\n })\n }\n\n const scrollToOption = (\n option:\n | OptionPublicInstance\n | OptionPublicInstance[]\n | SelectStates['selected']\n ) => {\n const targetOption = isArray(option) ? option[option.length - 1] : option\n let target = null\n\n if (!isNil(targetOption?.value)) {\n const options = optionsArray.value.filter(\n (item) => item.value === targetOption.value\n )\n if (options.length > 0) {\n target = options[0].$el\n }\n }\n\n if (tooltipRef.value && target) {\n const menu = tooltipRef.value?.popperRef?.contentRef?.querySelector?.(\n `.${nsSelect.be('dropdown', 'wrap')}`\n )\n if (menu) {\n scrollIntoView(menu as HTMLElement, target)\n }\n }\n scrollbarRef.value?.handleScroll()\n }\n\n const onOptionCreate = (vm: OptionPublicInstance) => {\n states.options.set(vm.value, vm)\n states.cachedOptions.set(vm.value, vm)\n }\n\n const onOptionDestroy = (key: OptionValue, vm: OptionPublicInstance) => {\n if (states.options.get(key) === vm) {\n states.options.delete(key)\n }\n }\n\n const popperRef = computed(() => {\n return tooltipRef.value?.popperRef?.contentRef\n })\n\n const handleMenuEnter = () => {\n states.isBeforeHide = false\n nextTick(() => {\n scrollbarRef.value?.update()\n scrollToOption(states.selected)\n })\n }\n\n const focus = () => {\n inputRef.value?.focus()\n }\n\n const blur = () => {\n if (expanded.value) {\n expanded.value = false\n nextTick(() => inputRef.value?.blur())\n return\n }\n inputRef.value?.blur()\n }\n\n const handleClearClick = (event: Event) => {\n deleteSelected(event)\n }\n\n const handleClickOutside = (event: Event) => {\n expanded.value = false\n\n if (isFocused.value) {\n const _event = new FocusEvent('blur', event)\n nextTick(() => handleBlur(_event))\n }\n }\n\n const handleEsc = () => {\n if (states.inputValue.length > 0) {\n states.inputValue = ''\n } else {\n expanded.value = false\n }\n }\n\n const toggleMenu = (event?: Event) => {\n if (\n selectDisabled.value ||\n (props.filterable &&\n expanded.value &&\n event &&\n !suffixRef.value?.contains(event.target as Node))\n )\n return\n\n // We only set the inputHovering state to true on mouseenter event on iOS devices\n // To keep the state updated we set it here to true\n if (isIOS) states.inputHovering = true\n\n if (states.menuVisibleOnFocus) {\n // controlled by automaticDropdown\n states.menuVisibleOnFocus = false\n } else {\n expanded.value = !expanded.value\n }\n }\n\n const selectOption = () => {\n if (!expanded.value) {\n toggleMenu()\n } else {\n const option = optionsArray.value[states.hoveringIndex]\n if (option && !option.isDisabled) {\n handleOptionSelect(option)\n }\n }\n }\n\n const getValueKey = (\n item: OptionPublicInstance | SelectStates['selected'][0]\n ) => {\n return isObject(item.value) ? get(item.value, props.valueKey) : item.value\n }\n\n const optionsAllDisabled = computed(() =>\n optionsArray.value\n .filter((option) => option.visible)\n .every((option) => option.isDisabled)\n )\n\n const showTagList = computed(() => {\n if (!props.multiple) {\n return []\n }\n return props.collapseTags\n ? states.selected.slice(0, props.maxCollapseTags)\n : states.selected\n })\n\n const collapseTagList = computed(() => {\n if (!props.multiple) {\n return []\n }\n return props.collapseTags\n ? states.selected.slice(props.maxCollapseTags)\n : []\n })\n\n const navigateOptions = (direction: 'prev' | 'next') => {\n if (!expanded.value) {\n expanded.value = true\n return\n }\n if (\n states.options.size === 0 ||\n filteredOptionsCount.value === 0 ||\n isComposing.value\n )\n return\n\n if (!optionsAllDisabled.value) {\n if (direction === 'next') {\n states.hoveringIndex++\n if (states.hoveringIndex === states.options.size) {\n states.hoveringIndex = 0\n }\n } else if (direction === 'prev') {\n states.hoveringIndex--\n if (states.hoveringIndex < 0) {\n states.hoveringIndex = states.options.size - 1\n }\n }\n const option = optionsArray.value[states.hoveringIndex]\n if (option.isDisabled || !option.visible) {\n navigateOptions(direction)\n }\n nextTick(() => scrollToOption(hoverOption.value))\n }\n }\n\n const findFocusableIndex = (\n arr: any[],\n start: number,\n step: number,\n len: number\n ) => {\n for (let i = start; i >= 0 && i < len; i += step) {\n const obj = arr[i]\n if (!obj?.isDisabled && obj?.visible) {\n return i\n }\n }\n return null\n }\n\n const focusOption = (targetIndex: number, mode: 'up' | 'down') => {\n const len = states.options.size\n if (len === 0) return\n const start = clamp(targetIndex, 0, len - 1)\n const options = optionsArray.value\n const direction = mode === 'up' ? -1 : 1\n const newIndex =\n findFocusableIndex(options, start, direction, len) ??\n findFocusableIndex(options, start - direction, -direction, len)\n\n if (newIndex != null) {\n states.hoveringIndex = newIndex\n nextTick(() => scrollToOption(hoverOption.value))\n }\n }\n\n const handleKeydown = (e: KeyboardEvent) => {\n const code = getEventCode(e)\n let isPreventDefault = true\n switch (code) {\n case EVENT_CODE.up:\n navigateOptions('prev')\n break\n case EVENT_CODE.down:\n navigateOptions('next')\n break\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n if (!isComposing.value) {\n selectOption()\n }\n break\n case EVENT_CODE.esc:\n handleEsc()\n break\n case EVENT_CODE.backspace:\n isPreventDefault = false\n deletePrevTag(e)\n return\n case EVENT_CODE.home:\n if (!expanded.value) return\n focusOption(0, 'down')\n break\n case EVENT_CODE.end:\n if (!expanded.value) return\n focusOption(states.options.size - 1, 'up')\n break\n case EVENT_CODE.pageUp:\n if (!expanded.value) return\n focusOption(states.hoveringIndex - 10, 'up')\n break\n case EVENT_CODE.pageDown:\n if (!expanded.value) return\n focusOption(states.hoveringIndex + 10, 'down')\n break\n default:\n isPreventDefault = false\n break\n }\n if (isPreventDefault) {\n e.preventDefault()\n e.stopPropagation()\n }\n }\n\n const getGapWidth = () => {\n if (!selectionRef.value) return 0\n const style = window.getComputedStyle(selectionRef.value)\n return Number.parseFloat(style.gap || '6px')\n }\n\n // computed style\n const tagStyle = computed(() => {\n const gapWidth = getGapWidth()\n const inputSlotWidth = props.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0\n const maxWidth =\n collapseItemRef.value && props.maxCollapseTags === 1\n ? states.selectionWidth -\n states.collapseItemWidth -\n gapWidth -\n inputSlotWidth\n : states.selectionWidth - inputSlotWidth\n return { maxWidth: `${maxWidth}px` }\n })\n\n const collapseTagStyle = computed(() => {\n return { maxWidth: `${states.selectionWidth}px` }\n })\n\n const popupScroll = (data: { scrollTop: number; scrollLeft: number }) => {\n emit('popup-scroll', data)\n }\n\n useResizeObserver(selectionRef, resetSelectionWidth)\n useResizeObserver(wrapperRef, updateTooltip)\n useResizeObserver(tagMenuRef, updateTagTooltip)\n useResizeObserver(collapseItemRef, resetCollapseItemWidth)\n\n // #21498\n let stop: (() => void) | undefined\n watch(\n () => dropdownMenuVisible.value,\n (newVal) => {\n if (newVal) {\n stop = useResizeObserver(menuRef, updateTooltip).stop\n } else {\n stop?.()\n stop = undefined\n }\n emit('visible-change', newVal)\n }\n )\n\n onMounted(() => {\n setSelected()\n })\n\n return {\n inputId,\n contentId,\n nsSelect,\n nsInput,\n states,\n isFocused,\n expanded,\n optionsArray,\n hoverOption,\n selectSize,\n filteredOptionsCount,\n updateTooltip,\n updateTagTooltip,\n debouncedOnInputChange,\n onInput,\n deletePrevTag,\n deleteTag,\n deleteSelected,\n handleOptionSelect,\n scrollToOption,\n hasModelValue,\n shouldShowPlaceholder,\n currentPlaceholder,\n mouseEnterEventName,\n needStatusIcon,\n showClearBtn,\n iconComponent,\n iconReverse,\n validateState,\n validateIcon,\n showNewOption,\n updateOptions,\n collapseTagSize,\n setSelected,\n selectDisabled,\n emptyText,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n handleKeydown,\n onOptionCreate,\n onOptionDestroy,\n handleMenuEnter,\n focus,\n blur,\n handleClearClick,\n handleClickOutside,\n handleEsc,\n toggleMenu,\n selectOption,\n getValueKey,\n navigateOptions,\n dropdownMenuVisible,\n showTagList,\n collapseTagList,\n popupScroll,\n getOption,\n\n // computed style\n tagStyle,\n collapseTagStyle,\n\n // DOM ref\n popperRef,\n inputRef,\n tooltipRef,\n tagTooltipRef,\n prefixRef,\n suffixRef,\n selectRef,\n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A;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"useSelect.mjs","names":["isUndefined","isClient","isPlainObject","clamp"],"sources":["../../../../../../packages/components/select/src/useSelect.ts"],"sourcesContent":["import {\n computed,\n nextTick,\n onMounted,\n reactive,\n ref,\n useSlots,\n watch,\n watchEffect,\n} from 'vue'\nimport { clamp, findLastIndex, get, isEqual, isNil } from 'lodash-unified'\nimport { useDebounceFn, useResizeObserver } from '@vueuse/core'\nimport {\n NOOP,\n ValidateComponentsMap,\n ensureArray,\n getEventCode,\n isArray,\n isClient,\n isEmpty,\n isFunction,\n isIOS,\n isNumber,\n isObject,\n isPlainObject,\n isUndefined,\n scrollIntoView,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n MINIMUM_INPUT_WIDTH,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport {\n useComposition,\n useEmptyValues,\n useFocusController,\n useId,\n useLocale,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\n\nimport type { Component } from 'vue'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\nimport type {\n ScrollbarDirection,\n ScrollbarInstance,\n} from '@element-plus/components/scrollbar'\nimport type { SelectEmits, SelectProps } from './select'\nimport type {\n OptionBasic,\n OptionPublicInstance,\n OptionValue,\n SelectStates,\n} from './type'\n\nexport const useSelect = (props: SelectProps, emit: SelectEmits) => {\n const { t } = useLocale()\n const slots = useSlots()\n const contentId = useId()\n const nsSelect = useNamespace('select')\n const nsInput = useNamespace('input')\n\n const states = reactive<SelectStates>({\n inputValue: '',\n options: new Map(),\n cachedOptions: new Map(),\n optionValues: [], // sorted value of options\n selected: [],\n selectionWidth: 0,\n collapseItemWidth: 0,\n selectedLabel: '',\n hoveringIndex: -1,\n previousQuery: null,\n inputHovering: false,\n menuVisibleOnFocus: false,\n isBeforeHide: false,\n })\n\n // template refs\n const selectRef = ref<HTMLElement>()\n const selectionRef = ref<HTMLElement>()\n const tooltipRef = ref<TooltipInstance>()\n const tagTooltipRef = ref<TooltipInstance>()\n const inputRef = ref<HTMLInputElement>()\n const prefixRef = ref<HTMLElement>()\n const suffixRef = ref<HTMLElement>()\n const menuRef = ref<HTMLElement>()\n const tagMenuRef = ref<HTMLElement>()\n const collapseItemRef = ref<HTMLElement>()\n const scrollbarRef = ref<ScrollbarInstance>()\n // the controller of the expanded popup\n const expanded = ref(false)\n const hoverOption = ref()\n const debouncing = ref(false)\n\n const { form, formItem } = useFormItem()\n const { inputId } = useFormItemInputId(props, {\n formItemContext: formItem,\n })\n const { valueOnClear, isEmptyValue } = useEmptyValues(props)\n\n const {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n } = useComposition({\n afterComposition: (e) => onInput(e),\n })\n\n const selectDisabled = useFormDisabled()\n\n const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {\n disabled: selectDisabled,\n afterFocus() {\n if (props.automaticDropdown && !expanded.value) {\n expanded.value = true\n states.menuVisibleOnFocus = true\n }\n },\n beforeBlur(event) {\n return (\n tooltipRef.value?.isFocusInsideContent(event) ||\n tagTooltipRef.value?.isFocusInsideContent(event)\n )\n },\n afterBlur() {\n expanded.value = false\n states.menuVisibleOnFocus = false\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\n }\n },\n })\n\n const hasModelValue = computed(() => {\n return isArray(props.modelValue)\n ? props.modelValue.length > 0\n : !isEmptyValue(props.modelValue)\n })\n\n const needStatusIcon = computed(() => form?.statusIcon ?? false)\n\n const showClearBtn = computed(() => {\n return (\n props.clearable &&\n !selectDisabled.value &&\n hasModelValue.value &&\n (isFocused.value || states.inputHovering)\n )\n })\n const iconComponent = computed(() =>\n props.remote && props.filterable && !props.remoteShowSuffix\n ? ''\n : props.suffixIcon\n )\n const iconReverse = computed(() =>\n nsSelect.is('reverse', !!(iconComponent.value && expanded.value))\n )\n\n const validateState = computed(() => formItem?.validateState || '')\n const validateIcon = computed(\n () =>\n validateState.value &&\n (ValidateComponentsMap[validateState.value] as Component)\n )\n\n const debounce = computed(() => (props.remote ? props.debounce : 0))\n\n const isRemoteSearchEmpty = computed(\n () => props.remote && !states.inputValue && states.options.size === 0\n )\n\n const emptyText = computed(() => {\n if (props.loading) {\n return props.loadingText || t('el.select.loading')\n } else {\n if (\n props.filterable &&\n states.inputValue &&\n states.options.size > 0 &&\n filteredOptionsCount.value === 0\n ) {\n return props.noMatchText || t('el.select.noMatch')\n }\n if (states.options.size === 0) {\n return props.noDataText || t('el.select.noData')\n }\n }\n return null\n })\n\n const filteredOptionsCount = computed(\n () => optionsArray.value.filter((option) => option.visible).length\n )\n\n const optionsArray = computed(() => {\n const list = Array.from(states.options.values())\n const newList: OptionPublicInstance[] = []\n states.optionValues.forEach((item) => {\n const index = list.findIndex((i) => i.value === item)\n if (index > -1) {\n newList.push(list[index])\n }\n })\n return newList.length >= list.length ? newList : list\n })\n\n const cachedOptionsArray = computed(() =>\n Array.from(states.cachedOptions.values())\n )\n\n const showNewOption = computed(() => {\n const hasExistingOption = optionsArray.value\n .filter((option) => {\n return !option.created\n })\n .some((option) => {\n return option.currentLabel === states.inputValue\n })\n return (\n props.filterable &&\n props.allowCreate &&\n states.inputValue !== '' &&\n !hasExistingOption\n )\n })\n\n const updateOptions = () => {\n if (props.filterable && isFunction(props.filterMethod)) return\n if (props.filterable && props.remote && isFunction(props.remoteMethod))\n return\n optionsArray.value.forEach((option) => {\n option.updateOption?.(states.inputValue)\n })\n }\n\n const selectSize = useFormSize()\n\n const collapseTagSize = computed(() =>\n ['small'].includes(selectSize.value) ? 'small' : 'default'\n )\n\n const dropdownMenuVisible = computed({\n get() {\n return (\n expanded.value &&\n (props.loading ||\n !isRemoteSearchEmpty.value ||\n (props.remote && !!slots.empty)) &&\n (!debouncing.value ||\n !isEmpty(states.previousQuery) ||\n states.options.size > 0)\n )\n },\n set(val: boolean) {\n expanded.value = val\n },\n })\n\n const shouldShowPlaceholder = computed(() => {\n if (props.multiple && !isUndefined(props.modelValue)) {\n return ensureArray(props.modelValue).length === 0 && !states.inputValue\n }\n const value = isArray(props.modelValue)\n ? props.modelValue[0]\n : props.modelValue\n return props.filterable || isUndefined(value) ? !states.inputValue : true\n })\n\n const currentPlaceholder = computed(() => {\n const _placeholder = props.placeholder ?? t('el.select.placeholder')\n return props.multiple || !hasModelValue.value\n ? _placeholder\n : states.selectedLabel\n })\n\n // iOS Safari does not handle click events when a mouseenter event is registered and a DOM-change happens in a child\n // We use a Vue custom event binding to only register the event on non-iOS devices\n // ref.: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html\n // Github Issue: https://github.com/vuejs/vue/issues/9859\n const mouseEnterEventName = isIOS ? null : 'mouseenter'\n\n watch(\n () => props.modelValue,\n (val, oldVal) => {\n if (props.multiple) {\n if (props.filterable && !props.reserveKeyword) {\n states.inputValue = ''\n handleQueryChange('')\n }\n }\n setSelected()\n if (!isEqual(val, oldVal) && props.validateEvent) {\n formItem?.validate('change').catch(NOOP)\n }\n },\n {\n flush: 'post',\n deep: true,\n }\n )\n\n watch(\n () => expanded.value,\n (val) => {\n if (val) {\n handleQueryChange(states.inputValue)\n } else {\n states.inputValue = ''\n states.previousQuery = null\n states.isBeforeHide = true\n states.menuVisibleOnFocus = false\n }\n }\n )\n\n watch(\n // fix `Array.prototype.push/splice/..` cannot trigger non-deep watcher\n // https://github.com/vuejs/vue-next/issues/2116\n () => states.options.entries(),\n () => {\n if (!isClient) return\n // tooltipRef.value?.updatePopper?.()\n setSelected()\n if (\n props.defaultFirstOption &&\n (props.filterable || props.remote) &&\n filteredOptionsCount.value\n ) {\n checkDefaultFirstOption()\n }\n },\n {\n flush: 'post',\n }\n )\n\n watch([() => states.hoveringIndex, optionsArray], ([val]) => {\n if (isNumber(val) && val > -1) {\n hoverOption.value = optionsArray.value[val] || {}\n } else {\n hoverOption.value = {}\n }\n optionsArray.value.forEach((option) => {\n option.hover = hoverOption.value === option\n })\n })\n\n watchEffect(() => {\n // Anything could cause options changed, then update options\n // If you want to control it by condition, write here\n if (states.isBeforeHide) return\n updateOptions()\n })\n\n const handleQueryChange = (val: string) => {\n if (states.previousQuery === val || isComposing.value) {\n return\n }\n states.previousQuery = val\n if (props.filterable && isFunction(props.filterMethod)) {\n props.filterMethod(val)\n } else if (\n props.filterable &&\n props.remote &&\n isFunction(props.remoteMethod)\n ) {\n props.remoteMethod(val)\n }\n if (\n props.defaultFirstOption &&\n (props.filterable || props.remote) &&\n filteredOptionsCount.value\n ) {\n nextTick(checkDefaultFirstOption)\n } else {\n nextTick(updateHoveringIndex)\n }\n }\n\n /**\n * find and highlight first option as default selected\n * @remark\n * - if the first option in dropdown list is user-created,\n * it would be at the end of the optionsArray\n * so find it and set hover.\n * (NOTE: there must be only one user-created option in dropdown list with query)\n * - if there's no user-created option in list, just find the first one as usual\n * (NOTE: exclude options that are disabled or in disabled-group)\n */\n const checkDefaultFirstOption = () => {\n const optionsInDropdown = optionsArray.value.filter(\n (n) => n.visible && !n.disabled && !n.states.groupDisabled\n )\n const userCreatedOption = optionsInDropdown.find((n) => n.created)\n const firstOriginOption = optionsInDropdown[0]\n const valueList = optionsArray.value.map((item) => item.value)\n states.hoveringIndex = getValueIndex(\n valueList,\n userCreatedOption || firstOriginOption\n )\n }\n\n const setSelected = () => {\n if (!props.multiple) {\n const value = isArray(props.modelValue)\n ? props.modelValue[0]\n : props.modelValue\n const option = getOption(value)\n states.selectedLabel = option.currentLabel\n states.selected = [option]\n return\n } else {\n states.selectedLabel = ''\n }\n const result: SelectStates['selected'] = []\n if (!isUndefined(props.modelValue)) {\n ensureArray(props.modelValue).forEach((value) => {\n result.push(getOption(value))\n })\n }\n states.selected = result\n }\n\n const getOption = (value: OptionValue) => {\n let option\n const isObjectValue = isPlainObject(value)\n\n for (let i = states.cachedOptions.size - 1; i >= 0; i--) {\n const cachedOption = cachedOptionsArray.value[i]\n const isEqualValue = isObjectValue\n ? get(cachedOption.value, props.valueKey) === get(value, props.valueKey)\n : cachedOption.value === value\n if (isEqualValue) {\n option = {\n index: optionsArray.value\n .filter((opt) => !opt.created)\n .indexOf(cachedOption),\n value,\n currentLabel: cachedOption.currentLabel,\n get isDisabled() {\n return cachedOption.isDisabled\n },\n }\n break\n }\n }\n if (option) return option\n const label = isObjectValue ? value.label : (value ?? '')\n const newOption = {\n index: -1,\n value,\n currentLabel: label,\n }\n return newOption\n }\n\n const updateHoveringIndex = () => {\n const length = states.selected.length\n if (length > 0) {\n const lastOption = states.selected[length - 1]\n states.hoveringIndex = optionsArray.value.findIndex(\n (item) => getValueKey(lastOption) === getValueKey(item)\n )\n } else {\n states.hoveringIndex = -1\n }\n }\n\n const resetSelectionWidth = () => {\n states.selectionWidth = Number.parseFloat(\n window.getComputedStyle(selectionRef.value!).width\n )\n }\n\n const resetCollapseItemWidth = () => {\n states.collapseItemWidth =\n collapseItemRef.value!.getBoundingClientRect().width\n }\n\n const updateTooltip = () => {\n tooltipRef.value?.updatePopper?.()\n }\n\n const updateTagTooltip = () => {\n tagTooltipRef.value?.updatePopper?.()\n }\n\n const onInputChange = () => {\n if (states.inputValue.length > 0 && !expanded.value) {\n expanded.value = true\n }\n handleQueryChange(states.inputValue)\n }\n\n const onInput = (event: Event) => {\n states.inputValue = (event.target as HTMLInputElement).value\n if (props.remote) {\n debouncing.value = true\n debouncedOnInputChange()\n } else {\n return onInputChange()\n }\n }\n\n const debouncedOnInputChange = useDebounceFn(() => {\n onInputChange()\n debouncing.value = false\n }, debounce)\n\n const emitChange = (val: OptionValue | OptionValue[]) => {\n if (!isEqual(props.modelValue, val)) {\n emit(CHANGE_EVENT, val)\n }\n }\n\n const getLastNotDisabledIndex = (value: OptionValue[]) =>\n findLastIndex(value, (it) => {\n const option = states.cachedOptions.get(it)\n return !option?.disabled && !option?.states.groupDisabled\n })\n\n const deletePrevTag = (e: KeyboardEvent) => {\n const code = getEventCode(e)\n if (!props.multiple) return\n if (code === EVENT_CODE.delete) return\n if ((e.target as HTMLInputElement).value.length <= 0) {\n const value = ensureArray(props.modelValue).slice()\n const lastNotDisabledIndex = getLastNotDisabledIndex(value)\n if (lastNotDisabledIndex < 0) return\n const removeTagValue = value[lastNotDisabledIndex]\n value.splice(lastNotDisabledIndex, 1)\n emit(UPDATE_MODEL_EVENT, value)\n emitChange(value)\n emit('remove-tag', removeTagValue)\n }\n }\n\n const deleteTag = (event: MouseEvent, tag: OptionBasic) => {\n const index = states.selected.indexOf(tag)\n if (index > -1 && !selectDisabled.value) {\n const value = ensureArray(props.modelValue).slice()\n value.splice(index, 1)\n emit(UPDATE_MODEL_EVENT, value)\n emitChange(value)\n emit('remove-tag', tag.value)\n }\n event.stopPropagation()\n focus()\n }\n\n const deleteSelected = (event: Event) => {\n event.stopPropagation()\n const value = props.multiple ? [] : valueOnClear.value\n if (props.multiple) {\n for (const item of states.selected) {\n if (item.isDisabled) value.push(item.value)\n }\n }\n emit(UPDATE_MODEL_EVENT, value)\n emitChange(value)\n states.hoveringIndex = -1\n expanded.value = false\n emit('clear')\n focus()\n }\n\n const handleOptionSelect = (option: OptionPublicInstance) => {\n if (props.multiple) {\n const value = ensureArray(props.modelValue ?? []).slice()\n const optionIndex = getValueIndex(value, option)\n if (optionIndex > -1) {\n value.splice(optionIndex, 1)\n } else if (\n props.multipleLimit <= 0 ||\n value.length < props.multipleLimit\n ) {\n value.push(option.value)\n }\n emit(UPDATE_MODEL_EVENT, value)\n emitChange(value)\n if (option.created) {\n handleQueryChange('')\n }\n if (props.filterable && (option.created || !props.reserveKeyword)) {\n states.inputValue = ''\n }\n } else {\n !isEqual(props.modelValue, option.value) &&\n emit(UPDATE_MODEL_EVENT, option.value)\n emitChange(option.value)\n expanded.value = false\n }\n focus()\n if (expanded.value) return\n nextTick(() => {\n scrollToOption(option)\n })\n }\n\n const getValueIndex = (arr: OptionValue[], option: OptionPublicInstance) => {\n if (isUndefined(option)) return -1\n if (!isObject(option.value)) return arr.indexOf(option.value)\n\n return arr.findIndex((item) => {\n return isEqual(get(item, props.valueKey), getValueKey(option))\n })\n }\n\n const scrollToOption = (\n option:\n | OptionPublicInstance\n | OptionPublicInstance[]\n | SelectStates['selected']\n ) => {\n const targetOption = isArray(option) ? option[option.length - 1] : option\n let target = null\n\n if (!isNil(targetOption?.value)) {\n const options = optionsArray.value.filter(\n (item) => item.value === targetOption.value\n )\n if (options.length > 0) {\n target = options[0].$el\n }\n }\n\n if (tooltipRef.value && target) {\n const menu = tooltipRef.value?.popperRef?.contentRef?.querySelector?.(\n `.${nsSelect.be('dropdown', 'wrap')}`\n )\n if (menu) {\n scrollIntoView(menu as HTMLElement, target)\n }\n }\n scrollbarRef.value?.handleScroll()\n }\n\n const onOptionCreate = (vm: OptionPublicInstance) => {\n states.options.set(vm.value, vm)\n states.cachedOptions.set(vm.value, vm)\n }\n\n const onOptionDestroy = (key: OptionValue, vm: OptionPublicInstance) => {\n if (states.options.get(key) === vm) {\n states.options.delete(key)\n }\n }\n\n const popperRef = computed(() => {\n return tooltipRef.value?.popperRef?.contentRef\n })\n\n const handleMenuEnter = () => {\n states.isBeforeHide = false\n nextTick(() => {\n scrollbarRef.value?.update()\n scrollToOption(states.selected)\n })\n }\n\n const focus = () => {\n inputRef.value?.focus()\n }\n\n const blur = () => {\n if (expanded.value) {\n expanded.value = false\n nextTick(() => inputRef.value?.blur())\n return\n }\n inputRef.value?.blur()\n }\n\n const handleClearClick = (event: Event) => {\n deleteSelected(event)\n }\n\n const handleClickOutside = (event: Event) => {\n expanded.value = false\n\n if (isFocused.value) {\n const _event = new FocusEvent('blur', event)\n nextTick(() => handleBlur(_event))\n }\n }\n\n const handleEsc = () => {\n if (states.inputValue.length > 0) {\n states.inputValue = ''\n } else {\n expanded.value = false\n }\n }\n\n const toggleMenu = (event?: Event) => {\n if (\n selectDisabled.value ||\n (props.filterable &&\n expanded.value &&\n event &&\n !suffixRef.value?.contains(event.target as Node))\n )\n return\n\n // We only set the inputHovering state to true on mouseenter event on iOS devices\n // To keep the state updated we set it here to true\n if (isIOS) states.inputHovering = true\n\n if (states.menuVisibleOnFocus) {\n // controlled by automaticDropdown\n states.menuVisibleOnFocus = false\n } else {\n expanded.value = !expanded.value\n }\n }\n\n const selectOption = () => {\n if (!expanded.value) {\n toggleMenu()\n } else {\n const option = optionsArray.value[states.hoveringIndex]\n if (option && !option.isDisabled) {\n handleOptionSelect(option)\n }\n }\n }\n\n const getValueKey = (\n item: OptionPublicInstance | SelectStates['selected'][0]\n ) => {\n return isObject(item.value) ? get(item.value, props.valueKey) : item.value\n }\n\n const optionsAllDisabled = computed(() =>\n optionsArray.value\n .filter((option) => option.visible)\n .every((option) => option.isDisabled)\n )\n\n const showTagList = computed(() => {\n if (!props.multiple) {\n return []\n }\n return props.collapseTags\n ? states.selected.slice(0, props.maxCollapseTags)\n : states.selected\n })\n\n const collapseTagList = computed(() => {\n if (!props.multiple) {\n return []\n }\n return props.collapseTags\n ? states.selected.slice(props.maxCollapseTags)\n : []\n })\n\n const navigateOptions = (direction: 'prev' | 'next') => {\n if (!expanded.value) {\n expanded.value = true\n return\n }\n if (\n states.options.size === 0 ||\n filteredOptionsCount.value === 0 ||\n isComposing.value\n )\n return\n\n if (!optionsAllDisabled.value) {\n if (direction === 'next') {\n states.hoveringIndex++\n if (states.hoveringIndex === states.options.size) {\n states.hoveringIndex = 0\n }\n } else if (direction === 'prev') {\n states.hoveringIndex--\n if (states.hoveringIndex < 0) {\n states.hoveringIndex = states.options.size - 1\n }\n }\n const option = optionsArray.value[states.hoveringIndex]\n if (option.isDisabled || !option.visible) {\n navigateOptions(direction)\n }\n nextTick(() => scrollToOption(hoverOption.value))\n }\n }\n\n const findFocusableIndex = (\n arr: any[],\n start: number,\n step: number,\n len: number\n ) => {\n for (let i = start; i >= 0 && i < len; i += step) {\n const obj = arr[i]\n if (!obj?.isDisabled && obj?.visible) {\n return i\n }\n }\n return null\n }\n\n const focusOption = (targetIndex: number, mode: 'up' | 'down') => {\n const len = states.options.size\n if (len === 0) return\n const start = clamp(targetIndex, 0, len - 1)\n const options = optionsArray.value\n const direction = mode === 'up' ? -1 : 1\n const newIndex =\n findFocusableIndex(options, start, direction, len) ??\n findFocusableIndex(options, start - direction, -direction, len)\n\n if (newIndex != null) {\n states.hoveringIndex = newIndex\n nextTick(() => scrollToOption(hoverOption.value))\n }\n }\n\n const handleKeydown = (e: KeyboardEvent) => {\n const code = getEventCode(e)\n let isPreventDefault = true\n switch (code) {\n case EVENT_CODE.up:\n navigateOptions('prev')\n break\n case EVENT_CODE.down:\n navigateOptions('next')\n break\n case EVENT_CODE.enter:\n case EVENT_CODE.numpadEnter:\n if (!isComposing.value) {\n selectOption()\n }\n break\n case EVENT_CODE.esc:\n handleEsc()\n break\n case EVENT_CODE.backspace:\n isPreventDefault = false\n deletePrevTag(e)\n return\n case EVENT_CODE.home:\n if (!expanded.value) return\n focusOption(0, 'down')\n break\n case EVENT_CODE.end:\n if (!expanded.value) return\n focusOption(states.options.size - 1, 'up')\n break\n case EVENT_CODE.pageUp:\n if (!expanded.value) return\n focusOption(states.hoveringIndex - 10, 'up')\n break\n case EVENT_CODE.pageDown:\n if (!expanded.value) return\n focusOption(states.hoveringIndex + 10, 'down')\n break\n default:\n isPreventDefault = false\n break\n }\n if (isPreventDefault) {\n e.preventDefault()\n e.stopPropagation()\n }\n }\n\n const getGapWidth = () => {\n if (!selectionRef.value) return 0\n const style = window.getComputedStyle(selectionRef.value)\n return Number.parseFloat(style.gap || '6px')\n }\n\n // computed style\n const tagStyle = computed(() => {\n const gapWidth = getGapWidth()\n const inputSlotWidth = props.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0\n const maxWidth =\n collapseItemRef.value && props.maxCollapseTags === 1\n ? states.selectionWidth -\n states.collapseItemWidth -\n gapWidth -\n inputSlotWidth\n : states.selectionWidth - inputSlotWidth\n return { maxWidth: `${maxWidth}px` }\n })\n\n const collapseTagStyle = computed(() => {\n return { maxWidth: `${states.selectionWidth}px` }\n })\n\n const popupScroll = (data: { scrollTop: number; scrollLeft: number }) => {\n emit('popup-scroll', data)\n }\n\n const endReached = (direction: ScrollbarDirection) => {\n emit('end-reached', direction)\n }\n\n useResizeObserver(selectionRef, resetSelectionWidth)\n useResizeObserver(wrapperRef, updateTooltip)\n useResizeObserver(tagMenuRef, updateTagTooltip)\n useResizeObserver(collapseItemRef, resetCollapseItemWidth)\n\n // #21498\n let stop: (() => void) | undefined\n watch(\n () => dropdownMenuVisible.value,\n (newVal) => {\n if (newVal) {\n stop = useResizeObserver(menuRef, updateTooltip).stop\n } else {\n stop?.()\n stop = undefined\n }\n emit('visible-change', newVal)\n }\n )\n\n onMounted(() => {\n setSelected()\n })\n\n return {\n inputId,\n contentId,\n nsSelect,\n nsInput,\n states,\n isFocused,\n expanded,\n optionsArray,\n hoverOption,\n selectSize,\n filteredOptionsCount,\n updateTooltip,\n updateTagTooltip,\n debouncedOnInputChange,\n onInput,\n deletePrevTag,\n deleteTag,\n deleteSelected,\n handleOptionSelect,\n scrollToOption,\n hasModelValue,\n shouldShowPlaceholder,\n currentPlaceholder,\n mouseEnterEventName,\n needStatusIcon,\n showClearBtn,\n iconComponent,\n iconReverse,\n validateState,\n validateIcon,\n showNewOption,\n updateOptions,\n collapseTagSize,\n setSelected,\n selectDisabled,\n emptyText,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n handleKeydown,\n onOptionCreate,\n onOptionDestroy,\n handleMenuEnter,\n focus,\n blur,\n handleClearClick,\n handleClickOutside,\n handleEsc,\n toggleMenu,\n selectOption,\n getValueKey,\n navigateOptions,\n dropdownMenuVisible,\n showTagList,\n collapseTagList,\n popupScroll,\n getOption,\n endReached,\n\n // computed style\n tagStyle,\n collapseTagStyle,\n\n // DOM ref\n popperRef,\n inputRef,\n tooltipRef,\n tagTooltipRef,\n prefixRef,\n suffixRef,\n selectRef,\n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EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -6,6 +6,7 @@ import { Options, Placement } from "../../popper/index.js";
|
|
|
6
6
|
import { Option, OptionType } from "./select.types.js";
|
|
7
7
|
import { _default } from "./select.vue.js";
|
|
8
8
|
import { Props } from "./useProps.js";
|
|
9
|
+
import "../../../index.js";
|
|
9
10
|
import * as vue from "vue";
|
|
10
11
|
import { CSSProperties, ExtractPropTypes, ExtractPublicPropTypes } from "vue";
|
|
11
12
|
|
|
@@ -204,7 +205,7 @@ declare const selectV2Props: {
|
|
|
204
205
|
readonly remote: BooleanConstructor;
|
|
205
206
|
readonly debounce: EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
206
207
|
readonly size: {
|
|
207
|
-
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "
|
|
208
|
+
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
|
|
208
209
|
readonly required: false;
|
|
209
210
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
210
211
|
__epPropKey: true;
|
|
@@ -216,11 +217,11 @@ declare const selectV2Props: {
|
|
|
216
217
|
readonly offset: EpPropFinalized<NumberConstructor, unknown, unknown, 12, boolean>;
|
|
217
218
|
readonly remoteShowSuffix: BooleanConstructor;
|
|
218
219
|
readonly showArrow: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
219
|
-
readonly placement: EpPropFinalized<(new (...args: any[]) => "
|
|
220
|
+
readonly placement: EpPropFinalized<(new (...args: any[]) => "bottom" | "auto" | "auto-start" | "auto-end" | "top" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement) | (((new (...args: any[]) => "bottom" | "auto" | "auto-start" | "auto-end" | "top" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement)) | null)[], Placement, unknown, "bottom-start", boolean>;
|
|
220
221
|
readonly fallbackPlacements: EpPropFinalized<(new (...args: any[]) => Placement[]) | (() => Placement[]) | (((new (...args: any[]) => Placement[]) | (() => Placement[])) | null)[], unknown, unknown, readonly ["bottom-start", "top-start", "right", "left"], boolean>;
|
|
221
222
|
readonly tagType: {
|
|
222
223
|
readonly default: "info";
|
|
223
|
-
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "
|
|
224
|
+
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "primary" | "success" | "info" | "warning" | "danger", unknown>>;
|
|
224
225
|
readonly required: false;
|
|
225
226
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
226
227
|
readonly __epPropKey: true;
|
|
@@ -6,6 +6,7 @@ import { useSizeProp } from "../../../hooks/use-size/index.mjs";
|
|
|
6
6
|
import { useEmptyValuesProps } from "../../../hooks/use-empty-values/index.mjs";
|
|
7
7
|
import { useAriaProps } from "../../../hooks/use-aria/index.mjs";
|
|
8
8
|
import { useTooltipContentProps } from "../../tooltip/src/content.mjs";
|
|
9
|
+
import { scrollbarEmits } from "../../scrollbar/src/scrollbar.mjs";
|
|
9
10
|
import { tagProps } from "../../tag/src/tag.mjs";
|
|
10
11
|
import { defaultProps } from "./useProps.mjs";
|
|
11
12
|
import { ArrowDown, CircleClose } from "@element-plus/icons-vue";
|
|
@@ -184,6 +185,7 @@ const optionV2Props = buildProps({
|
|
|
184
185
|
const selectV2Emits = {
|
|
185
186
|
[UPDATE_MODEL_EVENT]: (val) => true,
|
|
186
187
|
[CHANGE_EVENT]: (val) => true,
|
|
188
|
+
"end-reached": scrollbarEmits["end-reached"],
|
|
187
189
|
"remove-tag": (val) => true,
|
|
188
190
|
"visible-change": (visible) => true,
|
|
189
191
|
focus: (evt) => evt instanceof FocusEvent,
|
|
@@ -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;CAIV,eAAe;EACb,MAAM;EACN,SAAS;EACV;CAID,MAAM;CAIN,YAAY;CAIZ,aAAa;CAIb,cAAc,EACZ,MAAM,eAAwC,SAAS,EACxD;CAID,gBAAgB;EACd,MAAM;EACN,SAAS;EACV;CAID,SAAS;EACP,MAAM,eAA6B,MAAM;EACzC,UAAU;EACX;CAID,aAAa,EACX,MAAM,QACP;CAID,Y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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;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,CA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AG,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?.()
|