@element-plus/nightly 0.0.20260329 → 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 +153 -13
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +6 -6
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +153 -13
- 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.d.ts +1 -1
- package/es/components/affix/src/affix.vue.d.ts +2 -2
- package/es/components/alert/src/alert.d.ts +2 -2
- package/es/components/alert/src/alert.vue.d.ts +2 -2
- package/es/components/anchor/src/anchor-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 +3 -3
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +10 -10
- package/es/components/avatar/src/avatar.d.ts +1 -1
- package/es/components/avatar/src/avatar.vue.d.ts +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +2 -2
- package/es/components/badge/src/badge.d.ts +1 -1
- package/es/components/badge/src/badge.vue.d.ts +1 -1
- package/es/components/button/src/button-group.vue.d.ts +1 -1
- package/es/components/button/src/button.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +4 -4
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +1 -1
- package/es/components/cascader/src/cascader.d.ts +4 -4
- package/es/components/cascader/src/cascader.vue.d.ts +11 -11
- 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_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 +4 -4
- 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 +4 -4
- package/es/components/col/src/col.vue.d.ts +1 -1
- package/es/components/collapse/src/collapse.d.ts +1 -1
- package/es/components/color-picker/src/color-picker.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/config-provider/src/config-provider.d.ts +2 -2
- package/es/components/date-picker/src/date-picker.d.ts +8 -8
- package/es/components/date-picker/src/props.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +2 -2
- package/es/components/descriptions/src/description-item.d.ts +19 -19
- package/es/components/descriptions/src/description.mjs.map +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +3 -3
- 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/divider/src/divider.d.ts +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +3 -3
- 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.d.ts +1 -1
- 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.d.ts +2 -2
- package/es/components/form/src/form.vue.d.ts +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.vue.d.ts +2 -2
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
- package/es/components/input/src/input.d.ts +2 -2
- package/es/components/input/src/input.vue.d.ts +2 -2
- package/es/components/input-number/src/input-number.d.ts +3 -3
- package/es/components/input-number/src/input-number.vue.d.ts +6 -6
- package/es/components/input-tag/src/input-tag.d.ts +3 -3
- package/es/components/input-tag/src/input-tag.vue.d.ts +6 -6
- 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/mention.d.ts +3 -3
- package/es/components/menu/src/sub-menu.d.ts +1 -1
- package/es/components/message/src/message.d.ts +2 -2
- 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/page-header/src/page-header.vue.d.ts +1 -1
- 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 +3 -3
- package/es/components/popover/src/popover.d.ts +1 -1
- package/es/components/popover/src/popover.vue.d.ts +9 -9
- package/es/components/popper/src/composables/use-content.d.ts +10 -10
- package/es/components/popper/src/content.vue.d.ts +5 -5
- 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 +3 -3
- package/es/components/radio/src/radio-button.d.ts +3 -3
- package/es/components/radio/src/radio-button.vue.d.ts +2 -2
- 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 +2 -2
- package/es/components/rate/src/rate.vue.d.ts +1 -1
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/row/src/row.d.ts +2 -2
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/es/components/segmented/index.d.ts +1 -1
- package/es/components/segmented/src/segmented.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 +5 -5
- package/es/components/select/src/select.vue.d.ts +74 -80
- package/es/components/select-v2/src/defaults.d.ts +3 -3
- package/es/components/select-v2/src/select.vue.d.ts +56 -62
- package/es/components/slider/src/button.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/steps/src/item.vue.d.ts +1 -1
- package/es/components/switch/src/switch.vue.d.ts +2 -2
- package/es/components/table/src/table-body/index.d.ts +1 -1
- package/es/components/table/src/table-column/index.d.ts +19 -19
- package/es/components/table/src/table-footer/index.d.ts +1 -1
- package/es/components/table/src/table-header/index.d.ts +13 -13
- package/es/components/table/src/table.vue.d.ts +41 -41
- 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/tabs.d.ts +5 -5
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/text/src/text.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 +8 -8
- 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 +5 -5
- package/es/components/timeline/src/timeline-item.d.ts +2 -2
- package/es/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +9 -9
- package/es/components/tooltip/src/tooltip.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +10 -10
- 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 +18 -24
- package/es/components/tree-select/src/tree-select.vue.d.ts +32 -32
- 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 +1 -1
- package/es/hooks/use-floating/index.d.ts +12 -12
- package/es/hooks/use-popper/index.d.ts +10 -10
- 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.d.ts +1 -1
- package/lib/components/affix/src/affix.vue.d.ts +2 -2
- package/lib/components/alert/src/alert.d.ts +2 -2
- package/lib/components/alert/src/alert.vue.d.ts +2 -2
- package/lib/components/anchor/src/anchor-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 +3 -3
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +10 -10
- package/lib/components/avatar/src/avatar.d.ts +1 -1
- package/lib/components/avatar/src/avatar.vue.d.ts +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +2 -2
- package/lib/components/badge/src/badge.d.ts +1 -1
- package/lib/components/badge/src/badge.vue.d.ts +1 -1
- package/lib/components/button/src/button-group.vue.d.ts +1 -1
- package/lib/components/button/src/button.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +4 -4
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +1 -1
- package/lib/components/cascader/src/cascader.d.ts +4 -4
- package/lib/components/cascader/src/cascader.vue.d.ts +11 -11
- 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_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 +4 -4
- 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 +4 -4
- package/lib/components/col/src/col.vue.d.ts +1 -1
- package/lib/components/collapse/src/collapse.d.ts +1 -1
- package/lib/components/color-picker/src/color-picker.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/config-provider/src/config-provider.d.ts +2 -2
- package/lib/components/date-picker/src/date-picker.d.ts +8 -8
- package/lib/components/date-picker/src/props.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +2 -2
- package/lib/components/descriptions/src/description-item.d.ts +19 -19
- package/lib/components/descriptions/src/description.js.map +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +3 -3
- 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/divider/src/divider.d.ts +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +3 -3
- 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.d.ts +1 -1
- 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.d.ts +2 -2
- package/lib/components/form/src/form.vue.d.ts +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.vue.d.ts +2 -2
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
- package/lib/components/input/src/input.d.ts +2 -2
- package/lib/components/input/src/input.vue.d.ts +2 -2
- package/lib/components/input-number/src/input-number.d.ts +3 -3
- package/lib/components/input-number/src/input-number.vue.d.ts +6 -6
- package/lib/components/input-tag/src/input-tag.d.ts +3 -3
- package/lib/components/input-tag/src/input-tag.vue.d.ts +6 -6
- 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/mention.d.ts +3 -3
- package/lib/components/menu/src/sub-menu.d.ts +1 -1
- package/lib/components/message/src/message.d.ts +2 -2
- 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/page-header/src/page-header.vue.d.ts +1 -1
- 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 +3 -3
- package/lib/components/popover/src/popover.d.ts +1 -1
- package/lib/components/popover/src/popover.vue.d.ts +9 -9
- package/lib/components/popper/src/composables/use-content.d.ts +10 -10
- package/lib/components/popper/src/content.vue.d.ts +5 -5
- 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 +3 -3
- package/lib/components/radio/src/radio-button.d.ts +3 -3
- package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
- 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 +2 -2
- package/lib/components/rate/src/rate.vue.d.ts +1 -1
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/row/src/row.d.ts +2 -2
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +1 -1
- package/lib/components/segmented/src/segmented.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 +5 -5
- package/lib/components/select/src/select.vue.d.ts +74 -80
- package/lib/components/select-v2/src/defaults.d.ts +3 -3
- package/lib/components/select-v2/src/select.vue.d.ts +56 -62
- package/lib/components/slider/src/button.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/steps/src/item.vue.d.ts +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +2 -2
- package/lib/components/table/src/table-body/index.d.ts +1 -1
- package/lib/components/table/src/table-column/index.d.ts +19 -19
- package/lib/components/table/src/table-footer/index.d.ts +1 -1
- package/lib/components/table/src/table-header/index.d.ts +13 -13
- package/lib/components/table/src/table.vue.d.ts +41 -41
- 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/tabs.d.ts +5 -5
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/text/src/text.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 +8 -8
- 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 +5 -5
- package/lib/components/timeline/src/timeline-item.d.ts +2 -2
- package/lib/components/timeline/src/timeline-item.vue.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +9 -9
- package/lib/components/tooltip/src/tooltip.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +10 -10
- 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 +18 -24
- package/lib/components/tree-select/src/tree-select.vue.d.ts +32 -32
- 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 +1 -1
- package/lib/hooks/use-floating/index.d.ts +12 -12
- package/lib/hooks/use-popper/index.d.ts +10 -10
- 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
|
@@ -51,12 +51,12 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
51
51
|
readonly __epPropKey: true;
|
|
52
52
|
};
|
|
53
53
|
readonly type: {
|
|
54
|
-
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => "" | "default" | "
|
|
54
|
+
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text") | (() => "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text") | (((new (...args: any[]) => "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text") | (() => "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text")) | null)[], unknown, unknown>>;
|
|
55
55
|
readonly required: false;
|
|
56
56
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
57
57
|
__epPropKey: true;
|
|
58
58
|
};
|
|
59
|
-
readonly placement: EpPropFinalized<(new (...args: any[]) => "
|
|
59
|
+
readonly placement: EpPropFinalized<(new (...args: any[]) => "right" | "left" | "auto" | "bottom" | "top" | "right-end" | "right-start" | "left-end" | "left-start" | "bottom-end" | "bottom-start" | "top-end" | "top-start" | "auto-start" | "auto-end") | (() => Placement) | (((new (...args: any[]) => "right" | "left" | "auto" | "bottom" | "top" | "right-end" | "right-start" | "left-end" | "left-start" | "bottom-end" | "bottom-start" | "top-end" | "top-start" | "auto-start" | "auto-end") | (() => Placement)) | null)[], unknown, unknown, "bottom", boolean>;
|
|
60
60
|
readonly popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | (((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>)) | null)[], unknown, unknown, () => {}, boolean>;
|
|
61
61
|
readonly id: StringConstructor;
|
|
62
62
|
readonly size: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -177,7 +177,7 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
177
177
|
__epPropKey: true;
|
|
178
178
|
};
|
|
179
179
|
readonly disabled: BooleanConstructor;
|
|
180
|
-
readonly role: EpPropFinalized<StringConstructor, "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "
|
|
180
|
+
readonly role: EpPropFinalized<StringConstructor, "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "tree" | "group" | "navigation", unknown, "menu", boolean>;
|
|
181
181
|
readonly buttonProps: {
|
|
182
182
|
readonly type: vue.PropType<Partial<ButtonProps>>;
|
|
183
183
|
readonly required: false;
|
|
@@ -253,12 +253,12 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
253
253
|
readonly __epPropKey: true;
|
|
254
254
|
};
|
|
255
255
|
readonly type: {
|
|
256
|
-
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => "" | "default" | "
|
|
256
|
+
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text") | (() => "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text") | (((new (...args: any[]) => "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text") | (() => "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text")) | null)[], unknown, unknown>>;
|
|
257
257
|
readonly required: false;
|
|
258
258
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
259
259
|
__epPropKey: true;
|
|
260
260
|
};
|
|
261
|
-
readonly placement: EpPropFinalized<(new (...args: any[]) => "
|
|
261
|
+
readonly placement: EpPropFinalized<(new (...args: any[]) => "right" | "left" | "auto" | "bottom" | "top" | "right-end" | "right-start" | "left-end" | "left-start" | "bottom-end" | "bottom-start" | "top-end" | "top-start" | "auto-start" | "auto-end") | (() => Placement) | (((new (...args: any[]) => "right" | "left" | "auto" | "bottom" | "top" | "right-end" | "right-start" | "left-end" | "left-start" | "bottom-end" | "bottom-start" | "top-end" | "top-start" | "auto-start" | "auto-end") | (() => Placement)) | null)[], unknown, unknown, "bottom", boolean>;
|
|
262
262
|
readonly popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | (((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>)) | null)[], unknown, unknown, () => {}, boolean>;
|
|
263
263
|
readonly id: StringConstructor;
|
|
264
264
|
readonly size: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -379,7 +379,7 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
379
379
|
__epPropKey: true;
|
|
380
380
|
};
|
|
381
381
|
readonly disabled: BooleanConstructor;
|
|
382
|
-
readonly role: EpPropFinalized<StringConstructor, "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "
|
|
382
|
+
readonly role: EpPropFinalized<StringConstructor, "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "tree" | "group" | "navigation", unknown, "menu", boolean>;
|
|
383
383
|
readonly buttonProps: {
|
|
384
384
|
readonly type: vue.PropType<Partial<ButtonProps>>;
|
|
385
385
|
readonly required: false;
|
|
@@ -399,21 +399,21 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
399
399
|
"onVisible-change"?: ((...args: any[]) => any) | undefined;
|
|
400
400
|
onCommand?: ((...args: any[]) => any) | undefined;
|
|
401
401
|
}>, {
|
|
402
|
-
readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
403
|
-
readonly effect: EpPropMergeType<(new (...args: any[]) => string) | (() => PopperEffect) | (((new (...args: any[]) => string) | (() => PopperEffect)) | null)[], unknown, unknown>;
|
|
404
|
-
readonly placement: EpPropMergeType<(new (...args: any[]) => "top" | "auto" | "bottom" | "bottom-start" | "left" | "right" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement) | (((new (...args: any[]) => "top" | "auto" | "bottom" | "bottom-start" | "left" | "right" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement)) | null)[], unknown, unknown>;
|
|
405
|
-
readonly size: string;
|
|
406
402
|
readonly disabled: boolean;
|
|
403
|
+
readonly size: string;
|
|
407
404
|
readonly tabindex: EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>;
|
|
405
|
+
readonly effect: EpPropMergeType<(new (...args: any[]) => string) | (() => PopperEffect) | (((new (...args: any[]) => string) | (() => PopperEffect)) | null)[], unknown, unknown>;
|
|
406
|
+
readonly showArrow: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
407
|
+
readonly placement: EpPropMergeType<(new (...args: any[]) => "right" | "left" | "auto" | "bottom" | "top" | "right-end" | "right-start" | "left-end" | "left-start" | "bottom-end" | "bottom-start" | "top-end" | "top-start" | "auto-start" | "auto-end") | (() => Placement) | (((new (...args: any[]) => "right" | "left" | "auto" | "bottom" | "top" | "right-end" | "right-start" | "left-end" | "left-start" | "bottom-end" | "bottom-start" | "top-end" | "top-start" | "auto-start" | "auto-end") | (() => Placement)) | null)[], unknown, unknown>;
|
|
408
|
+
readonly popperOptions: Partial<Options>;
|
|
408
409
|
readonly virtualTriggering: boolean;
|
|
409
410
|
readonly loop: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
410
|
-
readonly
|
|
411
|
-
readonly
|
|
412
|
-
readonly role: EpPropMergeType<StringConstructor, "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "group" | "navigation" | "tree", unknown>;
|
|
411
|
+
readonly maxHeight: EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>;
|
|
412
|
+
readonly role: EpPropMergeType<StringConstructor, "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "tree" | "group" | "navigation", unknown>;
|
|
413
413
|
readonly persistent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
414
|
+
readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
414
415
|
readonly trigger: Arrayable<"click" | "contextmenu" | "hover">;
|
|
415
416
|
readonly triggerKeys: string[];
|
|
416
|
-
readonly maxHeight: EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>;
|
|
417
417
|
readonly hideOnClick: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
418
418
|
readonly showTimeout: number;
|
|
419
419
|
readonly hideTimeout: number;
|
|
@@ -425,22 +425,22 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
425
425
|
}>, {
|
|
426
426
|
ref: vue.Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
427
427
|
size: vue.ComputedRef<"" | "default" | "small" | "large">;
|
|
428
|
-
type: vue.ComputedRef<"default" | "" | "
|
|
428
|
+
type: vue.ComputedRef<"default" | "primary" | "" | "success" | "info" | "warning" | "danger" | "text">;
|
|
429
429
|
disabled: vue.ComputedRef<boolean>;
|
|
430
430
|
shouldAddSpace: vue.ComputedRef<boolean>;
|
|
431
431
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
432
432
|
click: (evt: MouseEvent) => void;
|
|
433
433
|
}, vue.PublicProps, {
|
|
434
|
+
disabled: boolean;
|
|
434
435
|
type: ButtonType;
|
|
435
436
|
text: boolean;
|
|
436
|
-
disabled: boolean;
|
|
437
437
|
round: boolean;
|
|
438
438
|
dashed: boolean;
|
|
439
|
+
tag: string | vue.Component;
|
|
440
|
+
plain: boolean;
|
|
439
441
|
nativeType: ButtonNativeType;
|
|
440
442
|
loadingIcon: IconPropType;
|
|
441
|
-
plain: boolean;
|
|
442
443
|
autoInsertSpace: boolean;
|
|
443
|
-
tag: string | vue.Component;
|
|
444
444
|
}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
|
|
445
445
|
P: {};
|
|
446
446
|
B: {};
|
|
@@ -453,20 +453,20 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
453
453
|
}>, {
|
|
454
454
|
ref: vue.Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
455
455
|
size: vue.ComputedRef<"" | "default" | "small" | "large">;
|
|
456
|
-
type: vue.ComputedRef<"default" | "" | "
|
|
456
|
+
type: vue.ComputedRef<"default" | "primary" | "" | "success" | "info" | "warning" | "danger" | "text">;
|
|
457
457
|
disabled: vue.ComputedRef<boolean>;
|
|
458
458
|
shouldAddSpace: vue.ComputedRef<boolean>;
|
|
459
459
|
}, {}, {}, {}, {
|
|
460
|
+
disabled: boolean;
|
|
460
461
|
type: ButtonType;
|
|
461
462
|
text: boolean;
|
|
462
|
-
disabled: boolean;
|
|
463
463
|
round: boolean;
|
|
464
464
|
dashed: boolean;
|
|
465
|
+
tag: string | vue.Component;
|
|
466
|
+
plain: boolean;
|
|
465
467
|
nativeType: ButtonNativeType;
|
|
466
468
|
loadingIcon: IconPropType;
|
|
467
|
-
plain: boolean;
|
|
468
469
|
autoInsertSpace: boolean;
|
|
469
|
-
tag: string | vue.Component;
|
|
470
470
|
}>;
|
|
471
471
|
__isFragment?: never;
|
|
472
472
|
__isTeleport?: never;
|
|
@@ -476,22 +476,22 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
476
476
|
}>, {
|
|
477
477
|
ref: vue.Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
478
478
|
size: vue.ComputedRef<"" | "default" | "small" | "large">;
|
|
479
|
-
type: vue.ComputedRef<"default" | "" | "
|
|
479
|
+
type: vue.ComputedRef<"default" | "primary" | "" | "success" | "info" | "warning" | "danger" | "text">;
|
|
480
480
|
disabled: vue.ComputedRef<boolean>;
|
|
481
481
|
shouldAddSpace: vue.ComputedRef<boolean>;
|
|
482
482
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
483
483
|
click: (evt: MouseEvent) => void;
|
|
484
484
|
}, string, {
|
|
485
|
+
disabled: boolean;
|
|
485
486
|
type: ButtonType;
|
|
486
487
|
text: boolean;
|
|
487
|
-
disabled: boolean;
|
|
488
488
|
round: boolean;
|
|
489
489
|
dashed: boolean;
|
|
490
|
+
tag: string | vue.Component;
|
|
491
|
+
plain: boolean;
|
|
490
492
|
nativeType: ButtonNativeType;
|
|
491
493
|
loadingIcon: IconPropType;
|
|
492
|
-
plain: boolean;
|
|
493
494
|
autoInsertSpace: boolean;
|
|
494
|
-
tag: string | vue.Component;
|
|
495
495
|
}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
496
496
|
$slots: {
|
|
497
497
|
loading?: (props: {}) => any;
|
|
@@ -528,7 +528,7 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
528
528
|
};
|
|
529
529
|
ElButtonGroup: {
|
|
530
530
|
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, vue.PublicProps, {
|
|
531
|
-
type: "" | "default" | "
|
|
531
|
+
type: "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text";
|
|
532
532
|
direction: "horizontal" | "vertical";
|
|
533
533
|
}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
|
|
534
534
|
P: {};
|
|
@@ -538,14 +538,14 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
538
538
|
M: {};
|
|
539
539
|
Defaults: {};
|
|
540
540
|
}, Readonly<ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
541
|
-
type: "" | "default" | "
|
|
541
|
+
type: "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text";
|
|
542
542
|
direction: "horizontal" | "vertical";
|
|
543
543
|
}>;
|
|
544
544
|
__isFragment?: never;
|
|
545
545
|
__isTeleport?: never;
|
|
546
546
|
__isSuspense?: never;
|
|
547
547
|
} & vue.ComponentOptionsBase<Readonly<ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
|
|
548
|
-
type: "" | "default" | "
|
|
548
|
+
type: "" | "default" | "primary" | "success" | "info" | "warning" | "danger" | "text";
|
|
549
549
|
direction: "horizontal" | "vertical";
|
|
550
550
|
}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
551
551
|
$slots: {
|
|
@@ -577,9 +577,9 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
577
577
|
"end-reached": (direction: ScrollbarDirection) => void;
|
|
578
578
|
}, vue.PublicProps, {
|
|
579
579
|
tabindex: number | string;
|
|
580
|
+
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
580
581
|
height: number | string;
|
|
581
582
|
maxHeight: number | string;
|
|
582
|
-
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
583
583
|
distance: number;
|
|
584
584
|
wrapStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
585
585
|
wrapClass: string | string[];
|
|
@@ -611,9 +611,9 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
611
611
|
handleScroll: () => void;
|
|
612
612
|
}, {}, {}, {}, {
|
|
613
613
|
tabindex: number | string;
|
|
614
|
+
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
614
615
|
height: number | string;
|
|
615
616
|
maxHeight: number | string;
|
|
616
|
-
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
617
617
|
distance: number;
|
|
618
618
|
wrapStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
619
619
|
wrapClass: string | string[];
|
|
@@ -648,9 +648,9 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
648
648
|
"end-reached": (direction: ScrollbarDirection) => void;
|
|
649
649
|
}, string, {
|
|
650
650
|
tabindex: number | string;
|
|
651
|
+
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
651
652
|
height: number | string;
|
|
652
653
|
maxHeight: number | string;
|
|
653
|
-
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
654
654
|
distance: number;
|
|
655
655
|
wrapStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
656
656
|
wrapClass: string | string[];
|
|
@@ -688,15 +688,19 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
688
688
|
"before-show": (...args: any[]) => void;
|
|
689
689
|
"before-hide": (...args: any[]) => void;
|
|
690
690
|
}, vue.PublicProps, {
|
|
691
|
-
offset: number;
|
|
692
|
-
teleported: boolean;
|
|
693
|
-
effect: PopperEffect;
|
|
694
|
-
placement: Placement;
|
|
695
|
-
popperStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
696
691
|
visible: boolean | null;
|
|
697
692
|
content: string;
|
|
698
693
|
style: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
694
|
+
effect: PopperEffect;
|
|
695
|
+
popperStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
696
|
+
showArrow: boolean;
|
|
697
|
+
placement: Placement;
|
|
698
|
+
showAfter: number;
|
|
699
|
+
hideAfter: number;
|
|
700
|
+
autoClose: number;
|
|
699
701
|
enterable: boolean;
|
|
702
|
+
offset: number;
|
|
703
|
+
popperOptions: Partial<Options>;
|
|
700
704
|
pure: boolean;
|
|
701
705
|
focusOnShow: boolean;
|
|
702
706
|
trapping: boolean;
|
|
@@ -705,14 +709,10 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
705
709
|
loop: boolean;
|
|
706
710
|
boundariesPadding: number;
|
|
707
711
|
gpuAcceleration: boolean;
|
|
708
|
-
popperOptions: Partial<Options>;
|
|
709
712
|
strategy: "fixed" | "absolute";
|
|
710
713
|
arrowOffset: number;
|
|
711
|
-
showArrow: boolean;
|
|
712
714
|
role: typeof roleTypes[number];
|
|
713
|
-
|
|
714
|
-
hideAfter: number;
|
|
715
|
-
autoClose: number;
|
|
715
|
+
teleported: boolean;
|
|
716
716
|
trigger: Arrayable<TooltipTriggerType>;
|
|
717
717
|
triggerKeys: string[];
|
|
718
718
|
}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
|
|
@@ -739,15 +739,19 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
739
739
|
onClose: (event?: Event, delay?: number) => void;
|
|
740
740
|
hide: (event?: Event) => void;
|
|
741
741
|
}, {}, {}, {}, {
|
|
742
|
-
offset: number;
|
|
743
|
-
teleported: boolean;
|
|
744
|
-
effect: PopperEffect;
|
|
745
|
-
placement: Placement;
|
|
746
|
-
popperStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
747
742
|
visible: boolean | null;
|
|
748
743
|
content: string;
|
|
749
744
|
style: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
745
|
+
effect: PopperEffect;
|
|
746
|
+
popperStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
747
|
+
showArrow: boolean;
|
|
748
|
+
placement: Placement;
|
|
749
|
+
showAfter: number;
|
|
750
|
+
hideAfter: number;
|
|
751
|
+
autoClose: number;
|
|
750
752
|
enterable: boolean;
|
|
753
|
+
offset: number;
|
|
754
|
+
popperOptions: Partial<Options>;
|
|
751
755
|
pure: boolean;
|
|
752
756
|
focusOnShow: boolean;
|
|
753
757
|
trapping: boolean;
|
|
@@ -756,14 +760,10 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
756
760
|
loop: boolean;
|
|
757
761
|
boundariesPadding: number;
|
|
758
762
|
gpuAcceleration: boolean;
|
|
759
|
-
popperOptions: Partial<Options>;
|
|
760
763
|
strategy: "fixed" | "absolute";
|
|
761
764
|
arrowOffset: number;
|
|
762
|
-
showArrow: boolean;
|
|
763
765
|
role: typeof roleTypes[number];
|
|
764
|
-
|
|
765
|
-
hideAfter: number;
|
|
766
|
-
autoClose: number;
|
|
766
|
+
teleported: boolean;
|
|
767
767
|
trigger: Arrayable<TooltipTriggerType>;
|
|
768
768
|
triggerKeys: string[];
|
|
769
769
|
}>;
|
|
@@ -795,15 +795,19 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
795
795
|
"before-show": (...args: any[]) => void;
|
|
796
796
|
"before-hide": (...args: any[]) => void;
|
|
797
797
|
}, string, {
|
|
798
|
-
offset: number;
|
|
799
|
-
teleported: boolean;
|
|
800
|
-
effect: PopperEffect;
|
|
801
|
-
placement: Placement;
|
|
802
|
-
popperStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
803
798
|
visible: boolean | null;
|
|
804
799
|
content: string;
|
|
805
800
|
style: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
801
|
+
effect: PopperEffect;
|
|
802
|
+
popperStyle: string | false | CSSProperties | vue.StyleValue[] | null;
|
|
803
|
+
showArrow: boolean;
|
|
804
|
+
placement: Placement;
|
|
805
|
+
showAfter: number;
|
|
806
|
+
hideAfter: number;
|
|
807
|
+
autoClose: number;
|
|
806
808
|
enterable: boolean;
|
|
809
|
+
offset: number;
|
|
810
|
+
popperOptions: Partial<Options>;
|
|
807
811
|
pure: boolean;
|
|
808
812
|
focusOnShow: boolean;
|
|
809
813
|
trapping: boolean;
|
|
@@ -812,14 +816,10 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
812
816
|
loop: boolean;
|
|
813
817
|
boundariesPadding: number;
|
|
814
818
|
gpuAcceleration: boolean;
|
|
815
|
-
popperOptions: Partial<Options>;
|
|
816
819
|
strategy: "fixed" | "absolute";
|
|
817
820
|
arrowOffset: number;
|
|
818
|
-
showArrow: boolean;
|
|
819
821
|
role: typeof roleTypes[number];
|
|
820
|
-
|
|
821
|
-
hideAfter: number;
|
|
822
|
-
autoClose: number;
|
|
822
|
+
teleported: boolean;
|
|
823
823
|
trigger: Arrayable<TooltipTriggerType>;
|
|
824
824
|
triggerKeys: string[];
|
|
825
825
|
}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
@@ -908,24 +908,18 @@ declare const __VLS_export: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
908
908
|
[key: string]: any;
|
|
909
909
|
}> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
910
910
|
ElIcon: SFCWithInstall<{
|
|
911
|
-
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, vue.PublicProps, {
|
|
912
|
-
size: number | string;
|
|
913
|
-
}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
|
|
911
|
+
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, vue.PublicProps, {}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
|
|
914
912
|
P: {};
|
|
915
913
|
B: {};
|
|
916
914
|
D: {};
|
|
917
915
|
C: {};
|
|
918
916
|
M: {};
|
|
919
917
|
Defaults: {};
|
|
920
|
-
}, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
921
|
-
size: number | string;
|
|
922
|
-
}>;
|
|
918
|
+
}, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
923
919
|
__isFragment?: never;
|
|
924
920
|
__isTeleport?: never;
|
|
925
921
|
__isSuspense?: never;
|
|
926
|
-
} & vue.ComponentOptionsBase<Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
|
|
927
|
-
size: number | string;
|
|
928
|
-
}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
922
|
+
} & vue.ComponentOptionsBase<Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
929
923
|
$slots: {
|
|
930
924
|
default?: (props: {}) => any;
|
|
931
925
|
};
|
|
@@ -71,7 +71,7 @@ declare const formItemProps: {
|
|
|
71
71
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
72
72
|
__epPropKey: true;
|
|
73
73
|
};
|
|
74
|
-
readonly labelPosition: EpPropFinalized<StringConstructor, "" | "
|
|
74
|
+
readonly labelPosition: EpPropFinalized<StringConstructor, "" | "right" | "left" | "top", unknown, "", boolean>;
|
|
75
75
|
readonly prop: {
|
|
76
76
|
readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | string[]) | (() => FormItemProp) | (((new (...args: any[]) => string | string[]) | (() => FormItemProp)) | null)[], unknown, unknown>>;
|
|
77
77
|
readonly required: false;
|
|
@@ -184,6 +184,7 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
184
184
|
const setInitialValue = (value) => {
|
|
185
185
|
initialValue = cloneDeep(value);
|
|
186
186
|
};
|
|
187
|
+
const getInitialValue = () => initialValue;
|
|
187
188
|
watch(() => props.error, (val) => {
|
|
188
189
|
validateMessage.value = val || "";
|
|
189
190
|
setValidationState(val ? "error" : "");
|
|
@@ -206,9 +207,18 @@ var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
206
207
|
clearValidate,
|
|
207
208
|
validate,
|
|
208
209
|
propString,
|
|
209
|
-
setInitialValue
|
|
210
|
+
setInitialValue,
|
|
211
|
+
getInitialValue
|
|
210
212
|
});
|
|
211
213
|
provide(formItemContextKey, context);
|
|
214
|
+
watch(propString, (newPropString, oldPropString) => {
|
|
215
|
+
if (!formContext || !oldPropString) return;
|
|
216
|
+
formContext.removeField(context, oldPropString);
|
|
217
|
+
if (newPropString) {
|
|
218
|
+
setInitialValue(fieldValue.value);
|
|
219
|
+
formContext.addField(context);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
212
222
|
onMounted(() => {
|
|
213
223
|
if (props.prop) {
|
|
214
224
|
setInitialValue(fieldValue.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div\n ref=\"formItemRef\"\n :class=\"formItemClasses\"\n :role=\"isGroup ? 'group' : undefined\"\n :aria-labelledby=\"isGroup ? labelId : undefined\"\n >\n <form-label-wrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"formContext?.labelWidth === 'auto'\"\n >\n <component\n :is=\"labelFor ? 'label' : 'div'\"\n v-if=\"!!(label || $slots.label)\"\n :id=\"labelId\"\n :for=\"labelFor\"\n :class=\"ns.e('label')\"\n :style=\"labelStyle\"\n >\n <slot name=\"label\" :label=\"currentLabel\">\n {{ currentLabel }}\n </slot>\n </component>\n </form-label-wrap>\n\n <div :class=\"ns.e('content')\" :style=\"contentStyle\">\n <slot />\n <transition-group :name=\"`${ns.namespace.value}-zoom-in-top`\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div :class=\"validateClasses\">\n {{ validateMessage }}\n </div>\n </slot>\n </transition-group>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n useSlots,\n watch,\n} from 'vue'\nimport AsyncValidator from 'async-validator'\nimport { refDebounced } from '@vueuse/core'\nimport {\n addUnit,\n ensureArray,\n getProp,\n isArray,\n isBoolean,\n isFunction,\n} from '@element-plus/utils'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport FormLabelWrap from './form-label-wrap'\nimport { formContextKey, formItemContextKey } from './constants'\nimport { cloneDeep } from 'lodash-unified'\n\nimport type { CSSProperties } from 'vue'\nimport type { RuleItem } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type {\n FormItemContext,\n FormItemRule,\n FormValidateFailure,\n} from './types'\nimport type { FormItemProps, FormItemValidateState } from './form-item'\n\ndefineOptions({\n name: 'ElFormItem',\n})\nconst props = withDefaults(defineProps<FormItemProps>(), {\n labelPosition: '',\n showMessage: true,\n required: undefined,\n inlineMessage: undefined,\n})\nconst slots = useSlots()\n\nconst formContext = inject(formContextKey, undefined)\nconst parentFormItemContext = inject(formItemContextKey, undefined)\n\nconst _size = useFormSize(undefined, { formItem: false })\nconst ns = useNamespace('form-item')\n\nconst labelId = useId().value\nconst inputIds = ref<string[]>([])\n\nconst validateState = ref<FormItemValidateState>('')\nconst validateStateDebounced = refDebounced(validateState, 100)\nconst validateMessage = ref('')\nconst formItemRef = ref<HTMLDivElement>()\n// special inline value.\nlet initialValue: any = undefined\nlet isResettingField = false\n\nconst labelPosition = computed(\n () => props.labelPosition || formContext?.labelPosition\n)\n\nconst labelStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top') {\n return {}\n }\n\n const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth)\n return { width: labelWidth }\n})\n\nconst contentStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top' || formContext?.inline) {\n return {}\n }\n if (!props.label && !props.labelWidth && isNested) {\n return {}\n }\n const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth)\n if (!props.label && !slots.label) {\n return { marginLeft: labelWidth }\n }\n return {}\n})\n\nconst formItemClasses = computed(() => [\n ns.b(),\n ns.m(_size.value),\n ns.is('error', validateState.value === 'error'),\n ns.is('validating', validateState.value === 'validating'),\n ns.is('success', validateState.value === 'success'),\n ns.is('required', isRequired.value || props.required),\n ns.is('no-asterisk', formContext?.hideRequiredAsterisk),\n formContext?.requireAsteriskPosition === 'right'\n ? 'asterisk-right'\n : 'asterisk-left',\n {\n [ns.m('feedback')]: formContext?.statusIcon,\n [ns.m(`label-${labelPosition.value}`)]: labelPosition.value,\n },\n])\n\nconst _inlineMessage = computed(() =>\n isBoolean(props.inlineMessage)\n ? props.inlineMessage\n : formContext?.inlineMessage || false\n)\n\nconst validateClasses = computed(() => [\n ns.e('error'),\n { [ns.em('error', 'inline')]: _inlineMessage.value },\n])\n\nconst propString = computed(() => {\n if (!props.prop) return ''\n return isArray(props.prop) ? props.prop.join('.') : props.prop\n})\n\nconst hasLabel = computed<boolean>(() => {\n return !!(props.label || slots.label)\n})\n\nconst labelFor = computed<string | undefined>(() => {\n return (\n props.for ?? (inputIds.value.length === 1 ? inputIds.value[0] : undefined)\n )\n})\n\nconst isGroup = computed<boolean>(() => {\n return !labelFor.value && hasLabel.value\n})\n\nconst isNested = !!parentFormItemContext\n\nconst fieldValue = computed(() => {\n const model = formContext?.model\n if (!model || !props.prop) {\n return\n }\n return getProp(model, props.prop).value\n})\n\nconst normalizedRules = computed(() => {\n const { required } = props\n\n const rules: FormItemRule[] = []\n\n if (props.rules) {\n rules.push(...ensureArray(props.rules))\n }\n\n const formRules = formContext?.rules\n if (formRules && props.prop) {\n const _rules = getProp<Arrayable<FormItemRule> | undefined>(\n formRules,\n props.prop\n ).value\n if (_rules) {\n rules.push(...ensureArray(_rules))\n }\n }\n\n if (required !== undefined) {\n const requiredRules = rules\n .map((rule, i) => [rule, i] as const)\n .filter(([rule]) => 'required' in rule)\n\n if (requiredRules.length > 0) {\n for (const [rule, i] of requiredRules) {\n if (rule.required === required) continue\n rules[i] = { ...rule, required }\n }\n } else {\n rules.push({ required })\n }\n }\n\n return rules\n})\n\nconst validateEnabled = computed(() => normalizedRules.value.length > 0)\n\nconst getFilteredRule = (trigger: string) => {\n const rules = normalizedRules.value\n return (\n rules\n .filter((rule) => {\n if (!rule.trigger || !trigger) return true\n if (isArray(rule.trigger)) {\n return rule.trigger.includes(trigger)\n } else {\n return rule.trigger === trigger\n }\n })\n // exclude trigger\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .map(({ trigger, ...rule }): RuleItem => rule)\n )\n}\n\nconst isRequired = computed(() =>\n normalizedRules.value.some((rule) => rule.required)\n)\n\nconst shouldShowError = computed(\n () =>\n validateStateDebounced.value === 'error' &&\n props.showMessage &&\n (formContext?.showMessage ?? true)\n)\n\nconst currentLabel = computed(\n () => `${props.label || ''}${formContext?.labelSuffix || ''}`\n)\n\nconst setValidationState = (state: FormItemValidateState) => {\n validateState.value = state\n}\n\nconst onValidationFailed = (error: FormValidateFailure) => {\n const { errors, fields } = error\n if (!errors || !fields) {\n console.error(error)\n }\n\n setValidationState('error')\n validateMessage.value = errors\n ? (errors?.[0]?.message ?? `${props.prop} is required`)\n : ''\n\n formContext?.emit('validate', props.prop!, false, validateMessage.value)\n}\n\nconst onValidationSucceeded = () => {\n setValidationState('success')\n formContext?.emit('validate', props.prop!, true, '')\n}\n\nconst doValidate = async (rules: RuleItem[]): Promise<true> => {\n const modelName = propString.value\n const validator = new AsyncValidator({\n [modelName]: rules,\n })\n return validator\n .validate({ [modelName]: fieldValue.value }, { firstFields: true })\n .then(() => {\n onValidationSucceeded()\n return true as const\n })\n .catch((err: FormValidateFailure) => {\n onValidationFailed(err)\n return Promise.reject(err)\n })\n}\n\nconst validate: FormItemContext['validate'] = async (trigger, callback) => {\n // skip validation if its resetting\n if (isResettingField || !props.prop) {\n return false\n }\n\n const hasCallback = isFunction(callback)\n if (!validateEnabled.value) {\n callback?.(false)\n return false\n }\n\n const rules = getFilteredRule(trigger)\n if (rules.length === 0) {\n callback?.(true)\n return true\n }\n\n setValidationState('validating')\n\n return doValidate(rules)\n .then(() => {\n callback?.(true)\n return true as const\n })\n .catch((err: FormValidateFailure) => {\n const { fields } = err\n callback?.(false, fields)\n return hasCallback ? false : Promise.reject(fields)\n })\n}\n\nconst clearValidate: FormItemContext['clearValidate'] = () => {\n setValidationState('')\n validateMessage.value = ''\n isResettingField = false\n}\n\nconst resetField: FormItemContext['resetField'] = async () => {\n const model = formContext?.model\n if (!model || !props.prop) return\n\n const computedValue = getProp(model, props.prop)\n\n // prevent validation from being triggered\n isResettingField = true\n\n computedValue.value = cloneDeep(initialValue)\n\n await nextTick()\n clearValidate()\n\n isResettingField = false\n}\n\nconst addInputId: FormItemContext['addInputId'] = (id: string) => {\n if (!inputIds.value.includes(id)) {\n inputIds.value.push(id)\n }\n}\n\nconst removeInputId: FormItemContext['removeInputId'] = (id: string) => {\n inputIds.value = inputIds.value.filter((listId) => listId !== id)\n}\n\nconst setInitialValue: FormItemContext['setInitialValue'] = (value: any) => {\n initialValue = cloneDeep(value)\n}\n\nwatch(\n () => props.error,\n (val) => {\n validateMessage.value = val || ''\n setValidationState(val ? 'error' : '')\n },\n { immediate: true }\n)\n\nwatch(\n () => props.validateStatus,\n (val) => setValidationState(val || '')\n)\n\nconst context: FormItemContext = reactive({\n ...toRefs(props),\n $el: formItemRef,\n size: _size,\n validateMessage,\n validateState,\n labelId,\n inputIds,\n isGroup,\n hasLabel,\n fieldValue,\n addInputId,\n removeInputId,\n resetField,\n clearValidate,\n validate,\n propString,\n setInitialValue,\n})\n\nprovide(formItemContextKey, context)\n\nonMounted(() => {\n if (props.prop) {\n setInitialValue(fieldValue.value)\n formContext?.addField(context)\n }\n})\n\nonBeforeUnmount(() => {\n formContext?.removeField(context)\n})\n\ndefineExpose({\n /**\n * @description Form item size.\n */\n size: _size,\n /**\n * @description Validation message.\n */\n validateMessage,\n /**\n * @description Validation state.\n */\n validateState,\n /**\n * @description Validate form item.\n */\n validate,\n /**\n * @description Remove validation status of the field.\n */\n clearValidate,\n /**\n * @description Reset current field and remove validation result.\n */\n resetField,\n /**\n * @description Set initial value for this field. When `resetField` is called, the field will reset to this value.\n */\n setInitialValue,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAiFA,MAAM,QAAQ;EAMd,MAAM,QAAQ,UAAS;EAEvB,MAAM,cAAc,OAAO,gBAAgB,OAAS;EACpD,MAAM,wBAAwB,OAAO,oBAAoB,OAAS;EAElE,MAAM,QAAQ,YAAY,QAAW,EAAE,UAAU,OAAO,CAAA;EACxD,MAAM,KAAK,aAAa,YAAW;EAEnC,MAAM,UAAU,OAAO,CAAC;EACxB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,SAAA;;KAJoC,OAAO,gBAAA;aAI3C,CAHL,mBAEM,OAAA,EAFA,OAAK,eAAE,gBAAA,MAAe,oBACvB,gBAAA,MAAe,EAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"form-item.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div\n ref=\"formItemRef\"\n :class=\"formItemClasses\"\n :role=\"isGroup ? 'group' : undefined\"\n :aria-labelledby=\"isGroup ? labelId : undefined\"\n >\n <form-label-wrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"formContext?.labelWidth === 'auto'\"\n >\n <component\n :is=\"labelFor ? 'label' : 'div'\"\n v-if=\"!!(label || $slots.label)\"\n :id=\"labelId\"\n :for=\"labelFor\"\n :class=\"ns.e('label')\"\n :style=\"labelStyle\"\n >\n <slot name=\"label\" :label=\"currentLabel\">\n {{ currentLabel }}\n </slot>\n </component>\n </form-label-wrap>\n\n <div :class=\"ns.e('content')\" :style=\"contentStyle\">\n <slot />\n <transition-group :name=\"`${ns.namespace.value}-zoom-in-top`\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div :class=\"validateClasses\">\n {{ validateMessage }}\n </div>\n </slot>\n </transition-group>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n useSlots,\n watch,\n} from 'vue'\nimport AsyncValidator from 'async-validator'\nimport { refDebounced } from '@vueuse/core'\nimport {\n addUnit,\n ensureArray,\n getProp,\n isArray,\n isBoolean,\n isFunction,\n} from '@element-plus/utils'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport FormLabelWrap from './form-label-wrap'\nimport { formContextKey, formItemContextKey } from './constants'\nimport { cloneDeep } from 'lodash-unified'\n\nimport type { CSSProperties } from 'vue'\nimport type { RuleItem } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type {\n FormItemContext,\n FormItemRule,\n FormValidateFailure,\n} from './types'\nimport type { FormItemProps, FormItemValidateState } from './form-item'\n\ndefineOptions({\n name: 'ElFormItem',\n})\nconst props = withDefaults(defineProps<FormItemProps>(), {\n labelPosition: '',\n showMessage: true,\n required: undefined,\n inlineMessage: undefined,\n})\nconst slots = useSlots()\n\nconst formContext = inject(formContextKey, undefined)\nconst parentFormItemContext = inject(formItemContextKey, undefined)\n\nconst _size = useFormSize(undefined, { formItem: false })\nconst ns = useNamespace('form-item')\n\nconst labelId = useId().value\nconst inputIds = ref<string[]>([])\n\nconst validateState = ref<FormItemValidateState>('')\nconst validateStateDebounced = refDebounced(validateState, 100)\nconst validateMessage = ref('')\nconst formItemRef = ref<HTMLDivElement>()\n// special inline value.\nlet initialValue: any = undefined\nlet isResettingField = false\n\nconst labelPosition = computed(\n () => props.labelPosition || formContext?.labelPosition\n)\n\nconst labelStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top') {\n return {}\n }\n\n const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth)\n return { width: labelWidth }\n})\n\nconst contentStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top' || formContext?.inline) {\n return {}\n }\n if (!props.label && !props.labelWidth && isNested) {\n return {}\n }\n const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth)\n if (!props.label && !slots.label) {\n return { marginLeft: labelWidth }\n }\n return {}\n})\n\nconst formItemClasses = computed(() => [\n ns.b(),\n ns.m(_size.value),\n ns.is('error', validateState.value === 'error'),\n ns.is('validating', validateState.value === 'validating'),\n ns.is('success', validateState.value === 'success'),\n ns.is('required', isRequired.value || props.required),\n ns.is('no-asterisk', formContext?.hideRequiredAsterisk),\n formContext?.requireAsteriskPosition === 'right'\n ? 'asterisk-right'\n : 'asterisk-left',\n {\n [ns.m('feedback')]: formContext?.statusIcon,\n [ns.m(`label-${labelPosition.value}`)]: labelPosition.value,\n },\n])\n\nconst _inlineMessage = computed(() =>\n isBoolean(props.inlineMessage)\n ? props.inlineMessage\n : formContext?.inlineMessage || false\n)\n\nconst validateClasses = computed(() => [\n ns.e('error'),\n { [ns.em('error', 'inline')]: _inlineMessage.value },\n])\n\nconst propString = computed(() => {\n if (!props.prop) return ''\n return isArray(props.prop) ? props.prop.join('.') : props.prop\n})\n\nconst hasLabel = computed<boolean>(() => {\n return !!(props.label || slots.label)\n})\n\nconst labelFor = computed<string | undefined>(() => {\n return (\n props.for ?? (inputIds.value.length === 1 ? inputIds.value[0] : undefined)\n )\n})\n\nconst isGroup = computed<boolean>(() => {\n return !labelFor.value && hasLabel.value\n})\n\nconst isNested = !!parentFormItemContext\n\nconst fieldValue = computed(() => {\n const model = formContext?.model\n if (!model || !props.prop) {\n return\n }\n return getProp(model, props.prop).value\n})\n\nconst normalizedRules = computed(() => {\n const { required } = props\n\n const rules: FormItemRule[] = []\n\n if (props.rules) {\n rules.push(...ensureArray(props.rules))\n }\n\n const formRules = formContext?.rules\n if (formRules && props.prop) {\n const _rules = getProp<Arrayable<FormItemRule> | undefined>(\n formRules,\n props.prop\n ).value\n if (_rules) {\n rules.push(...ensureArray(_rules))\n }\n }\n\n if (required !== undefined) {\n const requiredRules = rules\n .map((rule, i) => [rule, i] as const)\n .filter(([rule]) => 'required' in rule)\n\n if (requiredRules.length > 0) {\n for (const [rule, i] of requiredRules) {\n if (rule.required === required) continue\n rules[i] = { ...rule, required }\n }\n } else {\n rules.push({ required })\n }\n }\n\n return rules\n})\n\nconst validateEnabled = computed(() => normalizedRules.value.length > 0)\n\nconst getFilteredRule = (trigger: string) => {\n const rules = normalizedRules.value\n return (\n rules\n .filter((rule) => {\n if (!rule.trigger || !trigger) return true\n if (isArray(rule.trigger)) {\n return rule.trigger.includes(trigger)\n } else {\n return rule.trigger === trigger\n }\n })\n // exclude trigger\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .map(({ trigger, ...rule }): RuleItem => rule)\n )\n}\n\nconst isRequired = computed(() =>\n normalizedRules.value.some((rule) => rule.required)\n)\n\nconst shouldShowError = computed(\n () =>\n validateStateDebounced.value === 'error' &&\n props.showMessage &&\n (formContext?.showMessage ?? true)\n)\n\nconst currentLabel = computed(\n () => `${props.label || ''}${formContext?.labelSuffix || ''}`\n)\n\nconst setValidationState = (state: FormItemValidateState) => {\n validateState.value = state\n}\n\nconst onValidationFailed = (error: FormValidateFailure) => {\n const { errors, fields } = error\n if (!errors || !fields) {\n console.error(error)\n }\n\n setValidationState('error')\n validateMessage.value = errors\n ? (errors?.[0]?.message ?? `${props.prop} is required`)\n : ''\n\n formContext?.emit('validate', props.prop!, false, validateMessage.value)\n}\n\nconst onValidationSucceeded = () => {\n setValidationState('success')\n formContext?.emit('validate', props.prop!, true, '')\n}\n\nconst doValidate = async (rules: RuleItem[]): Promise<true> => {\n const modelName = propString.value\n const validator = new AsyncValidator({\n [modelName]: rules,\n })\n return validator\n .validate({ [modelName]: fieldValue.value }, { firstFields: true })\n .then(() => {\n onValidationSucceeded()\n return true as const\n })\n .catch((err: FormValidateFailure) => {\n onValidationFailed(err)\n return Promise.reject(err)\n })\n}\n\nconst validate: FormItemContext['validate'] = async (trigger, callback) => {\n // skip validation if its resetting\n if (isResettingField || !props.prop) {\n return false\n }\n\n const hasCallback = isFunction(callback)\n if (!validateEnabled.value) {\n callback?.(false)\n return false\n }\n\n const rules = getFilteredRule(trigger)\n if (rules.length === 0) {\n callback?.(true)\n return true\n }\n\n setValidationState('validating')\n\n return doValidate(rules)\n .then(() => {\n callback?.(true)\n return true as const\n })\n .catch((err: FormValidateFailure) => {\n const { fields } = err\n callback?.(false, fields)\n return hasCallback ? false : Promise.reject(fields)\n })\n}\n\nconst clearValidate: FormItemContext['clearValidate'] = () => {\n setValidationState('')\n validateMessage.value = ''\n isResettingField = false\n}\n\nconst resetField: FormItemContext['resetField'] = async () => {\n const model = formContext?.model\n if (!model || !props.prop) return\n\n const computedValue = getProp(model, props.prop)\n\n // prevent validation from being triggered\n isResettingField = true\n\n computedValue.value = cloneDeep(initialValue)\n\n await nextTick()\n clearValidate()\n\n isResettingField = false\n}\n\nconst addInputId: FormItemContext['addInputId'] = (id: string) => {\n if (!inputIds.value.includes(id)) {\n inputIds.value.push(id)\n }\n}\n\nconst removeInputId: FormItemContext['removeInputId'] = (id: string) => {\n inputIds.value = inputIds.value.filter((listId) => listId !== id)\n}\n\nconst setInitialValue: FormItemContext['setInitialValue'] = (value: any) => {\n initialValue = cloneDeep(value)\n}\n\nconst getInitialValue: FormItemContext['getInitialValue'] = () => initialValue\n\nwatch(\n () => props.error,\n (val) => {\n validateMessage.value = val || ''\n setValidationState(val ? 'error' : '')\n },\n { immediate: true }\n)\n\nwatch(\n () => props.validateStatus,\n (val) => setValidationState(val || '')\n)\n\nconst context: FormItemContext = reactive({\n ...toRefs(props),\n $el: formItemRef,\n size: _size,\n validateMessage,\n validateState,\n labelId,\n inputIds,\n isGroup,\n hasLabel,\n fieldValue,\n addInputId,\n removeInputId,\n resetField,\n clearValidate,\n validate,\n propString,\n setInitialValue,\n getInitialValue,\n})\n\nprovide(formItemContextKey, context)\n\nwatch(propString, (newPropString, oldPropString) => {\n if (!formContext || !oldPropString) return\n formContext.removeField(context, oldPropString)\n if (newPropString) {\n setInitialValue(fieldValue.value)\n formContext.addField(context)\n }\n})\n\nonMounted(() => {\n if (props.prop) {\n setInitialValue(fieldValue.value)\n formContext?.addField(context)\n }\n})\n\nonBeforeUnmount(() => {\n formContext?.removeField(context)\n})\n\ndefineExpose({\n /**\n * @description Form item size.\n */\n size: _size,\n /**\n * @description Validation message.\n */\n validateMessage,\n /**\n * @description Validation state.\n */\n validateState,\n /**\n * @description Validate form item.\n */\n validate,\n /**\n * @description Remove validation status of the field.\n */\n clearValidate,\n /**\n * @description Reset current field and remove validation result.\n */\n resetField,\n /**\n * @description Set initial value for this field. When `resetField` is called, the field will reset to this value.\n */\n setInitialValue,\n})\n</script>\n"],"mappings":";;;;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AAI,MAAA,QAAO;KACX,KAAK,SAAA;KACL,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,QAAA,CAAA;KACX,OAAK,eAAE,WAAA,MAAU;;4BAIX,CAFP,WAEO,KAAA,QAAA,SAAA,EAFa,OAAO,aAAA,OAAY,QAEhC,iCADF,aAAA,MAAY,EAAA,EAAA;;;;;;;;;2CAKrB,mBASM,OAAA;IATA,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,UAAA,CAAA;IAAc,OAAK,eAAE,aAAA,MAAY;OAChD,WAAQ,KAAA,QAAA,UAAA,EACR,YAMmB,iBAAA,EANA,MAAI,GAAK,MAAA,GAAE,CAAC,UAAU,MAAK;2BAKrC,CAJK,gBAAA,QAAZ,WAIO,KAAA,QAAA,SAAA;;KAJoC,OAAO,gBAAA;aAI3C,CAHL,mBAEM,OAAA,EAFA,OAAK,eAAE,gBAAA,MAAe,oBACvB,gBAAA,MAAe,EAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item2.mjs","names":[],"sources":["../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div\n ref=\"formItemRef\"\n :class=\"formItemClasses\"\n :role=\"isGroup ? 'group' : undefined\"\n :aria-labelledby=\"isGroup ? labelId : undefined\"\n >\n <form-label-wrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"formContext?.labelWidth === 'auto'\"\n >\n <component\n :is=\"labelFor ? 'label' : 'div'\"\n v-if=\"!!(label || $slots.label)\"\n :id=\"labelId\"\n :for=\"labelFor\"\n :class=\"ns.e('label')\"\n :style=\"labelStyle\"\n >\n <slot name=\"label\" :label=\"currentLabel\">\n {{ currentLabel }}\n </slot>\n </component>\n </form-label-wrap>\n\n <div :class=\"ns.e('content')\" :style=\"contentStyle\">\n <slot />\n <transition-group :name=\"`${ns.namespace.value}-zoom-in-top`\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div :class=\"validateClasses\">\n {{ validateMessage }}\n </div>\n </slot>\n </transition-group>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n useSlots,\n watch,\n} from 'vue'\nimport AsyncValidator from 'async-validator'\nimport { refDebounced } from '@vueuse/core'\nimport {\n addUnit,\n ensureArray,\n getProp,\n isArray,\n isBoolean,\n isFunction,\n} from '@element-plus/utils'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport FormLabelWrap from './form-label-wrap'\nimport { formContextKey, formItemContextKey } from './constants'\nimport { cloneDeep } from 'lodash-unified'\n\nimport type { CSSProperties } from 'vue'\nimport type { RuleItem } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type {\n FormItemContext,\n FormItemRule,\n FormValidateFailure,\n} from './types'\nimport type { FormItemProps, FormItemValidateState } from './form-item'\n\ndefineOptions({\n name: 'ElFormItem',\n})\nconst props = withDefaults(defineProps<FormItemProps>(), {\n labelPosition: '',\n showMessage: true,\n required: undefined,\n inlineMessage: undefined,\n})\nconst slots = useSlots()\n\nconst formContext = inject(formContextKey, undefined)\nconst parentFormItemContext = inject(formItemContextKey, undefined)\n\nconst _size = useFormSize(undefined, { formItem: false })\nconst ns = useNamespace('form-item')\n\nconst labelId = useId().value\nconst inputIds = ref<string[]>([])\n\nconst validateState = ref<FormItemValidateState>('')\nconst validateStateDebounced = refDebounced(validateState, 100)\nconst validateMessage = ref('')\nconst formItemRef = ref<HTMLDivElement>()\n// special inline value.\nlet initialValue: any = undefined\nlet isResettingField = false\n\nconst labelPosition = computed(\n () => props.labelPosition || formContext?.labelPosition\n)\n\nconst labelStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top') {\n return {}\n }\n\n const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth)\n return { width: labelWidth }\n})\n\nconst contentStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top' || formContext?.inline) {\n return {}\n }\n if (!props.label && !props.labelWidth && isNested) {\n return {}\n }\n const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth)\n if (!props.label && !slots.label) {\n return { marginLeft: labelWidth }\n }\n return {}\n})\n\nconst formItemClasses = computed(() => [\n ns.b(),\n ns.m(_size.value),\n ns.is('error', validateState.value === 'error'),\n ns.is('validating', validateState.value === 'validating'),\n ns.is('success', validateState.value === 'success'),\n ns.is('required', isRequired.value || props.required),\n ns.is('no-asterisk', formContext?.hideRequiredAsterisk),\n formContext?.requireAsteriskPosition === 'right'\n ? 'asterisk-right'\n : 'asterisk-left',\n {\n [ns.m('feedback')]: formContext?.statusIcon,\n [ns.m(`label-${labelPosition.value}`)]: labelPosition.value,\n },\n])\n\nconst _inlineMessage = computed(() =>\n isBoolean(props.inlineMessage)\n ? props.inlineMessage\n : formContext?.inlineMessage || false\n)\n\nconst validateClasses = computed(() => [\n ns.e('error'),\n { [ns.em('error', 'inline')]: _inlineMessage.value },\n])\n\nconst propString = computed(() => {\n if (!props.prop) return ''\n return isArray(props.prop) ? props.prop.join('.') : props.prop\n})\n\nconst hasLabel = computed<boolean>(() => {\n return !!(props.label || slots.label)\n})\n\nconst labelFor = computed<string | undefined>(() => {\n return (\n props.for ?? (inputIds.value.length === 1 ? inputIds.value[0] : undefined)\n )\n})\n\nconst isGroup = computed<boolean>(() => {\n return !labelFor.value && hasLabel.value\n})\n\nconst isNested = !!parentFormItemContext\n\nconst fieldValue = computed(() => {\n const model = formContext?.model\n if (!model || !props.prop) {\n return\n }\n return getProp(model, props.prop).value\n})\n\nconst normalizedRules = computed(() => {\n const { required } = props\n\n const rules: FormItemRule[] = []\n\n if (props.rules) {\n rules.push(...ensureArray(props.rules))\n }\n\n const formRules = formContext?.rules\n if (formRules && props.prop) {\n const _rules = getProp<Arrayable<FormItemRule> | undefined>(\n formRules,\n props.prop\n ).value\n if (_rules) {\n rules.push(...ensureArray(_rules))\n }\n }\n\n if (required !== undefined) {\n const requiredRules = rules\n .map((rule, i) => [rule, i] as const)\n .filter(([rule]) => 'required' in rule)\n\n if (requiredRules.length > 0) {\n for (const [rule, i] of requiredRules) {\n if (rule.required === required) continue\n rules[i] = { ...rule, required }\n }\n } else {\n rules.push({ required })\n }\n }\n\n return rules\n})\n\nconst validateEnabled = computed(() => normalizedRules.value.length > 0)\n\nconst getFilteredRule = (trigger: string) => {\n const rules = normalizedRules.value\n return (\n rules\n .filter((rule) => {\n if (!rule.trigger || !trigger) return true\n if (isArray(rule.trigger)) {\n return rule.trigger.includes(trigger)\n } else {\n return rule.trigger === trigger\n }\n })\n // exclude trigger\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .map(({ trigger, ...rule }): RuleItem => rule)\n )\n}\n\nconst isRequired = computed(() =>\n normalizedRules.value.some((rule) => rule.required)\n)\n\nconst shouldShowError = computed(\n () =>\n validateStateDebounced.value === 'error' &&\n props.showMessage &&\n (formContext?.showMessage ?? true)\n)\n\nconst currentLabel = computed(\n () => `${props.label || ''}${formContext?.labelSuffix || ''}`\n)\n\nconst setValidationState = (state: FormItemValidateState) => {\n validateState.value = state\n}\n\nconst onValidationFailed = (error: FormValidateFailure) => {\n const { errors, fields } = error\n if (!errors || !fields) {\n console.error(error)\n }\n\n setValidationState('error')\n validateMessage.value = errors\n ? (errors?.[0]?.message ?? `${props.prop} is required`)\n : ''\n\n formContext?.emit('validate', props.prop!, false, validateMessage.value)\n}\n\nconst onValidationSucceeded = () => {\n setValidationState('success')\n formContext?.emit('validate', props.prop!, true, '')\n}\n\nconst doValidate = async (rules: RuleItem[]): Promise<true> => {\n const modelName = propString.value\n const validator = new AsyncValidator({\n [modelName]: rules,\n })\n return validator\n .validate({ [modelName]: fieldValue.value }, { firstFields: true })\n .then(() => {\n onValidationSucceeded()\n return true as const\n })\n .catch((err: FormValidateFailure) => {\n onValidationFailed(err)\n return Promise.reject(err)\n })\n}\n\nconst validate: FormItemContext['validate'] = async (trigger, callback) => {\n // skip validation if its resetting\n if (isResettingField || !props.prop) {\n return false\n }\n\n const hasCallback = isFunction(callback)\n if (!validateEnabled.value) {\n callback?.(false)\n return false\n }\n\n const rules = getFilteredRule(trigger)\n if (rules.length === 0) {\n callback?.(true)\n return true\n }\n\n setValidationState('validating')\n\n return doValidate(rules)\n .then(() => {\n callback?.(true)\n return true as const\n })\n .catch((err: FormValidateFailure) => {\n const { fields } = err\n callback?.(false, fields)\n return hasCallback ? false : Promise.reject(fields)\n })\n}\n\nconst clearValidate: FormItemContext['clearValidate'] = () => {\n setValidationState('')\n validateMessage.value = ''\n isResettingField = false\n}\n\nconst resetField: FormItemContext['resetField'] = async () => {\n const model = formContext?.model\n if (!model || !props.prop) return\n\n const computedValue = getProp(model, props.prop)\n\n // prevent validation from being triggered\n isResettingField = true\n\n computedValue.value = cloneDeep(initialValue)\n\n await nextTick()\n clearValidate()\n\n isResettingField = false\n}\n\nconst addInputId: FormItemContext['addInputId'] = (id: string) => {\n if (!inputIds.value.includes(id)) {\n inputIds.value.push(id)\n }\n}\n\nconst removeInputId: FormItemContext['removeInputId'] = (id: string) => {\n inputIds.value = inputIds.value.filter((listId) => listId !== id)\n}\n\nconst setInitialValue: FormItemContext['setInitialValue'] = (value: any) => {\n initialValue = cloneDeep(value)\n}\n\nwatch(\n () => props.error,\n (val) => {\n validateMessage.value = val || ''\n setValidationState(val ? 'error' : '')\n },\n { immediate: true }\n)\n\nwatch(\n () => props.validateStatus,\n (val) => setValidationState(val || '')\n)\n\nconst context: FormItemContext = reactive({\n ...toRefs(props),\n $el: formItemRef,\n size: _size,\n validateMessage,\n validateState,\n labelId,\n inputIds,\n isGroup,\n hasLabel,\n fieldValue,\n addInputId,\n removeInputId,\n resetField,\n clearValidate,\n validate,\n propString,\n setInitialValue,\n})\n\nprovide(formItemContextKey, context)\n\nonMounted(() => {\n if (props.prop) {\n setInitialValue(fieldValue.value)\n formContext?.addField(context)\n }\n})\n\nonBeforeUnmount(() => {\n formContext?.removeField(context)\n})\n\ndefineExpose({\n /**\n * @description Form item size.\n */\n size: _size,\n /**\n * @description Validation message.\n */\n validateMessage,\n /**\n * @description Validation state.\n */\n validateState,\n /**\n * @description Validate form item.\n */\n validate,\n /**\n * @description Remove validation status of the field.\n */\n clearValidate,\n /**\n * @description Reset current field and remove validation result.\n */\n resetField,\n /**\n * @description Set initial value for this field. When `resetField` is called, the field will reset to this value.\n */\n setInitialValue,\n})\n</script>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"form-item2.mjs","names":[],"sources":["../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div\n ref=\"formItemRef\"\n :class=\"formItemClasses\"\n :role=\"isGroup ? 'group' : undefined\"\n :aria-labelledby=\"isGroup ? labelId : undefined\"\n >\n <form-label-wrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"formContext?.labelWidth === 'auto'\"\n >\n <component\n :is=\"labelFor ? 'label' : 'div'\"\n v-if=\"!!(label || $slots.label)\"\n :id=\"labelId\"\n :for=\"labelFor\"\n :class=\"ns.e('label')\"\n :style=\"labelStyle\"\n >\n <slot name=\"label\" :label=\"currentLabel\">\n {{ currentLabel }}\n </slot>\n </component>\n </form-label-wrap>\n\n <div :class=\"ns.e('content')\" :style=\"contentStyle\">\n <slot />\n <transition-group :name=\"`${ns.namespace.value}-zoom-in-top`\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div :class=\"validateClasses\">\n {{ validateMessage }}\n </div>\n </slot>\n </transition-group>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n useSlots,\n watch,\n} from 'vue'\nimport AsyncValidator from 'async-validator'\nimport { refDebounced } from '@vueuse/core'\nimport {\n addUnit,\n ensureArray,\n getProp,\n isArray,\n isBoolean,\n isFunction,\n} from '@element-plus/utils'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport FormLabelWrap from './form-label-wrap'\nimport { formContextKey, formItemContextKey } from './constants'\nimport { cloneDeep } from 'lodash-unified'\n\nimport type { CSSProperties } from 'vue'\nimport type { RuleItem } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type {\n FormItemContext,\n FormItemRule,\n FormValidateFailure,\n} from './types'\nimport type { FormItemProps, FormItemValidateState } from './form-item'\n\ndefineOptions({\n name: 'ElFormItem',\n})\nconst props = withDefaults(defineProps<FormItemProps>(), {\n labelPosition: '',\n showMessage: true,\n required: undefined,\n inlineMessage: undefined,\n})\nconst slots = useSlots()\n\nconst formContext = inject(formContextKey, undefined)\nconst parentFormItemContext = inject(formItemContextKey, undefined)\n\nconst _size = useFormSize(undefined, { formItem: false })\nconst ns = useNamespace('form-item')\n\nconst labelId = useId().value\nconst inputIds = ref<string[]>([])\n\nconst validateState = ref<FormItemValidateState>('')\nconst validateStateDebounced = refDebounced(validateState, 100)\nconst validateMessage = ref('')\nconst formItemRef = ref<HTMLDivElement>()\n// special inline value.\nlet initialValue: any = undefined\nlet isResettingField = false\n\nconst labelPosition = computed(\n () => props.labelPosition || formContext?.labelPosition\n)\n\nconst labelStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top') {\n return {}\n }\n\n const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth)\n return { width: labelWidth }\n})\n\nconst contentStyle = computed<CSSProperties>(() => {\n if (labelPosition.value === 'top' || formContext?.inline) {\n return {}\n }\n if (!props.label && !props.labelWidth && isNested) {\n return {}\n }\n const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth)\n if (!props.label && !slots.label) {\n return { marginLeft: labelWidth }\n }\n return {}\n})\n\nconst formItemClasses = computed(() => [\n ns.b(),\n ns.m(_size.value),\n ns.is('error', validateState.value === 'error'),\n ns.is('validating', validateState.value === 'validating'),\n ns.is('success', validateState.value === 'success'),\n ns.is('required', isRequired.value || props.required),\n ns.is('no-asterisk', formContext?.hideRequiredAsterisk),\n formContext?.requireAsteriskPosition === 'right'\n ? 'asterisk-right'\n : 'asterisk-left',\n {\n [ns.m('feedback')]: formContext?.statusIcon,\n [ns.m(`label-${labelPosition.value}`)]: labelPosition.value,\n },\n])\n\nconst _inlineMessage = computed(() =>\n isBoolean(props.inlineMessage)\n ? props.inlineMessage\n : formContext?.inlineMessage || false\n)\n\nconst validateClasses = computed(() => [\n ns.e('error'),\n { [ns.em('error', 'inline')]: _inlineMessage.value },\n])\n\nconst propString = computed(() => {\n if (!props.prop) return ''\n return isArray(props.prop) ? props.prop.join('.') : props.prop\n})\n\nconst hasLabel = computed<boolean>(() => {\n return !!(props.label || slots.label)\n})\n\nconst labelFor = computed<string | undefined>(() => {\n return (\n props.for ?? (inputIds.value.length === 1 ? inputIds.value[0] : undefined)\n )\n})\n\nconst isGroup = computed<boolean>(() => {\n return !labelFor.value && hasLabel.value\n})\n\nconst isNested = !!parentFormItemContext\n\nconst fieldValue = computed(() => {\n const model = formContext?.model\n if (!model || !props.prop) {\n return\n }\n return getProp(model, props.prop).value\n})\n\nconst normalizedRules = computed(() => {\n const { required } = props\n\n const rules: FormItemRule[] = []\n\n if (props.rules) {\n rules.push(...ensureArray(props.rules))\n }\n\n const formRules = formContext?.rules\n if (formRules && props.prop) {\n const _rules = getProp<Arrayable<FormItemRule> | undefined>(\n formRules,\n props.prop\n ).value\n if (_rules) {\n rules.push(...ensureArray(_rules))\n }\n }\n\n if (required !== undefined) {\n const requiredRules = rules\n .map((rule, i) => [rule, i] as const)\n .filter(([rule]) => 'required' in rule)\n\n if (requiredRules.length > 0) {\n for (const [rule, i] of requiredRules) {\n if (rule.required === required) continue\n rules[i] = { ...rule, required }\n }\n } else {\n rules.push({ required })\n }\n }\n\n return rules\n})\n\nconst validateEnabled = computed(() => normalizedRules.value.length > 0)\n\nconst getFilteredRule = (trigger: string) => {\n const rules = normalizedRules.value\n return (\n rules\n .filter((rule) => {\n if (!rule.trigger || !trigger) return true\n if (isArray(rule.trigger)) {\n return rule.trigger.includes(trigger)\n } else {\n return rule.trigger === trigger\n }\n })\n // exclude trigger\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .map(({ trigger, ...rule }): RuleItem => rule)\n )\n}\n\nconst isRequired = computed(() =>\n normalizedRules.value.some((rule) => rule.required)\n)\n\nconst shouldShowError = computed(\n () =>\n validateStateDebounced.value === 'error' &&\n props.showMessage &&\n (formContext?.showMessage ?? true)\n)\n\nconst currentLabel = computed(\n () => `${props.label || ''}${formContext?.labelSuffix || ''}`\n)\n\nconst setValidationState = (state: FormItemValidateState) => {\n validateState.value = state\n}\n\nconst onValidationFailed = (error: FormValidateFailure) => {\n const { errors, fields } = error\n if (!errors || !fields) {\n console.error(error)\n }\n\n setValidationState('error')\n validateMessage.value = errors\n ? (errors?.[0]?.message ?? `${props.prop} is required`)\n : ''\n\n formContext?.emit('validate', props.prop!, false, validateMessage.value)\n}\n\nconst onValidationSucceeded = () => {\n setValidationState('success')\n formContext?.emit('validate', props.prop!, true, '')\n}\n\nconst doValidate = async (rules: RuleItem[]): Promise<true> => {\n const modelName = propString.value\n const validator = new AsyncValidator({\n [modelName]: rules,\n })\n return validator\n .validate({ [modelName]: fieldValue.value }, { firstFields: true })\n .then(() => {\n onValidationSucceeded()\n return true as const\n })\n .catch((err: FormValidateFailure) => {\n onValidationFailed(err)\n return Promise.reject(err)\n })\n}\n\nconst validate: FormItemContext['validate'] = async (trigger, callback) => {\n // skip validation if its resetting\n if (isResettingField || !props.prop) {\n return false\n }\n\n const hasCallback = isFunction(callback)\n if (!validateEnabled.value) {\n callback?.(false)\n return false\n }\n\n const rules = getFilteredRule(trigger)\n if (rules.length === 0) {\n callback?.(true)\n return true\n }\n\n setValidationState('validating')\n\n return doValidate(rules)\n .then(() => {\n callback?.(true)\n return true as const\n })\n .catch((err: FormValidateFailure) => {\n const { fields } = err\n callback?.(false, fields)\n return hasCallback ? false : Promise.reject(fields)\n })\n}\n\nconst clearValidate: FormItemContext['clearValidate'] = () => {\n setValidationState('')\n validateMessage.value = ''\n isResettingField = false\n}\n\nconst resetField: FormItemContext['resetField'] = async () => {\n const model = formContext?.model\n if (!model || !props.prop) return\n\n const computedValue = getProp(model, props.prop)\n\n // prevent validation from being triggered\n isResettingField = true\n\n computedValue.value = cloneDeep(initialValue)\n\n await nextTick()\n clearValidate()\n\n isResettingField = false\n}\n\nconst addInputId: FormItemContext['addInputId'] = (id: string) => {\n if (!inputIds.value.includes(id)) {\n inputIds.value.push(id)\n }\n}\n\nconst removeInputId: FormItemContext['removeInputId'] = (id: string) => {\n inputIds.value = inputIds.value.filter((listId) => listId !== id)\n}\n\nconst setInitialValue: FormItemContext['setInitialValue'] = (value: any) => {\n initialValue = cloneDeep(value)\n}\n\nconst getInitialValue: FormItemContext['getInitialValue'] = () => initialValue\n\nwatch(\n () => props.error,\n (val) => {\n validateMessage.value = val || ''\n setValidationState(val ? 'error' : '')\n },\n { immediate: true }\n)\n\nwatch(\n () => props.validateStatus,\n (val) => setValidationState(val || '')\n)\n\nconst context: FormItemContext = reactive({\n ...toRefs(props),\n $el: formItemRef,\n size: _size,\n validateMessage,\n validateState,\n labelId,\n inputIds,\n isGroup,\n hasLabel,\n fieldValue,\n addInputId,\n removeInputId,\n resetField,\n clearValidate,\n validate,\n propString,\n setInitialValue,\n getInitialValue,\n})\n\nprovide(formItemContextKey, context)\n\nwatch(propString, (newPropString, oldPropString) => {\n if (!formContext || !oldPropString) return\n formContext.removeField(context, oldPropString)\n if (newPropString) {\n setInitialValue(fieldValue.value)\n formContext.addField(context)\n }\n})\n\nonMounted(() => {\n if (props.prop) {\n setInitialValue(fieldValue.value)\n formContext?.addField(context)\n }\n})\n\nonBeforeUnmount(() => {\n formContext?.removeField(context)\n})\n\ndefineExpose({\n /**\n * @description Form item size.\n */\n size: _size,\n /**\n * @description Validation message.\n */\n validateMessage,\n /**\n * @description Validation state.\n */\n validateState,\n /**\n * @description Validate form item.\n */\n validate,\n /**\n * @description Remove validation status of the field.\n */\n clearValidate,\n /**\n * @description Reset current field and remove validation result.\n */\n resetField,\n /**\n * @description Set initial value for this field. When `resetField` is called, the field will reset to this value.\n */\n setInitialValue,\n})\n</script>\n"],"mappings":""}
|
|
@@ -99,8 +99,8 @@ declare const formProps: {
|
|
|
99
99
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
100
100
|
__epPropKey: true;
|
|
101
101
|
};
|
|
102
|
-
readonly labelPosition: EpPropFinalized<StringConstructor, "
|
|
103
|
-
readonly requireAsteriskPosition: EpPropFinalized<StringConstructor, "
|
|
102
|
+
readonly labelPosition: EpPropFinalized<StringConstructor, "right" | "left" | "top", unknown, "right", boolean>;
|
|
103
|
+
readonly requireAsteriskPosition: EpPropFinalized<StringConstructor, "right" | "left", unknown, "left", boolean>;
|
|
104
104
|
readonly labelWidth: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
105
105
|
readonly labelSuffix: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
106
106
|
readonly inline: BooleanConstructor;
|
|
@@ -48,13 +48,13 @@ declare const __VLS_base: vue.DefineComponent<FormProps, {
|
|
|
48
48
|
}, string, vue.PublicProps, Readonly<FormProps> & Readonly<{
|
|
49
49
|
onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
|
|
50
50
|
}>, {
|
|
51
|
+
scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
|
|
51
52
|
labelWidth: string | number;
|
|
52
53
|
labelPosition: "left" | "right" | "top";
|
|
53
54
|
requireAsteriskPosition: "left" | "right";
|
|
54
55
|
labelSuffix: string;
|
|
55
56
|
showMessage: boolean;
|
|
56
57
|
validateOnRuleChange: boolean;
|
|
57
|
-
scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
|
|
58
58
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
59
59
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
60
60
|
declare const _default: typeof __VLS_export;
|
|
@@ -40,12 +40,20 @@ var form_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
40
40
|
return filterFields(fields, [prop])[0];
|
|
41
41
|
};
|
|
42
42
|
const addField = (field) => {
|
|
43
|
-
fields.push(field);
|
|
43
|
+
if (!fields.includes(field)) fields.push(field);
|
|
44
44
|
if (field.propString) if (initialValues.has(field.propString)) field.setInitialValue(initialValues.get(field.propString));
|
|
45
45
|
else initialValues.set(field.propString, cloneDeep(field.fieldValue));
|
|
46
46
|
};
|
|
47
|
-
const removeField = (field) => {
|
|
48
|
-
if (
|
|
47
|
+
const removeField = (field, oldPropString) => {
|
|
48
|
+
if (oldPropString) {
|
|
49
|
+
initialValues.delete(oldPropString);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const idx = fields.indexOf(field);
|
|
53
|
+
if (idx > -1) {
|
|
54
|
+
fields.splice(idx, 1);
|
|
55
|
+
if (field.propString) initialValues.set(field.propString, cloneDeep(field.getInitialValue()));
|
|
56
|
+
}
|
|
49
57
|
};
|
|
50
58
|
const setInitialValues = (initModel) => {
|
|
51
59
|
if (!props.model) {
|