vxe-pc-ui 4.10.42 → 4.10.44
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/es/icon/style.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tooltip/src/tooltip.js +96 -28
- package/es/tooltip/style.css +16 -6
- package/es/tooltip/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-tooltip/style.css +16 -6
- package/es/vxe-tooltip/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +92 -35
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tooltip/src/tooltip.js +90 -33
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +16 -6
- package/lib/tooltip/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-tooltip/style/style.css +16 -6
- package/lib/vxe-tooltip/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/tooltip/src/tooltip.ts +95 -28
- package/styles/components/tooltip.scss +21 -8
- package/types/components/gantt-module/gantt-view.d.ts +2 -1
- package/types/components/gantt.d.ts +88 -6
- package/types/components/grid.d.ts +1 -0
- package/types/components/tooltip.d.ts +11 -3
- /package/es/icon/{iconfont.1764811574696.ttf → iconfont.1765012543889.ttf} +0 -0
- /package/es/icon/{iconfont.1764811574696.woff → iconfont.1765012543889.woff} +0 -0
- /package/es/icon/{iconfont.1764811574696.woff2 → iconfont.1765012543889.woff2} +0 -0
- /package/es/{iconfont.1764811574696.ttf → iconfont.1765012543889.ttf} +0 -0
- /package/es/{iconfont.1764811574696.woff → iconfont.1765012543889.woff} +0 -0
- /package/es/{iconfont.1764811574696.woff2 → iconfont.1765012543889.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1764811574696.ttf → iconfont.1765012543889.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1764811574696.woff → iconfont.1765012543889.woff} +0 -0
- /package/lib/icon/style/{iconfont.1764811574696.woff2 → iconfont.1765012543889.woff2} +0 -0
- /package/lib/{iconfont.1764811574696.ttf → iconfont.1765012543889.ttf} +0 -0
- /package/lib/{iconfont.1764811574696.woff → iconfont.1765012543889.woff} +0 -0
- /package/lib/{iconfont.1764811574696.woff2 → iconfont.1765012543889.woff2} +0 -0
|
@@ -3,7 +3,7 @@ import { defineVxeComponent } from '../../ui/src/comp'
|
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { getConfig, createEvent, useSize } from '../../ui'
|
|
5
5
|
import { getLastZIndex, nextZIndex } from '../../ui/src/utils'
|
|
6
|
-
import {
|
|
6
|
+
import { toCssUnit } from '../../ui/src/dom'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
9
9
|
import type { VxeTooltipPropTypes, VxeTooltipConstructor, VxeTooltipEmits, TooltipInternalData, TooltipReactData, TooltipMethods, TooltipPrivateRef, VxeComponentStyleType } from '../../../types'
|
|
@@ -87,6 +87,7 @@ export default defineVxeComponent({
|
|
|
87
87
|
target: null,
|
|
88
88
|
isUpdate: false,
|
|
89
89
|
visible: false,
|
|
90
|
+
tipPos: null,
|
|
90
91
|
tipContent: '',
|
|
91
92
|
tipActive: false,
|
|
92
93
|
tipTarget: null,
|
|
@@ -144,30 +145,74 @@ export default defineVxeComponent({
|
|
|
144
145
|
let tooltipMethods = {} as TooltipMethods
|
|
145
146
|
|
|
146
147
|
const updateTipStyle = () => {
|
|
147
|
-
const {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
const { isArrow } = props
|
|
149
|
+
const { tipTarget: targetElem, tipStore, tipPos } = reactData
|
|
150
|
+
let top: number | '' = ''
|
|
151
|
+
let left: number | '' = ''
|
|
152
|
+
let panelPlacement: 'top' | 'bottom' = 'bottom'
|
|
153
|
+
let arrowLeft: number | '' = ''
|
|
154
|
+
const panelElem = refElem.value
|
|
155
|
+
if (panelElem && targetElem) {
|
|
156
|
+
const documentElement = document.documentElement
|
|
157
|
+
const bodyElem = document.body
|
|
158
|
+
const targetWidth = targetElem.offsetWidth
|
|
159
|
+
const targetHeight = targetElem.offsetHeight
|
|
160
|
+
const panelHeight = panelElem.offsetHeight
|
|
161
|
+
const panelWidth = panelElem.offsetWidth
|
|
162
|
+
|
|
163
|
+
const targetRect = targetElem.getBoundingClientRect()
|
|
164
|
+
const visibleHeight = documentElement.clientHeight || bodyElem.clientHeight
|
|
165
|
+
const visibleWidth = documentElement.clientWidth || bodyElem.clientWidth
|
|
166
|
+
|
|
155
167
|
const marginSize = 6
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
168
|
+
top = targetRect.top + targetHeight
|
|
169
|
+
left = targetRect.left
|
|
170
|
+
if (tipPos && (tipPos.x && tipPos.y)) {
|
|
171
|
+
if (isArrow) {
|
|
172
|
+
left = left + Math.max(8, Math.min(targetWidth - 8, tipPos.oLeft)) - panelWidth / 2
|
|
173
|
+
} else {
|
|
174
|
+
left = tipPos.x + 1
|
|
175
|
+
top = tipPos.y + 1
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
left = targetRect.left + (targetWidth - panelWidth) / 2
|
|
179
|
+
}
|
|
180
|
+
// 如果下面不够放,则向上
|
|
181
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
182
|
+
panelPlacement = 'top'
|
|
183
|
+
top = targetRect.top - panelHeight
|
|
163
184
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
185
|
+
// 如果上面不够放,则向下(优先)
|
|
186
|
+
if (top < marginSize) {
|
|
187
|
+
panelPlacement = 'bottom'
|
|
188
|
+
top = targetRect.top + targetHeight
|
|
167
189
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
190
|
+
// 如果溢出右边
|
|
191
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
192
|
+
left -= left + panelWidth + marginSize - visibleWidth
|
|
193
|
+
}
|
|
194
|
+
// 如果溢出左边
|
|
195
|
+
if (left < marginSize) {
|
|
196
|
+
left = marginSize
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// 箭头
|
|
200
|
+
if (left === targetRect.left) {
|
|
201
|
+
if (targetWidth <= panelWidth) {
|
|
202
|
+
arrowLeft = targetWidth / 2
|
|
203
|
+
}
|
|
204
|
+
} else if (left < targetRect.left) {
|
|
205
|
+
if (left + panelWidth > targetRect.left + targetWidth) {
|
|
206
|
+
arrowLeft = (targetRect.left - left) + targetWidth / 2
|
|
207
|
+
} else {
|
|
208
|
+
arrowLeft = (targetRect.left - left) + (panelWidth - (targetRect.left - left)) / 2
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
tipStore.placement = panelPlacement
|
|
213
|
+
tipStore.style.top = `${top}px`
|
|
214
|
+
tipStore.style.left = `${left}px`
|
|
215
|
+
tipStore.arrowStyle.left = `${arrowLeft}px`
|
|
171
216
|
}
|
|
172
217
|
}
|
|
173
218
|
|
|
@@ -252,7 +297,7 @@ export default defineVxeComponent({
|
|
|
252
297
|
}, props.enterDelay, { leading: false, trailing: true })
|
|
253
298
|
}
|
|
254
299
|
|
|
255
|
-
const handleVisible = (target: HTMLElement | null, content?: VxeTooltipPropTypes.Content) => {
|
|
300
|
+
const handleVisible = (target: HTMLElement | null, content?: VxeTooltipPropTypes.Content, evnt?: MouseEvent) => {
|
|
256
301
|
const contentSlot = slots.content
|
|
257
302
|
if (!contentSlot && (content === '' || XEUtils.eqNull(content))) {
|
|
258
303
|
return nextTick()
|
|
@@ -260,9 +305,22 @@ export default defineVxeComponent({
|
|
|
260
305
|
if (target) {
|
|
261
306
|
const { showDelayTip } = internalData
|
|
262
307
|
const { trigger, enterDelay } = props
|
|
308
|
+
if (evnt) {
|
|
309
|
+
reactData.tipPos = {
|
|
310
|
+
x: evnt.clientX,
|
|
311
|
+
y: evnt.clientY,
|
|
312
|
+
oLeft: evnt.offsetX,
|
|
313
|
+
oTop: evnt.offsetY
|
|
314
|
+
}
|
|
315
|
+
} else {
|
|
316
|
+
reactData.tipPos = null
|
|
317
|
+
}
|
|
263
318
|
reactData.tipActive = true
|
|
264
319
|
reactData.tipTarget = target
|
|
265
320
|
reactData.tipContent = content
|
|
321
|
+
if (reactData.visible) {
|
|
322
|
+
return $xeTooltip.updatePlacement()
|
|
323
|
+
}
|
|
266
324
|
if (enterDelay && trigger === 'hover') {
|
|
267
325
|
if (showDelayTip) {
|
|
268
326
|
showDelayTip()
|
|
@@ -291,10 +349,14 @@ export default defineVxeComponent({
|
|
|
291
349
|
dispatchEvent (type, params, evnt) {
|
|
292
350
|
emit(type, createEvent(evnt, { $tooltip: $xeTooltip }, params))
|
|
293
351
|
},
|
|
352
|
+
openByEvent (evnt: Event, target?: HTMLElement | null, content?: VxeTooltipPropTypes.Content) {
|
|
353
|
+
return handleVisible(target || reactData.target as HTMLElement || getSelectorEl(), content, evnt as MouseEvent)
|
|
354
|
+
},
|
|
294
355
|
open (target?: HTMLElement | null, content?: VxeTooltipPropTypes.Content) {
|
|
295
356
|
return handleVisible(target || reactData.target as HTMLElement || getSelectorEl(), content)
|
|
296
357
|
},
|
|
297
358
|
close () {
|
|
359
|
+
reactData.tipPos = null
|
|
298
360
|
reactData.tipTarget = null
|
|
299
361
|
reactData.tipActive = false
|
|
300
362
|
Object.assign(reactData.tipStore, {
|
|
@@ -391,11 +453,16 @@ export default defineVxeComponent({
|
|
|
391
453
|
style: tipStore.style,
|
|
392
454
|
...ons
|
|
393
455
|
}, [
|
|
394
|
-
renderContent(),
|
|
395
456
|
h('div', {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
457
|
+
key: 'tby',
|
|
458
|
+
class: 'vxe-tooltip--body'
|
|
459
|
+
}, [
|
|
460
|
+
renderContent(),
|
|
461
|
+
h('div', {
|
|
462
|
+
class: 'vxe-tooltip--arrow',
|
|
463
|
+
style: tipStore.arrowStyle
|
|
464
|
+
})
|
|
465
|
+
]),
|
|
399
466
|
...(defaultSlot ? getSlotVNs(defaultSlot({})) : [])
|
|
400
467
|
])
|
|
401
468
|
}
|
|
@@ -433,7 +500,7 @@ export default defineVxeComponent({
|
|
|
433
500
|
reactData.tipContent = content
|
|
434
501
|
reactData.tipZindex = nextZIndex()
|
|
435
502
|
XEUtils.arrayEach(wrapperElem.children, (elem, index) => {
|
|
436
|
-
if (index
|
|
503
|
+
if (index) {
|
|
437
504
|
parentNode.insertBefore(elem, wrapperElem)
|
|
438
505
|
if (!reactData.target) {
|
|
439
506
|
reactData.target = elem as HTMLElement
|
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
top: -100%;
|
|
5
5
|
left: -100%;
|
|
6
6
|
font-size: 12px;
|
|
7
|
-
border-radius: var(--vxe-ui-base-border-radius);
|
|
8
|
-
white-space: normal;
|
|
9
|
-
word-break: break-word;
|
|
10
|
-
box-shadow: 2px 2px 4px -2px rgba(0,0,0,.2);
|
|
11
7
|
color: var(--vxe-ui-font-color);
|
|
12
8
|
font-family: var(--vxe-ui-font-family);
|
|
13
9
|
&:not(.is--enterable) {
|
|
@@ -57,6 +53,9 @@
|
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
55
|
&.placement--top {
|
|
56
|
+
&.is--arrow {
|
|
57
|
+
padding-bottom: 6px;
|
|
58
|
+
}
|
|
60
59
|
&.is--enterable {
|
|
61
60
|
&:after {
|
|
62
61
|
bottom: -6px;
|
|
@@ -70,6 +69,9 @@
|
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
&.placement--bottom {
|
|
72
|
+
&.is--arrow {
|
|
73
|
+
padding-top: 6px;
|
|
74
|
+
}
|
|
73
75
|
&.is--enterable {
|
|
74
76
|
&:after {
|
|
75
77
|
top: -6px;
|
|
@@ -83,10 +85,19 @@
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
}
|
|
88
|
+
.vxe-tooltip--body {
|
|
89
|
+
position: relative;
|
|
90
|
+
border-radius: var(--vxe-ui-base-border-radius);
|
|
91
|
+
white-space: normal;
|
|
92
|
+
word-break: break-word;
|
|
93
|
+
box-shadow: 2px 2px 4px -2px rgba(0,0,0,.2);
|
|
94
|
+
}
|
|
86
95
|
.vxe-tooltip--wrapper {
|
|
87
96
|
&.theme--light {
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
.vxe-tooltip--body {
|
|
98
|
+
background-color: var(--vxe-ui-layout-background-color);
|
|
99
|
+
border: 1px solid var(--vxe-ui-input-border-color);
|
|
100
|
+
}
|
|
90
101
|
&.placement--top {
|
|
91
102
|
.vxe-tooltip--arrow {
|
|
92
103
|
border-top-color: var(--vxe-ui-input-border-color);
|
|
@@ -105,8 +116,10 @@
|
|
|
105
116
|
}
|
|
106
117
|
}
|
|
107
118
|
&.theme--dark {
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
.vxe-tooltip--body {
|
|
120
|
+
background: var(--vxe-ui-tooltip-dark-background-color);
|
|
121
|
+
color: var(--vxe-ui-tooltip-dark-color);
|
|
122
|
+
}
|
|
110
123
|
&.placement--top {
|
|
111
124
|
.vxe-tooltip--arrow {
|
|
112
125
|
border-top-color: var(--vxe-ui-tooltip-dark-background-color);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderFunction, SetupContext, Ref } from 'vue'
|
|
1
|
+
import { RenderFunction, SetupContext, Ref, ComputedRef } from 'vue'
|
|
2
2
|
import { VxeComponentBaseOptions, DefineVxeComponentInstance } from '@vxe-ui/core'
|
|
3
3
|
import { VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from '../table'
|
|
4
4
|
import { VxeGanttDefines } from '../gantt'
|
|
@@ -109,6 +109,7 @@ export interface GanttViewPrivateRef {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export interface GanttViewPrivateComputed {
|
|
112
|
+
computeScaleDateList: ComputedRef<Date[]>
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
export interface VxeGanttViewPrivateMethods {
|
|
@@ -2,6 +2,7 @@ import { RenderFunction, SetupContext, ComputedRef, Ref } from 'vue'
|
|
|
2
2
|
import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentBaseOptions, VxeComponentEventParams, ValueOf, VxeComponentSlotType, VxeComponentAlignType } from '@vxe-ui/core'
|
|
3
3
|
import { GridPrivateRef, VxeGridProps, VxeGridPropTypes, GridPrivateComputed, GridReactData, GridInternalData, GridMethods, GridPrivateMethods, VxeGridEmits, VxeGridSlots, VxeGridListeners, VxeGridEventProps, VxeGridMethods } from './grid'
|
|
4
4
|
import { VxeTablePropTypes } from './table'
|
|
5
|
+
import { VxeTooltipPropTypes } from './tooltip'
|
|
5
6
|
|
|
6
7
|
/* eslint-disable no-use-before-define,@typescript-eslint/ban-types */
|
|
7
8
|
|
|
@@ -61,10 +62,6 @@ export namespace VxeGanttPropTypes {
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
export interface TaskViewScaleConfig {
|
|
64
|
-
/**
|
|
65
|
-
* 日期轴渲染单位,默认是按天 date
|
|
66
|
-
*/
|
|
67
|
-
scaleUnit?: 'year' | 'quarter' | 'month' | 'week' | 'date' | 'hour' | 'minute' | 'second'
|
|
68
65
|
/**
|
|
69
66
|
* 年配置
|
|
70
67
|
*/
|
|
@@ -233,6 +230,10 @@ export namespace VxeGanttPropTypes {
|
|
|
233
230
|
* 是否在任务条显示内容
|
|
234
231
|
*/
|
|
235
232
|
showContent?: boolean
|
|
233
|
+
/**
|
|
234
|
+
* 是否在任务条显示提示信息
|
|
235
|
+
*/
|
|
236
|
+
showTooltip?: boolean
|
|
236
237
|
/**
|
|
237
238
|
* 自定义任务条内容方法
|
|
238
239
|
*/
|
|
@@ -257,6 +258,28 @@ export namespace VxeGanttPropTypes {
|
|
|
257
258
|
*/
|
|
258
259
|
resize?: boolean
|
|
259
260
|
}
|
|
261
|
+
|
|
262
|
+
export interface TaskBarTooltipConfig<D = any> {
|
|
263
|
+
theme?: VxeTooltipPropTypes.Theme
|
|
264
|
+
enterable?: VxeTooltipPropTypes.Enterable
|
|
265
|
+
enterDelay?: VxeTooltipPropTypes.EnterDelay
|
|
266
|
+
leaveDelay?: VxeTooltipPropTypes.LeaveDelay
|
|
267
|
+
width?: VxeTooltipPropTypes.Width
|
|
268
|
+
height?: VxeTooltipPropTypes.Height
|
|
269
|
+
minWidth?: VxeTooltipPropTypes.MinWidth
|
|
270
|
+
minHeight?: VxeTooltipPropTypes.MinHeight
|
|
271
|
+
maxWidth?: VxeTooltipPropTypes.MaxWidth
|
|
272
|
+
maxHeight?: VxeTooltipPropTypes.MaxHeight
|
|
273
|
+
useHTML?: VxeTooltipPropTypes.UseHTML
|
|
274
|
+
contentMethod?(params: {
|
|
275
|
+
$gantt: VxeGanttConstructor<D>
|
|
276
|
+
row: D
|
|
277
|
+
rowIndex: number
|
|
278
|
+
$rowIndex: number
|
|
279
|
+
_rowIndex: number
|
|
280
|
+
}): string | null | void
|
|
281
|
+
}
|
|
282
|
+
|
|
260
283
|
export interface TaskBarResizeConfig<D = any> {
|
|
261
284
|
/**
|
|
262
285
|
* 是否允许拖拽调整任务条起始日期
|
|
@@ -281,6 +304,7 @@ export namespace VxeGanttPropTypes {
|
|
|
281
304
|
row: D
|
|
282
305
|
}): Promise<boolean> | boolean
|
|
283
306
|
}
|
|
307
|
+
|
|
284
308
|
export interface TaskBarDragConfig<D = any> {
|
|
285
309
|
/**
|
|
286
310
|
* 拖拽开始时是否允许行拖拽移动任务条日期的方法,该方法的返回值用来决定是否允许被拖拽
|
|
@@ -306,6 +330,7 @@ export interface VxeGanttProps<D = any> extends Omit<VxeGridProps<D>, 'layouts'>
|
|
|
306
330
|
taskViewConfig?: VxeGanttPropTypes.TaskViewConfig<D>
|
|
307
331
|
taskSplitConfig?: VxeGanttPropTypes.TaskSplitConfig
|
|
308
332
|
taskBarConfig?: VxeGanttPropTypes.TaskBarConfig<D>
|
|
333
|
+
taskBarTooltipConfig?: VxeGanttPropTypes.TaskBarTooltipConfig<D>
|
|
309
334
|
taskBarResizeConfig?: VxeGanttPropTypes.TaskBarResizeConfig<D>
|
|
310
335
|
taskBarDragConfig?: VxeGanttPropTypes.TaskBarDragConfig<D>
|
|
311
336
|
}
|
|
@@ -318,7 +343,11 @@ export interface GanttPrivateComputed<D = any> extends GridPrivateComputed<D> {
|
|
|
318
343
|
computeTaskBarDragOpts: ComputedRef<VxeGanttPropTypes.TaskBarDragConfig<D>>
|
|
319
344
|
computeTaskBarResizeOpts: ComputedRef<VxeGanttPropTypes.TaskBarResizeConfig<D>>
|
|
320
345
|
computeTaskSplitOpts: ComputedRef<VxeGanttPropTypes.TaskSplitConfig>
|
|
321
|
-
|
|
346
|
+
computeTaskBarTooltipOpts: ComputedRef<VxeGanttPropTypes.TaskBarTooltipConfig>
|
|
347
|
+
computeTaskViewScales: ComputedRef<VxeGanttDefines.ColumnScaleType[] | VxeGanttDefines.ColumnScaleConfig[] | undefined>
|
|
348
|
+
computeScaleUnit: ComputedRef<VxeGanttDefines.ColumnScaleType>
|
|
349
|
+
computeMinScale: ComputedRef<VxeGanttDefines.ColumnScaleObj>
|
|
350
|
+
computeWeekScale: ComputedRef<VxeGanttDefines.ColumnScaleObj | null | undefined>
|
|
322
351
|
computeTitleField: ComputedRef<string>
|
|
323
352
|
computeStartField: ComputedRef<string>
|
|
324
353
|
computeEndField: ComputedRef<string>
|
|
@@ -333,10 +362,24 @@ export interface GanttReactData<D = any> extends GridReactData<D> {
|
|
|
333
362
|
showLeftView: boolean
|
|
334
363
|
showRightView: boolean
|
|
335
364
|
taskScaleList: VxeGanttDefines.ColumnScaleObj[]
|
|
365
|
+
|
|
366
|
+
// 存放 bar tooltip 相关信息
|
|
367
|
+
barTipStore: {
|
|
368
|
+
row: D | null
|
|
369
|
+
content: string
|
|
370
|
+
visible: boolean
|
|
371
|
+
params?: null | {
|
|
372
|
+
row: D | null
|
|
373
|
+
rowIndex: number
|
|
374
|
+
$rowIndex: number
|
|
375
|
+
_rowIndex: number
|
|
376
|
+
}
|
|
377
|
+
}
|
|
336
378
|
}
|
|
337
379
|
|
|
338
380
|
export interface GanttInternalData extends GridInternalData {
|
|
339
381
|
resizeTableWidth: number
|
|
382
|
+
barTipTimeout?: any
|
|
340
383
|
}
|
|
341
384
|
|
|
342
385
|
export interface GanttMethods<D = any> extends Omit<GridMethods<D>, 'dispatchEvent'> {
|
|
@@ -370,6 +413,10 @@ export interface GanttMethods<D = any> extends Omit<GridMethods<D>, 'dispatchEve
|
|
|
370
413
|
* 隐藏任务视图
|
|
371
414
|
*/
|
|
372
415
|
hideTaskView(): Promise<void>
|
|
416
|
+
/**
|
|
417
|
+
* 手动关闭任务条提示
|
|
418
|
+
*/
|
|
419
|
+
closeTaskBarTooltip(): Promise<void>
|
|
373
420
|
}
|
|
374
421
|
export interface VxeGanttMethods<D = any> extends GanttMethods<D>, Omit<VxeGridMethods<D>, 'dispatchEvent'> { }
|
|
375
422
|
|
|
@@ -408,6 +455,14 @@ export interface GanttPrivateMethods extends GridPrivateMethods {
|
|
|
408
455
|
* @private
|
|
409
456
|
*/
|
|
410
457
|
handleTaskBarDblclickEvent(evnt: MouseEvent, params: VxeGanttDefines.TaskBarClickParams): void
|
|
458
|
+
/**
|
|
459
|
+
* @private
|
|
460
|
+
*/
|
|
461
|
+
triggerTaskBarTooltipEvent(evnt: MouseEvent, params: VxeGanttDefines.TaskBarMouseoverParams): void
|
|
462
|
+
/**
|
|
463
|
+
* @private
|
|
464
|
+
*/
|
|
465
|
+
handleTaskBarTooltipLeaveEvent(evnt: MouseEvent, params: VxeGanttDefines.TaskBarMouseoverParams): void
|
|
411
466
|
}
|
|
412
467
|
export interface VxeGanttPrivateMethods extends GanttPrivateMethods {}
|
|
413
468
|
|
|
@@ -416,10 +471,12 @@ export type VxeGanttEmits = [
|
|
|
416
471
|
|
|
417
472
|
'task-cell-click',
|
|
418
473
|
'task-cell-dblclick',
|
|
474
|
+
'task-bar-mouseenter',
|
|
475
|
+
'task-bar-mouseleave',
|
|
419
476
|
'task-bar-click',
|
|
420
477
|
'task-bar-dblclick',
|
|
421
478
|
'task-view-cell-click',
|
|
422
|
-
'task-view-cell-dblclick'
|
|
479
|
+
'task-view-cell-dblclick',
|
|
423
480
|
]
|
|
424
481
|
|
|
425
482
|
export namespace VxeGanttDefines {
|
|
@@ -443,6 +500,7 @@ export namespace VxeGanttDefines {
|
|
|
443
500
|
}
|
|
444
501
|
|
|
445
502
|
export interface ScaleDateObj {
|
|
503
|
+
date: Date
|
|
446
504
|
yy: string
|
|
447
505
|
M: string
|
|
448
506
|
d: string
|
|
@@ -460,6 +518,10 @@ export namespace VxeGanttDefines {
|
|
|
460
518
|
* 自定义时间轴-列头单元格标题
|
|
461
519
|
*/
|
|
462
520
|
titleMethod?: (params: VxeGanttSlotTypes.TaskViewCellTitleSlotParams) => string | number
|
|
521
|
+
/**
|
|
522
|
+
* 自定义时间轴-自定义标题日期格式
|
|
523
|
+
*/
|
|
524
|
+
titleFormat?: string
|
|
463
525
|
/**
|
|
464
526
|
* 自定义时间轴-列头单元格样式
|
|
465
527
|
*/
|
|
@@ -517,6 +579,13 @@ export namespace VxeGanttDefines {
|
|
|
517
579
|
export interface TaskBarClickEventParams<D = any> extends TaskBarClickParams<D>, GanttEventParams {}
|
|
518
580
|
export interface TaskBarDblClickEventParams<D = any> extends TaskBarClickEventParams<D> {}
|
|
519
581
|
|
|
582
|
+
export interface TaskBarMouseoverParams<D = any> extends GanttEventParams {
|
|
583
|
+
row: D
|
|
584
|
+
rowIndex: number
|
|
585
|
+
$rowIndex: number
|
|
586
|
+
_rowIndex: number
|
|
587
|
+
}
|
|
588
|
+
|
|
520
589
|
export interface TaskHeaderContextmenuParams<D = any> {
|
|
521
590
|
source: string
|
|
522
591
|
type: string
|
|
@@ -597,6 +666,14 @@ export namespace VxeGanttSlotTypes {
|
|
|
597
666
|
$rowIndex: number
|
|
598
667
|
}
|
|
599
668
|
export interface TaskViewHeaderCellStyleSlotParams extends TaskViewCellTitleSlotParams {}
|
|
669
|
+
|
|
670
|
+
export interface TaskBarTooltipSlotParams<D = any> {
|
|
671
|
+
row: D
|
|
672
|
+
rowIndex: number
|
|
673
|
+
$rowIndex: number
|
|
674
|
+
_rowIndex: number
|
|
675
|
+
tooltipContent: string
|
|
676
|
+
}
|
|
600
677
|
}
|
|
601
678
|
|
|
602
679
|
export interface VxeGanttSlots<D = any> extends VxeGridSlots<D> {
|
|
@@ -605,6 +682,11 @@ export interface VxeGanttSlots<D = any> extends VxeGridSlots<D> {
|
|
|
605
682
|
*/
|
|
606
683
|
taskBar?(params: VxeGanttSlotTypes.TaskBarSlotParams<D>): any
|
|
607
684
|
'task-bar'?(params: VxeGanttSlotTypes.TaskBarSlotParams<D>): any
|
|
685
|
+
/**
|
|
686
|
+
* 自定义任务条提示模板
|
|
687
|
+
*/
|
|
688
|
+
taskBarTooltip?(params: VxeGanttSlotTypes.TaskBarTooltipSlotParams<D>): any
|
|
689
|
+
'task-bar-tooltip'?(params: VxeGanttSlotTypes.TaskBarTooltipSlotParams<D>): any
|
|
608
690
|
}
|
|
609
691
|
|
|
610
692
|
export * from './gantt-module'
|
|
@@ -77,7 +77,13 @@ export interface TooltipReactData {
|
|
|
77
77
|
target: HTMLElement | null
|
|
78
78
|
isUpdate: boolean
|
|
79
79
|
visible: boolean
|
|
80
|
-
|
|
80
|
+
tipPos: null | {
|
|
81
|
+
x: number
|
|
82
|
+
y: number
|
|
83
|
+
oLeft: number
|
|
84
|
+
oTop: number
|
|
85
|
+
}
|
|
86
|
+
tipContent: string | number | undefined
|
|
81
87
|
tipActive: boolean
|
|
82
88
|
tipTarget: HTMLElement | null
|
|
83
89
|
tipZindex: number
|
|
@@ -96,8 +102,10 @@ export interface TooltipMethods {
|
|
|
96
102
|
dispatchEvent(type: ValueOf<VxeTooltipEmits>, params: Record<string, any>, evnt: Event | null): void
|
|
97
103
|
/**
|
|
98
104
|
* 显示
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
*/
|
|
106
|
+
openByEvent(evnt: Event, target?: any, content?: VxeTooltipPropTypes.Content): Promise<void>
|
|
107
|
+
/**
|
|
108
|
+
* 显示
|
|
101
109
|
*/
|
|
102
110
|
open(target?: any, content?: VxeTooltipPropTypes.Content): Promise<void>
|
|
103
111
|
/**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|