@element-plus/nightly 0.0.20241113 → 0.0.20241114
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.full.js +129 -111
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +129 -111
- 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/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/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/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/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/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-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/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +8 -70
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +70 -8
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/cascader/index.mjs +2 -2
- package/es/components/cascader/src/cascader.mjs +83 -627
- package/es/components/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader2.mjs +629 -83
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs +1 -0
- package/es/components/cascader-panel/src/index.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +18 -28
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +28 -18
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +1 -0
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-item-impl.mjs +2 -3
- package/es/components/dropdown/src/dropdown-item-impl.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +7 -2
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/dropdown/src/useDropdown.mjs +1 -1
- package/es/components/dropdown/src/useDropdown.mjs.map +1 -1
- package/es/components/focus-trap/src/focus-trap.mjs +2 -2
- package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
- package/es/components/index.mjs +5 -5
- package/es/components/mention/src/mention2.mjs +51 -45
- package/es/components/mention/src/mention2.mjs.map +1 -1
- package/es/components/menu/src/utils/menu-item.mjs +1 -0
- package/es/components/menu/src/utils/menu-item.mjs.map +1 -1
- package/es/components/menu/src/utils/submenu.mjs +1 -0
- package/es/components/menu/src/utils/submenu.mjs.map +1 -1
- package/es/components/pagination/src/components/next.mjs +36 -19
- package/es/components/pagination/src/components/next.mjs.map +1 -1
- package/es/components/pagination/src/components/next2.mjs +19 -36
- package/es/components/pagination/src/components/next2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/roving-focus-group/index.mjs +3 -3
- package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.mjs +29 -27
- package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs +27 -29
- package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-item.mjs +3 -3
- package/es/components/roving-focus-group/src/roving-focus-item.mjs.map +1 -1
- package/es/components/roving-focus-group/src/utils.mjs +1 -1
- package/es/components/roving-focus-group/src/utils.mjs.map +1 -1
- package/es/components/scrollbar/index.mjs +2 -2
- package/es/components/scrollbar/src/scrollbar.mjs +55 -171
- package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +171 -55
- package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
- package/es/components/segmented/index.mjs +2 -2
- package/es/components/segmented/src/segmented.mjs +34 -169
- package/es/components/segmented/src/segmented.mjs.map +1 -1
- package/es/components/segmented/src/segmented2.mjs +169 -34
- package/es/components/segmented/src/segmented2.mjs.map +1 -1
- package/es/components/select-v2/src/select-dropdown.mjs +7 -9
- package/es/components/select-v2/src/select-dropdown.mjs.map +1 -1
- package/es/components/select-v2/src/useSelect.mjs +2 -1
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/slider/src/composables/use-slider-button.mjs +24 -15
- package/es/components/slider/src/composables/use-slider-button.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +21 -25
- package/es/components/tabs/src/tab-nav.mjs.map +1 -1
- package/es/components/tabs/src/tabs.mjs +1 -1
- package/es/components/tabs/src/tabs.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +1 -1
- package/es/components/tooltip/src/trigger.mjs.map +1 -1
- package/es/components/tree/src/model/useKeydown.mjs +1 -1
- package/es/components/tree/src/model/useKeydown.mjs.map +1 -1
- package/es/hooks/use-escape-keydown/index.mjs +2 -3
- package/es/hooks/use-escape-keydown/index.mjs.map +1 -1
- package/es/index.mjs +5 -5
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +8 -70
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +70 -8
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/cascader/index.js +2 -2
- package/lib/components/cascader/src/cascader.js +84 -627
- package/lib/components/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader2.js +629 -84
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js +1 -0
- package/lib/components/cascader-panel/src/index.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +20 -28
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +28 -20
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +1 -0
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-item-impl.js +2 -3
- package/lib/components/dropdown/src/dropdown-item-impl.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +1 -1
- package/lib/components/dropdown/src/dropdown2.js +7 -2
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/dropdown/src/useDropdown.js +1 -1
- package/lib/components/dropdown/src/useDropdown.js.map +1 -1
- package/lib/components/focus-trap/src/focus-trap.js +2 -2
- package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
- package/lib/components/index.js +5 -5
- package/lib/components/mention/src/mention2.js +51 -45
- package/lib/components/mention/src/mention2.js.map +1 -1
- package/lib/components/menu/src/utils/menu-item.js +1 -0
- package/lib/components/menu/src/utils/menu-item.js.map +1 -1
- package/lib/components/menu/src/utils/submenu.js +1 -0
- package/lib/components/menu/src/utils/submenu.js.map +1 -1
- package/lib/components/pagination/src/components/next.js +36 -19
- package/lib/components/pagination/src/components/next.js.map +1 -1
- package/lib/components/pagination/src/components/next2.js +19 -36
- package/lib/components/pagination/src/components/next2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/roving-focus-group/index.js +2 -2
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.js +33 -27
- package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group2.js +27 -33
- package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-item.js +3 -3
- package/lib/components/roving-focus-group/src/roving-focus-item.js.map +1 -1
- package/lib/components/roving-focus-group/src/utils.js +1 -1
- package/lib/components/roving-focus-group/src/utils.js.map +1 -1
- package/lib/components/scrollbar/index.js +2 -2
- package/lib/components/scrollbar/src/scrollbar.js +56 -171
- package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +171 -56
- package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
- package/lib/components/segmented/index.js +2 -2
- package/lib/components/segmented/src/segmented.js +34 -168
- package/lib/components/segmented/src/segmented.js.map +1 -1
- package/lib/components/segmented/src/segmented2.js +168 -34
- package/lib/components/segmented/src/segmented2.js.map +1 -1
- package/lib/components/select-v2/src/select-dropdown.js +7 -9
- package/lib/components/select-v2/src/select-dropdown.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.js +2 -1
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/slider/src/composables/use-slider-button.js +24 -15
- package/lib/components/slider/src/composables/use-slider-button.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +21 -25
- package/lib/components/tabs/src/tab-nav.js.map +1 -1
- package/lib/components/tabs/src/tabs.js +1 -1
- package/lib/components/tabs/src/tabs.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +1 -1
- package/lib/components/tooltip/src/trigger.js.map +1 -1
- package/lib/components/tree/src/model/useKeydown.js +1 -1
- package/lib/components/tree/src/model/useKeydown.js.map +1 -1
- package/lib/hooks/use-escape-keydown/index.js +2 -3
- package/lib/hooks/use-escape-keydown/index.js.map +1 -1
- package/lib/index.js +5 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
@@ -1,91 +1,637 @@
|
|
1
|
-
import {
|
2
|
-
import '
|
1
|
+
import { defineComponent, useAttrs, ref, computed, nextTick, watch, onMounted, openBlock, createBlock, unref, withCtx, withDirectives, createElementBlock, normalizeClass, normalizeStyle, createVNode, withModifiers, Fragment, renderList, toDisplayString, createElementVNode, withKeys, vModelText, createCommentVNode, isRef, renderSlot, vShow } from 'vue';
|
2
|
+
import { cloneDeep, debounce } from 'lodash-unified';
|
3
|
+
import { isClient, useCssVar, useResizeObserver } from '@vueuse/core';
|
3
4
|
import '../../../utils/index.mjs';
|
5
|
+
import { ElCascaderPanel } from '../../cascader-panel/index.mjs';
|
6
|
+
import { ElInput } from '../../input/index.mjs';
|
7
|
+
import { ElTooltip } from '../../tooltip/index.mjs';
|
8
|
+
import { ElScrollbar } from '../../scrollbar/index.mjs';
|
9
|
+
import { ElTag } from '../../tag/index.mjs';
|
10
|
+
import { ElIcon } from '../../icon/index.mjs';
|
11
|
+
import '../../form/index.mjs';
|
12
|
+
import '../../../directives/index.mjs';
|
4
13
|
import '../../../hooks/index.mjs';
|
5
|
-
import '../../tooltip/index.mjs';
|
6
|
-
import '../../tag/index.mjs';
|
7
14
|
import '../../../constants/index.mjs';
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
15
|
+
import { CircleClose, ArrowDown, Check } from '@element-plus/icons-vue';
|
16
|
+
import { cascaderProps, cascaderEmits } from './cascader.mjs';
|
17
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
18
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
19
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
20
|
+
import { useFormItem } from '../../form/src/hooks/use-form-item.mjs';
|
21
|
+
import { useEmptyValues } from '../../../hooks/use-empty-values/index.mjs';
|
22
|
+
import { useComposition } from '../../../hooks/use-composition/index.mjs';
|
23
|
+
import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
|
14
24
|
import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
|
15
|
-
import {
|
25
|
+
import { debugWarn } from '../../../utils/error.mjs';
|
26
|
+
import { EVENT_CODE } from '../../../constants/aria.mjs';
|
27
|
+
import { focusNode, getSibling } from '../../../utils/dom/aria.mjs';
|
28
|
+
import { isPromise } from '@vue/shared';
|
29
|
+
import ClickOutside from '../../../directives/click-outside/index.mjs';
|
16
30
|
|
17
|
-
const
|
18
|
-
|
19
|
-
|
20
|
-
placeholder: String,
|
21
|
-
disabled: Boolean,
|
22
|
-
clearable: Boolean,
|
23
|
-
filterable: Boolean,
|
24
|
-
filterMethod: {
|
25
|
-
type: definePropType(Function),
|
26
|
-
default: (node, keyword) => node.text.includes(keyword)
|
27
|
-
},
|
28
|
-
separator: {
|
29
|
-
type: String,
|
30
|
-
default: " / "
|
31
|
-
},
|
32
|
-
showAllLevels: {
|
33
|
-
type: Boolean,
|
34
|
-
default: true
|
35
|
-
},
|
36
|
-
collapseTags: Boolean,
|
37
|
-
maxCollapseTags: {
|
38
|
-
type: Number,
|
39
|
-
default: 1
|
40
|
-
},
|
41
|
-
collapseTagsTooltip: {
|
42
|
-
type: Boolean,
|
43
|
-
default: false
|
44
|
-
},
|
45
|
-
debounce: {
|
46
|
-
type: Number,
|
47
|
-
default: 300
|
48
|
-
},
|
49
|
-
beforeFilter: {
|
50
|
-
type: definePropType(Function),
|
51
|
-
default: () => true
|
52
|
-
},
|
53
|
-
placement: {
|
54
|
-
type: definePropType(String),
|
55
|
-
values: placements,
|
56
|
-
default: "bottom-start"
|
57
|
-
},
|
58
|
-
fallbackPlacements: {
|
59
|
-
type: definePropType(Array),
|
60
|
-
default: ["bottom-start", "bottom", "top-start", "top", "right", "left"]
|
61
|
-
},
|
62
|
-
popperClass: {
|
63
|
-
type: String,
|
64
|
-
default: ""
|
65
|
-
},
|
66
|
-
teleported: useTooltipContentProps.teleported,
|
67
|
-
tagType: { ...tagProps.type, default: "info" },
|
68
|
-
tagEffect: { ...tagProps.effect, default: "light" },
|
69
|
-
validateEvent: {
|
70
|
-
type: Boolean,
|
71
|
-
default: true
|
72
|
-
},
|
73
|
-
persistent: {
|
74
|
-
type: Boolean,
|
75
|
-
default: true
|
76
|
-
},
|
77
|
-
...useEmptyValuesProps
|
31
|
+
const COMPONENT_NAME = "ElCascader";
|
32
|
+
const __default__ = defineComponent({
|
33
|
+
name: COMPONENT_NAME
|
78
34
|
});
|
79
|
-
const
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
35
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
36
|
+
...__default__,
|
37
|
+
props: cascaderProps,
|
38
|
+
emits: cascaderEmits,
|
39
|
+
setup(__props, { expose, emit }) {
|
40
|
+
const props = __props;
|
41
|
+
const popperOptions = {
|
42
|
+
modifiers: [
|
43
|
+
{
|
44
|
+
name: "arrowPosition",
|
45
|
+
enabled: true,
|
46
|
+
phase: "main",
|
47
|
+
fn: ({ state }) => {
|
48
|
+
const { modifiersData, placement } = state;
|
49
|
+
if (["right", "left", "bottom", "top"].includes(placement))
|
50
|
+
return;
|
51
|
+
modifiersData.arrow.x = 35;
|
52
|
+
},
|
53
|
+
requires: ["arrow"]
|
54
|
+
}
|
55
|
+
]
|
56
|
+
};
|
57
|
+
const attrs = useAttrs();
|
58
|
+
let inputInitialHeight = 0;
|
59
|
+
let pressDeleteCount = 0;
|
60
|
+
const nsCascader = useNamespace("cascader");
|
61
|
+
const nsInput = useNamespace("input");
|
62
|
+
const { t } = useLocale();
|
63
|
+
const { form, formItem } = useFormItem();
|
64
|
+
const { valueOnClear } = useEmptyValues(props);
|
65
|
+
const { isComposing, handleComposition } = useComposition({
|
66
|
+
afterComposition(event) {
|
67
|
+
var _a;
|
68
|
+
const text = (_a = event.target) == null ? void 0 : _a.value;
|
69
|
+
handleInput(text);
|
70
|
+
}
|
71
|
+
});
|
72
|
+
const tooltipRef = ref(null);
|
73
|
+
const input = ref(null);
|
74
|
+
const tagWrapper = ref(null);
|
75
|
+
const cascaderPanelRef = ref(null);
|
76
|
+
const suggestionPanel = ref(null);
|
77
|
+
const popperVisible = ref(false);
|
78
|
+
const inputHover = ref(false);
|
79
|
+
const filtering = ref(false);
|
80
|
+
const filterFocus = ref(false);
|
81
|
+
const inputValue = ref("");
|
82
|
+
const searchInputValue = ref("");
|
83
|
+
const presentTags = ref([]);
|
84
|
+
const allPresentTags = ref([]);
|
85
|
+
const suggestions = ref([]);
|
86
|
+
const cascaderStyle = computed(() => {
|
87
|
+
return attrs.style;
|
88
|
+
});
|
89
|
+
const isDisabled = computed(() => props.disabled || (form == null ? void 0 : form.disabled));
|
90
|
+
const inputPlaceholder = computed(() => props.placeholder || t("el.cascader.placeholder"));
|
91
|
+
const currentPlaceholder = computed(() => searchInputValue.value || presentTags.value.length > 0 || isComposing.value ? "" : inputPlaceholder.value);
|
92
|
+
const realSize = useFormSize();
|
93
|
+
const tagSize = computed(() => ["small"].includes(realSize.value) ? "small" : "default");
|
94
|
+
const multiple = computed(() => !!props.props.multiple);
|
95
|
+
const readonly = computed(() => !props.filterable || multiple.value);
|
96
|
+
const searchKeyword = computed(() => multiple.value ? searchInputValue.value : inputValue.value);
|
97
|
+
const checkedNodes = computed(() => {
|
98
|
+
var _a;
|
99
|
+
return ((_a = cascaderPanelRef.value) == null ? void 0 : _a.checkedNodes) || [];
|
100
|
+
});
|
101
|
+
const clearBtnVisible = computed(() => {
|
102
|
+
if (!props.clearable || isDisabled.value || filtering.value || !inputHover.value)
|
103
|
+
return false;
|
104
|
+
return !!checkedNodes.value.length;
|
105
|
+
});
|
106
|
+
const presentText = computed(() => {
|
107
|
+
const { showAllLevels, separator } = props;
|
108
|
+
const nodes = checkedNodes.value;
|
109
|
+
return nodes.length ? multiple.value ? "" : nodes[0].calcText(showAllLevels, separator) : "";
|
110
|
+
});
|
111
|
+
const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
|
112
|
+
const checkedValue = computed({
|
113
|
+
get() {
|
114
|
+
return cloneDeep(props.modelValue);
|
115
|
+
},
|
116
|
+
set(val) {
|
117
|
+
const value = val != null ? val : valueOnClear.value;
|
118
|
+
emit(UPDATE_MODEL_EVENT, value);
|
119
|
+
emit(CHANGE_EVENT, value);
|
120
|
+
if (props.validateEvent) {
|
121
|
+
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
|
122
|
+
}
|
123
|
+
}
|
124
|
+
});
|
125
|
+
const cascaderKls = computed(() => {
|
126
|
+
return [
|
127
|
+
nsCascader.b(),
|
128
|
+
nsCascader.m(realSize.value),
|
129
|
+
nsCascader.is("disabled", isDisabled.value),
|
130
|
+
attrs.class
|
131
|
+
];
|
132
|
+
});
|
133
|
+
const cascaderIconKls = computed(() => {
|
134
|
+
return [
|
135
|
+
nsInput.e("icon"),
|
136
|
+
"icon-arrow-down",
|
137
|
+
nsCascader.is("reverse", popperVisible.value)
|
138
|
+
];
|
139
|
+
});
|
140
|
+
const inputClass = computed(() => {
|
141
|
+
return nsCascader.is("focus", popperVisible.value || filterFocus.value);
|
142
|
+
});
|
143
|
+
const contentRef = computed(() => {
|
144
|
+
var _a, _b;
|
145
|
+
return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
|
146
|
+
});
|
147
|
+
const togglePopperVisible = (visible) => {
|
148
|
+
var _a, _b, _c;
|
149
|
+
if (isDisabled.value)
|
150
|
+
return;
|
151
|
+
visible = visible != null ? visible : !popperVisible.value;
|
152
|
+
if (visible !== popperVisible.value) {
|
153
|
+
popperVisible.value = visible;
|
154
|
+
(_b = (_a = input.value) == null ? void 0 : _a.input) == null ? void 0 : _b.setAttribute("aria-expanded", `${visible}`);
|
155
|
+
if (visible) {
|
156
|
+
updatePopperPosition();
|
157
|
+
nextTick((_c = cascaderPanelRef.value) == null ? void 0 : _c.scrollToExpandingNode);
|
158
|
+
} else if (props.filterable) {
|
159
|
+
syncPresentTextValue();
|
160
|
+
}
|
161
|
+
emit("visibleChange", visible);
|
162
|
+
}
|
163
|
+
};
|
164
|
+
const updatePopperPosition = () => {
|
165
|
+
nextTick(() => {
|
166
|
+
var _a;
|
167
|
+
(_a = tooltipRef.value) == null ? void 0 : _a.updatePopper();
|
168
|
+
});
|
169
|
+
};
|
170
|
+
const hideSuggestionPanel = () => {
|
171
|
+
filtering.value = false;
|
172
|
+
};
|
173
|
+
const genTag = (node) => {
|
174
|
+
const { showAllLevels, separator } = props;
|
175
|
+
return {
|
176
|
+
node,
|
177
|
+
key: node.uid,
|
178
|
+
text: node.calcText(showAllLevels, separator),
|
179
|
+
hitState: false,
|
180
|
+
closable: !isDisabled.value && !node.isDisabled,
|
181
|
+
isCollapseTag: false
|
182
|
+
};
|
183
|
+
};
|
184
|
+
const deleteTag = (tag) => {
|
185
|
+
var _a;
|
186
|
+
const node = tag.node;
|
187
|
+
node.doCheck(false);
|
188
|
+
(_a = cascaderPanelRef.value) == null ? void 0 : _a.calculateCheckedValue();
|
189
|
+
emit("removeTag", node.valueByOption);
|
190
|
+
};
|
191
|
+
const calculatePresentTags = () => {
|
192
|
+
if (!multiple.value)
|
193
|
+
return;
|
194
|
+
const nodes = checkedNodes.value;
|
195
|
+
const tags = [];
|
196
|
+
const allTags = [];
|
197
|
+
nodes.forEach((node) => allTags.push(genTag(node)));
|
198
|
+
allPresentTags.value = allTags;
|
199
|
+
if (nodes.length) {
|
200
|
+
nodes.slice(0, props.maxCollapseTags).forEach((node) => tags.push(genTag(node)));
|
201
|
+
const rest = nodes.slice(props.maxCollapseTags);
|
202
|
+
const restCount = rest.length;
|
203
|
+
if (restCount) {
|
204
|
+
if (props.collapseTags) {
|
205
|
+
tags.push({
|
206
|
+
key: -1,
|
207
|
+
text: `+ ${restCount}`,
|
208
|
+
closable: false,
|
209
|
+
isCollapseTag: true
|
210
|
+
});
|
211
|
+
} else {
|
212
|
+
rest.forEach((node) => tags.push(genTag(node)));
|
213
|
+
}
|
214
|
+
}
|
215
|
+
}
|
216
|
+
presentTags.value = tags;
|
217
|
+
};
|
218
|
+
const calculateSuggestions = () => {
|
219
|
+
var _a, _b;
|
220
|
+
const { filterMethod, showAllLevels, separator } = props;
|
221
|
+
const res = (_b = (_a = cascaderPanelRef.value) == null ? void 0 : _a.getFlattedNodes(!props.props.checkStrictly)) == null ? void 0 : _b.filter((node) => {
|
222
|
+
if (node.isDisabled)
|
223
|
+
return false;
|
224
|
+
node.calcText(showAllLevels, separator);
|
225
|
+
return filterMethod(node, searchKeyword.value);
|
226
|
+
});
|
227
|
+
if (multiple.value) {
|
228
|
+
presentTags.value.forEach((tag) => {
|
229
|
+
tag.hitState = false;
|
230
|
+
});
|
231
|
+
allPresentTags.value.forEach((tag) => {
|
232
|
+
tag.hitState = false;
|
233
|
+
});
|
234
|
+
}
|
235
|
+
filtering.value = true;
|
236
|
+
suggestions.value = res;
|
237
|
+
updatePopperPosition();
|
238
|
+
};
|
239
|
+
const focusFirstNode = () => {
|
240
|
+
var _a;
|
241
|
+
let firstNode;
|
242
|
+
if (filtering.value && suggestionPanel.value) {
|
243
|
+
firstNode = suggestionPanel.value.$el.querySelector(`.${nsCascader.e("suggestion-item")}`);
|
244
|
+
} else {
|
245
|
+
firstNode = (_a = cascaderPanelRef.value) == null ? void 0 : _a.$el.querySelector(`.${nsCascader.b("node")}[tabindex="-1"]`);
|
246
|
+
}
|
247
|
+
if (firstNode) {
|
248
|
+
firstNode.focus();
|
249
|
+
!filtering.value && firstNode.click();
|
250
|
+
}
|
251
|
+
};
|
252
|
+
const updateStyle = () => {
|
253
|
+
var _a, _b;
|
254
|
+
const inputInner = (_a = input.value) == null ? void 0 : _a.input;
|
255
|
+
const tagWrapperEl = tagWrapper.value;
|
256
|
+
const suggestionPanelEl = (_b = suggestionPanel.value) == null ? void 0 : _b.$el;
|
257
|
+
if (!isClient || !inputInner)
|
258
|
+
return;
|
259
|
+
if (suggestionPanelEl) {
|
260
|
+
const suggestionList = suggestionPanelEl.querySelector(`.${nsCascader.e("suggestion-list")}`);
|
261
|
+
suggestionList.style.minWidth = `${inputInner.offsetWidth}px`;
|
262
|
+
}
|
263
|
+
if (tagWrapperEl) {
|
264
|
+
const { offsetHeight } = tagWrapperEl;
|
265
|
+
const height = presentTags.value.length > 0 ? `${Math.max(offsetHeight + 6, inputInitialHeight)}px` : `${inputInitialHeight}px`;
|
266
|
+
inputInner.style.height = height;
|
267
|
+
updatePopperPosition();
|
268
|
+
}
|
269
|
+
};
|
270
|
+
const getCheckedNodes = (leafOnly) => {
|
271
|
+
var _a;
|
272
|
+
return (_a = cascaderPanelRef.value) == null ? void 0 : _a.getCheckedNodes(leafOnly);
|
273
|
+
};
|
274
|
+
const handleExpandChange = (value) => {
|
275
|
+
updatePopperPosition();
|
276
|
+
emit("expandChange", value);
|
277
|
+
};
|
278
|
+
const handleKeyDown = (e) => {
|
279
|
+
if (isComposing.value)
|
280
|
+
return;
|
281
|
+
switch (e.code) {
|
282
|
+
case EVENT_CODE.enter:
|
283
|
+
case EVENT_CODE.numpadEnter:
|
284
|
+
togglePopperVisible();
|
285
|
+
break;
|
286
|
+
case EVENT_CODE.down:
|
287
|
+
togglePopperVisible(true);
|
288
|
+
nextTick(focusFirstNode);
|
289
|
+
e.preventDefault();
|
290
|
+
break;
|
291
|
+
case EVENT_CODE.esc:
|
292
|
+
if (popperVisible.value === true) {
|
293
|
+
e.preventDefault();
|
294
|
+
e.stopPropagation();
|
295
|
+
togglePopperVisible(false);
|
296
|
+
}
|
297
|
+
break;
|
298
|
+
case EVENT_CODE.tab:
|
299
|
+
togglePopperVisible(false);
|
300
|
+
break;
|
301
|
+
}
|
302
|
+
};
|
303
|
+
const handleClear = () => {
|
304
|
+
var _a;
|
305
|
+
(_a = cascaderPanelRef.value) == null ? void 0 : _a.clearCheckedNodes();
|
306
|
+
if (!popperVisible.value && props.filterable) {
|
307
|
+
syncPresentTextValue();
|
308
|
+
}
|
309
|
+
togglePopperVisible(false);
|
310
|
+
emit("clear");
|
311
|
+
};
|
312
|
+
const syncPresentTextValue = () => {
|
313
|
+
const { value } = presentText;
|
314
|
+
inputValue.value = value;
|
315
|
+
searchInputValue.value = value;
|
316
|
+
};
|
317
|
+
const handleSuggestionClick = (node) => {
|
318
|
+
var _a, _b;
|
319
|
+
const { checked } = node;
|
320
|
+
if (multiple.value) {
|
321
|
+
(_a = cascaderPanelRef.value) == null ? void 0 : _a.handleCheckChange(node, !checked, false);
|
322
|
+
} else {
|
323
|
+
!checked && ((_b = cascaderPanelRef.value) == null ? void 0 : _b.handleCheckChange(node, true, false));
|
324
|
+
togglePopperVisible(false);
|
325
|
+
}
|
326
|
+
};
|
327
|
+
const handleSuggestionKeyDown = (e) => {
|
328
|
+
const target = e.target;
|
329
|
+
const { code } = e;
|
330
|
+
switch (code) {
|
331
|
+
case EVENT_CODE.up:
|
332
|
+
case EVENT_CODE.down: {
|
333
|
+
const distance = code === EVENT_CODE.up ? -1 : 1;
|
334
|
+
focusNode(getSibling(target, distance, `.${nsCascader.e("suggestion-item")}[tabindex="-1"]`));
|
335
|
+
break;
|
336
|
+
}
|
337
|
+
case EVENT_CODE.enter:
|
338
|
+
case EVENT_CODE.numpadEnter:
|
339
|
+
target.click();
|
340
|
+
break;
|
341
|
+
}
|
342
|
+
};
|
343
|
+
const handleDelete = () => {
|
344
|
+
const tags = presentTags.value;
|
345
|
+
const lastTag = tags[tags.length - 1];
|
346
|
+
pressDeleteCount = searchInputValue.value ? 0 : pressDeleteCount + 1;
|
347
|
+
if (!lastTag || !pressDeleteCount || props.collapseTags && tags.length > 1)
|
348
|
+
return;
|
349
|
+
if (lastTag.hitState) {
|
350
|
+
deleteTag(lastTag);
|
351
|
+
} else {
|
352
|
+
lastTag.hitState = true;
|
353
|
+
}
|
354
|
+
};
|
355
|
+
const handleFocus = (e) => {
|
356
|
+
const el = e.target;
|
357
|
+
const name = nsCascader.e("search-input");
|
358
|
+
if (el.className === name) {
|
359
|
+
filterFocus.value = true;
|
360
|
+
}
|
361
|
+
emit("focus", e);
|
362
|
+
};
|
363
|
+
const handleBlur = (e) => {
|
364
|
+
filterFocus.value = false;
|
365
|
+
emit("blur", e);
|
366
|
+
};
|
367
|
+
const handleFilter = debounce(() => {
|
368
|
+
const { value } = searchKeyword;
|
369
|
+
if (!value)
|
370
|
+
return;
|
371
|
+
const passed = props.beforeFilter(value);
|
372
|
+
if (isPromise(passed)) {
|
373
|
+
passed.then(calculateSuggestions).catch(() => {
|
374
|
+
});
|
375
|
+
} else if (passed !== false) {
|
376
|
+
calculateSuggestions();
|
377
|
+
} else {
|
378
|
+
hideSuggestionPanel();
|
379
|
+
}
|
380
|
+
}, props.debounce);
|
381
|
+
const handleInput = (val, e) => {
|
382
|
+
!popperVisible.value && togglePopperVisible(true);
|
383
|
+
if (e == null ? void 0 : e.isComposing)
|
384
|
+
return;
|
385
|
+
val ? handleFilter() : hideSuggestionPanel();
|
386
|
+
};
|
387
|
+
const getInputInnerHeight = (inputInner) => Number.parseFloat(useCssVar(nsInput.cssVarName("input-height"), inputInner).value) - 2;
|
388
|
+
watch(filtering, updatePopperPosition);
|
389
|
+
watch([checkedNodes, isDisabled, () => props.collapseTags], calculatePresentTags);
|
390
|
+
watch(presentTags, () => {
|
391
|
+
nextTick(() => updateStyle());
|
392
|
+
});
|
393
|
+
watch(realSize, async () => {
|
394
|
+
await nextTick();
|
395
|
+
const inputInner = input.value.input;
|
396
|
+
inputInitialHeight = getInputInnerHeight(inputInner) || inputInitialHeight;
|
397
|
+
updateStyle();
|
398
|
+
});
|
399
|
+
watch(presentText, syncPresentTextValue, { immediate: true });
|
400
|
+
onMounted(() => {
|
401
|
+
const inputInner = input.value.input;
|
402
|
+
const inputInnerHeight = getInputInnerHeight(inputInner);
|
403
|
+
inputInitialHeight = inputInner.offsetHeight || inputInnerHeight;
|
404
|
+
useResizeObserver(inputInner, updateStyle);
|
405
|
+
});
|
406
|
+
expose({
|
407
|
+
getCheckedNodes,
|
408
|
+
cascaderPanelRef,
|
409
|
+
togglePopperVisible,
|
410
|
+
contentRef,
|
411
|
+
presentText
|
412
|
+
});
|
413
|
+
return (_ctx, _cache) => {
|
414
|
+
return openBlock(), createBlock(unref(ElTooltip), {
|
415
|
+
ref_key: "tooltipRef",
|
416
|
+
ref: tooltipRef,
|
417
|
+
visible: popperVisible.value,
|
418
|
+
teleported: _ctx.teleported,
|
419
|
+
"popper-class": [unref(nsCascader).e("dropdown"), _ctx.popperClass],
|
420
|
+
"popper-options": popperOptions,
|
421
|
+
"fallback-placements": _ctx.fallbackPlacements,
|
422
|
+
"stop-popper-mouse-event": false,
|
423
|
+
"gpu-acceleration": false,
|
424
|
+
placement: _ctx.placement,
|
425
|
+
transition: `${unref(nsCascader).namespace.value}-zoom-in-top`,
|
426
|
+
effect: "light",
|
427
|
+
pure: "",
|
428
|
+
persistent: _ctx.persistent,
|
429
|
+
onHide: hideSuggestionPanel
|
430
|
+
}, {
|
431
|
+
default: withCtx(() => [
|
432
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
433
|
+
class: normalizeClass(unref(cascaderKls)),
|
434
|
+
style: normalizeStyle(unref(cascaderStyle)),
|
435
|
+
onClick: () => togglePopperVisible(unref(readonly) ? void 0 : true),
|
436
|
+
onKeydown: handleKeyDown,
|
437
|
+
onMouseenter: ($event) => inputHover.value = true,
|
438
|
+
onMouseleave: ($event) => inputHover.value = false
|
439
|
+
}, [
|
440
|
+
createVNode(unref(ElInput), {
|
441
|
+
ref_key: "input",
|
442
|
+
ref: input,
|
443
|
+
modelValue: inputValue.value,
|
444
|
+
"onUpdate:modelValue": ($event) => inputValue.value = $event,
|
445
|
+
placeholder: unref(currentPlaceholder),
|
446
|
+
readonly: unref(readonly),
|
447
|
+
disabled: unref(isDisabled),
|
448
|
+
"validate-event": false,
|
449
|
+
size: unref(realSize),
|
450
|
+
class: normalizeClass(unref(inputClass)),
|
451
|
+
tabindex: unref(multiple) && _ctx.filterable && !unref(isDisabled) ? -1 : void 0,
|
452
|
+
onCompositionstart: unref(handleComposition),
|
453
|
+
onCompositionupdate: unref(handleComposition),
|
454
|
+
onCompositionend: unref(handleComposition),
|
455
|
+
onFocus: handleFocus,
|
456
|
+
onBlur: handleBlur,
|
457
|
+
onInput: handleInput
|
458
|
+
}, {
|
459
|
+
suffix: withCtx(() => [
|
460
|
+
unref(clearBtnVisible) ? (openBlock(), createBlock(unref(ElIcon), {
|
461
|
+
key: "clear",
|
462
|
+
class: normalizeClass([unref(nsInput).e("icon"), "icon-circle-close"]),
|
463
|
+
onClick: withModifiers(handleClear, ["stop"])
|
464
|
+
}, {
|
465
|
+
default: withCtx(() => [
|
466
|
+
createVNode(unref(CircleClose))
|
467
|
+
]),
|
468
|
+
_: 1
|
469
|
+
}, 8, ["class", "onClick"])) : (openBlock(), createBlock(unref(ElIcon), {
|
470
|
+
key: "arrow-down",
|
471
|
+
class: normalizeClass(unref(cascaderIconKls)),
|
472
|
+
onClick: withModifiers(($event) => togglePopperVisible(), ["stop"])
|
473
|
+
}, {
|
474
|
+
default: withCtx(() => [
|
475
|
+
createVNode(unref(ArrowDown))
|
476
|
+
]),
|
477
|
+
_: 1
|
478
|
+
}, 8, ["class", "onClick"]))
|
479
|
+
]),
|
480
|
+
_: 1
|
481
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "readonly", "disabled", "size", "class", "tabindex", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
|
482
|
+
unref(multiple) ? (openBlock(), createElementBlock("div", {
|
483
|
+
key: 0,
|
484
|
+
ref_key: "tagWrapper",
|
485
|
+
ref: tagWrapper,
|
486
|
+
class: normalizeClass([
|
487
|
+
unref(nsCascader).e("tags"),
|
488
|
+
unref(nsCascader).is("validate", Boolean(unref(validateState)))
|
489
|
+
])
|
490
|
+
}, [
|
491
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(presentTags.value, (tag) => {
|
492
|
+
return openBlock(), createBlock(unref(ElTag), {
|
493
|
+
key: tag.key,
|
494
|
+
type: _ctx.tagType,
|
495
|
+
size: unref(tagSize),
|
496
|
+
effect: _ctx.tagEffect,
|
497
|
+
hit: tag.hitState,
|
498
|
+
closable: tag.closable,
|
499
|
+
"disable-transitions": "",
|
500
|
+
onClose: ($event) => deleteTag(tag)
|
501
|
+
}, {
|
502
|
+
default: withCtx(() => [
|
503
|
+
tag.isCollapseTag === false ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(tag.text), 1)) : (openBlock(), createBlock(unref(ElTooltip), {
|
504
|
+
key: 1,
|
505
|
+
disabled: popperVisible.value || !_ctx.collapseTagsTooltip,
|
506
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
507
|
+
placement: "bottom",
|
508
|
+
effect: "light"
|
509
|
+
}, {
|
510
|
+
default: withCtx(() => [
|
511
|
+
createElementVNode("span", null, toDisplayString(tag.text), 1)
|
512
|
+
]),
|
513
|
+
content: withCtx(() => [
|
514
|
+
createElementVNode("div", {
|
515
|
+
class: normalizeClass(unref(nsCascader).e("collapse-tags"))
|
516
|
+
}, [
|
517
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(allPresentTags.value.slice(_ctx.maxCollapseTags), (tag2, idx) => {
|
518
|
+
return openBlock(), createElementBlock("div", {
|
519
|
+
key: idx,
|
520
|
+
class: normalizeClass(unref(nsCascader).e("collapse-tag"))
|
521
|
+
}, [
|
522
|
+
(openBlock(), createBlock(unref(ElTag), {
|
523
|
+
key: tag2.key,
|
524
|
+
class: "in-tooltip",
|
525
|
+
type: _ctx.tagType,
|
526
|
+
size: unref(tagSize),
|
527
|
+
effect: _ctx.tagEffect,
|
528
|
+
hit: tag2.hitState,
|
529
|
+
closable: tag2.closable,
|
530
|
+
"disable-transitions": "",
|
531
|
+
onClose: ($event) => deleteTag(tag2)
|
532
|
+
}, {
|
533
|
+
default: withCtx(() => [
|
534
|
+
createElementVNode("span", null, toDisplayString(tag2.text), 1)
|
535
|
+
]),
|
536
|
+
_: 2
|
537
|
+
}, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]))
|
538
|
+
], 2);
|
539
|
+
}), 128))
|
540
|
+
], 2)
|
541
|
+
]),
|
542
|
+
_: 2
|
543
|
+
}, 1032, ["disabled"]))
|
544
|
+
]),
|
545
|
+
_: 2
|
546
|
+
}, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]);
|
547
|
+
}), 128)),
|
548
|
+
_ctx.filterable && !unref(isDisabled) ? withDirectives((openBlock(), createElementBlock("input", {
|
549
|
+
key: 0,
|
550
|
+
"onUpdate:modelValue": ($event) => searchInputValue.value = $event,
|
551
|
+
type: "text",
|
552
|
+
class: normalizeClass(unref(nsCascader).e("search-input")),
|
553
|
+
placeholder: unref(presentText) ? "" : unref(inputPlaceholder),
|
554
|
+
onInput: (e) => handleInput(searchInputValue.value, e),
|
555
|
+
onClick: withModifiers(($event) => togglePopperVisible(true), ["stop"]),
|
556
|
+
onKeydown: withKeys(handleDelete, ["delete"]),
|
557
|
+
onCompositionstart: unref(handleComposition),
|
558
|
+
onCompositionupdate: unref(handleComposition),
|
559
|
+
onCompositionend: unref(handleComposition),
|
560
|
+
onFocus: handleFocus,
|
561
|
+
onBlur: handleBlur
|
562
|
+
}, null, 42, ["onUpdate:modelValue", "placeholder", "onInput", "onClick", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend"])), [
|
563
|
+
[vModelText, searchInputValue.value]
|
564
|
+
]) : createCommentVNode("v-if", true)
|
565
|
+
], 2)) : createCommentVNode("v-if", true)
|
566
|
+
], 46, ["onClick", "onMouseenter", "onMouseleave"])), [
|
567
|
+
[unref(ClickOutside), () => togglePopperVisible(false), unref(contentRef)]
|
568
|
+
])
|
569
|
+
]),
|
570
|
+
content: withCtx(() => [
|
571
|
+
withDirectives(createVNode(unref(ElCascaderPanel), {
|
572
|
+
ref_key: "cascaderPanelRef",
|
573
|
+
ref: cascaderPanelRef,
|
574
|
+
modelValue: unref(checkedValue),
|
575
|
+
"onUpdate:modelValue": ($event) => isRef(checkedValue) ? checkedValue.value = $event : null,
|
576
|
+
options: _ctx.options,
|
577
|
+
props: props.props,
|
578
|
+
border: false,
|
579
|
+
"render-label": _ctx.$slots.default,
|
580
|
+
onExpandChange: handleExpandChange,
|
581
|
+
onClose: ($event) => _ctx.$nextTick(() => togglePopperVisible(false))
|
582
|
+
}, {
|
583
|
+
empty: withCtx(() => [
|
584
|
+
renderSlot(_ctx.$slots, "empty")
|
585
|
+
]),
|
586
|
+
_: 3
|
587
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "render-label", "onClose"]), [
|
588
|
+
[vShow, !filtering.value]
|
589
|
+
]),
|
590
|
+
_ctx.filterable ? withDirectives((openBlock(), createBlock(unref(ElScrollbar), {
|
591
|
+
key: 0,
|
592
|
+
ref_key: "suggestionPanel",
|
593
|
+
ref: suggestionPanel,
|
594
|
+
tag: "ul",
|
595
|
+
class: normalizeClass(unref(nsCascader).e("suggestion-panel")),
|
596
|
+
"view-class": unref(nsCascader).e("suggestion-list"),
|
597
|
+
onKeydown: handleSuggestionKeyDown
|
598
|
+
}, {
|
599
|
+
default: withCtx(() => [
|
600
|
+
suggestions.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(suggestions.value, (item) => {
|
601
|
+
return openBlock(), createElementBlock("li", {
|
602
|
+
key: item.uid,
|
603
|
+
class: normalizeClass([
|
604
|
+
unref(nsCascader).e("suggestion-item"),
|
605
|
+
unref(nsCascader).is("checked", item.checked)
|
606
|
+
]),
|
607
|
+
tabindex: -1,
|
608
|
+
onClick: ($event) => handleSuggestionClick(item)
|
609
|
+
}, [
|
610
|
+
createElementVNode("span", null, toDisplayString(item.text), 1),
|
611
|
+
item.checked ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
612
|
+
default: withCtx(() => [
|
613
|
+
createVNode(unref(Check))
|
614
|
+
]),
|
615
|
+
_: 1
|
616
|
+
})) : createCommentVNode("v-if", true)
|
617
|
+
], 10, ["onClick"]);
|
618
|
+
}), 128)) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
619
|
+
createElementVNode("li", {
|
620
|
+
class: normalizeClass(unref(nsCascader).e("empty-text"))
|
621
|
+
}, toDisplayString(unref(t)("el.cascader.noMatch")), 3)
|
622
|
+
])
|
623
|
+
]),
|
624
|
+
_: 3
|
625
|
+
}, 8, ["class", "view-class"])), [
|
626
|
+
[vShow, filtering.value]
|
627
|
+
]) : createCommentVNode("v-if", true)
|
628
|
+
]),
|
629
|
+
_: 3
|
630
|
+
}, 8, ["visible", "teleported", "popper-class", "fallback-placements", "placement", "transition", "persistent"]);
|
631
|
+
};
|
632
|
+
}
|
633
|
+
});
|
634
|
+
var Cascader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "cascader.vue"]]);
|
89
635
|
|
90
|
-
export {
|
636
|
+
export { Cascader as default };
|
91
637
|
//# sourceMappingURL=cascader2.mjs.map
|