@element-plus/nightly 0.0.20260514 → 0.0.20260516
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 +5 -5
- 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 +5 -5
- 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 +1 -1
- package/es/components/alert/src/alert.d.ts +1 -1
- package/es/components/anchor/src/anchor.d.ts +2 -2
- package/es/components/anchor/src/anchor.vue.d.ts +3 -3
- package/es/components/autocomplete/src/autocomplete.d.ts +4 -4
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +6 -6
- package/es/components/avatar/src/avatar-group.d.ts +1 -1
- package/es/components/backtop/src/backtop.vue.d.ts +2 -2
- package/es/components/badge/src/badge.d.ts +1 -1
- package/es/components/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 +1 -1
- package/es/components/button/src/button.vue.d.ts +2 -2
- package/es/components/button/src/use-button.d.ts +1 -1
- package/es/components/calendar/src/calendar.vue.d.ts +1 -1
- package/es/components/calendar/src/select-controller.vue.d.ts +2 -2
- package/es/components/card/src/card.vue.d.ts +1 -1
- package/es/components/carousel/src/carousel.d.ts +2 -2
- package/es/components/carousel/src/carousel.vue.d.ts +1 -1
- package/es/components/cascader/src/cascader.d.ts +2 -2
- package/es/components/cascader/src/cascader.vue.d.ts +11 -11
- package/es/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/es/components/check-tag/src/check-tag.d.ts +1 -1
- package/es/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
- package/es/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
- package/es/components/checkbox/src/checkbox.d.ts +3 -3
- package/es/components/checkbox/src/checkbox.vue.d.ts +5 -5
- package/es/components/col/src/col.vue.d.ts +2 -2
- package/es/components/collapse/src/collapse.vue.d.ts +2 -2
- package/es/components/color-picker/src/color-picker.vue.d.ts +8 -8
- 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-panel.d.ts +5 -5
- package/es/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/es/components/descriptions/src/description-item.d.ts +9 -9
- package/es/components/descriptions/src/description.d.ts +1 -1
- package/es/components/descriptions/src/description.vue.d.ts +1 -1
- package/es/components/dialog/src/dialog.vue.d.ts +3 -3
- package/es/components/divider/src/divider.d.ts +2 -2
- package/es/components/divider/src/divider.vue.d.ts +1 -1
- package/es/components/drawer/src/drawer.vue.d.ts +4 -4
- package/es/components/dropdown/src/dropdown-item-impl.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown-item-impl.vue.d.ts +2 -2
- package/es/components/dropdown/src/dropdown-item.vue.d.ts +6 -6
- package/es/components/dropdown/src/dropdown-menu.mjs.map +1 -1
- 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 +35 -35
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/es/components/form/src/form-item.d.ts +2 -2
- package/es/components/form/src/form-item.vue.d.ts +1 -1
- package/es/components/form/src/form.d.ts +1 -1
- package/es/components/image/src/image.vue.d.ts +2 -2
- package/es/components/index.d.ts +2 -2
- package/es/components/input/src/input.d.ts +3 -3
- package/es/components/input/src/input.vue.d.ts +16 -16
- package/es/components/input-number/src/input-number.d.ts +2 -2
- package/es/components/input-number/src/input-number.vue.d.ts +8 -8
- package/es/components/input-otp/src/input-otp.vue.d.ts +6 -6
- package/es/components/input-tag/src/input-tag.d.ts +2 -2
- package/es/components/input-tag/src/input-tag.vue.d.ts +9 -9
- package/es/components/link/src/link.d.ts +1 -1
- package/es/components/link/src/link.vue.d.ts +1 -1
- package/es/components/mention/src/mention.d.ts +4 -4
- package/es/components/mention/src/mention.vue.d.ts +5 -5
- package/es/components/menu/src/menu.d.ts +9 -9
- 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 +5 -5
- package/es/components/message-box/src/index.vue.d.ts +51 -51
- package/es/components/notification/src/notification.d.ts +1 -1
- package/es/components/notification/src/notification.vue.d.ts +4 -4
- package/es/components/page-header/src/page-header.vue.d.ts +1 -1
- package/es/components/pagination/src/components/next.vue.d.ts +1 -1
- package/es/components/pagination/src/components/pager.vue.d.ts +1 -1
- package/es/components/pagination/src/components/prev.vue.d.ts +1 -1
- package/es/components/pagination/src/pagination.d.ts +1 -1
- package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
- package/es/components/popover/src/popover.d.ts +2 -2
- package/es/components/popover/src/popover.vue.d.ts +2 -2
- package/es/components/popper/src/composables/use-content.d.ts +3 -3
- package/es/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/es/components/popper/src/content.vue.d.ts +6 -6
- 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 +3 -3
- package/es/components/radio/src/radio-button.vue.d.ts +3 -3
- package/es/components/radio/src/radio-group.vue.d.ts +4 -4
- package/es/components/radio/src/radio.d.ts +6 -6
- package/es/components/radio/src/radio.vue.d.ts +5 -5
- package/es/components/rate/src/rate.vue.d.ts +3 -3
- package/es/components/result/src/result.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +2 -2
- package/es/components/roving-focus-group/src/roving-focus-group.d.ts +1 -1
- package/es/components/roving-focus-group/src/roving-focus-group.vue.d.ts +2 -2
- package/es/components/row/src/row.d.ts +2 -2
- package/es/components/row/src/row.vue.d.ts +1 -1
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/es/components/segmented/index.d.ts +5 -5
- package/es/components/segmented/src/segmented.d.ts +2 -2
- package/es/components/segmented/src/segmented.vue.d.ts +2 -2
- package/es/components/select/src/option.d.ts +1 -1
- package/es/components/select/src/option.vue.d.ts +2 -2
- package/es/components/select/src/option2.mjs.map +1 -1
- package/es/components/select/src/select.d.ts +3 -3
- package/es/components/select/src/select.vue.d.ts +39 -39
- package/es/components/select/src/select2.mjs.map +1 -1
- package/es/components/select/src/useSelect.d.ts +5 -5
- package/es/components/select-v2/src/defaults.d.ts +2 -2
- package/es/components/select-v2/src/option-item.mjs.map +1 -1
- package/es/components/select-v2/src/select.mjs.map +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +27 -27
- package/es/components/select-v2/src/useSelect.d.ts +1 -1
- package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/es/components/slider/src/button.vue.d.ts +1 -1
- package/es/components/slider/src/slider.vue.d.ts +5 -5
- package/es/components/space/src/space.d.ts +9 -9
- package/es/components/splitter/src/splitter.d.ts +1 -1
- 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 +3 -3
- package/es/components/steps/src/steps.vue.d.ts +1 -1
- package/es/components/switch/src/switch.vue.d.ts +4 -4
- package/es/components/table/index.d.ts +2 -2
- package/es/components/table/index.mjs.map +1 -1
- package/es/components/table/src/config.d.ts +1 -1
- package/es/components/table/src/filter-panel.mjs.map +1 -1
- package/es/components/table/src/filter-panel.vue.d.ts +35 -35
- package/es/components/table/src/store/current.d.ts +1 -1
- package/es/components/table/src/store/expand.d.ts +1 -1
- package/es/components/table/src/store/helper.d.ts +13 -13
- package/es/components/table/src/store/index.d.ts +23 -23
- package/es/components/table/src/store/index.mjs.map +1 -1
- package/es/components/table/src/store/tree.d.ts +1 -1
- package/es/components/table/src/store/watcher.d.ts +3 -3
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table/defaults.d.ts +28 -3
- package/es/components/table/src/table/defaults.mjs.map +1 -1
- package/es/components/table/src/table/style-helper.d.ts +1 -1
- package/es/components/table/src/table/utils-helper.d.ts +1 -1
- package/es/components/table/src/table-body/defaults.d.ts +1 -1
- package/es/components/table/src/table-body/events-helper.d.ts +3 -3
- package/es/components/table/src/table-body/events-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
- package/es/components/table/src/table-column/defaults.d.ts +3 -3
- package/es/components/table/src/table-footer/index.d.ts +1 -1
- package/es/components/table/src/table-header/event-helper.d.ts +2 -2
- package/es/components/table/src/table-header/event-helper.mjs +1 -1
- package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
- package/es/components/table/src/table-header/index.d.ts +17 -17
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table/src/table-layout.d.ts +1 -1
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +42 -35
- package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/es/components/tabs/src/tabs.d.ts +4 -4
- package/es/components/tag/src/tag.d.ts +1 -1
- package/es/components/tag/src/tag.vue.d.ts +2 -2
- package/es/components/text/src/text.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.d.ts +7 -7
- 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 +2 -2
- package/es/components/timeline/src/timeline.d.ts +4 -4
- package/es/components/tooltip/src/content.vue.d.ts +3 -3
- package/es/components/tooltip/src/tooltip.d.ts +2 -2
- package/es/components/tooltip/src/tooltip.vue.d.ts +3 -3
- package/es/components/tooltip/src/trigger.d.ts +1 -1
- package/es/components/tour/src/content.d.ts +1 -1
- package/es/components/tour/src/content.vue.d.ts +1 -1
- 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 +2 -2
- package/es/components/tree/src/tree-node.mjs.map +1 -1
- package/es/components/tree/src/tree-node.vue.d.ts +14 -14
- package/es/components/tree/src/tree.vue.d.ts +14 -14
- package/es/components/tree-select/src/tree-select-option.d.ts +2 -2
- package/es/components/tree-select/src/tree-select.vue.d.ts +13 -13
- package/es/components/tree-v2/src/composables/useTree.d.ts +10 -10
- package/es/components/tree-v2/src/tree.vue.d.ts +1 -1
- package/es/components/upload/src/upload-content.d.ts +1 -1
- package/es/components/upload/src/upload-content.vue.d.ts +3 -3
- package/es/components/upload/src/upload-list.d.ts +1 -1
- package/es/components/upload/src/upload.d.ts +2 -2
- package/es/components/upload/src/upload.vue.d.ts +4 -4
- package/es/components/virtual-list/src/builders/build-grid.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- package/es/components/virtual-list/src/components/fixed-size-list.d.ts +5 -5
- package/es/components/virtual-list/src/components/scrollbar.d.ts +3 -3
- package/es/components/virtual-list/src/props.d.ts +2 -2
- package/es/hooks/use-floating/index.d.ts +8 -8
- package/es/hooks/use-popper/index.d.ts +3 -3
- package/es/index.d.ts +2 -2
- 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 +1 -1
- package/lib/components/alert/src/alert.d.ts +1 -1
- package/lib/components/anchor/src/anchor.d.ts +2 -2
- package/lib/components/anchor/src/anchor.vue.d.ts +3 -3
- package/lib/components/autocomplete/src/autocomplete.d.ts +4 -4
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +6 -6
- package/lib/components/avatar/src/avatar-group.d.ts +1 -1
- package/lib/components/backtop/src/backtop.vue.d.ts +2 -2
- package/lib/components/badge/src/badge.d.ts +1 -1
- package/lib/components/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 +1 -1
- package/lib/components/button/src/button.vue.d.ts +2 -2
- package/lib/components/button/src/use-button.d.ts +1 -1
- package/lib/components/calendar/src/calendar.vue.d.ts +1 -1
- package/lib/components/calendar/src/select-controller.vue.d.ts +2 -2
- package/lib/components/card/src/card.vue.d.ts +1 -1
- package/lib/components/carousel/src/carousel.d.ts +2 -2
- package/lib/components/carousel/src/carousel.vue.d.ts +1 -1
- package/lib/components/cascader/src/cascader.d.ts +2 -2
- package/lib/components/cascader/src/cascader.vue.d.ts +11 -11
- package/lib/components/cascader-panel/src/index.vue.d.ts +3 -3
- package/lib/components/check-tag/src/check-tag.d.ts +1 -1
- package/lib/components/checkbox/src/checkbox-button.vue.d.ts +5 -5
- package/lib/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
- package/lib/components/checkbox/src/checkbox.d.ts +3 -3
- package/lib/components/checkbox/src/checkbox.vue.d.ts +5 -5
- package/lib/components/col/src/col.vue.d.ts +2 -2
- package/lib/components/collapse/src/collapse.vue.d.ts +2 -2
- package/lib/components/color-picker/src/color-picker.vue.d.ts +8 -8
- 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-panel.d.ts +5 -5
- package/lib/components/date-picker-panel/src/props/date-picker-panel.d.ts +1 -1
- package/lib/components/descriptions/src/description-item.d.ts +9 -9
- package/lib/components/descriptions/src/description.d.ts +1 -1
- package/lib/components/descriptions/src/description.vue.d.ts +1 -1
- package/lib/components/dialog/src/dialog.vue.d.ts +3 -3
- package/lib/components/divider/src/divider.d.ts +2 -2
- package/lib/components/divider/src/divider.vue.d.ts +1 -1
- package/lib/components/drawer/src/drawer.vue.d.ts +4 -4
- package/lib/components/dropdown/src/dropdown-item-impl.js.map +1 -1
- package/lib/components/dropdown/src/dropdown-item-impl.vue.d.ts +2 -2
- package/lib/components/dropdown/src/dropdown-item.vue.d.ts +6 -6
- package/lib/components/dropdown/src/dropdown-menu.js.map +1 -1
- 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 +35 -35
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/focus-trap/src/focus-trap.vue.d.ts +1 -1
- package/lib/components/form/src/form-item.d.ts +2 -2
- package/lib/components/form/src/form-item.vue.d.ts +1 -1
- package/lib/components/form/src/form.d.ts +1 -1
- package/lib/components/image/src/image.vue.d.ts +2 -2
- package/lib/components/index.d.ts +2 -2
- package/lib/components/input/src/input.d.ts +3 -3
- package/lib/components/input/src/input.vue.d.ts +16 -16
- package/lib/components/input-number/src/input-number.d.ts +2 -2
- package/lib/components/input-number/src/input-number.vue.d.ts +8 -8
- package/lib/components/input-otp/src/input-otp.vue.d.ts +6 -6
- package/lib/components/input-tag/src/input-tag.d.ts +2 -2
- package/lib/components/input-tag/src/input-tag.vue.d.ts +9 -9
- package/lib/components/link/src/link.d.ts +1 -1
- package/lib/components/link/src/link.vue.d.ts +1 -1
- package/lib/components/mention/src/mention.d.ts +4 -4
- package/lib/components/mention/src/mention.vue.d.ts +5 -5
- package/lib/components/menu/src/menu.d.ts +9 -9
- 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 +5 -5
- package/lib/components/message-box/src/index.vue.d.ts +51 -51
- package/lib/components/notification/src/notification.d.ts +1 -1
- package/lib/components/notification/src/notification.vue.d.ts +4 -4
- package/lib/components/page-header/src/page-header.vue.d.ts +1 -1
- package/lib/components/pagination/src/components/next.vue.d.ts +1 -1
- package/lib/components/pagination/src/components/pager.vue.d.ts +1 -1
- package/lib/components/pagination/src/components/prev.vue.d.ts +1 -1
- package/lib/components/pagination/src/pagination.d.ts +1 -1
- package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
- package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
- package/lib/components/popover/src/popover.d.ts +2 -2
- package/lib/components/popover/src/popover.vue.d.ts +2 -2
- package/lib/components/popper/src/composables/use-content.d.ts +3 -3
- package/lib/components/popper/src/composables/use-focus-trap.d.ts +1 -1
- package/lib/components/popper/src/content.vue.d.ts +6 -6
- 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 +3 -3
- package/lib/components/radio/src/radio-button.vue.d.ts +3 -3
- package/lib/components/radio/src/radio-group.vue.d.ts +4 -4
- package/lib/components/radio/src/radio.d.ts +6 -6
- package/lib/components/radio/src/radio.vue.d.ts +5 -5
- package/lib/components/rate/src/rate.vue.d.ts +3 -3
- package/lib/components/result/src/result.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +2 -2
- package/lib/components/roving-focus-group/src/roving-focus-group.d.ts +1 -1
- package/lib/components/roving-focus-group/src/roving-focus-group.vue.d.ts +2 -2
- package/lib/components/row/src/row.d.ts +2 -2
- package/lib/components/row/src/row.vue.d.ts +1 -1
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +1 -1
- package/lib/components/segmented/index.d.ts +5 -5
- package/lib/components/segmented/src/segmented.d.ts +2 -2
- package/lib/components/segmented/src/segmented.vue.d.ts +2 -2
- package/lib/components/select/src/option.d.ts +1 -1
- package/lib/components/select/src/option.vue.d.ts +2 -2
- package/lib/components/select/src/option2.js.map +1 -1
- package/lib/components/select/src/select.d.ts +3 -3
- package/lib/components/select/src/select.vue.d.ts +39 -39
- package/lib/components/select/src/select2.js.map +1 -1
- package/lib/components/select/src/useSelect.d.ts +5 -5
- package/lib/components/select-v2/src/defaults.d.ts +2 -2
- package/lib/components/select-v2/src/option-item.js.map +1 -1
- package/lib/components/select-v2/src/select.js.map +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +27 -27
- package/lib/components/select-v2/src/useSelect.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
- package/lib/components/slider/src/button.vue.d.ts +1 -1
- package/lib/components/slider/src/slider.vue.d.ts +5 -5
- package/lib/components/space/src/space.d.ts +9 -9
- package/lib/components/splitter/src/splitter.d.ts +1 -1
- 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 +3 -3
- package/lib/components/steps/src/steps.vue.d.ts +1 -1
- package/lib/components/switch/src/switch.vue.d.ts +4 -4
- package/lib/components/table/index.d.ts +2 -2
- package/lib/components/table/index.js.map +1 -1
- package/lib/components/table/src/config.d.ts +1 -1
- package/lib/components/table/src/filter-panel.js.map +1 -1
- package/lib/components/table/src/filter-panel.vue.d.ts +35 -35
- package/lib/components/table/src/store/current.d.ts +1 -1
- package/lib/components/table/src/store/expand.d.ts +1 -1
- package/lib/components/table/src/store/helper.d.ts +13 -13
- package/lib/components/table/src/store/index.d.ts +23 -23
- package/lib/components/table/src/store/index.js.map +1 -1
- package/lib/components/table/src/store/tree.d.ts +1 -1
- package/lib/components/table/src/store/watcher.d.ts +3 -3
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table/defaults.d.ts +28 -3
- package/lib/components/table/src/table/defaults.js.map +1 -1
- package/lib/components/table/src/table/style-helper.d.ts +1 -1
- package/lib/components/table/src/table/utils-helper.d.ts +1 -1
- package/lib/components/table/src/table-body/defaults.d.ts +1 -1
- package/lib/components/table/src/table-body/events-helper.d.ts +3 -3
- package/lib/components/table/src/table-body/events-helper.js.map +1 -1
- package/lib/components/table/src/table-body/render-helper.js.map +1 -1
- package/lib/components/table/src/table-column/defaults.d.ts +3 -3
- package/lib/components/table/src/table-footer/index.d.ts +1 -1
- package/lib/components/table/src/table-header/event-helper.d.ts +2 -2
- package/lib/components/table/src/table-header/event-helper.js +1 -1
- package/lib/components/table/src/table-header/event-helper.js.map +1 -1
- package/lib/components/table/src/table-header/index.d.ts +17 -17
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table/src/table-layout.d.ts +1 -1
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +42 -35
- package/lib/components/table/src/table.vue_vue_type_script_setup_true_lang.js +2 -2
- package/lib/components/table/src/table.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/tabs/src/tab-pane.vue.d.ts +1 -1
- package/lib/components/tabs/src/tabs.d.ts +4 -4
- package/lib/components/tag/src/tag.d.ts +1 -1
- package/lib/components/tag/src/tag.vue.d.ts +2 -2
- package/lib/components/text/src/text.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.d.ts +7 -7
- 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 +2 -2
- package/lib/components/timeline/src/timeline.d.ts +4 -4
- package/lib/components/tooltip/src/content.vue.d.ts +3 -3
- package/lib/components/tooltip/src/tooltip.d.ts +2 -2
- package/lib/components/tooltip/src/tooltip.vue.d.ts +3 -3
- package/lib/components/tooltip/src/trigger.d.ts +1 -1
- package/lib/components/tour/src/content.d.ts +1 -1
- package/lib/components/tour/src/content.vue.d.ts +1 -1
- 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 +2 -2
- package/lib/components/tree/src/tree-node.js.map +1 -1
- package/lib/components/tree/src/tree-node.vue.d.ts +14 -14
- package/lib/components/tree/src/tree.vue.d.ts +14 -14
- package/lib/components/tree-select/src/tree-select-option.d.ts +2 -2
- package/lib/components/tree-select/src/tree-select.vue.d.ts +13 -13
- package/lib/components/tree-v2/src/composables/useTree.d.ts +10 -10
- package/lib/components/tree-v2/src/tree.vue.d.ts +1 -1
- package/lib/components/upload/src/upload-content.d.ts +1 -1
- package/lib/components/upload/src/upload-content.vue.d.ts +3 -3
- package/lib/components/upload/src/upload-list.d.ts +1 -1
- package/lib/components/upload/src/upload.d.ts +2 -2
- package/lib/components/upload/src/upload.vue.d.ts +4 -4
- package/lib/components/virtual-list/src/builders/build-grid.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +5 -5
- package/lib/components/virtual-list/src/components/scrollbar.d.ts +3 -3
- package/lib/components/virtual-list/src/props.d.ts +2 -2
- package/lib/hooks/use-floating/index.d.ts +8 -8
- package/lib/hooks/use-popper/index.d.ts +3 -3
- package/lib/index.d.ts +2 -2
- 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
|
@@ -3,8 +3,8 @@ import { ComponentSize } from "../../../../constants/size.js";
|
|
|
3
3
|
import { Nullable } from "../../../../utils/typescript.js";
|
|
4
4
|
import { TableOverflowTooltipFormatter, TableOverflowTooltipOptions } from "../util.js";
|
|
5
5
|
import { TableColumnCtx } from "../table-column/defaults.js";
|
|
6
|
-
import TableLayout from "../table-layout.js";
|
|
7
6
|
import { Store } from "../store/index.js";
|
|
7
|
+
import TableLayout from "../table-layout.js";
|
|
8
8
|
import { CSSProperties, ComponentInternalInstance, PropType, Ref, StyleValue, VNode } from "vue";
|
|
9
9
|
|
|
10
10
|
//#region ../../packages/components/table/src/table/defaults.d.ts
|
|
@@ -54,7 +54,7 @@ type SummaryMethod<T extends DefaultRow> = (data: {
|
|
|
54
54
|
columns: TableColumnCtx<T>[];
|
|
55
55
|
data: T[];
|
|
56
56
|
}) => (string | VNode)[];
|
|
57
|
-
interface Table<T extends DefaultRow = any> extends ComponentInternalInstance {
|
|
57
|
+
interface Table<T extends DefaultRow = any> extends Omit<ComponentInternalInstance, 'emit'> {
|
|
58
58
|
$ready: boolean;
|
|
59
59
|
hoverState?: HoverState<T> | null;
|
|
60
60
|
renderExpanded: RenderExpanded<T>;
|
|
@@ -63,6 +63,7 @@ interface Table<T extends DefaultRow = any> extends ComponentInternalInstance {
|
|
|
63
63
|
refs: TableRefs;
|
|
64
64
|
tableId: string;
|
|
65
65
|
state: TableState;
|
|
66
|
+
emit: TableEmits<T>;
|
|
66
67
|
}
|
|
67
68
|
type ColumnCls<T> = string | ((data: {
|
|
68
69
|
row: T;
|
|
@@ -310,6 +311,30 @@ interface TableConfigContext {
|
|
|
310
311
|
tooltipOptions?: TableOverflowTooltipOptions;
|
|
311
312
|
tooltipFormatter?: TableOverflowTooltipFormatter<any>;
|
|
312
313
|
}
|
|
314
|
+
interface TableEmits<T extends DefaultRow = DefaultRow> {
|
|
315
|
+
(e: 'select', selection: T[], row: T): void;
|
|
316
|
+
(e: 'select-all', selection: T[]): void;
|
|
317
|
+
(e: 'selection-change', newSelection: T[]): void;
|
|
318
|
+
(e: 'cell-mouse-enter' | 'cell-mouse-leave' | 'cell-dblclick', row: T, column: TableColumnCtx<T>, cell: HTMLTableCellElement, event: MouseEvent): void;
|
|
319
|
+
(e: 'cell-contextmenu' | 'cell-click', row: T, column: TableColumnCtx<T>, cell: HTMLTableCellElement, event: PointerEvent): void;
|
|
320
|
+
(e: 'row-dblclick', row: T, column: TableColumnCtx<T> | null, event: MouseEvent): void;
|
|
321
|
+
(e: 'row-click' | 'row-contextmenu', row: T, column: TableColumnCtx<T> | null, event: PointerEvent): void;
|
|
322
|
+
(e: 'header-click' | 'header-contextmenu', column: TableColumnCtx<T>, event: PointerEvent): void;
|
|
323
|
+
(e: 'sort-change', data: {
|
|
324
|
+
column: TableColumnCtx<T>;
|
|
325
|
+
prop: string | null;
|
|
326
|
+
order: TableSortOrder | null;
|
|
327
|
+
}): void;
|
|
328
|
+
(e: 'filter-change', newFilters: Record<string, string[]>): void;
|
|
329
|
+
(e: 'current-change', currentRow: T | null, oldCurrentRow: T | null): void;
|
|
330
|
+
(e: 'header-dragend', newWidth: number, oldWidth: number, column: TableColumnCtx<T>, event: MouseEvent): void;
|
|
331
|
+
(e: 'expand-change', row: T, expandedRows: T[]): void;
|
|
332
|
+
(e: 'expand-change', row: T, expanded: boolean): void;
|
|
333
|
+
(e: 'scroll', data: {
|
|
334
|
+
scrollLeft: number;
|
|
335
|
+
scrollTop: number;
|
|
336
|
+
}): void;
|
|
337
|
+
}
|
|
313
338
|
/**
|
|
314
339
|
* @deprecated Removed after 3.0.0, Use `TableProps` instead.
|
|
315
340
|
*/
|
|
@@ -540,4 +565,4 @@ declare const tableProps: {
|
|
|
540
565
|
nativeScrollbar: BooleanConstructor;
|
|
541
566
|
};
|
|
542
567
|
//#endregion
|
|
543
|
-
export { type CellCls, type CellStyle, type ColumnCls, type ColumnStyle, type DefaultRow, type Filter, type RenderExpanded, type RenderRowData, type Sort, type SummaryMethod, type Table, type TableColumnCtx, type TableConfigContext, type TableProps, type TableRefs, type TableSortOrder, type TableTooltipData, type TreeNode, type TreeProps, tableProps as default, tableProps };
|
|
568
|
+
export { type CellCls, type CellStyle, type ColumnCls, type ColumnStyle, type DefaultRow, type Filter, type RenderExpanded, type RenderRowData, type Sort, type SummaryMethod, type Table, type TableColumnCtx, type TableConfigContext, type TableEmits, type TableProps, type TableRefs, type TableSortOrder, type TableTooltipData, type TreeNode, type TreeProps, tableProps as default, tableProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":["useSizeProp"],"sources":["../../../../../../../packages/components/table/src/table/defaults.ts"],"sourcesContent":["import { useSizeProp } from '@element-plus/hooks'\n\nimport type {\n CSSProperties,\n ComponentInternalInstance,\n PropType,\n Ref,\n StyleValue,\n VNode,\n} from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { Nullable } from '@element-plus/utils'\nimport type { Store } from '../store'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type TableLayout from '../table-layout'\nimport type {\n TableOverflowTooltipFormatter,\n TableOverflowTooltipOptions,\n} from '../util'\n\ntype DefaultRow = Record<PropertyKey, any>\n\ninterface TableRefs {\n tableWrapper: HTMLElement\n headerWrapper: HTMLElement\n footerWrapper: HTMLElement\n fixedBodyWrapper: HTMLElement\n rightFixedBodyWrapper: HTMLElement\n bodyWrapper: HTMLElement\n appendWrapper: HTMLElement\n [key: string]: any\n}\n\ninterface TableState {\n isGroup: Ref<boolean>\n resizeState: Ref<{\n width: any\n height: any\n }>\n doLayout: () => void\n debouncedUpdateLayout: () => void\n}\n\ninterface TreeProps {\n hasChildren?: string\n children?: string\n checkStrictly?: boolean\n}\n\ntype HoverState<T extends DefaultRow> = Nullable<{\n cell: HTMLElement\n column: TableColumnCtx<T>\n row: T\n}>\n\ntype RIS<T extends DefaultRow> = {\n row: T\n $index: number\n store: Store<T>\n expanded: boolean\n}\n\ntype RenderExpanded<T extends DefaultRow> = ({\n row,\n $index,\n store,\n expanded,\n}: RIS<T>) => VNode[] | undefined\n\ntype SummaryMethod<T extends DefaultRow> = (data: {\n columns: TableColumnCtx<T>[]\n data: T[]\n}) => (string | VNode)[]\n\ninterface Table<T extends DefaultRow = any> extends ComponentInternalInstance {\n $ready: boolean\n hoverState?: HoverState<T> | null\n renderExpanded: RenderExpanded<T>\n store: Store<T>\n layout: TableLayout<T>\n refs: TableRefs\n tableId: string\n state: TableState\n}\n\ntype ColumnCls<T> = string | ((data: { row: T; rowIndex: number }) => string)\ntype ColumnStyle<T> =\n | CSSProperties\n | ((data: { row: T; rowIndex: number }) => CSSProperties)\ntype CellCls<T extends DefaultRow> =\n | string\n | ((data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) => string)\ntype CellStyle<T extends DefaultRow> =\n | CSSProperties\n | ((data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) => CSSProperties)\ntype Layout = 'fixed' | 'auto'\ninterface TableProps<T extends DefaultRow = DefaultRow> {\n /**\n * @description table data\n */\n data?: T[]\n /**\n * @description size of Table\n */\n size?: ComponentSize\n width?: string | number\n /**\n * @description table's height. By default it has an `auto` height. If its value is a number, the height is measured in pixels; if its value is a string, the value will be assigned to element's style.height, the height is affected by external styles\n */\n height?: string | number\n /**\n * @description table's max-height. The legal value is a number or the height in px\n */\n maxHeight?: string | number\n /**\n * @description whether width of column automatically fits its container\n */\n fit?: boolean\n /**\n * @description whether Table is striped\n */\n stripe?: boolean\n /**\n * @description whether Table has vertical border\n */\n border?: boolean\n /**\n * @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used\n */\n rowKey?: string | ((row: T) => string)\n context?: Table<T>\n /**\n * @description whether Table header is visible\n */\n showHeader?: boolean\n /**\n * @description whether to display a summary row\n */\n showSummary?: boolean\n /**\n * @description displayed text for the first column of summary row\n */\n sumText?: string\n /**\n * @description custom summary method\n */\n summaryMethod?: SummaryMethod<T>\n /**\n * @description function that returns custom class names for a row, or a string assigning class names for every row\n */\n rowClassName?: ColumnCls<T>\n /**\n * @description function that returns custom style for a row, or an object assigning custom style for every row\n */\n rowStyle?: ColumnStyle<T>\n /**\n * @description function that returns custom class names for a cell, or a string assigning class names for every cell\n */\n cellClassName?: CellCls<T>\n /**\n * @description function that returns custom style for a cell, or an object assigning custom style for every cell\n */\n cellStyle?: CellStyle<T>\n /**\n * @description function that returns custom class names for a row in table header, or a string assigning class names for every row in table header\n */\n headerRowClassName?: ColumnCls<T>\n /**\n * @description function that returns custom style for a row in table header, or an object assigning custom style for every row in table header\n */\n headerRowStyle?: ColumnStyle<T>\n /**\n * @description function that returns custom class names for a cell in table header, or a string assigning class names for every cell in table header\n */\n headerCellClassName?: CellCls<T>\n /**\n * @description function that returns custom style for a cell in table header, or an object assigning custom style for every cell in table header\n */\n headerCellStyle?: CellStyle<T>\n /**\n * @description whether current row is highlighted\n */\n highlightCurrentRow?: boolean\n /**\n * @description key of current row, a set only prop\n */\n currentRowKey?: string | number\n /**\n * @description displayed text when data is empty. You can customize this area with `#empty`\n */\n emptyText?: string\n /**\n * @description set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop\n */\n expandRowKeys?: Array<string>\n /**\n * @description whether expand all rows by default, works when the table has a column type=\"expand\" or contains tree structure data\n */\n defaultExpandAll?: boolean\n /**\n * @description enable expandable rows, works when the table has a column type=\"expand\"\n */\n rowExpandable?: (row: T, index: number) => boolean\n /**\n * @description set the default sort column and order. property `prop` is used to set default sort column, property `order` is used to set default sort order\n */\n defaultSort?: Sort\n /**\n * @description the `effect` of the overflow tooltip\n */\n tooltipEffect?: string\n /**\n * @description the options for the overflow tooltip, [see the following tooltip component](tooltip.html#attributes)\n */\n tooltipOptions?: TableOverflowTooltipOptions\n /**\n * @description method that returns rowspan and colspan\n */\n spanMethod?: (data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) =>\n | number[]\n | {\n rowspan: number\n colspan: number\n }\n | undefined\n /**\n * @description controls the behavior of master checkbox in multi-select tables when only some rows are selected (but not all). If true, all rows will be selected, else deselected\n */\n selectOnIndeterminate?: boolean\n /**\n * @description horizontal indentation of tree data\n */\n indent?: number\n /**\n * @description configuration for rendering nested data\n */\n treeProps?: TreeProps\n /**\n * @description whether to lazy loading data\n */\n lazy?: boolean\n /**\n * @description method for loading child row data, only works when `lazy` is true\n */\n load?: (row: T, treeNode: TreeNode, resolve: (data: T[]) => void) => void\n className?: string\n style?: StyleValue\n /**\n * @description sets the algorithm used to lay out table cells, rows, and columns\n */\n tableLayout?: Layout\n /**\n * @description always show scrollbar\n */\n scrollbarAlwaysOn?: boolean\n /**\n * @description ensure main axis minimum-size doesn't follow the content\n */\n flexible?: boolean\n /**\n * @description whether to hide extra content and show them in a tooltip when hovering on the cell.It will affect all the table columns\n */\n showOverflowTooltip?: boolean | TableOverflowTooltipOptions\n /**\n * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`\n */\n tooltipFormatter?: TableOverflowTooltipFormatter<T>\n appendFilterPanelTo?: string\n scrollbarTabindex?: number | string\n /**\n * @description whether to allow drag the last column\n */\n allowDragLastColumn?: boolean\n /**\n * @description whether to preserve expanded row content in DOM when collapsed\n */\n preserveExpandedContent?: boolean\n /**\n * @description whether to use native scrollbars\n */\n nativeScrollbar?: boolean\n}\n\ntype TableTooltipData<T extends DefaultRow> = Parameters<\n TableOverflowTooltipFormatter<T>\n>[0]\ntype TableSortOrder = 'ascending' | 'descending'\n\ninterface Sort {\n prop: string\n order: TableSortOrder\n init?: any\n silent?: any\n}\n\ninterface Filter<T extends DefaultRow> {\n column: TableColumnCtx<T>\n values: string[]\n silent: any\n}\n\ninterface TreeNode {\n expanded?: boolean\n loading?: boolean\n noLazyChildren?: boolean\n indent?: number\n level?: number\n display?: boolean\n}\n\ninterface RenderRowData<T extends DefaultRow> {\n store: Store<T>\n _self: Table<T>\n column: TableColumnCtx<T>\n row: T\n $index: number\n cellIndex: number\n treeNode?: TreeNode\n expanded: boolean\n}\n\ninterface TableConfigContext {\n showOverflowTooltip?: boolean | TableOverflowTooltipOptions\n tooltipEffect?: string\n tooltipOptions?: TableOverflowTooltipOptions\n tooltipFormatter?: TableOverflowTooltipFormatter<any>\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `TableProps` instead.\n */\nexport const tableProps = {\n /**\n * @description table data\n */\n data: {\n type: Array as PropType<any[]>,\n default: () => [],\n },\n /**\n * @description size of Table\n */\n size: useSizeProp,\n width: [String, Number],\n /**\n * @description table's height. By default it has an `auto` height. If its value is a number, the height is measured in pixels; if its value is a string, the value will be assigned to element's style.height, the height is affected by external styles\n */\n height: [String, Number],\n /**\n * @description table's max-height. The legal value is a number or the height in px\n */\n maxHeight: [String, Number],\n /**\n * @description whether width of column automatically fits its container\n */\n fit: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether Table is striped\n */\n stripe: Boolean,\n /**\n * @description whether Table has vertical border\n */\n border: Boolean,\n /**\n * @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used\n */\n rowKey: [String, Function] as PropType<TableProps<any>['rowKey']>,\n /**\n * @description whether Table header is visible\n */\n showHeader: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to display a summary row\n */\n showSummary: Boolean,\n /**\n * @description displayed text for the first column of summary row\n */\n sumText: String,\n /**\n * @description custom summary method\n */\n summaryMethod: Function as PropType<TableProps<any>['summaryMethod']>,\n /**\n * @description function that returns custom class names for a row, or a string assigning class names for every row\n */\n rowClassName: [String, Function] as PropType<TableProps<any>['rowClassName']>,\n /**\n * @description function that returns custom style for a row, or an object assigning custom style for every row\n */\n rowStyle: [Object, Function] as PropType<TableProps<any>['rowStyle']>,\n /**\n * @description function that returns custom class names for a cell, or a string assigning class names for every cell\n */\n cellClassName: [String, Function] as PropType<\n TableProps<any>['cellClassName']\n >,\n /**\n * @description function that returns custom style for a cell, or an object assigning custom style for every cell\n */\n cellStyle: [Object, Function] as PropType<TableProps<any>['cellStyle']>,\n /**\n * @description function that returns custom class names for a row in table header, or a string assigning class names for every row in table header\n */\n headerRowClassName: [String, Function] as PropType<\n TableProps<any>['headerRowClassName']\n >,\n /**\n * @description function that returns custom style for a row in table header, or an object assigning custom style for every row in table header\n */\n headerRowStyle: [Object, Function] as PropType<\n TableProps<any>['headerRowStyle']\n >,\n /**\n * @description function that returns custom class names for a cell in table header, or a string assigning class names for every cell in table header\n */\n headerCellClassName: [String, Function] as PropType<\n TableProps<any>['headerCellClassName']\n >,\n /**\n * @description function that returns custom style for a cell in table header, or an object assigning custom style for every cell in table header\n */\n headerCellStyle: [Object, Function] as PropType<\n TableProps<any>['headerCellStyle']\n >,\n /**\n * @description whether current row is highlighted\n */\n highlightCurrentRow: Boolean,\n /**\n * @description key of current row, a set only prop\n */\n currentRowKey: [String, Number],\n /**\n * @description displayed text when data is empty. You can customize this area with `#empty`\n */\n emptyText: String,\n /**\n * @description set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop\n */\n expandRowKeys: Array as PropType<TableProps<any>['expandRowKeys']>,\n /**\n * @description whether expand all rows by default, works when the table has a column type=\"expand\" or contains tree structure data\n */\n defaultExpandAll: Boolean,\n /**\n * @description enable expandable rows, works when the table has a column type=\"expand\"\n */\n rowExpandable: {\n type: Function as PropType<TableProps<any>['rowExpandable']>,\n },\n /**\n * @description set the default sort column and order. property `prop` is used to set default sort column, property `order` is used to set default sort order\n */\n defaultSort: Object as PropType<TableProps<any>['defaultSort']>,\n /**\n * @description the `effect` of the overflow tooltip\n */\n tooltipEffect: String,\n /**\n * @description the options for the overflow tooltip, [see the following tooltip component](tooltip.html#attributes)\n */\n tooltipOptions: Object as PropType<TableProps<any>['tooltipOptions']>,\n /**\n * @description method that returns rowspan and colspan\n */\n spanMethod: Function as PropType<TableProps<any>['spanMethod']>,\n /**\n * @description controls the behavior of master checkbox in multi-select tables when only some rows are selected (but not all). If true, all rows will be selected, else deselected\n */\n selectOnIndeterminate: {\n type: Boolean,\n default: true,\n },\n /**\n * @description horizontal indentation of tree data\n */\n indent: {\n type: Number,\n default: 16,\n },\n /**\n * @description configuration for rendering nested data\n */\n treeProps: {\n type: Object as PropType<TableProps<any>['treeProps']>,\n default: () => {\n return {\n hasChildren: 'hasChildren',\n children: 'children',\n checkStrictly: false,\n }\n },\n },\n /**\n * @description whether to lazy loading data\n */\n lazy: Boolean,\n /**\n * @description method for loading child row data, only works when `lazy` is true\n */\n load: Function as PropType<TableProps<any>['load']>,\n style: {\n type: [String, Object, Array, Boolean] as PropType<\n TableProps<any>['style']\n >,\n default: () => ({}),\n },\n className: {\n type: String,\n default: '',\n },\n /**\n * @description sets the algorithm used to lay out table cells, rows, and columns\n */\n tableLayout: {\n type: String as PropType<Layout>,\n default: 'fixed',\n },\n /**\n * @description always show scrollbar\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description ensure main axis minimum-size doesn't follow the content\n */\n flexible: Boolean,\n /**\n * @description whether to hide extra content and show them in a tooltip when hovering on the cell.It will affect all the table columns\n */\n showOverflowTooltip: {\n type: [Boolean, Object] as PropType<TableProps<any>['showOverflowTooltip']>,\n default: undefined,\n },\n /**\n * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`\n */\n tooltipFormatter: Function as PropType<TableProps<any>['tooltipFormatter']>,\n appendFilterPanelTo: String,\n scrollbarTabindex: {\n type: [Number, String],\n default: undefined,\n },\n /**\n * @description whether to allow drag the last column\n */\n allowDragLastColumn: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to preserve expanded row content in DOM when collapsed\n */\n preserveExpandedContent: Boolean,\n /**\n * @description whether to use native scrollbars\n */\n nativeScrollbar: Boolean,\n}\nexport type {\n SummaryMethod,\n Table,\n TableProps,\n TableRefs,\n ColumnCls,\n ColumnStyle,\n CellCls,\n CellStyle,\n DefaultRow,\n TreeNode,\n RenderRowData,\n Sort,\n Filter,\n TableColumnCtx,\n TreeProps,\n TableTooltipData,\n TableSortOrder,\n RenderExpanded,\n TableConfigContext,\n}\n\nexport default tableProps\n"],"mappings":";;;;;;;;;AA0VA,MAAa,aAAa;;;;CAIxB,MAAM;EACJ,MAAM;EACN,eAAe,EAAE;EAClB;;;;CAID,MAAMA,cAAAA;CACN,OAAO,CAAC,QAAQ,OAAO;;;;CAIvB,QAAQ,C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;;;;CAID,kBAAkB;CAClB,qBAAqB;CACrB,mBAAmB;EACjB,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS,KAAA;EACV;;;;CAID,qBAAqB;EACnB,MAAM;EACN,SAAS;EACV;;;;CAID,yBAAyB;;;;CAIzB,iBAAiB;CAClB"}
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["useSizeProp"],"sources":["../../../../../../../packages/components/table/src/table/defaults.ts"],"sourcesContent":["import { useSizeProp } from '@element-plus/hooks'\n\nimport type {\n CSSProperties,\n ComponentInternalInstance,\n PropType,\n Ref,\n StyleValue,\n VNode,\n} from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { Nullable } from '@element-plus/utils'\nimport type { Store } from '../store'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type TableLayout from '../table-layout'\nimport type {\n TableOverflowTooltipFormatter,\n TableOverflowTooltipOptions,\n} from '../util'\n\ntype DefaultRow = Record<PropertyKey, any>\n\ninterface TableRefs {\n tableWrapper: HTMLElement\n headerWrapper: HTMLElement\n footerWrapper: HTMLElement\n fixedBodyWrapper: HTMLElement\n rightFixedBodyWrapper: HTMLElement\n bodyWrapper: HTMLElement\n appendWrapper: HTMLElement\n [key: string]: any\n}\n\ninterface TableState {\n isGroup: Ref<boolean>\n resizeState: Ref<{\n width: any\n height: any\n }>\n doLayout: () => void\n debouncedUpdateLayout: () => void\n}\n\ninterface TreeProps {\n hasChildren?: string\n children?: string\n checkStrictly?: boolean\n}\n\ntype HoverState<T extends DefaultRow> = Nullable<{\n cell: HTMLElement\n column: TableColumnCtx<T>\n row: T\n}>\n\ntype RIS<T extends DefaultRow> = {\n row: T\n $index: number\n store: Store<T>\n expanded: boolean\n}\n\ntype RenderExpanded<T extends DefaultRow> = ({\n row,\n $index,\n store,\n expanded,\n}: RIS<T>) => VNode[] | undefined\n\ntype SummaryMethod<T extends DefaultRow> = (data: {\n columns: TableColumnCtx<T>[]\n data: T[]\n}) => (string | VNode)[]\n\ninterface Table<T extends DefaultRow = any> extends Omit<\n ComponentInternalInstance,\n 'emit'\n> {\n $ready: boolean\n hoverState?: HoverState<T> | null\n renderExpanded: RenderExpanded<T>\n store: Store<T>\n layout: TableLayout<T>\n refs: TableRefs\n tableId: string\n state: TableState\n emit: TableEmits<T>\n}\n\ntype ColumnCls<T> = string | ((data: { row: T; rowIndex: number }) => string)\ntype ColumnStyle<T> =\n | CSSProperties\n | ((data: { row: T; rowIndex: number }) => CSSProperties)\ntype CellCls<T extends DefaultRow> =\n | string\n | ((data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) => string)\ntype CellStyle<T extends DefaultRow> =\n | CSSProperties\n | ((data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) => CSSProperties)\ntype Layout = 'fixed' | 'auto'\ninterface TableProps<T extends DefaultRow = DefaultRow> {\n /**\n * @description table data\n */\n data?: T[]\n /**\n * @description size of Table\n */\n size?: ComponentSize\n width?: string | number\n /**\n * @description table's height. By default it has an `auto` height. If its value is a number, the height is measured in pixels; if its value is a string, the value will be assigned to element's style.height, the height is affected by external styles\n */\n height?: string | number\n /**\n * @description table's max-height. The legal value is a number or the height in px\n */\n maxHeight?: string | number\n /**\n * @description whether width of column automatically fits its container\n */\n fit?: boolean\n /**\n * @description whether Table is striped\n */\n stripe?: boolean\n /**\n * @description whether Table has vertical border\n */\n border?: boolean\n /**\n * @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used\n */\n rowKey?: string | ((row: T) => string)\n context?: Table<T>\n /**\n * @description whether Table header is visible\n */\n showHeader?: boolean\n /**\n * @description whether to display a summary row\n */\n showSummary?: boolean\n /**\n * @description displayed text for the first column of summary row\n */\n sumText?: string\n /**\n * @description custom summary method\n */\n summaryMethod?: SummaryMethod<T>\n /**\n * @description function that returns custom class names for a row, or a string assigning class names for every row\n */\n rowClassName?: ColumnCls<T>\n /**\n * @description function that returns custom style for a row, or an object assigning custom style for every row\n */\n rowStyle?: ColumnStyle<T>\n /**\n * @description function that returns custom class names for a cell, or a string assigning class names for every cell\n */\n cellClassName?: CellCls<T>\n /**\n * @description function that returns custom style for a cell, or an object assigning custom style for every cell\n */\n cellStyle?: CellStyle<T>\n /**\n * @description function that returns custom class names for a row in table header, or a string assigning class names for every row in table header\n */\n headerRowClassName?: ColumnCls<T>\n /**\n * @description function that returns custom style for a row in table header, or an object assigning custom style for every row in table header\n */\n headerRowStyle?: ColumnStyle<T>\n /**\n * @description function that returns custom class names for a cell in table header, or a string assigning class names for every cell in table header\n */\n headerCellClassName?: CellCls<T>\n /**\n * @description function that returns custom style for a cell in table header, or an object assigning custom style for every cell in table header\n */\n headerCellStyle?: CellStyle<T>\n /**\n * @description whether current row is highlighted\n */\n highlightCurrentRow?: boolean\n /**\n * @description key of current row, a set only prop\n */\n currentRowKey?: string | number\n /**\n * @description displayed text when data is empty. You can customize this area with `#empty`\n */\n emptyText?: string\n /**\n * @description set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop\n */\n expandRowKeys?: Array<string>\n /**\n * @description whether expand all rows by default, works when the table has a column type=\"expand\" or contains tree structure data\n */\n defaultExpandAll?: boolean\n /**\n * @description enable expandable rows, works when the table has a column type=\"expand\"\n */\n rowExpandable?: (row: T, index: number) => boolean\n /**\n * @description set the default sort column and order. property `prop` is used to set default sort column, property `order` is used to set default sort order\n */\n defaultSort?: Sort\n /**\n * @description the `effect` of the overflow tooltip\n */\n tooltipEffect?: string\n /**\n * @description the options for the overflow tooltip, [see the following tooltip component](tooltip.html#attributes)\n */\n tooltipOptions?: TableOverflowTooltipOptions\n /**\n * @description method that returns rowspan and colspan\n */\n spanMethod?: (data: {\n row: T\n rowIndex: number\n column: TableColumnCtx<T>\n columnIndex: number\n }) =>\n | number[]\n | {\n rowspan: number\n colspan: number\n }\n | undefined\n /**\n * @description controls the behavior of master checkbox in multi-select tables when only some rows are selected (but not all). If true, all rows will be selected, else deselected\n */\n selectOnIndeterminate?: boolean\n /**\n * @description horizontal indentation of tree data\n */\n indent?: number\n /**\n * @description configuration for rendering nested data\n */\n treeProps?: TreeProps\n /**\n * @description whether to lazy loading data\n */\n lazy?: boolean\n /**\n * @description method for loading child row data, only works when `lazy` is true\n */\n load?: (row: T, treeNode: TreeNode, resolve: (data: T[]) => void) => void\n className?: string\n style?: StyleValue\n /**\n * @description sets the algorithm used to lay out table cells, rows, and columns\n */\n tableLayout?: Layout\n /**\n * @description always show scrollbar\n */\n scrollbarAlwaysOn?: boolean\n /**\n * @description ensure main axis minimum-size doesn't follow the content\n */\n flexible?: boolean\n /**\n * @description whether to hide extra content and show them in a tooltip when hovering on the cell.It will affect all the table columns\n */\n showOverflowTooltip?: boolean | TableOverflowTooltipOptions\n /**\n * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`\n */\n tooltipFormatter?: TableOverflowTooltipFormatter<T>\n appendFilterPanelTo?: string\n scrollbarTabindex?: number | string\n /**\n * @description whether to allow drag the last column\n */\n allowDragLastColumn?: boolean\n /**\n * @description whether to preserve expanded row content in DOM when collapsed\n */\n preserveExpandedContent?: boolean\n /**\n * @description whether to use native scrollbars\n */\n nativeScrollbar?: boolean\n}\n\ntype TableTooltipData<T extends DefaultRow> = Parameters<\n TableOverflowTooltipFormatter<T>\n>[0]\ntype TableSortOrder = 'ascending' | 'descending'\n\ninterface Sort {\n prop: string\n order: TableSortOrder\n init?: any\n silent?: any\n}\n\ninterface Filter<T extends DefaultRow> {\n column: TableColumnCtx<T>\n values: string[]\n silent: any\n}\n\ninterface TreeNode {\n expanded?: boolean\n loading?: boolean\n noLazyChildren?: boolean\n indent?: number\n level?: number\n display?: boolean\n}\n\ninterface RenderRowData<T extends DefaultRow> {\n store: Store<T>\n _self: Table<T>\n column: TableColumnCtx<T>\n row: T\n $index: number\n cellIndex: number\n treeNode?: TreeNode\n expanded: boolean\n}\n\ninterface TableConfigContext {\n showOverflowTooltip?: boolean | TableOverflowTooltipOptions\n tooltipEffect?: string\n tooltipOptions?: TableOverflowTooltipOptions\n tooltipFormatter?: TableOverflowTooltipFormatter<any>\n}\n\ninterface TableEmits<T extends DefaultRow = DefaultRow> {\n (e: 'select', selection: T[], row: T): void\n (e: 'select-all', selection: T[]): void\n (e: 'selection-change', newSelection: T[]): void\n (\n e: 'cell-mouse-enter' | 'cell-mouse-leave' | 'cell-dblclick',\n row: T,\n column: TableColumnCtx<T>,\n cell: HTMLTableCellElement,\n event: MouseEvent\n ): void\n (\n e: 'cell-contextmenu' | 'cell-click',\n row: T,\n column: TableColumnCtx<T>,\n cell: HTMLTableCellElement,\n event: PointerEvent\n ): void\n (\n e: 'row-dblclick',\n row: T,\n column: TableColumnCtx<T> | null,\n event: MouseEvent\n ): void\n (\n e: 'row-click' | 'row-contextmenu',\n row: T,\n column: TableColumnCtx<T> | null,\n event: PointerEvent\n ): void\n (\n e: 'header-click' | 'header-contextmenu',\n column: TableColumnCtx<T>,\n event: PointerEvent\n ): void\n (\n e: 'sort-change',\n data: {\n column: TableColumnCtx<T>\n prop: string | null\n order: TableSortOrder | null\n }\n ): void\n (e: 'filter-change', newFilters: Record<string, string[]>): void\n (e: 'current-change', currentRow: T | null, oldCurrentRow: T | null): void\n (\n e: 'header-dragend',\n newWidth: number,\n oldWidth: number,\n column: TableColumnCtx<T>,\n event: MouseEvent\n ): void\n (e: 'expand-change', row: T, expandedRows: T[]): void\n (e: 'expand-change', row: T, expanded: boolean): void\n (\n e: 'scroll',\n data: {\n scrollLeft: number\n scrollTop: number\n }\n ): void\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `TableProps` instead.\n */\nexport const tableProps = {\n /**\n * @description table data\n */\n data: {\n type: Array as PropType<any[]>,\n default: () => [],\n },\n /**\n * @description size of Table\n */\n size: useSizeProp,\n width: [String, Number],\n /**\n * @description table's height. By default it has an `auto` height. If its value is a number, the height is measured in pixels; if its value is a string, the value will be assigned to element's style.height, the height is affected by external styles\n */\n height: [String, Number],\n /**\n * @description table's max-height. The legal value is a number or the height in px\n */\n maxHeight: [String, Number],\n /**\n * @description whether width of column automatically fits its container\n */\n fit: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether Table is striped\n */\n stripe: Boolean,\n /**\n * @description whether Table has vertical border\n */\n border: Boolean,\n /**\n * @description key of row data, used for optimizing rendering. Required if `reserve-selection` is on or display tree data. When its type is String, multi-level access is supported, e.g. `user.info.id`, but `user.info[0].id` is not supported, in which case `Function` should be used\n */\n rowKey: [String, Function] as PropType<TableProps<any>['rowKey']>,\n /**\n * @description whether Table header is visible\n */\n showHeader: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to display a summary row\n */\n showSummary: Boolean,\n /**\n * @description displayed text for the first column of summary row\n */\n sumText: String,\n /**\n * @description custom summary method\n */\n summaryMethod: Function as PropType<TableProps<any>['summaryMethod']>,\n /**\n * @description function that returns custom class names for a row, or a string assigning class names for every row\n */\n rowClassName: [String, Function] as PropType<TableProps<any>['rowClassName']>,\n /**\n * @description function that returns custom style for a row, or an object assigning custom style for every row\n */\n rowStyle: [Object, Function] as PropType<TableProps<any>['rowStyle']>,\n /**\n * @description function that returns custom class names for a cell, or a string assigning class names for every cell\n */\n cellClassName: [String, Function] as PropType<\n TableProps<any>['cellClassName']\n >,\n /**\n * @description function that returns custom style for a cell, or an object assigning custom style for every cell\n */\n cellStyle: [Object, Function] as PropType<TableProps<any>['cellStyle']>,\n /**\n * @description function that returns custom class names for a row in table header, or a string assigning class names for every row in table header\n */\n headerRowClassName: [String, Function] as PropType<\n TableProps<any>['headerRowClassName']\n >,\n /**\n * @description function that returns custom style for a row in table header, or an object assigning custom style for every row in table header\n */\n headerRowStyle: [Object, Function] as PropType<\n TableProps<any>['headerRowStyle']\n >,\n /**\n * @description function that returns custom class names for a cell in table header, or a string assigning class names for every cell in table header\n */\n headerCellClassName: [String, Function] as PropType<\n TableProps<any>['headerCellClassName']\n >,\n /**\n * @description function that returns custom style for a cell in table header, or an object assigning custom style for every cell in table header\n */\n headerCellStyle: [Object, Function] as PropType<\n TableProps<any>['headerCellStyle']\n >,\n /**\n * @description whether current row is highlighted\n */\n highlightCurrentRow: Boolean,\n /**\n * @description key of current row, a set only prop\n */\n currentRowKey: [String, Number],\n /**\n * @description displayed text when data is empty. You can customize this area with `#empty`\n */\n emptyText: String,\n /**\n * @description set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop\n */\n expandRowKeys: Array as PropType<TableProps<any>['expandRowKeys']>,\n /**\n * @description whether expand all rows by default, works when the table has a column type=\"expand\" or contains tree structure data\n */\n defaultExpandAll: Boolean,\n /**\n * @description enable expandable rows, works when the table has a column type=\"expand\"\n */\n rowExpandable: {\n type: Function as PropType<TableProps<any>['rowExpandable']>,\n },\n /**\n * @description set the default sort column and order. property `prop` is used to set default sort column, property `order` is used to set default sort order\n */\n defaultSort: Object as PropType<TableProps<any>['defaultSort']>,\n /**\n * @description the `effect` of the overflow tooltip\n */\n tooltipEffect: String,\n /**\n * @description the options for the overflow tooltip, [see the following tooltip component](tooltip.html#attributes)\n */\n tooltipOptions: Object as PropType<TableProps<any>['tooltipOptions']>,\n /**\n * @description method that returns rowspan and colspan\n */\n spanMethod: Function as PropType<TableProps<any>['spanMethod']>,\n /**\n * @description controls the behavior of master checkbox in multi-select tables when only some rows are selected (but not all). If true, all rows will be selected, else deselected\n */\n selectOnIndeterminate: {\n type: Boolean,\n default: true,\n },\n /**\n * @description horizontal indentation of tree data\n */\n indent: {\n type: Number,\n default: 16,\n },\n /**\n * @description configuration for rendering nested data\n */\n treeProps: {\n type: Object as PropType<TableProps<any>['treeProps']>,\n default: () => {\n return {\n hasChildren: 'hasChildren',\n children: 'children',\n checkStrictly: false,\n }\n },\n },\n /**\n * @description whether to lazy loading data\n */\n lazy: Boolean,\n /**\n * @description method for loading child row data, only works when `lazy` is true\n */\n load: Function as PropType<TableProps<any>['load']>,\n style: {\n type: [String, Object, Array, Boolean] as PropType<\n TableProps<any>['style']\n >,\n default: () => ({}),\n },\n className: {\n type: String,\n default: '',\n },\n /**\n * @description sets the algorithm used to lay out table cells, rows, and columns\n */\n tableLayout: {\n type: String as PropType<Layout>,\n default: 'fixed',\n },\n /**\n * @description always show scrollbar\n */\n scrollbarAlwaysOn: Boolean,\n /**\n * @description ensure main axis minimum-size doesn't follow the content\n */\n flexible: Boolean,\n /**\n * @description whether to hide extra content and show them in a tooltip when hovering on the cell.It will affect all the table columns\n */\n showOverflowTooltip: {\n type: [Boolean, Object] as PropType<TableProps<any>['showOverflowTooltip']>,\n default: undefined,\n },\n /**\n * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`\n */\n tooltipFormatter: Function as PropType<TableProps<any>['tooltipFormatter']>,\n appendFilterPanelTo: String,\n scrollbarTabindex: {\n type: [Number, String],\n default: undefined,\n },\n /**\n * @description whether to allow drag the last column\n */\n allowDragLastColumn: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to preserve expanded row content in DOM when collapsed\n */\n preserveExpandedContent: Boolean,\n /**\n * @description whether to use native scrollbars\n */\n nativeScrollbar: Boolean,\n}\nexport type {\n SummaryMethod,\n Table,\n TableProps,\n TableRefs,\n ColumnCls,\n ColumnStyle,\n CellCls,\n CellStyle,\n DefaultRow,\n TreeNode,\n RenderRowData,\n Sort,\n Filter,\n TableColumnCtx,\n TreeProps,\n TableTooltipData,\n TableSortOrder,\n RenderExpanded,\n TableConfigContext,\n TableEmits,\n}\n\nexport default tableProps\n"],"mappings":";;;;;;;;;AA6ZA,MAAa,aAAa;;;;CAIxB,MAAM;EACJ,MAAM;EACN,eAAe,EAAE;EAClB;;;;CAID,MAAMA,cAAAA;CACN,OAAO,CAAC,QAAQ,OAAO;;;;CAIvB,QAAQ,CAAC,QAAQ,OAAO;;;;CAIxB,WAAW,CAAC,QAAQ,OAAO;;;;CAI3B,KAAK;EACH,MAAM;EACN,SAAS;EACV;;;;CAID,QAAQ;;;;CAIR,QAAQ;;;;CAIR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S;EACV;;;;CAID,yBAAyB;;;;CAIzB,iBAAiB;CAClB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Store } from "../store/index.js";
|
|
1
2
|
import TableLayout from "../table-layout.js";
|
|
2
3
|
import { DefaultRow, RenderExpanded, Table, TableProps } from "./defaults.js";
|
|
3
|
-
import { Store } from "../store/index.js";
|
|
4
4
|
import * as _$vue from "vue";
|
|
5
5
|
|
|
6
6
|
//#region ../../packages/components/table/src/table/style-helper.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DefaultRow } from "./defaults.js";
|
|
2
1
|
import { Store } from "../store/index.js";
|
|
2
|
+
import { DefaultRow } from "./defaults.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../packages/components/table/src/table/utils-helper.d.ts
|
|
5
5
|
declare function useUtils<T extends DefaultRow>(store: Store<T>): {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TableOverflowTooltipOptions } from "../util.js";
|
|
2
|
-
import { ColumnCls, ColumnStyle, DefaultRow, Table } from "../table/defaults.js";
|
|
3
2
|
import { Store } from "../store/index.js";
|
|
3
|
+
import { ColumnCls, ColumnStyle, DefaultRow, Table } from "../table/defaults.js";
|
|
4
4
|
import { PropType } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region ../../packages/components/table/src/table-body/defaults.d.ts
|
|
@@ -6,9 +6,9 @@ import * as _$lodash_unified0 from "lodash-unified";
|
|
|
6
6
|
|
|
7
7
|
//#region ../../packages/components/table/src/table-body/events-helper.d.ts
|
|
8
8
|
declare function useEvents<T extends DefaultRow>(props: Partial<TableBodyProps<T>>): {
|
|
9
|
-
handleDoubleClick: (event:
|
|
10
|
-
handleClick: (event:
|
|
11
|
-
handleContextMenu: (event:
|
|
9
|
+
handleDoubleClick: (event: MouseEvent, row: T) => void;
|
|
10
|
+
handleClick: (event: PointerEvent, row: T) => void;
|
|
11
|
+
handleContextMenu: (event: PointerEvent, row: T) => void;
|
|
12
12
|
handleMouseEnter: _$lodash_unified0.DebouncedFunc<(index: number) => void>;
|
|
13
13
|
handleMouseLeave: _$lodash_unified0.DebouncedFunc<() => void>;
|
|
14
14
|
handleCellMouseEnter: (event: MouseEvent, row: T, tooltipOptions: TableOverflowTooltipOptions) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events-helper.js","names":["TABLE_INJECTION_KEY","getCell","getColumnByCell","addClass","removePopper","hasClass","isGreaterThan","removeClass"],"sources":["../../../../../../../packages/components/table/src/table-body/events-helper.ts"],"sourcesContent":["import { h, inject, ref } from 'vue'\nimport { debounce } from 'lodash-unified'\nimport {\n addClass,\n hasClass,\n isGreaterThan,\n removeClass,\n} from '@element-plus/utils'\nimport {\n createTablePopper,\n getCell,\n getColumnByCell,\n removePopper,\n} from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\n\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { TableBodyProps } from './defaults'\nimport type { TableOverflowTooltipOptions } from '../util'\nimport type { DefaultRow } from '../table/defaults'\n\nfunction useEvents<T extends DefaultRow>(props: Partial<TableBodyProps<T>>) {\n const parent = inject(TABLE_INJECTION_KEY)\n const tooltipContent = ref('')\n const tooltipTrigger = ref(h('div'))\n const handleEvent = (event: Event, row: T, name: string) => {\n const table = parent\n const cell = getCell(event)\n let column: TableColumnCtx<T> | null = null\n const namespace = table?.vnode.el?.dataset.prefix\n if (cell) {\n column = getColumnByCell(\n {\n columns: props.store?.states.columns.value ?? [],\n },\n cell,\n namespace\n )\n if (column) {\n table?.emit(`cell-${name}`, row, column, cell, event)\n }\n }\n table?.emit(`row-${name}`, row, column, event)\n }\n const handleDoubleClick = (event: Event, row: T) => {\n handleEvent(event, row, 'dblclick')\n }\n const handleClick = (event: Event, row: T) => {\n props.store?.commit('setCurrentRow', row)\n handleEvent(event, row, 'click')\n }\n const handleContextMenu = (event: Event, row: T) => {\n handleEvent(event, row, 'contextmenu')\n }\n const handleMouseEnter = debounce((index: number) => {\n props.store?.commit('setHoverRow', index)\n }, 30)\n const handleMouseLeave = debounce(() => {\n props.store?.commit('setHoverRow', null)\n }, 30)\n const getPadding = (el: HTMLElement) => {\n const style = window.getComputedStyle(el, null)\n const paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0\n const paddingRight = Number.parseInt(style.paddingRight, 10) || 0\n const paddingTop = Number.parseInt(style.paddingTop, 10) || 0\n const paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0\n return {\n left: paddingLeft,\n right: paddingRight,\n top: paddingTop,\n bottom: paddingBottom,\n }\n }\n\n const toggleRowClassByCell = (\n rowSpan: number,\n event: MouseEvent,\n toggle: (el: Element, cls: string) => void\n ) => {\n let node: Node | null | undefined = (event?.target as Element | null)\n ?.parentNode\n while (rowSpan > 1) {\n node = node?.nextSibling\n if (!node || node.nodeName !== 'TR') break\n toggle(node as Element, 'hover-row hover-fixed-row')\n rowSpan--\n }\n }\n\n const handleCellMouseEnter = (\n event: MouseEvent,\n row: T,\n tooltipOptions: TableOverflowTooltipOptions\n ) => {\n if (!parent) return\n const table = parent\n const cell = getCell(event)\n const namespace = table?.vnode.el?.dataset.prefix\n let column: TableColumnCtx<T> | null = null\n if (cell) {\n column = getColumnByCell(\n {\n columns: props.store?.states.columns.value ?? [],\n },\n cell,\n namespace\n )\n if (!column) {\n return\n }\n if (cell.rowSpan > 1) {\n toggleRowClassByCell(cell.rowSpan, event, addClass)\n }\n const hoverState = (table.hoverState = {\n cell,\n column: column as any,\n row,\n })\n table?.emit(\n 'cell-mouse-enter',\n hoverState.row,\n hoverState.column,\n hoverState.cell,\n event\n )\n }\n\n if (!tooltipOptions) {\n if (removePopper?.trigger === cell) {\n removePopper?.()\n }\n return\n }\n\n // 判断是否text-overflow, 如果是就显示tooltip\n const cellChild = (event.target as HTMLElement).querySelector(\n '.cell'\n ) as HTMLElement\n if (\n !(\n hasClass(cellChild, `${namespace}-tooltip`) &&\n cellChild.childNodes.length &&\n cellChild.textContent?.trim()\n )\n ) {\n return\n }\n // use range width instead of scrollWidth to determine whether the text is overflowing\n // to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3\n const range = document.createRange()\n range.setStart(cellChild, 0)\n range.setEnd(cellChild, cellChild.childNodes.length)\n /** detail: https://github.com/element-plus/element-plus/issues/10790\n * What went wrong?\n * UI > Browser > Zoom, In Blink/WebKit, getBoundingClientRect() sometimes returns inexact values, probably due to lost precision during internal calculations. In the example above:\n * - Expected: 188\n * - Actual: 188.00000762939453\n */\n const { width: rangeWidth, height: rangeHeight } =\n range.getBoundingClientRect()\n const { width: cellChildWidth, height: cellChildHeight } =\n cellChild.getBoundingClientRect()\n\n const { top, left, right, bottom } = getPadding(cellChild)\n const horizontalPadding = left + right\n const verticalPadding = top + bottom\n if (\n isGreaterThan(rangeWidth + horizontalPadding, cellChildWidth) ||\n isGreaterThan(rangeHeight + verticalPadding, cellChildHeight) ||\n // When using a high-resolution screen, it is possible that a returns cellChild.scrollWidth value of 1921 and\n // cellChildWidth returns a value of 1920.994140625. #16856 #16673\n isGreaterThan(cellChild.scrollWidth, cellChildWidth)\n ) {\n createTablePopper(\n tooltipOptions,\n (cell?.innerText || cell?.textContent) ?? '',\n row,\n column,\n cell,\n table\n )\n } else if (removePopper?.trigger === cell) {\n removePopper?.()\n }\n }\n const handleCellMouseLeave = (event: MouseEvent) => {\n const cell = getCell(event)\n if (!cell) return\n if (cell.rowSpan > 1) {\n toggleRowClassByCell(cell.rowSpan, event, removeClass)\n }\n const oldHoverState = parent?.hoverState\n parent?.emit(\n 'cell-mouse-leave',\n oldHoverState?.row,\n oldHoverState?.column,\n oldHoverState?.cell,\n event\n )\n }\n\n return {\n handleDoubleClick,\n handleClick,\n handleContextMenu,\n handleMouseEnter,\n handleMouseLeave,\n handleCellMouseEnter,\n handleCellMouseLeave,\n tooltipContent,\n tooltipTrigger,\n }\n}\n\nexport default useEvents\n"],"mappings":";;;;;;;;;;;;AAqBA,SAAS,UAAgC,OAAmC;CAC1E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AC1D,MAAM,oBAAoB,OAAO;EACjC,MAAM,kBAAkB,MAAM;EAC9B,IACEC,gBAAAA,cAAc,aAAa,mBAAmB,eAAe,IAC7DA,gBAAAA,cAAc,cAAc,iBAAiB,gBAAgB,IAG7DA,gBAAAA,cAAc,UAAU,aAAa,eAAe,EAEpD,aAAA,kBACE,iBACC,MAAM,aAAa,MAAM,gBAAgB,IAC1C,KACA,QACA,MACA,MACD;OACI,IAAIF,aAAAA,cAAc,YAAY,MACnC,aAAA,gBAAgB;;CAGpB,MAAM,wBAAwB,UAAsB;EAClD,MAAM,OAAOH,aAAAA,QAAQ,MAAM;EAC3B,IAAI,CAAC,MAAM;EACX,IAAI,KAAK,UAAU,GACjB,qBAAqB,KAAK,SAAS,OAAOM,cAAAA,YAAY;EAExD,MAAM,gBAAgB,QAAQ;EAC9B,QAAQ,KACN,oBACA,eAAe,KACf,eAAe,QACf,eAAe,MACf,MACD;;CAGH,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"events-helper.js","names":["TABLE_INJECTION_KEY","getCell","getColumnByCell","addClass","removePopper","hasClass","isGreaterThan","removeClass"],"sources":["../../../../../../../packages/components/table/src/table-body/events-helper.ts"],"sourcesContent":["import { h, inject, ref } from 'vue'\nimport { debounce } from 'lodash-unified'\nimport {\n addClass,\n hasClass,\n isGreaterThan,\n removeClass,\n} from '@element-plus/utils'\nimport {\n createTablePopper,\n getCell,\n getColumnByCell,\n removePopper,\n} from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\n\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { TableBodyProps } from './defaults'\nimport type { TableOverflowTooltipOptions } from '../util'\nimport type { DefaultRow, Table } from '../table/defaults'\n\ninterface HandleEvent<T> {\n (event: PointerEvent, row: T, name: 'click' | 'contextmenu'): void\n (event: MouseEvent, row: T, name: 'dblclick'): void\n}\n\nfunction useEvents<T extends DefaultRow>(props: Partial<TableBodyProps<T>>) {\n const parent = inject(TABLE_INJECTION_KEY) as Table<T>\n const tooltipContent = ref('')\n const tooltipTrigger = ref(h('div'))\n const handleEvent: HandleEvent<T> = (event, row, name) => {\n const table = parent\n const cell = getCell(event)\n let column: TableColumnCtx<T> | null = null\n const namespace = table?.vnode.el?.dataset.prefix\n if (cell) {\n column = getColumnByCell(\n {\n columns: props.store?.states.columns.value ?? [],\n },\n cell,\n namespace\n )\n if (column) {\n // @ts-expect-error\n table?.emit(`cell-${name}`, row, column, cell, event)\n }\n }\n // @ts-expect-error\n table?.emit(`row-${name}`, row, column, event)\n }\n const handleDoubleClick = (event: MouseEvent, row: T) => {\n handleEvent(event, row, 'dblclick')\n }\n const handleClick = (event: PointerEvent, row: T) => {\n props.store?.commit('setCurrentRow', row)\n handleEvent(event, row, 'click')\n }\n const handleContextMenu = (event: PointerEvent, row: T) => {\n handleEvent(event, row, 'contextmenu')\n }\n const handleMouseEnter = debounce((index: number) => {\n props.store?.commit('setHoverRow', index)\n }, 30)\n const handleMouseLeave = debounce(() => {\n props.store?.commit('setHoverRow', null)\n }, 30)\n const getPadding = (el: HTMLElement) => {\n const style = window.getComputedStyle(el, null)\n const paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0\n const paddingRight = Number.parseInt(style.paddingRight, 10) || 0\n const paddingTop = Number.parseInt(style.paddingTop, 10) || 0\n const paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0\n return {\n left: paddingLeft,\n right: paddingRight,\n top: paddingTop,\n bottom: paddingBottom,\n }\n }\n\n const toggleRowClassByCell = (\n rowSpan: number,\n event: MouseEvent,\n toggle: (el: Element, cls: string) => void\n ) => {\n let node: Node | null | undefined = (event?.target as Element | null)\n ?.parentNode\n while (rowSpan > 1) {\n node = node?.nextSibling\n if (!node || node.nodeName !== 'TR') break\n toggle(node as Element, 'hover-row hover-fixed-row')\n rowSpan--\n }\n }\n\n const handleCellMouseEnter = (\n event: MouseEvent,\n row: T,\n tooltipOptions: TableOverflowTooltipOptions\n ) => {\n if (!parent) return\n const table = parent\n const cell = getCell(event)\n const namespace = table?.vnode.el?.dataset.prefix\n let column: TableColumnCtx<T> | null = null\n if (cell) {\n column = getColumnByCell(\n {\n columns: props.store?.states.columns.value ?? [],\n },\n cell,\n namespace\n )\n if (!column) {\n return\n }\n if (cell.rowSpan > 1) {\n toggleRowClassByCell(cell.rowSpan, event, addClass)\n }\n const hoverState = (table.hoverState = {\n cell,\n column: column as any,\n row,\n })\n table?.emit(\n 'cell-mouse-enter',\n hoverState.row,\n hoverState.column,\n hoverState.cell,\n event\n )\n }\n\n if (!tooltipOptions) {\n if (removePopper?.trigger === cell) {\n removePopper?.()\n }\n return\n }\n\n // 判断是否text-overflow, 如果是就显示tooltip\n const cellChild = (event.target as HTMLElement).querySelector(\n '.cell'\n ) as HTMLElement\n if (\n !(\n hasClass(cellChild, `${namespace}-tooltip`) &&\n cellChild.childNodes.length &&\n cellChild.textContent?.trim()\n )\n ) {\n return\n }\n // use range width instead of scrollWidth to determine whether the text is overflowing\n // to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3\n const range = document.createRange()\n range.setStart(cellChild, 0)\n range.setEnd(cellChild, cellChild.childNodes.length)\n /** detail: https://github.com/element-plus/element-plus/issues/10790\n * What went wrong?\n * UI > Browser > Zoom, In Blink/WebKit, getBoundingClientRect() sometimes returns inexact values, probably due to lost precision during internal calculations. In the example above:\n * - Expected: 188\n * - Actual: 188.00000762939453\n */\n const { width: rangeWidth, height: rangeHeight } =\n range.getBoundingClientRect()\n const { width: cellChildWidth, height: cellChildHeight } =\n cellChild.getBoundingClientRect()\n\n const { top, left, right, bottom } = getPadding(cellChild)\n const horizontalPadding = left + right\n const verticalPadding = top + bottom\n if (\n isGreaterThan(rangeWidth + horizontalPadding, cellChildWidth) ||\n isGreaterThan(rangeHeight + verticalPadding, cellChildHeight) ||\n // When using a high-resolution screen, it is possible that a returns cellChild.scrollWidth value of 1921 and\n // cellChildWidth returns a value of 1920.994140625. #16856 #16673\n isGreaterThan(cellChild.scrollWidth, cellChildWidth)\n ) {\n createTablePopper(\n tooltipOptions,\n (cell?.innerText || cell?.textContent) ?? '',\n row,\n column,\n cell,\n table\n )\n } else if (removePopper?.trigger === cell) {\n removePopper?.()\n }\n }\n const handleCellMouseLeave = (event: MouseEvent) => {\n const cell = getCell(event)\n if (!cell) return\n if (cell.rowSpan > 1) {\n toggleRowClassByCell(cell.rowSpan, event, removeClass)\n }\n // From the normal user interaction flow, it should never be empty. However, to avoid potential runtime errors, we still keep this defensive optional handling.\n const oldHoverState = parent?.hoverState as NonNullable<Table['hoverState']>\n parent?.emit(\n 'cell-mouse-leave',\n oldHoverState?.row,\n oldHoverState?.column,\n oldHoverState?.cell as HTMLTableCellElement,\n event\n )\n }\n\n return {\n handleDoubleClick,\n handleClick,\n handleContextMenu,\n handleMouseEnter,\n handleMouseLeave,\n handleCellMouseEnter,\n handleCellMouseLeave,\n tooltipContent,\n tooltipTrigger,\n }\n}\n\nexport default useEvents\n"],"mappings":";;;;;;;;;;;;AA0BA,SAAS,UAAgC,OAAmC;CAC1E,MAAM,UAAA,GAAA,IAAA,QAAgBA,eAAAA,oBAAoB;CAC1C,MAAM,kBAAA,GAAA,IAAA,KAAqB,GAAG;CAC9B,MAAM,kBAAA,GAAA,IAAA,MAAA,GAAA,IAAA,GAAuB,MAAM,CAAC;CACpC,MAAM,eAA+B,OAAO,KAAK,SAAS;EACxD,MAAM,QAAQ;EACd,MAAM,OAAOC,aAAAA,QAAQ,MAAM;EAC3B,IAAI,SAAmC;EACvC,MAAM,YAAY,OAAO,MAAM,IAAI,QAAQ;EAC3C,IAAI,MAAM;GACR,SAASC,aAAAA,gBACP,EACE,SAAS,MAAM,OAAO,OAAO,QAAQ,SAAS,EAAE,EACjD,EACD,MACA,UACD;GACD,IAAI,QAEF,OAAO,KAAK,QAAQ,QAAQ,KAAK,QAAQ,MAAM,MAAM;;EAIzD,OAAO,KAAK,OAAO,QAAQ,KAAK,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KACf,eAAe,QACf,eAAe,MACf,MACD;;CAGH,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-helper.js","names":["TABLE_INJECTION_KEY","useNamespace","useEvents","useStyles","getRowIdentity","isBoolean","TdWrapper","isPropAbsent"],"sources":["../../../../../../../packages/components/table/src/table-body/render-helper.ts"],"sourcesContent":["import { computed, h, inject } from 'vue'\nimport { merge } from 'lodash-unified'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isBoolean, isPropAbsent } from '@element-plus/utils'\nimport { getRowIdentity } from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport useEvents from './events-helper'\nimport useStyles from './styles-helper'\nimport TdWrapper from './td-wrapper.vue'\n\nimport type { TableBodyProps } from './defaults'\nimport type {\n DefaultRow,\n RenderRowData,\n Table,\n TableColumnCtx,\n TableProps,\n TreeNode,\n} from '../table/defaults'\nimport type { TreeData } from '../store/tree'\nimport type { TableOverflowTooltipOptions } from '../util'\n\nfunction useRender<T extends DefaultRow>(props: Partial<TableBodyProps<T>>) {\n const parent = inject(TABLE_INJECTION_KEY) as Table<T>\n const ns = useNamespace('table')\n const {\n handleDoubleClick,\n handleClick,\n handleContextMenu,\n handleMouseEnter,\n handleMouseLeave,\n handleCellMouseEnter,\n handleCellMouseLeave,\n tooltipContent,\n tooltipTrigger,\n } = useEvents(props)\n const {\n getRowStyle,\n getRowClass,\n getCellStyle,\n getCellClass,\n getSpan,\n getColspanRealWidth,\n } = useStyles(props)\n\n let displayIndex = -1\n\n const firstDefaultColumnIndex = computed(() => {\n return props.store?.states.columns.value.findIndex(\n ({ type }) => type === 'default'\n )\n })\n const getKeyOfRow = (row: T, index: number) => {\n const rowKey = (parent?.props as Partial<TableProps<T>>)?.rowKey\n if (rowKey) {\n return getRowIdentity(row, rowKey)\n }\n return index\n }\n const rowRender = (\n row: T,\n $index: number,\n treeRowData?: TreeNode,\n expanded = false\n ) => {\n const { tooltipEffect, tooltipOptions, store } = props\n const { indent, columns } = store!.states\n const rowClasses = []\n let display = true\n if (treeRowData) {\n rowClasses.push(ns.em('row', `level-${treeRowData.level}`))\n display = !!treeRowData.display\n }\n if ($index === 0) {\n displayIndex = -1\n }\n if (props.stripe && display) {\n displayIndex++\n }\n rowClasses.push(...getRowClass(row, $index, displayIndex))\n const displayStyle = display ? null : { display: 'none' }\n return h(\n 'tr',\n {\n style: [displayStyle, getRowStyle(row, $index)],\n class: rowClasses,\n key: getKeyOfRow(row, $index),\n onDblclick: ($event: Event) => handleDoubleClick($event, row),\n onClick: ($event: Event) => handleClick($event, row),\n onContextmenu: ($event: Event) => handleContextMenu($event, row),\n onMouseenter: () => handleMouseEnter($index),\n onMouseleave: handleMouseLeave,\n },\n columns.value.map((column, cellIndex) => {\n const { rowspan, colspan } = getSpan(row, column, $index, cellIndex)\n if (!rowspan || !colspan) {\n return null\n }\n const columnData = Object.assign({}, column)\n columnData.realWidth = getColspanRealWidth(\n columns.value,\n colspan,\n cellIndex\n )\n const data: RenderRowData<T> = {\n store: store!,\n _self: props.context || parent!,\n column: columnData,\n row,\n $index,\n cellIndex,\n expanded,\n }\n if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {\n data.treeNode = {\n indent: treeRowData.level && treeRowData.level * indent.value,\n level: treeRowData.level,\n }\n if (isBoolean(treeRowData.expanded)) {\n data.treeNode.expanded = treeRowData.expanded\n // 表明是懒加载\n if ('loading' in treeRowData) {\n data.treeNode.loading = treeRowData.loading\n }\n if ('noLazyChildren' in treeRowData) {\n data.treeNode.noLazyChildren = treeRowData.noLazyChildren\n }\n }\n }\n const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`\n const patchKey = columnData.columnKey || columnData.rawColumnKey || ''\n const mergedTooltipOptions =\n column.showOverflowTooltip &&\n merge(\n {\n effect: tooltipEffect,\n },\n tooltipOptions,\n column.showOverflowTooltip\n )\n return h(\n TdWrapper,\n {\n style: getCellStyle($index, cellIndex, row, column),\n class: getCellClass($index, cellIndex, row, column, colspan - 1),\n key: `${patchKey}${baseKey}`,\n rowspan,\n colspan,\n onMouseenter: ($event: MouseEvent) =>\n handleCellMouseEnter(\n $event,\n row,\n mergedTooltipOptions as TableOverflowTooltipOptions\n ),\n onMouseleave: handleCellMouseLeave,\n },\n {\n default: () => cellChildren(cellIndex, column, data),\n }\n )\n })\n )\n }\n const cellChildren = <T extends DefaultRow>(\n _cellIndex: number,\n column: TableColumnCtx<T>,\n data: RenderRowData<T>\n ) => {\n return column.renderCell(data)\n }\n\n const wrappedRowRender = (row: T, $index: number) => {\n const store = props.store!\n const { isRowExpanded, assertRowKey } = store\n const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } =\n store.states\n const columns = store.states.columns.value\n const hasExpandColumn = columns.some(({ type }) => type === 'expand')\n if (hasExpandColumn) {\n const expanded = isRowExpanded(row)\n const tr = rowRender(row, $index, undefined, expanded)\n const renderExpanded = parent?.renderExpanded\n if (!renderExpanded) {\n console.error('[Element Error]renderExpanded is required.')\n return tr\n }\n\n // 在没设置时候避免 h 执行\n // 非保留模式且未展开时,直接返回\n // 使用二维数组包装,避免修改 $index\n const rows = [[tr]]\n\n // 仅在需要时创建展开行(保留模式或展开状态)\n if (parent.props.preserveExpandedContent || expanded) {\n rows[0].push(\n h(\n 'tr',\n {\n key: `expanded-row__${tr.key as string}`,\n style: { display: expanded ? '' : 'none' },\n },\n [\n h(\n 'td',\n {\n colspan: columns.length,\n class: `${ns.e('cell')} ${ns.e('expanded-cell')}`,\n },\n [renderExpanded({ row, $index, store, expanded })]\n ),\n ]\n )\n )\n }\n\n return rows\n } else if (Object.keys(treeData.value).length) {\n assertRowKey()\n // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算\n // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作\n const key = getRowIdentity(row, rowKey.value)\n let cur = treeData.value[key]\n let treeRowData = null\n if (cur) {\n treeRowData = {\n expanded: cur.expanded,\n level: cur.level,\n display: true,\n noLazyChildren: undefined as boolean | undefined,\n loading: undefined as boolean | undefined,\n }\n if (isBoolean(cur.lazy)) {\n if (treeRowData && isBoolean(cur.loaded) && cur.loaded) {\n treeRowData.noLazyChildren = !(cur.children && cur.children.length)\n }\n treeRowData.loading = cur.loading\n }\n }\n const tmp = [rowRender(row, $index, treeRowData ?? undefined)]\n // 渲染嵌套数据\n if (cur) {\n // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index\n let i = 0\n const traverse = (children: T[], parent: TreeData) => {\n if (!(children && children.length && parent)) return\n children.forEach((node) => {\n // 父节点的 display 状态影响子节点的显示状态\n const innerTreeRowData: Partial<Record<string, any>> = {\n display: parent.display && parent.expanded,\n level: parent.level! + 1,\n expanded: false,\n noLazyChildren: false,\n loading: false,\n }\n const childKey = getRowIdentity(node, rowKey.value)\n if (isPropAbsent(childKey)) {\n throw new Error('For nested data item, row-key is required.')\n }\n cur = { ...treeData.value[childKey] }\n // 对于当前节点,分成有无子节点两种情况。\n // 如果包含子节点的,设置 expanded 属性。\n // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。\n if (cur) {\n innerTreeRowData.expanded = cur.expanded\n // 懒加载的某些节点,level 未知\n cur.level = cur.level || innerTreeRowData.level\n cur.display = !!(cur.expanded && innerTreeRowData.display)\n if (isBoolean(cur.lazy)) {\n if (isBoolean(cur.loaded) && cur.loaded) {\n innerTreeRowData.noLazyChildren = !(\n cur.children && cur.children.length\n )\n }\n innerTreeRowData.loading = cur.loading\n }\n }\n i++\n tmp.push(rowRender(node, $index + i, innerTreeRowData))\n if (cur) {\n const nodes =\n lazyTreeNodeMap.value[childKey] ||\n node[childrenColumnName.value]\n traverse(nodes, cur)\n }\n })\n }\n // 对于 root 节点,display 一定为 true\n cur.display = true\n const nodes =\n lazyTreeNodeMap.value[key] || row[childrenColumnName.value]\n traverse(nodes, cur)\n }\n return tmp\n } else {\n return rowRender(row, $index, undefined)\n }\n }\n\n return {\n w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|
1
|
+
{"version":3,"file":"render-helper.js","names":["TABLE_INJECTION_KEY","useNamespace","useEvents","useStyles","getRowIdentity","isBoolean","TdWrapper","isPropAbsent"],"sources":["../../../../../../../packages/components/table/src/table-body/render-helper.ts"],"sourcesContent":["import { computed, h, inject } from 'vue'\nimport { merge } from 'lodash-unified'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isBoolean, isPropAbsent } from '@element-plus/utils'\nimport { getRowIdentity } from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport useEvents from './events-helper'\nimport useStyles from './styles-helper'\nimport TdWrapper from './td-wrapper.vue'\n\nimport type { TableBodyProps } from './defaults'\nimport type {\n DefaultRow,\n RenderRowData,\n Table,\n TableColumnCtx,\n TableProps,\n TreeNode,\n} from '../table/defaults'\nimport type { TreeData } from '../store/tree'\nimport type { TableOverflowTooltipOptions } from '../util'\n\nfunction useRender<T extends DefaultRow>(props: Partial<TableBodyProps<T>>) {\n const parent = inject(TABLE_INJECTION_KEY) as Table<T>\n const ns = useNamespace('table')\n const {\n handleDoubleClick,\n handleClick,\n handleContextMenu,\n handleMouseEnter,\n handleMouseLeave,\n handleCellMouseEnter,\n handleCellMouseLeave,\n tooltipContent,\n tooltipTrigger,\n } = useEvents(props)\n const {\n getRowStyle,\n getRowClass,\n getCellStyle,\n getCellClass,\n getSpan,\n getColspanRealWidth,\n } = useStyles(props)\n\n let displayIndex = -1\n\n const firstDefaultColumnIndex = computed(() => {\n return props.store?.states.columns.value.findIndex(\n ({ type }) => type === 'default'\n )\n })\n const getKeyOfRow = (row: T, index: number) => {\n const rowKey = (parent?.props as Partial<TableProps<T>>)?.rowKey\n if (rowKey) {\n return getRowIdentity(row, rowKey)\n }\n return index\n }\n const rowRender = (\n row: T,\n $index: number,\n treeRowData?: TreeNode,\n expanded = false\n ) => {\n const { tooltipEffect, tooltipOptions, store } = props\n const { indent, columns } = store!.states\n const rowClasses = []\n let display = true\n if (treeRowData) {\n rowClasses.push(ns.em('row', `level-${treeRowData.level}`))\n display = !!treeRowData.display\n }\n if ($index === 0) {\n displayIndex = -1\n }\n if (props.stripe && display) {\n displayIndex++\n }\n rowClasses.push(...getRowClass(row, $index, displayIndex))\n const displayStyle = display ? null : { display: 'none' }\n return h(\n 'tr',\n {\n style: [displayStyle, getRowStyle(row, $index)],\n class: rowClasses,\n key: getKeyOfRow(row, $index),\n onDblclick: ($event: MouseEvent) => handleDoubleClick($event, row),\n onClick: ($event: PointerEvent) => handleClick($event, row),\n onContextmenu: ($event: PointerEvent) => handleContextMenu($event, row),\n onMouseenter: () => handleMouseEnter($index),\n onMouseleave: handleMouseLeave,\n },\n columns.value.map((column, cellIndex) => {\n const { rowspan, colspan } = getSpan(row, column, $index, cellIndex)\n if (!rowspan || !colspan) {\n return null\n }\n const columnData = Object.assign({}, column)\n columnData.realWidth = getColspanRealWidth(\n columns.value,\n colspan,\n cellIndex\n )\n const data: RenderRowData<T> = {\n store: store!,\n _self: props.context || parent!,\n column: columnData,\n row,\n $index,\n cellIndex,\n expanded,\n }\n if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {\n data.treeNode = {\n indent: treeRowData.level && treeRowData.level * indent.value,\n level: treeRowData.level,\n }\n if (isBoolean(treeRowData.expanded)) {\n data.treeNode.expanded = treeRowData.expanded\n // 表明是懒加载\n if ('loading' in treeRowData) {\n data.treeNode.loading = treeRowData.loading\n }\n if ('noLazyChildren' in treeRowData) {\n data.treeNode.noLazyChildren = treeRowData.noLazyChildren\n }\n }\n }\n const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`\n const patchKey = columnData.columnKey || columnData.rawColumnKey || ''\n const mergedTooltipOptions =\n column.showOverflowTooltip &&\n merge(\n {\n effect: tooltipEffect,\n },\n tooltipOptions,\n column.showOverflowTooltip\n )\n return h(\n TdWrapper,\n {\n style: getCellStyle($index, cellIndex, row, column),\n class: getCellClass($index, cellIndex, row, column, colspan - 1),\n key: `${patchKey}${baseKey}`,\n rowspan,\n colspan,\n onMouseenter: ($event: MouseEvent) =>\n handleCellMouseEnter(\n $event,\n row,\n mergedTooltipOptions as TableOverflowTooltipOptions\n ),\n onMouseleave: handleCellMouseLeave,\n },\n {\n default: () => cellChildren(cellIndex, column, data),\n }\n )\n })\n )\n }\n const cellChildren = <T extends DefaultRow>(\n _cellIndex: number,\n column: TableColumnCtx<T>,\n data: RenderRowData<T>\n ) => {\n return column.renderCell(data)\n }\n\n const wrappedRowRender = (row: T, $index: number) => {\n const store = props.store!\n const { isRowExpanded, assertRowKey } = store\n const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } =\n store.states\n const columns = store.states.columns.value\n const hasExpandColumn = columns.some(({ type }) => type === 'expand')\n if (hasExpandColumn) {\n const expanded = isRowExpanded(row)\n const tr = rowRender(row, $index, undefined, expanded)\n const renderExpanded = parent?.renderExpanded\n if (!renderExpanded) {\n console.error('[Element Error]renderExpanded is required.')\n return tr\n }\n\n // 在没设置时候避免 h 执行\n // 非保留模式且未展开时,直接返回\n // 使用二维数组包装,避免修改 $index\n const rows = [[tr]]\n\n // 仅在需要时创建展开行(保留模式或展开状态)\n if (parent.props.preserveExpandedContent || expanded) {\n rows[0].push(\n h(\n 'tr',\n {\n key: `expanded-row__${tr.key as string}`,\n style: { display: expanded ? '' : 'none' },\n },\n [\n h(\n 'td',\n {\n colspan: columns.length,\n class: `${ns.e('cell')} ${ns.e('expanded-cell')}`,\n },\n [renderExpanded({ row, $index, store, expanded })]\n ),\n ]\n )\n )\n }\n\n return rows\n } else if (Object.keys(treeData.value).length) {\n assertRowKey()\n // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算\n // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作\n const key = getRowIdentity(row, rowKey.value)\n let cur = treeData.value[key]\n let treeRowData = null\n if (cur) {\n treeRowData = {\n expanded: cur.expanded,\n level: cur.level,\n display: true,\n noLazyChildren: undefined as boolean | undefined,\n loading: undefined as boolean | undefined,\n }\n if (isBoolean(cur.lazy)) {\n if (treeRowData && isBoolean(cur.loaded) && cur.loaded) {\n treeRowData.noLazyChildren = !(cur.children && cur.children.length)\n }\n treeRowData.loading = cur.loading\n }\n }\n const tmp = [rowRender(row, $index, treeRowData ?? undefined)]\n // 渲染嵌套数据\n if (cur) {\n // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index\n let i = 0\n const traverse = (children: T[], parent: TreeData) => {\n if (!(children && children.length && parent)) return\n children.forEach((node) => {\n // 父节点的 display 状态影响子节点的显示状态\n const innerTreeRowData: Partial<Record<string, any>> = {\n display: parent.display && parent.expanded,\n level: parent.level! + 1,\n expanded: false,\n noLazyChildren: false,\n loading: false,\n }\n const childKey = getRowIdentity(node, rowKey.value)\n if (isPropAbsent(childKey)) {\n throw new Error('For nested data item, row-key is required.')\n }\n cur = { ...treeData.value[childKey] }\n // 对于当前节点,分成有无子节点两种情况。\n // 如果包含子节点的,设置 expanded 属性。\n // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。\n if (cur) {\n innerTreeRowData.expanded = cur.expanded\n // 懒加载的某些节点,level 未知\n cur.level = cur.level || innerTreeRowData.level\n cur.display = !!(cur.expanded && innerTreeRowData.display)\n if (isBoolean(cur.lazy)) {\n if (isBoolean(cur.loaded) && cur.loaded) {\n innerTreeRowData.noLazyChildren = !(\n cur.children && cur.children.length\n )\n }\n innerTreeRowData.loading = cur.loading\n }\n }\n i++\n tmp.push(rowRender(node, $index + i, innerTreeRowData))\n if (cur) {\n const nodes =\n lazyTreeNodeMap.value[childKey] ||\n node[childrenColumnName.value]\n traverse(nodes, cur)\n }\n })\n }\n // 对于 root 节点,display 一定为 true\n cur.display = true\n const nodes =\n lazyTreeNodeMap.value[key] || row[childrenColumnName.value]\n traverse(nodes, cur)\n }\n return tmp\n } else {\n return rowRender(row, $index, undefined)\n }\n }\n\n return {\n wrappedRowRender,\n tooltipContent,\n tooltipTrigger,\n }\n}\n\nexport default useRender\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAS,UAAgC,OA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, Table, TableSortOrder } from "../table/defaults.js";
|
|
3
2
|
import { Store } from "../store/index.js";
|
|
3
|
+
import { DefaultRow, Table, TableSortOrder } from "../table/defaults.js";
|
|
4
4
|
import { ComponentInternalInstance, PropType, Ref, VNode } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region ../../packages/components/table/src/table-column/defaults.d.ts
|
|
@@ -249,7 +249,7 @@ declare const tableColumnProps: {
|
|
|
249
249
|
* @description whether column can be sorted. Remote sorting can be done by setting this attribute to 'custom' and listening to the `sort-change` event of Table
|
|
250
250
|
*/
|
|
251
251
|
sortable: {
|
|
252
|
-
type: (
|
|
252
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
253
253
|
default: boolean;
|
|
254
254
|
};
|
|
255
255
|
/**
|
|
@@ -293,7 +293,7 @@ declare const tableColumnProps: {
|
|
|
293
293
|
/**
|
|
294
294
|
* @description whether column is fixed at left / right. Will be fixed at left if `true`
|
|
295
295
|
*/
|
|
296
|
-
fixed: (
|
|
296
|
+
fixed: (BooleanConstructor | StringConstructor)[];
|
|
297
297
|
/**
|
|
298
298
|
* @description function that formats cell content
|
|
299
299
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TableColumnCtx } from "../table-column/defaults.js";
|
|
2
|
+
import { Store } from "../store/index.js";
|
|
2
3
|
import TableLayout from "../table-layout.js";
|
|
3
4
|
import { DefaultRow, Sort, SummaryMethod } from "../table/defaults.js";
|
|
4
|
-
import { Store } from "../store/index.js";
|
|
5
5
|
import * as _$vue from "vue";
|
|
6
6
|
import { PropType } from "vue";
|
|
7
7
|
|
|
@@ -5,8 +5,8 @@ import { DefaultRow, TableSortOrder } from "../table/defaults.js";
|
|
|
5
5
|
|
|
6
6
|
//#region ../../packages/components/table/src/table-header/event-helper.d.ts
|
|
7
7
|
declare function useEvent<T extends DefaultRow>(props: TableHeaderProps<T>, emit: EmitFn<string[]>): {
|
|
8
|
-
handleHeaderClick: (event:
|
|
9
|
-
handleHeaderContextMenu: (event:
|
|
8
|
+
handleHeaderClick: (event: PointerEvent, column: TableColumnCtx<T>) => void;
|
|
9
|
+
handleHeaderContextMenu: (event: PointerEvent, column: TableColumnCtx<T>) => void;
|
|
10
10
|
handleMouseDown: (event: MouseEvent, column: TableColumnCtx<T>) => void;
|
|
11
11
|
handleMouseMove: (event: MouseEvent, column: TableColumnCtx<T>) => void;
|
|
12
12
|
handleMouseOut: () => void;
|
|
@@ -139,7 +139,7 @@ function useEvent(props, emit) {
|
|
|
139
139
|
if (sortingColumn !== column || sortingColumn === column && (0, lodash_unified.isNull)(sortingColumn.order)) {
|
|
140
140
|
if (sortingColumn) sortingColumn.order = null;
|
|
141
141
|
states.sortingColumn.value = column;
|
|
142
|
-
sortProp = column.property;
|
|
142
|
+
sortProp = column.property ?? null;
|
|
143
143
|
}
|
|
144
144
|
if (!order) sortOrder = column.order = null;
|
|
145
145
|
else sortOrder = column.order = order;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-helper.js","names":["TABLE_INJECTION_KEY","isClient","isElement","hasClass"],"sources":["../../../../../../../packages/components/table/src/table-header/event-helper.ts"],"sourcesContent":["import { getCurrentInstance, inject, ref } from 'vue'\nimport { isNull } from 'lodash-unified'\nimport {\n addClass,\n hasClass,\n isClient,\n isElement,\n removeClass,\n} from '@element-plus/utils'\nimport { TABLE_INJECTION_KEY } from '../tokens'\n\nimport type { EmitFn } from '@element-plus/utils'\nimport type { TableHeaderProps } from '.'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { DefaultRow, TableSortOrder } from '../table/defaults'\n\nfunction useEvent<T extends DefaultRow>(\n props: TableHeaderProps<T>,\n emit: EmitFn<string[]>\n) {\n const instance = getCurrentInstance()\n const parent = inject(TABLE_INJECTION_KEY)\n const handleFilterClick = (event: Event) => {\n event.stopPropagation()\n return\n }\n\n const handleHeaderClick = (event: Event, column: TableColumnCtx<T>) => {\n if (!column.filters && column.sortable) {\n handleSortClick(event, column, false)\n } else if (column.filterable && !column.sortable) {\n handleFilterClick(event)\n }\n parent?.emit('header-click', column, event)\n }\n\n const handleHeaderContextMenu = (event: Event, column: TableColumnCtx<T>) => {\n parent?.emit('header-contextmenu', column, event)\n }\n const draggingColumn = ref<TableColumnCtx<T> | null>(null)\n const dragging = ref(false)\n const dragState = ref<{\n startMouseLeft: number\n startLeft: number\n startColumnLeft: number\n tableLeft: number\n }>()\n const handleMouseDown = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (!isClient) return\n if (column.children && column.children.length > 0) return\n /* istanbul ignore if */\n if (\n draggingColumn.value &&\n props.border &&\n draggingColumn.value.id === column.id\n ) {\n dragging.value = true\n\n const table = parent\n emit('set-drag-visible', true)\n const tableEl = table?.vnode.el\n const tableLeft = tableEl?.getBoundingClientRect().left\n const columnEl = instance?.vnode?.el?.querySelector(`th.${column.id}`)\n const columnRect = columnEl.getBoundingClientRect()\n const minLeft = columnRect.left - tableLeft + 30\n\n addClass(columnEl, 'noclick')\n\n dragState.value = {\n startMouseLeft: event.clientX,\n startLeft: columnRect.right - tableLeft,\n startColumnLeft: columnRect.left - tableLeft,\n tableLeft,\n }\n const resizeProxy = table?.refs.resizeProxy as HTMLElement\n resizeProxy.style.left = `${(dragState.value as any).startLeft}px`\n\n document.onselectstart = function () {\n return false\n }\n document.ondragstart = function () {\n return false\n }\n\n const handleMouseMove = (event: MouseEvent) => {\n const deltaLeft =\n event.clientX - (dragState.value as any).startMouseLeft\n const proxyLeft = (dragState.value as any).startLeft + deltaLeft\n\n resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`\n }\n\n const handleMouseUp = () => {\n if (dragging.value) {\n const { startColumnLeft, startLeft } = dragState.value as any\n const finalLeft = Number.parseInt(resizeProxy.style.left, 10)\n const columnWidth = finalLeft - startColumnLeft\n column.width = column.realWidth = columnWidth\n table?.emit(\n 'header-dragend',\n column.width,\n startLeft - startColumnLeft,\n column,\n event\n )\n requestAnimationFrame(() => {\n props.store.scheduleLayout(false, true)\n })\n document.body.style.cursor = ''\n dragging.value = false\n draggingColumn.value = null\n dragState.value = undefined\n emit('set-drag-visible', false)\n }\n\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.onselectstart = null\n document.ondragstart = null\n\n setTimeout(() => {\n removeClass(columnEl, 'noclick')\n }, 0)\n }\n\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n }\n }\n\n const handleMouseMove = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (!props.border || (column.children && column.children.length > 0)) return\n const el = event.target as HTMLElement\n const target = isElement(el) ? el.closest('th') : null\n if (!target) {\n return\n }\n\n const isSortable = hasClass(target, 'is-sortable')\n\n if (isSortable) {\n const cursor = dragging.value ? 'col-resize' : ''\n target.style.cursor = cursor\n\n const caret = target.querySelector<HTMLElement>('.caret-wrapper')\n if (caret) {\n caret.style.cursor = cursor\n }\n }\n\n if (!column.resizable || dragging.value) {\n draggingColumn.value = null\n return\n }\n\n const rect = target.getBoundingClientRect()\n const isLastTh = target.parentNode?.lastElementChild === target\n const allowDrag = props.allowDragLastColumn || !isLastTh\n const isResizeHandleActive =\n rect.width > 12 && rect.right - event.clientX < 8 && allowDrag\n const cursor = isResizeHandleActive ? 'col-resize' : ''\n\n document.body.style.cursor = cursor\n draggingColumn.value = isResizeHandleActive ? (column as any) : null\n if (isSortable) {\n target.style.cursor = cursor\n }\n }\n\n const handleMouseOut = () => {\n if (!isClient || dragging.value) return\n document.body.style.cursor = ''\n }\n const toggleOrder = ({ order, sortOrders }: TableColumnCtx<T>) => {\n if ((order as string) === '') return sortOrders[0]\n const index = sortOrders.indexOf(order || null)\n return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1]\n }\n const handleSortClick = (\n event: Event,\n column: TableColumnCtx<T>,\n givenOrder?: TableSortOrder | boolean\n ) => {\n event.stopPropagation()\n const order = (\n column.order === givenOrder ? null : givenOrder || toggleOrder(column)\n ) as TableSortOrder | null\n const target = (event.target as HTMLElement)?.closest('th')\n\n if (target) {\n if (hasClass(target, 'noclick')) {\n removeClass(target, 'noclick')\n return\n }\n }\n\n if (!column.sortable) return\n\n const clickTarget = event.currentTarget\n\n if (\n ['ascending', 'descending'].some(\n (str) =>\n hasClass(clickTarget as Element, str) &&\n !column.sortOrders.includes(str as TableSortOrder)\n )\n ) {\n return\n }\n\n const states = props.store.states\n let sortProp = states.sortProp.value\n let sortOrder\n const sortingColumn = states.sortingColumn.value\n\n if (\n sortingColumn !== column ||\n (sortingColumn === column && isNull(sortingColumn.order))\n ) {\n if (sortingColumn) {\n sortingColumn.order = null\n }\n states.sortingColumn.value = column\n sortProp = column.property\n }\n if (!order) {\n sortOrder = column.order = null\n } else {\n sortOrder = column.order = order\n }\n\n states.sortProp.value = sortProp\n states.sortOrder.value = sortOrder\n\n parent?.store.commit('changeSortCondition')\n }\n\n return {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n }\n}\n\nexport default useEvent\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAS,SACP,OACA,MACA;CACA,MAAM,YAAA,GAAA,IAAA,qBAA+B;CACrC,MAAM,UAAA,GAAA,IAAA,QAAgBA,eAAAA,oBAAoB;CAC1C,MAAM,qBAAqB,UAAiB;EAC1C,MAAM,iBAAiB;;CAIzB,MAAM,qBAAqB,OAAc,WAA8B;EACrE,IAAI,CAAC,OAAO,WAAW,OAAO,UAC5B,gBAAgB,OAAO,QAAQ,MAAM;OAChC,IAAI,OAAO,cAAc,CAAC,OAAO,UACtC,kBAAkB,MAAM;EAE1B,QAAQ,KAAK,gBAAgB,QAAQ,MAAM;;CAG7C,MAAM,2BAA2B,OAAc,WAA8B;EAC3E,QAAQ,KAAK,sBAAsB,QAAQ,MAAM;;CAEnD,MAAM,kBAAA,GAAA,IAAA,KAA+C,KAAK;CAC1D,MAAM,YAAA,GAAA,IAAA,KAAe,MAAM;CAC3B,M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Ae,EAAE,OAAO,iBAAoC;EAChE,IAAK,UAAqB,IAAI,OAAO,WAAW;EAChD,MAAM,QAAQ,WAAW,QAAQ,SAAS,KAAK;EAC/C,OAAO,WAAW,QAAQ,WAAW,SAAS,IAAI,IAAI,QAAQ;;CAEhE,MAAM,mBACJ,OACA,QACA,eACG;EACH,MAAM,iBAAiB;EACvB,MAAM,QACJ,OAAO,UAAU,aAAa,OAAO,cAAc,YAAY,OAAO;EAExE,MAAM,SAAU,MAAM,QAAwB,QAAQ,KAAK;EAE3D,IAAI;OACEE,cAAAA,SAAS,QAAQ,UAAU,EAAE;IAC/B,cAAA,YAAY,QAAQ,UAAU;IAC9B;;;EAIJ,IAAI,CAAC,OAAO,UAAU;EAEtB,MAAM,cAAc,MAAM;EAE1B,IACE,CAAC,aAAa,aAAa,CAAC,MACzB,QACCA,cAAAA,SAAS,aAAwB,IAAI,IACrC,CAAC,OAAO,WAAW,SAAS,IAAsB,CACrD,EAED;EAGF,MAAM,SAAS,MAAM,MAAM;EAC3B,IAAI,WAAW,OAAO,SAAS;EAC/B,IAAI;EACJ,MAAM,gBAAgB,OAAO,cAAc;EAE3C,IACE,kBAAkB,UACjB,kBAAkB,WAAA,GAAA,eAAA,QAAiB,cAAc,MAAM,EACxD;GACA,IAAI,eACF,cAAc,QAAQ;GAExB,OAAO,cAAc,QAAQ;GAC7B,WAAW,OAAO;;EAEpB,IAAI,CAAC,OACH,YAAY,OAAO,QAAQ;OAE3B,YAAY,OAAO,QAAQ;EAG7B,OAAO,SAAS,QAAQ;EACxB,OAAO,UAAU,QAAQ;EAEzB,QAAQ,MAAM,OAAO,sBAAsB;;CAG7C,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"event-helper.js","names":["TABLE_INJECTION_KEY","isClient","isElement","hasClass"],"sources":["../../../../../../../packages/components/table/src/table-header/event-helper.ts"],"sourcesContent":["import { getCurrentInstance, inject, ref } from 'vue'\nimport { isNull } from 'lodash-unified'\nimport {\n addClass,\n hasClass,\n isClient,\n isElement,\n removeClass,\n} from '@element-plus/utils'\nimport { TABLE_INJECTION_KEY } from '../tokens'\n\nimport type { EmitFn } from '@element-plus/utils'\nimport type { TableHeaderProps } from '.'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { DefaultRow, TableSortOrder } from '../table/defaults'\n\nfunction useEvent<T extends DefaultRow>(\n props: TableHeaderProps<T>,\n emit: EmitFn<string[]>\n) {\n const instance = getCurrentInstance()\n const parent = inject(TABLE_INJECTION_KEY)\n const handleFilterClick = (event: Event) => {\n event.stopPropagation()\n return\n }\n\n const handleHeaderClick = (\n event: PointerEvent,\n column: TableColumnCtx<T>\n ) => {\n if (!column.filters && column.sortable) {\n handleSortClick(event, column, false)\n } else if (column.filterable && !column.sortable) {\n handleFilterClick(event)\n }\n parent?.emit('header-click', column, event)\n }\n\n const handleHeaderContextMenu = (\n event: PointerEvent,\n column: TableColumnCtx<T>\n ) => {\n parent?.emit('header-contextmenu', column, event)\n }\n const draggingColumn = ref<TableColumnCtx<T> | null>(null)\n const dragging = ref(false)\n const dragState = ref<{\n startMouseLeft: number\n startLeft: number\n startColumnLeft: number\n tableLeft: number\n }>()\n const handleMouseDown = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (!isClient) return\n if (column.children && column.children.length > 0) return\n /* istanbul ignore if */\n if (\n draggingColumn.value &&\n props.border &&\n draggingColumn.value.id === column.id\n ) {\n dragging.value = true\n\n const table = parent\n emit('set-drag-visible', true)\n const tableEl = table?.vnode.el\n const tableLeft = tableEl?.getBoundingClientRect().left\n const columnEl = instance?.vnode?.el?.querySelector(`th.${column.id}`)\n const columnRect = columnEl.getBoundingClientRect()\n const minLeft = columnRect.left - tableLeft + 30\n\n addClass(columnEl, 'noclick')\n\n dragState.value = {\n startMouseLeft: event.clientX,\n startLeft: columnRect.right - tableLeft,\n startColumnLeft: columnRect.left - tableLeft,\n tableLeft,\n }\n const resizeProxy = table?.refs.resizeProxy as HTMLElement\n resizeProxy.style.left = `${(dragState.value as any).startLeft}px`\n\n document.onselectstart = function () {\n return false\n }\n document.ondragstart = function () {\n return false\n }\n\n const handleMouseMove = (event: MouseEvent) => {\n const deltaLeft =\n event.clientX - (dragState.value as any).startMouseLeft\n const proxyLeft = (dragState.value as any).startLeft + deltaLeft\n\n resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`\n }\n\n const handleMouseUp = () => {\n if (dragging.value) {\n const { startColumnLeft, startLeft } = dragState.value as any\n const finalLeft = Number.parseInt(resizeProxy.style.left, 10)\n const columnWidth = finalLeft - startColumnLeft\n column.width = column.realWidth = columnWidth\n table?.emit(\n 'header-dragend',\n column.width,\n startLeft - startColumnLeft,\n column,\n event\n )\n requestAnimationFrame(() => {\n props.store.scheduleLayout(false, true)\n })\n document.body.style.cursor = ''\n dragging.value = false\n draggingColumn.value = null\n dragState.value = undefined\n emit('set-drag-visible', false)\n }\n\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.onselectstart = null\n document.ondragstart = null\n\n setTimeout(() => {\n removeClass(columnEl, 'noclick')\n }, 0)\n }\n\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n }\n }\n\n const handleMouseMove = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (!props.border || (column.children && column.children.length > 0)) return\n const el = event.target as HTMLElement\n const target = isElement(el) ? el.closest('th') : null\n if (!target) {\n return\n }\n\n const isSortable = hasClass(target, 'is-sortable')\n\n if (isSortable) {\n const cursor = dragging.value ? 'col-resize' : ''\n target.style.cursor = cursor\n\n const caret = target.querySelector<HTMLElement>('.caret-wrapper')\n if (caret) {\n caret.style.cursor = cursor\n }\n }\n\n if (!column.resizable || dragging.value) {\n draggingColumn.value = null\n return\n }\n\n const rect = target.getBoundingClientRect()\n const isLastTh = target.parentNode?.lastElementChild === target\n const allowDrag = props.allowDragLastColumn || !isLastTh\n const isResizeHandleActive =\n rect.width > 12 && rect.right - event.clientX < 8 && allowDrag\n const cursor = isResizeHandleActive ? 'col-resize' : ''\n\n document.body.style.cursor = cursor\n draggingColumn.value = isResizeHandleActive ? (column as any) : null\n if (isSortable) {\n target.style.cursor = cursor\n }\n }\n\n const handleMouseOut = () => {\n if (!isClient || dragging.value) return\n document.body.style.cursor = ''\n }\n const toggleOrder = ({ order, sortOrders }: TableColumnCtx<T>) => {\n if ((order as string) === '') return sortOrders[0]\n const index = sortOrders.indexOf(order || null)\n return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1]\n }\n const handleSortClick = (\n event: Event,\n column: TableColumnCtx<T>,\n givenOrder?: TableSortOrder | boolean\n ) => {\n event.stopPropagation()\n const order = (\n column.order === givenOrder ? null : givenOrder || toggleOrder(column)\n ) as TableSortOrder | null\n const target = (event.target as HTMLElement)?.closest('th')\n\n if (target) {\n if (hasClass(target, 'noclick')) {\n removeClass(target, 'noclick')\n return\n }\n }\n\n if (!column.sortable) return\n\n const clickTarget = event.currentTarget\n\n if (\n ['ascending', 'descending'].some(\n (str) =>\n hasClass(clickTarget as Element, str) &&\n !column.sortOrders.includes(str as TableSortOrder)\n )\n ) {\n return\n }\n\n const states = props.store.states\n let sortProp = states.sortProp.value\n let sortOrder\n const sortingColumn = states.sortingColumn.value\n\n if (\n sortingColumn !== column ||\n (sortingColumn === column && isNull(sortingColumn.order))\n ) {\n if (sortingColumn) {\n sortingColumn.order = null\n }\n states.sortingColumn.value = column\n sortProp = column.property ?? null\n }\n if (!order) {\n sortOrder = column.order = null\n } else {\n sortOrder = column.order = order\n }\n\n states.sortProp.value = sortProp\n states.sortOrder.value = sortOrder\n\n parent?.store.commit('changeSortCondition')\n }\n\n return {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n }\n}\n\nexport default useEvent\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAS,SACP,OACA,MACA;CACA,MAAM,YAA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kB,WAAA,GAAA,eAAA,QAAiB,cAAc,MAAM,EACxD;GACA,IAAI,eACF,cAAc,QAAQ;GAExB,OAAO,cAAc,QAAQ;GAC7B,WAAW,OAAO,YAAY;;EAEhC,IAAI,CAAC,OACH,YAAY,OAAO,QAAQ;OAE3B,YAAY,OAAO,QAAQ;EAG7B,OAAO,SAAS,QAAQ;EACxB,OAAO,UAAU,QAAQ;EAEzB,QAAQ,MAAM,OAAO,sBAAsB;;CAG7C,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -3,9 +3,9 @@ import { CheckboxProps, CheckboxValueType } from "../../../checkbox/src/checkbox
|
|
|
3
3
|
import _default$1 from "../../../checkbox/src/checkbox-button.vue.js";
|
|
4
4
|
import _default$2 from "../../../checkbox/src/checkbox-group.vue.js";
|
|
5
5
|
import { TableColumnCtx } from "../table-column/defaults.js";
|
|
6
|
+
import { Store } from "../store/index.js";
|
|
6
7
|
import TableLayout from "../table-layout.js";
|
|
7
8
|
import { DefaultRow, Sort, TableSortOrder } from "../table/defaults.js";
|
|
8
|
-
import { Store } from "../store/index.js";
|
|
9
9
|
import * as _$vue from "vue";
|
|
10
10
|
import { ComponentInternalInstance, PropType, Ref } from "vue";
|
|
11
11
|
|
|
@@ -75,8 +75,8 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
75
75
|
getHeaderRowStyle: (rowIndex: number) => any;
|
|
76
76
|
getHeaderCellClass: (rowIndex: number, columnIndex: number, row: any, column: TableColumnCtx<any>) => string;
|
|
77
77
|
getHeaderCellStyle: (rowIndex: number, columnIndex: number, row: any, column: TableColumnCtx<any>) => _$vue.CSSProperties;
|
|
78
|
-
handleHeaderClick: (event:
|
|
79
|
-
handleHeaderContextMenu: (event:
|
|
78
|
+
handleHeaderClick: (event: PointerEvent, column: TableColumnCtx<any>) => void;
|
|
79
|
+
handleHeaderContextMenu: (event: PointerEvent, column: TableColumnCtx<any>) => void;
|
|
80
80
|
handleMouseDown: (event: MouseEvent, column: TableColumnCtx<any>) => void;
|
|
81
81
|
handleMouseMove: (event: MouseEvent, column: TableColumnCtx<any>) => void;
|
|
82
82
|
handleMouseOut: () => void;
|
|
@@ -119,19 +119,19 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
119
119
|
}, {}, {
|
|
120
120
|
ElCheckbox: {
|
|
121
121
|
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<CheckboxProps> & Readonly<{
|
|
122
|
-
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
123
122
|
"onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
|
|
123
|
+
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
124
124
|
}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
125
|
-
change: (val: CheckboxValueType) => void;
|
|
126
125
|
"update:modelValue": (val: CheckboxValueType) => void;
|
|
126
|
+
change: (val: CheckboxValueType) => void;
|
|
127
127
|
}, _$vue.PublicProps, {
|
|
128
|
-
name: string;
|
|
129
|
-
label: string | boolean | number | object;
|
|
130
|
-
value: string | boolean | number | object;
|
|
131
128
|
id: string;
|
|
132
129
|
disabled: boolean;
|
|
133
130
|
modelValue: number | string | boolean;
|
|
134
131
|
validateEvent: boolean;
|
|
132
|
+
name: string;
|
|
133
|
+
value: string | boolean | number | object;
|
|
134
|
+
label: string | boolean | number | object;
|
|
135
135
|
trueValue: string | number;
|
|
136
136
|
falseValue: string | number;
|
|
137
137
|
trueLabel: string | number;
|
|
@@ -144,16 +144,16 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
144
144
|
M: {};
|
|
145
145
|
Defaults: {};
|
|
146
146
|
}, Readonly<CheckboxProps> & Readonly<{
|
|
147
|
-
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
148
147
|
"onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
|
|
148
|
+
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
149
149
|
}>, {}, {}, {}, {}, {
|
|
150
|
-
name: string;
|
|
151
|
-
label: string | boolean | number | object;
|
|
152
|
-
value: string | boolean | number | object;
|
|
153
150
|
id: string;
|
|
154
151
|
disabled: boolean;
|
|
155
152
|
modelValue: number | string | boolean;
|
|
156
153
|
validateEvent: boolean;
|
|
154
|
+
name: string;
|
|
155
|
+
value: string | boolean | number | object;
|
|
156
|
+
label: string | boolean | number | object;
|
|
157
157
|
trueValue: string | number;
|
|
158
158
|
falseValue: string | number;
|
|
159
159
|
trueLabel: string | number;
|
|
@@ -163,19 +163,19 @@ declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
163
163
|
__isTeleport?: never;
|
|
164
164
|
__isSuspense?: never;
|
|
165
165
|
} & _$vue.ComponentOptionsBase<Readonly<CheckboxProps> & Readonly<{
|
|
166
|
-
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
167
166
|
"onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
|
|
167
|
+
onChange?: ((val: CheckboxValueType) => any) | undefined;
|
|
168
168
|
}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
|
|
169
|
-
change: (val: CheckboxValueType) => void;
|
|
170
169
|
"update:modelValue": (val: CheckboxValueType) => void;
|
|
170
|
+
change: (val: CheckboxValueType) => void;
|
|
171
171
|
}, string, {
|
|
172
|
-
name: string;
|
|
173
|
-
label: string | boolean | number | object;
|
|
174
|
-
value: string | boolean | number | object;
|
|
175
172
|
id: string;
|
|
176
173
|
disabled: boolean;
|
|
177
174
|
modelValue: number | string | boolean;
|
|
178
175
|
validateEvent: boolean;
|
|
176
|
+
name: string;
|
|
177
|
+
value: string | boolean | number | object;
|
|
178
|
+
label: string | boolean | number | object;
|
|
179
179
|
trueValue: string | number;
|
|
180
180
|
falseValue: string | number;
|
|
181
181
|
trueLabel: string | number;
|