@element-plus/nightly 0.0.20260521 → 0.0.20260522
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 +7 -4
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +3 -3
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +7 -4
- 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 +4 -4
- package/es/components/alert/src/alert.d.ts +2 -2
- package/es/components/anchor/src/anchor.d.ts +1 -1
- package/es/components/anchor/src/anchor.vue.d.ts +1 -1
- package/es/components/autocomplete/src/autocomplete.d.ts +5 -5
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +6 -6
- package/es/components/avatar/src/avatar-group-props.d.ts +1 -1
- package/es/components/avatar/src/avatar-group.d.ts +2 -2
- package/es/components/avatar/src/avatar.d.ts +2 -2
- package/es/components/backtop/src/backtop.vue.d.ts +2 -2
- package/es/components/badge/src/badge.vue.d.ts +1 -1
- package/es/components/button/src/button-group.d.ts +2 -2
- package/es/components/button/src/button-group.vue.d.ts +1 -1
- package/es/components/button/src/button.d.ts +2 -2
- package/es/components/button/src/button.vue.d.ts +3 -3
- package/es/components/button/src/use-button.d.ts +2 -2
- package/es/components/calendar/src/calendar.vue.d.ts +1 -1
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel-item.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.d.ts +1 -1
- package/es/components/carousel/src/carousel.vue.d.ts +2 -2
- package/es/components/cascader/src/cascader.d.ts +4 -4
- package/es/components/cascader/src/cascader.vue.d.ts +13 -13
- package/es/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/es/components/cascader-panel/src/menu.vue.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
- package/es/components/checkbox/src/checkbox-group.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
- package/es/components/checkbox/src/checkbox.d.ts +9 -9
- package/es/components/checkbox/src/checkbox.vue.d.ts +5 -5
- package/es/components/checkbox/src/composables/use-checkbox-status.d.ts +2 -2
- package/es/components/checkbox/src/composables/use-checkbox.d.ts +2 -2
- package/es/components/col/src/col.vue.d.ts +2 -2
- package/es/components/collapse/src/collapse-item.vue.d.ts +1 -1
- package/es/components/collapse/src/collapse.vue.d.ts +1 -1
- package/es/components/color-picker/src/color-picker.d.ts +1 -1
- package/es/components/color-picker/src/color-picker.vue.d.ts +8 -8
- package/es/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/es/components/config-provider/src/config-provider-props.d.ts +1 -1
- package/es/components/config-provider/src/config-provider.d.ts +2 -2
- package/es/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/es/components/date-picker/src/date-picker.d.ts +7 -7
- package/es/components/date-picker/src/props.d.ts +2 -2
- package/es/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-month-range.vue.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-com/panel-year-range.vue.d.ts +1 -1
- package/es/components/date-picker-panel/src/date-picker-panel.d.ts +4 -4
- package/es/components/date-picker-panel/src/panel-utils.d.ts +9 -9
- package/es/components/descriptions/src/description-item.d.ts +12 -12
- package/es/components/descriptions/src/description.d.ts +1 -1
- package/es/components/descriptions/src/description.vue.d.ts +2 -2
- package/es/components/dialog/src/dialog.vue.d.ts +7 -7
- package/es/components/divider/src/divider.vue.d.ts +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +8 -8
- package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/src/dropdown-item.vue.d.ts +3 -3
- package/es/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.d.ts +4 -4
- package/es/components/dropdown/src/dropdown.vue.d.ts +53 -53
- package/es/components/form/src/form-item.d.ts +3 -3
- package/es/components/form/src/form-item.vue.d.ts +2 -2
- package/es/components/form/src/form.d.ts +3 -3
- package/es/components/form/src/hooks/use-form-common-props.d.ts +2 -2
- package/es/components/image/src/image.d.ts +1 -1
- package/es/components/image/src/image.vue.d.ts +8 -8
- package/es/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/es/components/input/src/input.d.ts +4 -4
- package/es/components/input/src/input.vue.d.ts +17 -17
- package/es/components/input-number/src/input-number.d.ts +2 -2
- package/es/components/input-number/src/input-number.vue.d.ts +7 -7
- package/es/components/input-otp/src/input-otp.vue.d.ts +7 -7
- package/es/components/input-tag/src/composables/use-input-tag.d.ts +1 -1
- package/es/components/input-tag/src/input-tag.d.ts +3 -3
- package/es/components/input-tag/src/input-tag.vue.d.ts +9 -9
- package/es/components/link/src/link.vue.d.ts +1 -1
- package/es/components/mention/src/mention.d.ts +5 -5
- package/es/components/mention/src/mention.vue.d.ts +5 -5
- package/es/components/menu/src/menu.d.ts +7 -7
- package/es/components/menu/src/sub-menu.d.ts +1 -1
- package/es/components/message/src/instance.d.ts +1 -1
- package/es/components/message/src/message.d.ts +2 -2
- package/es/components/message/src/message.vue.d.ts +4 -4
- package/es/components/message-box/src/index.mjs +5 -2
- package/es/components/message-box/src/index.mjs.map +1 -1
- package/es/components/message-box/src/index.vue.d.ts +60 -60
- package/es/components/message-box/src/index.vue_vue_type_script_lang.mjs.map +1 -1
- package/es/components/notification/src/notification.d.ts +1 -1
- package/es/components/notification/src/notification.vue.d.ts +3 -3
- package/es/components/pagination/src/components/jumper.d.ts +1 -1
- package/es/components/pagination/src/components/jumper.vue.d.ts +2 -2
- package/es/components/pagination/src/components/sizes.d.ts +1 -1
- package/es/components/pagination/src/components/sizes.vue.d.ts +3 -3
- package/es/components/pagination/src/pagination.d.ts +6 -6
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +4 -4
- package/es/components/popover/src/popover.d.ts +2 -2
- package/es/components/popover/src/popover.vue.d.ts +4 -4
- package/es/components/popper/src/composables/use-content.d.ts +2 -2
- package/es/components/popper/src/content.d.ts +4 -4
- package/es/components/popper/src/content.vue.d.ts +7 -7
- package/es/components/popper/src/popper.d.ts +2 -2
- package/es/components/progress/src/progress.vue.d.ts +1 -1
- package/es/components/radio/src/radio-button.d.ts +4 -4
- package/es/components/radio/src/radio-button.vue.d.ts +2 -2
- package/es/components/radio/src/radio-group.d.ts +1 -1
- package/es/components/radio/src/radio-group.vue.d.ts +5 -5
- package/es/components/radio/src/radio.d.ts +8 -8
- package/es/components/radio/src/radio.vue.d.ts +4 -4
- package/es/components/radio/src/use-radio.d.ts +1 -1
- package/es/components/rate/src/rate.d.ts +1 -1
- package/es/components/rate/src/rate.vue.d.ts +1 -1
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/result/src/result.vue.d.ts +1 -1
- package/es/components/row/src/row.d.ts +2 -2
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/es/components/segmented/index.d.ts +3 -3
- package/es/components/segmented/src/segmented.d.ts +2 -2
- package/es/components/segmented/src/segmented.vue.d.ts +1 -1
- package/es/components/select/src/option.d.ts +2 -2
- package/es/components/select/src/option.vue.d.ts +5 -5
- package/es/components/select/src/select.d.ts +5 -5
- package/es/components/select/src/select.vue.d.ts +65 -65
- package/es/components/select/src/useOption.d.ts +2 -2
- package/es/components/select/src/useSelect.d.ts +6 -6
- package/es/components/select-v2/src/defaults.d.ts +3 -3
- package/es/components/select-v2/src/select.vue.d.ts +49 -49
- package/es/components/select-v2/src/useSelect.d.ts +2 -2
- package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/slider.d.ts +2 -2
- package/es/components/slider/src/slider.vue.d.ts +8 -8
- package/es/components/space/src/space.d.ts +5 -5
- package/es/components/splitter/src/splitter.vue.d.ts +2 -2
- package/es/components/steps/src/item.d.ts +1 -1
- package/es/components/steps/src/item.vue.d.ts +1 -1
- package/es/components/steps/src/steps.d.ts +2 -2
- package/es/components/steps/src/steps.vue.d.ts +1 -1
- package/es/components/switch/src/switch.d.ts +1 -1
- package/es/components/switch/src/switch.vue.d.ts +4 -4
- package/es/components/table/src/filter-panel.vue.d.ts +52 -52
- package/es/components/table/src/store/helper.d.ts +1 -1
- package/es/components/table/src/store/index.d.ts +2 -2
- package/es/components/table/src/table/defaults.d.ts +6 -6
- package/es/components/table/src/table/style-helper.d.ts +2 -2
- package/es/components/table/src/table-column/defaults.d.ts +2 -2
- package/es/components/table/src/table-header/index.d.ts +15 -15
- package/es/components/table/src/table.vue.d.ts +5 -5
- package/es/components/table-v2/src/components/header.d.ts +1 -1
- package/es/components/table-v2/src/components/row.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +2 -2
- package/es/components/table-v2/src/table-v2.d.ts +4 -4
- package/es/components/tabs/src/tab-nav.d.ts +1 -1
- package/es/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +6 -6
- package/es/components/tag/src/tag.d.ts +2 -2
- package/es/components/tag/src/tag.vue.d.ts +2 -2
- package/es/components/text/src/text.d.ts +1 -1
- package/es/components/text/src/text.vue.d.ts +1 -1
- package/es/components/time-picker/src/common/picker-range-trigger.vue.d.ts +6 -6
- package/es/components/time-picker/src/common/picker.vue.d.ts +13 -13
- package/es/components/time-picker/src/common/props.d.ts +2 -2
- package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +2 -2
- package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -2
- package/es/components/time-picker/src/time-picker.d.ts +7 -7
- package/es/components/time-select/src/time-select.d.ts +1 -1
- package/es/components/time-select/src/time-select.vue.d.ts +9 -9
- 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.d.ts +1 -1
- package/es/components/tooltip/src/content.vue.d.ts +5 -5
- package/es/components/tooltip/src/tooltip.d.ts +3 -3
- package/es/components/tooltip/src/tooltip.vue.d.ts +8 -8
- package/es/components/tooltip/src/trigger.d.ts +1 -1
- package/es/components/tour/src/content.d.ts +2 -2
- package/es/components/tour/src/mask.vue.d.ts +1 -1
- package/es/components/tour/src/step.d.ts +1 -1
- package/es/components/tour/src/tour.d.ts +1 -1
- package/es/components/tour/src/tour.vue.d.ts +3 -3
- package/es/components/transfer/src/transfer.vue.d.ts +1 -1
- package/es/components/tree/src/tree-node.vue.d.ts +16 -16
- package/es/components/tree/src/tree.vue.d.ts +24 -24
- package/es/components/tree-select/src/tree-select-option.d.ts +5 -5
- package/es/components/tree-select/src/tree-select.vue.d.ts +25 -25
- package/es/components/tree-v2/src/composables/useTree.d.ts +10 -10
- package/es/components/tree-v2/src/tree-node.vue.d.ts +3 -3
- package/es/components/tree-v2/src/tree.vue.d.ts +9 -9
- package/es/components/upload/src/upload-content.vue.d.ts +2 -2
- package/es/components/upload/src/upload.vue.d.ts +3 -3
- package/es/components/virtual-list/src/builders/build-grid.d.ts +5 -5
- package/es/components/virtual-list/src/builders/build-list.d.ts +5 -5
- package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +5 -5
- package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +5 -5
- package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +5 -5
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +5 -5
- package/es/components/virtual-list/src/components/scrollbar.d.ts +1 -1
- package/es/components/watermark/src/watermark.vue.d.ts +2 -2
- package/es/hooks/use-floating/index.d.ts +8 -8
- package/es/hooks/use-popper/index.d.ts +2 -2
- package/es/hooks/use-size/index.d.ts +3 -3
- package/es/utils/vue/vnode.d.ts +4 -4
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/src/affix.d.ts +1 -1
- package/lib/components/affix/src/affix.vue.d.ts +4 -4
- package/lib/components/alert/src/alert.d.ts +2 -2
- package/lib/components/anchor/src/anchor.d.ts +1 -1
- package/lib/components/anchor/src/anchor.vue.d.ts +1 -1
- package/lib/components/autocomplete/src/autocomplete.d.ts +5 -5
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +6 -6
- package/lib/components/avatar/src/avatar-group-props.d.ts +1 -1
- package/lib/components/avatar/src/avatar-group.d.ts +2 -2
- package/lib/components/avatar/src/avatar.d.ts +2 -2
- package/lib/components/backtop/src/backtop.vue.d.ts +2 -2
- package/lib/components/badge/src/badge.vue.d.ts +1 -1
- package/lib/components/button/src/button-group.d.ts +2 -2
- package/lib/components/button/src/button-group.vue.d.ts +1 -1
- package/lib/components/button/src/button.d.ts +2 -2
- package/lib/components/button/src/button.vue.d.ts +3 -3
- package/lib/components/button/src/use-button.d.ts +2 -2
- package/lib/components/calendar/src/calendar.vue.d.ts +1 -1
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel-item.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.d.ts +1 -1
- package/lib/components/carousel/src/carousel.vue.d.ts +2 -2
- package/lib/components/cascader/src/cascader.d.ts +4 -4
- package/lib/components/cascader/src/cascader.vue.d.ts +13 -13
- package/lib/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/lib/components/cascader-panel/src/menu.vue.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
- package/lib/components/checkbox/src/checkbox-group.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
- package/lib/components/checkbox/src/checkbox.d.ts +9 -9
- package/lib/components/checkbox/src/checkbox.vue.d.ts +5 -5
- package/lib/components/checkbox/src/composables/use-checkbox-status.d.ts +2 -2
- package/lib/components/checkbox/src/composables/use-checkbox.d.ts +2 -2
- package/lib/components/col/src/col.vue.d.ts +2 -2
- package/lib/components/collapse/src/collapse-item.vue.d.ts +1 -1
- package/lib/components/collapse/src/collapse.vue.d.ts +1 -1
- package/lib/components/color-picker/src/color-picker.d.ts +1 -1
- package/lib/components/color-picker/src/color-picker.vue.d.ts +8 -8
- package/lib/components/color-picker-panel/src/color-picker-panel.vue.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider-props.d.ts +1 -1
- package/lib/components/config-provider/src/config-provider.d.ts +2 -2
- package/lib/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/lib/components/date-picker/src/date-picker.d.ts +7 -7
- package/lib/components/date-picker/src/props.d.ts +2 -2
- package/lib/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-month-range.vue.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-com/panel-year-range.vue.d.ts +1 -1
- package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +4 -4
- package/lib/components/date-picker-panel/src/panel-utils.d.ts +9 -9
- package/lib/components/descriptions/src/description-item.d.ts +12 -12
- package/lib/components/descriptions/src/description.d.ts +1 -1
- package/lib/components/descriptions/src/description.vue.d.ts +2 -2
- package/lib/components/dialog/src/dialog.vue.d.ts +7 -7
- package/lib/components/divider/src/divider.vue.d.ts +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +8 -8
- package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown-item.vue.d.ts +3 -3
- package/lib/components/dropdown/src/dropdown-menu.vue.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.d.ts +4 -4
- package/lib/components/dropdown/src/dropdown.vue.d.ts +53 -53
- package/lib/components/form/src/form-item.d.ts +3 -3
- package/lib/components/form/src/form-item.vue.d.ts +2 -2
- package/lib/components/form/src/form.d.ts +3 -3
- package/lib/components/form/src/hooks/use-form-common-props.d.ts +2 -2
- package/lib/components/image/src/image.d.ts +1 -1
- package/lib/components/image/src/image.vue.d.ts +8 -8
- package/lib/components/image-viewer/src/image-viewer.vue.d.ts +4 -4
- package/lib/components/input/src/input.d.ts +4 -4
- package/lib/components/input/src/input.vue.d.ts +17 -17
- package/lib/components/input-number/src/input-number.d.ts +2 -2
- package/lib/components/input-number/src/input-number.vue.d.ts +7 -7
- package/lib/components/input-otp/src/input-otp.vue.d.ts +7 -7
- package/lib/components/input-tag/src/composables/use-input-tag.d.ts +1 -1
- package/lib/components/input-tag/src/input-tag.d.ts +3 -3
- package/lib/components/input-tag/src/input-tag.vue.d.ts +9 -9
- package/lib/components/link/src/link.vue.d.ts +1 -1
- package/lib/components/mention/src/mention.d.ts +5 -5
- package/lib/components/mention/src/mention.vue.d.ts +5 -5
- package/lib/components/menu/src/menu.d.ts +7 -7
- package/lib/components/menu/src/sub-menu.d.ts +1 -1
- package/lib/components/message/src/instance.d.ts +1 -1
- package/lib/components/message/src/message.d.ts +2 -2
- package/lib/components/message/src/message.vue.d.ts +4 -4
- package/lib/components/message-box/src/index.js +5 -2
- package/lib/components/message-box/src/index.js.map +1 -1
- package/lib/components/message-box/src/index.vue.d.ts +60 -60
- package/lib/components/message-box/src/index.vue_vue_type_script_lang.js.map +1 -1
- package/lib/components/notification/src/notification.d.ts +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +3 -3
- package/lib/components/pagination/src/components/jumper.d.ts +1 -1
- package/lib/components/pagination/src/components/jumper.vue.d.ts +2 -2
- package/lib/components/pagination/src/components/sizes.d.ts +1 -1
- package/lib/components/pagination/src/components/sizes.vue.d.ts +3 -3
- package/lib/components/pagination/src/pagination.d.ts +6 -6
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +4 -4
- package/lib/components/popover/src/popover.d.ts +2 -2
- package/lib/components/popover/src/popover.vue.d.ts +4 -4
- package/lib/components/popper/src/composables/use-content.d.ts +2 -2
- package/lib/components/popper/src/content.d.ts +4 -4
- package/lib/components/popper/src/content.vue.d.ts +7 -7
- package/lib/components/popper/src/popper.d.ts +2 -2
- package/lib/components/progress/src/progress.vue.d.ts +1 -1
- package/lib/components/radio/src/radio-button.d.ts +4 -4
- package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
- package/lib/components/radio/src/radio-group.d.ts +1 -1
- package/lib/components/radio/src/radio-group.vue.d.ts +5 -5
- package/lib/components/radio/src/radio.d.ts +8 -8
- package/lib/components/radio/src/radio.vue.d.ts +4 -4
- package/lib/components/radio/src/use-radio.d.ts +1 -1
- package/lib/components/rate/src/rate.d.ts +1 -1
- package/lib/components/rate/src/rate.vue.d.ts +1 -1
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/result/src/result.vue.d.ts +1 -1
- package/lib/components/row/src/row.d.ts +2 -2
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +3 -3
- package/lib/components/segmented/src/segmented.d.ts +2 -2
- package/lib/components/segmented/src/segmented.vue.d.ts +1 -1
- package/lib/components/select/src/option.d.ts +2 -2
- package/lib/components/select/src/option.vue.d.ts +5 -5
- package/lib/components/select/src/select.d.ts +5 -5
- package/lib/components/select/src/select.vue.d.ts +65 -65
- package/lib/components/select/src/useOption.d.ts +2 -2
- package/lib/components/select/src/useSelect.d.ts +6 -6
- package/lib/components/select-v2/src/defaults.d.ts +3 -3
- package/lib/components/select-v2/src/select.vue.d.ts +49 -49
- package/lib/components/select-v2/src/useSelect.d.ts +2 -2
- package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.d.ts +2 -2
- package/lib/components/slider/src/slider.vue.d.ts +8 -8
- package/lib/components/space/src/space.d.ts +5 -5
- package/lib/components/splitter/src/splitter.vue.d.ts +2 -2
- package/lib/components/steps/src/item.d.ts +1 -1
- package/lib/components/steps/src/item.vue.d.ts +1 -1
- package/lib/components/steps/src/steps.d.ts +2 -2
- package/lib/components/steps/src/steps.vue.d.ts +1 -1
- package/lib/components/switch/src/switch.d.ts +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +4 -4
- package/lib/components/table/src/filter-panel.vue.d.ts +52 -52
- package/lib/components/table/src/store/helper.d.ts +1 -1
- package/lib/components/table/src/store/index.d.ts +2 -2
- package/lib/components/table/src/table/defaults.d.ts +6 -6
- package/lib/components/table/src/table/style-helper.d.ts +2 -2
- package/lib/components/table/src/table-column/defaults.d.ts +2 -2
- package/lib/components/table/src/table-header/index.d.ts +15 -15
- package/lib/components/table/src/table.vue.d.ts +5 -5
- package/lib/components/table-v2/src/components/header.d.ts +1 -1
- package/lib/components/table-v2/src/components/row.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +2 -2
- package/lib/components/table-v2/src/table-v2.d.ts +4 -4
- package/lib/components/tabs/src/tab-nav.d.ts +1 -1
- package/lib/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +6 -6
- package/lib/components/tag/src/tag.d.ts +2 -2
- package/lib/components/tag/src/tag.vue.d.ts +2 -2
- package/lib/components/text/src/text.d.ts +1 -1
- package/lib/components/text/src/text.vue.d.ts +1 -1
- package/lib/components/time-picker/src/common/picker-range-trigger.vue.d.ts +6 -6
- package/lib/components/time-picker/src/common/picker.vue.d.ts +13 -13
- package/lib/components/time-picker/src/common/props.d.ts +2 -2
- package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +2 -2
- package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -2
- package/lib/components/time-picker/src/time-picker.d.ts +7 -7
- package/lib/components/time-select/src/time-select.d.ts +1 -1
- package/lib/components/time-select/src/time-select.vue.d.ts +9 -9
- 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.d.ts +1 -1
- package/lib/components/tooltip/src/content.vue.d.ts +5 -5
- package/lib/components/tooltip/src/tooltip.d.ts +3 -3
- package/lib/components/tooltip/src/tooltip.vue.d.ts +8 -8
- package/lib/components/tooltip/src/trigger.d.ts +1 -1
- package/lib/components/tour/src/content.d.ts +2 -2
- package/lib/components/tour/src/mask.vue.d.ts +1 -1
- package/lib/components/tour/src/step.d.ts +1 -1
- package/lib/components/tour/src/tour.d.ts +1 -1
- package/lib/components/tour/src/tour.vue.d.ts +3 -3
- package/lib/components/transfer/src/transfer.vue.d.ts +1 -1
- package/lib/components/tree/src/tree-node.vue.d.ts +16 -16
- package/lib/components/tree/src/tree.vue.d.ts +24 -24
- package/lib/components/tree-select/src/tree-select-option.d.ts +5 -5
- package/lib/components/tree-select/src/tree-select.vue.d.ts +25 -25
- package/lib/components/tree-v2/src/composables/useTree.d.ts +10 -10
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +3 -3
- package/lib/components/tree-v2/src/tree.vue.d.ts +9 -9
- package/lib/components/upload/src/upload-content.vue.d.ts +2 -2
- package/lib/components/upload/src/upload.vue.d.ts +3 -3
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +5 -5
- package/lib/components/virtual-list/src/builders/build-list.d.ts +5 -5
- package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +5 -5
- package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +5 -5
- package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +5 -5
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +5 -5
- package/lib/components/virtual-list/src/components/scrollbar.d.ts +1 -1
- package/lib/components/watermark/src/watermark.vue.d.ts +2 -2
- package/lib/hooks/use-floating/index.d.ts +8 -8
- package/lib/hooks/use-popper/index.d.ts +2 -2
- package/lib/hooks/use-size/index.d.ts +3 -3
- package/lib/utils/vue/vnode.d.ts +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"[ns.is('message-box'), modalClass]\"\n :mask=\"modal\"\n >\n <div\n role=\"dialog\"\n :aria-label=\"title\"\n aria-modal=\"true\"\n :aria-describedby=\"!showInput ? contentId : undefined\"\n :class=\"`${ns.namespace.value}-overlay-message-box`\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"rootRef\"\n :focus-start-el=\"focusStartRef\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"rootRef\"\n :class=\"[\n ns.b(),\n customClass,\n ns.is('draggable', draggable),\n ns.is('dragging', isDragging),\n { [ns.m('center')]: center },\n ]\"\n :style=\"customStyle\"\n tabindex=\"-1\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n :class=\"[ns.e('header'), { 'show-close': showClose }]\"\n >\n <div :class=\"ns.e('title')\">\n <el-icon\n v-if=\"iconComponent && center\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n :class=\"ns.e('headerbtn')\"\n :aria-label=\"t('el.messagebox.close')\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || 'close'\" />\n </el-icon>\n </button>\n </div>\n <div :id=\"contentId\" :class=\"ns.e('content')\">\n <div :class=\"ns.e('container')\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" :class=\"ns.e('message')\">\n <slot>\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-if=\"!dangerouslyUseHTMLString\"\n :for=\"showInput ? inputId : undefined\"\n v-text=\"message\"\n />\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-else\n :for=\"showInput ? inputId : undefined\"\n v-html=\"message\"\n />\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" :class=\"ns.e('input')\">\n <el-input\n :id=\"inputId\"\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :aria-invalid=\"validateError\"\n :class=\"{ invalid: validateError }\"\n @keydown.enter=\"handleInputEnter\"\n />\n <div\n :class=\"ns.e('errormsg')\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div :class=\"ns.e('btns')\">\n <el-button\n v-if=\"showCancelButton\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n :loading=\"cancelButtonLoading\"\n :loading-icon=\"cancelButtonLoadingIcon\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n :loading=\"confirmButtonLoading\"\n :loading-icon=\"confirmButtonLoadingIcon\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n toRefs,\n watch,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useDraggable,\n useId,\n useLockscreen,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport {\n TypeComponents,\n TypeComponentsMap,\n isFunction,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Loading } from '@element-plus/icons-vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\nimport type { InputInstance } from '@element-plus/components/input'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\n ElFocusTrap,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents,\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n closeOnHashChange: {\n type: Boolean,\n default: true,\n },\n center: Boolean,\n draggable: Boolean,\n overflow: Boolean,\n roundButton: Boolean,\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n // const popup = usePopup(props, doClose)\n const {\n locale,\n zIndex,\n ns,\n size: btnSize,\n } = useGlobalComponentSettings(\n 'message-box',\n computed(() => props.buttonSize)\n )\n\n const { t } = locale\n const { nextZIndex } = zIndex\n\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n // autofocus element when open message-box\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n cancelButtonType: '',\n confirmButtonType: 'primary',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n closeIcon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: '',\n inputValidator: undefined,\n inputErrorMessage: '',\n message: '',\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n })\n\n const contentId = useId()\n const inputId = useId()\n\n const iconComponent = computed(() => {\n const type = state.type\n return state.icon || (type && TypeComponentsMap[type]) || ''\n })\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const focusStartRef = ref<HTMLElement>()\n const inputRef = ref<InputInstance>()\n const confirmRef = ref<ComponentPublicInstance>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType !== 'prompt') {\n if (state.autofocus) {\n focusStartRef.value = confirmRef.value?.$el ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n state.zIndex = nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n if (state.autofocus) {\n focusStartRef.value = getInputElement() ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n const overflow = computed(() => props.overflow)\n const { isDragging } = useDraggable(rootRef, headerRef, draggable, overflow)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n window.addEventListener('hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n window.removeEventListener('hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick)\n\n const handleInputEnter = (e: KeyboardEvent | Event) => {\n if (state.inputType !== 'textarea' && !inputRef.value?.isComposing) {\n e.preventDefault()\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (isFunction(inputValidator)) {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (isString(validateResult)) {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value?.$refs\n return (inputRefs?.input ?? inputRefs?.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event like this\n // to dispatch, it could callout another message box.\n const onCloseRequested = () => {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible, { ns })\n }\n\n return {\n ...toRefs(state),\n ns,\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n contentId,\n inputId,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n focusStartRef,\n headerRef,\n inputRef,\n isDragging,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n onCloseRequested,\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;mDAuJe,IAAA,YAAA;EAtJD,MAAK;EAAkB,cAAW,OAAA,QAAA,OAAA,OAAA,WAAE,KAAA,MAAK,SAAA;EAArD,WAAA;;kCAqJe,EAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,aAAA,uBAAA;GAlJV,WAAS,KAAA;GACT,iBAAa,CAAG,KAAA,GAAG,GAAE,cAAA,EAAiB,KAAA,WAAU;GAChD,MAAM,KAAA;;mCA+ID,EAAA,GAAA,IAAA,oBAAA,OAAA;IA5IJ,MAAK;IACJ,cAAY,KAAA;IACb,cAAW;IACV,oBAAgB,CAAG,KAAA,YAAY,KAAA,YAAY,KAAA;IAC3C,QAAA,GAAA,IAAA,gBAAK,GAAK,KAAA,GAAG,UAAU,MAAK,sBAAA;IAC5B,SAAK,OAAA,OAAA,OAAA,MAAA,GAAA,SAAE,KAAA,aAAa,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A,EAAA,EAAA;;;;;;;;;;;;;;mBAhI3B,KAAA,QAAO,CAAA,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"[ns.is('message-box'), modalClass]\"\n :mask=\"modal\"\n >\n <div\n role=\"dialog\"\n :aria-label=\"title\"\n aria-modal=\"true\"\n :aria-describedby=\"!showInput ? contentId : undefined\"\n :class=\"`${ns.namespace.value}-overlay-message-box`\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"rootRef\"\n :focus-start-el=\"focusStartRef\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"rootRef\"\n :class=\"[\n ns.b(),\n customClass,\n ns.is('draggable', draggable),\n ns.is('dragging', isDragging),\n { [ns.m('center')]: center },\n ]\"\n :style=\"customStyle\"\n tabindex=\"-1\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n :class=\"[ns.e('header'), { 'show-close': showClose }]\"\n >\n <div :class=\"ns.e('title')\">\n <el-icon\n v-if=\"iconComponent && center\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n :class=\"ns.e('headerbtn')\"\n :aria-label=\"t('el.messagebox.close')\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || 'close'\" />\n </el-icon>\n </button>\n </div>\n <div :id=\"contentId\" :class=\"ns.e('content')\">\n <div :class=\"ns.e('container')\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" :class=\"ns.e('message')\">\n <slot>\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-if=\"!dangerouslyUseHTMLString\"\n :for=\"showInput ? inputId : undefined\"\n v-text=\"message\"\n />\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-else\n :for=\"showInput ? inputId : undefined\"\n v-html=\"message\"\n />\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" :class=\"ns.e('input')\">\n <el-input\n :id=\"inputId\"\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :aria-invalid=\"validateError\"\n :class=\"{ invalid: validateError }\"\n @keydown.enter=\"handleInputEnter\"\n />\n <div\n :class=\"ns.e('errormsg')\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div\n v-if=\"showCancelButton || showConfirmButton\"\n :class=\"ns.e('btns')\"\n >\n <el-button\n v-if=\"showCancelButton\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n :loading=\"cancelButtonLoading\"\n :loading-icon=\"cancelButtonLoadingIcon\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n :loading=\"confirmButtonLoading\"\n :loading-icon=\"confirmButtonLoadingIcon\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n toRefs,\n watch,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useDraggable,\n useId,\n useLockscreen,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport {\n TypeComponents,\n TypeComponentsMap,\n isFunction,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Loading } from '@element-plus/icons-vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\nimport type { InputInstance } from '@element-plus/components/input'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\n ElFocusTrap,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents,\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n closeOnHashChange: {\n type: Boolean,\n default: true,\n },\n center: Boolean,\n draggable: Boolean,\n overflow: Boolean,\n roundButton: Boolean,\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n // const popup = usePopup(props, doClose)\n const {\n locale,\n zIndex,\n ns,\n size: btnSize,\n } = useGlobalComponentSettings(\n 'message-box',\n computed(() => props.buttonSize)\n )\n\n const { t } = locale\n const { nextZIndex } = zIndex\n\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n // autofocus element when open message-box\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n cancelButtonType: '',\n confirmButtonType: 'primary',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n closeIcon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: '',\n inputValidator: undefined,\n inputErrorMessage: '',\n message: '',\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n })\n\n const contentId = useId()\n const inputId = useId()\n\n const iconComponent = computed(() => {\n const type = state.type\n return state.icon || (type && TypeComponentsMap[type]) || ''\n })\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const focusStartRef = ref<HTMLElement>()\n const inputRef = ref<InputInstance>()\n const confirmRef = ref<ComponentPublicInstance>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType !== 'prompt') {\n if (state.autofocus) {\n focusStartRef.value = confirmRef.value?.$el ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n state.zIndex = nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n if (state.autofocus) {\n focusStartRef.value = getInputElement() ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n const overflow = computed(() => props.overflow)\n const { isDragging } = useDraggable(rootRef, headerRef, draggable, overflow)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n window.addEventListener('hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n window.removeEventListener('hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick)\n\n const handleInputEnter = (e: KeyboardEvent | Event) => {\n if (state.inputType !== 'textarea' && !inputRef.value?.isComposing) {\n e.preventDefault()\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (isFunction(inputValidator)) {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (isString(validateResult)) {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value?.$refs\n return (inputRefs?.input ?? inputRefs?.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event like this\n // to dispatch, it could callout another message box.\n const onCloseRequested = () => {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible, { ns })\n }\n\n return {\n ...toRefs(state),\n ns,\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n contentId,\n inputId,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n focusStartRef,\n headerRef,\n inputRef,\n isDragging,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n onCloseRequested,\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;mDA0Je,IAAA,YAAA;EAzJD,MAAK;EAAkB,cAAW,OAAA,Q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,KAAA,sBAAiB;MACvB,SAAS,KAAA;MACT,gBAAc,KAAA;MACd,QAAA,GAAA,IAAA,gBAAK,CAAG,KAAA,qBAAoB,CAAA;MAC5B,OAAO,KAAA;MACP,UAAU,KAAA;MACV,MAAM,KAAA;MACN,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAA,aAAY,UAAA;MACnB,WAAO,OAAA,OAAA,OAAA,MAAA,GAAA,IAAA,WAAA,GAAA,IAAA,gBAAA,WAAgB,KAAA,aAAY,UAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,QAAA,CAAA;;sCAEiB,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,iBAAlD,KAAA,qBAAqB,KAAA,EAAC,wBAAA,CAAA,EAAA,EAAA,CAAA,CAAA;;;;;;;;;;;sBAbjB,KAAA,kBAAiB,CAAA,CAAA,CAAA,EAAA,EAAA,KAAA,GAAA,IAAA,oBAAA,QAAA,KAAA;;;;;;;;;;;;;;mBAnI3B,KAAA,QAAO,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -89,7 +89,7 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
89
89
|
}>;
|
|
90
90
|
contentId: _$vue.Ref<string, string>;
|
|
91
91
|
inputId: _$vue.Ref<string, string>;
|
|
92
|
-
btnSize: _$vue.ComputedRef<"" | "
|
|
92
|
+
btnSize: _$vue.ComputedRef<"default" | "" | "large" | "small">;
|
|
93
93
|
iconComponent: _$vue.ComputedRef<string | _$vue.FunctionalComponent<any, {}, any, {}> | {
|
|
94
94
|
new (...args: any[]): any;
|
|
95
95
|
__isFragment?: never;
|
|
@@ -229,7 +229,7 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
229
229
|
autofocus: _$vue.Ref<boolean, boolean>;
|
|
230
230
|
title: _$vue.Ref<string | undefined, string | undefined>;
|
|
231
231
|
message: _$vue.Ref<string, string>;
|
|
232
|
-
type: _$vue.Ref<"" | "info" | "primary" | "success" | "warning" | "error"
|
|
232
|
+
type: _$vue.Ref<"" | "error" | "info" | "primary" | "success" | "warning", "" | "error" | "info" | "primary" | "success" | "warning">;
|
|
233
233
|
icon: _$vue.Ref<string | _$vue.FunctionalComponent<any, {}, any, {}> | {
|
|
234
234
|
new (...args: any[]): any;
|
|
235
235
|
__isFragment?: never;
|
|
@@ -4031,8 +4031,8 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4031
4031
|
dangerouslyUseHTMLString: _$vue.Ref<boolean, boolean>;
|
|
4032
4032
|
confirmButtonText: _$vue.Ref<string, string>;
|
|
4033
4033
|
cancelButtonText: _$vue.Ref<string, string>;
|
|
4034
|
-
confirmButtonType: _$vue.Ref<"" | "default" | "info" | "primary" | "success" | "warning" | "
|
|
4035
|
-
cancelButtonType: _$vue.Ref<"" | "default" | "info" | "primary" | "success" | "warning" | "
|
|
4034
|
+
confirmButtonType: _$vue.Ref<"" | "text" | "default" | "info" | "primary" | "success" | "warning" | "danger", "" | "text" | "default" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
4035
|
+
cancelButtonType: _$vue.Ref<"" | "text" | "default" | "info" | "primary" | "success" | "warning" | "danger", "" | "text" | "default" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
4036
4036
|
confirmButtonLoading: _$vue.Ref<boolean, boolean>;
|
|
4037
4037
|
cancelButtonLoading: _$vue.Ref<boolean, boolean>;
|
|
4038
4038
|
confirmButtonLoadingIcon: _$vue.Ref<string | _$vue.FunctionalComponent<any, {}, any, {}> | {
|
|
@@ -4578,10 +4578,10 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4578
4578
|
onVanish?: ((...args: any[]) => any) | undefined;
|
|
4579
4579
|
}>, {
|
|
4580
4580
|
center: boolean;
|
|
4581
|
-
container: string;
|
|
4582
4581
|
overflow: boolean;
|
|
4583
|
-
closeOnClickModal: boolean;
|
|
4584
4582
|
closeOnPressEscape: boolean;
|
|
4583
|
+
container: string;
|
|
4584
|
+
closeOnClickModal: boolean;
|
|
4585
4585
|
lockScroll: boolean;
|
|
4586
4586
|
modal: boolean;
|
|
4587
4587
|
draggable: boolean;
|
|
@@ -4600,16 +4600,16 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4600
4600
|
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
4601
4601
|
}>, {
|
|
4602
4602
|
ref: _$vue.Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
4603
|
-
size: _$vue.ComputedRef<"" | "default" | "
|
|
4604
|
-
type: _$vue.ComputedRef<"" | "default" | "
|
|
4603
|
+
size: _$vue.ComputedRef<"" | "default" | "large" | "small">;
|
|
4604
|
+
type: _$vue.ComputedRef<"text" | "default" | "" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
4605
4605
|
disabled: _$vue.ComputedRef<boolean>;
|
|
4606
4606
|
shouldAddSpace: _$vue.ComputedRef<boolean>;
|
|
4607
4607
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
4608
4608
|
click: (evt: MouseEvent) => void;
|
|
4609
4609
|
}, _$vue.PublicProps, {
|
|
4610
|
-
type: ButtonType;
|
|
4611
4610
|
text: boolean;
|
|
4612
4611
|
disabled: boolean;
|
|
4612
|
+
type: ButtonType;
|
|
4613
4613
|
round: boolean;
|
|
4614
4614
|
dashed: boolean;
|
|
4615
4615
|
nativeType: ButtonNativeType;
|
|
@@ -4628,14 +4628,14 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4628
4628
|
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
4629
4629
|
}>, {
|
|
4630
4630
|
ref: _$vue.Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
4631
|
-
size: _$vue.ComputedRef<"" | "default" | "
|
|
4632
|
-
type: _$vue.ComputedRef<"" | "default" | "
|
|
4631
|
+
size: _$vue.ComputedRef<"" | "default" | "large" | "small">;
|
|
4632
|
+
type: _$vue.ComputedRef<"text" | "default" | "" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
4633
4633
|
disabled: _$vue.ComputedRef<boolean>;
|
|
4634
4634
|
shouldAddSpace: _$vue.ComputedRef<boolean>;
|
|
4635
4635
|
}, {}, {}, {}, {
|
|
4636
|
-
type: ButtonType;
|
|
4637
4636
|
text: boolean;
|
|
4638
4637
|
disabled: boolean;
|
|
4638
|
+
type: ButtonType;
|
|
4639
4639
|
round: boolean;
|
|
4640
4640
|
dashed: boolean;
|
|
4641
4641
|
nativeType: ButtonNativeType;
|
|
@@ -4651,16 +4651,16 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4651
4651
|
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
4652
4652
|
}>, {
|
|
4653
4653
|
ref: _$vue.Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
4654
|
-
size: _$vue.ComputedRef<"" | "default" | "
|
|
4655
|
-
type: _$vue.ComputedRef<"" | "default" | "
|
|
4654
|
+
size: _$vue.ComputedRef<"" | "default" | "large" | "small">;
|
|
4655
|
+
type: _$vue.ComputedRef<"text" | "default" | "" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
4656
4656
|
disabled: _$vue.ComputedRef<boolean>;
|
|
4657
4657
|
shouldAddSpace: _$vue.ComputedRef<boolean>;
|
|
4658
4658
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
4659
4659
|
click: (evt: MouseEvent) => void;
|
|
4660
4660
|
}, string, {
|
|
4661
|
-
type: ButtonType;
|
|
4662
4661
|
text: boolean;
|
|
4663
4662
|
disabled: boolean;
|
|
4663
|
+
type: ButtonType;
|
|
4664
4664
|
round: boolean;
|
|
4665
4665
|
dashed: boolean;
|
|
4666
4666
|
nativeType: ButtonNativeType;
|
|
@@ -4678,9 +4678,9 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4678
4678
|
};
|
|
4679
4679
|
}) & _$vue.ObjectPlugin & {
|
|
4680
4680
|
setPropsDefaults: (defaults: {
|
|
4681
|
-
readonly size?: "" | "default" | "
|
|
4681
|
+
readonly size?: "" | "default" | "large" | "small" | (() => "" | "default" | "large" | "small") | undefined;
|
|
4682
4682
|
readonly disabled?: boolean | (() => boolean) | undefined;
|
|
4683
|
-
readonly type?: "" | "default" | "info" | "primary" | "success" | "warning" | "
|
|
4683
|
+
readonly type?: "" | "text" | "default" | "info" | "primary" | "success" | "warning" | "danger" | (() => "" | "text" | "default" | "info" | "primary" | "success" | "warning" | "danger") | undefined;
|
|
4684
4684
|
readonly icon?: string | _$vue.FunctionalComponent<any, {}, any, {}> | {
|
|
4685
4685
|
new (...args: any[]): any;
|
|
4686
4686
|
__isFragment?: never;
|
|
@@ -4748,18 +4748,18 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4748
4748
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
4749
4749
|
ElInput: SFCWithInstall<{
|
|
4750
4750
|
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<InputProps> & Readonly<{
|
|
4751
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4752
|
-
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4753
|
-
onInput?: ((value: string) => any) | undefined;
|
|
4754
4751
|
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4755
|
-
|
|
4752
|
+
onInput?: ((value: string) => any) | undefined;
|
|
4756
4753
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4754
|
+
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4755
|
+
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
4760
4756
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
4761
4757
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
4762
|
-
|
|
4758
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
4759
|
+
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4760
|
+
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4761
|
+
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4762
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4763
4763
|
}>, {
|
|
4764
4764
|
input: _$vue.ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
4765
4765
|
textarea: _$vue.ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
@@ -4774,21 +4774,21 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4774
4774
|
clear: (evt?: MouseEvent) => void;
|
|
4775
4775
|
resizeTextarea: () => void;
|
|
4776
4776
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
4777
|
-
"update:modelValue": (value: string) => void;
|
|
4778
|
-
change: (value: string, evt?: Event | undefined) => void;
|
|
4779
|
-
input: (value: string) => void;
|
|
4780
4777
|
clear: (evt: MouseEvent | undefined) => void;
|
|
4781
|
-
|
|
4778
|
+
input: (value: string) => void;
|
|
4782
4779
|
blur: (evt: FocusEvent) => void;
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
keydown: (evt: Event | KeyboardEvent) => void;
|
|
4780
|
+
change: (value: string, evt?: Event | undefined) => void;
|
|
4781
|
+
compositionend: (evt: CompositionEvent) => void;
|
|
4786
4782
|
compositionstart: (evt: CompositionEvent) => void;
|
|
4787
4783
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
4788
|
-
|
|
4784
|
+
focus: (evt: FocusEvent) => void;
|
|
4785
|
+
keydown: (evt: Event | KeyboardEvent) => void;
|
|
4786
|
+
mouseenter: (evt: MouseEvent) => void;
|
|
4787
|
+
mouseleave: (evt: MouseEvent) => void;
|
|
4788
|
+
"update:modelValue": (value: string) => void;
|
|
4789
4789
|
}, _$vue.PublicProps, {
|
|
4790
|
-
type: InputType;
|
|
4791
4790
|
disabled: boolean;
|
|
4791
|
+
type: InputType;
|
|
4792
4792
|
modelValue: string | number | null;
|
|
4793
4793
|
modelModifiers: InputModelModifiers;
|
|
4794
4794
|
autocomplete: string;
|
|
@@ -4806,18 +4806,18 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4806
4806
|
M: {};
|
|
4807
4807
|
Defaults: {};
|
|
4808
4808
|
}, Readonly<InputProps> & Readonly<{
|
|
4809
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4810
|
-
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4811
|
-
onInput?: ((value: string) => any) | undefined;
|
|
4812
4809
|
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4813
|
-
|
|
4810
|
+
onInput?: ((value: string) => any) | undefined;
|
|
4814
4811
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4812
|
+
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4813
|
+
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
4818
4814
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
4819
4815
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
4820
|
-
|
|
4816
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
4817
|
+
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4818
|
+
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4819
|
+
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4820
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4821
4821
|
}>, {
|
|
4822
4822
|
input: _$vue.ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
4823
4823
|
textarea: _$vue.ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
@@ -4832,8 +4832,8 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4832
4832
|
clear: (evt?: MouseEvent) => void;
|
|
4833
4833
|
resizeTextarea: () => void;
|
|
4834
4834
|
}, {}, {}, {}, {
|
|
4835
|
-
type: InputType;
|
|
4836
4835
|
disabled: boolean;
|
|
4836
|
+
type: InputType;
|
|
4837
4837
|
modelValue: string | number | null;
|
|
4838
4838
|
modelModifiers: InputModelModifiers;
|
|
4839
4839
|
autocomplete: string;
|
|
@@ -4848,18 +4848,18 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4848
4848
|
__isTeleport?: never;
|
|
4849
4849
|
__isSuspense?: never;
|
|
4850
4850
|
} & _$vue.ComponentOptionsBase<Readonly<InputProps> & Readonly<{
|
|
4851
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4852
|
-
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4853
|
-
onInput?: ((value: string) => any) | undefined;
|
|
4854
4851
|
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
4855
|
-
|
|
4852
|
+
onInput?: ((value: string) => any) | undefined;
|
|
4856
4853
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4854
|
+
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
4855
|
+
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
4860
4856
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
4861
4857
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
4862
|
-
|
|
4858
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
4859
|
+
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
4860
|
+
onMouseenter?: ((evt: MouseEvent) => any) | undefined;
|
|
4861
|
+
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
4862
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
4863
4863
|
}>, {
|
|
4864
4864
|
input: _$vue.ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
4865
4865
|
textarea: _$vue.ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
@@ -4874,21 +4874,21 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
4874
4874
|
clear: (evt?: MouseEvent) => void;
|
|
4875
4875
|
resizeTextarea: () => void;
|
|
4876
4876
|
}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
4877
|
-
"update:modelValue": (value: string) => void;
|
|
4878
|
-
change: (value: string, evt?: Event | undefined) => void;
|
|
4879
|
-
input: (value: string) => void;
|
|
4880
4877
|
clear: (evt: MouseEvent | undefined) => void;
|
|
4881
|
-
|
|
4878
|
+
input: (value: string) => void;
|
|
4882
4879
|
blur: (evt: FocusEvent) => void;
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
keydown: (evt: Event | KeyboardEvent) => void;
|
|
4880
|
+
change: (value: string, evt?: Event | undefined) => void;
|
|
4881
|
+
compositionend: (evt: CompositionEvent) => void;
|
|
4886
4882
|
compositionstart: (evt: CompositionEvent) => void;
|
|
4887
4883
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
4888
|
-
|
|
4884
|
+
focus: (evt: FocusEvent) => void;
|
|
4885
|
+
keydown: (evt: Event | KeyboardEvent) => void;
|
|
4886
|
+
mouseenter: (evt: MouseEvent) => void;
|
|
4887
|
+
mouseleave: (evt: MouseEvent) => void;
|
|
4888
|
+
"update:modelValue": (value: string) => void;
|
|
4889
4889
|
}, string, {
|
|
4890
|
-
type: InputType;
|
|
4891
4890
|
disabled: boolean;
|
|
4891
|
+
type: InputType;
|
|
4892
4892
|
modelValue: string | number | null;
|
|
4893
4893
|
modelModifiers: InputModelModifiers;
|
|
4894
4894
|
autocomplete: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue_vue_type_script_lang.js","names":[],"sources":["../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"[ns.is('message-box'), modalClass]\"\n :mask=\"modal\"\n >\n <div\n role=\"dialog\"\n :aria-label=\"title\"\n aria-modal=\"true\"\n :aria-describedby=\"!showInput ? contentId : undefined\"\n :class=\"`${ns.namespace.value}-overlay-message-box`\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"rootRef\"\n :focus-start-el=\"focusStartRef\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"rootRef\"\n :class=\"[\n ns.b(),\n customClass,\n ns.is('draggable', draggable),\n ns.is('dragging', isDragging),\n { [ns.m('center')]: center },\n ]\"\n :style=\"customStyle\"\n tabindex=\"-1\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n :class=\"[ns.e('header'), { 'show-close': showClose }]\"\n >\n <div :class=\"ns.e('title')\">\n <el-icon\n v-if=\"iconComponent && center\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n :class=\"ns.e('headerbtn')\"\n :aria-label=\"t('el.messagebox.close')\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || 'close'\" />\n </el-icon>\n </button>\n </div>\n <div :id=\"contentId\" :class=\"ns.e('content')\">\n <div :class=\"ns.e('container')\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" :class=\"ns.e('message')\">\n <slot>\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-if=\"!dangerouslyUseHTMLString\"\n :for=\"showInput ? inputId : undefined\"\n v-text=\"message\"\n />\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-else\n :for=\"showInput ? inputId : undefined\"\n v-html=\"message\"\n />\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" :class=\"ns.e('input')\">\n <el-input\n :id=\"inputId\"\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :aria-invalid=\"validateError\"\n :class=\"{ invalid: validateError }\"\n @keydown.enter=\"handleInputEnter\"\n />\n <div\n :class=\"ns.e('errormsg')\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div :class=\"ns.e('btns')\">\n <el-button\n v-if=\"showCancelButton\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n :loading=\"cancelButtonLoading\"\n :loading-icon=\"cancelButtonLoadingIcon\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n :loading=\"confirmButtonLoading\"\n :loading-icon=\"confirmButtonLoadingIcon\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n toRefs,\n watch,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useDraggable,\n useId,\n useLockscreen,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport {\n TypeComponents,\n TypeComponentsMap,\n isFunction,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Loading } from '@element-plus/icons-vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\nimport type { InputInstance } from '@element-plus/components/input'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\n ElFocusTrap,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents,\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n closeOnHashChange: {\n type: Boolean,\n default: true,\n },\n center: Boolean,\n draggable: Boolean,\n overflow: Boolean,\n roundButton: Boolean,\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n // const popup = usePopup(props, doClose)\n const {\n locale,\n zIndex,\n ns,\n size: btnSize,\n } = useGlobalComponentSettings(\n 'message-box',\n computed(() => props.buttonSize)\n )\n\n const { t } = locale\n const { nextZIndex } = zIndex\n\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n // autofocus element when open message-box\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n cancelButtonType: '',\n confirmButtonType: 'primary',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n closeIcon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: '',\n inputValidator: undefined,\n inputErrorMessage: '',\n message: '',\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n })\n\n const contentId = useId()\n const inputId = useId()\n\n const iconComponent = computed(() => {\n const type = state.type\n return state.icon || (type && TypeComponentsMap[type]) || ''\n })\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const focusStartRef = ref<HTMLElement>()\n const inputRef = ref<InputInstance>()\n const confirmRef = ref<ComponentPublicInstance>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType !== 'prompt') {\n if (state.autofocus) {\n focusStartRef.value = confirmRef.value?.$el ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n state.zIndex = nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n if (state.autofocus) {\n focusStartRef.value = getInputElement() ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n const overflow = computed(() => props.overflow)\n const { isDragging } = useDraggable(rootRef, headerRef, draggable, overflow)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n window.addEventListener('hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n window.removeEventListener('hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick)\n\n const handleInputEnter = (e: KeyboardEvent | Event) => {\n if (state.inputType !== 'textarea' && !inputRef.value?.isComposing) {\n e.preventDefault()\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (isFunction(inputValidator)) {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (isString(validateResult)) {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value?.$refs\n return (inputRefs?.input ?? inputRefs?.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event like this\n // to dispatch, it could callout another message box.\n const onCloseRequested = () => {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible, { ns })\n }\n\n return {\n ...toRefs(state),\n ns,\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n contentId,\n inputId,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n focusStartRef,\n headerRef,\n inputRef,\n isDragging,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n onCloseRequested,\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsMA,IAAA,0CAAA,GAAA,IAAA,iBAA+B;CAC7B,MAAM;CACN,YAAY,EACV,WAAA,gBAAA,SACD;CACD,YAAY;EACV,UAAA,gBAAA;EACA,aAAA,gBAAA;EACA,SAAA,gBAAA;EACA,WAAA,gBAAA;EACA,QAAA,gBAAA;EACA,GAAG,aAAA;EACJ;CACD,cAAc;CACd,OAAO;EACL,YAAY;GACV,MAAM;GACN,WAAW,kBAAA;GACZ;EACD,OAAO;GACL,MAAM;GACN,SAAS;GACV;EACD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EACD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EACD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EACD,oBAAoB;GAClB,MAAM;GACN,SAAS;GACV;EACD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EACD,QAAQ;EACR,WAAW;EACX,UAAU;EACV,aAAa;EACb,WAAW;GACT,MAAM;GACN,SAAS;GACV;EACD,SAAS;GACP,MAAM;GACN,SAAS;GACV;EACF;CACD,OAAO,CAAC,UAAU,SAAS;CAC3B,MAAM,OAAO,EAAE,QAAQ;EAErB,MAAM,EACJ,QACA,QACA,IACA,MAAM,YACJ,0BAAA,2BACF,gBAAA,GAAA,IAAA,gBACe,MAAM,WAAU,CACjC;EAEA,MAAM,EAAE,MAAM;EACd,MAAM,EAAE,eAAe;EAEvB,MAAM,WAAA,GAAA,IAAA,KAAc,MAAK;EAEzB,MAAM,SAAA,GAAA,IAAA,UAAkC;GAEtC,WAAW;GACX,aAAa;GACb,UAAU;G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A;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACF;;CAEH,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.vue_vue_type_script_lang.js","names":[],"sources":["../../../../../../packages/components/message-box/src/index.vue"],"sourcesContent":["<template>\n <transition name=\"fade-in-linear\" @after-leave=\"$emit('vanish')\">\n <el-overlay\n v-show=\"visible\"\n :z-index=\"zIndex\"\n :overlay-class=\"[ns.is('message-box'), modalClass]\"\n :mask=\"modal\"\n >\n <div\n role=\"dialog\"\n :aria-label=\"title\"\n aria-modal=\"true\"\n :aria-describedby=\"!showInput ? contentId : undefined\"\n :class=\"`${ns.namespace.value}-overlay-message-box`\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"rootRef\"\n :focus-start-el=\"focusStartRef\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"rootRef\"\n :class=\"[\n ns.b(),\n customClass,\n ns.is('draggable', draggable),\n ns.is('dragging', isDragging),\n { [ns.m('center')]: center },\n ]\"\n :style=\"customStyle\"\n tabindex=\"-1\"\n @click.stop=\"\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n ref=\"headerRef\"\n :class=\"[ns.e('header'), { 'show-close': showClose }]\"\n >\n <div :class=\"ns.e('title')\">\n <el-icon\n v-if=\"iconComponent && center\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <span>{{ title }}</span>\n </div>\n <button\n v-if=\"showClose\"\n type=\"button\"\n :class=\"ns.e('headerbtn')\"\n :aria-label=\"t('el.messagebox.close')\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"closeIcon || 'close'\" />\n </el-icon>\n </button>\n </div>\n <div :id=\"contentId\" :class=\"ns.e('content')\">\n <div :class=\"ns.e('container')\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n :class=\"[ns.e('status'), typeClass]\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" :class=\"ns.e('message')\">\n <slot>\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-if=\"!dangerouslyUseHTMLString\"\n :for=\"showInput ? inputId : undefined\"\n v-text=\"message\"\n />\n <component\n :is=\"showInput ? 'label' : 'p'\"\n v-else\n :for=\"showInput ? inputId : undefined\"\n v-html=\"message\"\n />\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" :class=\"ns.e('input')\">\n <el-input\n :id=\"inputId\"\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :aria-invalid=\"validateError\"\n :class=\"{ invalid: validateError }\"\n @keydown.enter=\"handleInputEnter\"\n />\n <div\n :class=\"ns.e('errormsg')\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div\n v-if=\"showCancelButton || showConfirmButton\"\n :class=\"ns.e('btns')\"\n >\n <el-button\n v-if=\"showCancelButton\"\n :type=\"cancelButtonType === 'text' ? '' : cancelButtonType\"\n :text=\"cancelButtonType === 'text'\"\n :loading=\"cancelButtonLoading\"\n :loading-icon=\"cancelButtonLoadingIcon\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"btnSize\"\n @click=\"handleAction('cancel')\"\n @keydown.prevent.enter=\"handleAction('cancel')\"\n >\n {{ cancelButtonText || t('el.messagebox.cancel') }}\n </el-button>\n <el-button\n v-show=\"showConfirmButton\"\n ref=\"confirmRef\"\n :type=\"confirmButtonType === 'text' ? '' : confirmButtonType\"\n :text=\"confirmButtonType === 'text'\"\n :loading=\"confirmButtonLoading\"\n :loading-icon=\"confirmButtonLoadingIcon\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"btnSize\"\n @click=\"handleAction('confirm')\"\n @keydown.prevent.enter=\"handleAction('confirm')\"\n >\n {{ confirmButtonText || t('el.messagebox.confirm') }}\n </el-button>\n </div>\n </div>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n markRaw,\n nextTick,\n onBeforeUnmount,\n onMounted,\n reactive,\n ref,\n toRefs,\n watch,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useDraggable,\n useId,\n useLockscreen,\n useSameTarget,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport {\n TypeComponents,\n TypeComponentsMap,\n isFunction,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { Loading } from '@element-plus/icons-vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useGlobalComponentSettings } from '@element-plus/components/config-provider'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\nimport type { InputInstance } from '@element-plus/components/input'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\n ElFocusTrap,\n ElInput,\n ElOverlay,\n ElIcon,\n ...TypeComponents,\n },\n inheritAttrs: false,\n props: {\n buttonSize: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n modal: {\n type: Boolean,\n default: true,\n },\n lockScroll: {\n type: Boolean,\n default: true,\n },\n showClose: {\n type: Boolean,\n default: true,\n },\n closeOnClickModal: {\n type: Boolean,\n default: true,\n },\n closeOnPressEscape: {\n type: Boolean,\n default: true,\n },\n closeOnHashChange: {\n type: Boolean,\n default: true,\n },\n center: Boolean,\n draggable: Boolean,\n overflow: Boolean,\n roundButton: Boolean,\n container: {\n type: String, // default append to body\n default: 'body',\n },\n boxType: {\n type: String as PropType<MessageBoxType>,\n default: '',\n },\n },\n emits: ['vanish', 'action'],\n setup(props, { emit }) {\n // const popup = usePopup(props, doClose)\n const {\n locale,\n zIndex,\n ns,\n size: btnSize,\n } = useGlobalComponentSettings(\n 'message-box',\n computed(() => props.buttonSize)\n )\n\n const { t } = locale\n const { nextZIndex } = zIndex\n\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n // autofocus element when open message-box\n autofocus: true,\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n cancelButtonType: '',\n confirmButtonType: 'primary',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n closeIcon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: '',\n inputValidator: undefined,\n inputErrorMessage: '',\n message: '',\n modalFade: true,\n modalClass: '',\n showCancelButton: false,\n showConfirmButton: true,\n type: '',\n title: undefined,\n showInput: false,\n action: '' as Action,\n confirmButtonLoading: false,\n cancelButtonLoading: false,\n confirmButtonLoadingIcon: markRaw(Loading),\n cancelButtonLoadingIcon: markRaw(Loading),\n confirmButtonDisabled: false,\n editorErrorMessage: '',\n // refer to: https://github.com/ElemeFE/element/commit/2999279ae34ef10c373ca795c87b020ed6753eed\n // seemed ok for now without this state.\n // isOnComposition: false, // temporary remove\n validateError: false,\n zIndex: nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return { [ns.bm('icon', type)]: type && TypeComponentsMap[type] }\n })\n\n const contentId = useId()\n const inputId = useId()\n\n const iconComponent = computed(() => {\n const type = state.type\n return state.icon || (type && TypeComponentsMap[type]) || ''\n })\n const hasMessage = computed(() => !!state.message)\n const rootRef = ref<HTMLElement>()\n const headerRef = ref<HTMLElement>()\n const focusStartRef = ref<HTMLElement>()\n const inputRef = ref<InputInstance>()\n const confirmRef = ref<ComponentPublicInstance>()\n\n const confirmButtonClasses = computed(() => state.confirmButtonClass)\n\n watch(\n () => state.inputValue,\n async (val) => {\n await nextTick()\n if (props.boxType === 'prompt' && val) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType !== 'prompt') {\n if (state.autofocus) {\n focusStartRef.value = confirmRef.value?.$el ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n state.zIndex = nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n if (state.autofocus) {\n focusStartRef.value = getInputElement() ?? rootRef.value\n } else {\n focusStartRef.value = rootRef.value\n }\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n const draggable = computed(() => props.draggable)\n const overflow = computed(() => props.overflow)\n const { isDragging } = useDraggable(rootRef, headerRef, draggable, overflow)\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n window.addEventListener('hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n window.removeEventListener('hashchange', doClose)\n }\n })\n\n function doClose() {\n if (!visible.value) return\n visible.value = false\n nextTick(() => {\n if (state.action) emit('action', state.action)\n })\n }\n\n const handleWrapperClick = () => {\n if (props.closeOnClickModal) {\n handleAction(state.distinguishCancelAndClose ? 'close' : 'cancel')\n }\n }\n\n const overlayEvent = useSameTarget(handleWrapperClick)\n\n const handleInputEnter = (e: KeyboardEvent | Event) => {\n if (state.inputType !== 'textarea' && !inputRef.value?.isComposing) {\n e.preventDefault()\n return handleAction('confirm')\n }\n }\n\n const handleAction = (action: Action) => {\n if (props.boxType === 'prompt' && action === 'confirm' && !validate()) {\n return\n }\n\n state.action = action\n\n if (state.beforeClose) {\n state.beforeClose?.(action, state, doClose)\n } else {\n doClose()\n }\n }\n\n const validate = () => {\n if (props.boxType === 'prompt') {\n const inputPattern = state.inputPattern\n if (inputPattern && !inputPattern.test(state.inputValue || '')) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n const inputValidator = state.inputValidator\n if (isFunction(inputValidator)) {\n const validateResult = inputValidator(state.inputValue)\n if (validateResult === false) {\n state.editorErrorMessage =\n state.inputErrorMessage || t('el.messagebox.error')\n state.validateError = true\n return false\n }\n if (isString(validateResult)) {\n state.editorErrorMessage = validateResult\n state.validateError = true\n return false\n }\n }\n }\n state.editorErrorMessage = ''\n state.validateError = false\n return true\n }\n\n const getInputElement = () => {\n const inputRefs = inputRef.value?.$refs\n return (inputRefs?.input ?? inputRefs?.textarea) as HTMLElement\n }\n\n const handleClose = () => {\n handleAction('close')\n }\n\n // when close on press escape is disabled, pressing esc should not callout\n // any other message box and close any other dialog-ish elements\n // e.g. Dialog has a close on press esc feature, and when it closes, it calls\n // props.beforeClose method to make a intermediate state by callout a message box\n // for some verification or alerting. then if we allow global event like this\n // to dispatch, it could callout another message box.\n const onCloseRequested = () => {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible, { ns })\n }\n\n return {\n ...toRefs(state),\n ns,\n overlayEvent,\n visible,\n hasMessage,\n typeClass,\n contentId,\n inputId,\n btnSize,\n iconComponent,\n confirmButtonClasses,\n rootRef,\n focusStartRef,\n headerRef,\n inputRef,\n isDragging,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n onCloseRequested,\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyMA,IAAA,0CAAA,GAAA,IAAA,iBAA+B;CAC7B,MAAM;C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UAAU;IAC9B,MAAM,eAAe,MAAM;IAC3B,IAAI,gBAAgB,CAAC,aAAa,KAAK,MAAM,cAAc,GAAG,EAAE;KAC9D,MAAM,qBACJ,MAAM,qBAAqB,EAAE,sBAAqB;KACpD,MAAM,gBAAgB;KACtB,OAAO;;IAET,MAAM,iBAAiB,MAAM;IAC7B,KAAA,GAAA,YAAA,YAAe,eAAe,EAAE;KAC9B,MAAM,iBAAiB,eAAe,MAAM,WAAU;KACtD,IAAI,mBAAmB,OAAO;MAC5B,MAAM,qBACJ,MAAM,qBAAqB,EAAE,sBAAqB;MACpD,MAAM,gBAAgB;MACtB,OAAO;;KAET,KAAA,GAAA,YAAA,UAAa,eAAe,EAAE;MAC5B,MAAM,qBAAqB;MAC3B,MAAM,gBAAgB;MACtB,OAAO;;;;GAIb,MAAM,qBAAqB;GAC3B,MAAM,gBAAgB;GACtB,OAAO;;EAGT,MAAM,wBAAwB;GAC5B,MAAM,YAAY,SAAS,OAAO;GAClC,OAAQ,WAAW,SAAS,WAAW;;EAGzC,MAAM,oBAAoB;GACxB,aAAa,QAAO;;EAStB,MAAM,yBAAyB;GAC7B,IAAI,MAAM,oBACR,aAAY;;EAKhB,IAAI,MAAM,YACR,gBAAA,cAAc,SAAS,EAAE,IAAI,CAAA;EAG/B,OAAO;GACL,IAAA,GAAA,IAAA,QAAU,MAAM;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACF;;CAEH,CAAA"}
|
|
@@ -112,7 +112,7 @@ declare const notificationProps: {
|
|
|
112
112
|
readonly position: EpPropFinalized<StringConstructor, "top-left" | "top-right" | "bottom-left" | "bottom-right", unknown, "top-right", boolean>;
|
|
113
113
|
readonly showClose: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
114
114
|
readonly title: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
115
|
-
readonly type: EpPropFinalized<StringConstructor, "" | "
|
|
115
|
+
readonly type: EpPropFinalized<StringConstructor, "" | "error" | "info" | "primary" | "success" | "warning", unknown, "", boolean>;
|
|
116
116
|
readonly zIndex: NumberConstructor;
|
|
117
117
|
readonly closeIcon: EpPropFinalized<(new (...args: any[]) => (string | _$vue.Component) & {}) | (() => string | _$vue.Component) | (((new (...args: any[]) => (string | _$vue.Component) & {}) | (() => string | _$vue.Component)) | null)[], unknown, unknown, _$vue.DefineComponent<{}, void, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>, boolean>;
|
|
118
118
|
};
|
|
@@ -16,13 +16,13 @@ declare const __VLS_base: _$vue.DefineComponent<NotificationProps, {
|
|
|
16
16
|
}, string, _$vue.PublicProps, Readonly<NotificationProps> & Readonly<{
|
|
17
17
|
onDestroy?: (() => any) | undefined;
|
|
18
18
|
}>, {
|
|
19
|
+
id: string;
|
|
19
20
|
type: NotificationType;
|
|
20
|
-
message: string | _$vue.VNode | (() => _$vue.VNode);
|
|
21
|
-
offset: number;
|
|
22
21
|
position: NotificationPosition;
|
|
23
22
|
title: string;
|
|
24
|
-
id: string;
|
|
25
23
|
onClick: () => void;
|
|
24
|
+
message: string | _$vue.VNode | (() => _$vue.VNode);
|
|
25
|
+
offset: number;
|
|
26
26
|
closeIcon: IconPropType;
|
|
27
27
|
showClose: boolean;
|
|
28
28
|
duration: number;
|
|
@@ -6,7 +6,7 @@ import { ExtractPropTypes, ExtractPublicPropTypes } from "vue";
|
|
|
6
6
|
//#region ../../packages/components/pagination/src/components/jumper.d.ts
|
|
7
7
|
declare const paginationJumperProps: {
|
|
8
8
|
readonly size: {
|
|
9
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "
|
|
9
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", unknown>>;
|
|
10
10
|
readonly required: false;
|
|
11
11
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
12
12
|
__epPropKey: true;
|
|
@@ -4,14 +4,14 @@ import * as _$vue from "vue";
|
|
|
4
4
|
//#region ../../packages/components/pagination/src/components/jumper.vue.d.ts
|
|
5
5
|
declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
6
6
|
readonly size: {
|
|
7
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "
|
|
7
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", unknown>>;
|
|
8
8
|
readonly required: false;
|
|
9
9
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
10
10
|
__epPropKey: true;
|
|
11
11
|
};
|
|
12
12
|
}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{
|
|
13
13
|
readonly size: {
|
|
14
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "
|
|
14
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", unknown>>;
|
|
15
15
|
readonly required: false;
|
|
16
16
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
17
17
|
__epPropKey: true;
|
|
@@ -27,7 +27,7 @@ declare const paginationSizesProps: {
|
|
|
27
27
|
readonly disabled: BooleanConstructor;
|
|
28
28
|
readonly teleported: BooleanConstructor;
|
|
29
29
|
readonly size: {
|
|
30
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "
|
|
30
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", unknown>>;
|
|
31
31
|
readonly required: false;
|
|
32
32
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
33
33
|
__epPropKey: true;
|
|
@@ -25,7 +25,7 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
25
25
|
readonly disabled: BooleanConstructor;
|
|
26
26
|
readonly teleported: BooleanConstructor;
|
|
27
27
|
readonly size: {
|
|
28
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "
|
|
28
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", unknown>>;
|
|
29
29
|
readonly required: false;
|
|
30
30
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
31
31
|
__epPropKey: true;
|
|
@@ -56,7 +56,7 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
56
56
|
readonly disabled: BooleanConstructor;
|
|
57
57
|
readonly teleported: BooleanConstructor;
|
|
58
58
|
readonly size: {
|
|
59
|
-
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "
|
|
59
|
+
readonly type: _$vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", unknown>>;
|
|
60
60
|
readonly required: false;
|
|
61
61
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
62
62
|
__epPropKey: true;
|
|
@@ -65,8 +65,8 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
65
65
|
}>> & Readonly<{
|
|
66
66
|
"onPage-size-change"?: ((...args: any[]) => any) | undefined;
|
|
67
67
|
}>, {
|
|
68
|
-
readonly teleported: boolean;
|
|
69
68
|
readonly disabled: boolean;
|
|
69
|
+
readonly teleported: boolean;
|
|
70
70
|
readonly pageSizes: number[];
|
|
71
71
|
}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
72
72
|
declare const _default: typeof __VLS_export;
|