@element-plus/nightly 0.0.20240922 → 0.0.20240924
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.full.js +81 -58
- package/dist/index.full.min.js +10 -10
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +9 -9
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +81 -58
- 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/autocomplete/index.mjs +2 -2
- package/es/components/autocomplete/src/autocomplete.mjs +365 -81
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete2.mjs +81 -365
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +70 -8
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +8 -70
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/cascader/src/cascader.mjs +1 -1
- package/es/components/cascader/src/cascader.vue.d.ts +4 -0
- package/es/components/cascader/src/cascader2.mjs +2 -1
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +66 -43
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +43 -66
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse-item.mjs +19 -90
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item2.mjs +90 -19
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/color-picker/src/color-picker2.mjs +5 -6
- package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
- package/es/components/descriptions/src/description2.mjs +1 -1
- package/es/components/descriptions/src/descriptions-row.mjs +7 -63
- package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
- package/es/components/descriptions/src/descriptions-row2.mjs +63 -7
- package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
- package/es/components/divider/index.mjs +2 -2
- package/es/components/divider/src/divider.mjs +17 -35
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider2.mjs +35 -17
- package/es/components/divider/src/divider2.mjs.map +1 -1
- package/es/components/empty/index.mjs +2 -2
- package/es/components/empty/src/empty.mjs +11 -53
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty2.mjs +53 -11
- package/es/components/empty/src/empty2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +45 -392
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +392 -45
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +19 -19
- package/es/components/input-number/src/input-number.vue.d.ts +2 -0
- package/es/components/input-number/src/input-number2.mjs +15 -2
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown.mjs +15 -167
- package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
- package/es/components/mention/src/mention-dropdown2.mjs +167 -15
- package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item.mjs +14 -97
- package/es/components/menu/src/menu-item.mjs.map +1 -1
- package/es/components/menu/src/menu-item2.mjs +97 -14
- package/es/components/menu/src/menu-item2.mjs.map +1 -1
- package/es/components/notification/index.mjs +1 -1
- package/es/components/notification/src/notification.mjs +64 -145
- package/es/components/notification/src/notification.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +145 -64
- package/es/components/notification/src/notification2.mjs.map +1 -1
- package/es/components/notification/src/notify.mjs +2 -2
- 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/components/prev.mjs +18 -36
- package/es/components/pagination/src/components/prev.mjs.map +1 -1
- package/es/components/pagination/src/components/prev2.mjs +36 -18
- package/es/components/pagination/src/components/prev2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +2 -2
- package/es/components/popover/index.mjs +2 -2
- package/es/components/popover/src/popover.mjs +66 -111
- package/es/components/popover/src/popover.mjs.map +1 -1
- package/es/components/popover/src/popover2.mjs +111 -66
- package/es/components/popover/src/popover2.mjs.map +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/content.mjs +137 -93
- package/es/components/popper/src/content.mjs.map +1 -1
- package/es/components/popper/src/content2.mjs +93 -137
- package/es/components/popper/src/content2.mjs.map +1 -1
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select-v2/src/defaults.d.ts +19 -0
- package/es/components/select-v2/src/defaults.mjs +18 -2
- package/es/components/select-v2/src/defaults.mjs.map +1 -1
- package/es/components/select-v2/src/group-item.mjs +4 -2
- package/es/components/select-v2/src/group-item.mjs.map +1 -1
- package/es/components/select-v2/src/group-item.vue.d.ts +7 -2
- package/es/components/select-v2/src/option-item.mjs +2 -2
- package/es/components/select-v2/src/option-item.mjs.map +1 -1
- package/es/components/select-v2/src/option-item.vue.d.ts +6 -3
- package/es/components/select-v2/src/select-dropdown.d.ts +23 -1
- package/es/components/select-v2/src/select-dropdown.mjs +20 -19
- package/es/components/select-v2/src/select-dropdown.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +3 -12
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/select-v2/src/select.types.d.ts +15 -0
- package/es/components/select-v2/src/select.vue.d.ts +45 -53
- package/es/components/select-v2/src/token.d.ts +7 -8
- package/es/components/select-v2/src/token.mjs.map +1 -1
- package/es/components/select-v2/src/useAllowCreate.d.ts +2 -2
- package/es/components/select-v2/src/useAllowCreate.mjs +1 -1
- package/es/components/select-v2/src/useAllowCreate.mjs.map +1 -1
- package/es/components/select-v2/src/useOption.d.ts +2 -1
- package/es/components/select-v2/src/useOption.mjs.map +1 -1
- package/es/components/select-v2/src/useSelect.d.ts +33 -47
- package/es/components/select-v2/src/useSelect.mjs +17 -13
- package/es/components/select-v2/src/useSelect.mjs.map +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +229 -72
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +72 -229
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +1 -1
- package/es/components/tabs/src/tab-bar.mjs +96 -7
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +7 -96
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +98 -29
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +29 -98
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/time-select/index.mjs +2 -2
- package/es/components/time-select/src/time-select.mjs +51 -124
- package/es/components/time-select/src/time-select.mjs.map +1 -1
- package/es/components/time-select/src/time-select2.mjs +124 -51
- package/es/components/time-select/src/time-select2.mjs.map +1 -1
- package/es/components/tooltip/src/content.mjs +1 -1
- package/es/components/tooltip/src/content2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +2 -2
- package/es/components/tooltip-v2/src/tooltip.mjs +77 -20
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +20 -77
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/tour/index.mjs +2 -2
- package/es/components/tour/src/mask.mjs +19 -76
- package/es/components/tour/src/mask.mjs.map +1 -1
- package/es/components/tour/src/mask2.mjs +76 -19
- package/es/components/tour/src/mask2.mjs.map +1 -1
- package/es/components/tour/src/step.mjs +44 -169
- package/es/components/tour/src/step.mjs.map +1 -1
- package/es/components/tour/src/step2.mjs +169 -44
- package/es/components/tour/src/step2.mjs.map +1 -1
- package/es/components/tour/src/tour2.mjs +1 -1
- package/es/components/upload/index.mjs +2 -2
- package/es/components/upload/src/upload-content.mjs +1 -1
- package/es/components/upload/src/upload-content2.mjs +1 -1
- package/es/components/upload/src/upload-list.mjs +1 -1
- package/es/components/upload/src/upload.mjs +124 -98
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +98 -124
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/components/upload/src/use-handlers.mjs +1 -1
- package/es/components/virtual-list/index.d.ts +2 -0
- package/es/components/virtual-list/src/builders/build-list.mjs.map +1 -1
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -0
- package/es/components/virtual-list/src/components/dynamic-size-list.mjs.map +1 -1
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +1 -0
- package/es/components/virtual-list/src/components/fixed-size-list.mjs.map +1 -1
- package/es/components/virtual-list/src/hooks/use-cache.d.ts +1 -1
- package/es/components/virtual-list/src/hooks/use-cache.mjs.map +1 -1
- package/es/components/watermark/index.mjs +2 -2
- package/es/components/watermark/src/watermark.mjs +28 -209
- package/es/components/watermark/src/watermark.mjs.map +1 -1
- package/es/components/watermark/src/watermark2.mjs +209 -28
- package/es/components/watermark/src/watermark2.mjs.map +1 -1
- package/es/index.mjs +19 -19
- package/es/utils/vue/typescript.d.ts +2 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/index.js +2 -2
- package/lib/components/autocomplete/src/autocomplete.js +363 -80
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete2.js +80 -363
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +70 -8
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +8 -70
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/cascader/src/cascader.js +1 -1
- package/lib/components/cascader/src/cascader.vue.d.ts +4 -0
- package/lib/components/cascader/src/cascader2.js +2 -1
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +66 -43
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +43 -66
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse-item.js +19 -90
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item2.js +90 -19
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/color-picker/src/color-picker2.js +5 -6
- package/lib/components/color-picker/src/color-picker2.js.map +1 -1
- package/lib/components/descriptions/src/description2.js +1 -1
- package/lib/components/descriptions/src/descriptions-row.js +7 -63
- package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
- package/lib/components/descriptions/src/descriptions-row2.js +63 -7
- package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
- package/lib/components/divider/index.js +2 -2
- package/lib/components/divider/src/divider.js +17 -35
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider2.js +35 -17
- package/lib/components/divider/src/divider2.js.map +1 -1
- package/lib/components/empty/index.js +2 -2
- package/lib/components/empty/src/empty.js +11 -53
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty2.js +53 -11
- package/lib/components/empty/src/empty2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +46 -392
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +392 -46
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +19 -19
- package/lib/components/input-number/src/input-number.vue.d.ts +2 -0
- package/lib/components/input-number/src/input-number2.js +14 -1
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown.js +16 -167
- package/lib/components/mention/src/mention-dropdown.js.map +1 -1
- package/lib/components/mention/src/mention-dropdown2.js +167 -16
- package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
- package/lib/components/mention/src/mention2.js +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item.js +15 -97
- package/lib/components/menu/src/menu-item.js.map +1 -1
- package/lib/components/menu/src/menu-item2.js +97 -15
- package/lib/components/menu/src/menu-item2.js.map +1 -1
- package/lib/components/notification/index.js +1 -1
- package/lib/components/notification/src/notification.js +65 -144
- package/lib/components/notification/src/notification.js.map +1 -1
- package/lib/components/notification/src/notification2.js +144 -65
- package/lib/components/notification/src/notification2.js.map +1 -1
- package/lib/components/notification/src/notify.js +2 -2
- 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/components/prev.js +19 -36
- package/lib/components/pagination/src/components/prev.js.map +1 -1
- package/lib/components/pagination/src/components/prev2.js +36 -19
- package/lib/components/pagination/src/components/prev2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +2 -2
- package/lib/components/popover/index.js +2 -2
- package/lib/components/popover/src/popover.js +67 -111
- package/lib/components/popover/src/popover.js.map +1 -1
- package/lib/components/popover/src/popover2.js +111 -67
- package/lib/components/popover/src/popover2.js.map +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/content.js +137 -98
- package/lib/components/popper/src/content.js.map +1 -1
- package/lib/components/popper/src/content2.js +98 -137
- package/lib/components/popper/src/content2.js.map +1 -1
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select-v2/src/defaults.d.ts +19 -0
- package/lib/components/select-v2/src/defaults.js +19 -1
- package/lib/components/select-v2/src/defaults.js.map +1 -1
- package/lib/components/select-v2/src/group-item.js +4 -2
- package/lib/components/select-v2/src/group-item.js.map +1 -1
- package/lib/components/select-v2/src/group-item.vue.d.ts +7 -2
- package/lib/components/select-v2/src/option-item.js +1 -1
- package/lib/components/select-v2/src/option-item.js.map +1 -1
- package/lib/components/select-v2/src/option-item.vue.d.ts +6 -3
- package/lib/components/select-v2/src/select-dropdown.d.ts +23 -1
- package/lib/components/select-v2/src/select-dropdown.js +20 -19
- package/lib/components/select-v2/src/select-dropdown.js.map +1 -1
- package/lib/components/select-v2/src/select.js +2 -11
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/select-v2/src/select.types.d.ts +15 -0
- package/lib/components/select-v2/src/select.vue.d.ts +45 -53
- package/lib/components/select-v2/src/token.d.ts +7 -8
- package/lib/components/select-v2/src/token.js.map +1 -1
- package/lib/components/select-v2/src/useAllowCreate.d.ts +2 -2
- package/lib/components/select-v2/src/useAllowCreate.js +1 -1
- package/lib/components/select-v2/src/useAllowCreate.js.map +1 -1
- package/lib/components/select-v2/src/useOption.d.ts +2 -1
- package/lib/components/select-v2/src/useOption.js.map +1 -1
- package/lib/components/select-v2/src/useSelect.d.ts +33 -47
- package/lib/components/select-v2/src/useSelect.js +17 -13
- package/lib/components/select-v2/src/useSelect.js.map +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +228 -72
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +72 -228
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/tabs/src/tab-bar.js +96 -7
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +7 -96
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +98 -30
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +30 -98
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/time-select/index.js +2 -2
- package/lib/components/time-select/src/time-select.js +51 -129
- package/lib/components/time-select/src/time-select.js.map +1 -1
- package/lib/components/time-select/src/time-select2.js +129 -51
- package/lib/components/time-select/src/time-select2.js.map +1 -1
- package/lib/components/tooltip/src/content.js +1 -1
- package/lib/components/tooltip/src/content2.js +1 -1
- package/lib/components/tooltip-v2/index.js +2 -2
- package/lib/components/tooltip-v2/src/tooltip.js +77 -20
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +20 -77
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/tour/index.js +2 -2
- package/lib/components/tour/src/mask.js +19 -76
- package/lib/components/tour/src/mask.js.map +1 -1
- package/lib/components/tour/src/mask2.js +76 -19
- package/lib/components/tour/src/mask2.js.map +1 -1
- package/lib/components/tour/src/step.js +44 -168
- package/lib/components/tour/src/step.js.map +1 -1
- package/lib/components/tour/src/step2.js +168 -44
- package/lib/components/tour/src/step2.js.map +1 -1
- package/lib/components/tour/src/tour2.js +1 -1
- package/lib/components/upload/index.js +2 -2
- package/lib/components/upload/src/upload-content.js +1 -1
- package/lib/components/upload/src/upload-content2.js +1 -1
- package/lib/components/upload/src/upload-list.js +1 -1
- package/lib/components/upload/src/upload.js +124 -101
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +101 -124
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/components/upload/src/use-handlers.js +1 -1
- package/lib/components/virtual-list/index.d.ts +2 -0
- package/lib/components/virtual-list/src/builders/build-list.js.map +1 -1
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -0
- package/lib/components/virtual-list/src/components/dynamic-size-list.js.map +1 -1
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +1 -0
- package/lib/components/virtual-list/src/components/fixed-size-list.js.map +1 -1
- package/lib/components/virtual-list/src/hooks/use-cache.d.ts +1 -1
- package/lib/components/virtual-list/src/hooks/use-cache.js.map +1 -1
- package/lib/components/watermark/index.js +2 -2
- package/lib/components/watermark/src/watermark.js +28 -209
- package/lib/components/watermark/src/watermark.js.map +1 -1
- package/lib/components/watermark/src/watermark2.js +209 -28
- package/lib/components/watermark/src/watermark2.js.map +1 -1
- package/lib/index.js +19 -19
- package/lib/utils/vue/typescript.d.ts +2 -1
- 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/theme-chalk/el-avatar.css +1 -1
- package/theme-chalk/el-transfer.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/avatar.scss +1 -0
- package/theme-chalk/src/transfer.scss +0 -1
- package/web-types.json +1 -1
|
@@ -333,7 +333,20 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
333
333
|
onFocus: handleFocus,
|
|
334
334
|
onInput: handleInput,
|
|
335
335
|
onChange: handleInputChange
|
|
336
|
-
},
|
|
336
|
+
}, vue.createSlots({ _: 2 }, [
|
|
337
|
+
_ctx.$slots.prefix ? {
|
|
338
|
+
name: "prefix",
|
|
339
|
+
fn: vue.withCtx(() => [
|
|
340
|
+
vue.renderSlot(_ctx.$slots, "prefix")
|
|
341
|
+
])
|
|
342
|
+
} : void 0,
|
|
343
|
+
_ctx.$slots.suffix ? {
|
|
344
|
+
name: "suffix",
|
|
345
|
+
fn: vue.withCtx(() => [
|
|
346
|
+
vue.renderSlot(_ctx.$slots, "suffix")
|
|
347
|
+
])
|
|
348
|
+
} : void 0
|
|
349
|
+
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
|
|
337
350
|
], 42, ["onDragstart"]);
|
|
338
351
|
};
|
|
339
352
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-number2.js","sources":["../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n type=\"number\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n @keydown.up.prevent=\"increase\"\n @keydown.down.prevent=\"decrease\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n />\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, reactive, ref, watch } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n debugWarn,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits, inputNumberProps } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = defineProps(inputNumberProps)\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst inputNumberSize = useFormSize()\nconst inputNumberDisabled = useFormDisabled()\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = Number(value)\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(Math.round(newVal / step) * step, precision)\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n if (oldVal === newVal && value) return\n data.userInput = null\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n const newVal = value === '' ? null : Number(value)\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number(value) : ''\n if ((isNumber(newVal) && !Number.isNaN(newVal)) || value === '') {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"names":["useLocale","useNamespace","ref","reactive","useFormItem","computed","isNumber","isUndefined","debugWarn","useFormSize","useFormDisabled","isNil","INPUT_EVENT","throwError","isString","UPDATE_MODEL_EVENT","CHANGE_EVENT","watch","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;uCA8Fc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,MAAMA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,cAAc,CAAA,CAAA;AACtC,IAAA,MAAM,QAAQC,OAAmB,EAAA,CAAA;AAMjC,IAAA,MAAM,OAAOC,YAAe,CAAA;AAAA,MAC1B,cAAc,KAAM,CAAA,UAAA;AAAA,MACpB,SAAW,EAAA,IAAA;A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OAAA,MAAK;AACH,QAAI,UAAqB,gBAAiB,CAAA,eAAA,CAAA,CAAA;AAC1C,OAAI;AACF,MAAM,UAAA,CAAA,YAAA,CAAA,eAAA,EAAA,IAAA,CAAA,YAAA,IAAA,IAAA,CAAA,YAAA,KAAA,CAAA,GAAA,MAAA,CAAA,IAAA,CAAA,YAAA,CAAA,GAAA,EAAA,CAAA,CAAA;AAAA,MACR,UAAA,CAAA,YAAA,CAAA,eAAA,EAAA,MAAA,CAAA,mBAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,MAAA,IAAA,CAAAZ,8BAA6B,UAAA,IAAA,IAAA,EAAA;AAAA,QAC/B,IAAA,GAAA,GAAA,MAAA,CAAA,UAAA,CAAA,CAAA;AACA,QAAA,IAAA;AAAoE,UACrE,GAAA,GAAA,IAAA,CAAA;AACD,SAAA;AACE,QAAM,IAAA,CAAAS,wBAAmB,EAAO,GAAA,CAAA,CAAA;AAChC,OAAA;AAAsE,MACvE,UAAA,CAAA,gBAAA,CAAA,OAAA,EAAA,WAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA,CAAA,CAAA;AACD,KAAa,CAAA,CAAA;AAAA,IAEXI,aAAA,CAAA,MAAA;AAAA,MAEA,IAAA,EAAA,EAAA,EAAA,CAAA;AAAA,MACD,MAAA,UAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"input-number2.js","sources":["../../../../../../packages/components/input-number/src/input-number.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n ns.b(),\n ns.m(inputNumberSize),\n ns.is('disabled', inputNumberDisabled),\n ns.is('without-controls', !controls),\n ns.is('controls-right', controlsAtRight),\n ]\"\n @dragstart.prevent\n >\n <span\n v-if=\"controls\"\n v-repeat-click=\"decrease\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.decrease')\"\n :class=\"[ns.e('decrease'), ns.is('disabled', minDisabled)]\"\n @keydown.enter=\"decrease\"\n >\n <slot name=\"decrease-icon\">\n <el-icon>\n <arrow-down v-if=\"controlsAtRight\" />\n <minus v-else />\n </el-icon>\n </slot>\n </span>\n <span\n v-if=\"controls\"\n v-repeat-click=\"increase\"\n role=\"button\"\n :aria-label=\"t('el.inputNumber.increase')\"\n :class=\"[ns.e('increase'), ns.is('disabled', maxDisabled)]\"\n @keydown.enter=\"increase\"\n >\n <slot name=\"increase-icon\">\n <el-icon>\n <arrow-up v-if=\"controlsAtRight\" />\n <plus v-else />\n </el-icon>\n </slot>\n </span>\n <el-input\n :id=\"id\"\n ref=\"input\"\n type=\"number\"\n :step=\"step\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :readonly=\"readonly\"\n :disabled=\"inputNumberDisabled\"\n :size=\"inputNumberSize\"\n :max=\"max\"\n :min=\"min\"\n :name=\"name\"\n :aria-label=\"ariaLabel\"\n :validate-event=\"false\"\n @keydown.up.prevent=\"increase\"\n @keydown.down.prevent=\"decrease\"\n @blur=\"handleBlur\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @change=\"handleInputChange\"\n >\n <template v-if=\"$slots.prefix\" #prefix>\n <slot name=\"prefix\" />\n </template>\n <template v-if=\"$slots.suffix\" #suffix>\n <slot name=\"suffix\" />\n </template>\n </el-input>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, onMounted, onUpdated, reactive, ref, watch } from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { ElInput } from '@element-plus/components/input'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormSize,\n} from '@element-plus/components/form'\nimport { vRepeatClick } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport {\n debugWarn,\n isNumber,\n isString,\n isUndefined,\n throwError,\n} from '@element-plus/utils'\nimport { ArrowDown, ArrowUp, Minus, Plus } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits, inputNumberProps } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = defineProps(inputNumberProps)\nconst emit = defineEmits(inputNumberEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('input-number')\nconst input = ref<InputInstance>()\n\ninterface Data {\n currentValue: number | null | undefined\n userInput: null | number | string\n}\nconst data = reactive<Data>({\n currentValue: props.modelValue,\n userInput: null,\n})\n\nconst { formItem } = useFormItem()\n\nconst minDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue <= props.min\n)\nconst maxDisabled = computed(\n () => isNumber(props.modelValue) && props.modelValue >= props.max\n)\n\nconst numPrecision = computed(() => {\n const stepPrecision = getPrecision(props.step)\n if (!isUndefined(props.precision)) {\n if (stepPrecision > props.precision) {\n debugWarn(\n 'InputNumber',\n 'precision should not be less than the decimal places of step'\n )\n }\n return props.precision\n } else {\n return Math.max(getPrecision(props.modelValue), stepPrecision)\n }\n})\nconst controlsAtRight = computed(() => {\n return props.controls && props.controlsPosition === 'right'\n})\n\nconst inputNumberSize = useFormSize()\nconst inputNumberDisabled = useFormDisabled()\n\nconst displayValue = computed(() => {\n if (data.userInput !== null) {\n return data.userInput\n }\n let currentValue: number | string | undefined | null = data.currentValue\n if (isNil(currentValue)) return ''\n if (isNumber(currentValue)) {\n if (Number.isNaN(currentValue)) return ''\n if (!isUndefined(props.precision)) {\n currentValue = currentValue.toFixed(props.precision)\n }\n }\n return currentValue\n})\nconst toPrecision = (num: number, pre?: number) => {\n if (isUndefined(pre)) pre = numPrecision.value\n if (pre === 0) return Math.round(num)\n let snum = String(num)\n const pointPos = snum.indexOf('.')\n if (pointPos === -1) return num\n const nums = snum.replace('.', '').split('')\n const datum = nums[pointPos + pre]\n if (!datum) return num\n const length = snum.length\n if (snum.charAt(length - 1) === '5') {\n snum = `${snum.slice(0, Math.max(0, length - 1))}6`\n }\n return Number.parseFloat(Number(snum).toFixed(pre))\n}\nconst getPrecision = (value: number | null | undefined) => {\n if (isNil(value)) return 0\n const valueString = value.toString()\n const dotPosition = valueString.indexOf('.')\n let precision = 0\n if (dotPosition !== -1) {\n precision = valueString.length - dotPosition - 1\n }\n return precision\n}\nconst ensurePrecision = (val: number, coefficient: 1 | -1 = 1) => {\n if (!isNumber(val)) return data.currentValue\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst increase = () => {\n if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst decrease = () => {\n if (props.readonly || inputNumberDisabled.value || minDisabled.value) return\n const value = Number(displayValue.value) || 0\n const newVal = ensurePrecision(value, -1)\n setCurrentValue(newVal)\n emit(INPUT_EVENT, data.currentValue)\n setCurrentValueToModelValue()\n}\nconst verifyValue = (\n value: number | string | null | undefined,\n update?: boolean\n): number | null | undefined => {\n const { max, min, step, precision, stepStrictly, valueOnClear } = props\n if (max < min) {\n throwError('InputNumber', 'min should not be greater than max.')\n }\n let newVal = Number(value)\n if (isNil(value) || Number.isNaN(newVal)) {\n return null\n }\n if (value === '') {\n if (valueOnClear === null) {\n return null\n }\n newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear\n }\n if (stepStrictly) {\n newVal = toPrecision(Math.round(newVal / step) * step, precision)\n if (newVal !== value) {\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n }\n if (!isUndefined(precision)) {\n newVal = toPrecision(newVal, precision)\n }\n if (newVal > max || newVal < min) {\n newVal = newVal > max ? max : min\n update && emit(UPDATE_MODEL_EVENT, newVal)\n }\n return newVal\n}\nconst setCurrentValue = (\n value: number | string | null | undefined,\n emitChange = true\n) => {\n const oldVal = data.currentValue\n const newVal = verifyValue(value)\n if (!emitChange) {\n emit(UPDATE_MODEL_EVENT, newVal!)\n return\n }\n if (oldVal === newVal && value) return\n data.userInput = null\n emit(UPDATE_MODEL_EVENT, newVal!)\n if (oldVal !== newVal) {\n emit(CHANGE_EVENT, newVal!, oldVal!)\n }\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n const newVal = value === '' ? null : Number(value)\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number(value) : ''\n if ((isNumber(newVal) && !Number.isNaN(newVal)) || value === '') {\n setCurrentValue(newVal)\n }\n setCurrentValueToModelValue()\n data.userInput = null\n}\n\nconst focus = () => {\n input.value?.focus?.()\n}\n\nconst blur = () => {\n input.value?.blur?.()\n}\n\nconst handleFocus = (event: MouseEvent | FocusEvent) => {\n emit('focus', event)\n}\n\nconst handleBlur = (event: MouseEvent | FocusEvent) => {\n data.userInput = null\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n}\n\nconst setCurrentValueToModelValue = () => {\n if (data.currentValue !== props.modelValue) {\n data.currentValue = props.modelValue\n }\n}\nconst handleWheel = (e: WheelEvent) => {\n if (document.activeElement === e.target) e.preventDefault()\n}\n\nwatch(\n () => props.modelValue,\n (value, oldValue) => {\n const newValue = verifyValue(value, true)\n if (data.userInput === null && newValue !== oldValue) {\n data.currentValue = newValue\n }\n },\n { immediate: true }\n)\nonMounted(() => {\n const { min, max, modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n if (Number.isFinite(max)) {\n innerInput.setAttribute('aria-valuemax', String(max))\n } else {\n innerInput.removeAttribute('aria-valuemax')\n }\n if (Number.isFinite(min)) {\n innerInput.setAttribute('aria-valuemin', String(min))\n } else {\n innerInput.removeAttribute('aria-valuemin')\n }\n innerInput.setAttribute(\n 'aria-valuenow',\n data.currentValue || data.currentValue === 0\n ? String(data.currentValue)\n : ''\n )\n innerInput.setAttribute('aria-disabled', String(inputNumberDisabled.value))\n if (!isNumber(modelValue) && modelValue != null) {\n let val: number | null = Number(modelValue)\n if (Number.isNaN(val)) {\n val = null\n }\n emit(UPDATE_MODEL_EVENT, val!)\n }\n innerInput.addEventListener('wheel', handleWheel, { passive: false })\n})\nonUpdated(() => {\n const innerInput = input.value?.input\n innerInput?.setAttribute('aria-valuenow', `${data.currentValue ?? ''}`)\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"names":["useLocale","useNamespace","ref","reactive","useFormItem","computed","isNumber","isUndefined","debugWarn","useFormSize","useFormDisabled","isNil","INPUT_EVENT","throwError","isString","UPDATE_MODEL_EVENT","CHANGE_EVENT","watch","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;uCAqGc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAE,MAAMA,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,cAAc,CAAA,CAAA;AACtC,IAAA,MAAM,QAAQC,OAAmB,EAAA,CAAA;AAMjC,IAAA,MAAM,OAAOC,YAAe,CAAA;AAAA,MAC1B,cAAc,KAAM,CAAA,UAAA;AAAA,MACpB,SAAW,EAAA,IAAA;AAAA,KACZ,CAAA,CAAA;AAED,IAAM,MAAA,EAAE,aAAaC,uBAAY,EAAA,CAAA;AAEjC,IAAM,MAAA,WAAA,GAAcC,YAClB,CAAA,MAAMC,cAAS,CAAA,KAAA,CAAM,UAAU,CAAK,IAAA,KA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A,CAAA,GAAA,MAAA,CAAA,IAAA,CAAA,YAAA,CAAA,GAAA,EAAA,CAAA,CAAA;AAAA,MACR,UAAA,CAAA,YAAA,CAAA,eAAA,EAAA,MAAA,CAAA,mBAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,MAAA,IAAA,CAAAZ,8BAA6B,UAAA,IAAA,IAAA,EAAA;AAAA,QAC/B,IAAA,GAAA,GAAA,MAAA,CAAA,UAAA,CAAA,CAAA;AACA,QAAA,IAAA;AAAoE,UACrE,GAAA,GAAA,IAAA,CAAA;AACD,SAAA;AACE,QAAM,IAAA,CAAAS,wBAAmB,EAAO,GAAA,CAAA,CAAA;AAChC,OAAA;AAAsE,MACvE,UAAA,CAAA,gBAAA,CAAA,OAAA,EAAA,WAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA,CAAA,CAAA;AACD,KAAa,CAAA,CAAA;AAAA,IAEXI,aAAA,CAAA,MAAA;AAAA,MAEA,IAAA,EAAA,EAAA,EAAA,CAAA;AAAA,MACD,MAAA,UAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,175 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
require('../../../hooks/index.js');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
11
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
12
|
-
var index$1 = require('../../../hooks/use-locale/index.js');
|
|
13
|
-
var scroll = require('../../../utils/dom/scroll.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
7
|
+
var shared = require('@vue/shared');
|
|
14
8
|
|
|
15
|
-
const
|
|
16
|
-
|
|
9
|
+
const mentionDropdownProps = runtime.buildProps({
|
|
10
|
+
options: {
|
|
11
|
+
type: runtime.definePropType(Array),
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
loading: Boolean,
|
|
15
|
+
disabled: Boolean,
|
|
16
|
+
contentId: String,
|
|
17
|
+
ariaLabel: String
|
|
17
18
|
});
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
emits: mentionDropdown.mentionDropdownEmits,
|
|
22
|
-
setup(__props, { expose, emit }) {
|
|
23
|
-
const props = __props;
|
|
24
|
-
const ns = index.useNamespace("mention");
|
|
25
|
-
const { t } = index$1.useLocale();
|
|
26
|
-
const hoveringIndex = vue.ref(-1);
|
|
27
|
-
const scrollbarRef = vue.ref();
|
|
28
|
-
const optionRefs = vue.ref();
|
|
29
|
-
const dropdownRef = vue.ref();
|
|
30
|
-
const optionkls = (item, index) => [
|
|
31
|
-
ns.be("dropdown", "item"),
|
|
32
|
-
ns.is("hovering", hoveringIndex.value === index),
|
|
33
|
-
ns.is("disabled", item.disabled || props.disabled)
|
|
34
|
-
];
|
|
35
|
-
const handleSelect = (item) => {
|
|
36
|
-
if (item.disabled || props.disabled)
|
|
37
|
-
return;
|
|
38
|
-
emit("select", item);
|
|
39
|
-
};
|
|
40
|
-
const handleMouseEnter = (index) => {
|
|
41
|
-
hoveringIndex.value = index;
|
|
42
|
-
};
|
|
43
|
-
const filteredAllDisabled = vue.computed(() => props.disabled || props.options.every((item) => item.disabled));
|
|
44
|
-
const hoverOption = vue.computed(() => props.options[hoveringIndex.value]);
|
|
45
|
-
const selectHoverOption = () => {
|
|
46
|
-
if (!hoverOption.value)
|
|
47
|
-
return;
|
|
48
|
-
emit("select", hoverOption.value);
|
|
49
|
-
};
|
|
50
|
-
const navigateOptions = (direction) => {
|
|
51
|
-
const { options } = props;
|
|
52
|
-
if (options.length === 0 || filteredAllDisabled.value)
|
|
53
|
-
return;
|
|
54
|
-
if (direction === "next") {
|
|
55
|
-
hoveringIndex.value++;
|
|
56
|
-
if (hoveringIndex.value === options.length) {
|
|
57
|
-
hoveringIndex.value = 0;
|
|
58
|
-
}
|
|
59
|
-
} else if (direction === "prev") {
|
|
60
|
-
hoveringIndex.value--;
|
|
61
|
-
if (hoveringIndex.value < 0) {
|
|
62
|
-
hoveringIndex.value = options.length - 1;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const option = options[hoveringIndex.value];
|
|
66
|
-
if (option.disabled) {
|
|
67
|
-
navigateOptions(direction);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
vue.nextTick(() => scrollToOption(option));
|
|
71
|
-
};
|
|
72
|
-
const scrollToOption = (option) => {
|
|
73
|
-
var _a, _b, _c, _d;
|
|
74
|
-
const { options } = props;
|
|
75
|
-
const index = options.findIndex((item) => item.value === option.value);
|
|
76
|
-
const target = (_a = optionRefs.value) == null ? void 0 : _a[index];
|
|
77
|
-
if (target) {
|
|
78
|
-
const menu = (_c = (_b = dropdownRef.value) == null ? void 0 : _b.querySelector) == null ? void 0 : _c.call(_b, `.${ns.be("dropdown", "wrap")}`);
|
|
79
|
-
if (menu) {
|
|
80
|
-
scroll.scrollIntoView(menu, target);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
(_d = scrollbarRef.value) == null ? void 0 : _d.handleScroll();
|
|
84
|
-
};
|
|
85
|
-
const resetHoveringIndex = () => {
|
|
86
|
-
if (filteredAllDisabled.value || props.options.length === 0) {
|
|
87
|
-
hoveringIndex.value = -1;
|
|
88
|
-
} else {
|
|
89
|
-
hoveringIndex.value = 0;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
vue.watch(() => props.options, resetHoveringIndex, {
|
|
93
|
-
immediate: true
|
|
94
|
-
});
|
|
95
|
-
expose({
|
|
96
|
-
hoveringIndex,
|
|
97
|
-
navigateOptions,
|
|
98
|
-
selectHoverOption,
|
|
99
|
-
hoverOption
|
|
100
|
-
});
|
|
101
|
-
return (_ctx, _cache) => {
|
|
102
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
103
|
-
ref_key: "dropdownRef",
|
|
104
|
-
ref: dropdownRef,
|
|
105
|
-
class: vue.normalizeClass(vue.unref(ns).b("dropdown"))
|
|
106
|
-
}, [
|
|
107
|
-
_ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
108
|
-
key: 0,
|
|
109
|
-
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "header"))
|
|
110
|
-
}, [
|
|
111
|
-
vue.renderSlot(_ctx.$slots, "header")
|
|
112
|
-
], 2)) : vue.createCommentVNode("v-if", true),
|
|
113
|
-
vue.withDirectives(vue.createVNode(vue.unref(index$2.ElScrollbar), {
|
|
114
|
-
id: _ctx.contentId,
|
|
115
|
-
ref_key: "scrollbarRef",
|
|
116
|
-
ref: scrollbarRef,
|
|
117
|
-
tag: "ul",
|
|
118
|
-
"wrap-class": vue.unref(ns).be("dropdown", "wrap"),
|
|
119
|
-
"view-class": vue.unref(ns).be("dropdown", "list"),
|
|
120
|
-
role: "listbox",
|
|
121
|
-
"aria-label": _ctx.ariaLabel,
|
|
122
|
-
"aria-orientation": "vertical"
|
|
123
|
-
}, {
|
|
124
|
-
default: vue.withCtx(() => [
|
|
125
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (item, index) => {
|
|
126
|
-
return vue.openBlock(), vue.createElementBlock("li", {
|
|
127
|
-
id: `${_ctx.contentId}-${index}`,
|
|
128
|
-
ref_for: true,
|
|
129
|
-
ref_key: "optionRefs",
|
|
130
|
-
ref: optionRefs,
|
|
131
|
-
key: item.value,
|
|
132
|
-
class: vue.normalizeClass(optionkls(item, index)),
|
|
133
|
-
role: "option",
|
|
134
|
-
"aria-disabled": item.disabled || _ctx.disabled || void 0,
|
|
135
|
-
"aria-selected": hoveringIndex.value === index,
|
|
136
|
-
onMouseenter: ($event) => handleMouseEnter(index),
|
|
137
|
-
onClick: vue.withModifiers(($event) => handleSelect(item), ["stop"])
|
|
138
|
-
}, [
|
|
139
|
-
vue.renderSlot(_ctx.$slots, "label", {
|
|
140
|
-
item,
|
|
141
|
-
index
|
|
142
|
-
}, () => {
|
|
143
|
-
var _a;
|
|
144
|
-
return [
|
|
145
|
-
vue.createElementVNode("span", null, vue.toDisplayString((_a = item.label) != null ? _a : item.value), 1)
|
|
146
|
-
];
|
|
147
|
-
})
|
|
148
|
-
], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"]);
|
|
149
|
-
}), 128))
|
|
150
|
-
]),
|
|
151
|
-
_: 3
|
|
152
|
-
}, 8, ["id", "wrap-class", "view-class", "aria-label"]), [
|
|
153
|
-
[vue.vShow, _ctx.options.length > 0 && !_ctx.loading]
|
|
154
|
-
]),
|
|
155
|
-
_ctx.loading ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
156
|
-
key: 1,
|
|
157
|
-
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "loading"))
|
|
158
|
-
}, [
|
|
159
|
-
vue.renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
160
|
-
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.mention.loading")), 1)
|
|
161
|
-
])
|
|
162
|
-
], 2)) : vue.createCommentVNode("v-if", true),
|
|
163
|
-
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
164
|
-
key: 2,
|
|
165
|
-
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "footer"))
|
|
166
|
-
}, [
|
|
167
|
-
vue.renderSlot(_ctx.$slots, "footer")
|
|
168
|
-
], 2)) : vue.createCommentVNode("v-if", true)
|
|
169
|
-
], 2);
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
var ElMentionDropdown = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "mention-dropdown.vue"]]);
|
|
19
|
+
const mentionDropdownEmits = {
|
|
20
|
+
select: (option) => shared.isString(option.value)
|
|
21
|
+
};
|
|
174
22
|
|
|
175
|
-
exports
|
|
23
|
+
exports.mentionDropdownEmits = mentionDropdownEmits;
|
|
24
|
+
exports.mentionDropdownProps = mentionDropdownProps;
|
|
176
25
|
//# sourceMappingURL=mention-dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mention-dropdown.js","sources":["../../../../../../packages/components/mention/src/mention-dropdown.
|
|
1
|
+
{"version":3,"file":"mention-dropdown.js","sources":["../../../../../../packages/components/mention/src/mention-dropdown.ts"],"sourcesContent":["import { buildProps, definePropType, isString } from '@element-plus/utils'\n\nimport type { MentionOption } from './types'\n\nexport const mentionDropdownProps = buildProps({\n options: {\n type: definePropType<MentionOption[]>(Array),\n default: () => [],\n },\n loading: Boolean,\n disabled: Boolean,\n contentId: String,\n ariaLabel: String,\n})\n\nexport const mentionDropdownEmits = {\n select: (option: MentionOption) => isString(option.value),\n}\n"],"names":["buildProps","definePropType","isString"],"mappings":";;;;;;;;AACY,MAAC,oBAAoB,GAAGA,kBAAU,CAAC;AAC/C,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,SAAS,EAAE,MAAM;AACnB,CAAC,EAAE;AACS,MAAC,oBAAoB,GAAG;AACpC,EAAE,MAAM,EAAE,CAAC,MAAM,KAAKC,eAAQ,CAAC,MAAM,CAAC,KAAK,CAAC;AAC5C;;;;;"}
|
|
@@ -2,24 +2,175 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../../hooks/index.js');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
+
var index$2 = require('../../scrollbar/index.js');
|
|
9
|
+
var mentionDropdown = require('./mention-dropdown.js');
|
|
10
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
11
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
12
|
+
var index$1 = require('../../../hooks/use-locale/index.js');
|
|
13
|
+
var scroll = require('../../../utils/dom/scroll.js');
|
|
8
14
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
type: runtime.definePropType(Array),
|
|
12
|
-
default: () => []
|
|
13
|
-
},
|
|
14
|
-
loading: Boolean,
|
|
15
|
-
disabled: Boolean,
|
|
16
|
-
contentId: String,
|
|
17
|
-
ariaLabel: String
|
|
15
|
+
const __default__ = vue.defineComponent({
|
|
16
|
+
name: "ElMentionDropdown"
|
|
18
17
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
19
|
+
...__default__,
|
|
20
|
+
props: mentionDropdown.mentionDropdownProps,
|
|
21
|
+
emits: mentionDropdown.mentionDropdownEmits,
|
|
22
|
+
setup(__props, { expose, emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const ns = index.useNamespace("mention");
|
|
25
|
+
const { t } = index$1.useLocale();
|
|
26
|
+
const hoveringIndex = vue.ref(-1);
|
|
27
|
+
const scrollbarRef = vue.ref();
|
|
28
|
+
const optionRefs = vue.ref();
|
|
29
|
+
const dropdownRef = vue.ref();
|
|
30
|
+
const optionkls = (item, index) => [
|
|
31
|
+
ns.be("dropdown", "item"),
|
|
32
|
+
ns.is("hovering", hoveringIndex.value === index),
|
|
33
|
+
ns.is("disabled", item.disabled || props.disabled)
|
|
34
|
+
];
|
|
35
|
+
const handleSelect = (item) => {
|
|
36
|
+
if (item.disabled || props.disabled)
|
|
37
|
+
return;
|
|
38
|
+
emit("select", item);
|
|
39
|
+
};
|
|
40
|
+
const handleMouseEnter = (index) => {
|
|
41
|
+
hoveringIndex.value = index;
|
|
42
|
+
};
|
|
43
|
+
const filteredAllDisabled = vue.computed(() => props.disabled || props.options.every((item) => item.disabled));
|
|
44
|
+
const hoverOption = vue.computed(() => props.options[hoveringIndex.value]);
|
|
45
|
+
const selectHoverOption = () => {
|
|
46
|
+
if (!hoverOption.value)
|
|
47
|
+
return;
|
|
48
|
+
emit("select", hoverOption.value);
|
|
49
|
+
};
|
|
50
|
+
const navigateOptions = (direction) => {
|
|
51
|
+
const { options } = props;
|
|
52
|
+
if (options.length === 0 || filteredAllDisabled.value)
|
|
53
|
+
return;
|
|
54
|
+
if (direction === "next") {
|
|
55
|
+
hoveringIndex.value++;
|
|
56
|
+
if (hoveringIndex.value === options.length) {
|
|
57
|
+
hoveringIndex.value = 0;
|
|
58
|
+
}
|
|
59
|
+
} else if (direction === "prev") {
|
|
60
|
+
hoveringIndex.value--;
|
|
61
|
+
if (hoveringIndex.value < 0) {
|
|
62
|
+
hoveringIndex.value = options.length - 1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const option = options[hoveringIndex.value];
|
|
66
|
+
if (option.disabled) {
|
|
67
|
+
navigateOptions(direction);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
vue.nextTick(() => scrollToOption(option));
|
|
71
|
+
};
|
|
72
|
+
const scrollToOption = (option) => {
|
|
73
|
+
var _a, _b, _c, _d;
|
|
74
|
+
const { options } = props;
|
|
75
|
+
const index = options.findIndex((item) => item.value === option.value);
|
|
76
|
+
const target = (_a = optionRefs.value) == null ? void 0 : _a[index];
|
|
77
|
+
if (target) {
|
|
78
|
+
const menu = (_c = (_b = dropdownRef.value) == null ? void 0 : _b.querySelector) == null ? void 0 : _c.call(_b, `.${ns.be("dropdown", "wrap")}`);
|
|
79
|
+
if (menu) {
|
|
80
|
+
scroll.scrollIntoView(menu, target);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
(_d = scrollbarRef.value) == null ? void 0 : _d.handleScroll();
|
|
84
|
+
};
|
|
85
|
+
const resetHoveringIndex = () => {
|
|
86
|
+
if (filteredAllDisabled.value || props.options.length === 0) {
|
|
87
|
+
hoveringIndex.value = -1;
|
|
88
|
+
} else {
|
|
89
|
+
hoveringIndex.value = 0;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
vue.watch(() => props.options, resetHoveringIndex, {
|
|
93
|
+
immediate: true
|
|
94
|
+
});
|
|
95
|
+
expose({
|
|
96
|
+
hoveringIndex,
|
|
97
|
+
navigateOptions,
|
|
98
|
+
selectHoverOption,
|
|
99
|
+
hoverOption
|
|
100
|
+
});
|
|
101
|
+
return (_ctx, _cache) => {
|
|
102
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
103
|
+
ref_key: "dropdownRef",
|
|
104
|
+
ref: dropdownRef,
|
|
105
|
+
class: vue.normalizeClass(vue.unref(ns).b("dropdown"))
|
|
106
|
+
}, [
|
|
107
|
+
_ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
108
|
+
key: 0,
|
|
109
|
+
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "header"))
|
|
110
|
+
}, [
|
|
111
|
+
vue.renderSlot(_ctx.$slots, "header")
|
|
112
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
113
|
+
vue.withDirectives(vue.createVNode(vue.unref(index$2.ElScrollbar), {
|
|
114
|
+
id: _ctx.contentId,
|
|
115
|
+
ref_key: "scrollbarRef",
|
|
116
|
+
ref: scrollbarRef,
|
|
117
|
+
tag: "ul",
|
|
118
|
+
"wrap-class": vue.unref(ns).be("dropdown", "wrap"),
|
|
119
|
+
"view-class": vue.unref(ns).be("dropdown", "list"),
|
|
120
|
+
role: "listbox",
|
|
121
|
+
"aria-label": _ctx.ariaLabel,
|
|
122
|
+
"aria-orientation": "vertical"
|
|
123
|
+
}, {
|
|
124
|
+
default: vue.withCtx(() => [
|
|
125
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.options, (item, index) => {
|
|
126
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
127
|
+
id: `${_ctx.contentId}-${index}`,
|
|
128
|
+
ref_for: true,
|
|
129
|
+
ref_key: "optionRefs",
|
|
130
|
+
ref: optionRefs,
|
|
131
|
+
key: item.value,
|
|
132
|
+
class: vue.normalizeClass(optionkls(item, index)),
|
|
133
|
+
role: "option",
|
|
134
|
+
"aria-disabled": item.disabled || _ctx.disabled || void 0,
|
|
135
|
+
"aria-selected": hoveringIndex.value === index,
|
|
136
|
+
onMouseenter: ($event) => handleMouseEnter(index),
|
|
137
|
+
onClick: vue.withModifiers(($event) => handleSelect(item), ["stop"])
|
|
138
|
+
}, [
|
|
139
|
+
vue.renderSlot(_ctx.$slots, "label", {
|
|
140
|
+
item,
|
|
141
|
+
index
|
|
142
|
+
}, () => {
|
|
143
|
+
var _a;
|
|
144
|
+
return [
|
|
145
|
+
vue.createElementVNode("span", null, vue.toDisplayString((_a = item.label) != null ? _a : item.value), 1)
|
|
146
|
+
];
|
|
147
|
+
})
|
|
148
|
+
], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"]);
|
|
149
|
+
}), 128))
|
|
150
|
+
]),
|
|
151
|
+
_: 3
|
|
152
|
+
}, 8, ["id", "wrap-class", "view-class", "aria-label"]), [
|
|
153
|
+
[vue.vShow, _ctx.options.length > 0 && !_ctx.loading]
|
|
154
|
+
]),
|
|
155
|
+
_ctx.loading ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
156
|
+
key: 1,
|
|
157
|
+
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "loading"))
|
|
158
|
+
}, [
|
|
159
|
+
vue.renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
160
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.mention.loading")), 1)
|
|
161
|
+
])
|
|
162
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
163
|
+
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
164
|
+
key: 2,
|
|
165
|
+
class: vue.normalizeClass(vue.unref(ns).be("dropdown", "footer"))
|
|
166
|
+
}, [
|
|
167
|
+
vue.renderSlot(_ctx.$slots, "footer")
|
|
168
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
169
|
+
], 2);
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
var ElMentionDropdown = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "mention-dropdown.vue"]]);
|
|
22
174
|
|
|
23
|
-
exports
|
|
24
|
-
exports.mentionDropdownProps = mentionDropdownProps;
|
|
175
|
+
exports["default"] = ElMentionDropdown;
|
|
25
176
|
//# sourceMappingURL=mention-dropdown2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mention-dropdown2.js","sources":["../../../../../../packages/components/mention/src/mention-dropdown.
|
|
1
|
+
{"version":3,"file":"mention-dropdown2.js","sources":["../../../../../../packages/components/mention/src/mention-dropdown.vue"],"sourcesContent":["<template>\n <div ref=\"dropdownRef\" :class=\"ns.b('dropdown')\">\n <div v-if=\"$slots.header\" :class=\"ns.be('dropdown', 'header')\">\n <slot name=\"header\" />\n </div>\n <el-scrollbar\n v-show=\"options.length > 0 && !loading\"\n :id=\"contentId\"\n ref=\"scrollbarRef\"\n tag=\"ul\"\n :wrap-class=\"ns.be('dropdown', 'wrap')\"\n :view-class=\"ns.be('dropdown', 'list')\"\n role=\"listbox\"\n :aria-label=\"ariaLabel\"\n aria-orientation=\"vertical\"\n >\n <li\n v-for=\"(item, index) in options\"\n :id=\"`${contentId}-${index}`\"\n ref=\"optionRefs\"\n :key=\"item.value\"\n :class=\"optionkls(item, index)\"\n role=\"option\"\n :aria-disabled=\"item.disabled || disabled || undefined\"\n :aria-selected=\"hoveringIndex === index\"\n @mouseenter=\"handleMouseEnter(index)\"\n @click.stop=\"handleSelect(item)\"\n >\n <slot name=\"label\" :item=\"item\" :index=\"index\">\n <span>{{ item.label ?? item.value }}</span>\n </slot>\n </li>\n </el-scrollbar>\n <div v-if=\"loading\" :class=\"ns.be('dropdown', 'loading')\">\n <slot name=\"loading\"> {{ t('el.mention.loading') }} </slot>\n </div>\n <div v-if=\"$slots.footer\" :class=\"ns.be('dropdown', 'footer')\">\n <slot name=\"footer\" />\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { scrollIntoView } from '@element-plus/utils'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport { mentionDropdownEmits, mentionDropdownProps } from './mention-dropdown'\n\nimport type { MentionOption } from './types'\n\ndefineOptions({\n name: 'ElMentionDropdown',\n})\n\nconst props = defineProps(mentionDropdownProps)\nconst emit = defineEmits(mentionDropdownEmits)\n\nconst ns = useNamespace('mention')\nconst { t } = useLocale()\nconst hoveringIndex = ref(-1)\n\nconst scrollbarRef = ref<InstanceType<typeof ElScrollbar>>()\nconst optionRefs = ref<HTMLElement[]>()\nconst dropdownRef = ref<HTMLElement>()\n\nconst optionkls = (item: MentionOption, index: number) => [\n ns.be('dropdown', 'item'),\n ns.is('hovering', hoveringIndex.value === index),\n ns.is('disabled', item.disabled || props.disabled),\n]\n\nconst handleSelect = (item: MentionOption) => {\n if (item.disabled || props.disabled) return\n emit('select', item)\n}\n\nconst handleMouseEnter = (index: number) => {\n hoveringIndex.value = index\n}\n\nconst filteredAllDisabled = computed(\n () => props.disabled || props.options.every((item) => item.disabled)\n)\n\nconst hoverOption = computed(() => props.options[hoveringIndex.value])\n\nconst selectHoverOption = () => {\n if (!hoverOption.value) return\n emit('select', hoverOption.value)\n}\n\nconst navigateOptions = (direction: 'next' | 'prev') => {\n const { options } = props\n if (options.length === 0 || filteredAllDisabled.value) return\n\n if (direction === 'next') {\n hoveringIndex.value++\n if (hoveringIndex.value === options.length) {\n hoveringIndex.value = 0\n }\n } else if (direction === 'prev') {\n hoveringIndex.value--\n if (hoveringIndex.value < 0) {\n hoveringIndex.value = options.length - 1\n }\n }\n const option = options[hoveringIndex.value]\n if (option.disabled) {\n navigateOptions(direction)\n return\n }\n nextTick(() => scrollToOption(option))\n}\n\nconst scrollToOption = (option: MentionOption) => {\n const { options } = props\n\n const index = options.findIndex((item) => item.value === option.value)\n const target = optionRefs.value?.[index]\n\n if (target) {\n const menu = dropdownRef.value?.querySelector?.(\n `.${ns.be('dropdown', 'wrap')}`\n )\n if (menu) {\n scrollIntoView(menu as HTMLElement, target)\n }\n }\n scrollbarRef.value?.handleScroll()\n}\n\nconst resetHoveringIndex = () => {\n if (filteredAllDisabled.value || props.options.length === 0) {\n hoveringIndex.value = -1\n } else {\n hoveringIndex.value = 0\n }\n}\n\nwatch(() => props.options, resetHoveringIndex, {\n immediate: true,\n})\n\ndefineExpose({\n hoveringIndex,\n navigateOptions,\n selectHoverOption,\n hoverOption,\n})\n</script>\n"],"names":["useNamespace","useLocale","ref","computed","nextTick","scrollIntoView","watch"],"mappings":";;;;;;;;;;;;;;uCAkDc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,SAAS,CAAA,CAAA;AACjC,IAAM,MAAA,EAAE,MAAMC,iBAAU,EAAA,CAAA;AACxB,IAAM,MAAA,aAAA,GAAgBC,QAAI,CAAE,CAAA,CAAA,CAAA;AAE5B,IAAA,MAAM,eAAeA,OAAsC,EAAA,CAAA;AAC3D,IAAA,MAAM,aAAaA,OAAmB,EAAA,CAAA;AACtC,IAAA,MAAM,cAAcA,OAAiB,EAAA,CAAA;AAErC,IAAM,MAAA,SAAA,GAAY,CAAC,IAAA,EAAq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AA,aAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACR,QAAA,IAAA,IAAA,EAAA;AAA0C,UAC5CC,qBAAA,CAAA,IAAA,EAAA,MAAA,CAAA,CAAA;AAAA,SACF;AACA,OAAA;AAAiC,MACnC,CAAA,EAAA,GAAA,YAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAA,EAAA,CAAA;AAEA,KAAA,CAAA;AACE,IAAA,MAAI,kBAAoB,GAAA,MAAA;AACtB,MAAA,IAAA,mBAAsB,CAAA,KAAA,IAAA,KAAA,CAAA,OAAA,CAAA,MAAA,KAAA,CAAA,EAAA;AAAA,QACjB,aAAA,CAAA,KAAA,GAAA,CAAA,CAAA,CAAA;AACL,OAAA,MAAA;AAAsB,QACxB,aAAA,CAAA,KAAA,GAAA,CAAA,CAAA;AAAA,OACF;AAEA,KAAM,CAAA;AAAyC,IAAAC,SAClC,CAAA,MAAA,KAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;AAAA,MACZ,SAAA,EAAA,IAAA;AAED,KAAa,CAAA,CAAA;AAAA,IACX,MAAA,CAAA;AAAA,MACA,aAAA;AAAA,MACA,eAAA;AAAA,MACA,iBAAA;AAAA,MACD,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -12,7 +12,7 @@ require('../../form/index.js');
|
|
|
12
12
|
require('../../../utils/index.js');
|
|
13
13
|
var mention = require('./mention.js');
|
|
14
14
|
var helper = require('./helper.js');
|
|
15
|
-
var mentionDropdown = require('./mention-
|
|
15
|
+
var mentionDropdown = require('./mention-dropdown2.js');
|
|
16
16
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
17
17
|
var input = require('../../input/src/input.js');
|
|
18
18
|
var index = require('../../../hooks/use-namespace/index.js');
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
6
|
var menu = require('./src/menu.js');
|
|
7
|
-
var menuItem$1 = require('./src/menu-
|
|
7
|
+
var menuItem$1 = require('./src/menu-item2.js');
|
|
8
8
|
var menuItemGroup$1 = require('./src/menu-item-group2.js');
|
|
9
9
|
var subMenu = require('./src/sub-menu.js');
|
|
10
|
-
var menuItem = require('./src/menu-
|
|
10
|
+
var menuItem = require('./src/menu-item.js');
|
|
11
11
|
var menuItemGroup = require('./src/menu-item-group.js');
|
|
12
12
|
require('./src/types.js');
|
|
13
13
|
require('./src/instance.js');
|