Skip to content

Commit 9817c47

Browse files
authored
feat(gantt): support hide quick time jump (#597)
1 parent dfdee11 commit 9817c47

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

example/src/app/gantt/gantt.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class AppGanttExampleComponent implements OnInit, AfterViewInit {
6565
{ id: '000002', title: 'Task 2', start: 1617361997, end: 1625483597, progress: 0.5, linkable: false },
6666
{ id: '000003', title: 'Task 3 (不可拖动)', start: 1628507597, end: 1633345997, itemDraggable: false },
6767
{ id: '000004', title: 'Task 4', start: 1624705997 },
68-
{ id: '000005', title: 'Task 5', start: 1756628881, end: 1756801681, color: '#709dc1' },
68+
{ id: '000005', title: 'Task 5', start: 1756543568, end: 1756629968, color: '#709dc1' },
6969
{ id: '000006', title: 'Task 6', start: 1641121997, end: 1645528397 },
7070
{ id: '000007', title: 'Task 7', start: 1639393997, end: 1640862797 },
7171
{ id: '000008', title: 'Task 8', end: 1628783999, color: '#709dc1' },

packages/gantt/src/components/bar/bar.component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ export class NgxGanttBarComponent extends GanttItemUpper implements OnInit, Afte
127127
const contentElement = this.contentElementRef.nativeElement;
128128
const barElement = this.elementRef.nativeElement;
129129

130-
if (this.item.barStyle && Object.prototype.hasOwnProperty.call(this.item.barStyle, 'visibility')) {
131-
barElement.style.visibility = this.item.barStyle?.visibility as string;
132-
}
133130
if (this.item.refs?.width) {
134131
const color = this.item.color || barBackground;
135132

packages/gantt/src/components/main/gantt-main.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646
<div class="gantt-quick-time-focus" [style.width.px]="dom.visibleRangeX().max - dom.visibleRangeX().min">
4747
@for (data of viewportItems; track trackBy(i, data); let i = $index) {
4848
@let item = toItemType(data);
49-
<div class="gantt-quick-time-focus-item" [style.height.px]="ganttUpper.styles.lineHeight">
49+
<div
50+
class="gantt-quick-time-focus-item"
51+
[ngClass]="{ 'gantt-quick-time-focus-item-hide': !item?.refs?.width }"
52+
[style.height.px]="ganttUpper.styles.lineHeight"
53+
>
5054
<span class="ml-2">
5155
@if (item.refs?.x < dom.visibleRangeX().min && item.refs?.width) {
5256
<a class="gantt-quick-time-focus-item-arrow link-secondary" href="javascript:;" (click)="quickTime(item.origin, 'left')">

packages/gantt/src/gantt.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@
164164
}
165165
}
166166
}
167+
168+
&-hide {
169+
visibility: hidden;
170+
}
167171
}
168172
}
169173
}

0 commit comments

Comments
 (0)