vxe-pc-ui 4.20.34 → 4.20.35
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/all.esm.js +45718 -45038
- package/dist/all.esm.min.js +3 -3
- package/dist/style.css +307 -1
- package/dist/style.mini.css +1 -1
- package/es/alert/src/alert.js +117 -114
- package/es/anchor/src/anchor-link.js +110 -107
- package/es/anchor/src/anchor.js +212 -209
- package/es/avatar/src/avatar.js +132 -129
- package/es/backtop/src/backtop.js +267 -264
- package/es/badge/src/badge.js +102 -99
- package/es/breadcrumb/src/breadcrumb-item.js +104 -101
- package/es/breadcrumb/src/breadcrumb.js +70 -67
- package/es/button/src/button-group.js +88 -85
- package/es/calendar/src/calendar.js +1371 -1368
- package/es/card/src/card.js +235 -232
- package/es/carousel/src/carousel-item.js +78 -75
- package/es/carousel/src/carousel.js +392 -389
- package/es/cascader/src/cascader.js +1667 -1664
- package/es/checkbox/src/button.js +198 -195
- package/es/checkbox/src/checkbox.js +181 -178
- package/es/checkbox/src/group.js +210 -207
- package/es/collapse/src/collapse-pane.js +98 -95
- package/es/collapse/src/collapse.js +340 -337
- package/es/color-picker/src/color-picker.js +1116 -1113
- package/es/components.d.ts +1 -0
- package/es/components.js +3 -0
- package/es/context-menu/src/context-menu.js +601 -598
- package/es/countdown/src/countdown.js +224 -221
- package/es/date-panel/src/date-panel.js +1905 -1902
- package/es/date-picker/src/date-picker.js +1537 -1534
- package/es/date-range-picker/src/date-range-picker.js +1412 -1409
- package/es/divider/src/divider.js +80 -77
- package/es/drawer/src/drawer.js +778 -775
- package/es/empty/src/empty.js +100 -97
- package/es/form/src/form-group.js +74 -71
- package/es/form/src/form-item.js +76 -73
- package/es/form/src/form.js +789 -786
- package/es/icon/src/icon.js +59 -56
- package/es/icon/style.css +1 -1
- package/es/icon/style.mini.css +1 -1
- package/es/icon-picker/src/icon-picker.js +719 -716
- package/es/image/src/group.js +130 -127
- package/es/image/src/image.js +243 -240
- package/es/image/src/preview.js +627 -624
- package/es/index.esm.js +2 -0
- package/es/index.js +2 -0
- package/es/input/src/input.js +2700 -2697
- package/es/layout-aside/src/layout-aside.js +138 -135
- package/es/layout-body/src/layout-body.js +145 -142
- package/es/layout-container/src/layout-container.js +71 -68
- package/es/layout-footer/src/layout-footer.js +60 -57
- package/es/layout-header/src/layout-header.js +58 -55
- package/es/link/src/link.js +131 -128
- package/es/list/src/list.js +2174 -2171
- package/es/loading/src/loading.js +141 -138
- package/es/mention/src/mention.js +49 -46
- package/es/menu/src/menu.js +799 -796
- package/es/modal/src/modal.js +1519 -1527
- package/es/notice-bar/src/notice-bar.js +168 -165
- package/es/number-input/src/number-input.js +1094 -1091
- package/es/pager/src/pager.js +767 -764
- package/es/password-input/src/password-input.js +431 -428
- package/es/print/src/page-break.js +63 -60
- package/es/print/src/print.js +303 -300
- package/es/pulldown/src/pulldown.js +403 -400
- package/es/radio/src/button.js +214 -211
- package/es/radio/src/group.js +195 -192
- package/es/radio/src/radio.js +194 -191
- package/es/rate/src/rate.js +164 -161
- package/es/result/src/result.js +116 -113
- package/es/row/src/col.js +133 -130
- package/es/row/src/row.js +111 -108
- package/es/scrollbar/src/scrollbar.js +518 -515
- package/es/segmented/src/segmented.js +240 -237
- package/es/select/src/optgroup.js +44 -41
- package/es/select/src/option.js +39 -36
- package/es/select/src/select.js +1914 -1896
- package/es/slider/src/slider.js +419 -416
- package/es/space/src/space.js +190 -187
- package/es/splitter/src/splitter-panel.js +146 -143
- package/es/splitter/src/splitter.js +917 -914
- package/es/step-item/index.d.ts +76 -0
- package/es/step-item/index.js +17 -0
- package/es/steps/index.d.ts +288 -34
- package/es/steps/src/step-info.d.ts +6 -0
- package/es/steps/src/step-info.js +20 -0
- package/es/steps/src/step-item.d.ts +14 -0
- package/es/steps/src/step-item.js +39 -0
- package/es/steps/src/steps.d.ts +68 -8
- package/es/steps/src/steps.js +299 -47
- package/es/steps/src/util.d.ts +7 -0
- package/es/steps/src/util.js +44 -0
- package/es/steps/style.css +297 -0
- package/es/steps/style.mini.css +1 -0
- package/es/style.css +307 -1
- package/es/style.mini.css +1 -1
- package/es/switch/src/switch.js +228 -225
- package/es/table-select/src/table-select.js +865 -862
- package/es/table-transfer/src/table-transfer.js +61 -58
- package/es/tabs/src/tab-pane.js +102 -99
- package/es/tabs/src/tabs.js +936 -933
- package/es/tag/src/tag.js +163 -160
- package/es/text/src/text.js +232 -229
- package/es/text-ellipsis/src/text-ellipsis.js +252 -249
- package/es/textarea/src/textarea.js +434 -431
- package/es/timeline/src/timeline.js +74 -36
- package/es/timeline/src/util.js +7 -4
- package/es/tip/src/tip.js +117 -114
- package/es/tooltip/src/tooltip.js +552 -549
- package/es/tour/src/tour.js +49 -46
- package/es/transfer/src/transfer.js +95 -92
- package/es/tree/src/tree.js +3379 -3376
- package/es/tree-select/src/tree-select.js +969 -966
- package/es/ui/index.js +8 -2
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +1791 -1788
- package/es/vxe-icon/style.css +1 -1
- package/es/vxe-icon/style.mini.css +1 -1
- package/es/vxe-steps/style.css +297 -0
- package/es/vxe-steps/style.mini.css +1 -0
- package/es/watermark/src/watermark.js +158 -155
- package/lib/alert/src/alert.js +117 -114
- package/lib/anchor/src/anchor-link.js +110 -107
- package/lib/anchor/src/anchor.js +212 -209
- package/lib/avatar/src/avatar.js +132 -129
- package/lib/backtop/src/backtop.js +267 -264
- package/lib/badge/src/badge.js +102 -99
- package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
- package/lib/breadcrumb/src/breadcrumb.js +70 -67
- package/lib/button/src/button-group.js +88 -85
- package/lib/calendar/src/calendar.js +1371 -1368
- package/lib/card/src/card.js +235 -232
- package/lib/carousel/src/carousel-item.js +78 -75
- package/lib/carousel/src/carousel.js +392 -389
- package/lib/cascader/src/cascader.js +1665 -1662
- package/lib/checkbox/src/button.js +198 -195
- package/lib/checkbox/src/checkbox.js +181 -178
- package/lib/checkbox/src/group.js +210 -207
- package/lib/collapse/src/collapse-pane.js +98 -95
- package/lib/collapse/src/collapse.js +340 -337
- package/lib/color-picker/src/color-picker.js +1116 -1113
- package/lib/components.js +3 -0
- package/lib/context-menu/src/context-menu.js +601 -598
- package/lib/countdown/src/countdown.js +224 -221
- package/lib/date-panel/src/date-panel.js +1905 -1902
- package/lib/date-picker/src/date-picker.js +1537 -1534
- package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
- package/lib/divider/src/divider.js +80 -77
- package/lib/drawer/src/drawer.js +778 -775
- package/lib/empty/src/empty.js +100 -97
- package/lib/form/src/form-group.js +74 -71
- package/lib/form/src/form-item.js +76 -73
- package/lib/form/src/form.js +789 -786
- package/lib/icon/src/icon.js +59 -56
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.mini.css +1 -1
- package/lib/icon-picker/src/icon-picker.js +719 -716
- package/lib/image/src/group.js +130 -127
- package/lib/image/src/image.js +243 -240
- package/lib/image/src/preview.js +627 -624
- package/lib/index.common.js +2 -0
- package/lib/index.js +2 -0
- package/lib/index.umd.js +47411 -46732
- package/lib/index.umd.min.js +3 -3
- package/lib/input/src/input.js +2700 -2697
- package/lib/layout-aside/src/layout-aside.js +138 -135
- package/lib/layout-body/src/layout-body.js +145 -142
- package/lib/layout-container/src/layout-container.js +71 -68
- package/lib/layout-footer/src/layout-footer.js +60 -57
- package/lib/layout-header/src/layout-header.js +58 -55
- package/lib/link/src/link.js +131 -128
- package/lib/list/src/list.js +2173 -2170
- package/lib/loading/src/loading.js +141 -138
- package/lib/mention/src/mention.js +49 -46
- package/lib/menu/src/menu.js +799 -796
- package/lib/modal/src/modal.js +1519 -1527
- package/lib/notice-bar/src/notice-bar.js +168 -165
- package/lib/number-input/src/number-input.js +1094 -1091
- package/lib/pager/src/pager.js +767 -764
- package/lib/password-input/src/password-input.js +431 -428
- package/lib/print/src/page-break.js +63 -60
- package/lib/print/src/print.js +303 -300
- package/lib/pulldown/src/pulldown.js +403 -400
- package/lib/radio/src/button.js +214 -211
- package/lib/radio/src/group.js +195 -192
- package/lib/radio/src/radio.js +194 -191
- package/lib/rate/src/rate.js +164 -161
- package/lib/result/src/result.js +116 -113
- package/lib/row/src/col.js +133 -130
- package/lib/row/src/row.js +111 -108
- package/lib/scrollbar/src/scrollbar.js +518 -515
- package/lib/segmented/src/segmented.js +240 -237
- package/lib/select/src/optgroup.js +44 -41
- package/lib/select/src/option.js +39 -36
- package/lib/select/src/select.js +1915 -1897
- package/lib/slider/src/slider.js +419 -416
- package/lib/space/src/space.js +190 -187
- package/lib/splitter/src/splitter-panel.js +146 -143
- package/lib/splitter/src/splitter.js +917 -914
- package/lib/step-item/index.js +47 -0
- package/lib/steps/src/step-info.js +49 -0
- package/lib/steps/src/step-item.js +59 -0
- package/lib/steps/src/steps.js +298 -46
- package/lib/steps/src/util.js +74 -0
- package/lib/steps/style/style.css +297 -0
- package/lib/steps/style/style.mini.css +1 -0
- package/lib/style.css +307 -1
- package/lib/style.mini.css +1 -1
- package/lib/switch/src/switch.js +228 -225
- package/lib/table-select/src/table-select.js +865 -862
- package/lib/table-transfer/src/table-transfer.js +61 -58
- package/lib/tabs/src/tab-pane.js +102 -99
- package/lib/tabs/src/tabs.js +936 -933
- package/lib/tag/src/tag.js +163 -160
- package/lib/text/src/text.js +232 -229
- package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
- package/lib/textarea/src/textarea.js +434 -431
- package/lib/timeline/src/timeline.js +74 -36
- package/lib/timeline/src/util.js +7 -4
- package/lib/tip/src/tip.js +117 -114
- package/lib/tooltip/src/tooltip.js +552 -549
- package/lib/tour/src/tour.js +49 -46
- package/lib/transfer/src/transfer.js +95 -92
- package/lib/tree/src/tree.js +3379 -3376
- package/lib/tree-select/src/tree-select.js +969 -966
- package/lib/ui/index.js +8 -2
- package/lib/ui/src/log.js +1 -1
- package/lib/upload/src/upload.js +1788 -1785
- package/lib/vxe-icon/style/style.css +1 -1
- package/lib/vxe-icon/style/style.mini.css +1 -1
- package/lib/vxe-steps/style/style.css +297 -0
- package/lib/vxe-steps/style/style.mini.css +1 -0
- package/lib/watermark/src/watermark.js +158 -155
- package/package.json +1 -1
- package/packages/alert/src/alert.ts +2 -2
- package/packages/anchor/src/anchor-link.ts +2 -2
- package/packages/anchor/src/anchor.ts +2 -2
- package/packages/avatar/src/avatar.ts +2 -2
- package/packages/backtop/src/backtop.ts +2 -2
- package/packages/badge/src/badge.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
- package/packages/breadcrumb/src/breadcrumb.ts +2 -2
- package/packages/button/src/button-group.ts +2 -2
- package/packages/calendar/src/calendar.ts +2 -2
- package/packages/card/src/card.ts +2 -2
- package/packages/carousel/src/carousel-item.ts +2 -2
- package/packages/carousel/src/carousel.ts +2 -2
- package/packages/cascader/src/cascader.ts +2 -2
- package/packages/checkbox/src/button.ts +3 -15
- package/packages/checkbox/src/checkbox.ts +2 -2
- package/packages/checkbox/src/group.ts +2 -2
- package/packages/collapse/src/collapse-pane.ts +2 -2
- package/packages/collapse/src/collapse.ts +2 -2
- package/packages/color-picker/src/color-picker.ts +2 -2
- package/packages/components.ts +3 -0
- package/packages/context-menu/src/context-menu.ts +3 -16
- package/packages/countdown/src/countdown.ts +2 -2
- package/packages/date-panel/src/date-panel.ts +2 -2
- package/packages/date-picker/src/date-picker.ts +2 -2
- package/packages/date-range-picker/src/date-range-picker.ts +2 -2
- package/packages/divider/src/divider.ts +2 -2
- package/packages/drawer/src/drawer.ts +2 -2
- package/packages/empty/src/empty.ts +2 -2
- package/packages/form/src/form-group.ts +2 -2
- package/packages/form/src/form-item.ts +2 -2
- package/packages/form/src/form.ts +2 -2
- package/packages/icon/src/icon.ts +2 -2
- package/packages/icon-picker/src/icon-picker.ts +2 -2
- package/packages/image/src/group.ts +2 -2
- package/packages/image/src/image.ts +2 -2
- package/packages/image/src/preview.ts +3 -16
- package/packages/index.ts +2 -2
- package/packages/input/src/input.ts +2 -2
- package/packages/layout-aside/src/layout-aside.ts +2 -2
- package/packages/layout-body/src/layout-body.ts +2 -2
- package/packages/layout-container/src/layout-container.ts +3 -14
- package/packages/layout-footer/src/layout-footer.ts +2 -2
- package/packages/layout-header/src/layout-header.ts +2 -2
- package/packages/link/src/link.ts +2 -2
- package/packages/list/src/list.ts +2 -2
- package/packages/loading/src/loading.ts +2 -2
- package/packages/mention/src/mention.ts +2 -2
- package/packages/menu/src/menu.ts +2 -2
- package/packages/modal/src/modal.ts +5 -20
- package/packages/notice-bar/src/notice-bar.ts +2 -2
- package/packages/number-input/src/number-input.ts +3 -17
- package/packages/pager/src/pager.ts +2 -2
- package/packages/password-input/src/password-input.ts +2 -2
- package/packages/print/src/page-break.ts +2 -2
- package/packages/print/src/print.ts +2 -2
- package/packages/pulldown/src/pulldown.ts +2 -2
- package/packages/radio/src/button.ts +3 -16
- package/packages/radio/src/group.ts +3 -17
- package/packages/radio/src/radio.ts +2 -2
- package/packages/rate/src/rate.ts +2 -2
- package/packages/result/src/result.ts +2 -2
- package/packages/row/src/col.ts +2 -2
- package/packages/row/src/row.ts +2 -2
- package/packages/scrollbar/src/scrollbar.ts +3 -4
- package/packages/segmented/src/segmented.ts +2 -2
- package/packages/select/src/optgroup.ts +2 -2
- package/packages/select/src/option.ts +2 -2
- package/packages/select/src/select.ts +33 -19
- package/packages/slider/src/slider.ts +2 -2
- package/packages/space/src/space.ts +2 -2
- package/packages/splitter/src/splitter-panel.ts +2 -2
- package/packages/splitter/src/splitter.ts +2 -2
- package/packages/step-item/index.ts +16 -0
- package/packages/steps/src/step-info.ts +18 -0
- package/packages/steps/src/step-item.ts +41 -0
- package/packages/steps/src/steps.ts +273 -13
- package/packages/steps/src/util.ts +44 -0
- package/packages/switch/src/switch.ts +2 -2
- package/packages/table-select/src/table-select.ts +2 -2
- package/packages/table-transfer/src/table-transfer.ts +3 -15
- package/packages/tabs/src/tab-pane.ts +2 -2
- package/packages/tabs/src/tabs.ts +2 -2
- package/packages/tag/src/tag.ts +2 -2
- package/packages/text/src/text.ts +2 -2
- package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
- package/packages/textarea/src/textarea.ts +2 -2
- package/packages/timeline/src/timeline-info.ts +17 -17
- package/packages/timeline/src/timeline.ts +93 -49
- package/packages/timeline/src/util.ts +44 -41
- package/packages/tip/src/tip.ts +2 -2
- package/packages/tooltip/src/tooltip.ts +2 -2
- package/packages/tour/src/tour.ts +2 -2
- package/packages/transfer/src/transfer.ts +2 -2
- package/packages/tree/src/tree.ts +2 -2
- package/packages/tree-select/src/tree-select.ts +2 -2
- package/packages/ui/index.ts +8 -1
- package/packages/upload/src/upload.ts +2 -2
- package/packages/watermark/src/watermark.ts +2 -2
- package/styles/all.scss +1 -0
- package/styles/components/step-item.scss +0 -0
- package/styles/components/steps.scss +354 -0
- package/styles/theme/base.scss +9 -0
- package/types/all.d.ts +3 -0
- package/types/components/gantt.d.ts +1 -3
- package/types/components/select.d.ts +1 -13
- package/types/components/step-item.d.ts +72 -0
- package/types/components/steps.d.ts +67 -8
- package/types/components/table.d.ts +7 -66
- package/types/handles/form-design.d.ts +1 -4
- package/types/ui/global-config.d.ts +2 -0
- package/types/ui/global-icon.d.ts +7 -0
- /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
- /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
|
@@ -31,592 +31,595 @@ function createInternalData() {
|
|
|
31
31
|
// showDelayTip: undefined
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
var tooltip_default =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
34
|
+
var tooltip_default = (
|
|
35
|
+
/* define-vxe-component start */
|
|
36
|
+
defineVxeComponent({
|
|
37
|
+
name: "VxeTooltip",
|
|
38
|
+
props: {
|
|
39
|
+
modelValue: Boolean,
|
|
40
|
+
size: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: () => getConfig().tooltip.size || getConfig().size
|
|
43
|
+
},
|
|
44
|
+
selector: [String, Element],
|
|
45
|
+
trigger: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: () => getConfig().tooltip.trigger || "hover"
|
|
48
|
+
},
|
|
49
|
+
theme: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: () => getConfig().tooltip.theme || "dark"
|
|
52
|
+
},
|
|
53
|
+
content: {
|
|
54
|
+
type: [String, Number],
|
|
55
|
+
default: null
|
|
56
|
+
},
|
|
57
|
+
useHtml: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: () => XEUtils.isBoolean(getConfig().tooltip.useHtml) ? getConfig().tooltip.useHtml : null
|
|
60
|
+
},
|
|
61
|
+
// 已废弃,请使用 useHtml
|
|
62
|
+
useHTML: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: () => getConfig().tooltip.useHTML
|
|
65
|
+
},
|
|
66
|
+
zIndex: [String, Number],
|
|
67
|
+
popupClassName: [String, Function],
|
|
68
|
+
width: {
|
|
69
|
+
type: [String, Number],
|
|
70
|
+
default: () => getConfig().tooltip.Width
|
|
71
|
+
},
|
|
72
|
+
height: {
|
|
73
|
+
type: [String, Number],
|
|
74
|
+
default: () => getConfig().tooltip.height
|
|
75
|
+
},
|
|
76
|
+
minWidth: {
|
|
77
|
+
type: [String, Number],
|
|
78
|
+
default: () => getConfig().tooltip.minWidth
|
|
79
|
+
},
|
|
80
|
+
minHeight: {
|
|
81
|
+
type: [String, Number],
|
|
82
|
+
default: () => getConfig().tooltip.minHeight
|
|
83
|
+
},
|
|
84
|
+
maxWidth: {
|
|
85
|
+
type: [String, Number],
|
|
86
|
+
default: () => getConfig().tooltip.maxWidth
|
|
87
|
+
},
|
|
88
|
+
maxHeight: {
|
|
89
|
+
type: [String, Number],
|
|
90
|
+
default: () => getConfig().tooltip.maxHeight
|
|
91
|
+
},
|
|
92
|
+
placement: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: () => getConfig().tooltip.placement
|
|
95
|
+
},
|
|
96
|
+
defaultPlacement: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: () => getConfig().tooltip.defaultPlacement
|
|
99
|
+
},
|
|
100
|
+
isArrow: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: () => getConfig().tooltip.isArrow
|
|
103
|
+
},
|
|
104
|
+
enterable: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: () => getConfig().tooltip.enterable
|
|
107
|
+
},
|
|
108
|
+
enterDelay: {
|
|
109
|
+
type: Number,
|
|
110
|
+
default: () => getConfig().tooltip.enterDelay
|
|
111
|
+
},
|
|
112
|
+
leaveDelay: {
|
|
113
|
+
type: Number,
|
|
114
|
+
default: () => getConfig().tooltip.leaveDelay
|
|
115
|
+
},
|
|
116
|
+
appendTo: {
|
|
117
|
+
type: [String, Function],
|
|
118
|
+
default: () => getConfig().tooltip.appendTo
|
|
119
|
+
},
|
|
120
|
+
useScrollbar: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: () => getDefVal(getConfig().tooltip.useScrollbar, getConfig().useScrollbar)
|
|
123
|
+
},
|
|
124
|
+
scrollbarConfig: Object
|
|
121
125
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (height) {
|
|
142
|
-
stys.height = toCssUnit(height);
|
|
143
|
-
}
|
|
144
|
-
if (minWidth) {
|
|
145
|
-
stys.minWidth = toCssUnit(minWidth);
|
|
146
|
-
}
|
|
147
|
-
if (minHeight) {
|
|
148
|
-
stys.minHeight = toCssUnit(minHeight);
|
|
149
|
-
}
|
|
150
|
-
if (maxWidth) {
|
|
151
|
-
stys.maxWidth = toCssUnit(maxWidth);
|
|
152
|
-
}
|
|
153
|
-
if (maxHeight) {
|
|
154
|
-
stys.maxHeight = toCssUnit(maxHeight);
|
|
155
|
-
}
|
|
156
|
-
return stys;
|
|
157
|
-
});
|
|
158
|
-
const refMaps = {
|
|
159
|
-
refElem
|
|
160
|
-
};
|
|
161
|
-
const $xeTooltip = {
|
|
162
|
-
xID,
|
|
163
|
-
props,
|
|
164
|
-
context,
|
|
165
|
-
reactData,
|
|
166
|
-
internalData,
|
|
167
|
-
getRefMaps: () => refMaps
|
|
168
|
-
};
|
|
169
|
-
const dispatchEvent = (type, params, evnt) => {
|
|
170
|
-
emit(type, createEvent(evnt, { $tooltip: $xeTooltip }, params));
|
|
171
|
-
};
|
|
172
|
-
const updateValue = (value) => {
|
|
173
|
-
if (value !== reactData.visible) {
|
|
174
|
-
reactData.visible = value;
|
|
175
|
-
reactData.isUpdate = true;
|
|
176
|
-
emit("update:modelValue", value);
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
const updateZIndex = () => {
|
|
180
|
-
const { zIndex } = props;
|
|
181
|
-
if (zIndex) {
|
|
182
|
-
reactData.tipZindex = XEUtils.toNumber(zIndex);
|
|
183
|
-
} else if (reactData.tipZindex < getLastZIndex()) {
|
|
184
|
-
reactData.tipZindex = nextZIndex();
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
const clickEvent = () => {
|
|
188
|
-
if (reactData.visible) {
|
|
189
|
-
$xeTooltip.close();
|
|
190
|
-
} else {
|
|
191
|
-
handleVisible(reactData.target || getSelectorEl(), props.content);
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
const targetMouseenterEvent = () => {
|
|
195
|
-
handleVisible(reactData.target || getSelectorEl(), props.content);
|
|
196
|
-
};
|
|
197
|
-
const targetMouseleaveEvent = () => {
|
|
198
|
-
const { trigger, enterable, leaveDelay } = props;
|
|
199
|
-
reactData.tipActive = false;
|
|
200
|
-
if (enterable && trigger === "hover") {
|
|
201
|
-
setTimeout(() => {
|
|
202
|
-
if (!reactData.tipActive) {
|
|
203
|
-
$xeTooltip.close();
|
|
204
|
-
}
|
|
205
|
-
}, leaveDelay);
|
|
206
|
-
} else {
|
|
207
|
-
$xeTooltip.close();
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
const wrapperMouseenterEvent = () => {
|
|
211
|
-
reactData.tipActive = true;
|
|
212
|
-
};
|
|
213
|
-
const wrapperMouseleaveEvent = () => {
|
|
214
|
-
const { trigger, enterable, leaveDelay } = props;
|
|
215
|
-
reactData.tipActive = false;
|
|
216
|
-
if (enterable && trigger === "hover") {
|
|
217
|
-
setTimeout(() => {
|
|
218
|
-
if (!reactData.tipActive) {
|
|
219
|
-
$xeTooltip.close();
|
|
220
|
-
}
|
|
221
|
-
}, leaveDelay);
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
const showTip = () => {
|
|
225
|
-
const { appendTo } = props;
|
|
226
|
-
const { tipStore } = reactData;
|
|
227
|
-
const panelElem = refElem.value;
|
|
228
|
-
if (panelElem) {
|
|
229
|
-
const parentNode = panelElem.parentNode;
|
|
230
|
-
if (!parentNode) {
|
|
231
|
-
getPopupAppendElement(appendTo).appendChild(panelElem);
|
|
126
|
+
emits: ["update:modelValue", "show", "hide"],
|
|
127
|
+
setup(props, context) {
|
|
128
|
+
const { slots, emit } = context;
|
|
129
|
+
const xID = XEUtils.uniqueId();
|
|
130
|
+
const { computeSize } = useFns.useSize(props);
|
|
131
|
+
const { computeIsVScrollbar } = useFns.useVScrollbar(props);
|
|
132
|
+
const reactData = reactive(createReactData());
|
|
133
|
+
const internalData = createInternalData();
|
|
134
|
+
const refElem = ref();
|
|
135
|
+
const contentScrollbar = ref();
|
|
136
|
+
const contentWrapperElem = ref();
|
|
137
|
+
const computeWrapperStyle = computed(() => {
|
|
138
|
+
const { width, height, minHeight, minWidth, maxHeight, maxWidth } = props;
|
|
139
|
+
const stys = {};
|
|
140
|
+
if (width) {
|
|
141
|
+
stys.width = toCssUnit(width);
|
|
142
|
+
}
|
|
143
|
+
if (height) {
|
|
144
|
+
stys.height = toCssUnit(height);
|
|
232
145
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
146
|
+
if (minWidth) {
|
|
147
|
+
stys.minWidth = toCssUnit(minWidth);
|
|
148
|
+
}
|
|
149
|
+
if (minHeight) {
|
|
150
|
+
stys.minHeight = toCssUnit(minHeight);
|
|
151
|
+
}
|
|
152
|
+
if (maxWidth) {
|
|
153
|
+
stys.maxWidth = toCssUnit(maxWidth);
|
|
154
|
+
}
|
|
155
|
+
if (maxHeight) {
|
|
156
|
+
stys.maxHeight = toCssUnit(maxHeight);
|
|
157
|
+
}
|
|
158
|
+
return stys;
|
|
241
159
|
});
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
160
|
+
const refMaps = {
|
|
161
|
+
refElem
|
|
162
|
+
};
|
|
163
|
+
const $xeTooltip = {
|
|
164
|
+
xID,
|
|
165
|
+
props,
|
|
166
|
+
context,
|
|
167
|
+
reactData,
|
|
168
|
+
internalData,
|
|
169
|
+
getRefMaps: () => refMaps
|
|
170
|
+
};
|
|
171
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
172
|
+
emit(type, createEvent(evnt, { $tooltip: $xeTooltip }, params));
|
|
173
|
+
};
|
|
174
|
+
const updateValue = (value) => {
|
|
175
|
+
if (value !== reactData.visible) {
|
|
176
|
+
reactData.visible = value;
|
|
177
|
+
reactData.isUpdate = true;
|
|
178
|
+
emit("update:modelValue", value);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const updateZIndex = () => {
|
|
182
|
+
const { zIndex } = props;
|
|
183
|
+
if (zIndex) {
|
|
184
|
+
reactData.tipZindex = XEUtils.toNumber(zIndex);
|
|
185
|
+
} else if (reactData.tipZindex < getLastZIndex()) {
|
|
186
|
+
reactData.tipZindex = nextZIndex();
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const clickEvent = () => {
|
|
190
|
+
if (reactData.visible) {
|
|
191
|
+
$xeTooltip.close();
|
|
269
192
|
} else {
|
|
270
|
-
reactData.
|
|
193
|
+
handleVisible(reactData.target || getSelectorEl(), props.content);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const targetMouseenterEvent = () => {
|
|
197
|
+
handleVisible(reactData.target || getSelectorEl(), props.content);
|
|
198
|
+
};
|
|
199
|
+
const targetMouseleaveEvent = () => {
|
|
200
|
+
const { trigger, enterable, leaveDelay } = props;
|
|
201
|
+
reactData.tipActive = false;
|
|
202
|
+
if (enterable && trigger === "hover") {
|
|
203
|
+
setTimeout(() => {
|
|
204
|
+
if (!reactData.tipActive) {
|
|
205
|
+
$xeTooltip.close();
|
|
206
|
+
}
|
|
207
|
+
}, leaveDelay);
|
|
208
|
+
} else {
|
|
209
|
+
$xeTooltip.close();
|
|
271
210
|
}
|
|
211
|
+
};
|
|
212
|
+
const wrapperMouseenterEvent = () => {
|
|
272
213
|
reactData.tipActive = true;
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
214
|
+
};
|
|
215
|
+
const wrapperMouseleaveEvent = () => {
|
|
216
|
+
const { trigger, enterable, leaveDelay } = props;
|
|
217
|
+
reactData.tipActive = false;
|
|
218
|
+
if (enterable && trigger === "hover") {
|
|
219
|
+
setTimeout(() => {
|
|
220
|
+
if (!reactData.tipActive) {
|
|
221
|
+
$xeTooltip.close();
|
|
222
|
+
}
|
|
223
|
+
}, leaveDelay);
|
|
277
224
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
225
|
+
};
|
|
226
|
+
const showTip = () => {
|
|
227
|
+
const { appendTo } = props;
|
|
228
|
+
const { tipStore } = reactData;
|
|
229
|
+
const panelElem = refElem.value;
|
|
230
|
+
if (panelElem) {
|
|
231
|
+
const parentNode = panelElem.parentNode;
|
|
232
|
+
if (!parentNode) {
|
|
233
|
+
getPopupAppendElement(appendTo).appendChild(panelElem);
|
|
281
234
|
}
|
|
282
|
-
dispatchEvent("show", {}, evnt || null);
|
|
283
|
-
} else {
|
|
284
|
-
const rest = showTip();
|
|
285
|
-
dispatchEvent("show", {}, evnt || null);
|
|
286
|
-
return rest;
|
|
287
235
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
236
|
+
updateValue(true);
|
|
237
|
+
updateZIndex();
|
|
238
|
+
tipStore.placement = "top";
|
|
239
|
+
tipStore.style = { width: "auto", left: 0, top: 0, zIndex: props.zIndex || reactData.tipZindex };
|
|
240
|
+
tipStore.arrowStyle = { left: "50%" };
|
|
241
|
+
return $xeTooltip.updatePlacement().then(() => {
|
|
242
|
+
return $xeTooltip.updatePlacement();
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
const handleDelayFn = () => {
|
|
246
|
+
internalData.showDelayTip = XEUtils.debounce(
|
|
247
|
+
() => {
|
|
248
|
+
if (reactData.tipActive) {
|
|
249
|
+
showTip();
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
props.enterDelay,
|
|
253
|
+
{ leading: false, trailing: true }
|
|
254
|
+
);
|
|
255
|
+
};
|
|
256
|
+
const handleVisible = (target, content, evnt) => {
|
|
257
|
+
const contentSlot = slots.content;
|
|
258
|
+
if (!contentSlot && (content === "" || XEUtils.eqNull(content))) {
|
|
259
|
+
return nextTick();
|
|
296
260
|
}
|
|
297
|
-
if (
|
|
298
|
-
|
|
261
|
+
if (target) {
|
|
262
|
+
const { showDelayTip } = internalData;
|
|
263
|
+
const { trigger, enterDelay } = props;
|
|
264
|
+
if (evnt) {
|
|
265
|
+
reactData.tipPos = {
|
|
266
|
+
x: evnt.clientX,
|
|
267
|
+
y: evnt.clientY,
|
|
268
|
+
oLeft: evnt.offsetX,
|
|
269
|
+
oTop: evnt.offsetY
|
|
270
|
+
};
|
|
271
|
+
} else {
|
|
272
|
+
reactData.tipPos = null;
|
|
273
|
+
}
|
|
274
|
+
reactData.tipActive = true;
|
|
275
|
+
reactData.tipTarget = target;
|
|
276
|
+
reactData.tipContent = content;
|
|
277
|
+
if (reactData.visible) {
|
|
278
|
+
return $xeTooltip.updatePlacement();
|
|
279
|
+
}
|
|
280
|
+
if (enterDelay && trigger === "hover") {
|
|
281
|
+
if (showDelayTip) {
|
|
282
|
+
showDelayTip();
|
|
283
|
+
}
|
|
284
|
+
dispatchEvent("show", {}, evnt || null);
|
|
285
|
+
} else {
|
|
286
|
+
const rest = showTip();
|
|
287
|
+
dispatchEvent("show", {}, evnt || null);
|
|
288
|
+
return rest;
|
|
289
|
+
}
|
|
299
290
|
}
|
|
300
|
-
}
|
|
301
|
-
return null;
|
|
302
|
-
};
|
|
303
|
-
const updateTipStyle = () => {
|
|
304
|
-
const { placement, defaultPlacement, appendTo, isArrow } = props;
|
|
305
|
-
const { tipTarget: targetElem, tipStore, tipPos, tipZindex } = reactData;
|
|
306
|
-
const panelElem = refElem.value;
|
|
307
|
-
if (!targetElem || !panelElem) {
|
|
308
291
|
return nextTick();
|
|
309
|
-
}
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
left = targetLeft;
|
|
320
|
-
top = targetTop + targetHeight;
|
|
321
|
-
if (isArrow) {
|
|
322
|
-
left = left + Math.max(8, Math.min(targetWidth - 8, tipPos.oLeft)) - panelWidth / 2;
|
|
323
|
-
} else {
|
|
324
|
-
left = tipPos.x + 1;
|
|
325
|
-
top = tipPos.y + 1;
|
|
292
|
+
};
|
|
293
|
+
const getSelectorEl = () => {
|
|
294
|
+
const { selector } = props;
|
|
295
|
+
if (selector) {
|
|
296
|
+
if (XEUtils.isElement(selector)) {
|
|
297
|
+
return selector;
|
|
298
|
+
}
|
|
299
|
+
if (XEUtils.isString(selector)) {
|
|
300
|
+
return document.querySelector(selector);
|
|
301
|
+
}
|
|
326
302
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
303
|
+
return null;
|
|
304
|
+
};
|
|
305
|
+
const updateTipStyle = () => {
|
|
306
|
+
const { placement, defaultPlacement, appendTo, isArrow } = props;
|
|
307
|
+
const { tipTarget: targetElem, tipStore, tipPos, tipZindex } = reactData;
|
|
308
|
+
const panelElem = refElem.value;
|
|
309
|
+
if (!targetElem || !panelElem) {
|
|
310
|
+
return nextTick();
|
|
311
|
+
}
|
|
312
|
+
const targetRect = targetElem.getBoundingClientRect();
|
|
313
|
+
const targetWidth = targetElem.offsetWidth;
|
|
314
|
+
const targetHeight = targetElem.offsetHeight;
|
|
315
|
+
const panelWidth = panelElem.offsetWidth;
|
|
316
|
+
const targetLeft = targetRect.left;
|
|
317
|
+
const targetTop = targetRect.top;
|
|
318
|
+
let left = 0;
|
|
319
|
+
let top = 0;
|
|
320
|
+
if (tipPos && (tipPos.oLeft || tipPos.oTop)) {
|
|
321
|
+
left = targetLeft;
|
|
322
|
+
top = targetTop + targetHeight;
|
|
323
|
+
if (isArrow) {
|
|
324
|
+
left = left + Math.max(8, Math.min(targetWidth - 8, tipPos.oLeft)) - panelWidth / 2;
|
|
325
|
+
} else {
|
|
326
|
+
left = tipPos.x + 1;
|
|
327
|
+
top = tipPos.y + 1;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
const ppObj = updatePanelPlacement(targetElem, panelElem, {
|
|
331
|
+
defaultTop: top,
|
|
332
|
+
defaultLeft: left,
|
|
333
|
+
placement,
|
|
334
|
+
defaultPlacement,
|
|
335
|
+
appendTo,
|
|
336
|
+
isMinWidth: false,
|
|
337
|
+
teleportTo: true
|
|
361
338
|
});
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
return nextTick();
|
|
365
|
-
},
|
|
366
|
-
toVisible(target, content) {
|
|
367
|
-
return handleVisible(target, content);
|
|
368
|
-
},
|
|
369
|
-
updatePlacement() {
|
|
370
|
-
return updateTipStyle().then(() => {
|
|
371
|
-
return updateTipStyle();
|
|
372
|
-
}).then(() => {
|
|
373
|
-
return updateTipStyle();
|
|
339
|
+
const panelStyle = Object.assign(ppObj.style, {
|
|
340
|
+
zIndex: tipZindex
|
|
374
341
|
});
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
342
|
+
tipStore.placement = ppObj.placement;
|
|
343
|
+
tipStore.style = panelStyle;
|
|
344
|
+
tipStore.arrowStyle.left = ppObj.arrowLeft ? `${ppObj.arrowLeft}px` : "";
|
|
345
|
+
return nextTick();
|
|
346
|
+
};
|
|
347
|
+
const tooltipMethods = {
|
|
348
|
+
dispatchEvent,
|
|
349
|
+
openByEvent(evnt, target, content) {
|
|
350
|
+
return handleVisible(target || reactData.target || getSelectorEl(), content, evnt);
|
|
351
|
+
},
|
|
352
|
+
open(target, content) {
|
|
353
|
+
return handleVisible(target || reactData.target || getSelectorEl(), content);
|
|
354
|
+
},
|
|
355
|
+
close() {
|
|
356
|
+
reactData.tipPos = null;
|
|
357
|
+
reactData.tipTarget = null;
|
|
358
|
+
reactData.tipActive = false;
|
|
359
|
+
Object.assign(reactData.tipStore, {
|
|
360
|
+
style: {},
|
|
361
|
+
placement: "",
|
|
362
|
+
arrowStyle: null
|
|
363
|
+
});
|
|
364
|
+
updateValue(false);
|
|
365
|
+
dispatchEvent("hide", {}, null);
|
|
366
|
+
return nextTick();
|
|
367
|
+
},
|
|
368
|
+
toVisible(target, content) {
|
|
369
|
+
return handleVisible(target, content);
|
|
370
|
+
},
|
|
371
|
+
updatePlacement() {
|
|
372
|
+
return updateTipStyle().then(() => {
|
|
373
|
+
return updateTipStyle();
|
|
374
|
+
}).then(() => {
|
|
375
|
+
return updateTipStyle();
|
|
376
|
+
});
|
|
377
|
+
},
|
|
378
|
+
isActived() {
|
|
379
|
+
return reactData.tipActive;
|
|
380
|
+
},
|
|
381
|
+
setActived(active) {
|
|
382
|
+
reactData.tipActive = !!active;
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
const wheelEvent = (evnt) => {
|
|
386
|
+
evnt.stopPropagation();
|
|
387
|
+
};
|
|
388
|
+
const handleGlobalScrollEvent = () => {
|
|
389
|
+
if (reactData.visible) {
|
|
390
|
+
$xeTooltip.updatePlacement();
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
const handleGlobalBlurEvent = () => {
|
|
394
|
+
$xeTooltip.close();
|
|
395
|
+
};
|
|
396
|
+
const tooltipPrivateMethods = {
|
|
397
|
+
handleCloseEvent: targetMouseleaveEvent
|
|
398
|
+
};
|
|
399
|
+
Object.assign($xeTooltip, tooltipMethods, tooltipPrivateMethods);
|
|
400
|
+
const renderContent = () => {
|
|
401
|
+
const { theme, useHtml, useHTML } = props;
|
|
402
|
+
const { tipContent } = reactData;
|
|
403
|
+
const isVScrollbar = computeIsVScrollbar.value;
|
|
404
|
+
const wrapperStyle = computeWrapperStyle.value;
|
|
405
|
+
const contentSlot = slots.content;
|
|
406
|
+
const contVNs = [];
|
|
407
|
+
if (contentSlot) {
|
|
408
|
+
contVNs.push(
|
|
409
|
+
h(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
key: "ct"
|
|
413
|
+
},
|
|
414
|
+
getSlotVNs(contentSlot({}))
|
|
415
|
+
)
|
|
416
|
+
);
|
|
417
|
+
} else if (XEUtils.isBoolean(useHtml) ? useHtml : useHTML) {
|
|
418
|
+
contVNs.push(
|
|
419
|
+
h("div", {
|
|
420
|
+
key: "ch",
|
|
421
|
+
innerHTML: tipContent
|
|
422
|
+
})
|
|
423
|
+
);
|
|
424
|
+
} else {
|
|
425
|
+
contVNs.push(
|
|
426
|
+
h(
|
|
427
|
+
"span",
|
|
428
|
+
{
|
|
429
|
+
key: "cd"
|
|
430
|
+
},
|
|
431
|
+
`${tipContent}`
|
|
432
|
+
)
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
if (isVScrollbar) {
|
|
436
|
+
return h(
|
|
437
|
+
VxeScrollbarComponent,
|
|
409
438
|
{
|
|
410
|
-
key:
|
|
439
|
+
key: 5,
|
|
440
|
+
ref: contentScrollbar,
|
|
441
|
+
class: "vxe-tooltip--scrollbar-content",
|
|
442
|
+
theme,
|
|
443
|
+
viewClassName: "vxe-tooltip--scrollbar-content-view",
|
|
444
|
+
viewInnerClassName: "vxe-tooltip--scrollbar-content-inner",
|
|
445
|
+
viewStyle: wrapperStyle
|
|
411
446
|
},
|
|
412
|
-
getSlotVNs(contentSlot({}))
|
|
413
|
-
)
|
|
414
|
-
);
|
|
415
|
-
} else if (XEUtils.isBoolean(useHtml) ? useHtml : useHTML) {
|
|
416
|
-
contVNs.push(
|
|
417
|
-
h("div", {
|
|
418
|
-
key: "ch",
|
|
419
|
-
innerHTML: tipContent
|
|
420
|
-
})
|
|
421
|
-
);
|
|
422
|
-
} else {
|
|
423
|
-
contVNs.push(
|
|
424
|
-
h(
|
|
425
|
-
"span",
|
|
426
447
|
{
|
|
427
|
-
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
);
|
|
432
|
-
}
|
|
433
|
-
if (isVScrollbar) {
|
|
448
|
+
default: () => contVNs
|
|
449
|
+
}
|
|
450
|
+
);
|
|
451
|
+
}
|
|
434
452
|
return h(
|
|
435
|
-
|
|
453
|
+
"div",
|
|
436
454
|
{
|
|
437
|
-
key:
|
|
438
|
-
ref:
|
|
439
|
-
class: "vxe-tooltip--
|
|
440
|
-
|
|
441
|
-
viewClassName: "vxe-tooltip--scrollbar-content-view",
|
|
442
|
-
viewInnerClassName: "vxe-tooltip--scrollbar-content-inner",
|
|
443
|
-
viewStyle: wrapperStyle
|
|
455
|
+
key: 3,
|
|
456
|
+
ref: contentWrapperElem,
|
|
457
|
+
class: "vxe-tooltip--content",
|
|
458
|
+
style: wrapperStyle
|
|
444
459
|
},
|
|
460
|
+
contVNs
|
|
461
|
+
);
|
|
462
|
+
};
|
|
463
|
+
const renderVN = () => {
|
|
464
|
+
const { popupClassName, theme, isArrow, enterable } = props;
|
|
465
|
+
const { tipActive, visible, tipStore } = reactData;
|
|
466
|
+
const defaultSlot = slots.default;
|
|
467
|
+
const vSize = computeSize.value;
|
|
468
|
+
let ons;
|
|
469
|
+
if (enterable) {
|
|
470
|
+
ons = {
|
|
471
|
+
onMouseenter: wrapperMouseenterEvent,
|
|
472
|
+
onMouseleave: wrapperMouseleaveEvent
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
return h(
|
|
476
|
+
"div",
|
|
445
477
|
{
|
|
446
|
-
|
|
447
|
-
|
|
478
|
+
ref: refElem,
|
|
479
|
+
class: [
|
|
480
|
+
"vxe-tooltip--wrapper",
|
|
481
|
+
`theme--${theme}`,
|
|
482
|
+
popupClassName ? XEUtils.isFunction(popupClassName) ? popupClassName({ $tooltip: $xeTooltip }) : popupClassName : "",
|
|
483
|
+
{
|
|
484
|
+
[`size--${vSize}`]: vSize,
|
|
485
|
+
[`placement--${tipStore.placement}`]: tipStore.placement,
|
|
486
|
+
"is--enterable": enterable,
|
|
487
|
+
"is--visible": visible,
|
|
488
|
+
"is--arrow": isArrow,
|
|
489
|
+
"is--active": tipActive
|
|
490
|
+
}
|
|
491
|
+
],
|
|
492
|
+
style: tipStore.style,
|
|
493
|
+
...ons
|
|
494
|
+
},
|
|
495
|
+
[
|
|
496
|
+
h(
|
|
497
|
+
"div",
|
|
498
|
+
{
|
|
499
|
+
key: "tby",
|
|
500
|
+
class: "vxe-tooltip--body"
|
|
501
|
+
},
|
|
502
|
+
[
|
|
503
|
+
renderContent(),
|
|
504
|
+
h("div", {
|
|
505
|
+
class: "vxe-tooltip--arrow",
|
|
506
|
+
style: tipStore.arrowStyle
|
|
507
|
+
})
|
|
508
|
+
]
|
|
509
|
+
),
|
|
510
|
+
...defaultSlot ? getSlotVNs(defaultSlot({})) : []
|
|
511
|
+
]
|
|
448
512
|
);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
{
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
class: "vxe-tooltip--content",
|
|
456
|
-
style: wrapperStyle
|
|
457
|
-
},
|
|
458
|
-
contVNs
|
|
513
|
+
};
|
|
514
|
+
watch(
|
|
515
|
+
() => props.enterDelay,
|
|
516
|
+
() => {
|
|
517
|
+
handleDelayFn();
|
|
518
|
+
}
|
|
459
519
|
);
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
"div",
|
|
475
|
-
{
|
|
476
|
-
ref: refElem,
|
|
477
|
-
class: [
|
|
478
|
-
"vxe-tooltip--wrapper",
|
|
479
|
-
`theme--${theme}`,
|
|
480
|
-
popupClassName ? XEUtils.isFunction(popupClassName) ? popupClassName({ $tooltip: $xeTooltip }) : popupClassName : "",
|
|
481
|
-
{
|
|
482
|
-
[`size--${vSize}`]: vSize,
|
|
483
|
-
[`placement--${tipStore.placement}`]: tipStore.placement,
|
|
484
|
-
"is--enterable": enterable,
|
|
485
|
-
"is--visible": visible,
|
|
486
|
-
"is--arrow": isArrow,
|
|
487
|
-
"is--active": tipActive
|
|
520
|
+
watch(
|
|
521
|
+
() => props.content,
|
|
522
|
+
(val) => {
|
|
523
|
+
reactData.tipContent = val;
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
watch(
|
|
527
|
+
() => props.modelValue,
|
|
528
|
+
(val) => {
|
|
529
|
+
if (!reactData.isUpdate) {
|
|
530
|
+
if (val) {
|
|
531
|
+
handleVisible(reactData.target || getSelectorEl(), props.content);
|
|
532
|
+
} else {
|
|
533
|
+
$xeTooltip.close();
|
|
488
534
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
},
|
|
493
|
-
[
|
|
494
|
-
h(
|
|
495
|
-
"div",
|
|
496
|
-
{
|
|
497
|
-
key: "tby",
|
|
498
|
-
class: "vxe-tooltip--body"
|
|
499
|
-
},
|
|
500
|
-
[
|
|
501
|
-
renderContent(),
|
|
502
|
-
h("div", {
|
|
503
|
-
class: "vxe-tooltip--arrow",
|
|
504
|
-
style: tipStore.arrowStyle
|
|
505
|
-
})
|
|
506
|
-
]
|
|
507
|
-
),
|
|
508
|
-
...defaultSlot ? getSlotVNs(defaultSlot({})) : []
|
|
509
|
-
]
|
|
535
|
+
}
|
|
536
|
+
reactData.isUpdate = false;
|
|
537
|
+
}
|
|
510
538
|
);
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
() => props.content,
|
|
520
|
-
(val) => {
|
|
521
|
-
reactData.tipContent = val;
|
|
522
|
-
}
|
|
523
|
-
);
|
|
524
|
-
watch(
|
|
525
|
-
() => props.modelValue,
|
|
526
|
-
(val) => {
|
|
527
|
-
if (!reactData.isUpdate) {
|
|
528
|
-
if (val) {
|
|
529
|
-
handleVisible(reactData.target || getSelectorEl(), props.content);
|
|
530
|
-
} else {
|
|
531
|
-
$xeTooltip.close();
|
|
539
|
+
handleDelayFn();
|
|
540
|
+
onMounted(() => {
|
|
541
|
+
const $scrollbar = contentScrollbar.value;
|
|
542
|
+
if ($scrollbar) {
|
|
543
|
+
const viewEl = $scrollbar.getScrollViewElem();
|
|
544
|
+
if (viewEl) {
|
|
545
|
+
viewEl.addEventListener("wheel", wheelEvent, { passive: false });
|
|
546
|
+
internalData.scrollbarViewEl = viewEl;
|
|
532
547
|
}
|
|
533
548
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
handleDelayFn();
|
|
538
|
-
onMounted(() => {
|
|
539
|
-
const $scrollbar = contentScrollbar.value;
|
|
540
|
-
if ($scrollbar) {
|
|
541
|
-
const viewEl = $scrollbar.getScrollViewElem();
|
|
542
|
-
if (viewEl) {
|
|
543
|
-
viewEl.addEventListener("wheel", wheelEvent, { passive: false });
|
|
544
|
-
internalData.scrollbarViewEl = viewEl;
|
|
549
|
+
const contentWrapperfEl = contentWrapperElem.value;
|
|
550
|
+
if (contentWrapperfEl) {
|
|
551
|
+
contentWrapperfEl.addEventListener("wheel", wheelEvent, { passive: false });
|
|
545
552
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
+
nextTick(() => {
|
|
554
|
+
const { trigger, content } = props;
|
|
555
|
+
const panelElem = refElem.value;
|
|
556
|
+
if (panelElem) {
|
|
557
|
+
const parentNode = panelElem.parentNode;
|
|
558
|
+
if (parentNode) {
|
|
559
|
+
reactData.tipContent = content;
|
|
560
|
+
reactData.tipZindex = nextZIndex();
|
|
561
|
+
XEUtils.arrayEach(panelElem.children, (elem, index) => {
|
|
562
|
+
if (index) {
|
|
563
|
+
parentNode.insertBefore(elem, panelElem);
|
|
564
|
+
if (!reactData.target) {
|
|
565
|
+
reactData.target = elem;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
parentNode.removeChild(panelElem);
|
|
570
|
+
const { target } = reactData;
|
|
571
|
+
if (target) {
|
|
572
|
+
if (trigger === "hover") {
|
|
573
|
+
target.onmouseenter = targetMouseenterEvent;
|
|
574
|
+
target.onmouseleave = targetMouseleaveEvent;
|
|
575
|
+
} else if (trigger === "click") {
|
|
576
|
+
target.onclick = clickEvent;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
if (props.modelValue) {
|
|
580
|
+
handleVisible(target || getSelectorEl(), content);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
globalEvents.on($xeTooltip, "blur", handleGlobalBlurEvent);
|
|
586
|
+
globalEvents.on($xeTooltip, "scroll", handleGlobalScrollEvent);
|
|
587
|
+
});
|
|
588
|
+
onBeforeUnmount(() => {
|
|
589
|
+
const { target } = reactData;
|
|
590
|
+
const { scrollbarViewEl } = internalData;
|
|
553
591
|
const panelElem = refElem.value;
|
|
592
|
+
if (target) {
|
|
593
|
+
target.onmouseenter = null;
|
|
594
|
+
target.onmouseleave = null;
|
|
595
|
+
target.onclick = null;
|
|
596
|
+
}
|
|
597
|
+
const contentWrapperfEl = contentWrapperElem.value;
|
|
598
|
+
if (contentWrapperfEl) {
|
|
599
|
+
contentWrapperfEl.removeEventListener("wheel", wheelEvent);
|
|
600
|
+
}
|
|
601
|
+
if (scrollbarViewEl) {
|
|
602
|
+
scrollbarViewEl.removeEventListener("wheel", wheelEvent);
|
|
603
|
+
}
|
|
554
604
|
if (panelElem) {
|
|
555
605
|
const parentNode = panelElem.parentNode;
|
|
556
606
|
if (parentNode) {
|
|
557
|
-
reactData.tipContent = content;
|
|
558
|
-
reactData.tipZindex = nextZIndex();
|
|
559
|
-
XEUtils.arrayEach(panelElem.children, (elem, index) => {
|
|
560
|
-
if (index) {
|
|
561
|
-
parentNode.insertBefore(elem, panelElem);
|
|
562
|
-
if (!reactData.target) {
|
|
563
|
-
reactData.target = elem;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
607
|
parentNode.removeChild(panelElem);
|
|
568
|
-
const { target } = reactData;
|
|
569
|
-
if (target) {
|
|
570
|
-
if (trigger === "hover") {
|
|
571
|
-
target.onmouseenter = targetMouseenterEvent;
|
|
572
|
-
target.onmouseleave = targetMouseleaveEvent;
|
|
573
|
-
} else if (trigger === "click") {
|
|
574
|
-
target.onclick = clickEvent;
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
if (props.modelValue) {
|
|
578
|
-
handleVisible(target || getSelectorEl(), content);
|
|
579
|
-
}
|
|
580
608
|
}
|
|
581
609
|
}
|
|
610
|
+
globalEvents.off($xeTooltip, "blur");
|
|
611
|
+
globalEvents.off($xeTooltip, "scroll");
|
|
612
|
+
XEUtils.assign(reactData, createReactData());
|
|
613
|
+
XEUtils.assign(internalData, createInternalData());
|
|
582
614
|
});
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
target.onmouseenter = null;
|
|
592
|
-
target.onmouseleave = null;
|
|
593
|
-
target.onclick = null;
|
|
594
|
-
}
|
|
595
|
-
const contentWrapperfEl = contentWrapperElem.value;
|
|
596
|
-
if (contentWrapperfEl) {
|
|
597
|
-
contentWrapperfEl.removeEventListener("wheel", wheelEvent);
|
|
598
|
-
}
|
|
599
|
-
if (scrollbarViewEl) {
|
|
600
|
-
scrollbarViewEl.removeEventListener("wheel", wheelEvent);
|
|
601
|
-
}
|
|
602
|
-
if (panelElem) {
|
|
603
|
-
const parentNode = panelElem.parentNode;
|
|
604
|
-
if (parentNode) {
|
|
605
|
-
parentNode.removeChild(panelElem);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
globalEvents.off($xeTooltip, "blur");
|
|
609
|
-
globalEvents.off($xeTooltip, "scroll");
|
|
610
|
-
XEUtils.assign(reactData, createReactData());
|
|
611
|
-
XEUtils.assign(internalData, createInternalData());
|
|
612
|
-
});
|
|
613
|
-
$xeTooltip.renderVN = renderVN;
|
|
614
|
-
return $xeTooltip;
|
|
615
|
-
},
|
|
616
|
-
render() {
|
|
617
|
-
return this.renderVN();
|
|
618
|
-
}
|
|
619
|
-
});
|
|
615
|
+
$xeTooltip.renderVN = renderVN;
|
|
616
|
+
return $xeTooltip;
|
|
617
|
+
},
|
|
618
|
+
render() {
|
|
619
|
+
return this.renderVN();
|
|
620
|
+
}
|
|
621
|
+
})
|
|
622
|
+
);
|
|
620
623
|
export {
|
|
621
624
|
tooltip_default as default
|
|
622
625
|
};
|