element-ps 2.0.39 → 2.0.41
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 +325 -442
- package/dist/index.full.min.js +8 -8
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +325 -442
- package/es/components/autocomplete/index.d.ts +5 -5
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
- package/es/components/autocomplete/src/autocomplete2.mjs +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +29 -61
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +61 -29
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/backtop/index.mjs +2 -2
- package/es/components/backtop/src/backtop.mjs +59 -18
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +18 -59
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel-item.mjs +7 -148
- package/es/components/carousel/src/carousel-item.mjs.map +1 -1
- package/es/components/carousel/src/carousel-item2.mjs +148 -7
- package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
- package/es/components/cascader/src/index.mjs +2 -2
- package/es/components/check-tag/index.mjs +2 -2
- package/es/components/check-tag/src/check-tag.mjs +20 -7
- package/es/components/check-tag/src/check-tag.mjs.map +1 -1
- package/es/components/check-tag/src/check-tag2.mjs +7 -20
- package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +61 -14
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +14 -61
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +117 -23
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +23 -117
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/dropdown/index.d.ts +3 -3
- package/es/components/dropdown/src/dropdown.d.ts +1 -1
- package/es/components/dropdown/src/dropdown.mjs +1 -1
- package/es/components/dropdown/src/dropdown.vue.d.ts +3 -3
- package/es/components/empty/index.mjs +2 -2
- package/es/components/empty/src/empty.mjs +56 -11
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty2.mjs +11 -56
- package/es/components/empty/src/empty2.mjs.map +1 -1
- package/es/components/form/index.mjs +2 -2
- package/es/components/form/src/form.mjs +45 -40
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form2.mjs +40 -45
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +35 -8
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +8 -35
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/image-viewer/index.mjs +2 -2
- package/es/components/image-viewer/src/image-viewer.mjs +31 -210
- package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/components/image-viewer/src/image-viewer2.mjs +210 -31
- package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/components/index.mjs +27 -27
- package/es/components/menu/index.d.ts +3 -3
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +35 -4
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +4 -35
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/menu/src/menu.d.ts +4 -4
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +22 -53
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +53 -22
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popover/index.d.ts +6 -6
- package/es/components/popover/src/index.vue.d.ts +3 -3
- package/es/components/popover/src/popover.d.ts +1 -1
- package/es/components/popover/src/popover.mjs +1 -1
- package/es/components/popper/index.mjs +4 -4
- package/es/components/popper/src/arrow.mjs +7 -31
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +31 -7
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/popper/src/trigger.mjs +28 -17
- package/es/components/popper/src/trigger.mjs.map +1 -1
- package/es/components/popper/src/trigger2.mjs +17 -28
- package/es/components/popper/src/trigger2.mjs.map +1 -1
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +57 -230
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +230 -57
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-group.mjs +37 -18
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +18 -37
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/rate/index.mjs +2 -2
- package/es/components/rate/src/rate.mjs +169 -84
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate2.mjs +84 -169
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/result/index.mjs +2 -2
- package/es/components/result/src/result.mjs +28 -73
- package/es/components/result/src/result.mjs.map +1 -1
- package/es/components/result/src/result2.mjs +73 -28
- package/es/components/result/src/result2.mjs.map +1 -1
- package/es/components/select/index.d.ts +5 -5
- package/es/components/select/src/select.mjs +2 -2
- package/es/components/select/src/select.vue.d.ts +5 -5
- package/es/components/select/src/useSelect.d.ts +5 -5
- package/es/components/select-v2/index.d.ts +10 -10
- package/es/components/select-v2/src/defaults.mjs +1 -1
- package/es/components/select-v2/src/option-item.vue.d.ts +1 -1
- package/es/components/select-v2/src/select.vue.d.ts +5 -5
- package/es/components/select-v2/src/useSelect.d.ts +5 -5
- package/es/components/table/index.d.ts +86 -39
- package/es/components/table/src/config.mjs +0 -3
- package/es/components/table/src/config.mjs.map +1 -1
- package/es/components/table/src/filter-panel.mjs +1 -8
- package/es/components/table/src/filter-panel.mjs.map +1 -1
- package/es/components/table/src/filter-panel.vue.d.ts +5 -5
- package/es/components/table/src/store/current.mjs +12 -14
- package/es/components/table/src/store/current.mjs.map +1 -1
- package/es/components/table/src/store/index.mjs +9 -9
- package/es/components/table/src/store/index.mjs.map +1 -1
- package/es/components/table/src/store/watcher.mjs +1 -11
- package/es/components/table/src/store/watcher.mjs.map +1 -1
- package/es/components/table/src/table/defaults.d.ts +4 -8
- package/es/components/table/src/table/defaults.mjs +4 -3
- package/es/components/table/src/table/defaults.mjs.map +1 -1
- package/es/components/table/src/table/style-helper.d.ts +34 -24
- package/es/components/table/src/table/style-helper.mjs +120 -107
- package/es/components/table/src/table/style-helper.mjs.map +1 -1
- package/es/components/table/src/table/utils-helper.d.ts +1 -1
- package/es/components/table/src/table/utils-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/events-helper.d.ts +3 -1
- package/es/components/table/src/table-body/events-helper.mjs +3 -3
- package/es/components/table/src/table-body/events-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/index.mjs +5 -1
- package/es/components/table/src/table-body/index.mjs.map +1 -1
- package/es/components/table/src/table-body/render-helper.mjs +3 -6
- package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
- package/es/components/table/src/table-body/styles-helper.d.ts +1 -1
- package/es/components/table/src/table-body/styles-helper.mjs +3 -3
- package/es/components/table/src/table-body/styles-helper.mjs.map +1 -1
- package/es/components/table/src/table-column/render-helper.mjs +2 -4
- package/es/components/table/src/table-column/render-helper.mjs.map +1 -1
- package/es/components/table/src/table-footer/index.mjs +1 -1
- package/es/components/table/src/table-footer/index.mjs.map +1 -1
- package/es/components/table/src/table-header/event-helper.mjs +9 -5
- package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
- package/es/components/table/src/table-header/index.mjs +2 -1
- package/es/components/table/src/table-header/index.mjs.map +1 -1
- package/es/components/table/src/table-header/style.helper.mjs +2 -2
- package/es/components/table/src/table-header/style.helper.mjs.map +1 -1
- package/es/components/table/src/table-layout.d.ts +6 -1
- package/es/components/table/src/table-layout.mjs +64 -0
- package/es/components/table/src/table-layout.mjs.map +1 -1
- package/es/components/table/src/table.mjs +35 -31
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +86 -39
- package/es/components/table/src/util.d.ts +7 -7
- package/es/components/table/src/util.mjs +52 -68
- package/es/components/table/src/util.mjs.map +1 -1
- package/es/components/table-v2/src/components/header.d.ts +1 -1
- package/es/components/table-v2/src/table-grid.d.ts +1 -1
- package/es/components/table-v2/src/table-v2.d.ts +1 -1
- package/es/components/tabs/index.mjs +1 -1
- package/es/components/tabs/src/tab-bar.mjs +7 -76
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +76 -7
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/components/tag/index.mjs +2 -2
- package/es/components/tag/src/tag.mjs +81 -33
- package/es/components/tag/src/tag.mjs.map +1 -1
- package/es/components/tag/src/tag2.mjs +33 -81
- package/es/components/tag/src/tag2.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +5 -5
- package/es/components/tooltip/index.d.ts +3 -3
- package/es/components/tooltip/index.mjs +2 -2
- package/es/components/tooltip/src/tooltip.d.ts +1 -1
- package/es/components/tooltip/src/tooltip.mjs +53 -64
- package/es/components/tooltip/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.vue.d.ts +3 -3
- package/es/components/tooltip/src/tooltip2.mjs +64 -53
- package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
- package/es/components/tooltip/src/trigger.mjs +2 -2
- package/es/components/tooltip/src/trigger.vue.d.ts +3 -3
- package/es/components/tooltip-v2/index.mjs +3 -3
- package/es/components/tooltip-v2/src/root.mjs +81 -17
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +17 -81
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +73 -20
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +20 -73
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/upload/index.mjs +5 -5
- package/es/components/upload/src/upload-content.mjs +46 -15
- package/es/components/upload/src/upload-content.mjs.map +1 -1
- package/es/components/upload/src/upload-content2.mjs +15 -46
- package/es/components/upload/src/upload-content2.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger.mjs +11 -32
- package/es/components/upload/src/upload-dragger.mjs.map +1 -1
- package/es/components/upload/src/upload-dragger2.mjs +32 -11
- package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
- package/es/components/upload/src/upload-list.mjs +26 -155
- package/es/components/upload/src/upload-list.mjs.map +1 -1
- package/es/components/upload/src/upload-list2.mjs +155 -26
- package/es/components/upload/src/upload-list2.mjs.map +1 -1
- package/es/components/upload/src/upload.mjs +106 -99
- package/es/components/upload/src/upload.mjs.map +1 -1
- package/es/components/upload/src/upload2.mjs +99 -106
- package/es/components/upload/src/upload2.mjs.map +1 -1
- package/es/index.mjs +27 -27
- package/lib/components/autocomplete/index.d.ts +5 -5
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +5 -5
- package/lib/components/autocomplete/src/autocomplete2.js +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +29 -61
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +61 -29
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/backtop/index.js +2 -2
- package/lib/components/backtop/src/backtop.js +59 -18
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +18 -59
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel-item.js +7 -148
- package/lib/components/carousel/src/carousel-item.js.map +1 -1
- package/lib/components/carousel/src/carousel-item2.js +148 -7
- package/lib/components/carousel/src/carousel-item2.js.map +1 -1
- package/lib/components/cascader/src/index.js +2 -2
- package/lib/components/check-tag/index.js +2 -2
- package/lib/components/check-tag/src/check-tag.js +20 -7
- package/lib/components/check-tag/src/check-tag.js.map +1 -1
- package/lib/components/check-tag/src/check-tag2.js +7 -20
- package/lib/components/check-tag/src/check-tag2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +61 -16
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +16 -61
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +117 -23
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +23 -117
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/dropdown/index.d.ts +3 -3
- package/lib/components/dropdown/src/dropdown.d.ts +1 -1
- package/lib/components/dropdown/src/dropdown.js +1 -1
- package/lib/components/dropdown/src/dropdown.vue.d.ts +3 -3
- package/lib/components/empty/index.js +2 -2
- package/lib/components/empty/src/empty.js +56 -11
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty2.js +11 -56
- package/lib/components/empty/src/empty2.js.map +1 -1
- package/lib/components/form/index.js +2 -2
- package/lib/components/form/src/form.js +45 -40
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form2.js +40 -45
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +35 -8
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +8 -35
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/image-viewer/index.js +2 -2
- package/lib/components/image-viewer/src/image-viewer.js +31 -210
- package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/components/image-viewer/src/image-viewer2.js +210 -31
- package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/components/index.js +27 -27
- package/lib/components/menu/index.d.ts +3 -3
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +35 -4
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +4 -35
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/menu/src/menu.d.ts +4 -4
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +22 -53
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +53 -22
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popover/index.d.ts +6 -6
- package/lib/components/popover/src/index.vue.d.ts +3 -3
- package/lib/components/popover/src/popover.d.ts +1 -1
- package/lib/components/popover/src/popover.js +1 -1
- package/lib/components/popper/index.js +4 -4
- package/lib/components/popper/src/arrow.js +7 -31
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +31 -7
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/popper/src/trigger.js +28 -17
- package/lib/components/popper/src/trigger.js.map +1 -1
- package/lib/components/popper/src/trigger2.js +17 -28
- package/lib/components/popper/src/trigger2.js.map +1 -1
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +57 -230
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +230 -57
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-group.js +37 -18
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +18 -37
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/rate/index.js +2 -2
- package/lib/components/rate/src/rate.js +169 -84
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate2.js +84 -169
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/result/index.js +2 -2
- package/lib/components/result/src/result.js +30 -73
- package/lib/components/result/src/result.js.map +1 -1
- package/lib/components/result/src/result2.js +73 -30
- package/lib/components/result/src/result2.js.map +1 -1
- package/lib/components/select/index.d.ts +5 -5
- package/lib/components/select/src/select.js +2 -2
- package/lib/components/select/src/select.vue.d.ts +5 -5
- package/lib/components/select/src/useSelect.d.ts +5 -5
- package/lib/components/select-v2/index.d.ts +10 -10
- package/lib/components/select-v2/src/defaults.js +1 -1
- package/lib/components/select-v2/src/option-item.vue.d.ts +1 -1
- package/lib/components/select-v2/src/select.vue.d.ts +5 -5
- package/lib/components/select-v2/src/useSelect.d.ts +5 -5
- package/lib/components/table/index.d.ts +86 -39
- package/lib/components/table/src/config.js +0 -3
- package/lib/components/table/src/config.js.map +1 -1
- package/lib/components/table/src/filter-panel.js +0 -7
- package/lib/components/table/src/filter-panel.js.map +1 -1
- package/lib/components/table/src/filter-panel.vue.d.ts +5 -5
- package/lib/components/table/src/store/current.js +12 -14
- package/lib/components/table/src/store/current.js.map +1 -1
- package/lib/components/table/src/store/index.js +8 -8
- package/lib/components/table/src/store/index.js.map +1 -1
- package/lib/components/table/src/store/watcher.js +1 -11
- package/lib/components/table/src/store/watcher.js.map +1 -1
- package/lib/components/table/src/table/defaults.d.ts +4 -8
- package/lib/components/table/src/table/defaults.js +4 -3
- package/lib/components/table/src/table/defaults.js.map +1 -1
- package/lib/components/table/src/table/style-helper.d.ts +34 -24
- package/lib/components/table/src/table/style-helper.js +119 -106
- package/lib/components/table/src/table/style-helper.js.map +1 -1
- package/lib/components/table/src/table/utils-helper.d.ts +1 -1
- package/lib/components/table/src/table/utils-helper.js.map +1 -1
- package/lib/components/table/src/table-body/events-helper.d.ts +3 -1
- package/lib/components/table/src/table-body/events-helper.js +3 -3
- package/lib/components/table/src/table-body/events-helper.js.map +1 -1
- package/lib/components/table/src/table-body/index.js +4 -0
- package/lib/components/table/src/table-body/index.js.map +1 -1
- package/lib/components/table/src/table-body/render-helper.js +3 -6
- package/lib/components/table/src/table-body/render-helper.js.map +1 -1
- package/lib/components/table/src/table-body/styles-helper.d.ts +1 -1
- package/lib/components/table/src/table-body/styles-helper.js +3 -3
- package/lib/components/table/src/table-body/styles-helper.js.map +1 -1
- package/lib/components/table/src/table-column/render-helper.js +2 -4
- package/lib/components/table/src/table-column/render-helper.js.map +1 -1
- package/lib/components/table/src/table-footer/index.js +1 -1
- package/lib/components/table/src/table-footer/index.js.map +1 -1
- package/lib/components/table/src/table-header/event-helper.js +9 -5
- package/lib/components/table/src/table-header/event-helper.js.map +1 -1
- package/lib/components/table/src/table-header/index.js +2 -1
- package/lib/components/table/src/table-header/index.js.map +1 -1
- package/lib/components/table/src/table-header/style.helper.js +2 -2
- package/lib/components/table/src/table-header/style.helper.js.map +1 -1
- package/lib/components/table/src/table-layout.d.ts +6 -1
- package/lib/components/table/src/table-layout.js +64 -0
- package/lib/components/table/src/table-layout.js.map +1 -1
- package/lib/components/table/src/table.js +35 -31
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +86 -39
- package/lib/components/table/src/util.d.ts +7 -7
- package/lib/components/table/src/util.js +52 -68
- package/lib/components/table/src/util.js.map +1 -1
- package/lib/components/table-v2/src/components/header.d.ts +1 -1
- package/lib/components/table-v2/src/table-grid.d.ts +1 -1
- package/lib/components/table-v2/src/table-v2.d.ts +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/tabs/src/tab-bar.js +7 -76
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +76 -7
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/src/tag.js +81 -34
- package/lib/components/tag/src/tag.js.map +1 -1
- package/lib/components/tag/src/tag2.js +34 -81
- package/lib/components/tag/src/tag2.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +5 -5
- package/lib/components/tooltip/index.d.ts +3 -3
- package/lib/components/tooltip/index.js +2 -2
- package/lib/components/tooltip/src/tooltip.d.ts +1 -1
- package/lib/components/tooltip/src/tooltip.js +50 -63
- package/lib/components/tooltip/src/tooltip.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.vue.d.ts +3 -3
- package/lib/components/tooltip/src/tooltip2.js +63 -50
- package/lib/components/tooltip/src/tooltip2.js.map +1 -1
- package/lib/components/tooltip/src/trigger.js +2 -2
- package/lib/components/tooltip/src/trigger.vue.d.ts +3 -3
- package/lib/components/tooltip-v2/index.js +3 -3
- package/lib/components/tooltip-v2/src/root.js +81 -17
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +17 -81
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +73 -20
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +20 -73
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/upload/index.js +5 -5
- package/lib/components/upload/src/upload-content.js +46 -15
- package/lib/components/upload/src/upload-content.js.map +1 -1
- package/lib/components/upload/src/upload-content2.js +15 -46
- package/lib/components/upload/src/upload-content2.js.map +1 -1
- package/lib/components/upload/src/upload-dragger.js +12 -32
- package/lib/components/upload/src/upload-dragger.js.map +1 -1
- package/lib/components/upload/src/upload-dragger2.js +32 -12
- package/lib/components/upload/src/upload-dragger2.js.map +1 -1
- package/lib/components/upload/src/upload-list.js +27 -155
- package/lib/components/upload/src/upload-list.js.map +1 -1
- package/lib/components/upload/src/upload-list2.js +155 -27
- package/lib/components/upload/src/upload-list2.js.map +1 -1
- package/lib/components/upload/src/upload.js +109 -99
- package/lib/components/upload/src/upload.js.map +1 -1
- package/lib/components/upload/src/upload2.js +99 -109
- package/lib/components/upload/src/upload2.js.map +1 -1
- package/lib/index.js +27 -27
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
-
|
|
6
|
+
require('../../../../utils/index.js');
|
|
7
7
|
require('../../../../hooks/index.js');
|
|
8
|
+
var util = require('../util.js');
|
|
9
|
+
var resizeEvent = require('../../../../utils/dom/resize-event.js');
|
|
10
|
+
var event = require('../../../../utils/dom/event.js');
|
|
8
11
|
var index = require('../../../../hooks/use-common-props/index.js');
|
|
12
|
+
var shared = require('@vue/shared');
|
|
13
|
+
var core = require('@vueuse/core');
|
|
9
14
|
|
|
10
15
|
function useStyle(props, layout, store, table) {
|
|
11
16
|
const isHidden = vue.ref(false);
|
|
@@ -16,8 +21,7 @@ function useStyle(props, layout, store, table) {
|
|
|
16
21
|
};
|
|
17
22
|
const resizeState = vue.ref({
|
|
18
23
|
width: null,
|
|
19
|
-
height: null
|
|
20
|
-
headerHeight: null
|
|
24
|
+
height: null
|
|
21
25
|
});
|
|
22
26
|
const isGroup = vue.ref(false);
|
|
23
27
|
const scrollbarViewStyle = {
|
|
@@ -25,28 +29,6 @@ function useStyle(props, layout, store, table) {
|
|
|
25
29
|
verticalAlign: "middle"
|
|
26
30
|
};
|
|
27
31
|
const tableWidth = vue.ref();
|
|
28
|
-
const tableScrollHeight = vue.ref(0);
|
|
29
|
-
const bodyScrollHeight = vue.ref(0);
|
|
30
|
-
const headerScrollHeight = vue.ref(0);
|
|
31
|
-
const footerScrollHeight = vue.ref(0);
|
|
32
|
-
vue.watchEffect(() => {
|
|
33
|
-
layout.setHeight(props.height);
|
|
34
|
-
});
|
|
35
|
-
vue.watchEffect(() => {
|
|
36
|
-
layout.setMaxHeight(props.maxHeight);
|
|
37
|
-
});
|
|
38
|
-
vue.watch(() => [props.currentRowKey, store.states.rowKey], ([currentRowKey, rowKey]) => {
|
|
39
|
-
if (!vue.unref(rowKey) || !vue.unref(currentRowKey))
|
|
40
|
-
return;
|
|
41
|
-
store.setCurrentRowKey(`${currentRowKey}`);
|
|
42
|
-
}, {
|
|
43
|
-
immediate: true
|
|
44
|
-
});
|
|
45
|
-
vue.watchEffect(() => {
|
|
46
|
-
if (props.expandRowKeys) {
|
|
47
|
-
store.setExpandRowKeysAdapter(props.expandRowKeys);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
32
|
const handleMouseLeave = () => {
|
|
51
33
|
table.store.commit("setHoverRow", null);
|
|
52
34
|
if (table.hoverState)
|
|
@@ -71,22 +53,16 @@ function useStyle(props, layout, store, table) {
|
|
|
71
53
|
layout.updateElsHeight();
|
|
72
54
|
}
|
|
73
55
|
layout.updateColumnsWidth();
|
|
74
|
-
requestAnimationFrame(
|
|
56
|
+
requestAnimationFrame(syncPostion);
|
|
75
57
|
};
|
|
76
58
|
vue.onMounted(async () => {
|
|
77
59
|
await vue.nextTick();
|
|
78
60
|
store.updateColumns();
|
|
79
61
|
bindEvents();
|
|
80
62
|
requestAnimationFrame(doLayout);
|
|
81
|
-
const el = table.vnode.el;
|
|
82
|
-
const tableHeader = table.refs.headerWrapper;
|
|
83
|
-
if (props.flexible && el && el.parentElement) {
|
|
84
|
-
el.parentElement.style.minWidth = "0";
|
|
85
|
-
}
|
|
86
63
|
resizeState.value = {
|
|
87
|
-
width: tableWidth.value = el.offsetWidth,
|
|
88
|
-
height: el.offsetHeight
|
|
89
|
-
headerHeight: props.showHeader && tableHeader ? tableHeader.offsetHeight : null
|
|
64
|
+
width: tableWidth.value = table.vnode.el.offsetWidth,
|
|
65
|
+
height: table.vnode.el.offsetHeight
|
|
90
66
|
};
|
|
91
67
|
store.states.columns.value.forEach((column) => {
|
|
92
68
|
if (column.filteredValue && column.filteredValue.length) {
|
|
@@ -114,7 +90,7 @@ function useStyle(props, layout, store, table) {
|
|
|
114
90
|
const { tableWrapper } = table.refs;
|
|
115
91
|
return !!(tableWrapper && tableWrapper.classList.contains(className));
|
|
116
92
|
};
|
|
117
|
-
const
|
|
93
|
+
const syncPostion = function() {
|
|
118
94
|
if (!table.refs.scrollBarRef)
|
|
119
95
|
return;
|
|
120
96
|
if (!layout.scrollX.value) {
|
|
@@ -124,7 +100,7 @@ function useStyle(props, layout, store, table) {
|
|
|
124
100
|
}
|
|
125
101
|
return;
|
|
126
102
|
}
|
|
127
|
-
const scrollContainer = table.refs.scrollBarRef.
|
|
103
|
+
const scrollContainer = table.refs.scrollBarRef.wrap$;
|
|
128
104
|
if (!scrollContainer)
|
|
129
105
|
return;
|
|
130
106
|
const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer;
|
|
@@ -143,56 +119,48 @@ function useStyle(props, layout, store, table) {
|
|
|
143
119
|
}
|
|
144
120
|
};
|
|
145
121
|
const bindEvents = () => {
|
|
122
|
+
var _a;
|
|
146
123
|
if (!table.refs.scrollBarRef)
|
|
147
124
|
return;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
125
|
+
(_a = table.refs.scrollBarRef.wrap$) == null ? void 0 : _a.addEventListener("scroll", syncPostion, {
|
|
126
|
+
passive: true
|
|
127
|
+
});
|
|
128
|
+
if (props.fit) {
|
|
129
|
+
resizeEvent.addResizeListener(table.vnode.el, resizeListener);
|
|
130
|
+
} else {
|
|
131
|
+
event.on(window, "resize", doLayout);
|
|
152
132
|
}
|
|
133
|
+
};
|
|
134
|
+
vue.onBeforeUnmount(() => {
|
|
135
|
+
unbindEvents();
|
|
136
|
+
});
|
|
137
|
+
const unbindEvents = () => {
|
|
138
|
+
var _a;
|
|
139
|
+
(_a = table.refs.scrollBarRef.wrap$) == null ? void 0 : _a.removeEventListener("scroll", syncPostion, true);
|
|
153
140
|
if (props.fit) {
|
|
154
|
-
|
|
141
|
+
resizeEvent.removeResizeListener(table.vnode.el, resizeListener);
|
|
155
142
|
} else {
|
|
156
|
-
|
|
143
|
+
event.off(window, "resize", doLayout);
|
|
157
144
|
}
|
|
158
|
-
core.useResizeObserver(table.refs.bodyWrapper, () => {
|
|
159
|
-
var _a, _b;
|
|
160
|
-
resizeListener();
|
|
161
|
-
(_b = (_a = table.refs) == null ? void 0 : _a.scrollBarRef) == null ? void 0 : _b.update();
|
|
162
|
-
});
|
|
163
145
|
};
|
|
164
146
|
const resizeListener = () => {
|
|
165
|
-
|
|
166
|
-
const el = table.vnode.el;
|
|
167
|
-
if (!table.$ready || !el)
|
|
147
|
+
if (!table.$ready)
|
|
168
148
|
return;
|
|
169
149
|
let shouldUpdateLayout = false;
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
height: oldHeight,
|
|
173
|
-
headerHeight: oldHeaderHeight
|
|
174
|
-
} = resizeState.value;
|
|
150
|
+
const el = table.vnode.el;
|
|
151
|
+
const { width: oldWidth, height: oldHeight } = resizeState.value;
|
|
175
152
|
const width = tableWidth.value = el.offsetWidth;
|
|
176
153
|
if (oldWidth !== width) {
|
|
177
154
|
shouldUpdateLayout = true;
|
|
178
155
|
}
|
|
179
|
-
const
|
|
180
|
-
if ((props.height || shouldUpdateHeight.value) && oldHeight !==
|
|
181
|
-
shouldUpdateLayout = true;
|
|
182
|
-
}
|
|
183
|
-
const tableHeader = props.tableLayout === "fixed" ? table.refs.headerWrapper : (_a = table.refs.tableHeaderRef) == null ? void 0 : _a.$el;
|
|
184
|
-
if (props.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) !== oldHeaderHeight) {
|
|
156
|
+
const height2 = el.offsetHeight;
|
|
157
|
+
if ((props.height || shouldUpdateHeight.value) && oldHeight !== height2) {
|
|
185
158
|
shouldUpdateLayout = true;
|
|
186
159
|
}
|
|
187
|
-
tableScrollHeight.value = ((_b = table.refs.tableWrapper) == null ? void 0 : _b.scrollHeight) || 0;
|
|
188
|
-
headerScrollHeight.value = (tableHeader == null ? void 0 : tableHeader.scrollHeight) || 0;
|
|
189
|
-
footerScrollHeight.value = ((_c = table.refs.footerWrapper) == null ? void 0 : _c.offsetHeight) || 0;
|
|
190
|
-
bodyScrollHeight.value = tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value;
|
|
191
160
|
if (shouldUpdateLayout) {
|
|
192
161
|
resizeState.value = {
|
|
193
162
|
width,
|
|
194
|
-
height
|
|
195
|
-
headerHeight: props.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) || 0
|
|
163
|
+
height: height2
|
|
196
164
|
};
|
|
197
165
|
doLayout();
|
|
198
166
|
}
|
|
@@ -207,55 +175,57 @@ function useStyle(props, layout, store, table) {
|
|
|
207
175
|
return "fixed";
|
|
208
176
|
return props.tableLayout;
|
|
209
177
|
});
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
178
|
+
function calcMaxHeight(maxHeight, footerHeight, headerHeight) {
|
|
179
|
+
const parsedMaxHeight = util.parseHeight(maxHeight);
|
|
180
|
+
const tableHeaderHeight = props.showHeader ? headerHeight : 0;
|
|
181
|
+
if (parsedMaxHeight === null)
|
|
182
|
+
return;
|
|
183
|
+
if (shared.isString(parsedMaxHeight)) {
|
|
184
|
+
return `calc(${parsedMaxHeight} - ${footerHeight}px - ${tableHeaderHeight}px)`;
|
|
216
185
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const tableInnerStyle = vue.computed(() => {
|
|
186
|
+
return parsedMaxHeight - footerHeight - tableHeaderHeight;
|
|
187
|
+
}
|
|
188
|
+
const height = vue.computed(() => {
|
|
189
|
+
const headerHeight = layout.headerHeight.value || 0;
|
|
190
|
+
const bodyHeight2 = layout.bodyHeight.value;
|
|
191
|
+
const footerHeight = layout.footerHeight.value || 0;
|
|
224
192
|
if (props.height) {
|
|
225
|
-
return
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
if (props.maxHeight) {
|
|
230
|
-
return {
|
|
231
|
-
maxHeight: !Number.isNaN(Number(props.maxHeight)) ? `${props.maxHeight}px` : props.maxHeight
|
|
232
|
-
};
|
|
193
|
+
return bodyHeight2 ? bodyHeight2 : void 0;
|
|
194
|
+
} else if (props.maxHeight) {
|
|
195
|
+
return calcMaxHeight(props.maxHeight, footerHeight, headerHeight);
|
|
233
196
|
}
|
|
234
|
-
return
|
|
197
|
+
return void 0;
|
|
235
198
|
});
|
|
236
|
-
const
|
|
199
|
+
const bodyHeight = vue.computed(() => {
|
|
200
|
+
const headerHeight = layout.headerHeight.value || 0;
|
|
201
|
+
const bodyHeight2 = layout.bodyHeight.value;
|
|
202
|
+
const footerHeight = layout.footerHeight.value || 0;
|
|
237
203
|
if (props.height) {
|
|
238
204
|
return {
|
|
239
|
-
height: "
|
|
205
|
+
height: bodyHeight2 ? `${bodyHeight2}px` : ""
|
|
240
206
|
};
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
if (
|
|
244
|
-
const maxHeight = props.maxHeight;
|
|
245
|
-
const reachMaxHeight = tableScrollHeight.value >= Number(maxHeight);
|
|
246
|
-
if (reachMaxHeight) {
|
|
247
|
-
return {
|
|
248
|
-
maxHeight: `${tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value}px`
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
207
|
+
} else if (props.maxHeight) {
|
|
208
|
+
const maxHeight = calcMaxHeight(props.maxHeight, footerHeight, headerHeight);
|
|
209
|
+
if (maxHeight !== null) {
|
|
252
210
|
return {
|
|
253
|
-
|
|
211
|
+
"max-height": `${maxHeight}${core.isNumber(maxHeight) ? "px" : ""}`
|
|
254
212
|
};
|
|
255
213
|
}
|
|
256
214
|
}
|
|
257
215
|
return {};
|
|
258
216
|
});
|
|
217
|
+
const emptyBlockStyle = vue.computed(() => {
|
|
218
|
+
if (props.data && props.data.length)
|
|
219
|
+
return null;
|
|
220
|
+
let height2 = "100%";
|
|
221
|
+
if (layout.appendHeight.value) {
|
|
222
|
+
height2 = `calc(100% - ${layout.appendHeight.value}px)`;
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
width: tableWidth.value ? `${tableWidth.value}px` : "",
|
|
226
|
+
height: height2
|
|
227
|
+
};
|
|
228
|
+
});
|
|
259
229
|
const handleFixedMousewheel = (event, data) => {
|
|
260
230
|
const bodyWrapper = table.refs.bodyWrapper;
|
|
261
231
|
if (Math.abs(data.spinY) > 0) {
|
|
@@ -271,6 +241,47 @@ function useStyle(props, layout, store, table) {
|
|
|
271
241
|
bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
|
|
272
242
|
}
|
|
273
243
|
};
|
|
244
|
+
const fixedHeight = vue.computed(() => {
|
|
245
|
+
if (props.maxHeight) {
|
|
246
|
+
if (props.showSummary) {
|
|
247
|
+
return {
|
|
248
|
+
bottom: 0
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
bottom: layout.scrollX.value && props.data.length ? `${layout.gutterWidth}px` : ""
|
|
253
|
+
};
|
|
254
|
+
} else {
|
|
255
|
+
if (props.showSummary) {
|
|
256
|
+
return {
|
|
257
|
+
height: layout.tableHeight.value ? `${layout.tableHeight.value}px` : ""
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
height: layout.viewportHeight.value ? `${layout.viewportHeight.value}px` : ""
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
const fixedBodyHeight = vue.computed(() => {
|
|
266
|
+
if (props.height) {
|
|
267
|
+
return {
|
|
268
|
+
height: layout.fixedBodyHeight.value ? `${layout.fixedBodyHeight.value}px` : ""
|
|
269
|
+
};
|
|
270
|
+
} else if (props.maxHeight) {
|
|
271
|
+
let maxHeight = util.parseHeight(props.maxHeight);
|
|
272
|
+
if (typeof maxHeight === "number") {
|
|
273
|
+
maxHeight = layout.scrollX.value ? maxHeight - layout.gutterWidth : maxHeight;
|
|
274
|
+
if (props.showHeader) {
|
|
275
|
+
maxHeight -= layout.headerHeight.value;
|
|
276
|
+
}
|
|
277
|
+
maxHeight -= layout.footerHeight.value;
|
|
278
|
+
return {
|
|
279
|
+
"max-height": `${maxHeight}px`
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return {};
|
|
284
|
+
});
|
|
274
285
|
return {
|
|
275
286
|
isHidden,
|
|
276
287
|
renderExpanded,
|
|
@@ -279,17 +290,19 @@ function useStyle(props, layout, store, table) {
|
|
|
279
290
|
handleMouseLeave,
|
|
280
291
|
handleHeaderFooterMousewheel,
|
|
281
292
|
tableSize,
|
|
293
|
+
bodyHeight,
|
|
294
|
+
height,
|
|
282
295
|
emptyBlockStyle,
|
|
283
296
|
handleFixedMousewheel,
|
|
297
|
+
fixedHeight,
|
|
298
|
+
fixedBodyHeight,
|
|
284
299
|
resizeProxyVisible,
|
|
285
300
|
bodyWidth,
|
|
286
301
|
resizeState,
|
|
287
302
|
doLayout,
|
|
288
303
|
tableBodyStyles,
|
|
289
304
|
tableLayout,
|
|
290
|
-
scrollbarViewStyle
|
|
291
|
-
tableInnerStyle,
|
|
292
|
-
scrollbarStyle
|
|
305
|
+
scrollbarViewStyle
|
|
293
306
|
};
|
|
294
307
|
}
|
|
295
308
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-helper.js","sources":["../../../../../../../packages/components/table/src/table/style-helper.ts"],"sourcesContent":["import {\n computed,\n nextTick,\n onMounted,\n ref,\n unref,\n watch,\n watchEffect,\n} from 'vue'\nimport { useEventListener, useResizeObserver } from '@vueuse/core'\nimport { useSize } from '@element-ps/hooks'\n\nimport type { Table, TableProps } from './defaults'\nimport type { Store } from '../store'\nimport type TableLayout from '../table-layout'\nimport type { TableColumnCtx } from '../table-column/defaults'\n\nfunction useStyle<T>(\n props: TableProps<T>,\n layout: TableLayout<T>,\n store: Store<T>,\n table: Table<T>\n) {\n const isHidden = ref(false)\n const renderExpanded = ref(null)\n const resizeProxyVisible = ref(false)\n const setDragVisible = (visible: boolean) => {\n resizeProxyVisible.value = visible\n }\n const resizeState = ref<{\n width: null | number\n height: null | number\n headerHeight: null | number\n }>({\n width: null,\n height: null,\n headerHeight: null,\n })\n const isGroup = ref(false)\n const scrollbarViewStyle = {\n display: 'inline-block',\n verticalAlign: 'middle',\n }\n const tableWidth = ref()\n const tableScrollHeight = ref(0)\n const bodyScrollHeight = ref(0)\n const headerScrollHeight = ref(0)\n const footerScrollHeight = ref(0)\n\n watchEffect(() => {\n layout.setHeight(props.height)\n })\n watchEffect(() => {\n layout.setMaxHeight(props.maxHeight)\n })\n watch(\n () => [props.currentRowKey, store.states.rowKey],\n ([currentRowKey, rowKey]) => {\n if (!unref(rowKey) || !unref(currentRowKey)) return\n store.setCurrentRowKey(`${currentRowKey}`)\n },\n {\n immediate: true,\n }\n )\n watchEffect(() => {\n if (props.expandRowKeys) {\n store.setExpandRowKeysAdapter(props.expandRowKeys)\n }\n })\n\n const handleMouseLeave = () => {\n table.store.commit('setHoverRow', null)\n if (table.hoverState) table.hoverState = null\n }\n\n const handleHeaderFooterMousewheel = (event, data) => {\n const { pixelX, pixelY } = data\n if (Math.abs(pixelX) >= Math.abs(pixelY)) {\n table.refs.bodyWrapper.scrollLeft += data.pixelX / 5\n }\n }\n\n const shouldUpdateHeight = computed(() => {\n return (\n props.height ||\n props.maxHeight ||\n store.states.fixedColumns.value.length > 0 ||\n store.states.rightFixedColumns.value.length > 0\n )\n })\n\n const tableBodyStyles = computed(() => {\n return {\n width: layout.bodyWidth.value ? `${layout.bodyWidth.value}px` : '',\n }\n })\n\n const doLayout = () => {\n if (shouldUpdateHeight.value) {\n layout.updateElsHeight()\n }\n layout.updateColumnsWidth()\n requestAnimationFrame(syncPosition)\n }\n onMounted(async () => {\n await nextTick()\n store.updateColumns()\n bindEvents()\n requestAnimationFrame(doLayout)\n\n const el: HTMLElement = table.vnode.el as HTMLElement\n const tableHeader: HTMLElement = table.refs.headerWrapper\n if (props.flexible && el && el.parentElement) {\n // Automatic minimum size of flex-items\n // Ensure that the main axis does not follow the width of the items\n el.parentElement.style.minWidth = '0'\n }\n\n resizeState.value = {\n width: (tableWidth.value = el.offsetWidth),\n height: el.offsetHeight,\n headerHeight:\n props.showHeader && tableHeader ? tableHeader.offsetHeight : null,\n }\n\n // init filters\n store.states.columns.value.forEach((column: TableColumnCtx<T>) => {\n if (column.filteredValue && column.filteredValue.length) {\n table.store.commit('filterChange', {\n column,\n values: column.filteredValue,\n silent: true,\n })\n }\n })\n table.$ready = true\n })\n const setScrollClassByEl = (el: HTMLElement, className: string) => {\n if (!el) return\n const classList = Array.from(el.classList).filter(\n (item) => !item.startsWith('is-scrolling-')\n )\n classList.push(layout.scrollX.value ? className : 'is-scrolling-none')\n el.className = classList.join(' ')\n }\n const setScrollClass = (className: string) => {\n const { tableWrapper } = table.refs\n setScrollClassByEl(tableWrapper, className)\n }\n const hasScrollClass = (className: string) => {\n const { tableWrapper } = table.refs\n return !!(tableWrapper && tableWrapper.classList.contains(className))\n }\n const syncPosition = function () {\n if (!table.refs.scrollBarRef) return\n if (!layout.scrollX.value) {\n const scrollingNoneClass = 'is-scrolling-none'\n if (!hasScrollClass(scrollingNoneClass)) {\n setScrollClass(scrollingNoneClass)\n }\n return\n }\n const scrollContainer = table.refs.scrollBarRef.wrapRef\n if (!scrollContainer) return\n const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer\n const { headerWrapper, footerWrapper } = table.refs\n if (headerWrapper) headerWrapper.scrollLeft = scrollLeft\n if (footerWrapper) footerWrapper.scrollLeft = scrollLeft\n const maxScrollLeftPosition = scrollWidth - offsetWidth - 1\n if (scrollLeft >= maxScrollLeftPosition) {\n setScrollClass('is-scrolling-right')\n } else if (scrollLeft === 0) {\n setScrollClass('is-scrolling-left')\n } else {\n setScrollClass('is-scrolling-middle')\n }\n }\n\n const bindEvents = () => {\n if (!table.refs.scrollBarRef) return\n if (table.refs.scrollBarRef.wrapRef) {\n useEventListener(\n table.refs.scrollBarRef.wrapRef,\n 'scroll',\n syncPosition,\n {\n passive: true,\n }\n )\n }\n if (props.fit) {\n useResizeObserver(table.vnode.el as HTMLElement, resizeListener)\n } else {\n useEventListener(window, 'resize', resizeListener)\n }\n\n useResizeObserver(table.refs.bodyWrapper, () => {\n resizeListener()\n table.refs?.scrollBarRef?.update()\n })\n }\n const resizeListener = () => {\n const el = table.vnode.el\n if (!table.$ready || !el) return\n\n let shouldUpdateLayout = false\n const {\n width: oldWidth,\n height: oldHeight,\n headerHeight: oldHeaderHeight,\n } = resizeState.value\n\n const width = (tableWidth.value = el.offsetWidth)\n if (oldWidth !== width) {\n shouldUpdateLayout = true\n }\n\n const height = el.offsetHeight\n if ((props.height || shouldUpdateHeight.value) && oldHeight !== height) {\n shouldUpdateLayout = true\n }\n\n const tableHeader: HTMLElement =\n props.tableLayout === 'fixed'\n ? table.refs.headerWrapper\n : table.refs.tableHeaderRef?.$el\n if (props.showHeader && tableHeader?.offsetHeight !== oldHeaderHeight) {\n shouldUpdateLayout = true\n }\n\n tableScrollHeight.value = table.refs.tableWrapper?.scrollHeight || 0\n headerScrollHeight.value = tableHeader?.scrollHeight || 0\n footerScrollHeight.value = table.refs.footerWrapper?.offsetHeight || 0\n bodyScrollHeight.value =\n tableScrollHeight.value -\n headerScrollHeight.value -\n footerScrollHeight.value\n\n if (shouldUpdateLayout) {\n resizeState.value = {\n width,\n height,\n headerHeight: (props.showHeader && tableHeader?.offsetHeight) || 0,\n }\n doLayout()\n }\n }\n const tableSize = useSize()\n const bodyWidth = computed(() => {\n const { bodyWidth: bodyWidth_, scrollY, gutterWidth } = layout\n return bodyWidth_.value\n ? `${(bodyWidth_.value as number) - (scrollY.value ? gutterWidth : 0)}px`\n : ''\n })\n\n const tableLayout = computed(() => {\n if (props.maxHeight) return 'fixed'\n return props.tableLayout\n })\n\n const emptyBlockStyle = computed(() => {\n if (props.data && props.data.length) return null\n let height = '100%'\n if (props.height && bodyScrollHeight.value) {\n height = `${bodyScrollHeight.value}px`\n }\n const width = tableWidth.value\n return {\n width: width ? `${width}px` : '',\n height,\n }\n })\n\n const tableInnerStyle = computed(() => {\n if (props.height) {\n return {\n height: !Number.isNaN(Number(props.height))\n ? `${props.height}px`\n : props.height,\n }\n }\n if (props.maxHeight) {\n return {\n maxHeight: !Number.isNaN(Number(props.maxHeight))\n ? `${props.maxHeight}px`\n : props.maxHeight,\n }\n }\n return {}\n })\n\n const scrollbarStyle = computed(() => {\n if (props.height) {\n return {\n height: '100%',\n }\n }\n if (props.maxHeight) {\n if (!Number.isNaN(Number(props.maxHeight))) {\n const maxHeight = props.maxHeight\n const reachMaxHeight = tableScrollHeight.value >= Number(maxHeight)\n if (reachMaxHeight) {\n return {\n maxHeight: `${\n tableScrollHeight.value -\n headerScrollHeight.value -\n footerScrollHeight.value\n }px`,\n }\n }\n } else {\n return {\n maxHeight: `calc(${props.maxHeight} - ${\n headerScrollHeight.value + footerScrollHeight.value\n }px)`,\n }\n }\n }\n\n return {}\n })\n\n /**\n * fix layout\n */\n const handleFixedMousewheel = (event, data) => {\n const bodyWrapper = table.refs.bodyWrapper\n if (Math.abs(data.spinY) > 0) {\n const currentScrollTop = bodyWrapper.scrollTop\n if (data.pixelY < 0 && currentScrollTop !== 0) {\n event.preventDefault()\n }\n if (\n data.pixelY > 0 &&\n bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop\n ) {\n event.preventDefault()\n }\n bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5)\n } else {\n bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5)\n }\n }\n\n return {\n isHidden,\n renderExpanded,\n setDragVisible,\n isGroup,\n handleMouseLeave,\n handleHeaderFooterMousewheel,\n tableSize,\n emptyBlockStyle,\n handleFixedMousewheel,\n resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n tableBodyStyles,\n tableLayout,\n scrollbarViewStyle,\n tableInnerStyle,\n scrollbarStyle,\n }\n}\n\nexport default useStyle\n"],"names":["ref","watchEffect","watch","unref","computed","onMounted","nextTick","useEventListener","useResizeObserver","useSize"],"mappings":";;;;;;;;;AAWA,SAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AAC/C,EAAE,MAAM,QAAQ,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AAC9B,EAAE,MAAM,cAAc,GAAGA,OAAG,CAAC,IAAI,CAAC,CAAC;AACnC,EAAE,MAAM,kBAAkB,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AACxC,EAAE,MAAM,cAAc,GAAG,CAAC,OAAO,KAAK;AACtC,IAAI,kBAAkB,CAAC,KAAK,GAAG,OAAO,CAAC;AACvC,GAAG,CAAC;AACJ,EAAE,MAAM,WAAW,GAAGA,OAAG,CAAC;AAC1B,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,MAAM,EAAE,IAAI;AAChB,IAAI,YAAY,EAAE,IAAI;AACtB,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,OAAO,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AAC7B,EAAE,MAAM,kBAAkB,GAAG;AAC7B,IAAI,OAAO,EAAE,cAAc;AAC3B,IAAI,aAAa,EAAE,QAAQ;AAC3B,GAAG,CAAC;AACJ,EAAE,MAAM,UAAU,GAAGA,OAAG,EAAE,CAAC;AAC3B,EAAE,MAAM,iBAAiB,GAAGA,OAAG,CAAC,CAAC,CAAC,CAAC;AACnC,EAAE,MAAM,gBAAgB,GAAGA,OAAG,CAAC,CAAC,CAAC,CAAC;AA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,IAAI,eAAe;AACnB,IAAI,WAAW;AACf,IAAI,kBAAkB;AACtB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,GAAG,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"style-helper.js","sources":["../../../../../../../packages/components/table/src/table/style-helper.ts"],"sourcesContent":["import {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n unref,\n watch,\n watchEffect,\n} from 'vue'\nimport {\n addResizeListener,\n isNumber,\n isString,\n off,\n on,\n removeResizeListener,\n} from '@element-ps/utils'\nimport { useSize } from '@element-ps/hooks'\nimport { parseHeight } from '../util'\n\nimport type { ResizableElement } from '@element-ps/utils'\nimport type { Table, TableProps } from './defaults'\nimport type { Store } from '../store'\nimport type TableLayout from '../table-layout'\nimport type { TableColumnCtx } from '../table-column/defaults'\n\nfunction useStyle<T>(\n props: TableProps<T>,\n layout: TableLayout<T>,\n store: Store<T>,\n table: Table<T>\n) {\n const isHidden = ref(false)\n const renderExpanded = ref(null)\n const resizeProxyVisible = ref(false)\n const setDragVisible = (visible: boolean) => {\n resizeProxyVisible.value = visible\n }\n const resizeState = ref({\n width: null,\n height: null,\n })\n const isGroup = ref(false)\n const scrollbarViewStyle = {\n display: 'inline-block',\n verticalAlign: 'middle',\n }\n const tableWidth = ref()\n\n const handleMouseLeave = () => {\n table.store.commit('setHoverRow', null)\n if (table.hoverState) table.hoverState = null\n }\n\n const handleHeaderFooterMousewheel = (event, data) => {\n const { pixelX, pixelY } = data\n if (Math.abs(pixelX) >= Math.abs(pixelY)) {\n table.refs.bodyWrapper.scrollLeft += data.pixelX / 5\n }\n }\n\n const shouldUpdateHeight = computed(() => {\n return (\n props.height ||\n props.maxHeight ||\n store.states.fixedColumns.value.length > 0 ||\n store.states.rightFixedColumns.value.length > 0\n )\n })\n\n const tableBodyStyles = computed(() => {\n return {\n width: layout.bodyWidth.value ? `${layout.bodyWidth.value}px` : '',\n }\n })\n\n const doLayout = () => {\n if (shouldUpdateHeight.value) {\n layout.updateElsHeight()\n }\n layout.updateColumnsWidth()\n requestAnimationFrame(syncPostion)\n }\n onMounted(async () => {\n await nextTick()\n store.updateColumns()\n bindEvents()\n requestAnimationFrame(doLayout)\n\n resizeState.value = {\n width: (tableWidth.value = table.vnode.el.offsetWidth),\n height: table.vnode.el.offsetHeight,\n }\n\n // init filters\n store.states.columns.value.forEach((column: TableColumnCtx<T>) => {\n if (column.filteredValue && column.filteredValue.length) {\n table.store.commit('filterChange', {\n column,\n values: column.filteredValue,\n silent: true,\n })\n }\n })\n table.$ready = true\n })\n const setScrollClassByEl = (el: HTMLElement, className: string) => {\n if (!el) return\n const classList = Array.from(el.classList).filter(\n (item) => !item.startsWith('is-scrolling-')\n )\n classList.push(layout.scrollX.value ? className : 'is-scrolling-none')\n el.className = classList.join(' ')\n }\n const setScrollClass = (className: string) => {\n const { tableWrapper } = table.refs\n setScrollClassByEl(tableWrapper, className)\n }\n const hasScrollClass = (className: string) => {\n const { tableWrapper } = table.refs\n return !!(tableWrapper && tableWrapper.classList.contains(className))\n }\n const syncPostion = function () {\n if (!table.refs.scrollBarRef) return\n if (!layout.scrollX.value) {\n const scrollingNoneClass = 'is-scrolling-none'\n if (!hasScrollClass(scrollingNoneClass)) {\n setScrollClass(scrollingNoneClass)\n }\n return\n }\n const scrollContainer = table.refs.scrollBarRef.wrap$\n if (!scrollContainer) return\n const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer\n const { headerWrapper, footerWrapper } = table.refs\n if (headerWrapper) headerWrapper.scrollLeft = scrollLeft\n if (footerWrapper) footerWrapper.scrollLeft = scrollLeft\n const maxScrollLeftPosition = scrollWidth - offsetWidth - 1\n if (scrollLeft >= maxScrollLeftPosition) {\n setScrollClass('is-scrolling-right')\n } else if (scrollLeft === 0) {\n setScrollClass('is-scrolling-left')\n } else {\n setScrollClass('is-scrolling-middle')\n }\n }\n\n const bindEvents = () => {\n if (!table.refs.scrollBarRef) return\n table.refs.scrollBarRef.wrap$?.addEventListener('scroll', syncPostion, {\n passive: true,\n })\n if (props.fit) {\n addResizeListener(table.vnode.el as ResizableElement, resizeListener)\n } else {\n on(window, 'resize', doLayout)\n }\n }\n onBeforeUnmount(() => {\n unbindEvents()\n })\n const unbindEvents = () => {\n table.refs.scrollBarRef.wrap$?.removeEventListener(\n 'scroll',\n syncPostion,\n true\n )\n if (props.fit) {\n removeResizeListener(table.vnode.el as ResizableElement, resizeListener)\n } else {\n off(window, 'resize', doLayout)\n }\n }\n const resizeListener = () => {\n if (!table.$ready) return\n let shouldUpdateLayout = false\n const el = table.vnode.el\n const { width: oldWidth, height: oldHeight } = resizeState.value\n\n const width = (tableWidth.value = el.offsetWidth)\n if (oldWidth !== width) {\n shouldUpdateLayout = true\n }\n\n const height = el.offsetHeight\n if ((props.height || shouldUpdateHeight.value) && oldHeight !== height) {\n shouldUpdateLayout = true\n }\n\n if (shouldUpdateLayout) {\n resizeState.value = {\n width,\n height,\n }\n doLayout()\n }\n }\n const tableSize = useSize()\n const bodyWidth = computed(() => {\n const { bodyWidth: bodyWidth_, scrollY, gutterWidth } = layout\n return bodyWidth_.value\n ? `${(bodyWidth_.value as number) - (scrollY.value ? gutterWidth : 0)}px`\n : ''\n })\n\n const tableLayout = computed(() => {\n if (props.maxHeight) return 'fixed'\n return props.tableLayout\n })\n\n function calcMaxHeight(\n maxHeight: string | number,\n footerHeight: number,\n headerHeight: number\n ) {\n const parsedMaxHeight = parseHeight(maxHeight)\n const tableHeaderHeight = props.showHeader ? headerHeight : 0\n if (parsedMaxHeight === null) return\n if (isString(parsedMaxHeight)) {\n return `calc(${parsedMaxHeight} - ${footerHeight}px - ${tableHeaderHeight}px)`\n }\n return parsedMaxHeight - footerHeight - tableHeaderHeight\n }\n\n const height = computed(() => {\n const headerHeight = layout.headerHeight.value || 0\n const bodyHeight = layout.bodyHeight.value\n const footerHeight = layout.footerHeight.value || 0\n if (props.height) {\n return bodyHeight ? bodyHeight : undefined\n } else if (props.maxHeight) {\n return calcMaxHeight(props.maxHeight, footerHeight, headerHeight)\n }\n return undefined\n })\n\n const bodyHeight = computed(() => {\n const headerHeight = layout.headerHeight.value || 0\n const bodyHeight = layout.bodyHeight.value\n const footerHeight = layout.footerHeight.value || 0\n if (props.height) {\n return {\n height: bodyHeight ? `${bodyHeight}px` : '',\n }\n } else if (props.maxHeight) {\n const maxHeight = calcMaxHeight(\n props.maxHeight,\n footerHeight,\n headerHeight\n )\n if (maxHeight !== null) {\n return {\n 'max-height': `${maxHeight}${isNumber(maxHeight) ? 'px' : ''}`,\n }\n }\n }\n return {}\n })\n const emptyBlockStyle = computed(() => {\n if (props.data && props.data.length) return null\n let height = '100%'\n if (layout.appendHeight.value) {\n height = `calc(100% - ${layout.appendHeight.value}px)`\n }\n return {\n width: tableWidth.value ? `${tableWidth.value}px` : '',\n height,\n }\n })\n /**\n * fix layout\n */\n const handleFixedMousewheel = (event, data) => {\n const bodyWrapper = table.refs.bodyWrapper\n if (Math.abs(data.spinY) > 0) {\n const currentScrollTop = bodyWrapper.scrollTop\n if (data.pixelY < 0 && currentScrollTop !== 0) {\n event.preventDefault()\n }\n if (\n data.pixelY > 0 &&\n bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop\n ) {\n event.preventDefault()\n }\n bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5)\n } else {\n bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5)\n }\n }\n const fixedHeight = computed(() => {\n if (props.maxHeight) {\n if (props.showSummary) {\n return {\n bottom: 0,\n }\n }\n return {\n bottom:\n layout.scrollX.value && props.data.length\n ? `${layout.gutterWidth}px`\n : '',\n }\n } else {\n if (props.showSummary) {\n return {\n height: layout.tableHeight.value\n ? `${layout.tableHeight.value}px`\n : '',\n }\n }\n return {\n height: layout.viewportHeight.value\n ? `${layout.viewportHeight.value}px`\n : '',\n }\n }\n })\n const fixedBodyHeight = computed(() => {\n if (props.height) {\n return {\n height: layout.fixedBodyHeight.value\n ? `${layout.fixedBodyHeight.value}px`\n : '',\n }\n } else if (props.maxHeight) {\n let maxHeight = parseHeight(props.maxHeight)\n if (typeof maxHeight === 'number') {\n maxHeight = layout.scrollX.value\n ? maxHeight - layout.gutterWidth\n : maxHeight\n if (props.showHeader) {\n maxHeight -= layout.headerHeight.value\n }\n maxHeight -= layout.footerHeight.value\n return {\n 'max-height': `${maxHeight}px`,\n }\n }\n }\n return {}\n })\n\n return {\n isHidden,\n renderExpanded,\n setDragVisible,\n isGroup,\n handleMouseLeave,\n handleHeaderFooterMousewheel,\n tableSize,\n bodyHeight,\n height,\n emptyBlockStyle,\n handleFixedMousewheel,\n fixedHeight,\n fixedBodyHeight,\n resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n tableBodyStyles,\n tableLayout,\n scrollbarViewStyle,\n }\n}\n\nexport default useStyle\n"],"names":["ref","computed","onMounted","nextTick","addResizeListener","on","onBeforeUnmount","removeResizeListener","off","useSize","parseHeight","isString","isNumber"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AAC/C,EAAE,MAAM,QAAQ,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AAC9B,EAAE,MAAM,cAAc,GAAGA,OAAG,CAAC,IAAI,CAAC,CAAC;AACnC,EAAE,MAAM,kBAAkB,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AACxC,EAAE,MAAM,cAAc,GAAG,CAAC,OAAO,KAAK;AACtC,IAAI,kBAAkB,CAAC,KAAK,GAAG,OAAO,CAAC;AACvC,GAAG,CAAC;AACJ,EAAE,MAAM,WAAW,GAAGA,OAAG,CAAC;AAC1B,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,MAAM,EAAE,IAAI;AAChB,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,OAAO,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AAC7B,EAAE,MAAM,kBAAkB,GAAG;AAC7B,IAAI,OAA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;AACf,IAAI,QAAQ;AACZ,IAAI,eAAe;AACnB,IAAI,WAAW;AACf,IAAI,kBAAkB;AACtB,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -6,7 +6,7 @@ declare function useUtils<T>(store: Store<T>): {
|
|
|
6
6
|
clearSelection: () => void;
|
|
7
7
|
clearFilter: (columnKeys: string[]) => void;
|
|
8
8
|
toggleAllSelection: () => void;
|
|
9
|
-
toggleRowExpansion: (row: T, expanded
|
|
9
|
+
toggleRowExpansion: (row: T, expanded: boolean) => void;
|
|
10
10
|
clearSort: () => void;
|
|
11
11
|
sort: (prop: string, order: string) => void;
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-helper.js","sources":["../../../../../../../packages/components/table/src/table/utils-helper.ts"],"sourcesContent":["import type { Store } from '../store'\n\nfunction useUtils<T>(store: Store<T>) {\n const setCurrentRow = (row: T) => {\n store.commit('setCurrentRow', row)\n }\n const getSelectionRows = () => {\n return store.getSelectionRows()\n }\n const toggleRowSelection = (row: T, selected: boolean) => {\n store.toggleRowSelection(row, selected, false)\n store.updateAllSelected()\n }\n const clearSelection = () => {\n store.clearSelection()\n }\n const clearFilter = (columnKeys: string[]) => {\n store.clearFilter(columnKeys)\n }\n const toggleAllSelection = () => {\n store.commit('toggleAllSelection')\n }\n const toggleRowExpansion = (row: T, expanded
|
|
1
|
+
{"version":3,"file":"utils-helper.js","sources":["../../../../../../../packages/components/table/src/table/utils-helper.ts"],"sourcesContent":["import type { Store } from '../store'\n\nfunction useUtils<T>(store: Store<T>) {\n const setCurrentRow = (row: T) => {\n store.commit('setCurrentRow', row)\n }\n const getSelectionRows = () => {\n return store.getSelectionRows()\n }\n const toggleRowSelection = (row: T, selected: boolean) => {\n store.toggleRowSelection(row, selected, false)\n store.updateAllSelected()\n }\n const clearSelection = () => {\n store.clearSelection()\n }\n const clearFilter = (columnKeys: string[]) => {\n store.clearFilter(columnKeys)\n }\n const toggleAllSelection = () => {\n store.commit('toggleAllSelection')\n }\n const toggleRowExpansion = (row: T, expanded: boolean) => {\n store.toggleRowExpansionAdapter(row, expanded)\n }\n const clearSort = () => {\n store.clearSort()\n }\n const sort = (prop: string, order: string) => {\n store.commit('sort', { prop, order })\n }\n\n return {\n setCurrentRow,\n getSelectionRows,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n }\n}\n\nexport default useUtils\n"],"names":[],"mappings":";;;;AAAA,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,EAAE,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK;AACjC,IAAI,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;AACvC,GAAG,CAAC;AACJ,EAAE,MAAM,gBAAgB,GAAG,MAAM;AACjC,IAAI,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;AACpC,GAAG,CAAC;AACJ,EAAE,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,QAAQ,KAAK;AAChD,IAAI,KAAK,CAAC,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACnD,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;AAC9B,GAAG,CAAC;AACJ,EAAE,MAAM,cAAc,GAAG,MAAM;AAC/B,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;AAC3B,GAAG,CAAC;AACJ,EAAE,MAAM,WAAW,GAAG,CAAC,UAAU,KAAK;AACtC,IAAI,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAClC,GAAG,CAAC;AACJ,EAAE,MAAM,kBAAkB,GAAG,MAAM;AACnC,IAAI,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AACvC,GAAG,CAAC;AACJ,EAAE,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,QAAQ,KAAK;AAChD,IAAI,KAAK,CAAC,yBAAyB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AACnD,GAAG,CAAC;AACJ,EAAE,MAAM,SAAS,GAAG,MAAM;AAC1B,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;AACtB,GAAG,CAAC;AACJ,EAAE,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK;AAChC,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1C,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,aAAa;AACjB,IAAI,gBAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,cAAc;AAClB,IAAI,WAAW;AACf,IAAI,kBAAkB;AACtB,IAAI,kBAAkB;AACtB,IAAI,SAAS;AACb,IAAI,IAAI;AACR,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -5,7 +5,9 @@ declare function useEvents<T>(props: Partial<TableBodyProps<T>>): {
|
|
|
5
5
|
handleContextMenu: (event: Event, row: T) => void;
|
|
6
6
|
handleMouseEnter: import("lodash").DebouncedFunc<(index: number) => void>;
|
|
7
7
|
handleMouseLeave: import("lodash").DebouncedFunc<() => void>;
|
|
8
|
-
handleCellMouseEnter: (event: MouseEvent, row: T
|
|
8
|
+
handleCellMouseEnter: (event: MouseEvent, row: T & {
|
|
9
|
+
tooltipEffect: string;
|
|
10
|
+
}) => void;
|
|
9
11
|
handleCellMouseLeave: (event: any) => void;
|
|
10
12
|
tooltipContent: import("vue").Ref<string>;
|
|
11
13
|
tooltipTrigger: import("vue").Ref<import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -45,7 +45,7 @@ function useEvents(props) {
|
|
|
45
45
|
const handleMouseLeave = lodashUnified.debounce(() => {
|
|
46
46
|
props.store.commit("setHoverRow", null);
|
|
47
47
|
}, 30);
|
|
48
|
-
const handleCellMouseEnter = (event, row
|
|
48
|
+
const handleCellMouseEnter = (event, row) => {
|
|
49
49
|
var _a;
|
|
50
50
|
const table = parent;
|
|
51
51
|
const cell = util.getCell(event);
|
|
@@ -67,10 +67,10 @@ function useEvents(props) {
|
|
|
67
67
|
const rangeWidth = range.getBoundingClientRect().width;
|
|
68
68
|
const padding = (Number.parseInt(style.getStyle(cellChild, "paddingLeft"), 10) || 0) + (Number.parseInt(style.getStyle(cellChild, "paddingRight"), 10) || 0);
|
|
69
69
|
if (rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) {
|
|
70
|
-
util.createTablePopper(
|
|
70
|
+
util.createTablePopper(cell, cell.innerText || cell.textContent, {
|
|
71
71
|
placement: "top",
|
|
72
72
|
strategy: "fixed"
|
|
73
|
-
}, tooltipEffect);
|
|
73
|
+
}, row.tooltipEffect);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
const handleCellMouseLeave = (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events-helper.js","sources":["../../../../../../../packages/components/table/src/table-body/events-helper.ts"],"sourcesContent":["import { h, inject, ref } from 'vue'\nimport { debounce } from 'lodash-unified'\nimport { getStyle, hasClass } from '@element-ps/utils'\nimport { createTablePopper, getCell, getColumnByCell } from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { TableBodyProps } from './defaults'\n\nfunction useEvents<T>(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>\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 handleCellMouseEnter = (\n event: MouseEvent,\n row: T
|
|
1
|
+
{"version":3,"file":"events-helper.js","sources":["../../../../../../../packages/components/table/src/table-body/events-helper.ts"],"sourcesContent":["import { h, inject, ref } from 'vue'\nimport { debounce } from 'lodash-unified'\nimport { getStyle, hasClass } from '@element-ps/utils'\nimport { createTablePopper, getCell, getColumnByCell } from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { TableBodyProps } from './defaults'\n\nfunction useEvents<T>(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>\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 handleCellMouseEnter = (\n event: MouseEvent,\n row: T & { tooltipEffect: string }\n ) => {\n const table = parent\n const cell = getCell(event)\n const namespace = table?.vnode.el?.dataset.prefix\n if (cell) {\n const column = getColumnByCell(\n {\n columns: props.store.states.columns.value,\n },\n cell,\n namespace\n )\n const hoverState = (table.hoverState = { cell, column, row })\n table?.emit(\n 'cell-mouse-enter',\n hoverState.row,\n hoverState.column,\n hoverState.cell,\n event\n )\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 )\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 const rangeWidth = range.getBoundingClientRect().width\n const padding =\n (Number.parseInt(getStyle(cellChild, 'paddingLeft'), 10) || 0) +\n (Number.parseInt(getStyle(cellChild, 'paddingRight'), 10) || 0)\n if (\n rangeWidth + padding > cellChild.offsetWidth ||\n cellChild.scrollWidth > cellChild.offsetWidth\n ) {\n createTablePopper(\n cell,\n cell.innerText || cell.textContent,\n {\n placement: 'top',\n strategy: 'fixed',\n },\n row.tooltipEffect\n )\n }\n }\n const handleCellMouseLeave = (event) => {\n const cell = getCell(event)\n if (!cell) return\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"],"names":["inject","TABLE_INJECTION_KEY","ref","h","getCell","getColumnByCell","debounce","hasClass","getStyle","createTablePopper"],"mappings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xB,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../packages/components/table/src/table-body/index.ts"],"sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n onUnmounted,\n watch,\n} from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { addClass, removeClass } from '@element-ps/utils'\nimport { useNamespace } from '@element-ps/hooks'\nimport useLayoutObserver from '../layout-observer'\nimport { removePopper } from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport useRender from './render-helper'\nimport defaultProps from './defaults'\n\nimport type { VNode } from 'vue'\n\nexport default defineComponent({\n name: 'PsTableBody',\n props: defaultProps,\n setup(props) {\n const instance = getCurrentInstance()\n const parent = inject(TABLE_INJECTION_KEY)\n const ns = useNamespace('table')\n const { wrappedRowRender, tooltipContent, tooltipTrigger } =\n useRender(props)\n const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent!)\n\n onUnmounted(() => {\n removePopper?.()\n })\n\n return {\n ns,\n onColumnsChange,\n onScrollableChange,\n wrappedRowRender,\n tooltipContent,\n tooltipTrigger,\n }\n },\n render() {\n const { wrappedRowRender, store } = this\n const data = store.states.data.value || []\n return h('tbody', {}, [\n data.reduce((acc: VNode[], row) => {\n return acc.concat(wrappedRowRender(row, acc.length))\n }, []),\n ])\n },\n})\n"],"names":["defineComponent","defaultProps","getCurrentInstance","inject","TABLE_INJECTION_KEY","useNamespace","useRender","useLayoutObserver","onUnmounted","removePopper","h"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../packages/components/table/src/table-body/index.ts"],"sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n onUnmounted,\n onUpdated,\n watch,\n} from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { addClass, removeClass } from '@element-ps/utils'\nimport { useNamespace } from '@element-ps/hooks'\nimport useLayoutObserver from '../layout-observer'\nimport { removePopper } from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport useRender from './render-helper'\nimport defaultProps from './defaults'\n\nimport type { VNode } from 'vue'\n\nexport default defineComponent({\n name: 'PsTableBody',\n props: defaultProps,\n setup(props) {\n const instance = getCurrentInstance()\n const parent = inject(TABLE_INJECTION_KEY)\n const ns = useNamespace('table')\n const { wrappedRowRender, tooltipContent, tooltipTrigger } =\n useRender(props)\n const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent!)\n\n onUnmounted(() => {\n removePopper?.()\n })\n onUpdated(() => {\n removePopper?.()\n })\n\n return {\n ns,\n onColumnsChange,\n onScrollableChange,\n wrappedRowRender,\n tooltipContent,\n tooltipTrigger,\n }\n },\n render() {\n const { wrappedRowRender, store } = this\n const data = store.states.data.value || []\n return h('tbody', {}, [\n data.reduce((acc: VNode[], row) => {\n return acc.concat(wrappedRowRender(row, acc.length))\n }, []),\n ])\n },\n})\n"],"names":["defineComponent","defaultProps","getCurrentInstance","inject","TABLE_INJECTION_KEY","useNamespace","useRender","useLayoutObserver","onUnmounted","removePopper","onUpdated","h"],"mappings":";;;;;;;;;;;;;AAcA,gBAAeA,mBAAe,CAAC;AAC/B,EAAE,IAAI,EAAE,aAAa;AACrB,EAAE,KAAK,EAAEC,mBAAY;AACrB,EAAE,KAAK,CAAC,KAAK,EAAE;AACf,IAAI,MAAM,QAAQ,GAAGC,sBAAkB,EAAE,CAAC;AAC1C,IAAI,MAAM,MAAM,GAAGC,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC/C,IAAI,MAAM,EAAE,GAAGC,kBAAY,CAAC,OAAO,CAAC,CAAC;AACrC,IAAI,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,GAAGC,uBAAS,CAAC,KAAK,CAAC,CAAC;AAClF,IAAI,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,GAAGC,yBAAiB,CAAC,MAAM,CAAC,CAAC;AAC9E,IAAIC,eAAW,CAAC,MAAM;AACtB,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,CAAC,EAAE,GAAGC,iBAAY,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC;AAClD,KAAK,CAAC,CAAC;AACP,IAAIC,aAAS,CAAC,MAAM;AACpB,MAAM,IAAI,EAAE,CAAC;AACb,MAAM,CAAC,EAAE,GAAGD,iBAAY,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC;AAClD,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,MAAM,EAAE;AACR,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,cAAc;AACpB,KAAK,CAAC;AACN,GAAG;AACH,EAAE,MAAM,GAAG;AACX,IAAI,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;AAC7C,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;AAC/C,IAAI,OAAOE,KAAC,CAAC,OAAO,EAAE,EAAE,EAAE;AAC1B,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK;AAChC,QAAQ,OAAO,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7D,OAAO,EAAE,EAAE,CAAC;AACZ,KAAK,CAAC,CAAC;AACP,GAAG;AACH,CAAC,CAAC;;;;"}
|
|
@@ -3,16 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
-
require('../../../../hooks/index.js');
|
|
7
6
|
var util = require('../util.js');
|
|
8
7
|
var tokens = require('../tokens.js');
|
|
9
8
|
var eventsHelper = require('./events-helper.js');
|
|
10
9
|
var stylesHelper = require('./styles-helper.js');
|
|
11
|
-
var index = require('../../../../hooks/use-namespace/index.js');
|
|
12
10
|
|
|
13
11
|
function useRender(props) {
|
|
14
12
|
const parent = vue.inject(tokens.TABLE_INJECTION_KEY);
|
|
15
|
-
const ns = index.useNamespace("table");
|
|
16
13
|
const {
|
|
17
14
|
handleDoubleClick,
|
|
18
15
|
handleClick,
|
|
@@ -48,7 +45,7 @@ function useRender(props) {
|
|
|
48
45
|
const rowClasses = getRowClass(row, $index);
|
|
49
46
|
let display = true;
|
|
50
47
|
if (treeRowData) {
|
|
51
|
-
rowClasses.push(
|
|
48
|
+
rowClasses.push(`el-table__row--level-${treeRowData.level}`);
|
|
52
49
|
display = treeRowData.display;
|
|
53
50
|
}
|
|
54
51
|
const displayStyle = display ? null : {
|
|
@@ -99,7 +96,7 @@ function useRender(props) {
|
|
|
99
96
|
const tdChildren = cellChildren(cellIndex, column, data);
|
|
100
97
|
return vue.h("td", {
|
|
101
98
|
style: getCellStyle($index, cellIndex, row, column),
|
|
102
|
-
class: getCellClass($index, cellIndex, row, column
|
|
99
|
+
class: getCellClass($index, cellIndex, row, column),
|
|
103
100
|
key: `${patchKey}${baseKey}`,
|
|
104
101
|
rowspan,
|
|
105
102
|
colspan,
|
|
@@ -135,7 +132,7 @@ function useRender(props) {
|
|
|
135
132
|
}, [
|
|
136
133
|
vue.h("td", {
|
|
137
134
|
colspan: columns.length,
|
|
138
|
-
class:
|
|
135
|
+
class: "el-table__cell el-table__expanded-cell"
|
|
139
136
|
}, [renderExpanded({ row, $index, store, expanded })])
|
|
140
137
|
])
|
|
141
138
|
]
|