Skip to content

Commit

Permalink
fix: change compilationMode to partial
Browse files Browse the repository at this point in the history
  • Loading branch information
HandsomeButterball committed Jan 18, 2022
1 parent 21f4b16 commit 172f641
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
11 changes: 8 additions & 3 deletions packages/gantt/src/components/table/gantt-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ import {
ViewChild,
ElementRef,
OnChanges,
SimpleChanges
SimpleChanges,
Inject
} from '@angular/core';
import { GanttItemInternal, GanttGroupInternal } from '../../class';
import { NgxGanttTableColumnComponent } from '../../table/gantt-column.component';
import { defaultColumnWidth, minColumnWidth, NgxGanttComponent } from '../../gantt.component';
// import { defaultColumnWidth, minColumnWidth } from '../../gantt.component';
import { CdkDragEnd, CdkDragMove, CdkDragStart } from '@angular/cdk/drag-drop';
import { coerceCssPixelValue } from '@angular/cdk/coercion';
import { GanttAbstractComponent, GANTT_ABSTRACT_TOKEN } from '../../gantt-abstract';

export const defaultColumnWidth = 100;
export const minColumnWidth = 80;

interface DragFixedConfig {
target: HTMLElement;
Expand Down Expand Up @@ -55,7 +60,7 @@ export class GanttTableComponent implements OnInit, OnChanges {

@HostBinding('class.gantt-table-empty') ganttTableEmptyClass = false;

constructor(public gantt: NgxGanttComponent, private elementRef: ElementRef) {}
constructor(@Inject(GANTT_ABSTRACT_TOKEN) public gantt: GanttAbstractComponent, private elementRef: ElementRef) {}

ngOnInit() {}

Expand Down
14 changes: 14 additions & 0 deletions packages/gantt/src/gantt-abstract.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { InjectionToken } from '@angular/core';
import { GanttGroupInternal, GanttItemInternal } from './class';
import { GanttStyles } from './gantt.styles';
import { NgxGanttTableComponent } from './table/gantt-table.component';

export interface GanttAbstractComponent {
table: NgxGanttTableComponent;
styles: GanttStyles;
maxLevel: number;
expandGroup(group: GanttGroupInternal): void;
expandChildren(item: GanttItemInternal): void;
}

export const GANTT_ABSTRACT_TOKEN = new InjectionToken<GanttAbstractComponent>('gantt-abstract-token');
14 changes: 8 additions & 6 deletions packages/gantt/src/gantt.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
ContentChildren,
QueryList,
AfterViewInit,
ViewChild,
ContentChild,
TemplateRef
TemplateRef,
forwardRef
} from '@angular/core';
import { startWith, takeUntil, take, finalize } from 'rxjs/operators';
import { Subject, Observable } from 'rxjs';
Expand All @@ -26,10 +26,8 @@ import { NgxGanttTableColumnComponent } from './table/gantt-column.component';
import { sideWidth } from './gantt.styles';
import { coerceCssPixelValue } from '@angular/cdk/coercion';
import { NgxGanttTableComponent } from './table/gantt-table.component';

export const defaultColumnWidth = 100;
export const minColumnWidth = 80;

import { GANTT_ABSTRACT_TOKEN } from './gantt-abstract';
import { defaultColumnWidth } from './components/table/gantt-table.component';
@Component({
selector: 'ngx-gantt',
templateUrl: './gantt.component.html',
Expand All @@ -38,6 +36,10 @@ export const minColumnWidth = 80;
{
provide: GANTT_UPPER_TOKEN,
useExisting: NgxGanttComponent
},
{
provide: GANTT_ABSTRACT_TOKEN,
useExisting: forwardRef(() => NgxGanttComponent)
}
]
})
Expand Down
4 changes: 3 additions & 1 deletion packages/gantt/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {}
"angularCompilerOptions": {
"compilationMode": "partial"
}
}

0 comments on commit 172f641

Please sign in to comment.