@element-plus/nightly 0.0.20261029 → 0.0.20261030
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +16 -10
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +3 -3
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +16 -10
- 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/gl.js +1 -1
- package/dist/locale/gl.min.js +1 -1
- package/dist/locale/gl.min.mjs +1 -1
- package/dist/locale/gl.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/affix/src/affix.vue.d.ts +3 -3
- package/es/components/alert/src/alert.d.ts +2 -2
- package/es/components/alert/src/alert.vue.d.ts +2 -2
- package/es/components/anchor/src/anchor.vue.d.ts +4 -4
- package/es/components/autocomplete/src/autocomplete.d.ts +2 -2
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +2 -2
- package/es/components/avatar/src/avatar-group.d.ts +1 -1
- package/es/components/avatar/src/avatar.d.ts +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +2 -2
- package/es/components/badge/src/badge.d.ts +1 -1
- package/es/components/badge/src/badge.vue.d.ts +2 -2
- package/es/components/button/src/button-group.d.ts +1 -1
- package/es/components/button/src/button-group.vue.d.ts +1 -1
- package/es/components/button/src/button.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +3 -3
- package/es/components/button/src/use-button.d.ts +1 -1
- package/es/components/calendar/src/calendar.d.ts +1 -1
- package/es/components/calendar/src/calendar.vue.d.ts +1 -1
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel-item.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +2 -2
- package/es/components/cascader/src/cascader.d.ts +4 -4
- package/es/components/cascader/src/cascader.vue.d.ts +12 -12
- package/es/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/es/components/cascader-panel/src/menu.vue.d.ts +1 -1
- package/es/components/check-tag/src/check-tag.d.ts +1 -1
- package/es/components/check-tag/src/check-tag.vue.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +5 -5
- package/es/components/checkbox/src/checkbox.d.ts +3 -3
- package/es/components/checkbox/src/checkbox.vue.d.ts +6 -6
- package/es/components/collapse/src/collapse-item.vue.d.ts +1 -1
- package/es/components/collapse/src/collapse.vue.d.ts +2 -2
- package/es/components/color-picker/src/color-picker.vue.d.ts +7 -7
- package/es/components/config-provider/src/config-provider.d.ts +1 -1
- package/es/components/countdown/src/countdown.vue.d.ts +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +15 -15
- package/es/components/date-picker/src/props.d.ts +2 -2
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +5 -5
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +6 -6
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +5 -5
- package/es/components/date-picker-panel/src/panel-utils.d.ts +24 -24
- package/es/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/es/components/date-picker-panel/src/props/panel-date-pick.d.ts +1 -1
- package/es/components/date-picker-panel/src/props/panel-date-range.d.ts +1 -1
- package/es/components/date-picker-panel/src/props/shared.d.ts +1 -1
- package/es/components/descriptions/src/description-item.d.ts +9 -9
- package/es/components/descriptions/src/description.vue.d.ts +2 -2
- package/es/components/dialog/src/dialog-content.vue.d.ts +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +2 -2
- package/es/components/divider/src/divider.d.ts +1 -1
- package/es/components/divider/src/divider.vue.d.ts +2 -2
- package/es/components/drawer/src/drawer.vue.d.ts +5 -5
- package/es/components/dropdown/src/dropdown.d.ts +2 -2
- package/es/components/dropdown/src/dropdown.vue.d.ts +76 -76
- package/es/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/es/components/form/src/form-item.d.ts +2 -2
- package/es/components/form/src/form-item.vue.d.ts +2 -2
- package/es/components/form/src/form.d.ts +1 -1
- package/es/components/form/src/form.vue.d.ts +2 -2
- package/es/components/image/src/image.d.ts +2 -2
- package/es/components/image/src/image.vue.d.ts +7 -7
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +6 -6
- package/es/components/input/src/input.d.ts +1 -1
- package/es/components/input/src/input.vue.d.ts +5 -5
- package/es/components/input-number/src/input-number.d.ts +2 -2
- package/es/components/input-number/src/input-number.vue.d.ts +11 -11
- package/es/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.mjs +14 -8
- package/es/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/input-otp/src/input-otp.vue.d.ts +5 -5
- package/es/components/input-tag/src/input-tag.d.ts +2 -2
- package/es/components/input-tag/src/input-tag.vue.d.ts +9 -9
- package/es/components/link/src/link.d.ts +1 -1
- package/es/components/link/src/link.vue.d.ts +2 -2
- package/es/components/mention/src/mention.d.ts +1 -1
- package/es/components/menu/src/menu.d.ts +1 -1
- package/es/components/menu/src/sub-menu.d.ts +1 -1
- package/es/components/message/src/message.d.ts +1 -1
- package/es/components/message/src/message.vue.d.ts +3 -3
- package/es/components/message-box/src/index.vue.d.ts +29 -29
- package/es/components/notification/src/notification.d.ts +1 -1
- package/es/components/notification/src/notification.vue.d.ts +6 -6
- package/es/components/pagination/src/components/sizes.vue.d.ts +1 -1
- package/es/components/pagination/src/pagination.d.ts +3 -3
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +6 -6
- package/es/components/popover/src/popover.d.ts +41 -41
- package/es/components/popover/src/popover.vue.d.ts +17 -17
- package/es/components/popper/src/composables/use-content.d.ts +2 -2
- package/es/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/es/components/popper/src/content.vue.d.ts +11 -11
- package/es/components/progress/src/progress.d.ts +1 -1
- package/es/components/progress/src/progress.vue.d.ts +4 -4
- package/es/components/radio/src/radio-button.d.ts +3 -3
- package/es/components/radio/src/radio-button.vue.d.ts +3 -3
- package/es/components/radio/src/radio-group.vue.d.ts +7 -7
- package/es/components/radio/src/radio.d.ts +6 -6
- package/es/components/radio/src/radio.vue.d.ts +5 -5
- package/es/components/rate/src/rate.vue.d.ts +4 -4
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/result/src/result.vue.d.ts +1 -1
- package/es/components/row/src/row.d.ts +2 -2
- package/es/components/row/src/row.vue.d.ts +1 -1
- package/es/components/scrollbar/src/scrollbar.d.ts +1 -1
- package/es/components/segmented/index.d.ts +3 -3
- package/es/components/segmented/src/segmented.d.ts +1 -1
- package/es/components/segmented/src/segmented.vue.d.ts +2 -2
- package/es/components/select/src/option.d.ts +1 -1
- package/es/components/select/src/option.vue.d.ts +2 -2
- package/es/components/select/src/select.d.ts +4 -4
- package/es/components/select/src/select.vue.d.ts +89 -89
- package/es/components/select/src/useSelect.d.ts +5 -5
- package/es/components/select-v2/src/defaults.d.ts +4 -4
- package/es/components/select-v2/src/select.vue.d.ts +85 -85
- package/es/components/select-v2/src/useSelect.d.ts +1 -1
- package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/es/components/skeleton/src/skeleton-item.vue.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/slider/src/slider.vue.d.ts +7 -7
- package/es/components/space/src/space.d.ts +1 -1
- package/es/components/steps/src/item.d.ts +1 -1
- package/es/components/steps/src/item.vue.d.ts +2 -2
- package/es/components/steps/src/steps.d.ts +2 -2
- package/es/components/steps/src/steps.vue.d.ts +1 -1
- package/es/components/switch/src/switch.vue.d.ts +4 -4
- package/es/components/table/src/filter-panel.vue.d.ts +81 -81
- package/es/components/table/src/table-column/defaults.d.ts +2 -2
- package/es/components/table/src/table-header/index.d.ts +17 -17
- package/es/components/table/src/table.vue.d.ts +3 -3
- package/es/components/table-v2/src/components/header.d.ts +1 -1
- package/es/components/table-v2/src/components/row.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +2 -2
- package/es/components/table-v2/src/table-v2.d.ts +3 -3
- package/es/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +5 -5
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/tag/src/tag.vue.d.ts +2 -2
- package/es/components/text/src/text.d.ts +1 -1
- package/es/components/text/src/text.vue.d.ts +1 -1
- package/es/components/time-picker/src/common/picker-range-trigger.vue.d.ts +2 -2
- package/es/components/time-picker/src/common/picker.vue.d.ts +15 -15
- package/es/components/time-picker/src/common/props.d.ts +1 -1
- package/es/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -1
- package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -1
- package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +1 -1
- package/es/components/time-picker/src/time-picker.d.ts +13 -13
- package/es/components/time-select/src/time-select.vue.d.ts +7 -7
- package/es/components/timeline/src/timeline-item.d.ts +1 -1
- package/es/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +14 -14
- package/es/components/tooltip/src/tooltip.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +17 -17
- package/es/components/tooltip/src/trigger.d.ts +1 -1
- package/es/components/tour/src/content.d.ts +1 -1
- package/es/components/tour/src/step.d.ts +1 -1
- package/es/components/tour/src/step.vue.d.ts +2 -2
- package/es/components/tour/src/tour.d.ts +1 -1
- package/es/components/tour/src/tour.vue.d.ts +6 -6
- package/es/components/transfer/src/transfer.vue.d.ts +2 -2
- package/es/components/tree/src/tree-node.vue.d.ts +17 -17
- package/es/components/tree/src/tree.vue.d.ts +25 -25
- package/es/components/tree-select/src/tree-select-option.d.ts +2 -2
- package/es/components/tree-select/src/tree-select.vue.d.ts +30 -30
- package/es/components/tree-v2/src/composables/useTree.d.ts +4 -4
- package/es/components/tree-v2/src/tree-node.vue.d.ts +2 -2
- package/es/components/tree-v2/src/tree.vue.d.ts +9 -9
- package/es/components/upload/src/upload-content.vue.d.ts +1 -1
- package/es/components/upload/src/upload.vue.d.ts +2 -2
- package/es/components/virtual-list/src/builders/build-grid.d.ts +2 -2
- package/es/components/virtual-list/src/builders/build-list.d.ts +2 -2
- package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +2 -2
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +2 -2
- package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +2 -2
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +2 -2
- package/es/components/watermark/src/watermark.vue.d.ts +1 -1
- package/es/hooks/use-floating/index.d.ts +8 -8
- package/es/hooks/use-popper/index.d.ts +2 -2
- package/es/utils/vue/size.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/src/affix.vue.d.ts +3 -3
- package/lib/components/alert/src/alert.d.ts +2 -2
- package/lib/components/alert/src/alert.vue.d.ts +2 -2
- package/lib/components/anchor/src/anchor.vue.d.ts +4 -4
- package/lib/components/autocomplete/src/autocomplete.d.ts +2 -2
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +2 -2
- package/lib/components/avatar/src/avatar-group.d.ts +1 -1
- package/lib/components/avatar/src/avatar.d.ts +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +2 -2
- package/lib/components/badge/src/badge.d.ts +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +2 -2
- package/lib/components/button/src/button-group.d.ts +1 -1
- package/lib/components/button/src/button-group.vue.d.ts +1 -1
- package/lib/components/button/src/button.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +3 -3
- package/lib/components/button/src/use-button.d.ts +1 -1
- package/lib/components/calendar/src/calendar.d.ts +1 -1
- package/lib/components/calendar/src/calendar.vue.d.ts +1 -1
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel-item.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +2 -2
- package/lib/components/cascader/src/cascader.d.ts +4 -4
- package/lib/components/cascader/src/cascader.vue.d.ts +12 -12
- package/lib/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/lib/components/cascader-panel/src/menu.vue.d.ts +1 -1
- package/lib/components/check-tag/src/check-tag.d.ts +1 -1
- package/lib/components/check-tag/src/check-tag.vue.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +5 -5
- package/lib/components/checkbox/src/checkbox.d.ts +3 -3
- package/lib/components/checkbox/src/checkbox.vue.d.ts +6 -6
- package/lib/components/collapse/src/collapse-item.vue.d.ts +1 -1
- package/lib/components/collapse/src/collapse.vue.d.ts +2 -2
- package/lib/components/color-picker/src/color-picker.vue.d.ts +7 -7
- package/lib/components/config-provider/src/config-provider.d.ts +1 -1
- package/lib/components/countdown/src/countdown.vue.d.ts +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +15 -15
- package/lib/components/date-picker/src/props.d.ts +2 -2
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +5 -5
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +6 -6
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +5 -5
- package/lib/components/date-picker-panel/src/panel-utils.d.ts +24 -24
- package/lib/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/lib/components/date-picker-panel/src/props/panel-date-pick.d.ts +1 -1
- package/lib/components/date-picker-panel/src/props/panel-date-range.d.ts +1 -1
- package/lib/components/date-picker-panel/src/props/shared.d.ts +1 -1
- package/lib/components/descriptions/src/description-item.d.ts +9 -9
- package/lib/components/descriptions/src/description.vue.d.ts +2 -2
- package/lib/components/dialog/src/dialog-content.vue.d.ts +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +2 -2
- package/lib/components/divider/src/divider.d.ts +1 -1
- package/lib/components/divider/src/divider.vue.d.ts +2 -2
- package/lib/components/drawer/src/drawer.vue.d.ts +5 -5
- package/lib/components/dropdown/src/dropdown.d.ts +2 -2
- package/lib/components/dropdown/src/dropdown.vue.d.ts +76 -76
- package/lib/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/lib/components/form/src/form-item.d.ts +2 -2
- package/lib/components/form/src/form-item.vue.d.ts +2 -2
- package/lib/components/form/src/form.d.ts +1 -1
- package/lib/components/form/src/form.vue.d.ts +2 -2
- package/lib/components/image/src/image.d.ts +2 -2
- package/lib/components/image/src/image.vue.d.ts +7 -7
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +6 -6
- package/lib/components/input/src/input.d.ts +1 -1
- package/lib/components/input/src/input.vue.d.ts +5 -5
- package/lib/components/input-number/src/input-number.d.ts +2 -2
- package/lib/components/input-number/src/input-number.vue.d.ts +11 -11
- package/lib/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js +14 -8
- package/lib/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/input-otp/src/input-otp.vue.d.ts +5 -5
- package/lib/components/input-tag/src/input-tag.d.ts +2 -2
- package/lib/components/input-tag/src/input-tag.vue.d.ts +9 -9
- package/lib/components/link/src/link.d.ts +1 -1
- package/lib/components/link/src/link.vue.d.ts +2 -2
- package/lib/components/mention/src/mention.d.ts +1 -1
- package/lib/components/menu/src/menu.d.ts +1 -1
- package/lib/components/menu/src/sub-menu.d.ts +1 -1
- package/lib/components/message/src/message.d.ts +1 -1
- package/lib/components/message/src/message.vue.d.ts +3 -3
- package/lib/components/message-box/src/index.vue.d.ts +29 -29
- package/lib/components/notification/src/notification.d.ts +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +6 -6
- package/lib/components/pagination/src/components/sizes.vue.d.ts +1 -1
- package/lib/components/pagination/src/pagination.d.ts +3 -3
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +6 -6
- package/lib/components/popover/src/popover.d.ts +41 -41
- package/lib/components/popover/src/popover.vue.d.ts +17 -17
- package/lib/components/popper/src/composables/use-content.d.ts +2 -2
- package/lib/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/lib/components/popper/src/content.vue.d.ts +11 -11
- package/lib/components/progress/src/progress.d.ts +1 -1
- package/lib/components/progress/src/progress.vue.d.ts +4 -4
- package/lib/components/radio/src/radio-button.d.ts +3 -3
- package/lib/components/radio/src/radio-button.vue.d.ts +3 -3
- package/lib/components/radio/src/radio-group.vue.d.ts +7 -7
- package/lib/components/radio/src/radio.d.ts +6 -6
- package/lib/components/radio/src/radio.vue.d.ts +5 -5
- package/lib/components/rate/src/rate.vue.d.ts +4 -4
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/result/src/result.vue.d.ts +1 -1
- package/lib/components/row/src/row.d.ts +2 -2
- package/lib/components/row/src/row.vue.d.ts +1 -1
- package/lib/components/scrollbar/src/scrollbar.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +3 -3
- package/lib/components/segmented/src/segmented.d.ts +1 -1
- package/lib/components/segmented/src/segmented.vue.d.ts +2 -2
- package/lib/components/select/src/option.d.ts +1 -1
- package/lib/components/select/src/option.vue.d.ts +2 -2
- package/lib/components/select/src/select.d.ts +4 -4
- package/lib/components/select/src/select.vue.d.ts +89 -89
- package/lib/components/select/src/useSelect.d.ts +5 -5
- package/lib/components/select-v2/src/defaults.d.ts +4 -4
- package/lib/components/select-v2/src/select.vue.d.ts +85 -85
- package/lib/components/select-v2/src/useSelect.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton-item.vue.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +7 -7
- package/lib/components/space/src/space.d.ts +1 -1
- package/lib/components/steps/src/item.d.ts +1 -1
- package/lib/components/steps/src/item.vue.d.ts +2 -2
- package/lib/components/steps/src/steps.d.ts +2 -2
- package/lib/components/steps/src/steps.vue.d.ts +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +4 -4
- package/lib/components/table/src/filter-panel.vue.d.ts +81 -81
- package/lib/components/table/src/table-column/defaults.d.ts +2 -2
- package/lib/components/table/src/table-header/index.d.ts +17 -17
- package/lib/components/table/src/table.vue.d.ts +3 -3
- package/lib/components/table-v2/src/components/header.d.ts +1 -1
- package/lib/components/table-v2/src/components/row.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +2 -2
- package/lib/components/table-v2/src/table-v2.d.ts +3 -3
- package/lib/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +5 -5
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/tag/src/tag.vue.d.ts +2 -2
- package/lib/components/text/src/text.d.ts +1 -1
- package/lib/components/text/src/text.vue.d.ts +1 -1
- package/lib/components/time-picker/src/common/picker-range-trigger.vue.d.ts +2 -2
- package/lib/components/time-picker/src/common/picker.vue.d.ts +15 -15
- package/lib/components/time-picker/src/common/props.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker-com/basic-time-spinner.vue.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker.d.ts +13 -13
- package/lib/components/time-select/src/time-select.vue.d.ts +7 -7
- package/lib/components/timeline/src/timeline-item.d.ts +1 -1
- package/lib/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +14 -14
- package/lib/components/tooltip/src/tooltip.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +17 -17
- package/lib/components/tooltip/src/trigger.d.ts +1 -1
- package/lib/components/tour/src/content.d.ts +1 -1
- package/lib/components/tour/src/step.d.ts +1 -1
- package/lib/components/tour/src/step.vue.d.ts +2 -2
- package/lib/components/tour/src/tour.d.ts +1 -1
- package/lib/components/tour/src/tour.vue.d.ts +6 -6
- package/lib/components/transfer/src/transfer.vue.d.ts +2 -2
- package/lib/components/tree/src/tree-node.vue.d.ts +17 -17
- package/lib/components/tree/src/tree.vue.d.ts +25 -25
- package/lib/components/tree-select/src/tree-select-option.d.ts +2 -2
- package/lib/components/tree-select/src/tree-select.vue.d.ts +30 -30
- package/lib/components/tree-v2/src/composables/useTree.d.ts +4 -4
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +2 -2
- package/lib/components/tree-v2/src/tree.vue.d.ts +9 -9
- package/lib/components/upload/src/upload-content.vue.d.ts +1 -1
- package/lib/components/upload/src/upload.vue.d.ts +2 -2
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +2 -2
- package/lib/components/virtual-list/src/builders/build-list.d.ts +2 -2
- package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +2 -2
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +2 -2
- package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +2 -2
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +2 -2
- package/lib/components/watermark/src/watermark.vue.d.ts +1 -1
- package/lib/hooks/use-floating/index.d.ts +8 -8
- package/lib/hooks/use-popper/index.d.ts +2 -2
- package/lib/utils/vue/size.d.ts +1 -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/web-types.json +1 -1
|
@@ -31,7 +31,7 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
31
31
|
}>, {
|
|
32
32
|
loop: boolean;
|
|
33
33
|
trapped: boolean;
|
|
34
|
-
focusStartEl: HTMLElement | "
|
|
34
|
+
focusStartEl: HTMLElement | "first" | "container";
|
|
35
35
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
36
36
|
//#endregion
|
|
37
37
|
export { _default as default };
|
|
@@ -70,7 +70,7 @@ declare const formItemProps: {
|
|
|
70
70
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
71
71
|
__epPropKey: true;
|
|
72
72
|
};
|
|
73
|
-
readonly labelPosition: EpPropFinalized<StringConstructor, "" | "
|
|
73
|
+
readonly labelPosition: EpPropFinalized<StringConstructor, "" | "left" | "right" | "top", unknown, "", boolean>;
|
|
74
74
|
readonly prop: {
|
|
75
75
|
readonly type: _$vue.PropType<EpPropMergeType<(new (...args: any[]) => string | string[]) | (() => FormItemProp) | (((new (...args: any[]) => string | string[]) | (() => FormItemProp)) | null)[], unknown, unknown>>;
|
|
76
76
|
readonly required: false;
|
|
@@ -86,7 +86,7 @@ declare const formItemProps: {
|
|
|
86
86
|
};
|
|
87
87
|
readonly error: StringConstructor;
|
|
88
88
|
readonly validateStatus: {
|
|
89
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "
|
|
89
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "error" | "validating" | "success", unknown>>;
|
|
90
90
|
readonly required: false;
|
|
91
91
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
92
92
|
__epPropKey: true;
|
|
@@ -27,7 +27,7 @@ declare const __VLS_base: _$vue.DefineComponent<FormItemProps, {
|
|
|
27
27
|
/**
|
|
28
28
|
* @description Validation state.
|
|
29
29
|
*/
|
|
30
|
-
validateState: _$vue.Ref<"" | "
|
|
30
|
+
validateState: _$vue.Ref<"" | "error" | "validating" | "success", "" | "error" | "validating" | "success">;
|
|
31
31
|
/**
|
|
32
32
|
* @description Validate form item.
|
|
33
33
|
*/
|
|
@@ -45,8 +45,8 @@ declare const __VLS_base: _$vue.DefineComponent<FormItemProps, {
|
|
|
45
45
|
*/
|
|
46
46
|
setInitialValue: (value: any) => void;
|
|
47
47
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<FormItemProps> & Readonly<{}>, {
|
|
48
|
+
labelPosition: "" | "left" | "right" | "top";
|
|
48
49
|
required: boolean;
|
|
49
|
-
labelPosition: "" | "top" | "left" | "right";
|
|
50
50
|
inlineMessage: boolean;
|
|
51
51
|
showMessage: boolean;
|
|
52
52
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -98,7 +98,7 @@ declare const formProps: {
|
|
|
98
98
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
99
99
|
__epPropKey: true;
|
|
100
100
|
};
|
|
101
|
-
readonly labelPosition: EpPropFinalized<StringConstructor, "
|
|
101
|
+
readonly labelPosition: EpPropFinalized<StringConstructor, "left" | "right" | "top", unknown, "right", boolean>;
|
|
102
102
|
readonly requireAsteriskPosition: EpPropFinalized<StringConstructor, "left" | "right", unknown, "left", boolean>;
|
|
103
103
|
readonly labelWidth: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
104
104
|
readonly labelSuffix: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -48,10 +48,10 @@ declare const __VLS_base: _$vue.DefineComponent<FormProps, {
|
|
|
48
48
|
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
49
49
|
}>, {
|
|
50
50
|
labelWidth: string | number;
|
|
51
|
-
labelPosition: "
|
|
51
|
+
labelPosition: "left" | "right" | "top";
|
|
52
|
+
showMessage: boolean;
|
|
52
53
|
requireAsteriskPosition: "left" | "right";
|
|
53
54
|
labelSuffix: string;
|
|
54
|
-
showMessage: boolean;
|
|
55
55
|
validateOnRuleChange: boolean;
|
|
56
56
|
scrollIntoViewOptions: boolean | ScrollIntoViewOptions;
|
|
57
57
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -86,9 +86,9 @@ interface ImageProps {
|
|
|
86
86
|
declare const imageProps: {
|
|
87
87
|
readonly hideOnClickModal: BooleanConstructor;
|
|
88
88
|
readonly src: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
89
|
-
readonly fit: EpPropFinalized<StringConstructor, "" | "fill" | "
|
|
89
|
+
readonly fit: EpPropFinalized<StringConstructor, "" | "fill" | "contain" | "cover" | "none" | "scale-down", unknown, "", boolean>;
|
|
90
90
|
readonly loading: {
|
|
91
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "
|
|
91
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "eager" | "lazy", unknown>>;
|
|
92
92
|
readonly required: false;
|
|
93
93
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
94
94
|
__epPropKey: true;
|
|
@@ -39,26 +39,26 @@ type __VLS_Slots = {} & {
|
|
|
39
39
|
declare const __VLS_base: _$vue.DefineComponent<ImageProps, {
|
|
40
40
|
/** @description manually open preview */showPreview: typeof clickHandler;
|
|
41
41
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
42
|
-
close: () => void;
|
|
43
42
|
error: (evt: Event) => void;
|
|
44
|
-
show: () => void;
|
|
45
43
|
load: (evt: Event) => void;
|
|
46
44
|
switch: (val: number) => void;
|
|
45
|
+
close: () => void;
|
|
46
|
+
show: () => void;
|
|
47
47
|
}, string, _$vue.PublicProps, Readonly<ImageProps> & Readonly<{
|
|
48
|
-
onClose?: (() => any) | undefined;
|
|
49
48
|
onError?: ((evt: Event) => any) | undefined;
|
|
50
|
-
onShow?: (() => any) | undefined;
|
|
51
49
|
onLoad?: ((evt: Event) => any) | undefined;
|
|
52
50
|
onSwitch?: ((val: number) => any) | undefined;
|
|
51
|
+
onClose?: (() => any) | undefined;
|
|
52
|
+
onShow?: (() => any) | undefined;
|
|
53
53
|
}>, {
|
|
54
|
-
infinite: boolean;
|
|
55
|
-
scale: number;
|
|
56
54
|
src: string;
|
|
57
55
|
fit: ImageFitType;
|
|
56
|
+
previewSrcList: string[];
|
|
58
57
|
initialIndex: number;
|
|
58
|
+
infinite: boolean;
|
|
59
59
|
closeOnPressEscape: boolean;
|
|
60
|
-
previewSrcList: string[];
|
|
61
60
|
zoomRate: number;
|
|
61
|
+
scale: number;
|
|
62
62
|
minScale: number;
|
|
63
63
|
maxScale: number;
|
|
64
64
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -41,21 +41,21 @@ declare const __VLS_base: _$vue.DefineComponent<ImageViewerProps, {
|
|
|
41
41
|
*/
|
|
42
42
|
setActiveItem: typeof setActiveItem;
|
|
43
43
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
44
|
-
close: () => void;
|
|
45
44
|
error: (evt: Event) => void;
|
|
46
|
-
rotate: (deg: number) => void;
|
|
47
45
|
switch: (index: number) => void;
|
|
46
|
+
close: () => void;
|
|
47
|
+
rotate: (deg: number) => void;
|
|
48
48
|
}, string, _$vue.PublicProps, Readonly<ImageViewerProps> & Readonly<{
|
|
49
|
-
onClose?: (() => any) | undefined;
|
|
50
49
|
onError?: ((evt: Event) => any) | undefined;
|
|
51
|
-
onRotate?: ((deg: number) => any) | undefined;
|
|
52
50
|
onSwitch?: ((index: number) => any) | undefined;
|
|
51
|
+
onClose?: (() => any) | undefined;
|
|
52
|
+
onRotate?: ((deg: number) => any) | undefined;
|
|
53
53
|
}>, {
|
|
54
|
-
infinite: boolean;
|
|
55
|
-
scale: number;
|
|
56
54
|
initialIndex: number;
|
|
55
|
+
infinite: boolean;
|
|
57
56
|
closeOnPressEscape: boolean;
|
|
58
57
|
zoomRate: number;
|
|
58
|
+
scale: number;
|
|
59
59
|
minScale: number;
|
|
60
60
|
maxScale: number;
|
|
61
61
|
urlList: string[];
|
|
@@ -155,7 +155,7 @@ interface InputProps {
|
|
|
155
155
|
* @deprecated Removed after 3.0.0, Use `InputProps` instead.
|
|
156
156
|
*/
|
|
157
157
|
declare const inputProps: {
|
|
158
|
-
readonly inputmode: EpPropFinalized<(new (...args: any[]) => "search" | "
|
|
158
|
+
readonly inputmode: EpPropFinalized<(new (...args: any[]) => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal") | (() => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined) | (((new (...args: any[]) => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal") | (() => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined)) | null)[], unknown, unknown, undefined, boolean>;
|
|
159
159
|
readonly name: StringConstructor;
|
|
160
160
|
readonly ariaLabel: StringConstructor;
|
|
161
161
|
readonly id: EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
@@ -32,10 +32,10 @@ declare const __VLS_base: _$vue.DefineComponent<InputProps, {
|
|
|
32
32
|
clear: (evt?: MouseEvent) => void; /** @description resize textarea. */
|
|
33
33
|
resizeTextarea: () => void;
|
|
34
34
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
35
|
-
change: (value: string, evt?: Event | undefined) => void;
|
|
36
35
|
clear: (evt: MouseEvent | undefined) => void;
|
|
37
36
|
"update:modelValue": (value: string) => void;
|
|
38
37
|
input: (value: string) => void;
|
|
38
|
+
change: (value: string, evt?: Event | undefined) => void;
|
|
39
39
|
focus: (evt: FocusEvent) => void;
|
|
40
40
|
blur: (evt: FocusEvent) => void;
|
|
41
41
|
mouseleave: (evt: MouseEvent) => void;
|
|
@@ -45,10 +45,10 @@ declare const __VLS_base: _$vue.DefineComponent<InputProps, {
|
|
|
45
45
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
46
46
|
compositionend: (evt: CompositionEvent) => void;
|
|
47
47
|
}, string, _$vue.PublicProps, Readonly<InputProps> & Readonly<{
|
|
48
|
-
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
49
48
|
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
50
49
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
51
50
|
onInput?: ((value: string) => any) | undefined;
|
|
51
|
+
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
52
52
|
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
53
53
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
54
54
|
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
@@ -58,15 +58,15 @@ declare const __VLS_base: _$vue.DefineComponent<InputProps, {
|
|
|
58
58
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
59
59
|
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
60
60
|
}>, {
|
|
61
|
-
type: InputType;
|
|
62
|
-
disabled: boolean;
|
|
63
61
|
modelValue: string | number | null;
|
|
62
|
+
validateEvent: boolean;
|
|
63
|
+
disabled: boolean;
|
|
64
|
+
type: InputType;
|
|
64
65
|
modelModifiers: InputModelModifiers;
|
|
65
66
|
autocomplete: string;
|
|
66
67
|
clearIcon: IconPropType;
|
|
67
68
|
wordLimitPosition: "inside" | "outside";
|
|
68
69
|
tabindex: string | number;
|
|
69
|
-
validateEvent: boolean;
|
|
70
70
|
inputStyle: string | false | _$vue.CSSProperties | StyleValue[] | null;
|
|
71
71
|
rows: number;
|
|
72
72
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -106,8 +106,8 @@ interface InputNumberProps {
|
|
|
106
106
|
* @deprecated Removed after 3.0.0, Use `InputNumberProps` instead.
|
|
107
107
|
*/
|
|
108
108
|
declare const inputNumberProps: {
|
|
109
|
-
readonly inputmode: EpPropFinalized<(new (...args: any[]) => "search" | "
|
|
110
|
-
readonly align: EpPropFinalized<(new (...args: any[]) => "
|
|
109
|
+
readonly inputmode: EpPropFinalized<(new (...args: any[]) => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal") | (() => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined) | (((new (...args: any[]) => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal") | (() => "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal" | undefined)) | null)[], unknown, unknown, undefined, boolean>;
|
|
110
|
+
readonly align: EpPropFinalized<(new (...args: any[]) => "left" | "right" | "center") | (() => "left" | "right" | "center") | (((new (...args: any[]) => "left" | "right" | "center") | (() => "left" | "right" | "center")) | null)[], unknown, unknown, "center", boolean>;
|
|
111
111
|
readonly disabledScientific: BooleanConstructor;
|
|
112
112
|
readonly formatter: {
|
|
113
113
|
readonly type: _$vue.PropType<Function>;
|
|
@@ -16,32 +16,32 @@ declare const __VLS_base: _$vue.DefineComponent<InputNumberProps, {
|
|
|
16
16
|
/** @description get focus the input component */focus: () => void; /** @description remove focus the input component */
|
|
17
17
|
blur: () => void;
|
|
18
18
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
19
|
-
change: (cur: number | undefined, prev: number | undefined) => void;
|
|
20
19
|
"update:modelValue": (val: number | undefined) => void;
|
|
21
|
-
input: (val: number | null | undefined) => void;
|
|
22
20
|
focus: (e: FocusEvent) => void;
|
|
23
21
|
blur: (e: FocusEvent) => void;
|
|
22
|
+
change: (cur: number | undefined, prev: number | undefined) => void;
|
|
23
|
+
input: (val: number | null | undefined) => void;
|
|
24
24
|
}, string, _$vue.PublicProps, Readonly<InputNumberProps> & Readonly<{
|
|
25
|
-
onChange?: ((cur: number | undefined, prev: number | undefined) => any) | undefined;
|
|
26
25
|
"onUpdate:modelValue"?: ((val: number | undefined) => any) | undefined;
|
|
27
26
|
onInput?: ((val: number | null | undefined) => any) | undefined;
|
|
27
|
+
onChange?: ((cur: number | undefined, prev: number | undefined) => any) | undefined;
|
|
28
28
|
onFocus?: ((e: FocusEvent) => any) | undefined;
|
|
29
29
|
onBlur?: ((e: FocusEvent) => any) | undefined;
|
|
30
30
|
}>, {
|
|
31
|
-
|
|
31
|
+
validateEvent: boolean;
|
|
32
32
|
disabled: boolean;
|
|
33
|
-
|
|
33
|
+
id: string;
|
|
34
34
|
tabindex: string | number;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
inputmode: "search" | "none" | "text" | "email" | "tel" | "url" | "numeric" | "decimal";
|
|
36
|
+
readonly: boolean;
|
|
37
|
+
step: number;
|
|
38
38
|
max: number;
|
|
39
39
|
min: number;
|
|
40
|
-
align: "center" | "left" | "right";
|
|
41
|
-
step: number;
|
|
42
|
-
stepStrictly: boolean;
|
|
43
40
|
controls: boolean;
|
|
44
41
|
controlsPosition: "" | "right";
|
|
42
|
+
valueOnClear: number | "max" | "min" | null;
|
|
43
|
+
align: "left" | "right" | "center";
|
|
44
|
+
stepStrictly: boolean;
|
|
45
45
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
46
46
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
47
47
|
declare const _default: typeof __VLS_export;
|
|
@@ -192,6 +192,17 @@ var input_number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0,
|
|
|
192
192
|
const handleWheel = (e) => {
|
|
193
193
|
if (document.activeElement === e.target) e.preventDefault();
|
|
194
194
|
};
|
|
195
|
+
const updateAriaAttributes = () => {
|
|
196
|
+
const innerInput = input.value?.input;
|
|
197
|
+
if (!innerInput) return;
|
|
198
|
+
const { min, max } = props;
|
|
199
|
+
if (Number.isFinite(max)) innerInput.setAttribute("aria-valuemax", String(max));
|
|
200
|
+
else innerInput.removeAttribute("aria-valuemax");
|
|
201
|
+
if (Number.isFinite(min)) innerInput.setAttribute("aria-valuemin", String(min));
|
|
202
|
+
else innerInput.removeAttribute("aria-valuemin");
|
|
203
|
+
innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : "");
|
|
204
|
+
innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
|
|
205
|
+
};
|
|
195
206
|
(0, vue.watch)(() => props.modelValue, (value, oldValue) => {
|
|
196
207
|
const newValue = verifyValue(value, true);
|
|
197
208
|
if (data.userInput === null && newValue !== oldValue) data.currentValue = newValue;
|
|
@@ -200,15 +211,10 @@ var input_number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0,
|
|
|
200
211
|
data.currentValue = verifyValue(props.modelValue);
|
|
201
212
|
});
|
|
202
213
|
(0, vue.onMounted)(() => {
|
|
203
|
-
const {
|
|
214
|
+
const { modelValue } = props;
|
|
204
215
|
const innerInput = input.value?.input;
|
|
205
216
|
innerInput.setAttribute("role", "spinbutton");
|
|
206
|
-
|
|
207
|
-
else innerInput.removeAttribute("aria-valuemax");
|
|
208
|
-
if (Number.isFinite(min)) innerInput.setAttribute("aria-valuemin", String(min));
|
|
209
|
-
else innerInput.removeAttribute("aria-valuemin");
|
|
210
|
-
innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : "");
|
|
211
|
-
innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
|
|
217
|
+
updateAriaAttributes();
|
|
212
218
|
if (!require_types.isNumber(modelValue) && modelValue != null) {
|
|
213
219
|
let val = Number(modelValue);
|
|
214
220
|
if (Number.isNaN(val)) val = null;
|
|
@@ -217,7 +223,7 @@ var input_number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0,
|
|
|
217
223
|
innerInput.addEventListener("wheel", handleWheel, { passive: false });
|
|
218
224
|
});
|
|
219
225
|
(0, vue.onUpdated)(() => {
|
|
220
|
-
(
|
|
226
|
+
updateAriaAttributes();
|
|
221
227
|
});
|
|
222
228
|
__expose({
|
|
223
229
|
/** @description get focus the input component */
|
package/lib/components/input-number/src/input-number.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-number.vue_vue_type_script_setup_true_lang.js","names":["$slots","inputNumberProps","inputNumberEmits","useLocale","useNamespace","ref","reactive","useFormItem","computed","isNumber","isUndefined","useFormSize","useFormDisabled","isNil","getEventCode","getEventKey","EVENT_CODE","INPUT_EVENT","isString","UPDATE_MODEL_EVENT","CHANGE_EVENT","NOOP","_openBlock","_createElementBlock","_normalizeClass","_unref","_withModifiers","_withDirectives","_withKeys","_renderSlot","_createVNode","ElIcon","_withCtx","_createBlock","ArrowDown","Minus","vRepeatClick","_createCommentVNode","ArrowUp","Plus","ElInput","_createSlots"],"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 ns.is(align, !!align),\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=\"formatter ? 'text' : '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 :inputmode=\"inputmode\"\n :formatter=\"formatter\"\n :parser=\"parser\"\n :tabindex=\"tabindex\"\n @keydown=\"handleKeydown\"\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\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 NOOP,\n debugWarn,\n getEventCode,\n getEventKey,\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 EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { InputNumberProps } from './input-number'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n id: undefined,\n disabled: undefined,\n step: 1,\n max: Number.MAX_SAFE_INTEGER,\n min: Number.MIN_SAFE_INTEGER,\n stepStrictly: false,\n readonly: false,\n controls: true,\n controlsPosition: '',\n valueOnClear: null,\n validateEvent: true,\n inputmode: undefined,\n align: 'center',\n tabindex: 0,\n})\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 if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the maximum safe integer limit.'\n )\n return val\n } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the minimum safe integer limit.'\n )\n return val\n }\n\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst handleKeydown = (event: KeyboardEvent | Event) => {\n const code = getEventCode(event as KeyboardEvent)\n const key = getEventKey(event as KeyboardEvent)\n\n if (props.disabledScientific && ['e', 'E'].includes(key)) {\n event.preventDefault()\n return\n }\n\n switch (code) {\n case EVENT_CODE.up: {\n event.preventDefault()\n increase()\n break\n }\n case EVENT_CODE.down: {\n event.preventDefault()\n decrease()\n break\n }\n }\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 = !value ? Number(value) : Number.parseFloat(String(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(\n Math.round(toPrecision(newVal / step)) * step,\n precision\n )\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 data.userInput = null\n if (oldVal === newVal && value) return\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(NOOP)\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n let newVal = value === '' ? null : Number.parseFloat(value)\n if (Number.isNaN(newVal)) {\n newVal = null\n }\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number.parseFloat(value) : ''\n if (\n (isNumber(newVal) && !Number.isNaN(newVal)) ||\n (props.formatter && Number.isNaN(newVal)) ||\n newVal === ''\n ) {\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 // When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = props.formatter?.('') ?? ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\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)\n\nwatch(\n () => props.precision,\n () => {\n data.currentValue = verifyValue(props.modelValue)\n }\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAmHA,MAAM,QAAQ;EAgBd,MAAM,OAAO;EAEb,MAAM,EAAE,MAAMG,cAAAA,UAAU;EACxB,MAAM,KAAKC,gBAAAA,aAAa,cAAc;EACtC,MAAM,SAAA,GAAQC,IAAAA,IAAAA,CAAmB;EAMjC,MAAM,QAAA,GAAOC,IAAAA,SAAAA,CAAe;GAC1B,cAAc,MAAM;GACpB,WAAW;EACb,CAAC;EAED,MAAM,EAAE,aAAaC,sBAAAA,YAAY;EAEjC,MAAM,eAAA,GAAcC,IAAAA,SAAAA,OACZC,cAAAA,SAAS,MAAM,UAAU,KAAK,MAAM,cAAc,MAAM,GAChE;EACA,MAAM,eAAA,GAAcD,IAAAA,SAAAA,OACZC,cAAAA,SAAS,MAAM,UAAU,KAAK,MAAM,cAAc,MAAM,GAChE;EAEA,MAAM,gBAAA,GAAeD,IAAAA,SAAAA,OAAe;GAClC,MAAM,gBAAgB,aAAa,MAAM,IAAI;GAC7C,IAAI,CAACE,cAAAA,YAAY,MAAM,SAAS,GAAG;IACjC,IAAI,gBAAgB,MAAM,WACxB,cAAA,UACE,eACA,8DACF;IAEF,OAAO,MAAM;GACf,OACE,OAAO,KAAK,IAAI,aAAa,MAAM,UAAU,GAAG,aAAa;EAEjE,CAAC;EACD,MAAM,mBAAA,GAAkBF,IAAAA,SAAAA,OAAe;GACrC,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AA,CAAAe,gBAAAA,OAAA,GAAA;KA9BR,IAAI,QAAA;KACD,SAAA;KAAJ,KAAI;KACH,MAAM,QAAA,YAAS,SAAA;KACf,MAAM,QAAA;KACN,eAAa,aAAA;KACb,aAAa,QAAA;KACb,UAAU,QAAA;KACV,WAAA,GAAUf,IAAAA,MAAAA,CAAA,mBAAA;KACV,OAAA,GAAMA,IAAAA,MAAAA,CAAA,eAAA;KACN,KAAK,QAAA;KACL,KAAK,QAAA;KACL,MAAM,QAAA;KACN,cAAY,QAAA;KACZ,kBAAgB;KAChB,WAAW,QAAA;KACX,WAAW,QAAA;KACX,QAAQ,QAAA;KACR,UAAU,QAAA;KACV,WAAS;KACT,QAAM;KACN,SAAO;KACP,SAAO;KACP,UAAQ;I,mCAEOzB,KAAAA,OAAO,S;KAAS,MAAA;KAC9B,KAAA,GAAAgC,IAAAA,QAAAA,OAAsB,EAAA,GAAtBH,IAAAA,WAAAA,CAAsB,KAAA,QAAA,QAAA,C;;I,YAER7B,KAAAA,OAAO,S;KAAS,MAAA;KAC9B,KAAA,GAAAgC,IAAAA,QAAAA,OAAsB,EAAA,GAAtBH,IAAAA,WAAAA,CAAsB,KAAA,QAAA,QAAA,C"}
|
|
1
|
+
{"version":3,"file":"input-number.vue_vue_type_script_setup_true_lang.js","names":["$slots","inputNumberProps","inputNumberEmits","useLocale","useNamespace","ref","reactive","useFormItem","computed","isNumber","isUndefined","useFormSize","useFormDisabled","isNil","getEventCode","getEventKey","EVENT_CODE","INPUT_EVENT","isString","UPDATE_MODEL_EVENT","CHANGE_EVENT","NOOP","_openBlock","_createElementBlock","_normalizeClass","_unref","_withModifiers","_withDirectives","_withKeys","_renderSlot","_createVNode","ElIcon","_withCtx","_createBlock","ArrowDown","Minus","vRepeatClick","_createCommentVNode","ArrowUp","Plus","ElInput","_createSlots"],"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 ns.is(align, !!align),\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=\"formatter ? 'text' : '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 :inputmode=\"inputmode\"\n :formatter=\"formatter\"\n :parser=\"parser\"\n :tabindex=\"tabindex\"\n @keydown=\"handleKeydown\"\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\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 NOOP,\n debugWarn,\n getEventCode,\n getEventKey,\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 EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { InputNumberProps } from './input-number'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n id: undefined,\n disabled: undefined,\n step: 1,\n max: Number.MAX_SAFE_INTEGER,\n min: Number.MIN_SAFE_INTEGER,\n stepStrictly: false,\n readonly: false,\n controls: true,\n controlsPosition: '',\n valueOnClear: null,\n validateEvent: true,\n inputmode: undefined,\n align: 'center',\n tabindex: 0,\n})\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 if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the maximum safe integer limit.'\n )\n return val\n } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the minimum safe integer limit.'\n )\n return val\n }\n\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst handleKeydown = (event: KeyboardEvent | Event) => {\n const code = getEventCode(event as KeyboardEvent)\n const key = getEventKey(event as KeyboardEvent)\n\n if (props.disabledScientific && ['e', 'E'].includes(key)) {\n event.preventDefault()\n return\n }\n\n switch (code) {\n case EVENT_CODE.up: {\n event.preventDefault()\n increase()\n break\n }\n case EVENT_CODE.down: {\n event.preventDefault()\n decrease()\n break\n }\n }\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 = !value ? Number(value) : Number.parseFloat(String(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(\n Math.round(toPrecision(newVal / step)) * step,\n precision\n )\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 data.userInput = null\n if (oldVal === newVal && value) return\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(NOOP)\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n let newVal = value === '' ? null : Number.parseFloat(value)\n if (Number.isNaN(newVal)) {\n newVal = null\n }\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number.parseFloat(value) : ''\n if (\n (isNumber(newVal) && !Number.isNaN(newVal)) ||\n (props.formatter && Number.isNaN(newVal)) ||\n newVal === ''\n ) {\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 // When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = props.formatter?.('') ?? ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\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\nconst updateAriaAttributes = () => {\n const innerInput = input.value?.input as HTMLInputElement | undefined\n if (!innerInput) return\n\n const { min, max } = props\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}\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)\n\nwatch(\n () => props.precision,\n () => {\n data.currentValue = verifyValue(props.modelValue)\n }\n)\nonMounted(() => {\n const { modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n updateAriaAttributes()\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 updateAriaAttributes()\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAmHA,MAAM,QAAQ;EAgBd,MAAM,OAAO;EAEb,MAAM,EAAE,MAAMG,cAAAA,UAAU;EACxB,MAAM,KAAKC,gBAAAA,aAAa,cAAc;EACtC,MAAM,SAAA,GAAQC,IAAAA,IAAAA,CAAmB;EAMjC,MAAM,QAAA,GAAOC,IAAAA,SAAAA,CAAe;GAC1B,cAAc,MAAM;GACpB,WAAW;EACb,CAAC;EAED,MAAM,EAAE,aAAaC,sBAAAA,YAAY;EAEjC,MAAM,eAAA,GAAcC,IAAAA,SAAAA,OACZC,cAAAA,SAAS,MAAM,UAAU,KAAK,MAAM,cAAc,MAAM,GAChE;EACA,MAAM,eAAA,GAAcD,IAAAA,SAAAA,OACZC,cAAAA,SAAS,MAAM,UAAU,KAAK,MAAM,cAAc,MAAM,GAChE;EAEA,MAAM,gBAAA,GAAeD,IAAAA,SAAAA,OAAe;GAClC,MAAM,gBAAgB,aAAa,MAAM,IAAI;GAC7C,IAAI,CAACE,cAAAA,YAAY,MAAM,SAAS,GAAG;IACjC,IAAI,gBAA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W,IAAAA,YAAAA,EAAAA,GAAeR,IAAAA,MAAAA,CAAAc,wBAAAA,IAAA,GAAA,EAAA,KAAA,EAAA,CAAA,E;;I,0BATH,EAAA,GAAAd,IAAAA,MAAAA,CAAAW,gBAAAA,YAAA,GAAA,QAAQ,C;KAa1BN,GAAAA,IAAAA,YAAAA,EAAAA,GA+BWL,IAAAA,MAAAA,CAAAe,gBAAAA,OAAA,GAAA;KA9BR,IAAI,QAAA;KACD,SAAA;KAAJ,KAAI;KACH,MAAM,QAAA,YAAS,SAAA;KACf,MAAM,QAAA;KACN,eAAa,aAAA;KACb,aAAa,QAAA;KACb,UAAU,QAAA;KACV,WAAA,GAAUf,IAAAA,MAAAA,CAAA,mBAAA;KACV,OAAA,GAAMA,IAAAA,MAAAA,CAAA,eAAA;KACN,KAAK,QAAA;KACL,KAAK,QAAA;KACL,MAAM,QAAA;KACN,cAAY,QAAA;KACZ,kBAAgB;KAChB,WAAW,QAAA;KACX,WAAW,QAAA;KACX,QAAQ,QAAA;KACR,UAAU,QAAA;KACV,WAAS;KACT,QAAM;KACN,SAAO;KACP,SAAO;KACP,UAAQ;I,mCAEOzB,KAAAA,OAAO,S;KAAS,MAAA;KAC9B,KAAA,GAAAgC,IAAAA,QAAAA,OAAsB,EAAA,GAAtBH,IAAAA,WAAAA,CAAsB,KAAA,QAAA,QAAA,C;;I,YAER7B,KAAAA,OAAO,S;KAAS,MAAA;KAC9B,KAAA,GAAAgC,IAAAA,QAAAA,OAAsB,EAAA,GAAtBH,IAAAA,WAAAA,CAAsB,KAAA,QAAA,QAAA,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-number2.js","names":["_sfc_main"],"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 ns.is(align, !!align),\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=\"formatter ? 'text' : '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 :inputmode=\"inputmode\"\n :formatter=\"formatter\"\n :parser=\"parser\"\n :tabindex=\"tabindex\"\n @keydown=\"handleKeydown\"\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\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 NOOP,\n debugWarn,\n getEventCode,\n getEventKey,\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 EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { InputNumberProps } from './input-number'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n id: undefined,\n disabled: undefined,\n step: 1,\n max: Number.MAX_SAFE_INTEGER,\n min: Number.MIN_SAFE_INTEGER,\n stepStrictly: false,\n readonly: false,\n controls: true,\n controlsPosition: '',\n valueOnClear: null,\n validateEvent: true,\n inputmode: undefined,\n align: 'center',\n tabindex: 0,\n})\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 if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the maximum safe integer limit.'\n )\n return val\n } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the minimum safe integer limit.'\n )\n return val\n }\n\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst handleKeydown = (event: KeyboardEvent | Event) => {\n const code = getEventCode(event as KeyboardEvent)\n const key = getEventKey(event as KeyboardEvent)\n\n if (props.disabledScientific && ['e', 'E'].includes(key)) {\n event.preventDefault()\n return\n }\n\n switch (code) {\n case EVENT_CODE.up: {\n event.preventDefault()\n increase()\n break\n }\n case EVENT_CODE.down: {\n event.preventDefault()\n decrease()\n break\n }\n }\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 = !value ? Number(value) : Number.parseFloat(String(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(\n Math.round(toPrecision(newVal / step)) * step,\n precision\n )\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 data.userInput = null\n if (oldVal === newVal && value) return\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(NOOP)\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n let newVal = value === '' ? null : Number.parseFloat(value)\n if (Number.isNaN(newVal)) {\n newVal = null\n }\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number.parseFloat(value) : ''\n if (\n (isNumber(newVal) && !Number.isNaN(newVal)) ||\n (props.formatter && Number.isNaN(newVal)) ||\n newVal === ''\n ) {\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 // When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = props.formatter?.('') ?? ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\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)\n\nwatch(\n () => props.precision,\n () => {\n data.currentValue = verifyValue(props.modelValue)\n }\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"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"input-number2.js","names":["_sfc_main"],"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 ns.is(align, !!align),\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=\"formatter ? 'text' : '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 :inputmode=\"inputmode\"\n :formatter=\"formatter\"\n :parser=\"parser\"\n :tabindex=\"tabindex\"\n @keydown=\"handleKeydown\"\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\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 NOOP,\n debugWarn,\n getEventCode,\n getEventKey,\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 EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { inputNumberEmits } from './input-number'\n\nimport type { InputInstance } from '@element-plus/components/input'\nimport type { InputNumberProps } from './input-number'\n\ndefineOptions({\n name: 'ElInputNumber',\n})\n\nconst props = withDefaults(defineProps<InputNumberProps>(), {\n id: undefined,\n disabled: undefined,\n step: 1,\n max: Number.MAX_SAFE_INTEGER,\n min: Number.MIN_SAFE_INTEGER,\n stepStrictly: false,\n readonly: false,\n controls: true,\n controlsPosition: '',\n valueOnClear: null,\n validateEvent: true,\n inputmode: undefined,\n align: 'center',\n tabindex: 0,\n})\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 if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the maximum safe integer limit.'\n )\n return val\n } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {\n debugWarn(\n 'InputNumber',\n 'The value has reached the minimum safe integer limit.'\n )\n return val\n }\n\n // Solve the accuracy problem of JS decimal calculation by converting the value to integer.\n return toPrecision(val + props.step * coefficient)\n}\nconst handleKeydown = (event: KeyboardEvent | Event) => {\n const code = getEventCode(event as KeyboardEvent)\n const key = getEventKey(event as KeyboardEvent)\n\n if (props.disabledScientific && ['e', 'E'].includes(key)) {\n event.preventDefault()\n return\n }\n\n switch (code) {\n case EVENT_CODE.up: {\n event.preventDefault()\n increase()\n break\n }\n case EVENT_CODE.down: {\n event.preventDefault()\n decrease()\n break\n }\n }\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 = !value ? Number(value) : Number.parseFloat(String(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(\n Math.round(toPrecision(newVal / step)) * step,\n precision\n )\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 data.userInput = null\n if (oldVal === newVal && value) return\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(NOOP)\n }\n data.currentValue = newVal\n}\nconst handleInput = (value: string) => {\n data.userInput = value\n let newVal = value === '' ? null : Number.parseFloat(value)\n if (Number.isNaN(newVal)) {\n newVal = null\n }\n emit(INPUT_EVENT, newVal)\n setCurrentValue(newVal, false)\n}\nconst handleInputChange = (value: string) => {\n const newVal = value !== '' ? Number.parseFloat(value) : ''\n if (\n (isNumber(newVal) && !Number.isNaN(newVal)) ||\n (props.formatter && Number.isNaN(newVal)) ||\n newVal === ''\n ) {\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 // When non-numeric content is entered into a numeric input box,\n // the content displayed on the page is not cleared after the value is cleared. #18533\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1398528\n if (data.currentValue === null && input.value?.input) {\n input.value.input.value = props.formatter?.('') ?? ''\n }\n emit('blur', event)\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch(NOOP)\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\nconst updateAriaAttributes = () => {\n const innerInput = input.value?.input as HTMLInputElement | undefined\n if (!innerInput) return\n\n const { min, max } = props\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}\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)\n\nwatch(\n () => props.precision,\n () => {\n data.currentValue = verifyValue(props.modelValue)\n }\n)\nonMounted(() => {\n const { modelValue } = props\n const innerInput = input.value?.input as HTMLInputElement\n innerInput.setAttribute('role', 'spinbutton')\n updateAriaAttributes()\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 updateAriaAttributes()\n})\ndefineExpose({\n /** @description get focus the input component */\n focus,\n /** @description remove focus the input component */\n blur,\n})\n</script>\n"],"mappings":""}
|
|
@@ -22,22 +22,22 @@ declare const __VLS_base: _$vue.DefineComponent<InputOtpProps, {
|
|
|
22
22
|
*/
|
|
23
23
|
blur: () => void;
|
|
24
24
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
25
|
-
change: (value: string) => void;
|
|
26
25
|
"update:modelValue": (value: string) => void;
|
|
27
26
|
focus: (eve: FocusEvent) => void;
|
|
28
27
|
blur: (eve: FocusEvent) => void;
|
|
28
|
+
change: (value: string) => void;
|
|
29
29
|
finish: (value: string) => void;
|
|
30
30
|
}, string, _$vue.PublicProps, Readonly<InputOtpProps> & Readonly<{
|
|
31
|
-
onChange?: ((value: string) => any) | undefined;
|
|
32
31
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
32
|
+
onChange?: ((value: string) => any) | undefined;
|
|
33
33
|
onFocus?: ((eve: FocusEvent) => any) | undefined;
|
|
34
34
|
onBlur?: ((eve: FocusEvent) => any) | undefined;
|
|
35
35
|
onFinish?: ((value: string) => any) | undefined;
|
|
36
36
|
}>, {
|
|
37
|
-
length: number;
|
|
38
|
-
type: "filled" | "outlined" | "underlined";
|
|
39
|
-
disabled: boolean;
|
|
40
37
|
validateEvent: boolean;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
type: "filled" | "outlined" | "underlined";
|
|
40
|
+
length: number;
|
|
41
41
|
validator: (char: string, index: number) => boolean;
|
|
42
42
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
43
43
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -127,12 +127,12 @@ declare const inputTagProps: {
|
|
|
127
127
|
readonly max: NumberConstructor;
|
|
128
128
|
readonly tagType: {
|
|
129
129
|
readonly default: "info";
|
|
130
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "
|
|
130
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "success" | "primary" | "warning" | "info" | "danger", unknown>>;
|
|
131
131
|
readonly required: false;
|
|
132
132
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
133
133
|
readonly __epPropKey: true;
|
|
134
134
|
};
|
|
135
|
-
readonly tagEffect: EpPropFinalized<StringConstructor, "
|
|
135
|
+
readonly tagEffect: EpPropFinalized<StringConstructor, "dark" | "light" | "plain", unknown, "light", boolean>;
|
|
136
136
|
readonly effect: EpPropFinalized<(new (...args: any[]) => string) | (() => PopperEffect) | (((new (...args: any[]) => string) | (() => PopperEffect)) | null)[], unknown, unknown, "light", boolean>;
|
|
137
137
|
readonly trigger: EpPropFinalized<(new (...args: any[]) => "Enter" | "Space") | (() => "Enter" | "Space") | (((new (...args: any[]) => "Enter" | "Space") | (() => "Enter" | "Space")) | null)[], unknown, unknown, string, boolean>;
|
|
138
138
|
readonly draggable: BooleanConstructor;
|
|
@@ -24,38 +24,38 @@ declare const __VLS_base: _$vue.DefineComponent<InputTagProps, {
|
|
|
24
24
|
focus: () => void;
|
|
25
25
|
blur: () => void;
|
|
26
26
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
27
|
-
change: (value?: string[] | undefined) => void;
|
|
28
27
|
clear: () => void;
|
|
29
28
|
"update:modelValue": (value?: string[] | undefined) => void;
|
|
30
|
-
input: (value: string) => void;
|
|
31
29
|
focus: (evt: FocusEvent) => void;
|
|
32
30
|
blur: (evt: FocusEvent) => void;
|
|
31
|
+
change: (value?: string[] | undefined) => void;
|
|
32
|
+
input: (value: string) => void;
|
|
33
33
|
"add-tag": (value: string | string[]) => void;
|
|
34
34
|
"remove-tag": (value: string, index: number) => void;
|
|
35
35
|
"drag-tag": (oldIndex: number, newIndex: number, value: string) => void;
|
|
36
36
|
}, string, _$vue.PublicProps, Readonly<InputTagProps> & Readonly<{
|
|
37
|
-
onChange?: ((value?: string[] | undefined) => any) | undefined;
|
|
38
37
|
onClear?: (() => any) | undefined;
|
|
39
38
|
"onUpdate:modelValue"?: ((value?: string[] | undefined) => any) | undefined;
|
|
40
39
|
onInput?: ((value: string) => any) | undefined;
|
|
40
|
+
onChange?: ((value?: string[] | undefined) => any) | undefined;
|
|
41
41
|
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
42
42
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
43
43
|
"onAdd-tag"?: ((value: string | string[]) => any) | undefined;
|
|
44
44
|
"onRemove-tag"?: ((value: string, index: number) => any) | undefined;
|
|
45
45
|
"onDrag-tag"?: ((oldIndex: number, newIndex: number, value: string) => any) | undefined;
|
|
46
46
|
}>, {
|
|
47
|
-
|
|
48
|
-
id: string;
|
|
47
|
+
validateEvent: boolean;
|
|
49
48
|
disabled: boolean;
|
|
49
|
+
id: string;
|
|
50
50
|
autocomplete: string;
|
|
51
51
|
clearIcon: IconPropType;
|
|
52
52
|
tabindex: string | number;
|
|
53
|
-
|
|
53
|
+
effect: PopperEffect;
|
|
54
|
+
saveOnBlur: boolean;
|
|
54
55
|
trigger: "Enter" | "Space";
|
|
55
56
|
maxCollapseTags: number;
|
|
56
|
-
tagType: "
|
|
57
|
-
tagEffect: "
|
|
58
|
-
saveOnBlur: boolean;
|
|
57
|
+
tagType: "success" | "primary" | "warning" | "info" | "danger";
|
|
58
|
+
tagEffect: "dark" | "light" | "plain";
|
|
59
59
|
delimiter: string | RegExp;
|
|
60
60
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
61
61
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -35,7 +35,7 @@ interface LinkProps {
|
|
|
35
35
|
* @deprecated Removed after 3.0.0, Use `LinkProps` instead.
|
|
36
36
|
*/
|
|
37
37
|
declare const linkProps: {
|
|
38
|
-
readonly type: EpPropFinalized<StringConstructor, "
|
|
38
|
+
readonly type: EpPropFinalized<StringConstructor, "success" | "default" | "primary" | "warning" | "info" | "danger", unknown, undefined, boolean>;
|
|
39
39
|
readonly underline: EpPropFinalized<readonly [BooleanConstructor, StringConstructor], boolean | "always" | "never" | "hover", unknown, undefined, boolean>;
|
|
40
40
|
readonly disabled: BooleanConstructor;
|
|
41
41
|
readonly href: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -13,9 +13,9 @@ declare const __VLS_base: _$vue.DefineComponent<LinkProps, {}, {}, {}, {}, _$vue
|
|
|
13
13
|
}, string, _$vue.PublicProps, Readonly<LinkProps> & Readonly<{
|
|
14
14
|
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
|
|
17
|
-
type: "default" | "primary" | "success" | "warning" | "info" | "danger";
|
|
16
|
+
type: "success" | "default" | "primary" | "warning" | "info" | "danger";
|
|
18
17
|
underline: boolean | "always" | "never" | "hover";
|
|
18
|
+
target: (string & {}) | "_self" | "_blank" | "_parent" | "_top";
|
|
19
19
|
href: string;
|
|
20
20
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|