vxe-table 4.15.5 → 4.15.7
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/README.md +12 -7
- package/es/grid/src/emits.js +16 -0
- package/es/grid/src/grid.js +77 -62
- package/es/grid/src/props.js +7 -0
- package/es/style.css +1 -1
- package/es/table/index.js +0 -8
- package/es/table/module/custom/hook.js +3 -0
- package/es/table/module/edit/hook.js +3 -0
- package/es/table/module/export/hook.js +6 -1
- package/es/table/module/filter/hook.js +3 -0
- package/es/table/module/menu/hook.js +3 -0
- package/es/table/module/validator/hook.js +3 -0
- package/es/table/src/emits.js +1 -1
- package/es/table/src/props.js +1 -1
- package/es/table/src/table.js +137 -53
- package/es/table/src/util.js +6 -4
- package/es/toolbar/src/toolbar.js +2 -2
- package/es/ui/index.js +13 -4
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/emits.js +8 -0
- package/lib/grid/src/emits.min.js +1 -0
- package/lib/grid/src/grid.js +78 -54
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/src/props.js +24 -0
- package/lib/grid/src/props.min.js +1 -0
- package/lib/index.umd.js +12062 -11985
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/index.js +0 -8
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/hook.js +3 -0
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/edit/hook.js +3 -0
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +8 -1
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/filter/hook.js +3 -0
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/menu/hook.js +3 -0
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/module/validator/hook.js +3 -0
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/src/emits.js +2 -2
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +35 -31
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +6 -4
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +2 -0
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +12 -3
- 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/package.json +1 -1
- package/packages/grid/src/emits.ts +19 -0
- package/packages/grid/src/grid.ts +98 -94
- package/packages/grid/src/props.ts +23 -0
- package/packages/table/index.ts +0 -8
- package/packages/table/module/custom/hook.ts +3 -0
- package/packages/table/module/edit/hook.ts +3 -0
- package/packages/table/module/export/hook.ts +8 -3
- package/packages/table/module/filter/hook.ts +3 -0
- package/packages/table/module/menu/hook.ts +3 -0
- package/packages/table/module/validator/hook.ts +3 -0
- package/packages/table/src/emits.ts +2 -2
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +144 -55
- package/packages/table/src/util.ts +7 -4
- package/packages/toolbar/src/toolbar.ts +2 -2
- package/packages/ui/index.ts +12 -2
- package/packages/ui/src/dom.ts +1 -1
- /package/es/{iconfont.1754615009926.ttf → iconfont.1755066378525.ttf} +0 -0
- /package/es/{iconfont.1754615009926.woff → iconfont.1755066378525.woff} +0 -0
- /package/es/{iconfont.1754615009926.woff2 → iconfont.1755066378525.woff2} +0 -0
- /package/lib/{iconfont.1754615009926.ttf → iconfont.1755066378525.ttf} +0 -0
- /package/lib/{iconfont.1754615009926.woff → iconfont.1755066378525.woff} +0 -0
- /package/lib/{iconfont.1754615009926.woff2 → iconfont.1755066378525.woff2} +0 -0
|
@@ -12,14 +12,23 @@ import Cell from './cell'
|
|
|
12
12
|
import TableBodyComponent from './body'
|
|
13
13
|
import TableHeaderComponent from './header'
|
|
14
14
|
import TableFooterComponent from './footer'
|
|
15
|
-
import tableProps from './props'
|
|
16
|
-
import tableEmits from './emits'
|
|
15
|
+
import { tableProps } from './props'
|
|
16
|
+
import { tableEmits } from './emits'
|
|
17
17
|
import TableCustomPanelComponent from '../module/custom/panel'
|
|
18
18
|
import TableFilterPanelComponent from '../module/filter/panel'
|
|
19
19
|
import TableImportPanelComponent from '../module/export/import-panel'
|
|
20
20
|
import TableExportPanelComponent from '../module/export/export-panel'
|
|
21
21
|
import TableMenuPanelComponent from '../module/menu/panel'
|
|
22
22
|
|
|
23
|
+
import '../module/filter/hook'
|
|
24
|
+
import '../module/menu/hook'
|
|
25
|
+
import '../module/edit/hook'
|
|
26
|
+
import '../module/export/hook'
|
|
27
|
+
import '../module/keyboard/hook'
|
|
28
|
+
import '../module/validator/hook'
|
|
29
|
+
import '../module/custom/hook'
|
|
30
|
+
import '../render'
|
|
31
|
+
|
|
23
32
|
import type { VxeTooltipInstance, VxeTabsConstructor, VxeTabsPrivateMethods, ValueOf, VxeComponentSlotType } from 'vxe-pc-ui'
|
|
24
33
|
import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, VxeTablePropTypes, VxeToolbarConstructor, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, TableMethods, VxeTableMethods, VxeTableDefines, VxeTableEmits, VxeTableProps, VxeColumnPropTypes, VxeTableCustomPanelConstructor } from '../../../types'
|
|
25
34
|
|
|
@@ -95,6 +104,8 @@ export default defineVxeComponent({
|
|
|
95
104
|
rowGroupColumn: null,
|
|
96
105
|
// 展开列信息
|
|
97
106
|
expandColumn: null,
|
|
107
|
+
checkboxColumn: null,
|
|
108
|
+
radioColumn: null,
|
|
98
109
|
// 树节点列信息
|
|
99
110
|
treeNodeColumn: null,
|
|
100
111
|
hasFixedColumn: false,
|
|
@@ -350,6 +361,7 @@ export default defineVxeComponent({
|
|
|
350
361
|
const refScrollYSpaceElem = ref<HTMLDivElement>()
|
|
351
362
|
|
|
352
363
|
const $xeGrid = inject<(VxeGridConstructor & VxeGridPrivateMethods) | null>('$xeGrid', null)
|
|
364
|
+
const $xeGantt = inject('$xeGantt', null)
|
|
353
365
|
let $xeToolbar: VxeToolbarConstructor
|
|
354
366
|
|
|
355
367
|
const computeTableId = computed(() => {
|
|
@@ -901,6 +913,9 @@ export default defineVxeComponent({
|
|
|
901
913
|
getComputeMaps: () => computeMaps,
|
|
902
914
|
|
|
903
915
|
xeGrid: $xeGrid,
|
|
916
|
+
xeGantt: $xeGantt,
|
|
917
|
+
|
|
918
|
+
// 已废弃
|
|
904
919
|
xegrid: $xeGrid
|
|
905
920
|
} as unknown as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods
|
|
906
921
|
|
|
@@ -1696,6 +1711,8 @@ export default defineVxeComponent({
|
|
|
1696
1711
|
reactData.rowGroupColumn = rowGroupColumn
|
|
1697
1712
|
reactData.treeNodeColumn = treeNodeColumn
|
|
1698
1713
|
reactData.expandColumn = expandColumn
|
|
1714
|
+
reactData.checkboxColumn = checkboxColumn
|
|
1715
|
+
reactData.radioColumn = radioColumn
|
|
1699
1716
|
reactData.isAllOverflow = isAllOverflow
|
|
1700
1717
|
}
|
|
1701
1718
|
|
|
@@ -2264,53 +2281,71 @@ export default defineVxeComponent({
|
|
|
2264
2281
|
const updateStyle = () => {
|
|
2265
2282
|
const { showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props
|
|
2266
2283
|
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading } = reactData
|
|
2267
|
-
const { visibleColumn, tableHeight,
|
|
2284
|
+
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
|
|
2285
|
+
const $xeGanttView = internalData.xeGanttView
|
|
2268
2286
|
const el = refElem.value
|
|
2269
|
-
if (!el) {
|
|
2287
|
+
if (!el || !el.clientHeight) {
|
|
2270
2288
|
return
|
|
2271
2289
|
}
|
|
2272
2290
|
const containerList = ['main', 'left', 'right']
|
|
2273
|
-
|
|
2274
|
-
|
|
2291
|
+
let osbWidth = overflowY ? scrollbarWidth : 0
|
|
2292
|
+
let osbHeight = overflowX ? scrollbarHeight : 0
|
|
2275
2293
|
const emptyPlaceholderElem = refEmptyPlaceholder.value
|
|
2294
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
2276
2295
|
const mouseOpts = computeMouseOpts.value
|
|
2277
2296
|
const expandOpts = computeExpandOpts.value
|
|
2278
2297
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
|
|
2279
2298
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
2280
2299
|
if (emptyPlaceholderElem) {
|
|
2281
|
-
emptyPlaceholderElem.style.top = `${
|
|
2300
|
+
emptyPlaceholderElem.style.top = `${tHeaderHeight}px`
|
|
2282
2301
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : ''
|
|
2283
2302
|
}
|
|
2284
2303
|
|
|
2285
|
-
|
|
2304
|
+
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
2305
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
2306
|
+
|
|
2307
|
+
let xScrollbarVisible = overflowX ? 'visible' : 'hidden'
|
|
2308
|
+
if ($xeGanttView) {
|
|
2309
|
+
osbHeight = scrollbarHeight
|
|
2310
|
+
xScrollbarVisible = 'visible'
|
|
2311
|
+
} else if (scrollbarOpts.x && scrollbarOpts.x.visible === false) {
|
|
2312
|
+
osbHeight = 0
|
|
2313
|
+
xScrollbarVisible = 'hidden'
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
let yScrollbarVisible = overflowY ? 'visible' : 'hidden'
|
|
2317
|
+
if ((scrollbarOpts.y && scrollbarOpts.y.visible === false) || ($xeGanttView && !scrollbarYToLeft)) {
|
|
2318
|
+
osbWidth = 0
|
|
2319
|
+
yScrollbarVisible = 'hidden'
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
let tbHeight = 0
|
|
2286
2323
|
let bodyMaxHeight = 0
|
|
2287
|
-
const bodyMinHeight = customMinHeight -
|
|
2324
|
+
const bodyMinHeight = customMinHeight - tHeaderHeight - tFooterHeight - osbHeight
|
|
2288
2325
|
if (customMaxHeight) {
|
|
2289
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight -
|
|
2326
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - tHeaderHeight - tFooterHeight - osbHeight)
|
|
2290
2327
|
}
|
|
2291
2328
|
if (customHeight) {
|
|
2292
|
-
|
|
2329
|
+
tbHeight = customHeight - tHeaderHeight - tFooterHeight - osbHeight
|
|
2293
2330
|
}
|
|
2294
|
-
if (!
|
|
2331
|
+
if (!tbHeight) {
|
|
2295
2332
|
if (bodyTableElem) {
|
|
2296
|
-
|
|
2333
|
+
tbHeight = bodyTableElem.clientHeight
|
|
2297
2334
|
}
|
|
2298
2335
|
}
|
|
2299
|
-
if (
|
|
2336
|
+
if (tbHeight) {
|
|
2300
2337
|
if (bodyMaxHeight) {
|
|
2301
|
-
|
|
2338
|
+
tbHeight = Math.min(bodyMaxHeight, tbHeight)
|
|
2302
2339
|
}
|
|
2303
|
-
|
|
2340
|
+
tbHeight = Math.max(bodyMinHeight, tbHeight)
|
|
2304
2341
|
}
|
|
2305
2342
|
|
|
2306
|
-
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
2307
|
-
|
|
2308
2343
|
const xLeftCornerEl = refScrollXLeftCornerElem.value
|
|
2309
2344
|
const xRightCornerEl = refScrollXRightCornerElem.value
|
|
2310
2345
|
const scrollXVirtualEl = refScrollXVirtualElem.value
|
|
2311
2346
|
if (scrollXVirtualEl) {
|
|
2312
2347
|
scrollXVirtualEl.style.height = `${osbHeight}px`
|
|
2313
|
-
scrollXVirtualEl.style.visibility =
|
|
2348
|
+
scrollXVirtualEl.style.visibility = xScrollbarVisible
|
|
2314
2349
|
}
|
|
2315
2350
|
const xWrapperEl = refScrollXWrapperElem.value
|
|
2316
2351
|
if (xWrapperEl) {
|
|
@@ -2329,32 +2364,34 @@ export default defineVxeComponent({
|
|
|
2329
2364
|
const scrollYVirtualEl = refScrollYVirtualElem.value
|
|
2330
2365
|
if (scrollYVirtualEl) {
|
|
2331
2366
|
scrollYVirtualEl.style.width = `${osbWidth}px`
|
|
2332
|
-
scrollYVirtualEl.style.height = `${
|
|
2333
|
-
scrollYVirtualEl.style.visibility =
|
|
2367
|
+
scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`
|
|
2368
|
+
scrollYVirtualEl.style.visibility = yScrollbarVisible
|
|
2334
2369
|
}
|
|
2335
2370
|
const yTopCornerEl = refScrollYTopCornerElem.value
|
|
2336
2371
|
if (yTopCornerEl) {
|
|
2337
|
-
yTopCornerEl.style.height = `${
|
|
2338
|
-
yTopCornerEl.style.display = overflowY &&
|
|
2372
|
+
yTopCornerEl.style.height = `${tHeaderHeight}px`
|
|
2373
|
+
yTopCornerEl.style.display = overflowY && tHeaderHeight ? 'block' : ''
|
|
2339
2374
|
}
|
|
2340
2375
|
const yWrapperEl = refScrollYWrapperElem.value
|
|
2341
2376
|
if (yWrapperEl) {
|
|
2342
|
-
yWrapperEl.style.height = `${
|
|
2343
|
-
yWrapperEl.style.top = `${
|
|
2377
|
+
yWrapperEl.style.height = `${tbHeight}px`
|
|
2378
|
+
yWrapperEl.style.top = `${tHeaderHeight}px`
|
|
2344
2379
|
}
|
|
2345
2380
|
const yBottomCornerEl = refScrollYBottomCornerElem.value
|
|
2346
2381
|
if (yBottomCornerEl) {
|
|
2347
|
-
yBottomCornerEl.style.height = `${
|
|
2348
|
-
yBottomCornerEl.style.top = `${
|
|
2349
|
-
yBottomCornerEl.style.display = overflowY &&
|
|
2382
|
+
yBottomCornerEl.style.height = `${tFooterHeight}px`
|
|
2383
|
+
yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`
|
|
2384
|
+
yBottomCornerEl.style.display = overflowY && tFooterHeight ? 'block' : ''
|
|
2350
2385
|
}
|
|
2351
2386
|
|
|
2352
2387
|
const rowExpandEl = refRowExpandElem.value
|
|
2353
2388
|
if (rowExpandEl) {
|
|
2354
|
-
rowExpandEl.style.height = `${
|
|
2355
|
-
rowExpandEl.style.top = `${
|
|
2389
|
+
rowExpandEl.style.height = `${tbHeight}px`
|
|
2390
|
+
rowExpandEl.style.top = `${tHeaderHeight}px`
|
|
2356
2391
|
}
|
|
2357
2392
|
|
|
2393
|
+
internalData.tBodyHeight = tbHeight
|
|
2394
|
+
|
|
2358
2395
|
containerList.forEach((name, index) => {
|
|
2359
2396
|
const fixedType = index > 0 ? name : ''
|
|
2360
2397
|
const layoutList = ['header', 'body', 'footer']
|
|
@@ -2420,7 +2457,7 @@ export default defineVxeComponent({
|
|
|
2420
2457
|
}
|
|
2421
2458
|
|
|
2422
2459
|
if (currScrollElem) {
|
|
2423
|
-
currScrollElem.style.height = `${
|
|
2460
|
+
currScrollElem.style.height = `${tHeaderHeight}px`
|
|
2424
2461
|
}
|
|
2425
2462
|
|
|
2426
2463
|
if (tableElem) {
|
|
@@ -2429,16 +2466,16 @@ export default defineVxeComponent({
|
|
|
2429
2466
|
} else if (layout === 'body') {
|
|
2430
2467
|
if (currScrollElem) {
|
|
2431
2468
|
currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : ''
|
|
2432
|
-
currScrollElem.style.height = customHeight ? `${
|
|
2469
|
+
currScrollElem.style.height = customHeight ? `${tbHeight}px` : ''
|
|
2433
2470
|
currScrollElem.style.minHeight = `${bodyMinHeight}px`
|
|
2434
2471
|
}
|
|
2435
2472
|
|
|
2436
2473
|
// 如果是固定列
|
|
2437
2474
|
if (fixedWrapperElem) {
|
|
2438
2475
|
if (wrapperElem) {
|
|
2439
|
-
wrapperElem.style.top = `${
|
|
2476
|
+
wrapperElem.style.top = `${tHeaderHeight}px`
|
|
2440
2477
|
}
|
|
2441
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight +
|
|
2478
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + tHeaderHeight + tFooterHeight + osbHeight)}px`
|
|
2442
2479
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`
|
|
2443
2480
|
}
|
|
2444
2481
|
|
|
@@ -2521,11 +2558,11 @@ export default defineVxeComponent({
|
|
|
2521
2558
|
}
|
|
2522
2559
|
|
|
2523
2560
|
if (currScrollElem) {
|
|
2524
|
-
currScrollElem.style.height = `${
|
|
2561
|
+
currScrollElem.style.height = `${tFooterHeight}px`
|
|
2525
2562
|
// 如果是固定列
|
|
2526
2563
|
if (fixedWrapperElem) {
|
|
2527
2564
|
if (wrapperElem) {
|
|
2528
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight -
|
|
2565
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - tFooterHeight - osbHeight : tableHeight + tHeaderHeight}px`
|
|
2529
2566
|
}
|
|
2530
2567
|
}
|
|
2531
2568
|
}
|
|
@@ -2541,6 +2578,9 @@ export default defineVxeComponent({
|
|
|
2541
2578
|
if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
|
|
2542
2579
|
$xeTable.addCellSelectedClass()
|
|
2543
2580
|
}
|
|
2581
|
+
if ($xeGanttView) {
|
|
2582
|
+
$xeGanttView.handleUpdateStyle()
|
|
2583
|
+
}
|
|
2544
2584
|
return nextTick()
|
|
2545
2585
|
}
|
|
2546
2586
|
|
|
@@ -3126,14 +3166,13 @@ export default defineVxeComponent({
|
|
|
3126
3166
|
reactData.scrollbarHeight = scrollbarOpts.height || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14
|
|
3127
3167
|
}
|
|
3128
3168
|
|
|
3129
|
-
const
|
|
3130
|
-
const
|
|
3169
|
+
const hHeight = headerTableElem ? headerTableElem.clientHeight : 0
|
|
3170
|
+
const fHeight = footerTableElem ? footerTableElem.clientHeight : 0
|
|
3131
3171
|
internalData.tableHeight = bodyWrapperElem.offsetHeight
|
|
3132
|
-
internalData.
|
|
3133
|
-
internalData.
|
|
3134
|
-
|
|
3172
|
+
internalData.tHeaderHeight = hHeight
|
|
3173
|
+
internalData.tFooterHeight = fHeight
|
|
3135
3174
|
reactData.overflowX = overflowX
|
|
3136
|
-
reactData.parentHeight = Math.max(
|
|
3175
|
+
reactData.parentHeight = Math.max(hHeight + fHeight + 20, $xeTable.getParentHeight())
|
|
3137
3176
|
}
|
|
3138
3177
|
if (overflowX) {
|
|
3139
3178
|
$xeTable.checkScrolling()
|
|
@@ -3188,6 +3227,7 @@ export default defineVxeComponent({
|
|
|
3188
3227
|
|
|
3189
3228
|
const handleLazyRecalculate = (reFull: boolean, reWidth: boolean, reHeight: boolean) => {
|
|
3190
3229
|
return new Promise<void>(resolve => {
|
|
3230
|
+
const $xeGanttView = internalData.xeGanttView
|
|
3191
3231
|
const { rceTimeout, rceRunTime } = internalData
|
|
3192
3232
|
const resizeOpts = computeResizeOpts.value
|
|
3193
3233
|
const refreshDelay = resizeOpts.refreshDelay || 20
|
|
@@ -3212,6 +3252,9 @@ export default defineVxeComponent({
|
|
|
3212
3252
|
handleRecalculateStyle(reFull, reWidth, reHeight)
|
|
3213
3253
|
)
|
|
3214
3254
|
}
|
|
3255
|
+
if ($xeGanttView) {
|
|
3256
|
+
$xeGanttView.handleLazyRecalculate()
|
|
3257
|
+
}
|
|
3215
3258
|
internalData.rceTimeout = setTimeout(() => {
|
|
3216
3259
|
internalData.rceTimeout = undefined
|
|
3217
3260
|
handleRecalculateStyle(reFull, reWidth, reHeight)
|
|
@@ -3219,6 +3262,10 @@ export default defineVxeComponent({
|
|
|
3219
3262
|
})
|
|
3220
3263
|
}
|
|
3221
3264
|
|
|
3265
|
+
const handleResizeEvent = () => {
|
|
3266
|
+
handleLazyRecalculate(true, true, true)
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3222
3269
|
const handleUpdateAggValues = () => {
|
|
3223
3270
|
const { visibleColumn } = internalData
|
|
3224
3271
|
const aggCols: VxeTableDefines.ColumnInfo[] = []
|
|
@@ -4103,13 +4150,13 @@ export default defineVxeComponent({
|
|
|
4103
4150
|
}
|
|
4104
4151
|
|
|
4105
4152
|
const checkLastSyncScroll = (isRollX: boolean, isRollY: boolean) => {
|
|
4106
|
-
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData
|
|
4107
4153
|
const { lcsTimeout } = internalData
|
|
4108
4154
|
reactData.lazScrollLoading = true
|
|
4109
4155
|
if (lcsTimeout) {
|
|
4110
4156
|
clearTimeout(lcsTimeout)
|
|
4111
4157
|
}
|
|
4112
4158
|
internalData.lcsTimeout = setTimeout(() => {
|
|
4159
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData
|
|
4113
4160
|
internalData.lcsRunTime = Date.now()
|
|
4114
4161
|
internalData.lcsTimeout = undefined
|
|
4115
4162
|
internalData.intoRunScroll = false
|
|
@@ -4187,6 +4234,18 @@ export default defineVxeComponent({
|
|
|
4187
4234
|
requestAnimationFrame(step)
|
|
4188
4235
|
}
|
|
4189
4236
|
|
|
4237
|
+
const syncGanttScrollTop = (scrollTop: number) => {
|
|
4238
|
+
const $xeGanttView = internalData.xeGanttView
|
|
4239
|
+
if ($xeGanttView) {
|
|
4240
|
+
const ganttInternalData = $xeGanttView.internalData
|
|
4241
|
+
const { elemStore: ganttElemStore } = ganttInternalData
|
|
4242
|
+
const ganttBodyScrollElem = getRefElem(ganttElemStore['main-body-scroll'])
|
|
4243
|
+
if (ganttBodyScrollElem) {
|
|
4244
|
+
ganttBodyScrollElem.scrollTop = scrollTop
|
|
4245
|
+
}
|
|
4246
|
+
}
|
|
4247
|
+
}
|
|
4248
|
+
|
|
4190
4249
|
const dispatchEvent = (type: ValueOf<VxeTableEmits>, params: Record<string, any>, evnt: Event | null) => {
|
|
4191
4250
|
emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid }, params))
|
|
4192
4251
|
}
|
|
@@ -7070,11 +7129,18 @@ export default defineVxeComponent({
|
|
|
7070
7129
|
internalData.isActivated = false
|
|
7071
7130
|
return nextTick()
|
|
7072
7131
|
},
|
|
7132
|
+
/**
|
|
7133
|
+
* 已废弃,被 connectToolbar 替换
|
|
7134
|
+
* @deprecated
|
|
7135
|
+
*/
|
|
7136
|
+
connect ($toolbar) {
|
|
7137
|
+
return $xeTable.connectToolbar($toolbar)
|
|
7138
|
+
},
|
|
7073
7139
|
/**
|
|
7074
7140
|
* 连接工具栏
|
|
7075
7141
|
* @param $toolbar
|
|
7076
7142
|
*/
|
|
7077
|
-
|
|
7143
|
+
connectToolbar ($toolbar) {
|
|
7078
7144
|
if ($toolbar) {
|
|
7079
7145
|
$xeToolbar = $toolbar
|
|
7080
7146
|
$xeToolbar.syncUpdate({ collectColumn: internalData.collectColumn, $table: $xeTable })
|
|
@@ -7633,7 +7699,7 @@ export default defineVxeComponent({
|
|
|
7633
7699
|
if (!el || !el.clientWidth) {
|
|
7634
7700
|
return
|
|
7635
7701
|
}
|
|
7636
|
-
|
|
7702
|
+
handleResizeEvent()
|
|
7637
7703
|
$xeTable.updateCellAreas()
|
|
7638
7704
|
}
|
|
7639
7705
|
|
|
@@ -7989,6 +8055,7 @@ export default defineVxeComponent({
|
|
|
7989
8055
|
handleTableData (force?: boolean) {
|
|
7990
8056
|
const { scrollYLoad } = reactData
|
|
7991
8057
|
const { scrollYStore, fullDataRowIdData } = internalData
|
|
8058
|
+
const $xeGanttView = internalData.xeGanttView
|
|
7992
8059
|
let fullList: any[] = internalData.afterFullData
|
|
7993
8060
|
// 是否进行数据处理
|
|
7994
8061
|
if (force) {
|
|
@@ -8009,6 +8076,9 @@ export default defineVxeComponent({
|
|
|
8009
8076
|
})
|
|
8010
8077
|
reactData.tableData = tableData
|
|
8011
8078
|
internalData.visibleDataRowIdData = visibleDataRowIdMaps
|
|
8079
|
+
if ($xeGanttView) {
|
|
8080
|
+
$xeGanttView.updateViewData()
|
|
8081
|
+
}
|
|
8012
8082
|
return nextTick()
|
|
8013
8083
|
},
|
|
8014
8084
|
/**
|
|
@@ -9080,8 +9150,8 @@ export default defineVxeComponent({
|
|
|
9080
9150
|
* 如果是双击模式,则单击后选中状态
|
|
9081
9151
|
*/
|
|
9082
9152
|
triggerCellClickEvent (evnt, params) {
|
|
9083
|
-
const { highlightCurrentRow, highlightCurrentColumn, editConfig } = props
|
|
9084
|
-
const { editStore, isDragResize } = reactData
|
|
9153
|
+
const { treeConfig, highlightCurrentRow, highlightCurrentColumn, editConfig, aggregateConfig, rowGroupConfig } = props
|
|
9154
|
+
const { editStore, isDragResize, expandColumn, checkboxColumn, radioColumn } = reactData
|
|
9085
9155
|
if (isDragResize) {
|
|
9086
9156
|
return
|
|
9087
9157
|
}
|
|
@@ -9110,15 +9180,15 @@ export default defineVxeComponent({
|
|
|
9110
9180
|
params = Object.assign({ cell, triggerRadio, triggerCheckbox, triggerTreeNode, triggerExpandNode }, params)
|
|
9111
9181
|
if (!triggerCheckbox && !triggerRadio) {
|
|
9112
9182
|
// 如果是展开行
|
|
9113
|
-
if (!triggerExpandNode && (expandOpts.trigger === 'row' || (isExpandType && expandOpts.trigger === 'cell'))) {
|
|
9183
|
+
if (!triggerExpandNode && ((expandColumn && expandOpts.trigger === 'row') || (isExpandType && expandOpts.trigger === 'cell'))) {
|
|
9114
9184
|
$xeTable.triggerRowExpandEvent(evnt, params)
|
|
9115
9185
|
}
|
|
9116
9186
|
// 如果是树形表格
|
|
9117
|
-
if ((treeOpts.trigger === 'row' || (treeNode && treeOpts.trigger === 'cell'))) {
|
|
9187
|
+
if (treeConfig && (treeOpts.trigger === 'row' || (treeNode && treeOpts.trigger === 'cell'))) {
|
|
9118
9188
|
$xeTable.triggerTreeExpandEvent(evnt, params)
|
|
9119
9189
|
}
|
|
9120
9190
|
// 如果是行分组
|
|
9121
|
-
if ((aggregateOpts.trigger === 'row' || (rowGroupNode && aggregateOpts.trigger === 'cell'))) {
|
|
9191
|
+
if ((aggregateConfig || rowGroupConfig) && (aggregateOpts.trigger === 'row' || (rowGroupNode && aggregateOpts.trigger === 'cell'))) {
|
|
9122
9192
|
$xeTable.triggerRowGroupExpandEvent(evnt, params)
|
|
9123
9193
|
}
|
|
9124
9194
|
}
|
|
@@ -9138,11 +9208,11 @@ export default defineVxeComponent({
|
|
|
9138
9208
|
}
|
|
9139
9209
|
}
|
|
9140
9210
|
// 如果是单选框
|
|
9141
|
-
if (!triggerRadio && (radioOpts.trigger === 'row' || (isRadioType && radioOpts.trigger === 'cell'))) {
|
|
9211
|
+
if (!triggerRadio && ((radioColumn && radioOpts.trigger === 'row') || (isRadioType && radioOpts.trigger === 'cell'))) {
|
|
9142
9212
|
$xeTable.triggerRadioRowEvent(evnt, params)
|
|
9143
9213
|
}
|
|
9144
9214
|
// 如果是复选框
|
|
9145
|
-
if (!triggerCheckbox && (checkboxOpts.trigger === 'row' || (isCheckboxType && checkboxOpts.trigger === 'cell'))) {
|
|
9215
|
+
if (!triggerCheckbox && ((checkboxColumn && checkboxOpts.trigger === 'row') || (isCheckboxType && checkboxOpts.trigger === 'cell'))) {
|
|
9146
9216
|
$xeTable.handleToggleCheckRowEvent(evnt, params)
|
|
9147
9217
|
}
|
|
9148
9218
|
}
|
|
@@ -10534,6 +10604,7 @@ export default defineVxeComponent({
|
|
|
10534
10604
|
}
|
|
10535
10605
|
setScrollTop(yHandleEl, scrollTop)
|
|
10536
10606
|
setScrollTop(rowExpandEl, scrollTop)
|
|
10607
|
+
syncGanttScrollTop(scrollTop)
|
|
10537
10608
|
if (scrollYLoad) {
|
|
10538
10609
|
$xeTable.triggerScrollYEvent(evnt)
|
|
10539
10610
|
}
|
|
@@ -10727,6 +10798,7 @@ export default defineVxeComponent({
|
|
|
10727
10798
|
setScrollTop(leftScrollElem, currTopNum)
|
|
10728
10799
|
setScrollTop(rightScrollElem, currTopNum)
|
|
10729
10800
|
setScrollTop(rowExpandEl, currTopNum)
|
|
10801
|
+
syncGanttScrollTop(currTopNum)
|
|
10730
10802
|
if (scrollYLoad) {
|
|
10731
10803
|
$xeTable.triggerScrollYEvent(evnt)
|
|
10732
10804
|
}
|
|
@@ -10743,6 +10815,7 @@ export default defineVxeComponent({
|
|
|
10743
10815
|
setScrollTop(leftScrollElem, currTopNum)
|
|
10744
10816
|
setScrollTop(rightScrollElem, currTopNum)
|
|
10745
10817
|
setScrollTop(rowExpandEl, currTopNum)
|
|
10818
|
+
syncGanttScrollTop(currTopNum)
|
|
10746
10819
|
if (scrollYLoad) {
|
|
10747
10820
|
$xeTable.triggerScrollYEvent(evnt)
|
|
10748
10821
|
}
|
|
@@ -10817,6 +10890,7 @@ export default defineVxeComponent({
|
|
|
10817
10890
|
setScrollTop(leftScrollElem, scrollTop)
|
|
10818
10891
|
setScrollTop(rightScrollElem, scrollTop)
|
|
10819
10892
|
setScrollTop(rowExpandEl, scrollTop)
|
|
10893
|
+
syncGanttScrollTop(scrollTop)
|
|
10820
10894
|
if (scrollYLoad) {
|
|
10821
10895
|
$xeTable.triggerScrollYEvent(evnt)
|
|
10822
10896
|
}
|
|
@@ -10856,6 +10930,7 @@ export default defineVxeComponent({
|
|
|
10856
10930
|
updateScrollXSpace () {
|
|
10857
10931
|
const { scrollXLoad, overflowX, scrollXWidth } = reactData
|
|
10858
10932
|
const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData
|
|
10933
|
+
const $xeGanttView = internalData.xeGanttView
|
|
10859
10934
|
const mouseOpts = computeMouseOpts.value
|
|
10860
10935
|
const tableBody = refTableBody.value
|
|
10861
10936
|
const tableBodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
|
|
@@ -10924,10 +10999,13 @@ export default defineVxeComponent({
|
|
|
10924
10999
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`
|
|
10925
11000
|
}
|
|
10926
11001
|
|
|
11002
|
+
calcScrollbar()
|
|
10927
11003
|
if (isScrollXBig && mouseOpts.area) {
|
|
10928
11004
|
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
10929
11005
|
}
|
|
10930
|
-
|
|
11006
|
+
if ($xeGanttView) {
|
|
11007
|
+
$xeGanttView.updateScrollXSpace()
|
|
11008
|
+
}
|
|
10931
11009
|
return nextTick().then(() => {
|
|
10932
11010
|
updateStyle()
|
|
10933
11011
|
})
|
|
@@ -10937,6 +11015,7 @@ export default defineVxeComponent({
|
|
|
10937
11015
|
updateScrollYSpace () {
|
|
10938
11016
|
const { isAllOverflow, overflowY, scrollYLoad, expandColumn } = reactData
|
|
10939
11017
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData
|
|
11018
|
+
const $xeGanttView = internalData.xeGanttView
|
|
10940
11019
|
const { startIndex } = scrollYStore
|
|
10941
11020
|
const mouseOpts = computeMouseOpts.value
|
|
10942
11021
|
const expandOpts = computeExpandOpts.value
|
|
@@ -11034,10 +11113,13 @@ export default defineVxeComponent({
|
|
|
11034
11113
|
reactData.scrollYHeight = scrollYHeight
|
|
11035
11114
|
reactData.isScrollYBig = isScrollYBig
|
|
11036
11115
|
|
|
11116
|
+
calcScrollbar()
|
|
11037
11117
|
if (isScrollYBig && mouseOpts.area) {
|
|
11038
11118
|
errLog('vxe.error.notProp', ['mouse-config.area'])
|
|
11039
11119
|
}
|
|
11040
|
-
|
|
11120
|
+
if ($xeGanttView) {
|
|
11121
|
+
$xeGanttView.updateScrollYSpace()
|
|
11122
|
+
}
|
|
11041
11123
|
return nextTick().then(() => {
|
|
11042
11124
|
updateStyle()
|
|
11043
11125
|
})
|
|
@@ -11140,6 +11222,13 @@ export default defineVxeComponent({
|
|
|
11140
11222
|
return getRowid($xeTable, row1) === getRowid($xeTable, row2)
|
|
11141
11223
|
}
|
|
11142
11224
|
return false
|
|
11225
|
+
},
|
|
11226
|
+
handleConnectGanttView ($ganttView) {
|
|
11227
|
+
if ($ganttView && $ganttView.connectUpdate) {
|
|
11228
|
+
$ganttView.connectUpdate({ $table: $xeTable })
|
|
11229
|
+
internalData.xeGanttView = $ganttView as any
|
|
11230
|
+
}
|
|
11231
|
+
return nextTick()
|
|
11143
11232
|
}
|
|
11144
11233
|
}
|
|
11145
11234
|
|
|
@@ -12211,7 +12300,7 @@ export default defineVxeComponent({
|
|
|
12211
12300
|
const parentEl = tablePrivateMethods.getParentElem()
|
|
12212
12301
|
resizeObserver = globalResize.create(() => {
|
|
12213
12302
|
if (props.autoResize) {
|
|
12214
|
-
|
|
12303
|
+
handleResizeEvent()
|
|
12215
12304
|
}
|
|
12216
12305
|
})
|
|
12217
12306
|
if (el) {
|
|
@@ -36,10 +36,6 @@ export function createInternalData (): TableInternalData {
|
|
|
36
36
|
tableWidth: 0,
|
|
37
37
|
// 表格高度
|
|
38
38
|
tableHeight: 0,
|
|
39
|
-
// 表头高度
|
|
40
|
-
headerHeight: 0,
|
|
41
|
-
// 表尾高度
|
|
42
|
-
footerHeight: 0,
|
|
43
39
|
customHeight: 0,
|
|
44
40
|
customMinHeight: 0,
|
|
45
41
|
customMaxHeight: 0,
|
|
@@ -119,6 +115,13 @@ export function createInternalData (): TableInternalData {
|
|
|
119
115
|
|
|
120
116
|
cvCacheMaps: {},
|
|
121
117
|
|
|
118
|
+
// 表头高度
|
|
119
|
+
tHeaderHeight: 0,
|
|
120
|
+
// 表体高度
|
|
121
|
+
tBodyHeight: 0,
|
|
122
|
+
// 表尾高度
|
|
123
|
+
tFooterHeight: 0,
|
|
124
|
+
|
|
122
125
|
inited: false,
|
|
123
126
|
tooltipTimeout: null,
|
|
124
127
|
initStatus: false,
|
|
@@ -310,7 +310,7 @@ export default defineVxeComponent({
|
|
|
310
310
|
$xeGrid.triggerToolbarBtnEvent(item, $event)
|
|
311
311
|
} else {
|
|
312
312
|
const gCommandOpts = commands.get(code)
|
|
313
|
-
const params = { code, button: item, $table: $table
|
|
313
|
+
const params = { code, button: item, $table: $table as VxeTableConstructor, $grid: $xeGrid, $gantt: null, $event }
|
|
314
314
|
if (gCommandOpts) {
|
|
315
315
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
|
|
316
316
|
if (tCommandMethod) {
|
|
@@ -336,7 +336,7 @@ export default defineVxeComponent({
|
|
|
336
336
|
$xeGrid.triggerToolbarTolEvent(item, $event)
|
|
337
337
|
} else {
|
|
338
338
|
const gCommandOpts = commands.get(code)
|
|
339
|
-
const params = { code, button: null, tool: item, $table: $table
|
|
339
|
+
const params = { code, button: null, tool: item, $table: $table as VxeTableConstructor, $grid: $xeGrid, $gantt: null, $event }
|
|
340
340
|
if (gCommandOpts) {
|
|
341
341
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
|
|
342
342
|
if (tCommandMethod) {
|
package/packages/ui/index.ts
CHANGED
|
@@ -239,7 +239,15 @@ VxeUI.setConfig({
|
|
|
239
239
|
},
|
|
240
240
|
scrollbarConfig: {
|
|
241
241
|
// width: 14,
|
|
242
|
-
// height: 14
|
|
242
|
+
// height: 14,
|
|
243
|
+
x: {
|
|
244
|
+
// position: 'bottom',
|
|
245
|
+
visible: true
|
|
246
|
+
},
|
|
247
|
+
y: {
|
|
248
|
+
// position: 'right',
|
|
249
|
+
visible: true
|
|
250
|
+
}
|
|
243
251
|
}
|
|
244
252
|
},
|
|
245
253
|
// export: {
|
|
@@ -292,7 +300,9 @@ VxeUI.setConfig({
|
|
|
292
300
|
// types: ['csv', 'html', 'xml', 'txt']
|
|
293
301
|
// },
|
|
294
302
|
// buttons: []
|
|
295
|
-
}
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
gantt: {}
|
|
296
306
|
})
|
|
297
307
|
|
|
298
308
|
const iconPrefix = 'vxe-table-icon-'
|
package/packages/ui/src/dom.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|