@element-plus/nightly 0.0.20220123 → 0.0.20220124
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 +585 -440
- package/dist/index.full.min.js +6 -6
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +6 -6
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +585 -440
- package/dist/locale/af.js +6 -8
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.js.map +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +6 -8
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.js.map +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/bg.js +6 -8
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.js.map +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +6 -8
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.js.map +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +6 -8
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.js.map +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/cs.js +6 -8
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.js.map +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +6 -8
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.js.map +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +6 -8
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.js.map +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +6 -8
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.js.map +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +6 -8
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.js.map +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +6 -8
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.js.map +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +6 -8
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.js.map +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +6 -8
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.js.map +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +6 -8
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.js.map +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +6 -8
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.js.map +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +6 -8
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.js.map +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +6 -8
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.js.map +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +6 -8
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.js.map +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +6 -8
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.js.map +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +6 -8
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.js.map +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +6 -8
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.js.map +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +6 -8
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.js.map +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +6 -8
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.js.map +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +6 -8
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.js.map +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +6 -8
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.js.map +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +6 -8
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.js.map +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +6 -8
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.js.map +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +6 -8
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.js.map +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +6 -8
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.js.map +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +6 -8
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.js.map +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +6 -8
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.js.map +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mn.js +6 -8
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.js.map +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +6 -8
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.js.map +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +6 -8
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.js.map +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +6 -8
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.js.map +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +6 -8
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.js.map +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +6 -8
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.js.map +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +6 -8
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.js.map +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +6 -8
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.js.map +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +6 -8
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.js.map +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +6 -8
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.js.map +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +6 -8
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.js.map +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +6 -8
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.js.map +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +6 -8
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.js.map +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +6 -8
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.js.map +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +6 -8
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.js.map +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +6 -8
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.js.map +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +6 -8
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.js.map +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +6 -8
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.js.map +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +6 -8
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.js.map +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +6 -8
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.js.map +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +6 -8
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.js.map +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +6 -8
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.js.map +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +6 -8
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.js.map +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/affix/src/affix2.mjs +2 -1
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/autocomplete/src/index.mjs +2 -1
- package/es/components/autocomplete/src/index.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +2 -1
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +11 -7
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/carousel/src/item.mjs +4 -2
- package/es/components/carousel/src/item.mjs.map +1 -1
- package/es/components/cascader/src/index.mjs +38 -21
- package/es/components/cascader/src/index.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs +16 -13
- package/es/components/cascader-panel/src/index.mjs.map +1 -1
- package/es/components/cascader-panel/src/menu.mjs +25 -22
- package/es/components/cascader-panel/src/menu.mjs.map +1 -1
- package/es/components/cascader-panel/src/node2.mjs +6 -2
- package/es/components/cascader-panel/src/node2.mjs.map +1 -1
- package/es/components/checkbox/index.d.ts +33 -0
- package/es/components/checkbox/src/checkbox-button.mjs +21 -15
- package/es/components/checkbox/src/checkbox-button.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +11 -0
- package/es/components/checkbox/src/checkbox-group.mjs +5 -2
- package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox.mjs +36 -28
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox.vue.d.ts +11 -0
- package/es/components/collapse/src/collapse-item.mjs +3 -3
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/color-picker/src/index.mjs +8 -5
- package/es/components/color-picker/src/index.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/basic-date-table.mjs +2 -1
- package/es/components/date-picker/src/date-picker-com/basic-date-table.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/basic-month-table.mjs +2 -1
- package/es/components/date-picker/src/date-picker-com/basic-month-table.mjs.map +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.mjs +1 -1
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.mjs.map +1 -1
- package/es/components/descriptions/src/index.mjs +7 -2
- package/es/components/descriptions/src/index.mjs.map +1 -1
- package/es/components/dialog/src/dialog.mjs +1 -3
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-item.mjs +12 -6
- package/es/components/dropdown/src/dropdown-item.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-menu.mjs +2 -1
- package/es/components/dropdown/src/dropdown-menu.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +9 -5
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/focus-trap/src/focus-trap.mjs +1 -1
- package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
- package/es/components/form/src/form-item.mjs +6 -4
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/image/src/image2.mjs +3 -2
- package/es/components/image/src/image2.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +3 -2
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/input/src/input2.mjs +17 -8
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs +12 -6
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/message/src/message2.mjs +1 -1
- package/es/components/message-box/src/index.mjs +4 -2
- package/es/components/message-box/src/index.mjs.map +1 -1
- package/es/components/notification/src/notification2.mjs +1 -1
- package/es/components/pagination/src/components/jumper.mjs +5 -2
- package/es/components/pagination/src/components/jumper.mjs.map +1 -1
- package/es/components/pagination/src/components/sizes.mjs +2 -1
- package/es/components/pagination/src/components/sizes.mjs.map +1 -1
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +45 -104
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +107 -45
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popover/src/index.mjs +4 -2
- package/es/components/popover/src/index.mjs.map +1 -1
- package/es/components/popper/src/content.mjs +5 -3
- package/es/components/popper/src/content.mjs.map +1 -1
- package/es/components/popper/src/trigger.mjs +1 -1
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +2 -1
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/radio/src/radio-button2.mjs +4 -4
- package/es/components/radio/src/radio-button2.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +1 -1
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +10 -6
- package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs.map +1 -1
- package/es/components/scrollbar/src/bar2.mjs +2 -1
- package/es/components/scrollbar/src/bar2.mjs.map +1 -1
- package/es/components/scrollbar/src/scrollbar2.mjs +2 -2
- package/es/components/select/src/option-group.mjs +2 -1
- package/es/components/select/src/option-group.mjs.map +1 -1
- package/es/components/select/src/select-dropdown.mjs +2 -1
- package/es/components/select/src/select-dropdown.mjs.map +1 -1
- package/es/components/select/src/select.mjs +2 -1
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select-v2/src/select-dropdown.mjs +2 -1
- package/es/components/select-v2/src/select-dropdown.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs +192 -186
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/slider/src/index.mjs +3 -2
- package/es/components/slider/src/index.mjs.map +1 -1
- package/es/components/slider/src/marker.mjs +2 -1
- package/es/components/slider/src/marker.mjs.map +1 -1
- package/es/components/steps/src/item.mjs +2 -1
- package/es/components/steps/src/item.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +4 -2
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/table/src/filter-panel.mjs +7 -3
- package/es/components/table/src/filter-panel.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +3 -2
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.mjs +16 -8
- package/es/components/time-picker/src/common/picker.mjs.map +1 -1
- package/es/components/time-select/src/time-select.mjs +4 -2
- package/es/components/time-select/src/time-select.mjs.map +1 -1
- package/es/components/tooltip/src/content.mjs +9 -4
- package/es/components/tooltip/src/content.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +2 -1
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/transfer/src/index.mjs +2 -1
- package/es/components/transfer/src/index.mjs.map +1 -1
- package/es/components/tree/src/tree.mjs +2 -1
- package/es/components/tree/src/tree.mjs.map +1 -1
- package/es/components/tree-v2/src/tree-node.mjs +11 -7
- package/es/components/tree-v2/src/tree-node.mjs.map +1 -1
- package/es/components/tree-v2/src/tree.mjs +2 -1
- package/es/components/tree-v2/src/tree.mjs.map +1 -1
- package/es/components/upload/src/index.mjs +3 -2
- package/es/components/upload/src/index.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger.mjs +2 -1
- package/es/components/upload/src/upload-dragger.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/utils/validators.d.ts +0 -1
- package/es/utils/validators.mjs +1 -9
- package/es/utils/validators.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/src/affix2.js +2 -1
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/autocomplete/src/index.js +2 -1
- package/lib/components/autocomplete/src/index.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +2 -1
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/button/src/button2.js +11 -7
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/carousel/src/item.js +4 -2
- package/lib/components/carousel/src/item.js.map +1 -1
- package/lib/components/cascader/src/index.js +38 -21
- package/lib/components/cascader/src/index.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js +16 -13
- package/lib/components/cascader-panel/src/index.js.map +1 -1
- package/lib/components/cascader-panel/src/menu.js +25 -22
- package/lib/components/cascader-panel/src/menu.js.map +1 -1
- package/lib/components/cascader-panel/src/node2.js +6 -2
- package/lib/components/cascader-panel/src/node2.js.map +1 -1
- package/lib/components/checkbox/index.d.ts +33 -0
- package/lib/components/checkbox/src/checkbox-button.js +21 -15
- package/lib/components/checkbox/src/checkbox-button.js.map +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +11 -0
- package/lib/components/checkbox/src/checkbox-group.js +5 -2
- package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
- package/lib/components/checkbox/src/checkbox.js +35 -27
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox.vue.d.ts +11 -0
- package/lib/components/collapse/src/collapse-item.js +3 -3
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/color-picker/src/index.js +8 -5
- package/lib/components/color-picker/src/index.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/basic-date-table.js +2 -1
- package/lib/components/date-picker/src/date-picker-com/basic-date-table.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/basic-month-table.js +2 -1
- package/lib/components/date-picker/src/date-picker-com/basic-month-table.js.map +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.js +1 -1
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.js.map +1 -1
- package/lib/components/descriptions/src/index.js +7 -2
- package/lib/components/descriptions/src/index.js.map +1 -1
- package/lib/components/dialog/src/dialog.js +1 -3
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-item.js +12 -6
- package/lib/components/dropdown/src/dropdown-item.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-menu.js +2 -1
- package/lib/components/dropdown/src/dropdown-menu.js.map +1 -1
- package/lib/components/dropdown/src/dropdown2.js +9 -5
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/focus-trap/src/focus-trap.js +1 -1
- package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
- package/lib/components/form/src/form-item.js +6 -4
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/image/src/image2.js +3 -2
- package/lib/components/image/src/image2.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +3 -2
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/input/src/input2.js +17 -8
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js +12 -6
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/message/src/message2.js +1 -1
- package/lib/components/message-box/src/index.js +4 -2
- package/lib/components/message-box/src/index.js.map +1 -1
- package/lib/components/notification/src/notification2.js +1 -1
- package/lib/components/pagination/src/components/jumper.js +5 -2
- package/lib/components/pagination/src/components/jumper.js.map +1 -1
- package/lib/components/pagination/src/components/sizes.js +2 -1
- package/lib/components/pagination/src/components/sizes.js.map +1 -1
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +45 -104
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +107 -45
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popover/src/index.js +4 -2
- package/lib/components/popover/src/index.js.map +1 -1
- package/lib/components/popper/src/content.js +5 -3
- package/lib/components/popper/src/content.js.map +1 -1
- package/lib/components/popper/src/trigger.js +1 -1
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/progress/src/progress2.js +2 -1
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/radio/src/radio-button2.js +4 -4
- package/lib/components/radio/src/radio-button2.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +1 -1
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +10 -6
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.js.map +1 -1
- package/lib/components/scrollbar/src/bar2.js +2 -1
- package/lib/components/scrollbar/src/bar2.js.map +1 -1
- package/lib/components/scrollbar/src/scrollbar2.js +2 -2
- package/lib/components/select/src/option-group.js +2 -1
- package/lib/components/select/src/option-group.js.map +1 -1
- package/lib/components/select/src/select-dropdown.js +2 -1
- package/lib/components/select/src/select-dropdown.js.map +1 -1
- package/lib/components/select/src/select.js +2 -1
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select-v2/src/select-dropdown.js +2 -1
- package/lib/components/select-v2/src/select-dropdown.js.map +1 -1
- package/lib/components/select-v2/src/select.js +192 -186
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/slider/src/index.js +3 -2
- package/lib/components/slider/src/index.js.map +1 -1
- package/lib/components/slider/src/marker.js +2 -1
- package/lib/components/slider/src/marker.js.map +1 -1
- package/lib/components/steps/src/item.js +2 -1
- package/lib/components/steps/src/item.js.map +1 -1
- package/lib/components/switch/src/switch2.js +4 -2
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/table/src/filter-panel.js +7 -3
- package/lib/components/table/src/filter-panel.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +3 -2
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.js +16 -8
- package/lib/components/time-picker/src/common/picker.js.map +1 -1
- package/lib/components/time-select/src/time-select.js +4 -2
- package/lib/components/time-select/src/time-select.js.map +1 -1
- package/lib/components/tooltip/src/content.js +9 -4
- package/lib/components/tooltip/src/content.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +2 -1
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/transfer/src/index.js +2 -1
- package/lib/components/transfer/src/index.js.map +1 -1
- package/lib/components/tree/src/tree.js +2 -1
- package/lib/components/tree/src/tree.js.map +1 -1
- package/lib/components/tree-v2/src/tree-node.js +11 -7
- package/lib/components/tree-v2/src/tree-node.js.map +1 -1
- package/lib/components/tree-v2/src/tree.js +2 -1
- package/lib/components/tree-v2/src/tree.js.map +1 -1
- package/lib/components/upload/src/index.js +3 -2
- package/lib/components/upload/src/index.js.map +1 -1
- package/lib/components/upload/src/upload-dragger.js +2 -1
- package/lib/components/upload/src/upload-dragger.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/validators.d.ts +0 -1
- package/lib/utils/validators.js +0 -9
- package/lib/utils/validators.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -131,7 +131,8 @@ const _sfc_main = defineComponent({
|
|
|
131
131
|
if (val) {
|
|
132
132
|
if (props.boxType === "alert" || props.boxType === "confirm") {
|
|
133
133
|
nextTick().then(() => {
|
|
134
|
-
|
|
134
|
+
var _a, _b, _c;
|
|
135
|
+
(_c = (_b = (_a = confirmRef.value) == null ? void 0 : _a.$el) == null ? void 0 : _b.focus) == null ? void 0 : _c.call(_b);
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
138
|
state.zIndex = PopupManager.nextZIndex();
|
|
@@ -180,12 +181,13 @@ const _sfc_main = defineComponent({
|
|
|
180
181
|
}
|
|
181
182
|
};
|
|
182
183
|
const handleAction = (action) => {
|
|
184
|
+
var _a;
|
|
183
185
|
if (props.boxType === "prompt" && action === "confirm" && !validate()) {
|
|
184
186
|
return;
|
|
185
187
|
}
|
|
186
188
|
state.action = action;
|
|
187
189
|
if (state.beforeClose) {
|
|
188
|
-
state.beforeClose
|
|
190
|
+
(_a = state.beforeClose) == null ? void 0 : _a.call(state, action, state, doClose);
|
|
189
191
|
} else {
|
|
190
192
|
doClose();
|
|
191
193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","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=\"['is-message-box', modalClass]\"\n :mask=\"modal\"\n @click.self=\"handleWrapperClick\"\n >\n <div\n ref=\"root\"\n v-trap-focus\n role=\"dialog\"\n :aria-label=\"title || 'dialog'\"\n aria-modal=\"true\"\n :class=\"[\n 'el-message-box',\n customClass,\n { 'el-message-box--center': center },\n ]\"\n :style=\"customStyle\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n class=\"el-message-box__header\"\n >\n <div class=\"el-message-box__title\">\n <el-icon\n v-if=\"iconComponent && center\"\n class=\"el-message-box__status\"\n :class=\"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=\"el-message-box__headerbtn\"\n aria-label=\"Close\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon class=\"el-message-box__close\"><close /></el-icon>\n </button>\n </div>\n <div class=\"el-message-box__content\">\n <div class=\"el-message-box__container\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n class=\"el-message-box__status\"\n :class=\"typeClass\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" class=\"el-message-box__message\">\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\">{{ message }}</p>\n <p v-else v-html=\"message\"></p>\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" class=\"el-message-box__input\">\n <el-input\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :class=\"{ invalid: validateError }\"\n @keydown.prevent.enter=\"handleInputEnter\"\n />\n <div\n class=\"el-message-box__errormsg\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div class=\"el-message-box__btns\">\n <el-button\n v-if=\"showCancelButton\"\n :loading=\"cancelButtonLoading\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"buttonSize || ''\"\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=\"primary\"\n :loading=\"confirmButtonLoading\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"buttonSize || ''\"\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-overlay>\n </transition>\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n nextTick,\n onMounted,\n onBeforeUnmount,\n computed,\n watch,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useModal,\n useLockscreen,\n useLocale,\n useRestoreActive,\n usePreventGlobal,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport { PopupManager } from '@element-plus/utils/popup-manager'\nimport { on, off } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\nimport { isValidComponentSize } from '@element-plus/utils/validators'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils/icon'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/utils/types'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\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 roundButton: {\n default: false,\n type: Boolean,\n },\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 { t } = useLocale()\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: null,\n inputValidator: null,\n inputErrorMessage: '',\n message: null,\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 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: PopupManager.nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return type && TypeComponentsMap[type]\n ? `el-message-box-icon--${type}`\n : ''\n })\n\n const iconComponent = computed(\n () => state.icon || TypeComponentsMap[state.type] || ''\n )\n const hasMessage = computed(() => !!state.message)\n const inputRef = ref<ComponentPublicInstance>(null)\n const confirmRef = ref<ComponentPublicInstance>(null)\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 !== null) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType === 'alert' || props.boxType === 'confirm') {\n nextTick().then(() => {\n confirmRef.value?.$el?.focus?.()\n })\n }\n state.zIndex = PopupManager.nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n getInputElement().focus()\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n on(window, 'hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n off(window, '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 handleInputEnter = () => {\n if (state.inputType !== 'textarea') {\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 (typeof inputValidator === 'function') {\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 (typeof validateResult === 'string') {\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 liek this\n // to dispatch, it could callout another message box.\n if (props.closeOnPressEscape) {\n useModal(\n {\n handleClose,\n },\n visible\n )\n } else {\n usePreventGlobal(\n visible,\n 'keydown',\n (e: KeyboardEvent) => e.code === EVENT_CODE.esc\n )\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible)\n }\n\n // restore to prev active element.\n useRestoreActive(visible)\n\n return {\n ...toRefs(state),\n visible,\n hasMessage,\n typeClass,\n iconComponent,\n confirmButtonClasses,\n inputRef,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"names":["_openBlock","_Transition","_createVNode","_createElementBlock","_createCommentVNode","_withModifiers","_withCtx","_createElementVNode","_normalizeClass"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2JA,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA;AAAA,EAEF,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,OACG;AAAA;AAAA,EAEL,cAAc;AAAA,EACd,OAAO;AAAA,IACL,YA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kBAEb,uBAAe;AAAA,kBACf,WAAW;AAAA,kBACX,aAAK;AAAA,kBACL,sBAAO,gBAAgB;AAAA;mBAE1B,SAOM;AAAA,mCANE;AAAA,kBACL,OAAK;AAAA,wCAAkC;AAAA;;;uBAXtB;AAAA;;;+BAqBd,OAAgB;AAAA;gBACrB;AAAA,gBACA,SAAK;AAAA,gBACL,OAAOC,eAAW;AAAA,gBAClB,OAAM;AAAA,gBACN,WAAK;AAAA,gBACL,SAAO;AAAA;;;;;;iFAIV,QAaY;AAAA,6BAXNN,YAAY;AAAA,gBAChB,KAAI;AAAA,gBACH;AAAA,gBACA,SAAK;AAAA,gBACL,OAAOM,eAAW;AAAA,gBAClB,YAAU;AAAA,gBACV,UAAM;AAAA,gBACN,WAAK;AAAA,gBACL,SAAO;AAAA;;;;;;oBATA,qBAAiB;AAAA;;;;;;;;YAhGvB,YAAO;AAAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","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=\"['is-message-box', modalClass]\"\n :mask=\"modal\"\n @click.self=\"handleWrapperClick\"\n >\n <div\n ref=\"root\"\n v-trap-focus\n role=\"dialog\"\n :aria-label=\"title || 'dialog'\"\n aria-modal=\"true\"\n :class=\"[\n 'el-message-box',\n customClass,\n { 'el-message-box--center': center },\n ]\"\n :style=\"customStyle\"\n >\n <div\n v-if=\"title !== null && title !== undefined\"\n class=\"el-message-box__header\"\n >\n <div class=\"el-message-box__title\">\n <el-icon\n v-if=\"iconComponent && center\"\n class=\"el-message-box__status\"\n :class=\"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=\"el-message-box__headerbtn\"\n aria-label=\"Close\"\n @click=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n @keydown.prevent.enter=\"\n handleAction(distinguishCancelAndClose ? 'close' : 'cancel')\n \"\n >\n <el-icon class=\"el-message-box__close\"><close /></el-icon>\n </button>\n </div>\n <div class=\"el-message-box__content\">\n <div class=\"el-message-box__container\">\n <el-icon\n v-if=\"iconComponent && !center && hasMessage\"\n class=\"el-message-box__status\"\n :class=\"typeClass\"\n >\n <component :is=\"iconComponent\" />\n </el-icon>\n <div v-if=\"hasMessage\" class=\"el-message-box__message\">\n <slot>\n <p v-if=\"!dangerouslyUseHTMLString\">{{ message }}</p>\n <p v-else v-html=\"message\"></p>\n </slot>\n </div>\n </div>\n <div v-show=\"showInput\" class=\"el-message-box__input\">\n <el-input\n ref=\"inputRef\"\n v-model=\"inputValue\"\n :type=\"inputType\"\n :placeholder=\"inputPlaceholder\"\n :class=\"{ invalid: validateError }\"\n @keydown.prevent.enter=\"handleInputEnter\"\n />\n <div\n class=\"el-message-box__errormsg\"\n :style=\"{\n visibility: !!editorErrorMessage ? 'visible' : 'hidden',\n }\"\n >\n {{ editorErrorMessage }}\n </div>\n </div>\n </div>\n <div class=\"el-message-box__btns\">\n <el-button\n v-if=\"showCancelButton\"\n :loading=\"cancelButtonLoading\"\n :class=\"[cancelButtonClass]\"\n :round=\"roundButton\"\n :size=\"buttonSize || ''\"\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=\"primary\"\n :loading=\"confirmButtonLoading\"\n :class=\"[confirmButtonClasses]\"\n :round=\"roundButton\"\n :disabled=\"confirmButtonDisabled\"\n :size=\"buttonSize || ''\"\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-overlay>\n </transition>\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n nextTick,\n onMounted,\n onBeforeUnmount,\n computed,\n watch,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport { TrapFocus } from '@element-plus/directives'\nimport {\n useModal,\n useLockscreen,\n useLocale,\n useRestoreActive,\n usePreventGlobal,\n} from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport { PopupManager } from '@element-plus/utils/popup-manager'\nimport { on, off } from '@element-plus/utils/dom'\nimport { EVENT_CODE } from '@element-plus/utils/aria'\nimport { isValidComponentSize } from '@element-plus/utils/validators'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils/icon'\n\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { ComponentSize } from '@element-plus/utils/types'\nimport type {\n Action,\n MessageBoxState,\n MessageBoxType,\n} from './message-box.type'\n\nexport default defineComponent({\n name: 'ElMessageBox',\n directives: {\n TrapFocus,\n },\n components: {\n ElButton,\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 roundButton: {\n default: false,\n type: Boolean,\n },\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 { t } = useLocale()\n const visible = ref(false)\n // s represents state\n const state = reactive<MessageBoxState>({\n beforeClose: null,\n callback: null,\n cancelButtonText: '',\n cancelButtonClass: '',\n confirmButtonText: '',\n confirmButtonClass: '',\n customClass: '',\n customStyle: {},\n dangerouslyUseHTMLString: false,\n distinguishCancelAndClose: false,\n icon: '',\n inputPattern: null,\n inputPlaceholder: '',\n inputType: 'text',\n inputValue: null,\n inputValidator: null,\n inputErrorMessage: '',\n message: null,\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 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: PopupManager.nextZIndex(),\n })\n\n const typeClass = computed(() => {\n const type = state.type\n return type && TypeComponentsMap[type]\n ? `el-message-box-icon--${type}`\n : ''\n })\n\n const iconComponent = computed(\n () => state.icon || TypeComponentsMap[state.type] || ''\n )\n const hasMessage = computed(() => !!state.message)\n const inputRef = ref<ComponentPublicInstance>(null)\n const confirmRef = ref<ComponentPublicInstance>(null)\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 !== null) {\n validate()\n }\n },\n { immediate: true }\n )\n\n watch(\n () => visible.value,\n (val) => {\n if (val) {\n if (props.boxType === 'alert' || props.boxType === 'confirm') {\n nextTick().then(() => {\n confirmRef.value?.$el?.focus?.()\n })\n }\n state.zIndex = PopupManager.nextZIndex()\n }\n if (props.boxType !== 'prompt') return\n if (val) {\n nextTick().then(() => {\n if (inputRef.value && inputRef.value.$el) {\n getInputElement().focus()\n }\n })\n } else {\n state.editorErrorMessage = ''\n state.validateError = false\n }\n }\n )\n\n onMounted(async () => {\n await nextTick()\n if (props.closeOnHashChange) {\n on(window, 'hashchange', doClose)\n }\n })\n\n onBeforeUnmount(() => {\n if (props.closeOnHashChange) {\n off(window, '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 handleInputEnter = () => {\n if (state.inputType !== 'textarea') {\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 (typeof inputValidator === 'function') {\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 (typeof validateResult === 'string') {\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 liek this\n // to dispatch, it could callout another message box.\n if (props.closeOnPressEscape) {\n useModal(\n {\n handleClose,\n },\n visible\n )\n } else {\n usePreventGlobal(\n visible,\n 'keydown',\n (e: KeyboardEvent) => e.code === EVENT_CODE.esc\n )\n }\n\n // locks the screen to prevent scroll\n if (props.lockScroll) {\n useLockscreen(visible)\n }\n\n // restore to prev active element.\n useRestoreActive(visible)\n\n return {\n ...toRefs(state),\n visible,\n hasMessage,\n typeClass,\n iconComponent,\n confirmButtonClasses,\n inputRef,\n confirmRef,\n doClose, // for outside usage\n handleClose, // for out side usage\n handleWrapperClick,\n handleInputEnter,\n handleAction,\n t,\n }\n },\n})\n</script>\n"],"names":["_withCtx"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2JA,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA;AAAA,EAEF,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,OACG;AAAA;AAAA,EAEL,cAAc;AAAA,EACd,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,WAAW;AAAA;AAAA,IAEb,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,mBAAmB;AAAA,MACjB,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,QAAQ;AAAA,IACR,aAAa;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA;AAAA,IAER,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA;AAAA;AAAA,EAGb,OAAO,CAAC,UAAU;AAAA,EAClB,MAAM,OAAO,EAAE,QAAQ;AAErB,UAAM,EAAE,MAAM;AACd,UAAM,UAAU,IAAI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GL;;;;AAEmB;AAIZ,8BAFK;AAAwB,kEAClC,oBAA+B;;AAArB;;;;;;AAYZ;AANc;;kBAEb;AAAe,kBACf;AAAW,kBACX;AAAK,kBACL;AAAuB;;AASpB;AANE,yBACA;AAAA,wCAAkC;AAAA;;;;AAXtB;;;;AAqBE;;AACrB;AACK,gBACL;AAAkB,gBAClB,OAAM;AAAA,gBACN;AAAK,gBACL;AAAO;;;;;;;AAiBE;AAXM,qBACZ;AAAA;AACH,gBACA;AAAK,gBACL;AAAkB,gBAClB;AAAU,gBACV;AAAM,gBACN,WAAK;AAAA,gBACL;AAAO;;;;;;;AATiB;;;;;;;;;AAhGhB;;;;;;;;;;;;"}
|
|
@@ -14,13 +14,16 @@ const _sfc_main = defineComponent({
|
|
|
14
14
|
const { t } = useLocale();
|
|
15
15
|
const { pageCount, disabled, currentPage, changeEvent } = usePagination();
|
|
16
16
|
const userInput = ref();
|
|
17
|
-
const innerValue = computed(() =>
|
|
17
|
+
const innerValue = computed(() => {
|
|
18
|
+
var _a;
|
|
19
|
+
return (_a = userInput.value) != null ? _a : currentPage == null ? void 0 : currentPage.value;
|
|
20
|
+
});
|
|
18
21
|
function handleInput(val) {
|
|
19
22
|
userInput.value = +val;
|
|
20
23
|
}
|
|
21
24
|
function handleChange(val) {
|
|
22
25
|
val = Math.trunc(+val);
|
|
23
|
-
changeEvent
|
|
26
|
+
changeEvent == null ? void 0 : changeEvent(+val);
|
|
24
27
|
userInput.value = void 0;
|
|
25
28
|
}
|
|
26
29
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jumper.mjs","sources":["../../../../../../../packages/components/pagination/src/components/jumper.vue"],"sourcesContent":["<template>\n <span class=\"el-pagination__jump\">\n {{ t('el.pagination.goto') }}\n <el-input\n size=\"small\"\n class=\"el-pagination__editor is-in-pagination\"\n :min=\"1\"\n :max=\"pageCount\"\n :disabled=\"disabled\"\n :model-value=\"innerValue\"\n type=\"number\"\n @update:model-value=\"handleInput\"\n @change=\"handleChange\"\n />\n {{ t('el.pagination.pageClassifier') }}\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, ref } from 'vue'\nimport { useLocale } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { usePagination } from '../usePagination'\n\nexport default defineComponent({\n name: 'ElPaginationJumper',\n components: {\n ElInput,\n },\n\n setup() {\n const { t } = useLocale()\n const { pageCount, disabled, currentPage, changeEvent } = usePagination()\n const userInput = ref<number>()\n const innerValue = computed(() => userInput.value ?? currentPage?.value)\n\n function handleInput(val: number | string) {\n userInput.value = +val\n }\n\n function handleChange(val: number | string) {\n val = Math.trunc(+val)\n changeEvent?.(+val)\n userInput.value = undefined\n }\n\n return {\n pageCount,\n disabled,\n innerValue,\n\n t,\n handleInput,\n handleChange,\n }\n },\n})\n</script>\n"],"names":[
|
|
1
|
+
{"version":3,"file":"jumper.mjs","sources":["../../../../../../../packages/components/pagination/src/components/jumper.vue"],"sourcesContent":["<template>\n <span class=\"el-pagination__jump\">\n {{ t('el.pagination.goto') }}\n <el-input\n size=\"small\"\n class=\"el-pagination__editor is-in-pagination\"\n :min=\"1\"\n :max=\"pageCount\"\n :disabled=\"disabled\"\n :model-value=\"innerValue\"\n type=\"number\"\n @update:model-value=\"handleInput\"\n @change=\"handleChange\"\n />\n {{ t('el.pagination.pageClassifier') }}\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { computed, defineComponent, ref } from 'vue'\nimport { useLocale } from '@element-plus/hooks'\nimport ElInput from '@element-plus/components/input'\nimport { usePagination } from '../usePagination'\n\nexport default defineComponent({\n name: 'ElPaginationJumper',\n components: {\n ElInput,\n },\n\n setup() {\n const { t } = useLocale()\n const { pageCount, disabled, currentPage, changeEvent } = usePagination()\n const userInput = ref<number>()\n const innerValue = computed(() => userInput.value ?? currentPage?.value)\n\n function handleInput(val: number | string) {\n userInput.value = +val\n }\n\n function handleChange(val: number | string) {\n val = Math.trunc(+val)\n changeEvent?.(+val)\n userInput.value = undefined\n }\n\n return {\n pageCount,\n disabled,\n innerValue,\n\n t,\n handleInput,\n handleChange,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;AAwBA,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA;AAAA,EAGF,QAAQ;AACN,UAAM,EAAE,MAAM;AACd,UAAM,EAAE,WAAW,UAAU,aAAa,gBAAgB;AAC1D,UAAM,YAAY;AAClB,UAAM,aAAa,SAAS,MAAM;AAElC;AACE,gBAAU;AAAS;AAGrB;AACE,wBAAkB;AAClB;AACA;AAAkB;AAGpB;AAAO,MACL;AAAA;AACA;AACA,MAEA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;;AAnDE,qBAWF;AAAA;AATY;AACP;AACE;AACD,MACL;AAAU,MACV;AAAa,MACd;AAAa,MACZ;AAAA,MACA,uBAAQ;AAAY;;AAEnB;;;;;;;;;;"}
|
|
@@ -47,9 +47,10 @@ const _sfc_main = defineComponent({
|
|
|
47
47
|
});
|
|
48
48
|
const innerPagesizes = computed(() => props.pageSizes);
|
|
49
49
|
function handleChange(val) {
|
|
50
|
+
var _a;
|
|
50
51
|
if (val !== innerPageSize.value) {
|
|
51
52
|
innerPageSize.value = val;
|
|
52
|
-
pagination.handleSizeChange
|
|
53
|
+
(_a = pagination.handleSizeChange) == null ? void 0 : _a.call(pagination, Number(val));
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.mjs","sources":["../../../../../../../packages/components/pagination/src/components/sizes.vue"],"sourcesContent":["<template>\n <span class=\"el-pagination__sizes\">\n <el-select\n :model-value=\"innerPageSize\"\n :disabled=\"disabled\"\n :popper-class=\"popperClass\"\n size=\"small\"\n @change=\"handleChange\"\n >\n <el-option\n v-for=\"item in innerPagesizes\"\n :key=\"item\"\n :value=\"item\"\n :label=\"item + t('el.pagination.pagesize')\"\n />\n </el-select>\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, watch, computed, ref } from 'vue'\nimport isEqual from 'lodash/isEqual'\nimport { ElSelect, ElOption } from '@element-plus/components/select'\nimport { useLocale } from '@element-plus/hooks'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils/props'\nimport { usePagination } from '../usePagination'\n\nimport type { Nullable } from '@element-plus/utils/types'\n\nconst paginationSizesProps = buildProps({\n pageSize: {\n type: Number,\n required: true,\n },\n pageSizes: {\n type: definePropType<number[]>(Array),\n default: () => mutable([10, 20, 30, 40, 50, 100] as const),\n },\n popperClass: {\n type: String,\n default: '',\n },\n disabled: Boolean,\n} as const)\n\nexport default defineComponent({\n name: 'ElPaginationSizes',\n\n components: {\n ElSelect,\n ElOption,\n },\n\n props: paginationSizesProps,\n emits: ['page-size-change'],\n\n setup(props, { emit }) {\n const { t } = useLocale()\n const pagination = usePagination()\n const innerPageSize = ref<Nullable<number>>(props.pageSize)\n\n watch(\n () => props.pageSizes,\n (newVal, oldVal) => {\n if (isEqual(newVal, oldVal)) return\n if (Array.isArray(newVal)) {\n const pageSize =\n newVal.indexOf(props.pageSize) > -1\n ? props.pageSize\n : props.pageSizes[0]\n emit('page-size-change', pageSize)\n }\n }\n )\n\n watch(\n () => props.pageSize,\n (newVal) => {\n innerPageSize.value = newVal\n }\n )\n\n const innerPagesizes = computed(() => props.pageSizes)\n\n function handleChange(val: number) {\n if (val !== innerPageSize.value) {\n innerPageSize.value = val\n pagination.handleSizeChange?.(Number(val))\n }\n }\n\n return {\n innerPagesizes,\n innerPageSize,\n\n t,\n handleChange,\n }\n },\n})\n</script>\n"],"names":["_openBlock"
|
|
1
|
+
{"version":3,"file":"sizes.mjs","sources":["../../../../../../../packages/components/pagination/src/components/sizes.vue"],"sourcesContent":["<template>\n <span class=\"el-pagination__sizes\">\n <el-select\n :model-value=\"innerPageSize\"\n :disabled=\"disabled\"\n :popper-class=\"popperClass\"\n size=\"small\"\n @change=\"handleChange\"\n >\n <el-option\n v-for=\"item in innerPagesizes\"\n :key=\"item\"\n :value=\"item\"\n :label=\"item + t('el.pagination.pagesize')\"\n />\n </el-select>\n </span>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, watch, computed, ref } from 'vue'\nimport isEqual from 'lodash/isEqual'\nimport { ElSelect, ElOption } from '@element-plus/components/select'\nimport { useLocale } from '@element-plus/hooks'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils/props'\nimport { usePagination } from '../usePagination'\n\nimport type { Nullable } from '@element-plus/utils/types'\n\nconst paginationSizesProps = buildProps({\n pageSize: {\n type: Number,\n required: true,\n },\n pageSizes: {\n type: definePropType<number[]>(Array),\n default: () => mutable([10, 20, 30, 40, 50, 100] as const),\n },\n popperClass: {\n type: String,\n default: '',\n },\n disabled: Boolean,\n} as const)\n\nexport default defineComponent({\n name: 'ElPaginationSizes',\n\n components: {\n ElSelect,\n ElOption,\n },\n\n props: paginationSizesProps,\n emits: ['page-size-change'],\n\n setup(props, { emit }) {\n const { t } = useLocale()\n const pagination = usePagination()\n const innerPageSize = ref<Nullable<number>>(props.pageSize)\n\n watch(\n () => props.pageSizes,\n (newVal, oldVal) => {\n if (isEqual(newVal, oldVal)) return\n if (Array.isArray(newVal)) {\n const pageSize =\n newVal.indexOf(props.pageSize) > -1\n ? props.pageSize\n : props.pageSizes[0]\n emit('page-size-change', pageSize)\n }\n }\n )\n\n watch(\n () => props.pageSize,\n (newVal) => {\n innerPageSize.value = newVal\n }\n )\n\n const innerPagesizes = computed(() => props.pageSizes)\n\n function handleChange(val: number) {\n if (val !== innerPageSize.value) {\n innerPageSize.value = val\n pagination.handleSizeChange?.(Number(val))\n }\n }\n\n return {\n innerPagesizes,\n innerPageSize,\n\n t,\n handleChange,\n }\n },\n})\n</script>\n"],"names":["_openBlock"],"mappings":";;;;;;;;;AA6BA,MAAM,uBAAuB,WAAW;AAAA,EACtC,UAAU;AAAA,IACR,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,WAAW;AAAA,IACT,MAAM,eAAyB;AAAA,IAC/B,SAAS,MAAM,QAAQ,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI;AAAA;AAAA,EAE9C,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,UAAU;AAAA;AAGZ,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA;AAAA,EAGF,OAAO;AAAA,EACP,OAAO,CAAC;AAAA,EAER,MAAM,OAAO,EAAE,QAAQ;AACrB,UAAM,EAAE,MAAM;AACd,UAAM,aAAa;AACnB,UAAM,gBAAgB,IAAsB,MAAM;AAElD,UACE,MAAM,MAAM,WACZ,CAAC,QAAQ,WAAW;AAClB,UAAI,QAAQ,QAAQ;AAAS;AAC7B,UAAI,MAAM,QAAQ,SAAS;AACzB,cAAM,WACJ,OAAO,QAAQ,MAAM,YAAY,KAC7B,MAAM,WACN,MAAM,UAAU;AACtB,aAAK,oBAAoB;AAAA;AAAA;AAK/B,UACE,MAAM,MAAM,UACZ,CAAC,WAAW;AACV,oBAAc,QAAQ;AAAA;AAI1B,UAAM,iBAAiB,SAAS,MAAM,MAAM;AAE5C,0BAAsB,KAAa;AACjC,UAAI;AACF;AACA;AAAqC;AAAA;AAIzC;AAAO;AACL,MACA;AAAA,MAEA;AAAA,MACA;AAAA;AAAA;AAAA;;;;;;AAjFU;AAZiB;AAChB,MACV,eAAY;AAAA,MACb;AAAY,MACX;AAAA;;;AAED;;AAEY,iBACJA;AAAA,YACL;AAAO;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import Popconfirm from './src/
|
|
3
|
-
export { popconfirmProps } from './src/
|
|
2
|
+
import Popconfirm from './src/popconfirm2.mjs';
|
|
3
|
+
export { popconfirmProps } from './src/popconfirm.mjs';
|
|
4
4
|
|
|
5
5
|
const ElPopconfirm = withInstall(Popconfirm);
|
|
6
6
|
|
|
@@ -1,110 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import '../../../hooks/index.mjs';
|
|
6
|
-
import { popconfirmProps } from './popconfirm2.mjs';
|
|
7
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
-
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
1
|
+
import '../../button/index.mjs';
|
|
2
|
+
import { QuestionFilled } from '@element-plus/icons-vue';
|
|
3
|
+
import { buildProps, definePropType } from '../../../utils/props.mjs';
|
|
4
|
+
import { buttonType } from '../../button/src/button.mjs';
|
|
9
5
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
ElButton,
|
|
14
|
-
ElTooltip,
|
|
15
|
-
ElIcon
|
|
6
|
+
const popconfirmProps = buildProps({
|
|
7
|
+
title: {
|
|
8
|
+
type: String
|
|
16
9
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
10
|
+
confirmButtonText: {
|
|
11
|
+
type: String
|
|
12
|
+
},
|
|
13
|
+
cancelButtonText: {
|
|
14
|
+
type: String
|
|
15
|
+
},
|
|
16
|
+
confirmButtonType: {
|
|
17
|
+
type: String,
|
|
18
|
+
values: buttonType,
|
|
19
|
+
default: "primary"
|
|
20
|
+
},
|
|
21
|
+
cancelButtonType: {
|
|
22
|
+
type: String,
|
|
23
|
+
values: buttonType,
|
|
24
|
+
default: "text"
|
|
25
|
+
},
|
|
26
|
+
icon: {
|
|
27
|
+
type: definePropType([String, Object]),
|
|
28
|
+
default: QuestionFilled
|
|
29
|
+
},
|
|
30
|
+
iconColor: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "#f90"
|
|
33
|
+
},
|
|
34
|
+
hideIcon: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
hideAfter: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 200
|
|
41
|
+
},
|
|
42
|
+
onConfirm: {
|
|
43
|
+
type: definePropType(Function)
|
|
44
|
+
},
|
|
45
|
+
onCancel: {
|
|
46
|
+
type: definePropType(Function)
|
|
44
47
|
}
|
|
45
48
|
});
|
|
46
|
-
const _hoisted_1 = { class: "el-popconfirm" };
|
|
47
|
-
const _hoisted_2 = { class: "el-popconfirm__main" };
|
|
48
|
-
const _hoisted_3 = { class: "el-popconfirm__action" };
|
|
49
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
50
|
-
const _component_el_icon = resolveComponent("el-icon");
|
|
51
|
-
const _component_el_button = resolveComponent("el-button");
|
|
52
|
-
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
53
|
-
return openBlock(), createBlock(_component_el_tooltip, mergeProps({ ref: "tooltipRef" }, _ctx.$attrs, {
|
|
54
|
-
trigger: "click",
|
|
55
|
-
effect: "light",
|
|
56
|
-
"popper-class": "el-popover",
|
|
57
|
-
"append-to-body": "",
|
|
58
|
-
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
59
|
-
"hide-after": _ctx.hideAfter,
|
|
60
|
-
persistent: ""
|
|
61
|
-
}), {
|
|
62
|
-
content: withCtx(() => [
|
|
63
|
-
createElementVNode("div", _hoisted_1, [
|
|
64
|
-
createElementVNode("div", _hoisted_2, [
|
|
65
|
-
!_ctx.hideIcon && _ctx.icon ? (openBlock(), createBlock(_component_el_icon, {
|
|
66
|
-
key: 0,
|
|
67
|
-
class: "el-popconfirm__icon",
|
|
68
|
-
style: normalizeStyle({ color: _ctx.iconColor })
|
|
69
|
-
}, {
|
|
70
|
-
default: withCtx(() => [
|
|
71
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
|
|
72
|
-
]),
|
|
73
|
-
_: 1
|
|
74
|
-
}, 8, ["style"])) : createCommentVNode("v-if", true),
|
|
75
|
-
createTextVNode(" " + toDisplayString(_ctx.title), 1)
|
|
76
|
-
]),
|
|
77
|
-
createElementVNode("div", _hoisted_3, [
|
|
78
|
-
createVNode(_component_el_button, {
|
|
79
|
-
size: "small",
|
|
80
|
-
type: _ctx.cancelButtonType,
|
|
81
|
-
onClick: _ctx.cancel
|
|
82
|
-
}, {
|
|
83
|
-
default: withCtx(() => [
|
|
84
|
-
createTextVNode(toDisplayString(_ctx.finalCancelButtonText), 1)
|
|
85
|
-
]),
|
|
86
|
-
_: 1
|
|
87
|
-
}, 8, ["type", "onClick"]),
|
|
88
|
-
createVNode(_component_el_button, {
|
|
89
|
-
size: "small",
|
|
90
|
-
type: _ctx.confirmButtonType,
|
|
91
|
-
onClick: _ctx.confirm
|
|
92
|
-
}, {
|
|
93
|
-
default: withCtx(() => [
|
|
94
|
-
createTextVNode(toDisplayString(_ctx.finalConfirmButtonText), 1)
|
|
95
|
-
]),
|
|
96
|
-
_: 1
|
|
97
|
-
}, 8, ["type", "onClick"])
|
|
98
|
-
])
|
|
99
|
-
])
|
|
100
|
-
]),
|
|
101
|
-
default: withCtx(() => [
|
|
102
|
-
_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
|
|
103
|
-
]),
|
|
104
|
-
_: 3
|
|
105
|
-
}, 16, ["hide-after"]);
|
|
106
|
-
}
|
|
107
|
-
var Popconfirm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
108
49
|
|
|
109
|
-
export {
|
|
50
|
+
export { popconfirmProps };
|
|
110
51
|
//# sourceMappingURL=popconfirm.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popconfirm.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.
|
|
1
|
+
{"version":3,"file":"popconfirm.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.ts"],"sourcesContent":["import { buttonType } from '@element-plus/components/button'\nimport { QuestionFilled } from '@element-plus/icons-vue'\nimport { buildProps, definePropType } from '@element-plus/utils/props'\n\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const popconfirmProps = buildProps({\n title: {\n type: String,\n },\n confirmButtonText: {\n type: String,\n },\n cancelButtonText: {\n type: String,\n },\n confirmButtonType: {\n type: String,\n values: buttonType,\n default: 'primary',\n },\n cancelButtonType: {\n type: String,\n values: buttonType,\n default: 'text',\n },\n icon: {\n type: definePropType<string | Component>([String, Object]),\n default: QuestionFilled as any,\n },\n iconColor: {\n type: String,\n default: '#f90',\n },\n hideIcon: {\n type: Boolean,\n default: false,\n },\n hideAfter: {\n type: Number,\n default: 200,\n },\n onConfirm: {\n type: definePropType<(e: Event) => Promise<boolean> | boolean>(Function),\n },\n onCancel: {\n type: definePropType<(e: Event) => Promise<boolean> | boolean>(Function),\n },\n} as const)\nexport type PopconfirmProps = ExtractPropTypes<typeof popconfirmProps>\n"],"names":[],"mappings":";;;;;AAGY,MAAC,eAAe,GAAG,UAAU,CAAC;AAC1C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,cAAc;AAC3B,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,51 +1,113 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { defineComponent, ref, unref, computed, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeStyle, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, createVNode, renderSlot } from 'vue';
|
|
2
|
+
import { ElButton } from '../../button/index.mjs';
|
|
3
|
+
import { ElIcon } from '../../icon/index.mjs';
|
|
4
|
+
import { ElTooltip } from '../../tooltip/index.mjs';
|
|
5
|
+
import '../../../hooks/index.mjs';
|
|
6
|
+
import { popconfirmProps } from './popconfirm.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
|
5
9
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
const _sfc_main = defineComponent({
|
|
11
|
+
name: "ElPopconfirm",
|
|
12
|
+
components: {
|
|
13
|
+
ElButton,
|
|
14
|
+
ElTooltip,
|
|
15
|
+
ElIcon
|
|
9
16
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
default: 200
|
|
41
|
-
},
|
|
42
|
-
onConfirm: {
|
|
43
|
-
type: definePropType(Function)
|
|
44
|
-
},
|
|
45
|
-
onCancel: {
|
|
46
|
-
type: definePropType(Function)
|
|
17
|
+
props: popconfirmProps,
|
|
18
|
+
setup(props) {
|
|
19
|
+
const { t } = useLocale();
|
|
20
|
+
const tooltipRef = ref();
|
|
21
|
+
const hidePopper = () => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
(_b = (_a = unref(tooltipRef)) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a);
|
|
24
|
+
};
|
|
25
|
+
const handleCallback = () => {
|
|
26
|
+
hidePopper();
|
|
27
|
+
};
|
|
28
|
+
const confirm = (e) => {
|
|
29
|
+
var _a;
|
|
30
|
+
(_a = props.onConfirm) == null ? void 0 : _a.call(props, e);
|
|
31
|
+
handleCallback();
|
|
32
|
+
};
|
|
33
|
+
const cancel = (e) => {
|
|
34
|
+
var _a;
|
|
35
|
+
(_a = props.onCancel) == null ? void 0 : _a.call(props, e);
|
|
36
|
+
handleCallback();
|
|
37
|
+
};
|
|
38
|
+
const finalConfirmButtonText = computed(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
|
|
39
|
+
const finalCancelButtonText = computed(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
|
|
40
|
+
return {
|
|
41
|
+
finalConfirmButtonText,
|
|
42
|
+
finalCancelButtonText,
|
|
43
|
+
tooltipRef,
|
|
44
|
+
confirm,
|
|
45
|
+
cancel
|
|
46
|
+
};
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
+
const _hoisted_1 = { class: "el-popconfirm" };
|
|
50
|
+
const _hoisted_2 = { class: "el-popconfirm__main" };
|
|
51
|
+
const _hoisted_3 = { class: "el-popconfirm__action" };
|
|
52
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
53
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
54
|
+
const _component_el_button = resolveComponent("el-button");
|
|
55
|
+
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
56
|
+
return openBlock(), createBlock(_component_el_tooltip, mergeProps({ ref: "tooltipRef" }, _ctx.$attrs, {
|
|
57
|
+
trigger: "click",
|
|
58
|
+
effect: "light",
|
|
59
|
+
"popper-class": "el-popover",
|
|
60
|
+
"append-to-body": "",
|
|
61
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
62
|
+
"hide-after": _ctx.hideAfter,
|
|
63
|
+
persistent: ""
|
|
64
|
+
}), {
|
|
65
|
+
content: withCtx(() => [
|
|
66
|
+
createElementVNode("div", _hoisted_1, [
|
|
67
|
+
createElementVNode("div", _hoisted_2, [
|
|
68
|
+
!_ctx.hideIcon && _ctx.icon ? (openBlock(), createBlock(_component_el_icon, {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "el-popconfirm__icon",
|
|
71
|
+
style: normalizeStyle({ color: _ctx.iconColor })
|
|
72
|
+
}, {
|
|
73
|
+
default: withCtx(() => [
|
|
74
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}, 8, ["style"])) : createCommentVNode("v-if", true),
|
|
78
|
+
createTextVNode(" " + toDisplayString(_ctx.title), 1)
|
|
79
|
+
]),
|
|
80
|
+
createElementVNode("div", _hoisted_3, [
|
|
81
|
+
createVNode(_component_el_button, {
|
|
82
|
+
size: "small",
|
|
83
|
+
type: _ctx.cancelButtonType,
|
|
84
|
+
onClick: _ctx.cancel
|
|
85
|
+
}, {
|
|
86
|
+
default: withCtx(() => [
|
|
87
|
+
createTextVNode(toDisplayString(_ctx.finalCancelButtonText), 1)
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["type", "onClick"]),
|
|
91
|
+
createVNode(_component_el_button, {
|
|
92
|
+
size: "small",
|
|
93
|
+
type: _ctx.confirmButtonType,
|
|
94
|
+
onClick: _ctx.confirm
|
|
95
|
+
}, {
|
|
96
|
+
default: withCtx(() => [
|
|
97
|
+
createTextVNode(toDisplayString(_ctx.finalConfirmButtonText), 1)
|
|
98
|
+
]),
|
|
99
|
+
_: 1
|
|
100
|
+
}, 8, ["type", "onClick"])
|
|
101
|
+
])
|
|
102
|
+
])
|
|
103
|
+
]),
|
|
104
|
+
default: withCtx(() => [
|
|
105
|
+
_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
|
|
106
|
+
]),
|
|
107
|
+
_: 3
|
|
108
|
+
}, 16, ["hide-after"]);
|
|
109
|
+
}
|
|
110
|
+
var Popconfirm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
49
111
|
|
|
50
|
-
export {
|
|
112
|
+
export { Popconfirm as default };
|
|
51
113
|
//# sourceMappingURL=popconfirm2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popconfirm2.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.
|
|
1
|
+
{"version":3,"file":"popconfirm2.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n effect=\"light\"\n popper-class=\"el-popover\"\n append-to-body\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :hide-after=\"hideAfter\"\n persistent\n >\n <template #content>\n <div class=\"el-popconfirm\">\n <div class=\"el-popconfirm__main\">\n <el-icon\n v-if=\"!hideIcon && icon\"\n class=\"el-popconfirm__icon\"\n :style=\"{ color: iconColor }\"\n >\n <component :is=\"icon\" />\n </el-icon>\n {{ title }}\n </div>\n <div class=\"el-popconfirm__action\">\n <el-button size=\"small\" :type=\"cancelButtonType\" @click=\"cancel\">\n {{ finalCancelButtonText }}\n </el-button>\n <el-button size=\"small\" :type=\"confirmButtonType\" @click=\"confirm\">\n {{ finalConfirmButtonText }}\n </el-button>\n </div>\n </div>\n </template>\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, ref, computed, unref } from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport ElIcon from '@element-plus/components/icon'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { useLocale } from '@element-plus/hooks'\nimport { popconfirmProps } from './popconfirm'\n\nexport default defineComponent({\n name: 'ElPopconfirm',\n\n components: {\n ElButton,\n ElTooltip,\n ElIcon,\n },\n\n props: popconfirmProps,\n\n setup(props) {\n const { t } = useLocale()\n const tooltipRef = ref<{ onClose: () => void }>()\n\n const hidePopper = () => {\n unref(tooltipRef)?.onClose?.()\n }\n\n const handleCallback = () => {\n hidePopper()\n }\n\n const confirm = (e: Event) => {\n props.onConfirm?.(e)\n handleCallback()\n }\n const cancel = (e: Event) => {\n props.onCancel?.(e)\n handleCallback()\n }\n\n const finalConfirmButtonText = computed(\n () => props.confirmButtonText || t('el.popconfirm.confirmButtonText')\n )\n const finalCancelButtonText = computed(\n () => props.cancelButtonText || t('el.popconfirm.cancelButtonText')\n )\n\n return {\n finalConfirmButtonText,\n finalCancelButtonText,\n tooltipRef,\n\n confirm,\n cancel,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;AAgDA,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EAGF,OAAO;AAAA,EAEP,MAAM,OAAO;AACX,UAAM,EAAE,MAAM;AACd,UAAM,aAAa;AAEnB,UAAM,aAAa,MAAM;AACvB,YAAM;AAAa;AAGrB;AACE;AAAA;AAGF;AACE;AACA;AAAA;AAEF,oBAAgB;AACd;AACA;AAAA;AAGF,mCAA+B,SAC7B,MAAM;AAER;AAIA;AAAO;AACL;AACA;AACA,MAEA;AAAA,MACA;AAAA;AAAA;AAAA;;;;;;;;;AAzFa;AACR;AACP;AACc,IACb;AAAA,IACA;AAAqB,IACtB,cAAU;AAAA;;AAEC;AAoBH;AATE;AAPqB,2BADzB;;AAEO;AACC;;;AAEN;;;;AAEF;;;AAKY;AAFW;AAAQ;AAA0B;;;;;;;AAK7C;AAFW,YAAE;AAAM,uBAA2B;AAAA;;;;;;;;;;;AAMhC;;;;;;;;;;;;"}
|
|
@@ -17,7 +17,8 @@ const _sfc_main = defineComponent({
|
|
|
17
17
|
setup(props) {
|
|
18
18
|
const tooltipRef = ref(null);
|
|
19
19
|
const popperRef = computed(() => {
|
|
20
|
-
|
|
20
|
+
var _a;
|
|
21
|
+
return (_a = unref(tooltipRef)) == null ? void 0 : _a.popperRef;
|
|
21
22
|
});
|
|
22
23
|
const width = computed(() => {
|
|
23
24
|
if (isString(props.width)) {
|
|
@@ -41,7 +42,8 @@ const _sfc_main = defineComponent({
|
|
|
41
42
|
];
|
|
42
43
|
});
|
|
43
44
|
const hide = () => {
|
|
44
|
-
|
|
45
|
+
var _a;
|
|
46
|
+
(_a = tooltipRef.value) == null ? void 0 : _a.hide();
|
|
45
47
|
};
|
|
46
48
|
return {
|
|
47
49
|
kls,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/popover/src/index.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n persistent\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" class=\"el-popover__title\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, unref } from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { isString } from '@element-plus/utils/util'\nimport { usePopoverProps } from './popover'\n\nimport type { StyleValue } from 'vue'\n\nconst emits = ['update:visible', 'after-enter', 'after-leave']\n\nconst NAME = 'ElPopover'\n\nexport default defineComponent({\n name: NAME,\n components: {\n ElTooltip,\n },\n props: usePopoverProps,\n emits,\n setup(props) {\n const tooltipRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n })\n const width = computed(() => {\n if (isString(props.width)) {\n return props.width as string\n }\n return `${props.width}px`\n })\n\n const style = computed(() => {\n return [\n {\n width: width.value,\n },\n props.popperStyle,\n ] as StyleValue\n })\n\n const kls = computed(() => {\n return [\n { 'el-popover--plain': !!props.content },\n 'el-popover',\n props.popperClass,\n ]\n })\n\n const hide = () => {\n tooltipRef.value?.hide()\n }\n\n return {\n kls,\n style,\n tooltipRef,\n popperRef,\n hide,\n }\n },\n})\n</script>\n"],"names":[
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/popover/src/index.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n persistent\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" class=\"el-popover__title\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, unref } from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { isString } from '@element-plus/utils/util'\nimport { usePopoverProps } from './popover'\n\nimport type { StyleValue } from 'vue'\n\nconst emits = ['update:visible', 'after-enter', 'after-leave']\n\nconst NAME = 'ElPopover'\n\nexport default defineComponent({\n name: NAME,\n components: {\n ElTooltip,\n },\n props: usePopoverProps,\n emits,\n setup(props) {\n const tooltipRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n })\n const width = computed(() => {\n if (isString(props.width)) {\n return props.width as string\n }\n return `${props.width}px`\n })\n\n const style = computed(() => {\n return [\n {\n width: width.value,\n },\n props.popperStyle,\n ] as StyleValue\n })\n\n const kls = computed(() => {\n return [\n { 'el-popover--plain': !!props.content },\n 'el-popover',\n props.popperClass,\n ]\n })\n\n const hide = () => {\n tooltipRef.value?.hide()\n }\n\n return {\n kls,\n style,\n tooltipRef,\n popperRef,\n hide,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;AAiCA,MAAM,QAAQ,CAAC,kBAAkB,eAAe;AAEhD,MAAM,OAAO;AAEb,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA;AAAA,EAEF,OAAO;AAAA,EACP;AAAA,EACA,MAAM,OAAO;AACX,UAAM,aAAa,IAA2C;AAC9D,UAAM,YAAY,SAAS,MAAM;AAC/B,aAAO;AAAmB;AAE5B;AACE,UAAI,uBAAuB;AACzB;AAAa;AAEf;AAAgB;AAGlB;AACE;AAAO;AACL;AACe;AAAA;AAET;AAAA;AAIV;AACE,aAAO;AAAA;AAC0B,QAC/B;AAAA,QACA;AAAM;AAAA;AAIV;AACE,iBAAW;AAAO;AAGpB;AAAO,MACL;AAAA;AACA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;AAlEuB;AAA0B;;;;SAZlD;AAAiB;AACH;AACH,IACX;AAAc,IACd;AAAc,IACf,gBAAU;AAAA;;AAMC;AACO;AAKT;AADF;;;;AATyB;;;;;;;;;;;"}
|