@element-plus/nightly 0.0.20260328 → 0.0.20260330
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 +362 -14
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +363 -15
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/affix/src/affix.vue.d.ts +2 -2
- package/es/components/alert/src/alert.d.ts +1 -1
- package/es/components/alert/src/alert.vue.d.ts +1 -1
- package/es/components/anchor/src/anchor-link.vue.d.ts +1 -3
- package/es/components/anchor/src/anchor-link.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
- package/es/components/anchor/src/anchor.vue.d.ts +1 -1
- package/es/components/autocomplete/src/autocomplete.d.ts +2 -2
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
- package/es/components/avatar/src/avatar.d.ts +1 -1
- package/es/components/avatar/src/avatar.vue.d.ts +1 -1
- package/es/components/badge/src/badge.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/carousel/src/carousel-item.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +3 -3
- package/es/components/cascader/src/cascader.d.ts +3 -3
- package/es/components/cascader/src/cascader.vue.d.ts +10 -10
- package/es/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.mjs +6 -1
- package/es/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.vue.d.ts +1 -1
- package/es/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
- package/es/components/checkbox/src/checkbox-group.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +2 -2
- package/es/components/checkbox/src/checkbox.d.ts +8 -8
- package/es/components/checkbox/src/checkbox.vue.d.ts +5 -5
- package/es/components/collapse/src/collapse.vue.d.ts +1 -1
- package/es/components/color-picker/src/color-picker.vue.d.ts +5 -5
- package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/es/components/color-picker-panel/src/composables/use-predefine.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +11 -11
- package/es/components/date-picker/src/props.d.ts +2 -2
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +6 -6
- package/es/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/es/components/descriptions/src/description-item.d.ts +13 -13
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +6 -6
- package/es/components/dialog/src/use-dialog.d.ts +2 -2
- package/es/components/dialog/src/use-dialog.mjs.map +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +7 -7
- package/es/components/dropdown/src/dropdown-item.vue.d.ts +3 -9
- package/es/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.d.ts +3 -3
- package/es/components/dropdown/src/dropdown.vue.d.ts +65 -71
- package/es/components/form/src/form-item.vue_vue_type_script_setup_true_lang.mjs +11 -1
- package/es/components/form/src/form-item.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/form/src/form.vue_vue_type_script_setup_true_lang.mjs +11 -3
- package/es/components/form/src/form.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/form/src/types.d.ts +2 -1
- package/es/components/icon/src/icon.vue.d.ts +1 -3
- package/es/components/icon/src/icon.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/image/src/image.d.ts +1 -1
- package/es/components/image/src/image.vue.d.ts +7 -7
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/es/components/input/src/input.d.ts +1 -1
- package/es/components/input/src/input.vue.d.ts +4 -3
- package/es/components/input/src/input.vue_vue_type_script_setup_true_lang.mjs +1 -0
- package/es/components/input/src/input.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input-number/src/input-number.d.ts +1 -1
- package/es/components/input-number/src/input-number.vue.d.ts +6 -6
- package/es/components/input-tag/src/input-tag.d.ts +1 -1
- package/es/components/input-tag/src/input-tag.vue.d.ts +7 -7
- package/es/components/link/src/link.d.ts +1 -1
- package/es/components/link/src/link.vue.d.ts +1 -1
- package/es/components/mention/src/helper.d.ts +1 -1
- package/es/components/mention/src/helper.mjs.map +1 -1
- package/es/components/mention/src/mention.d.ts +8 -7
- package/es/components/mention/src/mention.mjs.map +1 -1
- package/es/components/mention/src/mention.vue.d.ts +48 -55
- package/es/components/mention/src/mention.vue_vue_type_script_setup_true_lang.mjs +212 -5
- package/es/components/mention/src/mention.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/mention/src/mention2.mjs.map +1 -1
- package/es/components/menu/src/menu.d.ts +2 -2
- package/es/components/message/src/message.d.ts +1 -1
- package/es/components/message/src/message.vue.d.ts +6 -6
- package/es/components/notification/src/notification.d.ts +1 -1
- package/es/components/notification/src/notification.vue.d.ts +4 -4
- package/es/components/pagination/src/pagination.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +2 -2
- package/es/components/popover/src/popover.d.ts +1 -1
- package/es/components/popover/src/popover.vue.d.ts +8 -8
- package/es/components/popper/src/composables/use-content.d.ts +8 -8
- package/es/components/popper/src/content.vue.d.ts +4 -4
- package/es/components/popper/src/popper.d.ts +2 -2
- package/es/components/popper/src/trigger.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/progress/src/progress.vue.d.ts +5 -5
- 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 +4 -4
- package/es/components/radio/src/radio.d.ts +6 -6
- package/es/components/radio/src/radio.vue.d.ts +4 -4
- package/es/components/rate/src/rate.vue.d.ts +2 -2
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/row/src/row.vue.d.ts +1 -1
- package/es/components/segmented/index.d.ts +2 -2
- package/es/components/segmented/src/segmented.d.ts +1 -1
- package/es/components/segmented/src/segmented.vue.d.ts +1 -1
- package/es/components/select/src/option.d.ts +2 -2
- package/es/components/select/src/option.vue.d.ts +5 -5
- package/es/components/select/src/select.d.ts +4 -4
- package/es/components/select/src/select.vue.d.ts +75 -81
- package/es/components/select-v2/src/defaults.d.ts +2 -2
- package/es/components/select-v2/src/select.vue.d.ts +62 -68
- package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/slider/src/slider.vue.d.ts +5 -5
- package/es/components/space/src/space.d.ts +1 -1
- package/es/components/statistic/src/statistic.vue.d.ts +1 -1
- package/es/components/steps/src/item.d.ts +1 -1
- package/es/components/steps/src/steps.d.ts +2 -2
- package/es/components/switch/src/switch.vue.d.ts +2 -2
- package/es/components/table/src/table-column/index.d.ts +22 -22
- package/es/components/table/src/table-header/index.d.ts +15 -15
- package/es/components/table/src/table.vue.d.ts +37 -37
- package/es/components/table-v2/src/table-grid.d.ts +1 -1
- package/es/components/table-v2/src/table-v2.d.ts +1 -1
- package/es/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +1 -1
- package/es/components/tag/src/tag.d.ts +1 -1
- 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.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +10 -10
- package/es/components/time-picker/src/common/picker.vue_vue_type_script_setup_true_lang.mjs +4 -3
- package/es/components/time-picker/src/common/picker.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/time-picker/src/common/props.d.ts +1 -1
- package/es/components/time-picker/src/time-picker.d.ts +8 -8
- package/es/components/time-select/src/time-select.vue.d.ts +4 -4
- 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 +8 -8
- package/es/components/tooltip/src/tooltip.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +12 -12
- 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 +8 -8
- package/es/components/transfer/src/composables/use-check.d.ts +4 -4
- package/es/components/transfer/src/composables/use-check.mjs.map +1 -1
- package/es/components/transfer/src/composables/use-computed-data.d.ts +3 -3
- package/es/components/transfer/src/composables/use-computed-data.mjs +1 -1
- package/es/components/transfer/src/composables/use-computed-data.mjs.map +1 -1
- package/es/components/transfer/src/composables/use-move.d.ts +2 -2
- package/es/components/transfer/src/composables/use-move.mjs.map +1 -1
- package/es/components/transfer/src/composables/use-props-alias.d.ts +4 -2
- package/es/components/transfer/src/composables/use-props-alias.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel.d.ts +11 -10
- package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel.vue.d.ts +23 -25
- package/es/components/transfer/src/transfer-panel.vue_vue_type_script_setup_true_lang.mjs +48 -2
- package/es/components/transfer/src/transfer-panel.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
- package/es/components/transfer/src/transfer.d.ts +9 -8
- package/es/components/transfer/src/transfer.mjs.map +1 -1
- package/es/components/transfer/src/transfer.vue.d.ts +32 -42
- package/es/components/transfer/src/transfer.vue_vue_type_script_setup_true_lang.mjs +73 -2
- package/es/components/transfer/src/transfer.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/transfer/src/transfer2.mjs.map +1 -1
- package/es/components/tree/src/tree.vue.d.ts +22 -28
- package/es/components/tree-select/src/tree-select.vue.d.ts +34 -34
- package/es/components/tree-v2/src/tree.vue.d.ts +2 -2
- package/es/components/upload/src/upload-content.mjs.map +1 -1
- 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/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 +2 -2
- package/es/hooks/use-popper/index.d.ts +8 -8
- package/es/utils/vue/size.d.ts +1 -1
- package/es/utils/vue/vnode.d.ts +4 -4
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/src/affix.vue.d.ts +2 -2
- package/lib/components/alert/src/alert.d.ts +1 -1
- package/lib/components/alert/src/alert.vue.d.ts +1 -1
- package/lib/components/anchor/src/anchor-link.vue.d.ts +1 -3
- package/lib/components/anchor/src/anchor-link.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/anchor/src/anchor-link2.js.map +1 -1
- package/lib/components/anchor/src/anchor.vue.d.ts +1 -1
- package/lib/components/autocomplete/src/autocomplete.d.ts +2 -2
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
- package/lib/components/avatar/src/avatar.d.ts +1 -1
- package/lib/components/avatar/src/avatar.vue.d.ts +1 -1
- package/lib/components/badge/src/badge.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/carousel/src/carousel-item.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +3 -3
- package/lib/components/cascader/src/cascader.d.ts +3 -3
- package/lib/components/cascader/src/cascader.vue.d.ts +10 -10
- package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js +6 -1
- package/lib/components/cascader/src/cascader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js.map +1 -1
- package/lib/components/cascader-panel/src/index.vue.d.ts +1 -1
- package/lib/components/cascader-panel/src/index.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/check-tag/src/check-tag.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
- package/lib/components/checkbox/src/checkbox-group.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +2 -2
- package/lib/components/checkbox/src/checkbox.d.ts +8 -8
- package/lib/components/checkbox/src/checkbox.vue.d.ts +5 -5
- package/lib/components/collapse/src/collapse.vue.d.ts +1 -1
- package/lib/components/color-picker/src/color-picker.vue.d.ts +5 -5
- package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/lib/components/color-picker-panel/src/composables/use-predefine.js.map +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +11 -11
- package/lib/components/date-picker/src/props.d.ts +2 -2
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +6 -6
- package/lib/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/lib/components/descriptions/src/description-item.d.ts +13 -13
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +6 -6
- package/lib/components/dialog/src/use-dialog.d.ts +2 -2
- package/lib/components/dialog/src/use-dialog.js.map +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +7 -7
- package/lib/components/dropdown/src/dropdown-item.vue.d.ts +3 -9
- package/lib/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.d.ts +3 -3
- package/lib/components/dropdown/src/dropdown.vue.d.ts +65 -71
- package/lib/components/form/src/form-item.vue_vue_type_script_setup_true_lang.js +11 -1
- package/lib/components/form/src/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/form/src/form.vue_vue_type_script_setup_true_lang.js +11 -3
- package/lib/components/form/src/form.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/form/src/types.d.ts +2 -1
- package/lib/components/icon/src/icon.vue.d.ts +1 -3
- package/lib/components/icon/src/icon.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/image/src/image.d.ts +1 -1
- package/lib/components/image/src/image.vue.d.ts +7 -7
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/lib/components/input/src/input.d.ts +1 -1
- package/lib/components/input/src/input.vue.d.ts +4 -3
- package/lib/components/input/src/input.vue_vue_type_script_setup_true_lang.js +1 -0
- package/lib/components/input/src/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input-number/src/input-number.d.ts +1 -1
- package/lib/components/input-number/src/input-number.vue.d.ts +6 -6
- package/lib/components/input-tag/src/input-tag.d.ts +1 -1
- package/lib/components/input-tag/src/input-tag.vue.d.ts +7 -7
- package/lib/components/link/src/link.d.ts +1 -1
- package/lib/components/link/src/link.vue.d.ts +1 -1
- package/lib/components/mention/src/helper.d.ts +1 -1
- package/lib/components/mention/src/helper.js.map +1 -1
- package/lib/components/mention/src/mention.d.ts +8 -7
- package/lib/components/mention/src/mention.js.map +1 -1
- package/lib/components/mention/src/mention.vue.d.ts +48 -55
- package/lib/components/mention/src/mention.vue_vue_type_script_setup_true_lang.js +208 -1
- package/lib/components/mention/src/mention.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/mention/src/mention2.js.map +1 -1
- package/lib/components/menu/src/menu.d.ts +2 -2
- package/lib/components/message/src/message.d.ts +1 -1
- package/lib/components/message/src/message.vue.d.ts +6 -6
- package/lib/components/notification/src/notification.d.ts +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +4 -4
- package/lib/components/pagination/src/pagination.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +2 -2
- package/lib/components/popover/src/popover.d.ts +1 -1
- package/lib/components/popover/src/popover.vue.d.ts +8 -8
- package/lib/components/popper/src/composables/use-content.d.ts +8 -8
- package/lib/components/popper/src/content.vue.d.ts +4 -4
- package/lib/components/popper/src/popper.d.ts +2 -2
- package/lib/components/popper/src/trigger.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/progress/src/progress.vue.d.ts +5 -5
- 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 +4 -4
- package/lib/components/radio/src/radio.d.ts +6 -6
- package/lib/components/radio/src/radio.vue.d.ts +4 -4
- package/lib/components/rate/src/rate.vue.d.ts +2 -2
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/row/src/row.vue.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +2 -2
- package/lib/components/segmented/src/segmented.d.ts +1 -1
- package/lib/components/segmented/src/segmented.vue.d.ts +1 -1
- package/lib/components/select/src/option.d.ts +2 -2
- package/lib/components/select/src/option.vue.d.ts +5 -5
- package/lib/components/select/src/select.d.ts +4 -4
- package/lib/components/select/src/select.vue.d.ts +75 -81
- package/lib/components/select-v2/src/defaults.d.ts +2 -2
- package/lib/components/select-v2/src/select.vue.d.ts +62 -68
- package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +5 -5
- package/lib/components/space/src/space.d.ts +1 -1
- package/lib/components/statistic/src/statistic.vue.d.ts +1 -1
- package/lib/components/steps/src/item.d.ts +1 -1
- package/lib/components/steps/src/steps.d.ts +2 -2
- package/lib/components/switch/src/switch.vue.d.ts +2 -2
- package/lib/components/table/src/table-column/index.d.ts +22 -22
- package/lib/components/table/src/table-header/index.d.ts +15 -15
- package/lib/components/table/src/table.vue.d.ts +37 -37
- package/lib/components/table-v2/src/table-grid.d.ts +1 -1
- package/lib/components/table-v2/src/table-v2.d.ts +1 -1
- package/lib/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +1 -1
- package/lib/components/tag/src/tag.d.ts +1 -1
- 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.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +10 -10
- package/lib/components/time-picker/src/common/picker.vue_vue_type_script_setup_true_lang.js +4 -3
- package/lib/components/time-picker/src/common/picker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/time-picker/src/common/props.d.ts +1 -1
- package/lib/components/time-picker/src/time-picker.d.ts +8 -8
- package/lib/components/time-select/src/time-select.vue.d.ts +4 -4
- 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 +8 -8
- package/lib/components/tooltip/src/tooltip.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +12 -12
- 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 +8 -8
- package/lib/components/transfer/src/composables/use-check.d.ts +4 -4
- package/lib/components/transfer/src/composables/use-check.js.map +1 -1
- package/lib/components/transfer/src/composables/use-computed-data.d.ts +3 -3
- package/lib/components/transfer/src/composables/use-computed-data.js +1 -1
- package/lib/components/transfer/src/composables/use-computed-data.js.map +1 -1
- package/lib/components/transfer/src/composables/use-move.d.ts +2 -2
- package/lib/components/transfer/src/composables/use-move.js.map +1 -1
- package/lib/components/transfer/src/composables/use-props-alias.d.ts +4 -2
- package/lib/components/transfer/src/composables/use-props-alias.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel.d.ts +11 -10
- package/lib/components/transfer/src/transfer-panel.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel.vue.d.ts +23 -25
- package/lib/components/transfer/src/transfer-panel.vue_vue_type_script_setup_true_lang.js +47 -1
- package/lib/components/transfer/src/transfer-panel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
- package/lib/components/transfer/src/transfer.d.ts +9 -8
- package/lib/components/transfer/src/transfer.js.map +1 -1
- package/lib/components/transfer/src/transfer.vue.d.ts +32 -42
- package/lib/components/transfer/src/transfer.vue_vue_type_script_setup_true_lang.js +72 -1
- package/lib/components/transfer/src/transfer.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/transfer/src/transfer2.js.map +1 -1
- package/lib/components/tree/src/tree.vue.d.ts +22 -28
- package/lib/components/tree-select/src/tree-select.vue.d.ts +34 -34
- package/lib/components/tree-v2/src/tree.vue.d.ts +2 -2
- package/lib/components/upload/src/upload-content.js.map +1 -1
- 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/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 +2 -2
- package/lib/hooks/use-popper/index.d.ts +8 -8
- package/lib/utils/vue/size.d.ts +1 -1
- package/lib/utils/vue/vnode.d.ts +4 -4
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <form ref=\"formRef\" :class=\"formClasses\">\n <slot />\n </form>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, ref, toRefs, watch } from 'vue'\nimport { cloneDeep } from 'lodash-unified'\nimport {\n debugWarn,\n ensureArray,\n getProp,\n isArray,\n isFunction,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport { formContextKey } from './constants'\nimport { formEmits } from './form'\nimport { filterFields, useFormLabelWidth } from './utils'\n\nimport type { ValidateFieldsError } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { FormProps } from './form'\nimport type {\n FormContext,\n FormItemContext,\n FormValidateCallback,\n FormValidationResult,\n} from './types'\nimport type { FormItemProp } from './form-item'\n\nconst COMPONENT_NAME = 'ElForm'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = withDefaults(defineProps<FormProps>(), {\n labelPosition: 'right',\n requireAsteriskPosition: 'left',\n labelWidth: '',\n labelSuffix: '',\n showMessage: true,\n validateOnRuleChange: true,\n scrollIntoViewOptions: true,\n})\nconst emit = defineEmits(formEmits)\n\nconst formRef = ref<HTMLElement>()\nconst fields = reactive<FormItemContext[]>([])\nconst initialValues = new Map<string, any>()\n\nconst formSize = useFormSize()\nconst ns = useNamespace('form')\nconst formClasses = computed(() => {\n const { labelPosition, inline } = props\n return [\n ns.b(),\n ns.m(formSize.value || 'default'),\n {\n [ns.m(`label-${labelPosition}`)]: labelPosition,\n [ns.m('inline')]: inline,\n },\n ]\n})\n\nconst getField: FormContext['getField'] = (prop) => {\n return filterFields(fields, [prop])[0]\n}\n\nconst addField: FormContext['addField'] = (field) => {\n fields.push(field)\n if (field.propString) {\n if (initialValues.has(field.propString)) {\n field.setInitialValue(initialValues.get(field.propString))\n } else {\n initialValues.set(field.propString, cloneDeep(field.fieldValue))\n }\n }\n}\n\nconst removeField: FormContext['removeField'] = (field) => {\n if (field.prop) {\n fields.splice(fields.indexOf(field), 1)\n }\n}\n\nconst setInitialValues: FormContext['setInitialValues'] = (initModel) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for setInitialValues to work.')\n return\n }\n if (!initModel) {\n debugWarn(\n COMPONENT_NAME,\n 'initModel is required for setInitialValues to work.'\n )\n return\n }\n\n for (const key of initialValues.keys()) {\n initialValues.set(key, cloneDeep(getProp(initModel, key).value))\n }\n fields.forEach((field) => {\n if (field.prop) {\n field.setInitialValue(getProp(initModel, field.prop).value)\n }\n })\n}\n\nconst resetFields: FormContext['resetFields'] = (properties = []) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for resetFields to work.')\n return\n }\n\n filterFields(fields, properties).forEach((field) => field.resetField())\n\n const activePropStrings = new Set(\n fields.map((f) => f.propString).filter(Boolean)\n )\n const propsToCheck =\n properties.length > 0\n ? ensureArray(properties).map((p) => (isArray(p) ? p.join('.') : p))\n : [...initialValues.keys()]\n\n for (const propString of propsToCheck) {\n if (!activePropStrings.has(propString) && initialValues.has(propString)) {\n getProp(props.model, propString).value = cloneDeep(\n initialValues.get(propString)\n )\n }\n }\n}\n\nconst clearValidate: FormContext['clearValidate'] = (props = []) => {\n filterFields(fields, props).forEach((field) => field.clearValidate())\n}\n\nconst isValidatable = computed(() => {\n const hasModel = !!props.model\n if (!hasModel) {\n debugWarn(COMPONENT_NAME, 'model is required for validate to work.')\n }\n return hasModel\n})\n\nconst obtainValidateFields = (props: Arrayable<FormItemProp>) => {\n if (fields.length === 0) return []\n\n const filteredFields = filterFields(fields, props)\n if (!filteredFields.length) {\n debugWarn(COMPONENT_NAME, 'please pass correct props!')\n return []\n }\n return filteredFields\n}\n\nconst validate = async (\n callback?: FormValidateCallback\n): FormValidationResult => validateField(undefined, callback)\n\nconst doValidateField = async (\n props: Arrayable<FormItemProp> = []\n): Promise<boolean> => {\n if (!isValidatable.value) return false\n\n const fields = obtainValidateFields(props)\n if (fields.length === 0) return true\n\n let validationErrors: ValidateFieldsError = {}\n for (const field of fields) {\n try {\n await field.validate('')\n if (field.validateState === 'error' && !field.error) field.resetField()\n } catch (fields) {\n validationErrors = {\n ...validationErrors,\n ...(fields as ValidateFieldsError),\n }\n }\n }\n\n if (Object.keys(validationErrors).length === 0) return true\n return Promise.reject(validationErrors)\n}\n\nconst validateField: FormContext['validateField'] = async (\n modelProps = [],\n callback\n) => {\n let result = false\n const shouldThrow = !isFunction(callback)\n try {\n result = await doValidateField(modelProps)\n // When result is false meaning that the fields are not validatable\n if (result === true) {\n await callback?.(result)\n }\n return result\n } catch (e) {\n if (e instanceof Error) throw e\n\n const invalidFields = e as ValidateFieldsError\n\n if (props.scrollToError) {\n // form-item may be dynamically rendered based on the judgment conditions, and the order in invalidFields is uncertain.\n // Therefore, the first form field with an error is determined by directly looking for the rendered element.\n if (formRef.value) {\n const formItem = formRef.value.querySelector(`.${ns.b()}-item.is-error`)\n formItem?.scrollIntoView(props.scrollIntoViewOptions)\n }\n }\n !result && (await callback?.(false, invalidFields))\n return shouldThrow && Promise.reject(invalidFields)\n }\n}\n\nconst scrollToField = (prop: FormItemProp) => {\n const field = getField(prop)\n if (field) {\n field.$el?.scrollIntoView(props.scrollIntoViewOptions)\n }\n}\n\nwatch(\n () => props.rules,\n () => {\n if (props.validateOnRuleChange) {\n validate().catch((err) => debugWarn(err))\n }\n },\n { deep: true, flush: 'post' }\n)\n\nprovide(\n formContextKey,\n reactive({\n ...toRefs(props),\n emit,\n\n resetFields,\n clearValidate,\n validateField,\n getField,\n addField,\n removeField,\n setInitialValues,\n\n ...useFormLabelWidth(),\n })\n)\n\ndefineExpose({\n /**\n * @description Validate the whole form. Receives a callback or returns `Promise`.\n */\n validate,\n /**\n * @description Validate specified fields.\n */\n validateField,\n /**\n * @description Reset specified fields and remove validation result.\n */\n resetFields,\n /**\n * @description Clear validation message for specified fields.\n */\n clearValidate,\n /**\n * @description Scroll to the specified fields.\n */\n scrollToField,\n /**\n * @description Get a field context.\n */\n getField,\n /**\n * @description All fields context.\n */\n fields,\n /**\n * @description Set initial values for form fields. When `resetFields` is called, fields will reset to these values.\n */\n setInitialValues,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;AAiCA,MAAM,iBAAiB;;;;;;;EAIvB,MAAM,QAAQ;EASd,MAAM,OAAO;EAEb,MAAM,UAAU,KAAiB;EACjC,MAAM,SAAS,SAA4B,EAAE,CAAA;EAC7C,MAAM,gCAAgB,IAAI,KAAiB;EAE3C,MAAM,WAAW,aAAY;EAC7B,MAAM,KAAK,aAAa,OAAM;EAC9B,MAAM,cAAc,eAAe;GACjC,MAAM,EAAE,eAAe,WAAW;AAClC,UAAO;IACL,GAAG,GAAG;IACN,GAAG,EAAE,SAAS,SAAS,UAAU;IACjC;MACG,GAAG,EAAE,SAAS,gBAAgB,GAAG;MACjC,GAAG,EAAE,SAAS,GAAG;KACnB;IACH;IACD;EAED,MAAM,YAAqC,SAAS;AAClD,UAAO,aAAa,QAAQ,CAAC,KAAK,CAAC,CAAC;;EAGtC,MAAM,YAAqC,UAAU;AACnD,UAAO,KAAK,MAAK;AACjB,OAAI,MAAM,WACR,KAAI,cAAc,IAAI,MAAM,WAAW,CACrC,OAAM,gBAAgB,cAAc,IAAI,MAAM,WAAW,CAAA;OAEzD,eAAc,IAAI,MAAM,YAAY,UAAU,MAAM,WAAW,CAAA;;EAKrE,MAAM,eAA2C,UAAU;AACzD,OAAI,MAAM,KACR,QAAO,OAAO,OAAO,QAAQ,MAAM,EAAE,EAAC;;EAI1C,MAAM,oBAAqD,cAAc;AACvE,OAAI,CAAC,MAAM,OAAO;AAChB,cAAU,gBAAgB,kDAAiD;AAC3E;;AAEF,OAAI,CAAC,WAAW;AACd,cACE,gBACA,sDACF;AACA;;AAGF,QAAK,MAAM,OAAO,cAAc,MAAM,CACpC,eAAc,IAAI,KAAK,UAAU,QAAQ,WAAW,IAAI,CAAC,MAAM,CAAA;AAEjE,UAAO,SAAS,UAAU;AACxB,QAAI,MAA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A;GAIA;GAIA;GAIA;GACD,CAAA;;uBA7RC,mBAEO,QAAA;aAFG;IAAJ,KAAI;IAAW,OAAK,eAAE,YAAA,MAAW;OACrC,WAAQ,KAAA,QAAA,UAAA"}
|
|
1
|
+
{"version":3,"file":"form.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <form ref=\"formRef\" :class=\"formClasses\">\n <slot />\n </form>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, ref, toRefs, watch } from 'vue'\nimport { cloneDeep } from 'lodash-unified'\nimport {\n debugWarn,\n ensureArray,\n getProp,\n isArray,\n isFunction,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport { formContextKey } from './constants'\nimport { formEmits } from './form'\nimport { filterFields, useFormLabelWidth } from './utils'\n\nimport type { ValidateFieldsError } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { FormProps } from './form'\nimport type {\n FormContext,\n FormItemContext,\n FormValidateCallback,\n FormValidationResult,\n} from './types'\nimport type { FormItemProp } from './form-item'\n\nconst COMPONENT_NAME = 'ElForm'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = withDefaults(defineProps<FormProps>(), {\n labelPosition: 'right',\n requireAsteriskPosition: 'left',\n labelWidth: '',\n labelSuffix: '',\n showMessage: true,\n validateOnRuleChange: true,\n scrollIntoViewOptions: true,\n})\nconst emit = defineEmits(formEmits)\n\nconst formRef = ref<HTMLElement>()\nconst fields = reactive<FormItemContext[]>([])\nconst initialValues = new Map<string, any>()\n\nconst formSize = useFormSize()\nconst ns = useNamespace('form')\nconst formClasses = computed(() => {\n const { labelPosition, inline } = props\n return [\n ns.b(),\n ns.m(formSize.value || 'default'),\n {\n [ns.m(`label-${labelPosition}`)]: labelPosition,\n [ns.m('inline')]: inline,\n },\n ]\n})\n\nconst getField: FormContext['getField'] = (prop) => {\n return filterFields(fields, [prop])[0]\n}\n\nconst addField: FormContext['addField'] = (field) => {\n if (!fields.includes(field)) {\n fields.push(field)\n }\n if (field.propString) {\n if (initialValues.has(field.propString)) {\n field.setInitialValue(initialValues.get(field.propString))\n } else {\n initialValues.set(field.propString, cloneDeep(field.fieldValue))\n }\n }\n}\n\nconst removeField: FormContext['removeField'] = (field, oldPropString?) => {\n if (oldPropString) {\n // Prop changed on a live field: delete stale key, field stays in fields[]\n initialValues.delete(oldPropString)\n return\n }\n // Unmount: splice from array, cache initialValue for potential remount\n const idx = fields.indexOf(field)\n if (idx > -1) {\n fields.splice(idx, 1)\n if (field.propString) {\n initialValues.set(field.propString, cloneDeep(field.getInitialValue()))\n }\n }\n}\n\nconst setInitialValues: FormContext['setInitialValues'] = (initModel) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for setInitialValues to work.')\n return\n }\n if (!initModel) {\n debugWarn(\n COMPONENT_NAME,\n 'initModel is required for setInitialValues to work.'\n )\n return\n }\n\n for (const key of initialValues.keys()) {\n initialValues.set(key, cloneDeep(getProp(initModel, key).value))\n }\n fields.forEach((field) => {\n if (field.prop) {\n field.setInitialValue(getProp(initModel, field.prop).value)\n }\n })\n}\n\nconst resetFields: FormContext['resetFields'] = (properties = []) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for resetFields to work.')\n return\n }\n\n filterFields(fields, properties).forEach((field) => field.resetField())\n\n const activePropStrings = new Set(\n fields.map((f) => f.propString).filter(Boolean)\n )\n const propsToCheck =\n properties.length > 0\n ? ensureArray(properties).map((p) => (isArray(p) ? p.join('.') : p))\n : [...initialValues.keys()]\n\n for (const propString of propsToCheck) {\n if (!activePropStrings.has(propString) && initialValues.has(propString)) {\n getProp(props.model, propString).value = cloneDeep(\n initialValues.get(propString)\n )\n }\n }\n}\n\nconst clearValidate: FormContext['clearValidate'] = (props = []) => {\n filterFields(fields, props).forEach((field) => field.clearValidate())\n}\n\nconst isValidatable = computed(() => {\n const hasModel = !!props.model\n if (!hasModel) {\n debugWarn(COMPONENT_NAME, 'model is required for validate to work.')\n }\n return hasModel\n})\n\nconst obtainValidateFields = (props: Arrayable<FormItemProp>) => {\n if (fields.length === 0) return []\n\n const filteredFields = filterFields(fields, props)\n if (!filteredFields.length) {\n debugWarn(COMPONENT_NAME, 'please pass correct props!')\n return []\n }\n return filteredFields\n}\n\nconst validate = async (\n callback?: FormValidateCallback\n): FormValidationResult => validateField(undefined, callback)\n\nconst doValidateField = async (\n props: Arrayable<FormItemProp> = []\n): Promise<boolean> => {\n if (!isValidatable.value) return false\n\n const fields = obtainValidateFields(props)\n if (fields.length === 0) return true\n\n let validationErrors: ValidateFieldsError = {}\n for (const field of fields) {\n try {\n await field.validate('')\n if (field.validateState === 'error' && !field.error) field.resetField()\n } catch (fields) {\n validationErrors = {\n ...validationErrors,\n ...(fields as ValidateFieldsError),\n }\n }\n }\n\n if (Object.keys(validationErrors).length === 0) return true\n return Promise.reject(validationErrors)\n}\n\nconst validateField: FormContext['validateField'] = async (\n modelProps = [],\n callback\n) => {\n let result = false\n const shouldThrow = !isFunction(callback)\n try {\n result = await doValidateField(modelProps)\n // When result is false meaning that the fields are not validatable\n if (result === true) {\n await callback?.(result)\n }\n return result\n } catch (e) {\n if (e instanceof Error) throw e\n\n const invalidFields = e as ValidateFieldsError\n\n if (props.scrollToError) {\n // form-item may be dynamically rendered based on the judgment conditions, and the order in invalidFields is uncertain.\n // Therefore, the first form field with an error is determined by directly looking for the rendered element.\n if (formRef.value) {\n const formItem = formRef.value.querySelector(`.${ns.b()}-item.is-error`)\n formItem?.scrollIntoView(props.scrollIntoViewOptions)\n }\n }\n !result && (await callback?.(false, invalidFields))\n return shouldThrow && Promise.reject(invalidFields)\n }\n}\n\nconst scrollToField = (prop: FormItemProp) => {\n const field = getField(prop)\n if (field) {\n field.$el?.scrollIntoView(props.scrollIntoViewOptions)\n }\n}\n\nwatch(\n () => props.rules,\n () => {\n if (props.validateOnRuleChange) {\n validate().catch((err) => debugWarn(err))\n }\n },\n { deep: true, flush: 'post' }\n)\n\nprovide(\n formContextKey,\n reactive({\n ...toRefs(props),\n emit,\n\n resetFields,\n clearValidate,\n validateField,\n getField,\n addField,\n removeField,\n setInitialValues,\n\n ...useFormLabelWidth(),\n })\n)\n\ndefineExpose({\n /**\n * @description Validate the whole form. Receives a callback or returns `Promise`.\n */\n validate,\n /**\n * @description Validate specified fields.\n */\n validateField,\n /**\n * @description Reset specified fields and remove validation result.\n */\n resetFields,\n /**\n * @description Clear validation message for specified fields.\n */\n clearValidate,\n /**\n * @description Scroll to the specified fields.\n */\n scrollToField,\n /**\n * @description Get a field context.\n */\n getField,\n /**\n * @description All fields context.\n */\n fields,\n /**\n * @description Set initial values for form fields. When `resetFields` is called, fields will reset to these values.\n */\n setInitialValues,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;AAiCA,MAAM,iBAAiB;;;;;;;EAIvB,MAAM,QAAQ;EASd,MAAM,OAAO;EAEb,MAAM,UAAU,KAAiB;EACjC,MAAM,SAAS,SAA4B,EAAE,CAAA;EAC7C,MAAM,gCAAgB,IAAI,KAAiB;EAE3C,MAAM,WAAW,aAAY;EAC7B,MAAM,KAAK,aAAa,OAAM;EAC9B,MAAM,cAAc,eAAe;GACjC,MAAM,EAAE,eAAe,WAAW;AAClC,UAAO;IACL,GAAG,GAAG;IACN,GAAG,EAAE,SAAS,SAAS,UAAU;IACjC;MACG,GAAG,EAAE,SAAS,gBAAgB,GAAG;MACjC,GAAG,EAAE,SAAS,GAAG;KACnB;IACH;IACD;EAED,MAAM,YAAqC,SAAS;AAClD,UAAO,aAAa,QAAQ,CAAC,KAAK,CAAC,CAAC;;EAGtC,MAAM,YAAqC,UAAU;AACnD,OAAI,CAAC,OAAO,SAAS,MAAM,CACzB,QAAO,KAAK,MAAK;AAEnB,OAAI,MAAM,WACR,KAAI,cAAc,IAAI,MAAM,WAAW,CACrC,OAAM,gBAAgB,cAAc,IAAI,MAAM,WAAW,CAAA;OAEzD,eAA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AI,QAAQ,MAEV,CADiB,QAAQ,MAAM,cAAc,IAAI,GAAG,GAAG,CAAC,gBAAe,EAC7D,eAAe,MAAM,sBAAqB;;AAGxD,KAAC,UAAW,MAAM,WAAW,OAAO,cAAc;AAClD,WAAO,eAAe,QAAQ,OAAO,cAAa;;;EAItD,MAAM,iBAAiB,SAAuB;GAC5C,MAAM,QAAQ,SAAS,KAAI;AAC3B,OAAI,MACF,OAAM,KAAK,eAAe,MAAM,sBAAqB;;AAIzD,cACQ,MAAM,aACN;AACJ,OAAI,MAAM,qBACR,WAAU,CAAC,OAAO,QAAQ,UAAU,IAAI,CAAA;KAG5C;GAAE,MAAM;GAAM,OAAO;GAAO,CAC9B;AAEA,UACE,gBACA,SAAS;GACP,GAAG,OAAO,MAAM;GAChB;GAEA;GACA;GACA;GACA;GACA;GACA;GACA;GAEA,GAAG,mBAAmB;GACvB,CAAA,CACH;AAEA,WAAa;GAIX;GAIA;GAIA;GAIA;GAIA;GAIA;GAIA;GAIA;GACD,CAAA;;uBAzSC,mBAEO,QAAA;aAFG;IAAJ,KAAI;IAAW,OAAK,eAAE,YAAA,MAAW;OACrC,WAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form2.mjs","names":[],"sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <form ref=\"formRef\" :class=\"formClasses\">\n <slot />\n </form>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, ref, toRefs, watch } from 'vue'\nimport { cloneDeep } from 'lodash-unified'\nimport {\n debugWarn,\n ensureArray,\n getProp,\n isArray,\n isFunction,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport { formContextKey } from './constants'\nimport { formEmits } from './form'\nimport { filterFields, useFormLabelWidth } from './utils'\n\nimport type { ValidateFieldsError } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { FormProps } from './form'\nimport type {\n FormContext,\n FormItemContext,\n FormValidateCallback,\n FormValidationResult,\n} from './types'\nimport type { FormItemProp } from './form-item'\n\nconst COMPONENT_NAME = 'ElForm'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = withDefaults(defineProps<FormProps>(), {\n labelPosition: 'right',\n requireAsteriskPosition: 'left',\n labelWidth: '',\n labelSuffix: '',\n showMessage: true,\n validateOnRuleChange: true,\n scrollIntoViewOptions: true,\n})\nconst emit = defineEmits(formEmits)\n\nconst formRef = ref<HTMLElement>()\nconst fields = reactive<FormItemContext[]>([])\nconst initialValues = new Map<string, any>()\n\nconst formSize = useFormSize()\nconst ns = useNamespace('form')\nconst formClasses = computed(() => {\n const { labelPosition, inline } = props\n return [\n ns.b(),\n ns.m(formSize.value || 'default'),\n {\n [ns.m(`label-${labelPosition}`)]: labelPosition,\n [ns.m('inline')]: inline,\n },\n ]\n})\n\nconst getField: FormContext['getField'] = (prop) => {\n return filterFields(fields, [prop])[0]\n}\n\nconst addField: FormContext['addField'] = (field) => {\n fields.push(field)\n if (field.propString) {\n if (initialValues.has(field.propString)) {\n field.setInitialValue(initialValues.get(field.propString))\n } else {\n initialValues.set(field.propString, cloneDeep(field.fieldValue))\n }\n }\n}\n\nconst removeField: FormContext['removeField'] = (field) => {\n if (
|
|
1
|
+
{"version":3,"file":"form2.mjs","names":[],"sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <form ref=\"formRef\" :class=\"formClasses\">\n <slot />\n </form>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, ref, toRefs, watch } from 'vue'\nimport { cloneDeep } from 'lodash-unified'\nimport {\n debugWarn,\n ensureArray,\n getProp,\n isArray,\n isFunction,\n} from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport { formContextKey } from './constants'\nimport { formEmits } from './form'\nimport { filterFields, useFormLabelWidth } from './utils'\n\nimport type { ValidateFieldsError } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { FormProps } from './form'\nimport type {\n FormContext,\n FormItemContext,\n FormValidateCallback,\n FormValidationResult,\n} from './types'\nimport type { FormItemProp } from './form-item'\n\nconst COMPONENT_NAME = 'ElForm'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = withDefaults(defineProps<FormProps>(), {\n labelPosition: 'right',\n requireAsteriskPosition: 'left',\n labelWidth: '',\n labelSuffix: '',\n showMessage: true,\n validateOnRuleChange: true,\n scrollIntoViewOptions: true,\n})\nconst emit = defineEmits(formEmits)\n\nconst formRef = ref<HTMLElement>()\nconst fields = reactive<FormItemContext[]>([])\nconst initialValues = new Map<string, any>()\n\nconst formSize = useFormSize()\nconst ns = useNamespace('form')\nconst formClasses = computed(() => {\n const { labelPosition, inline } = props\n return [\n ns.b(),\n ns.m(formSize.value || 'default'),\n {\n [ns.m(`label-${labelPosition}`)]: labelPosition,\n [ns.m('inline')]: inline,\n },\n ]\n})\n\nconst getField: FormContext['getField'] = (prop) => {\n return filterFields(fields, [prop])[0]\n}\n\nconst addField: FormContext['addField'] = (field) => {\n if (!fields.includes(field)) {\n fields.push(field)\n }\n if (field.propString) {\n if (initialValues.has(field.propString)) {\n field.setInitialValue(initialValues.get(field.propString))\n } else {\n initialValues.set(field.propString, cloneDeep(field.fieldValue))\n }\n }\n}\n\nconst removeField: FormContext['removeField'] = (field, oldPropString?) => {\n if (oldPropString) {\n // Prop changed on a live field: delete stale key, field stays in fields[]\n initialValues.delete(oldPropString)\n return\n }\n // Unmount: splice from array, cache initialValue for potential remount\n const idx = fields.indexOf(field)\n if (idx > -1) {\n fields.splice(idx, 1)\n if (field.propString) {\n initialValues.set(field.propString, cloneDeep(field.getInitialValue()))\n }\n }\n}\n\nconst setInitialValues: FormContext['setInitialValues'] = (initModel) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for setInitialValues to work.')\n return\n }\n if (!initModel) {\n debugWarn(\n COMPONENT_NAME,\n 'initModel is required for setInitialValues to work.'\n )\n return\n }\n\n for (const key of initialValues.keys()) {\n initialValues.set(key, cloneDeep(getProp(initModel, key).value))\n }\n fields.forEach((field) => {\n if (field.prop) {\n field.setInitialValue(getProp(initModel, field.prop).value)\n }\n })\n}\n\nconst resetFields: FormContext['resetFields'] = (properties = []) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for resetFields to work.')\n return\n }\n\n filterFields(fields, properties).forEach((field) => field.resetField())\n\n const activePropStrings = new Set(\n fields.map((f) => f.propString).filter(Boolean)\n )\n const propsToCheck =\n properties.length > 0\n ? ensureArray(properties).map((p) => (isArray(p) ? p.join('.') : p))\n : [...initialValues.keys()]\n\n for (const propString of propsToCheck) {\n if (!activePropStrings.has(propString) && initialValues.has(propString)) {\n getProp(props.model, propString).value = cloneDeep(\n initialValues.get(propString)\n )\n }\n }\n}\n\nconst clearValidate: FormContext['clearValidate'] = (props = []) => {\n filterFields(fields, props).forEach((field) => field.clearValidate())\n}\n\nconst isValidatable = computed(() => {\n const hasModel = !!props.model\n if (!hasModel) {\n debugWarn(COMPONENT_NAME, 'model is required for validate to work.')\n }\n return hasModel\n})\n\nconst obtainValidateFields = (props: Arrayable<FormItemProp>) => {\n if (fields.length === 0) return []\n\n const filteredFields = filterFields(fields, props)\n if (!filteredFields.length) {\n debugWarn(COMPONENT_NAME, 'please pass correct props!')\n return []\n }\n return filteredFields\n}\n\nconst validate = async (\n callback?: FormValidateCallback\n): FormValidationResult => validateField(undefined, callback)\n\nconst doValidateField = async (\n props: Arrayable<FormItemProp> = []\n): Promise<boolean> => {\n if (!isValidatable.value) return false\n\n const fields = obtainValidateFields(props)\n if (fields.length === 0) return true\n\n let validationErrors: ValidateFieldsError = {}\n for (const field of fields) {\n try {\n await field.validate('')\n if (field.validateState === 'error' && !field.error) field.resetField()\n } catch (fields) {\n validationErrors = {\n ...validationErrors,\n ...(fields as ValidateFieldsError),\n }\n }\n }\n\n if (Object.keys(validationErrors).length === 0) return true\n return Promise.reject(validationErrors)\n}\n\nconst validateField: FormContext['validateField'] = async (\n modelProps = [],\n callback\n) => {\n let result = false\n const shouldThrow = !isFunction(callback)\n try {\n result = await doValidateField(modelProps)\n // When result is false meaning that the fields are not validatable\n if (result === true) {\n await callback?.(result)\n }\n return result\n } catch (e) {\n if (e instanceof Error) throw e\n\n const invalidFields = e as ValidateFieldsError\n\n if (props.scrollToError) {\n // form-item may be dynamically rendered based on the judgment conditions, and the order in invalidFields is uncertain.\n // Therefore, the first form field with an error is determined by directly looking for the rendered element.\n if (formRef.value) {\n const formItem = formRef.value.querySelector(`.${ns.b()}-item.is-error`)\n formItem?.scrollIntoView(props.scrollIntoViewOptions)\n }\n }\n !result && (await callback?.(false, invalidFields))\n return shouldThrow && Promise.reject(invalidFields)\n }\n}\n\nconst scrollToField = (prop: FormItemProp) => {\n const field = getField(prop)\n if (field) {\n field.$el?.scrollIntoView(props.scrollIntoViewOptions)\n }\n}\n\nwatch(\n () => props.rules,\n () => {\n if (props.validateOnRuleChange) {\n validate().catch((err) => debugWarn(err))\n }\n },\n { deep: true, flush: 'post' }\n)\n\nprovide(\n formContextKey,\n reactive({\n ...toRefs(props),\n emit,\n\n resetFields,\n clearValidate,\n validateField,\n getField,\n addField,\n removeField,\n setInitialValues,\n\n ...useFormLabelWidth(),\n })\n)\n\ndefineExpose({\n /**\n * @description Validate the whole form. Receives a callback or returns `Promise`.\n */\n validate,\n /**\n * @description Validate specified fields.\n */\n validateField,\n /**\n * @description Reset specified fields and remove validation result.\n */\n resetFields,\n /**\n * @description Clear validation message for specified fields.\n */\n clearValidate,\n /**\n * @description Scroll to the specified fields.\n */\n scrollToField,\n /**\n * @description Get a field context.\n */\n getField,\n /**\n * @description All fields context.\n */\n fields,\n /**\n * @description Set initial values for form fields. When `resetFields` is called, fields will reset to these values.\n */\n setInitialValues,\n})\n</script>\n"],"mappings":""}
|
|
@@ -25,7 +25,7 @@ type FormContext = FormProps & UnwrapRef<FormLabelWidthContext> & {
|
|
|
25
25
|
emit: SetupContext<FormEmits>['emit'];
|
|
26
26
|
getField: (prop: FormItemProp) => FormItemContext | undefined;
|
|
27
27
|
addField: (field: FormItemContext) => void;
|
|
28
|
-
removeField: (field: FormItemContext) => void;
|
|
28
|
+
removeField: (field: FormItemContext, oldPropString?: string) => void;
|
|
29
29
|
resetFields: (props?: Arrayable<FormItemProp>) => void;
|
|
30
30
|
setInitialValues: (initModel: Record<string, any>) => void;
|
|
31
31
|
clearValidate: (props?: Arrayable<FormItemProp>) => void;
|
|
@@ -48,6 +48,7 @@ interface FormItemContext extends FormItemProps {
|
|
|
48
48
|
resetField(): void;
|
|
49
49
|
clearValidate(): void;
|
|
50
50
|
setInitialValue: (value: any) => void;
|
|
51
|
+
getInitialValue: () => any;
|
|
51
52
|
}
|
|
52
53
|
//#endregion
|
|
53
54
|
export { FormContext, FormItemContext, FormItemRule, FormLabelWidthContext, FormRules, FormValidateCallback, FormValidateFailure, FormValidationResult };
|
|
@@ -6,9 +6,7 @@ declare var __VLS_1: {};
|
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_1) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_base: vue.DefineComponent<IconProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<IconProps> & Readonly<{}>, {
|
|
10
|
-
size: number | string;
|
|
11
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const __VLS_base: vue.DefineComponent<IconProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
12
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
11
|
declare const _default: typeof __VLS_export;
|
|
14
12
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs"],"sources":["../../../../../../packages/components/icon/src/icon.vue"],"sourcesContent":["<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { addUnit } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport type { CSSProperties } from 'vue'\nimport type { IconProps } from './icon'\n\ndefineOptions({\n name: 'ElIcon',\n inheritAttrs: false,\n})\nconst props =
|
|
1
|
+
{"version":3,"file":"icon.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs"],"sources":["../../../../../../packages/components/icon/src/icon.vue"],"sourcesContent":["<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { addUnit } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport type { CSSProperties } from 'vue'\nimport type { IconProps } from './icon'\n\ndefineOptions({\n name: 'ElIcon',\n inheritAttrs: false,\n})\nconst props = defineProps<IconProps>()\nconst ns = useNamespace('icon')\n\nconst style = computed<CSSProperties>(() => {\n const { size, color } = props\n const fontSize = addUnit(size)\n if (!fontSize && !color) return {}\n\n return {\n fontSize,\n '--color': color,\n }\n})\n</script>\n"],"mappings":";;;;;;;;;;;;EAkBA,MAAM,QAAQ;EACd,MAAM,KAAK,aAAa,OAAM;EAE9B,MAAM,QAAQ,eAA8B;GAC1C,MAAM,EAAE,MAAM,UAAU;GACxB,MAAM,WAAW,QAAQ,KAAI;AAC7B,OAAI,CAAC,YAAY,CAAC,MAAO,QAAO,EAAC;AAEjC,UAAO;IACL;IACA,WAAW;IACb;IACD;;uBA7BC,mBAEI,KAFJ,WAEI;IAFA,OAAO,MAAA,GAAE,CAAC,GAAC;IAAK,OAAO,MAAA;MAAeA,KAAAA,OAAM,EAAA,CAC9C,WAAQ,KAAA,QAAA,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon2.mjs","names":[],"sources":["../../../../../../packages/components/icon/src/icon.vue"],"sourcesContent":["<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { addUnit } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport type { CSSProperties } from 'vue'\nimport type { IconProps } from './icon'\n\ndefineOptions({\n name: 'ElIcon',\n inheritAttrs: false,\n})\nconst props =
|
|
1
|
+
{"version":3,"file":"icon2.mjs","names":[],"sources":["../../../../../../packages/components/icon/src/icon.vue"],"sourcesContent":["<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { addUnit } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\n\nimport type { CSSProperties } from 'vue'\nimport type { IconProps } from './icon'\n\ndefineOptions({\n name: 'ElIcon',\n inheritAttrs: false,\n})\nconst props = defineProps<IconProps>()\nconst ns = useNamespace('icon')\n\nconst style = computed<CSSProperties>(() => {\n const { size, color } = props\n const fontSize = addUnit(size)\n if (!fontSize && !color) return {}\n\n return {\n fontSize,\n '--color': color,\n }\n})\n</script>\n"],"mappings":""}
|
|
@@ -87,7 +87,7 @@ interface ImageProps {
|
|
|
87
87
|
declare const imageProps: {
|
|
88
88
|
readonly hideOnClickModal: BooleanConstructor;
|
|
89
89
|
readonly src: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
90
|
-
readonly fit: EpPropFinalized<StringConstructor, "" | "fill" | "
|
|
90
|
+
readonly fit: EpPropFinalized<StringConstructor, "" | "fill" | "none" | "contain" | "cover" | "scale-down", unknown, "", boolean>;
|
|
91
91
|
readonly loading: {
|
|
92
92
|
readonly type: vue.PropType<EpPropMergeType<StringConstructor, "lazy" | "eager", unknown>>;
|
|
93
93
|
readonly required: false;
|
|
@@ -38,23 +38,23 @@ declare const __VLS_base: vue.DefineComponent<ImageProps, {
|
|
|
38
38
|
close: () => void;
|
|
39
39
|
error: (evt: Event) => void;
|
|
40
40
|
load: (evt: Event) => void;
|
|
41
|
-
switch: (val: number) => void;
|
|
42
41
|
show: () => void;
|
|
42
|
+
switch: (val: number) => void;
|
|
43
43
|
}, string, vue.PublicProps, Readonly<ImageProps> & Readonly<{
|
|
44
44
|
onClose?: (() => any) | undefined;
|
|
45
45
|
onError?: ((evt: Event) => any) | undefined;
|
|
46
46
|
onLoad?: ((evt: Event) => any) | undefined;
|
|
47
|
-
onSwitch?: ((val: number) => any) | undefined;
|
|
48
47
|
onShow?: (() => any) | undefined;
|
|
48
|
+
onSwitch?: ((val: number) => any) | undefined;
|
|
49
49
|
}>, {
|
|
50
|
-
src: string;
|
|
51
|
-
fit: ImageFitType;
|
|
52
|
-
previewSrcList: string[];
|
|
53
|
-
initialIndex: number;
|
|
54
50
|
infinite: boolean;
|
|
55
51
|
closeOnPressEscape: boolean;
|
|
56
|
-
|
|
52
|
+
fit: ImageFitType;
|
|
57
53
|
scale: number;
|
|
54
|
+
src: string;
|
|
55
|
+
initialIndex: number;
|
|
56
|
+
previewSrcList: string[];
|
|
57
|
+
zoomRate: number;
|
|
58
58
|
minScale: number;
|
|
59
59
|
maxScale: number;
|
|
60
60
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -38,19 +38,19 @@ declare const __VLS_base: vue.DefineComponent<ImageViewerProps, {
|
|
|
38
38
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
39
39
|
close: () => void;
|
|
40
40
|
error: (evt: Event) => void;
|
|
41
|
-
switch: (index: number) => void;
|
|
42
41
|
rotate: (deg: number) => void;
|
|
42
|
+
switch: (index: number) => void;
|
|
43
43
|
}, string, vue.PublicProps, Readonly<ImageViewerProps> & Readonly<{
|
|
44
44
|
onClose?: (() => any) | undefined;
|
|
45
45
|
onError?: ((evt: Event) => any) | undefined;
|
|
46
|
-
onSwitch?: ((index: number) => any) | undefined;
|
|
47
46
|
onRotate?: ((deg: number) => any) | undefined;
|
|
47
|
+
onSwitch?: ((index: number) => any) | undefined;
|
|
48
48
|
}>, {
|
|
49
|
-
initialIndex: number;
|
|
50
49
|
infinite: boolean;
|
|
51
50
|
closeOnPressEscape: boolean;
|
|
52
|
-
zoomRate: number;
|
|
53
51
|
scale: number;
|
|
52
|
+
initialIndex: number;
|
|
53
|
+
zoomRate: number;
|
|
54
54
|
minScale: number;
|
|
55
55
|
maxScale: number;
|
|
56
56
|
urlList: string[];
|
|
@@ -156,7 +156,7 @@ interface InputProps {
|
|
|
156
156
|
* @deprecated Removed after 3.0.0, Use `InputProps` instead.
|
|
157
157
|
*/
|
|
158
158
|
declare const inputProps: {
|
|
159
|
-
readonly inputmode: EpPropFinalized<(new (...args: any[]) => "
|
|
159
|
+
readonly inputmode: EpPropFinalized<(new (...args: any[]) => "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal") | (() => "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined) | (((new (...args: any[]) => "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal") | (() => "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined)) | null)[], unknown, unknown, undefined, boolean>;
|
|
160
160
|
readonly name: StringConstructor;
|
|
161
161
|
readonly ariaLabel: StringConstructor;
|
|
162
162
|
readonly id: EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
@@ -25,7 +25,8 @@ declare const __VLS_base: vue.DefineComponent<InputProps, {
|
|
|
25
25
|
ref: vue.ComputedRef<HTMLInputElement | HTMLTextAreaElement | undefined>; /** @description style of textarea. */
|
|
26
26
|
textareaStyle: vue.ComputedRef<StyleValue>; /** @description from props (used on unit test) */
|
|
27
27
|
autosize: vue.Ref<InputAutoSize | undefined, InputAutoSize | undefined>; /** @description is input composing */
|
|
28
|
-
isComposing: vue.Ref<boolean, boolean>; /** @description
|
|
28
|
+
isComposing: vue.Ref<boolean, boolean>; /** @description whether the password is visible */
|
|
29
|
+
passwordVisible: vue.Ref<boolean, boolean>; /** @description HTML input element native method */
|
|
29
30
|
focus: () => void | undefined; /** @description HTML input element native method */
|
|
30
31
|
blur: () => void | undefined; /** @description HTML input element native method */
|
|
31
32
|
select: () => void; /** @description clear input value */
|
|
@@ -58,15 +59,15 @@ declare const __VLS_base: vue.DefineComponent<InputProps, {
|
|
|
58
59
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
59
60
|
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
60
61
|
}>, {
|
|
62
|
+
disabled: boolean;
|
|
61
63
|
type: InputType;
|
|
62
64
|
modelValue: string | number | null;
|
|
63
|
-
disabled: boolean;
|
|
64
|
-
tabindex: string | number;
|
|
65
65
|
validateEvent: boolean;
|
|
66
66
|
modelModifiers: InputModelModifiers;
|
|
67
67
|
autocomplete: string;
|
|
68
68
|
clearIcon: IconPropType;
|
|
69
69
|
wordLimitPosition: "inside" | "outside";
|
|
70
|
+
tabindex: string | number;
|
|
70
71
|
inputStyle: string | false | vue.CSSProperties | StyleValue[] | null;
|
|
71
72
|
rows: number;
|
|
72
73
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n containerKls,\n {\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n },\n ]\"\n :style=\"containerStyle\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <!-- input -->\n <template v-if=\"type !== 'textarea'\">\n <!-- prepend slot -->\n <div v-if=\"$slots.prepend\" :class=\"nsInput.be('group', 'prepend')\">\n <slot name=\"prepend\" />\n </div>\n\n <div ref=\"wrapperRef\" :class=\"wrapperKls\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :class=\"nsInput.e('prefix-inner')\">\n <slot name=\"prefix\" />\n <el-icon v-if=\"prefixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"prefixIcon\" />\n </el-icon>\n </span>\n </span>\n\n <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\n <slot name=\"suffix\" />\n <el-icon v-if=\"suffixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"suffixIcon\" />\n </el-icon>\n </template>\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <el-icon\n v-if=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n @click=\"handlePasswordVisible\"\n @mousedown.prevent=\"NOOP\"\n @mouseup.prevent=\"NOOP\"\n >\n <slot name=\"password-icon\" :visible=\"passwordVisible\">\n <component :is=\"passwordIcon\" />\n </slot>\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ maxlength }}\n </span>\n </span>\n <el-icon\n v-if=\"validateState && validateIcon && needStatusIcon\"\n :class=\"[\n nsInput.e('icon'),\n nsInput.e('validateIcon'),\n nsInput.is('loading', validateState === 'validating'),\n ]\"\n >\n <component :is=\"validateIcon\" />\n </el-icon>\n </span>\n </span>\n </div>\n\n <!-- append slot -->\n <div v-if=\"$slots.append\" :class=\"nsInput.be('group', 'append')\">\n <slot name=\"append\" />\n </div>\n </template>\n\n <!-- textarea -->\n <template v-else>\n <textarea\n :id=\"inputId\"\n ref=\"textarea\"\n :class=\"[\n nsTextarea.e('inner'),\n nsInput.is('focus', isFocused),\n nsTextarea.is('clearable', clearable),\n ]\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :rows=\"rows\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsTextarea.e('icon'), nsTextarea.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :style=\"countStyle\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n {{ textLength }} / {{ maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Hide, View } from '@element-plus/icons-vue'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n NOOP,\n ValidateComponentsMap,\n debugWarn,\n isClient,\n isObject,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useComposition,\n useCursor,\n useFocusController,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { calcTextareaHeight, looseToNumber } from './utils'\nimport { inputEmits, inputPropsDefaults } from './input'\n\nimport type { StyleValue } from 'vue'\nimport type { InputProps } from './input'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\n\nconst COMPONENT_NAME = 'ElInput'\ndefineOptions({\n name: COMPONENT_NAME,\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<InputProps>(), inputPropsDefaults)\nconst emit = defineEmits(inputEmits)\n\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst containerKls = computed(() => [\n props.type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize.value),\n nsInput.is('disabled', inputDisabled.value),\n nsInput.is('exceed', inputExceed.value),\n {\n [nsInput.b('group')]: slots.prepend || slots.append,\n [nsInput.m('prefix')]: slots.prefix || props.prefixIcon,\n [nsInput.m('suffix')]:\n slots.suffix || props.suffixIcon || props.clearable || props.showPassword,\n [nsInput.bm('suffix', 'password-clear')]:\n showClear.value && showPwdVisible.value,\n [nsInput.b('hidden')]: props.type === 'hidden',\n },\n rawAttrs.class,\n])\n\nconst wrapperKls = computed(() => [\n nsInput.e('wrapper'),\n nsInput.is('focus', isFocused.value),\n])\n\nconst attrs = useAttrs()\nconst maxlength = computed(() => props.maxlength?.toString())\n\nconst { form: elForm, formItem: elFormItem } = useFormItem()\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\nconst inputSize = useFormSize()\nconst inputDisabled = useFormDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst hovering = ref(false)\nconst passwordVisible = ref(false)\nconst countStyle = ref<StyleValue>()\nconst textareaCalcStyle = shallowRef(props.inputStyle)\nconst saveValue = ref('')\n\nconst _ref = computed(() => input.value || textarea.value)\n\n// wrapperRef for type=\"text\", handleFocus and handleBlur for type=\"textarea\"\n// @ts-ignore - used in template ref binding, TS cannot detect template usage\nconst { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(\n _ref,\n {\n disabled: inputDisabled,\n afterBlur() {\n if (props.validateEvent) {\n elFormItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n },\n }\n)\n\nconst needStatusIcon = computed(() => elForm?.statusIcon ?? false)\nconst validateState = computed(() => elFormItem?.validateState || '')\nconst validateIcon = computed(\n () => validateState.value && ValidateComponentsMap[validateState.value]\n)\nconst passwordIcon = computed(() => (passwordVisible.value ? View : Hide))\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst showClear = computed(\n () =>\n props.clearable &&\n !inputDisabled.value &&\n !props.readonly &&\n !!nativeInputValue.value &&\n (isFocused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () => props.showPassword && !inputDisabled.value && !!nativeInputValue.value\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!maxlength.value &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => {\n if (props.countGraphemes && props.showWordLimit) {\n return props.countGraphemes(nativeInputValue.value)\n }\n return nativeInputValue.value.length\n})\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n showClear.value ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\nconst hasModelModifiers = computed(\n () => !!Object.keys(props.modelModifiers).length\n)\n\nconst [recordCursor, setCursor] = useCursor(input)\n\nuseResizeObserver(textarea, (entries) => {\n onceInitSizeTextarea()\n if (\n !isWordLimitVisible.value ||\n (props.resize !== 'both' && props.resize !== 'horizontal')\n )\n return\n const entry = entries[0]\n const { width } = entry.contentRect\n countStyle.value = {\n /** right: 100% - width + padding(22) - right(10) */\n right: `calc(100% - ${width + 22 - 10}px)`,\n }\n})\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea' || !textarea.value) return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows)\n\n // If the scrollbar is displayed, the height of the textarea needs more space than the calculated height.\n // If set textarea height in this case, the scrollbar will not hide.\n // So we need to hide scrollbar first, and reset it in next tick.\n // see https://github.com/element-plus/element-plus/issues/8825\n textareaCalcStyle.value = {\n overflowY: 'hidden',\n ...textareaStyle,\n }\n\n nextTick(() => {\n // NOTE: Force repaint to make sure the style set above is applied.\n textarea.value!.offsetHeight\n textareaCalcStyle.value = textareaStyle\n })\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value).minHeight,\n }\n }\n}\n\nconst createOnceInitResize = (resizeTextarea: () => void) => {\n let isInit = false\n return () => {\n if (isInit || !props.autosize) return\n const isElHidden = textarea.value?.offsetParent === null\n if (!isElHidden) {\n setTimeout(resizeTextarea)\n isInit = true\n }\n }\n}\n// fix: https://github.com/element-plus/element-plus/issues/12074\nconst onceInitSizeTextarea = createOnceInitResize(resizeTextarea)\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n const formatterValue = props.formatter\n ? props.formatter(nativeInputValue.value)\n : nativeInputValue.value\n if (!input || input.value === formatterValue || props.type === 'file') return\n input.value = formatterValue\n}\n\nconst formatValue = (value: string) => {\n const { trim, number } = props.modelModifiers\n if (trim) {\n value = value.trim()\n }\n if (number) {\n value = `${looseToNumber(value)}`\n }\n if (props.formatter && props.parser) {\n value = props.parser(value)\n }\n return value\n}\n\nconst handleInput = async (event: Event) => {\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n const { lazy } = props.modelModifiers\n let { value } = event.target as TargetElement\n let shouldForceNativeUpdate = false\n if (lazy) {\n emit(INPUT_EVENT, value)\n return\n }\n\n value = formatValue(value)\n\n if (props.countGraphemes && maxlength.value != null) {\n const limit = Number(maxlength.value)\n const graphemes = props.countGraphemes(value)\n const saveGraphemes = props.countGraphemes(saveValue.value)\n if (graphemes > limit && graphemes > saveGraphemes) {\n // If current value already exceeds limit, block further input and keep exceed state.\n if (saveGraphemes > limit) {\n value = saveValue.value\n shouldForceNativeUpdate = true\n } else {\n // Keep unchanged suffix like native maxlength behavior.\n // Instead of truncating from the end of the whole string,\n // only limit the inserted segment to available capacity.\n const prevValue = saveValue.value\n const nextValue = value\n let prefixLen = 0\n\n while (\n prefixLen < prevValue.length &&\n prefixLen < nextValue.length &&\n prevValue[prefixLen] === nextValue[prefixLen]\n ) {\n prefixLen++\n }\n\n let prevSuffixIndex = prevValue.length\n let nextSuffixIndex = nextValue.length\n while (\n prevSuffixIndex > prefixLen &&\n nextSuffixIndex > prefixLen &&\n prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]\n ) {\n prevSuffixIndex--\n nextSuffixIndex--\n }\n\n const before = nextValue.slice(0, prefixLen)\n const removed = prevValue.slice(prefixLen, prevSuffixIndex)\n const inserted = nextValue.slice(prefixLen, nextSuffixIndex)\n const after = nextValue.slice(nextSuffixIndex)\n\n const removedCount = props.countGraphemes(removed)\n const baseCount = saveGraphemes - removedCount\n const availableInserted = Math.max(0, limit - baseCount)\n\n let acceptedInserted = ''\n if (availableInserted > 0) {\n // Use Intl.Segmenter for proper grapheme cluster iteration if available.\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, {\n granularity: 'grapheme',\n })\n for (const { segment } of segmenter.segment(inserted)) {\n const candidate = acceptedInserted + segment\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n } else {\n // Fallback to code-point iteration for older environments.\n for (const char of Array.from(inserted)) {\n const candidate = acceptedInserted + char\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n }\n }\n\n value = before + acceptedInserted + after\n shouldForceNativeUpdate = true\n }\n }\n }\n\n // hack for https://github.com/ElemeFE/element/issues/8548\n // should remove the following line when we don't support IE\n if (String(value) === nativeInputValue.value) {\n // preserve native features while being compatible with #9501\n if (props.formatter || shouldForceNativeUpdate) {\n const target = event.target as TargetElement\n const blockedValue = target.value\n const selectionStart = target.selectionStart\n const selectionEnd = target.selectionEnd\n setNativeInputValue()\n // Keep caret position stable when input is blocked and value is reset.\n if (\n shouldForceNativeUpdate &&\n _ref.value &&\n selectionStart != null &&\n selectionEnd != null\n ) {\n const restoredValue = _ref.value.value\n const afterTxt = blockedValue.slice(Math.max(0, selectionEnd))\n let caretPos = Math.min(selectionStart, restoredValue.length)\n\n if (afterTxt && restoredValue.endsWith(afterTxt)) {\n caretPos = restoredValue.length - afterTxt.length\n }\n\n _ref.value.setSelectionRange(caretPos, caretPos)\n }\n }\n return\n }\n saveValue.value = value\n\n recordCursor()\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n\n if ((props.formatter && props.parser) || !hasModelModifiers.value) {\n setNativeInputValue()\n }\n setCursor()\n}\n\nconst handleChange = async (event: Event) => {\n let { value } = event.target as TargetElement\n\n value = formatValue(value)\n if (props.modelModifiers.lazy) {\n emit(UPDATE_MODEL_EVENT, value)\n }\n emit(CHANGE_EVENT, value, event)\n\n await nextTick()\n setNativeInputValue()\n}\n\nconst {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n} = useComposition({ emit, afterComposition: handleInput })\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n}\n\nconst focus = () => _ref.value?.focus()\n\nconst blur = () => _ref.value?.blur()\n\nconst handleMouseLeave = (evt: MouseEvent) => {\n hovering.value = false\n emit('mouseleave', evt)\n}\n\nconst handleMouseEnter = (evt: MouseEvent) => {\n hovering.value = true\n emit('mouseenter', evt)\n}\n\nconst handleKeydown = (evt: KeyboardEvent) => {\n emit('keydown', evt)\n}\n\nconst select = () => {\n _ref.value?.select()\n}\n\nconst clear = (evt?: MouseEvent) => {\n emit(UPDATE_MODEL_EVENT, '')\n emit(CHANGE_EVENT, '')\n emit('clear', evt)\n emit(INPUT_EVENT, '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => resizeTextarea())\n if (props.validateEvent) {\n elFormItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nwatch(\n () => nativeInputValue.value,\n (val) => {\n saveValue.value = val\n },\n { immediate: true }\n)\n\n// native input value is set explicitly\n// do not use v-model / :value in template\n// see: https://github.com/ElemeFE/element/issues/14521\nwatch(nativeInputValue, (newValue) => {\n if (!_ref.value) {\n return\n }\n const { trim, number } = props.modelModifiers\n const elValue = _ref.value.value\n const displayValue =\n (number || props.type === 'number') && !/^0\\d/.test(elValue)\n ? `${looseToNumber(elValue)}`\n : elValue\n\n if (displayValue === newValue) {\n return\n }\n\n if (document.activeElement === _ref.value && _ref.value.type !== 'range') {\n if (trim && displayValue.trim() === newValue) {\n return\n }\n }\n\n setNativeInputValue()\n})\n\n// when change between <input> and <textarea>,\n// update DOM dependent value and styles\n// https://github.com/ElemeFE/element/issues/14857\nwatch(\n () => props.type,\n async () => {\n await nextTick()\n setNativeInputValue()\n resizeTextarea()\n }\n)\n\nonMounted(() => {\n if (!props.formatter && props.parser) {\n debugWarn(\n COMPONENT_NAME,\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n nextTick(resizeTextarea)\n})\n\ndefineExpose({\n /** @description HTML input element */\n input,\n /** @description HTML textarea element */\n textarea,\n /** @description HTML element, input or textarea */\n ref: _ref,\n /** @description style of textarea. */\n textareaStyle,\n\n /** @description from props (used on unit test) */\n autosize: toRef(props, 'autosize'),\n\n /** @description is input composing */\n isComposing,\n\n /** @description HTML input element native method */\n focus,\n /** @description HTML input element native method */\n blur,\n /** @description HTML input element native method */\n select,\n /** @description clear input value */\n clear,\n /** @description resize textarea. */\n resizeTextarea,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkOA,MAAM,i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MAAA,qBAAA,CAAA,GAAA,KAAoB;KACpC,SAAO;KACP,SAAK,OAAA,OAAA,OAAA,kBAAE,MAAA,YAAA,IAAA,MAAA,YAAA,CAAA,GAAA,KAAW;KAClB,QAAI,OAAA,OAAA,OAAA,kBAAE,MAAA,WAAA,IAAA,MAAA,WAAA,CAAA,GAAA,KAAU;KAChB,UAAQ;KACR,WAAS;;IAGJ,UAAA,sBADR,YAOU,MAAA,OAAA,EAAA;;KALP,OAAK,eAAA,CAAG,MAAA,WAAU,CAAC,EAAC,OAAA,EAAU,MAAA,WAAU,CAAC,EAAC,QAAA,CAAA,CAAA;KAC1C,aAAS,cAAU,MAAA,KAAI,EAAA,CAAA,UAAA,CAAA;KACvB,SAAO;;4BAEqB,eAA7B,YAA6B,wBAAb,QAAA,UAAS,CAAA;;;IAGnB,mBAAA,sBADR,mBASO,QAAA;;KAPJ,OAAK,eAAE,WAAA,MAAU;KACjB,OAAK,eAAA,CAAc,MAAA,QAAO,CAAC,EAAC,QAAA,EAAqB,MAAA,QAAO,CAAC,GAAE,WAAY,QAAA,sBAAiB,UAAA;uBAKtF,WAAA,MAAU,GAAG,QAAG,gBAAG,UAAA,MAAS,EAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"input.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n containerKls,\n {\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n },\n ]\"\n :style=\"containerStyle\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <!-- input -->\n <template v-if=\"type !== 'textarea'\">\n <!-- prepend slot -->\n <div v-if=\"$slots.prepend\" :class=\"nsInput.be('group', 'prepend')\">\n <slot name=\"prepend\" />\n </div>\n\n <div ref=\"wrapperRef\" :class=\"wrapperKls\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :class=\"nsInput.e('prefix-inner')\">\n <slot name=\"prefix\" />\n <el-icon v-if=\"prefixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"prefixIcon\" />\n </el-icon>\n </span>\n </span>\n\n <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\n <slot name=\"suffix\" />\n <el-icon v-if=\"suffixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"suffixIcon\" />\n </el-icon>\n </template>\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <el-icon\n v-if=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n @click=\"handlePasswordVisible\"\n @mousedown.prevent=\"NOOP\"\n @mouseup.prevent=\"NOOP\"\n >\n <slot name=\"password-icon\" :visible=\"passwordVisible\">\n <component :is=\"passwordIcon\" />\n </slot>\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ maxlength }}\n </span>\n </span>\n <el-icon\n v-if=\"validateState && validateIcon && needStatusIcon\"\n :class=\"[\n nsInput.e('icon'),\n nsInput.e('validateIcon'),\n nsInput.is('loading', validateState === 'validating'),\n ]\"\n >\n <component :is=\"validateIcon\" />\n </el-icon>\n </span>\n </span>\n </div>\n\n <!-- append slot -->\n <div v-if=\"$slots.append\" :class=\"nsInput.be('group', 'append')\">\n <slot name=\"append\" />\n </div>\n </template>\n\n <!-- textarea -->\n <template v-else>\n <textarea\n :id=\"inputId\"\n ref=\"textarea\"\n :class=\"[\n nsTextarea.e('inner'),\n nsInput.is('focus', isFocused),\n nsTextarea.is('clearable', clearable),\n ]\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :rows=\"rows\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsTextarea.e('icon'), nsTextarea.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :style=\"countStyle\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n {{ textLength }} / {{ maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Hide, View } from '@element-plus/icons-vue'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n NOOP,\n ValidateComponentsMap,\n debugWarn,\n isClient,\n isObject,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useComposition,\n useCursor,\n useFocusController,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { calcTextareaHeight, looseToNumber } from './utils'\nimport { inputEmits, inputPropsDefaults } from './input'\n\nimport type { StyleValue } from 'vue'\nimport type { InputProps } from './input'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\n\nconst COMPONENT_NAME = 'ElInput'\ndefineOptions({\n name: COMPONENT_NAME,\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<InputProps>(), inputPropsDefaults)\nconst emit = defineEmits(inputEmits)\n\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst containerKls = computed(() => [\n props.type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize.value),\n nsInput.is('disabled', inputDisabled.value),\n nsInput.is('exceed', inputExceed.value),\n {\n [nsInput.b('group')]: slots.prepend || slots.append,\n [nsInput.m('prefix')]: slots.prefix || props.prefixIcon,\n [nsInput.m('suffix')]:\n slots.suffix || props.suffixIcon || props.clearable || props.showPassword,\n [nsInput.bm('suffix', 'password-clear')]:\n showClear.value && showPwdVisible.value,\n [nsInput.b('hidden')]: props.type === 'hidden',\n },\n rawAttrs.class,\n])\n\nconst wrapperKls = computed(() => [\n nsInput.e('wrapper'),\n nsInput.is('focus', isFocused.value),\n])\n\nconst attrs = useAttrs()\nconst maxlength = computed(() => props.maxlength?.toString())\n\nconst { form: elForm, formItem: elFormItem } = useFormItem()\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\nconst inputSize = useFormSize()\nconst inputDisabled = useFormDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst hovering = ref(false)\nconst passwordVisible = ref(false)\nconst countStyle = ref<StyleValue>()\nconst textareaCalcStyle = shallowRef(props.inputStyle)\nconst saveValue = ref('')\n\nconst _ref = computed(() => input.value || textarea.value)\n\n// wrapperRef for type=\"text\", handleFocus and handleBlur for type=\"textarea\"\n// @ts-ignore - used in template ref binding, TS cannot detect template usage\nconst { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(\n _ref,\n {\n disabled: inputDisabled,\n afterBlur() {\n if (props.validateEvent) {\n elFormItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n },\n }\n)\n\nconst needStatusIcon = computed(() => elForm?.statusIcon ?? false)\nconst validateState = computed(() => elFormItem?.validateState || '')\nconst validateIcon = computed(\n () => validateState.value && ValidateComponentsMap[validateState.value]\n)\nconst passwordIcon = computed(() => (passwordVisible.value ? View : Hide))\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst showClear = computed(\n () =>\n props.clearable &&\n !inputDisabled.value &&\n !props.readonly &&\n !!nativeInputValue.value &&\n (isFocused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () => props.showPassword && !inputDisabled.value && !!nativeInputValue.value\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!maxlength.value &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => {\n if (props.countGraphemes && props.showWordLimit) {\n return props.countGraphemes(nativeInputValue.value)\n }\n return nativeInputValue.value.length\n})\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n showClear.value ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\nconst hasModelModifiers = computed(\n () => !!Object.keys(props.modelModifiers).length\n)\n\nconst [recordCursor, setCursor] = useCursor(input)\n\nuseResizeObserver(textarea, (entries) => {\n onceInitSizeTextarea()\n if (\n !isWordLimitVisible.value ||\n (props.resize !== 'both' && props.resize !== 'horizontal')\n )\n return\n const entry = entries[0]\n const { width } = entry.contentRect\n countStyle.value = {\n /** right: 100% - width + padding(22) - right(10) */\n right: `calc(100% - ${width + 22 - 10}px)`,\n }\n})\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea' || !textarea.value) return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows)\n\n // If the scrollbar is displayed, the height of the textarea needs more space than the calculated height.\n // If set textarea height in this case, the scrollbar will not hide.\n // So we need to hide scrollbar first, and reset it in next tick.\n // see https://github.com/element-plus/element-plus/issues/8825\n textareaCalcStyle.value = {\n overflowY: 'hidden',\n ...textareaStyle,\n }\n\n nextTick(() => {\n // NOTE: Force repaint to make sure the style set above is applied.\n textarea.value!.offsetHeight\n textareaCalcStyle.value = textareaStyle\n })\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value).minHeight,\n }\n }\n}\n\nconst createOnceInitResize = (resizeTextarea: () => void) => {\n let isInit = false\n return () => {\n if (isInit || !props.autosize) return\n const isElHidden = textarea.value?.offsetParent === null\n if (!isElHidden) {\n setTimeout(resizeTextarea)\n isInit = true\n }\n }\n}\n// fix: https://github.com/element-plus/element-plus/issues/12074\nconst onceInitSizeTextarea = createOnceInitResize(resizeTextarea)\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n const formatterValue = props.formatter\n ? props.formatter(nativeInputValue.value)\n : nativeInputValue.value\n if (!input || input.value === formatterValue || props.type === 'file') return\n input.value = formatterValue\n}\n\nconst formatValue = (value: string) => {\n const { trim, number } = props.modelModifiers\n if (trim) {\n value = value.trim()\n }\n if (number) {\n value = `${looseToNumber(value)}`\n }\n if (props.formatter && props.parser) {\n value = props.parser(value)\n }\n return value\n}\n\nconst handleInput = async (event: Event) => {\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n const { lazy } = props.modelModifiers\n let { value } = event.target as TargetElement\n let shouldForceNativeUpdate = false\n if (lazy) {\n emit(INPUT_EVENT, value)\n return\n }\n\n value = formatValue(value)\n\n if (props.countGraphemes && maxlength.value != null) {\n const limit = Number(maxlength.value)\n const graphemes = props.countGraphemes(value)\n const saveGraphemes = props.countGraphemes(saveValue.value)\n if (graphemes > limit && graphemes > saveGraphemes) {\n // If current value already exceeds limit, block further input and keep exceed state.\n if (saveGraphemes > limit) {\n value = saveValue.value\n shouldForceNativeUpdate = true\n } else {\n // Keep unchanged suffix like native maxlength behavior.\n // Instead of truncating from the end of the whole string,\n // only limit the inserted segment to available capacity.\n const prevValue = saveValue.value\n const nextValue = value\n let prefixLen = 0\n\n while (\n prefixLen < prevValue.length &&\n prefixLen < nextValue.length &&\n prevValue[prefixLen] === nextValue[prefixLen]\n ) {\n prefixLen++\n }\n\n let prevSuffixIndex = prevValue.length\n let nextSuffixIndex = nextValue.length\n while (\n prevSuffixIndex > prefixLen &&\n nextSuffixIndex > prefixLen &&\n prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]\n ) {\n prevSuffixIndex--\n nextSuffixIndex--\n }\n\n const before = nextValue.slice(0, prefixLen)\n const removed = prevValue.slice(prefixLen, prevSuffixIndex)\n const inserted = nextValue.slice(prefixLen, nextSuffixIndex)\n const after = nextValue.slice(nextSuffixIndex)\n\n const removedCount = props.countGraphemes(removed)\n const baseCount = saveGraphemes - removedCount\n const availableInserted = Math.max(0, limit - baseCount)\n\n let acceptedInserted = ''\n if (availableInserted > 0) {\n // Use Intl.Segmenter for proper grapheme cluster iteration if available.\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, {\n granularity: 'grapheme',\n })\n for (const { segment } of segmenter.segment(inserted)) {\n const candidate = acceptedInserted + segment\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n } else {\n // Fallback to code-point iteration for older environments.\n for (const char of Array.from(inserted)) {\n const candidate = acceptedInserted + char\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n }\n }\n\n value = before + acceptedInserted + after\n shouldForceNativeUpdate = true\n }\n }\n }\n\n // hack for https://github.com/ElemeFE/element/issues/8548\n // should remove the following line when we don't support IE\n if (String(value) === nativeInputValue.value) {\n // preserve native features while being compatible with #9501\n if (props.formatter || shouldForceNativeUpdate) {\n const target = event.target as TargetElement\n const blockedValue = target.value\n const selectionStart = target.selectionStart\n const selectionEnd = target.selectionEnd\n setNativeInputValue()\n // Keep caret position stable when input is blocked and value is reset.\n if (\n shouldForceNativeUpdate &&\n _ref.value &&\n selectionStart != null &&\n selectionEnd != null\n ) {\n const restoredValue = _ref.value.value\n const afterTxt = blockedValue.slice(Math.max(0, selectionEnd))\n let caretPos = Math.min(selectionStart, restoredValue.length)\n\n if (afterTxt && restoredValue.endsWith(afterTxt)) {\n caretPos = restoredValue.length - afterTxt.length\n }\n\n _ref.value.setSelectionRange(caretPos, caretPos)\n }\n }\n return\n }\n saveValue.value = value\n\n recordCursor()\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n\n if ((props.formatter && props.parser) || !hasModelModifiers.value) {\n setNativeInputValue()\n }\n setCursor()\n}\n\nconst handleChange = async (event: Event) => {\n let { value } = event.target as TargetElement\n\n value = formatValue(value)\n if (props.modelModifiers.lazy) {\n emit(UPDATE_MODEL_EVENT, value)\n }\n emit(CHANGE_EVENT, value, event)\n\n await nextTick()\n setNativeInputValue()\n}\n\nconst {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n} = useComposition({ emit, afterComposition: handleInput })\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n}\n\nconst focus = () => _ref.value?.focus()\n\nconst blur = () => _ref.value?.blur()\n\nconst handleMouseLeave = (evt: MouseEvent) => {\n hovering.value = false\n emit('mouseleave', evt)\n}\n\nconst handleMouseEnter = (evt: MouseEvent) => {\n hovering.value = true\n emit('mouseenter', evt)\n}\n\nconst handleKeydown = (evt: KeyboardEvent) => {\n emit('keydown', evt)\n}\n\nconst select = () => {\n _ref.value?.select()\n}\n\nconst clear = (evt?: MouseEvent) => {\n emit(UPDATE_MODEL_EVENT, '')\n emit(CHANGE_EVENT, '')\n emit('clear', evt)\n emit(INPUT_EVENT, '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => resizeTextarea())\n if (props.validateEvent) {\n elFormItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nwatch(\n () => nativeInputValue.value,\n (val) => {\n saveValue.value = val\n },\n { immediate: true }\n)\n\n// native input value is set explicitly\n// do not use v-model / :value in template\n// see: https://github.com/ElemeFE/element/issues/14521\nwatch(nativeInputValue, (newValue) => {\n if (!_ref.value) {\n return\n }\n const { trim, number } = props.modelModifiers\n const elValue = _ref.value.value\n const displayValue =\n (number || props.type === 'number') && !/^0\\d/.test(elValue)\n ? `${looseToNumber(elValue)}`\n : elValue\n\n if (displayValue === newValue) {\n return\n }\n\n if (document.activeElement === _ref.value && _ref.value.type !== 'range') {\n if (trim && displayValue.trim() === newValue) {\n return\n }\n }\n\n setNativeInputValue()\n})\n\n// when change between <input> and <textarea>,\n// update DOM dependent value and styles\n// https://github.com/ElemeFE/element/issues/14857\nwatch(\n () => props.type,\n async () => {\n await nextTick()\n setNativeInputValue()\n resizeTextarea()\n }\n)\n\nonMounted(() => {\n if (!props.formatter && props.parser) {\n debugWarn(\n COMPONENT_NAME,\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n nextTick(resizeTextarea)\n})\n\ndefineExpose({\n /** @description HTML input element */\n input,\n /** @description HTML textarea element */\n textarea,\n /** @description HTML element, input or textarea */\n ref: _ref,\n /** @description style of textarea. */\n textareaStyle,\n\n /** @description from props (used on unit test) */\n autosize: toRef(props, 'autosize'),\n\n /** @description is input composing */\n isComposing,\n\n /** @description whether the password is visible */\n passwordVisible,\n\n /** @description HTML input element native method */\n focus,\n /** @description HTML input element native method */\n blur,\n /** @description HTML input element native method */\n select,\n /** @description clear input value */\n clear,\n /** @description resize textarea. */\n resizeTextarea,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkOA,MAAM,iBAAiB;;;;;;;;EAKvB,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,WAAW,UAAY;EAC7B,MAAM,QAAQ,UAAS;EAEvB,MAAM,eAAe,eAAe;GAClC,MAAM,SAAS,aAAa,WAAW,GAAG,GAAG,QAAQ,GAAG;GACxD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A,MAAA,WAAA,CAAA,GAAA,KAAU;KAChB,UAAQ;KACR,WAAS;;IAGJ,UAAA,sBADR,YAOU,MAAA,OAAA,EAAA;;KALP,OAAK,eAAA,CAAG,MAAA,WAAU,CAAC,EAAC,OAAA,EAAU,MAAA,WAAU,CAAC,EAAC,QAAA,CAAA,CAAA;KAC1C,aAAS,cAAU,MAAA,KAAI,EAAA,CAAA,UAAA,CAAA;KACvB,SAAO;;4BAEqB,eAA7B,YAA6B,wBAAb,QAAA,UAAS,CAAA;;;IAGnB,mBAAA,sBADR,mBASO,QAAA;;KAPJ,OAAK,eAAE,WAAA,MAAU;KACjB,OAAK,eAAA,CAAc,MAAA,QAAO,CAAC,EAAC,QAAA,EAAqB,MAAA,QAAO,CAAC,GAAE,WAAY,QAAA,sBAAiB,UAAA;uBAKtF,WAAA,MAAU,GAAG,QAAG,gBAAG,UAAA,MAAS,EAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input2.mjs","names":[],"sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n containerKls,\n {\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n },\n ]\"\n :style=\"containerStyle\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <!-- input -->\n <template v-if=\"type !== 'textarea'\">\n <!-- prepend slot -->\n <div v-if=\"$slots.prepend\" :class=\"nsInput.be('group', 'prepend')\">\n <slot name=\"prepend\" />\n </div>\n\n <div ref=\"wrapperRef\" :class=\"wrapperKls\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :class=\"nsInput.e('prefix-inner')\">\n <slot name=\"prefix\" />\n <el-icon v-if=\"prefixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"prefixIcon\" />\n </el-icon>\n </span>\n </span>\n\n <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\n <slot name=\"suffix\" />\n <el-icon v-if=\"suffixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"suffixIcon\" />\n </el-icon>\n </template>\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <el-icon\n v-if=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n @click=\"handlePasswordVisible\"\n @mousedown.prevent=\"NOOP\"\n @mouseup.prevent=\"NOOP\"\n >\n <slot name=\"password-icon\" :visible=\"passwordVisible\">\n <component :is=\"passwordIcon\" />\n </slot>\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ maxlength }}\n </span>\n </span>\n <el-icon\n v-if=\"validateState && validateIcon && needStatusIcon\"\n :class=\"[\n nsInput.e('icon'),\n nsInput.e('validateIcon'),\n nsInput.is('loading', validateState === 'validating'),\n ]\"\n >\n <component :is=\"validateIcon\" />\n </el-icon>\n </span>\n </span>\n </div>\n\n <!-- append slot -->\n <div v-if=\"$slots.append\" :class=\"nsInput.be('group', 'append')\">\n <slot name=\"append\" />\n </div>\n </template>\n\n <!-- textarea -->\n <template v-else>\n <textarea\n :id=\"inputId\"\n ref=\"textarea\"\n :class=\"[\n nsTextarea.e('inner'),\n nsInput.is('focus', isFocused),\n nsTextarea.is('clearable', clearable),\n ]\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :rows=\"rows\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsTextarea.e('icon'), nsTextarea.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :style=\"countStyle\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n {{ textLength }} / {{ maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Hide, View } from '@element-plus/icons-vue'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n NOOP,\n ValidateComponentsMap,\n debugWarn,\n isClient,\n isObject,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useComposition,\n useCursor,\n useFocusController,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { calcTextareaHeight, looseToNumber } from './utils'\nimport { inputEmits, inputPropsDefaults } from './input'\n\nimport type { StyleValue } from 'vue'\nimport type { InputProps } from './input'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\n\nconst COMPONENT_NAME = 'ElInput'\ndefineOptions({\n name: COMPONENT_NAME,\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<InputProps>(), inputPropsDefaults)\nconst emit = defineEmits(inputEmits)\n\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst containerKls = computed(() => [\n props.type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize.value),\n nsInput.is('disabled', inputDisabled.value),\n nsInput.is('exceed', inputExceed.value),\n {\n [nsInput.b('group')]: slots.prepend || slots.append,\n [nsInput.m('prefix')]: slots.prefix || props.prefixIcon,\n [nsInput.m('suffix')]:\n slots.suffix || props.suffixIcon || props.clearable || props.showPassword,\n [nsInput.bm('suffix', 'password-clear')]:\n showClear.value && showPwdVisible.value,\n [nsInput.b('hidden')]: props.type === 'hidden',\n },\n rawAttrs.class,\n])\n\nconst wrapperKls = computed(() => [\n nsInput.e('wrapper'),\n nsInput.is('focus', isFocused.value),\n])\n\nconst attrs = useAttrs()\nconst maxlength = computed(() => props.maxlength?.toString())\n\nconst { form: elForm, formItem: elFormItem } = useFormItem()\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\nconst inputSize = useFormSize()\nconst inputDisabled = useFormDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst hovering = ref(false)\nconst passwordVisible = ref(false)\nconst countStyle = ref<StyleValue>()\nconst textareaCalcStyle = shallowRef(props.inputStyle)\nconst saveValue = ref('')\n\nconst _ref = computed(() => input.value || textarea.value)\n\n// wrapperRef for type=\"text\", handleFocus and handleBlur for type=\"textarea\"\n// @ts-ignore - used in template ref binding, TS cannot detect template usage\nconst { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(\n _ref,\n {\n disabled: inputDisabled,\n afterBlur() {\n if (props.validateEvent) {\n elFormItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n },\n }\n)\n\nconst needStatusIcon = computed(() => elForm?.statusIcon ?? false)\nconst validateState = computed(() => elFormItem?.validateState || '')\nconst validateIcon = computed(\n () => validateState.value && ValidateComponentsMap[validateState.value]\n)\nconst passwordIcon = computed(() => (passwordVisible.value ? View : Hide))\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst showClear = computed(\n () =>\n props.clearable &&\n !inputDisabled.value &&\n !props.readonly &&\n !!nativeInputValue.value &&\n (isFocused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () => props.showPassword && !inputDisabled.value && !!nativeInputValue.value\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!maxlength.value &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => {\n if (props.countGraphemes && props.showWordLimit) {\n return props.countGraphemes(nativeInputValue.value)\n }\n return nativeInputValue.value.length\n})\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n showClear.value ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\nconst hasModelModifiers = computed(\n () => !!Object.keys(props.modelModifiers).length\n)\n\nconst [recordCursor, setCursor] = useCursor(input)\n\nuseResizeObserver(textarea, (entries) => {\n onceInitSizeTextarea()\n if (\n !isWordLimitVisible.value ||\n (props.resize !== 'both' && props.resize !== 'horizontal')\n )\n return\n const entry = entries[0]\n const { width } = entry.contentRect\n countStyle.value = {\n /** right: 100% - width + padding(22) - right(10) */\n right: `calc(100% - ${width + 22 - 10}px)`,\n }\n})\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea' || !textarea.value) return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows)\n\n // If the scrollbar is displayed, the height of the textarea needs more space than the calculated height.\n // If set textarea height in this case, the scrollbar will not hide.\n // So we need to hide scrollbar first, and reset it in next tick.\n // see https://github.com/element-plus/element-plus/issues/8825\n textareaCalcStyle.value = {\n overflowY: 'hidden',\n ...textareaStyle,\n }\n\n nextTick(() => {\n // NOTE: Force repaint to make sure the style set above is applied.\n textarea.value!.offsetHeight\n textareaCalcStyle.value = textareaStyle\n })\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value).minHeight,\n }\n }\n}\n\nconst createOnceInitResize = (resizeTextarea: () => void) => {\n let isInit = false\n return () => {\n if (isInit || !props.autosize) return\n const isElHidden = textarea.value?.offsetParent === null\n if (!isElHidden) {\n setTimeout(resizeTextarea)\n isInit = true\n }\n }\n}\n// fix: https://github.com/element-plus/element-plus/issues/12074\nconst onceInitSizeTextarea = createOnceInitResize(resizeTextarea)\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n const formatterValue = props.formatter\n ? props.formatter(nativeInputValue.value)\n : nativeInputValue.value\n if (!input || input.value === formatterValue || props.type === 'file') return\n input.value = formatterValue\n}\n\nconst formatValue = (value: string) => {\n const { trim, number } = props.modelModifiers\n if (trim) {\n value = value.trim()\n }\n if (number) {\n value = `${looseToNumber(value)}`\n }\n if (props.formatter && props.parser) {\n value = props.parser(value)\n }\n return value\n}\n\nconst handleInput = async (event: Event) => {\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n const { lazy } = props.modelModifiers\n let { value } = event.target as TargetElement\n let shouldForceNativeUpdate = false\n if (lazy) {\n emit(INPUT_EVENT, value)\n return\n }\n\n value = formatValue(value)\n\n if (props.countGraphemes && maxlength.value != null) {\n const limit = Number(maxlength.value)\n const graphemes = props.countGraphemes(value)\n const saveGraphemes = props.countGraphemes(saveValue.value)\n if (graphemes > limit && graphemes > saveGraphemes) {\n // If current value already exceeds limit, block further input and keep exceed state.\n if (saveGraphemes > limit) {\n value = saveValue.value\n shouldForceNativeUpdate = true\n } else {\n // Keep unchanged suffix like native maxlength behavior.\n // Instead of truncating from the end of the whole string,\n // only limit the inserted segment to available capacity.\n const prevValue = saveValue.value\n const nextValue = value\n let prefixLen = 0\n\n while (\n prefixLen < prevValue.length &&\n prefixLen < nextValue.length &&\n prevValue[prefixLen] === nextValue[prefixLen]\n ) {\n prefixLen++\n }\n\n let prevSuffixIndex = prevValue.length\n let nextSuffixIndex = nextValue.length\n while (\n prevSuffixIndex > prefixLen &&\n nextSuffixIndex > prefixLen &&\n prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]\n ) {\n prevSuffixIndex--\n nextSuffixIndex--\n }\n\n const before = nextValue.slice(0, prefixLen)\n const removed = prevValue.slice(prefixLen, prevSuffixIndex)\n const inserted = nextValue.slice(prefixLen, nextSuffixIndex)\n const after = nextValue.slice(nextSuffixIndex)\n\n const removedCount = props.countGraphemes(removed)\n const baseCount = saveGraphemes - removedCount\n const availableInserted = Math.max(0, limit - baseCount)\n\n let acceptedInserted = ''\n if (availableInserted > 0) {\n // Use Intl.Segmenter for proper grapheme cluster iteration if available.\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, {\n granularity: 'grapheme',\n })\n for (const { segment } of segmenter.segment(inserted)) {\n const candidate = acceptedInserted + segment\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n } else {\n // Fallback to code-point iteration for older environments.\n for (const char of Array.from(inserted)) {\n const candidate = acceptedInserted + char\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n }\n }\n\n value = before + acceptedInserted + after\n shouldForceNativeUpdate = true\n }\n }\n }\n\n // hack for https://github.com/ElemeFE/element/issues/8548\n // should remove the following line when we don't support IE\n if (String(value) === nativeInputValue.value) {\n // preserve native features while being compatible with #9501\n if (props.formatter || shouldForceNativeUpdate) {\n const target = event.target as TargetElement\n const blockedValue = target.value\n const selectionStart = target.selectionStart\n const selectionEnd = target.selectionEnd\n setNativeInputValue()\n // Keep caret position stable when input is blocked and value is reset.\n if (\n shouldForceNativeUpdate &&\n _ref.value &&\n selectionStart != null &&\n selectionEnd != null\n ) {\n const restoredValue = _ref.value.value\n const afterTxt = blockedValue.slice(Math.max(0, selectionEnd))\n let caretPos = Math.min(selectionStart, restoredValue.length)\n\n if (afterTxt && restoredValue.endsWith(afterTxt)) {\n caretPos = restoredValue.length - afterTxt.length\n }\n\n _ref.value.setSelectionRange(caretPos, caretPos)\n }\n }\n return\n }\n saveValue.value = value\n\n recordCursor()\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n\n if ((props.formatter && props.parser) || !hasModelModifiers.value) {\n setNativeInputValue()\n }\n setCursor()\n}\n\nconst handleChange = async (event: Event) => {\n let { value } = event.target as TargetElement\n\n value = formatValue(value)\n if (props.modelModifiers.lazy) {\n emit(UPDATE_MODEL_EVENT, value)\n }\n emit(CHANGE_EVENT, value, event)\n\n await nextTick()\n setNativeInputValue()\n}\n\nconst {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n} = useComposition({ emit, afterComposition: handleInput })\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n}\n\nconst focus = () => _ref.value?.focus()\n\nconst blur = () => _ref.value?.blur()\n\nconst handleMouseLeave = (evt: MouseEvent) => {\n hovering.value = false\n emit('mouseleave', evt)\n}\n\nconst handleMouseEnter = (evt: MouseEvent) => {\n hovering.value = true\n emit('mouseenter', evt)\n}\n\nconst handleKeydown = (evt: KeyboardEvent) => {\n emit('keydown', evt)\n}\n\nconst select = () => {\n _ref.value?.select()\n}\n\nconst clear = (evt?: MouseEvent) => {\n emit(UPDATE_MODEL_EVENT, '')\n emit(CHANGE_EVENT, '')\n emit('clear', evt)\n emit(INPUT_EVENT, '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => resizeTextarea())\n if (props.validateEvent) {\n elFormItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nwatch(\n () => nativeInputValue.value,\n (val) => {\n saveValue.value = val\n },\n { immediate: true }\n)\n\n// native input value is set explicitly\n// do not use v-model / :value in template\n// see: https://github.com/ElemeFE/element/issues/14521\nwatch(nativeInputValue, (newValue) => {\n if (!_ref.value) {\n return\n }\n const { trim, number } = props.modelModifiers\n const elValue = _ref.value.value\n const displayValue =\n (number || props.type === 'number') && !/^0\\d/.test(elValue)\n ? `${looseToNumber(elValue)}`\n : elValue\n\n if (displayValue === newValue) {\n return\n }\n\n if (document.activeElement === _ref.value && _ref.value.type !== 'range') {\n if (trim && displayValue.trim() === newValue) {\n return\n }\n }\n\n setNativeInputValue()\n})\n\n// when change between <input> and <textarea>,\n// update DOM dependent value and styles\n// https://github.com/ElemeFE/element/issues/14857\nwatch(\n () => props.type,\n async () => {\n await nextTick()\n setNativeInputValue()\n resizeTextarea()\n }\n)\n\nonMounted(() => {\n if (!props.formatter && props.parser) {\n debugWarn(\n COMPONENT_NAME,\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n nextTick(resizeTextarea)\n})\n\ndefineExpose({\n /** @description HTML input element */\n input,\n /** @description HTML textarea element */\n textarea,\n /** @description HTML element, input or textarea */\n ref: _ref,\n /** @description style of textarea. */\n textareaStyle,\n\n /** @description from props (used on unit test) */\n autosize: toRef(props, 'autosize'),\n\n /** @description is input composing */\n isComposing,\n\n /** @description HTML input element native method */\n focus,\n /** @description HTML input element native method */\n blur,\n /** @description HTML input element native method */\n select,\n /** @description clear input value */\n clear,\n /** @description resize textarea. */\n resizeTextarea,\n})\n</script>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"input2.mjs","names":[],"sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n containerKls,\n {\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n },\n ]\"\n :style=\"containerStyle\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n >\n <!-- input -->\n <template v-if=\"type !== 'textarea'\">\n <!-- prepend slot -->\n <div v-if=\"$slots.prepend\" :class=\"nsInput.be('group', 'prepend')\">\n <slot name=\"prepend\" />\n </div>\n\n <div ref=\"wrapperRef\" :class=\"wrapperKls\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :class=\"nsInput.e('prefix-inner')\">\n <slot name=\"prefix\" />\n <el-icon v-if=\"prefixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"prefixIcon\" />\n </el-icon>\n </span>\n </span>\n\n <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\n <slot name=\"suffix\" />\n <el-icon v-if=\"suffixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"suffixIcon\" />\n </el-icon>\n </template>\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <el-icon\n v-if=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n @click=\"handlePasswordVisible\"\n @mousedown.prevent=\"NOOP\"\n @mouseup.prevent=\"NOOP\"\n >\n <slot name=\"password-icon\" :visible=\"passwordVisible\">\n <component :is=\"passwordIcon\" />\n </slot>\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ maxlength }}\n </span>\n </span>\n <el-icon\n v-if=\"validateState && validateIcon && needStatusIcon\"\n :class=\"[\n nsInput.e('icon'),\n nsInput.e('validateIcon'),\n nsInput.is('loading', validateState === 'validating'),\n ]\"\n >\n <component :is=\"validateIcon\" />\n </el-icon>\n </span>\n </span>\n </div>\n\n <!-- append slot -->\n <div v-if=\"$slots.append\" :class=\"nsInput.be('group', 'append')\">\n <slot name=\"append\" />\n </div>\n </template>\n\n <!-- textarea -->\n <template v-else>\n <textarea\n :id=\"inputId\"\n ref=\"textarea\"\n :class=\"[\n nsTextarea.e('inner'),\n nsInput.is('focus', isFocused),\n nsTextarea.is('clearable', clearable),\n ]\"\n v-bind=\"attrs\"\n :name=\"name\"\n :minlength=\"countGraphemes ? undefined : minlength\"\n :maxlength=\"countGraphemes ? undefined : maxlength\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"ariaLabel\"\n :placeholder=\"placeholder\"\n :form=\"form\"\n :autofocus=\"autofocus\"\n :rows=\"rows\"\n :role=\"containerRole\"\n :inputmode=\"inputmode\"\n @compositionstart=\"handleCompositionStart\"\n @compositionupdate=\"handleCompositionUpdate\"\n @compositionend=\"handleCompositionEnd\"\n @input=\"handleInput\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @change=\"handleChange\"\n @keydown=\"handleKeydown\"\n />\n <el-icon\n v-if=\"showClear\"\n :class=\"[nsTextarea.e('icon'), nsTextarea.e('clear')]\"\n @mousedown.prevent=\"NOOP\"\n @click=\"clear\"\n >\n <component :is=\"clearIcon\" />\n </el-icon>\n <span\n v-if=\"isWordLimitVisible\"\n :style=\"countStyle\"\n :class=\"[\n nsInput.e('count'),\n nsInput.is('outside', wordLimitPosition === 'outside'),\n ]\"\n >\n {{ textLength }} / {{ maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n watch,\n} from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Hide, View } from '@element-plus/icons-vue'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport {\n NOOP,\n ValidateComponentsMap,\n debugWarn,\n isClient,\n isObject,\n} from '@element-plus/utils'\nimport {\n useAttrs,\n useComposition,\n useCursor,\n useFocusController,\n useNamespace,\n} from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { calcTextareaHeight, looseToNumber } from './utils'\nimport { inputEmits, inputPropsDefaults } from './input'\n\nimport type { StyleValue } from 'vue'\nimport type { InputProps } from './input'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\n\nconst COMPONENT_NAME = 'ElInput'\ndefineOptions({\n name: COMPONENT_NAME,\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<InputProps>(), inputPropsDefaults)\nconst emit = defineEmits(inputEmits)\n\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst containerKls = computed(() => [\n props.type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize.value),\n nsInput.is('disabled', inputDisabled.value),\n nsInput.is('exceed', inputExceed.value),\n {\n [nsInput.b('group')]: slots.prepend || slots.append,\n [nsInput.m('prefix')]: slots.prefix || props.prefixIcon,\n [nsInput.m('suffix')]:\n slots.suffix || props.suffixIcon || props.clearable || props.showPassword,\n [nsInput.bm('suffix', 'password-clear')]:\n showClear.value && showPwdVisible.value,\n [nsInput.b('hidden')]: props.type === 'hidden',\n },\n rawAttrs.class,\n])\n\nconst wrapperKls = computed(() => [\n nsInput.e('wrapper'),\n nsInput.is('focus', isFocused.value),\n])\n\nconst attrs = useAttrs()\nconst maxlength = computed(() => props.maxlength?.toString())\n\nconst { form: elForm, formItem: elFormItem } = useFormItem()\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\nconst inputSize = useFormSize()\nconst inputDisabled = useFormDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst hovering = ref(false)\nconst passwordVisible = ref(false)\nconst countStyle = ref<StyleValue>()\nconst textareaCalcStyle = shallowRef(props.inputStyle)\nconst saveValue = ref('')\n\nconst _ref = computed(() => input.value || textarea.value)\n\n// wrapperRef for type=\"text\", handleFocus and handleBlur for type=\"textarea\"\n// @ts-ignore - used in template ref binding, TS cannot detect template usage\nconst { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(\n _ref,\n {\n disabled: inputDisabled,\n afterBlur() {\n if (props.validateEvent) {\n elFormItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n },\n }\n)\n\nconst needStatusIcon = computed(() => elForm?.statusIcon ?? false)\nconst validateState = computed(() => elFormItem?.validateState || '')\nconst validateIcon = computed(\n () => validateState.value && ValidateComponentsMap[validateState.value]\n)\nconst passwordIcon = computed(() => (passwordVisible.value ? View : Hide))\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst showClear = computed(\n () =>\n props.clearable &&\n !inputDisabled.value &&\n !props.readonly &&\n !!nativeInputValue.value &&\n (isFocused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () => props.showPassword && !inputDisabled.value && !!nativeInputValue.value\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!maxlength.value &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => {\n if (props.countGraphemes && props.showWordLimit) {\n return props.countGraphemes(nativeInputValue.value)\n }\n return nativeInputValue.value.length\n})\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value && textLength.value > Number(maxlength.value)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n showClear.value ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\nconst hasModelModifiers = computed(\n () => !!Object.keys(props.modelModifiers).length\n)\n\nconst [recordCursor, setCursor] = useCursor(input)\n\nuseResizeObserver(textarea, (entries) => {\n onceInitSizeTextarea()\n if (\n !isWordLimitVisible.value ||\n (props.resize !== 'both' && props.resize !== 'horizontal')\n )\n return\n const entry = entries[0]\n const { width } = entry.contentRect\n countStyle.value = {\n /** right: 100% - width + padding(22) - right(10) */\n right: `calc(100% - ${width + 22 - 10}px)`,\n }\n})\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea' || !textarea.value) return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows)\n\n // If the scrollbar is displayed, the height of the textarea needs more space than the calculated height.\n // If set textarea height in this case, the scrollbar will not hide.\n // So we need to hide scrollbar first, and reset it in next tick.\n // see https://github.com/element-plus/element-plus/issues/8825\n textareaCalcStyle.value = {\n overflowY: 'hidden',\n ...textareaStyle,\n }\n\n nextTick(() => {\n // NOTE: Force repaint to make sure the style set above is applied.\n textarea.value!.offsetHeight\n textareaCalcStyle.value = textareaStyle\n })\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value).minHeight,\n }\n }\n}\n\nconst createOnceInitResize = (resizeTextarea: () => void) => {\n let isInit = false\n return () => {\n if (isInit || !props.autosize) return\n const isElHidden = textarea.value?.offsetParent === null\n if (!isElHidden) {\n setTimeout(resizeTextarea)\n isInit = true\n }\n }\n}\n// fix: https://github.com/element-plus/element-plus/issues/12074\nconst onceInitSizeTextarea = createOnceInitResize(resizeTextarea)\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n const formatterValue = props.formatter\n ? props.formatter(nativeInputValue.value)\n : nativeInputValue.value\n if (!input || input.value === formatterValue || props.type === 'file') return\n input.value = formatterValue\n}\n\nconst formatValue = (value: string) => {\n const { trim, number } = props.modelModifiers\n if (trim) {\n value = value.trim()\n }\n if (number) {\n value = `${looseToNumber(value)}`\n }\n if (props.formatter && props.parser) {\n value = props.parser(value)\n }\n return value\n}\n\nconst handleInput = async (event: Event) => {\n // should not emit input during composition\n // see: https://github.com/ElemeFE/element/issues/10516\n if (isComposing.value) return\n\n const { lazy } = props.modelModifiers\n let { value } = event.target as TargetElement\n let shouldForceNativeUpdate = false\n if (lazy) {\n emit(INPUT_EVENT, value)\n return\n }\n\n value = formatValue(value)\n\n if (props.countGraphemes && maxlength.value != null) {\n const limit = Number(maxlength.value)\n const graphemes = props.countGraphemes(value)\n const saveGraphemes = props.countGraphemes(saveValue.value)\n if (graphemes > limit && graphemes > saveGraphemes) {\n // If current value already exceeds limit, block further input and keep exceed state.\n if (saveGraphemes > limit) {\n value = saveValue.value\n shouldForceNativeUpdate = true\n } else {\n // Keep unchanged suffix like native maxlength behavior.\n // Instead of truncating from the end of the whole string,\n // only limit the inserted segment to available capacity.\n const prevValue = saveValue.value\n const nextValue = value\n let prefixLen = 0\n\n while (\n prefixLen < prevValue.length &&\n prefixLen < nextValue.length &&\n prevValue[prefixLen] === nextValue[prefixLen]\n ) {\n prefixLen++\n }\n\n let prevSuffixIndex = prevValue.length\n let nextSuffixIndex = nextValue.length\n while (\n prevSuffixIndex > prefixLen &&\n nextSuffixIndex > prefixLen &&\n prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]\n ) {\n prevSuffixIndex--\n nextSuffixIndex--\n }\n\n const before = nextValue.slice(0, prefixLen)\n const removed = prevValue.slice(prefixLen, prevSuffixIndex)\n const inserted = nextValue.slice(prefixLen, nextSuffixIndex)\n const after = nextValue.slice(nextSuffixIndex)\n\n const removedCount = props.countGraphemes(removed)\n const baseCount = saveGraphemes - removedCount\n const availableInserted = Math.max(0, limit - baseCount)\n\n let acceptedInserted = ''\n if (availableInserted > 0) {\n // Use Intl.Segmenter for proper grapheme cluster iteration if available.\n if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {\n const segmenter = new Intl.Segmenter(undefined, {\n granularity: 'grapheme',\n })\n for (const { segment } of segmenter.segment(inserted)) {\n const candidate = acceptedInserted + segment\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n } else {\n // Fallback to code-point iteration for older environments.\n for (const char of Array.from(inserted)) {\n const candidate = acceptedInserted + char\n const newCount = props.countGraphemes(candidate)\n if (newCount > availableInserted) break\n acceptedInserted = candidate\n }\n }\n }\n\n value = before + acceptedInserted + after\n shouldForceNativeUpdate = true\n }\n }\n }\n\n // hack for https://github.com/ElemeFE/element/issues/8548\n // should remove the following line when we don't support IE\n if (String(value) === nativeInputValue.value) {\n // preserve native features while being compatible with #9501\n if (props.formatter || shouldForceNativeUpdate) {\n const target = event.target as TargetElement\n const blockedValue = target.value\n const selectionStart = target.selectionStart\n const selectionEnd = target.selectionEnd\n setNativeInputValue()\n // Keep caret position stable when input is blocked and value is reset.\n if (\n shouldForceNativeUpdate &&\n _ref.value &&\n selectionStart != null &&\n selectionEnd != null\n ) {\n const restoredValue = _ref.value.value\n const afterTxt = blockedValue.slice(Math.max(0, selectionEnd))\n let caretPos = Math.min(selectionStart, restoredValue.length)\n\n if (afterTxt && restoredValue.endsWith(afterTxt)) {\n caretPos = restoredValue.length - afterTxt.length\n }\n\n _ref.value.setSelectionRange(caretPos, caretPos)\n }\n }\n return\n }\n saveValue.value = value\n\n recordCursor()\n emit(UPDATE_MODEL_EVENT, value)\n emit(INPUT_EVENT, value)\n\n // ensure native input value is controlled\n // see: https://github.com/ElemeFE/element/issues/12850\n await nextTick()\n\n if ((props.formatter && props.parser) || !hasModelModifiers.value) {\n setNativeInputValue()\n }\n setCursor()\n}\n\nconst handleChange = async (event: Event) => {\n let { value } = event.target as TargetElement\n\n value = formatValue(value)\n if (props.modelModifiers.lazy) {\n emit(UPDATE_MODEL_EVENT, value)\n }\n emit(CHANGE_EVENT, value, event)\n\n await nextTick()\n setNativeInputValue()\n}\n\nconst {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n} = useComposition({ emit, afterComposition: handleInput })\n\nconst handlePasswordVisible = () => {\n passwordVisible.value = !passwordVisible.value\n}\n\nconst focus = () => _ref.value?.focus()\n\nconst blur = () => _ref.value?.blur()\n\nconst handleMouseLeave = (evt: MouseEvent) => {\n hovering.value = false\n emit('mouseleave', evt)\n}\n\nconst handleMouseEnter = (evt: MouseEvent) => {\n hovering.value = true\n emit('mouseenter', evt)\n}\n\nconst handleKeydown = (evt: KeyboardEvent) => {\n emit('keydown', evt)\n}\n\nconst select = () => {\n _ref.value?.select()\n}\n\nconst clear = (evt?: MouseEvent) => {\n emit(UPDATE_MODEL_EVENT, '')\n emit(CHANGE_EVENT, '')\n emit('clear', evt)\n emit(INPUT_EVENT, '')\n}\n\nwatch(\n () => props.modelValue,\n () => {\n nextTick(() => resizeTextarea())\n if (props.validateEvent) {\n elFormItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nwatch(\n () => nativeInputValue.value,\n (val) => {\n saveValue.value = val\n },\n { immediate: true }\n)\n\n// native input value is set explicitly\n// do not use v-model / :value in template\n// see: https://github.com/ElemeFE/element/issues/14521\nwatch(nativeInputValue, (newValue) => {\n if (!_ref.value) {\n return\n }\n const { trim, number } = props.modelModifiers\n const elValue = _ref.value.value\n const displayValue =\n (number || props.type === 'number') && !/^0\\d/.test(elValue)\n ? `${looseToNumber(elValue)}`\n : elValue\n\n if (displayValue === newValue) {\n return\n }\n\n if (document.activeElement === _ref.value && _ref.value.type !== 'range') {\n if (trim && displayValue.trim() === newValue) {\n return\n }\n }\n\n setNativeInputValue()\n})\n\n// when change between <input> and <textarea>,\n// update DOM dependent value and styles\n// https://github.com/ElemeFE/element/issues/14857\nwatch(\n () => props.type,\n async () => {\n await nextTick()\n setNativeInputValue()\n resizeTextarea()\n }\n)\n\nonMounted(() => {\n if (!props.formatter && props.parser) {\n debugWarn(\n COMPONENT_NAME,\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n nextTick(resizeTextarea)\n})\n\ndefineExpose({\n /** @description HTML input element */\n input,\n /** @description HTML textarea element */\n textarea,\n /** @description HTML element, input or textarea */\n ref: _ref,\n /** @description style of textarea. */\n textareaStyle,\n\n /** @description from props (used on unit test) */\n autosize: toRef(props, 'autosize'),\n\n /** @description is input composing */\n isComposing,\n\n /** @description whether the password is visible */\n passwordVisible,\n\n /** @description HTML input element native method */\n focus,\n /** @description HTML input element native method */\n blur,\n /** @description HTML input element native method */\n select,\n /** @description clear input value */\n clear,\n /** @description resize textarea. */\n resizeTextarea,\n})\n</script>\n"],"mappings":""}
|
|
@@ -95,7 +95,7 @@ interface InputNumberProps {
|
|
|
95
95
|
* @deprecated Removed after 3.0.0, Use `InputNumberProps` instead.
|
|
96
96
|
*/
|
|
97
97
|
declare const inputNumberProps: {
|
|
98
|
-
readonly inputmode: EpPropFinalized<(new (...args: any[]) => "
|
|
98
|
+
readonly inputmode: EpPropFinalized<(new (...args: any[]) => "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal") | (() => "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined) | (((new (...args: any[]) => "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal") | (() => "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined)) | null)[], unknown, unknown, undefined, boolean>;
|
|
99
99
|
readonly align: EpPropFinalized<(new (...args: any[]) => "right" | "left" | "center") | (() => "right" | "left" | "center") | (((new (...args: any[]) => "right" | "left" | "center") | (() => "right" | "left" | "center")) | null)[], unknown, unknown, "center", boolean>;
|
|
100
100
|
readonly disabledScientific: BooleanConstructor;
|
|
101
101
|
readonly ariaLabel: StringConstructor;
|