vxe-gantt 3.6.2 → 3.6.4

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.
@@ -98,6 +98,14 @@ function createReactData (): GanttReactData {
98
98
  return {
99
99
  tableLoading: false,
100
100
  proxyInited: false,
101
+ // 是否存在纵向滚动条
102
+ overflowY: false,
103
+ // 是否存在横向滚动条
104
+ overflowX: false,
105
+ // 纵向滚动条的宽度
106
+ scrollbarWidth: 0,
107
+ // 横向滚动条的高度
108
+ scrollbarHeight: 0,
101
109
  isZMax: false,
102
110
  tableLinks: [],
103
111
  tableData: [],
@@ -436,13 +444,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
436
444
  const scrollbarOpts = $xeGantt.computeScrollbarOpts as VxeTablePropTypes.ScrollbarConfig
437
445
  return !!(scrollbarOpts.y && scrollbarOpts.y.position === 'left')
438
446
  },
439
- computeStyles () {
447
+ computeWrapperStyle () {
440
448
  const $xeGantt = this
441
449
  const props = $xeGantt
442
450
  const reactData = $xeGantt.reactData
443
451
 
444
452
  const { height, maxHeight, taskBarSubviewConfig } = props
445
- const { isZMax, tZindex } = reactData
453
+ const { isZMax, tZindex, overflowY, scrollbarWidth } = reactData
446
454
  const taskViewOpts = $xeGantt.computeTaskViewOpts as VxeGanttPropTypes.TaskViewConfig
447
455
  const { viewStyle, tableStyle } = taskViewOpts
448
456
  const taskBarOpts = $xeGantt.computeTaskBarOpts as VxeGanttPropTypes.TaskBarConfig
@@ -450,7 +458,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
450
458
  const taskBarSubviewOpts = $xeGantt.computeTaskBarSubviewOpts
451
459
  const taskNowLineOpts = $xeGantt.computeTaskNowLineOpts
452
460
  const { fontColor: nlfColor, bgColor: nlbgColor, width: nlWidth } = taskNowLineOpts
453
- const stys: VxeComponentStyleType = {}
461
+ const stys: VxeComponentStyleType = {
462
+ '--vxe-ui-gantt-scrollbar-width': (overflowY && scrollbarWidth ? scrollbarWidth : 0) + 'px'
463
+ }
454
464
  if (isZMax) {
455
465
  stys.zIndex = tZindex
456
466
  } else {
@@ -2628,8 +2638,12 @@ export default /* define-vxe-component start */ defineVxeComponent({
2628
2638
  },
2629
2639
  renderChildLayout (h: CreateElement, layoutKeys: VxeGanttDefines.LayoutKey[]) {
2630
2640
  const $xeGantt = this
2641
+ const reactData = $xeGantt.reactData
2631
2642
 
2643
+ const { showLeftView, showRightView } = reactData
2632
2644
  const taskSplitOpts = $xeGantt.computeTaskSplitOpts
2645
+ const scrollbarXToTop = $xeGantt.computeScrollbarXToTop
2646
+ const scrollbarYToLeft = $xeGantt.computeScrollbarYToLeft
2633
2647
  const { autoHideCollapseButton } = taskSplitOpts
2634
2648
  const childVNs: VNode[] = []
2635
2649
  layoutKeys.forEach(key => {
@@ -2648,7 +2662,11 @@ export default /* define-vxe-component start */ defineVxeComponent({
2648
2662
  h('div', {
2649
2663
  ref: 'refGanttContainerElem',
2650
2664
  key: 'tv',
2651
- class: ['vxe-gantt--gantt-container', {
2665
+ class: ['vxe-gantt--gantt-container', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
2666
+ 'show--left': showLeftView,
2667
+ 'hide--left': !showLeftView,
2668
+ 'show--right': showRightView,
2669
+ 'hide--right': !showRightView,
2652
2670
  'is--ah-split-btn': autoHideCollapseButton
2653
2671
  }]
2654
2672
  }, [
@@ -2777,9 +2795,9 @@ export default /* define-vxe-component start */ defineVxeComponent({
2777
2795
  const props = $xeGantt
2778
2796
  const reactData = $xeGantt.reactData
2779
2797
 
2780
- const { showLeftView, showRightView, showSplitAnimat } = reactData
2798
+ const { showLeftView, showRightView, overflowY, overflowX, showSplitAnimat } = reactData
2781
2799
  const vSize = $xeGantt.computeSize
2782
- const styles = $xeGantt.computeStyles
2800
+ const wrapperStyle = $xeGantt.computeWrapperStyle
2783
2801
  const isLoading = $xeGantt.computeIsLoading
2784
2802
  const taskSplitOpts = $xeGantt.computeTaskSplitOpts
2785
2803
  const tableBorder = $xeGantt.computeTableBorder
@@ -2797,9 +2815,11 @@ export default /* define-vxe-component start */ defineVxeComponent({
2797
2815
  'show--left': showLeftView,
2798
2816
  'hide--left': !showLeftView,
2799
2817
  'show--right': showRightView,
2800
- 'hide--right': !showRightView
2818
+ 'hide--right': !showRightView,
2819
+ 'is--scroll-y': overflowY,
2820
+ 'is--scroll-x': overflowX
2801
2821
  }],
2802
- style: styles
2822
+ style: wrapperStyle
2803
2823
  }, $xeGantt.renderLayout(h))
2804
2824
  }
2805
2825
  },
@@ -1,6 +1,11 @@
1
1
  @use '../helpers/baseMixin.scss';
2
2
  @use './gantt-module/all.scss';
3
3
 
4
+ // 局部变量
5
+ .vxe-gantt {
6
+ --vxe-ui-gantt-current-split-bar-action-btn-offset-left: 0px;
7
+ }
8
+
4
9
  .vxe-gantt {
5
10
  position: relative;
6
11
  display: flex;
@@ -73,13 +78,6 @@
73
78
  flex-grow: 1;
74
79
  overflow: hidden;
75
80
  }
76
- .vxe-gantt--view-split-bar {
77
- flex-shrink: 0;
78
- width: var(--vxe-ui-gantt-view-split-bar-width);
79
- &.is--resize {
80
- cursor: col-resize;
81
- }
82
- }
83
81
  .vxe-gantt--view-split-bar-handle {
84
82
  background-color: var(--vxe-ui-gantt-view-split-bar-background-color);
85
83
  &:hover,
@@ -87,8 +85,25 @@
87
85
  background-color: var(--vxe-ui-gantt-view-split-bar-hover-background-color);
88
86
  }
89
87
  }
88
+ &.is--animat {
89
+ & .vxe-gantt--table-wrapper {
90
+ @include baseMixin.createAnimationTransition(width, .3s);
91
+ }
92
+ }
93
+ &.show--animat {
94
+ &.hide--right {
95
+ .vxe-gantt--table-wrapper {
96
+ width: calc(100% - var(--vxe-ui-gantt-view-split-bar-width)) !important;
97
+ flex-shrink: 0;
98
+ flex-grow: unset;
99
+ }
100
+ }
101
+ }
102
+ }
103
+
104
+ .vxe-gantt--gantt-container {
90
105
  &.hide--left {
91
- .vxe-gantt--table-wrapper {
106
+ & > .vxe-gantt--table-wrapper {
92
107
  width: 0px !important;
93
108
  flex-shrink: 0;
94
109
  flex-grow: unset;
@@ -96,7 +111,7 @@
96
111
  }
97
112
  &.show--left {
98
113
  &.show--right {
99
- .vxe-gantt--table-wrapper {
114
+ & > .vxe-gantt--table-wrapper {
100
115
  flex-grow: unset;
101
116
  flex-shrink: 0;
102
117
  width: var(--vxe-ui-gantt-view-table-default-width);
@@ -104,28 +119,29 @@
104
119
  }
105
120
  }
106
121
  &.hide--right {
107
- .vxe-gantt--view-wrapper {
122
+ & > .vxe-gantt--view-wrapper {
108
123
  width: 0px !important;
109
124
  flex-shrink: 0;
110
125
  flex-grow: unset;
111
126
  }
112
127
  }
113
- &.is--animat {
114
- & .vxe-gantt--table-wrapper {
115
- @include baseMixin.createAnimationTransition(width, .3s);
116
- }
117
- }
118
- &.show--animat {
119
- &.hide--right {
120
- .vxe-gantt--table-wrapper {
121
- width: calc(100% - var(--vxe-ui-gantt-view-split-bar-width)) !important;
122
- flex-shrink: 0;
123
- flex-grow: unset;
128
+ &.show--left {
129
+ &.show--right {
130
+ .vxe-gantt--view-split-bar {
131
+ width: var(--vxe-ui-gantt-view-split-bar-width);
124
132
  }
125
133
  }
126
134
  }
127
135
  }
128
136
 
137
+ .vxe-gantt--view-split-bar {
138
+ width: 0;
139
+ flex-shrink: 0;
140
+ &.is--resize {
141
+ cursor: col-resize;
142
+ }
143
+ }
144
+
129
145
  .vxe-gantt--layout-body-wrapper {
130
146
  display: flex;
131
147
  flex-direction: row;
@@ -323,9 +339,9 @@
323
339
  }
324
340
  .vxe-gantt--view-split-bar-btn-wrapper {
325
341
  position: absolute;
326
- left: 50%;
342
+ width: 100%;
327
343
  top: 50%;
328
- transform: translate(-50%, -50%);
344
+ transform: translateY(-50%);
329
345
  z-index: 5;
330
346
  pointer-events: none;
331
347
  }
@@ -352,15 +368,27 @@
352
368
  transform: scale(0.9);
353
369
  }
354
370
  &.is--prev {
355
- left: calc(var(--vxe-ui-gantt-view-split-bar-action-btn-width) * -1 - 0.2em);
371
+ left: calc(var(--vxe-ui-gantt-view-split-bar-action-btn-width) * -1 - var(--vxe-ui-gantt-current-split-bar-action-btn-offset-left) - 0.2em);
356
372
  }
357
373
  &.is--next {
358
- right: calc(var(--vxe-ui-gantt-view-split-bar-action-btn-width) * -1 - 0.2em);
374
+ right: calc(var(--vxe-ui-gantt-view-split-bar-action-btn-width) * -1 - var(--vxe-ui-gantt-current-split-bar-action-btn-offset-left) - 0.2em);
359
375
  }
360
376
  i {
361
377
  font-size: 0.5em;
362
378
  }
363
379
  }
380
+ .vxe-gantt--gantt-container {
381
+ &.sy-pos--right {
382
+ &.hide--right {
383
+ --vxe-ui-gantt-current-split-bar-action-btn-offset-left: var(--vxe-ui-gantt-scrollbar-width);
384
+ }
385
+ }
386
+ &.sy-pos--left {
387
+ &.hide--left {
388
+ --vxe-ui-gantt-current-split-bar-action-btn-offset-left: var(--vxe-ui-gantt-scrollbar-width);
389
+ }
390
+ }
391
+ }
364
392
 
365
393
  .vxe-gantt--resizable-split-tip {
366
394
  display: none;