@worktile/gantt 19.0.7 → 19.0.8-next.0
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/class/date-point.d.ts +2 -0
- package/components/bar/bar.component.d.ts +4 -4
- package/components/table/gantt-table.scss +2 -0
- package/fesm2022/worktile-gantt.mjs +1303 -1300
- package/fesm2022/worktile-gantt.mjs.map +1 -1
- package/gantt-upper.d.ts +10 -11
- package/gantt.component.d.ts +4 -5
- package/gantt.config.d.ts +2 -2
- package/package.json +1 -1
- package/public-api.d.ts +18 -18
- package/views/day.d.ts +1 -1
- package/views/factory.d.ts +5 -5
- package/views/view.d.ts +5 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDate, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addQuarters, addYears, startOfMinute, startOfHour, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfMinute, endOfHour, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, getUnixTime, format, isWeekend, isToday, setDefaultOptions, differenceInHours, differenceInMinutes, differenceInDays, eachWeekOfInterval, eachDayOfInterval, eachHourOfInterval, differenceInCalendarQuarters, eachMonthOfInterval, eachYearOfInterval, differenceInCalendarYears } from 'date-fns';
|
|
2
|
+
export { addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarQuarters, differenceInDays, differenceInMinutes, eachDayOfInterval, eachHourOfInterval, eachMonthOfInterval, eachWeekOfInterval, endOfDay, endOfHour, endOfMinute, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format, fromUnixTime, getDaysInMonth, getUnixTime, getWeek, isToday, isWeekend, setDate, startOfDay, startOfHour, startOfMinute, startOfMonth, startOfQuarter, startOfWeek, startOfYear } from 'date-fns';
|
|
3
|
+
import { TZDate } from '@date-fns/tz';
|
|
4
|
+
import { BehaviorSubject, Subject, from, fromEvent, Observable, merge, EMPTY, interval, animationFrameScheduler, takeUntil as takeUntil$1, take as take$1, combineLatest, startWith as startWith$1, auditTime as auditTime$1, filter } from 'rxjs';
|
|
5
5
|
import { isPlatformServer, NgTemplateOutlet, NgStyle, NgClass, DOCUMENT, CommonModule } from '@angular/common';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
|
-
import { InjectionToken, inject, Inject, Injectable, EventEmitter, HostBinding, ContentChild, Output, Input, Directive, signal, PLATFORM_ID, effect, ViewChildren, ViewChild, Component,
|
|
8
|
-
import { BehaviorSubject, Subject, from, fromEvent, Observable, merge, EMPTY, interval, animationFrameScheduler, take as take$1, takeUntil as takeUntil$1, combineLatest, startWith as startWith$1, auditTime as auditTime$1, filter } from 'rxjs';
|
|
7
|
+
import { InjectionToken, inject, Inject, Injectable, EventEmitter, HostBinding, ContentChild, Output, Input, Directive, signal, PLATFORM_ID, effect, ViewChildren, ViewChild, Component, NgZone, input, ElementRef, Pipe, HostListener, Optional, forwardRef, ContentChildren, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
9
8
|
import { take, takeUntil, skip, map, pairwise, auditTime, startWith, switchMap, debounceTime, finalize } from 'rxjs/operators';
|
|
10
|
-
import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDate, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addQuarters, addYears, startOfMinute, startOfHour, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfMinute, endOfHour, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, getUnixTime, format, isWeekend, isToday, differenceInHours, differenceInMinutes, differenceInDays, differenceInCalendarQuarters, eachMonthOfInterval, eachYearOfInterval, eachWeekOfInterval, eachDayOfInterval, differenceInCalendarYears, eachHourOfInterval, setDefaultOptions } from 'date-fns';
|
|
11
|
-
export { addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarQuarters, differenceInDays, differenceInMinutes, eachDayOfInterval, eachHourOfInterval, eachMonthOfInterval, eachWeekOfInterval, endOfDay, endOfHour, endOfMinute, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format, fromUnixTime, getDaysInMonth, getUnixTime, getWeek, isToday, isWeekend, setDate, startOfDay, startOfHour, startOfMinute, startOfMonth, startOfQuarter, startOfWeek, startOfYear } from 'date-fns';
|
|
12
|
-
import { TZDate } from '@date-fns/tz';
|
|
13
|
-
import { de, ru } from 'date-fns/locale';
|
|
14
|
-
import { SelectionModel } from '@angular/cdk/collections';
|
|
15
9
|
import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
10
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
11
|
+
import { de, ru } from 'date-fns/locale';
|
|
12
|
+
import * as i1 from '@angular/cdk/drag-drop';
|
|
13
|
+
import { CdkDrag, CdkDropList, CdkDragHandle, DragDropModule } from '@angular/cdk/drag-drop';
|
|
14
|
+
import * as i1$1 from '@angular/cdk/scrolling';
|
|
15
|
+
import { CdkScrollable, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, ScrollingModule } from '@angular/cdk/scrolling';
|
|
16
16
|
import { __decorate, __param } from 'tslib';
|
|
17
17
|
|
|
18
18
|
class GanttDatePoint {
|
|
@@ -378,179 +378,15 @@ class GanttBaselineItemInternal {
|
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
const
|
|
382
|
-
const
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
get start() {
|
|
391
|
-
return this.start$.getValue();
|
|
392
|
-
}
|
|
393
|
-
get end() {
|
|
394
|
-
return this.end$.getValue();
|
|
395
|
-
}
|
|
396
|
-
constructor(start, end, options) {
|
|
397
|
-
this.showTimeline = true;
|
|
398
|
-
this.dateFormats = {};
|
|
399
|
-
this.options = Object.assign({}, viewOptions$6, options);
|
|
400
|
-
const startDate = start.isCustom
|
|
401
|
-
? this.viewStartOf(start.date)
|
|
402
|
-
: this.viewStartOf(start.date.value < this.options.start.value ? start.date : this.options.start);
|
|
403
|
-
const endDate = end.isCustom
|
|
404
|
-
? this.viewEndOf(end.date)
|
|
405
|
-
: this.viewEndOf(end.date.value > this.options.end.value ? end.date : this.options.end);
|
|
406
|
-
this.start$ = new BehaviorSubject(startDate);
|
|
407
|
-
this.end$ = new BehaviorSubject(endDate);
|
|
408
|
-
this.initialize();
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* deprecated, please use viewStartOf()
|
|
412
|
-
* @deprecated
|
|
413
|
-
*/
|
|
414
|
-
startOf(date) {
|
|
415
|
-
return this.viewStartOf(date);
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* deprecated, please use viewEndOf()
|
|
419
|
-
* @deprecated
|
|
420
|
-
*/
|
|
421
|
-
endOf(date) {
|
|
422
|
-
return this.viewEndOf(date);
|
|
423
|
-
}
|
|
424
|
-
startOfPrecision(date) {
|
|
425
|
-
switch (this.options.datePrecisionUnit) {
|
|
426
|
-
case 'minute':
|
|
427
|
-
return date.startOfMinute();
|
|
428
|
-
case 'hour':
|
|
429
|
-
return date.startOfHour();
|
|
430
|
-
default:
|
|
431
|
-
return date.startOfDay();
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
endOfPrecision(date) {
|
|
435
|
-
switch (this.options.datePrecisionUnit) {
|
|
436
|
-
case 'minute':
|
|
437
|
-
return date.endOfMinute();
|
|
438
|
-
case 'hour':
|
|
439
|
-
return date.endOfHour();
|
|
440
|
-
default:
|
|
441
|
-
return date.endOfDay();
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
differenceByPrecisionUnit(dateLeft, dateRight) {
|
|
445
|
-
switch (this.options.datePrecisionUnit) {
|
|
446
|
-
case 'minute':
|
|
447
|
-
return differenceInMinutes(dateLeft.value, dateRight.value);
|
|
448
|
-
case 'hour':
|
|
449
|
-
return differenceInHours(dateLeft.value, dateRight.value);
|
|
450
|
-
default:
|
|
451
|
-
return differenceInCalendarDays(dateLeft.value, dateRight.value);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
getDateIntervalWidth(start, end) {
|
|
455
|
-
let result = 0;
|
|
456
|
-
const days = differenceInDays(end.value, start.value);
|
|
457
|
-
for (let i = 0; i < Math.abs(days); i++) {
|
|
458
|
-
result += this.getDayOccupancyWidth(start.addDays(i));
|
|
459
|
-
}
|
|
460
|
-
result = days >= 0 ? result : -result;
|
|
461
|
-
return Number(result.toFixed(3));
|
|
462
|
-
}
|
|
463
|
-
initialize() {
|
|
464
|
-
this.primaryDatePoints = this.getPrimaryDatePoints();
|
|
465
|
-
this.secondaryDatePoints = this.getSecondaryDatePoints();
|
|
466
|
-
this.width = this.getWidth();
|
|
467
|
-
this.cellWidth = this.getCellWidth();
|
|
468
|
-
this.primaryWidth = this.getPrimaryWidth();
|
|
469
|
-
}
|
|
470
|
-
addStartDate() {
|
|
471
|
-
const start = this.viewStartOf(this.start.add(this.options.addAmount * -1, this.options.addUnit));
|
|
472
|
-
if (start.value >= this.options.min.value) {
|
|
473
|
-
const origin = this.start;
|
|
474
|
-
this.start$.next(start);
|
|
475
|
-
this.initialize();
|
|
476
|
-
return { start: this.start, end: origin };
|
|
477
|
-
}
|
|
478
|
-
return null;
|
|
479
|
-
}
|
|
480
|
-
addEndDate() {
|
|
481
|
-
const end = this.viewEndOf(this.end.add(this.options.addAmount, this.options.addUnit));
|
|
482
|
-
if (end.value <= this.options.max.value) {
|
|
483
|
-
const origin = this.end;
|
|
484
|
-
this.end$.next(end);
|
|
485
|
-
this.initialize();
|
|
486
|
-
return { start: origin, end: this.end };
|
|
487
|
-
}
|
|
488
|
-
return null;
|
|
489
|
-
}
|
|
490
|
-
updateDate(start, end) {
|
|
491
|
-
start = this.viewStartOf(start);
|
|
492
|
-
end = this.viewEndOf(end);
|
|
493
|
-
if (start.value < this.start.value) {
|
|
494
|
-
this.start$.next(start);
|
|
495
|
-
}
|
|
496
|
-
if (end.value > this.end.value) {
|
|
497
|
-
this.end$.next(end);
|
|
498
|
-
}
|
|
499
|
-
this.initialize();
|
|
500
|
-
}
|
|
501
|
-
// 获取View的宽度
|
|
502
|
-
getWidth() {
|
|
503
|
-
return this.getCellWidth() * this.secondaryDatePoints.length;
|
|
504
|
-
}
|
|
505
|
-
// 获取单个网格的宽度
|
|
506
|
-
getCellWidth() {
|
|
507
|
-
return this.options.cellWidth;
|
|
508
|
-
}
|
|
509
|
-
// 获取当前时间的X坐标
|
|
510
|
-
getTodayXPoint() {
|
|
511
|
-
const toady = new GanttDate().startOfDay();
|
|
512
|
-
if (toady.value > this.start.value && toady.value < this.end.value) {
|
|
513
|
-
const x = this.getXPointByDate(toady) + this.getDayOccupancyWidth(toady) / 2;
|
|
514
|
-
return x;
|
|
515
|
-
}
|
|
516
|
-
else {
|
|
517
|
-
return null;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
// 获取指定时间的X坐标
|
|
521
|
-
getXPointByDate(date) {
|
|
522
|
-
return this.getDateIntervalWidth(this.start, date);
|
|
523
|
-
}
|
|
524
|
-
// 根据X坐标获取对应时间
|
|
525
|
-
getDateByXPoint(x) {
|
|
526
|
-
const indexOfSecondaryDate = Math.max(Math.floor(x / this.getCellWidth()), 0);
|
|
527
|
-
const matchDate = this.secondaryDatePoints[Math.min(this.secondaryDatePoints.length - 1, indexOfSecondaryDate)];
|
|
528
|
-
const dayWidth = this.getDayOccupancyWidth(matchDate?.start);
|
|
529
|
-
if (dayWidth === this.getCellWidth()) {
|
|
530
|
-
return matchDate?.start;
|
|
531
|
-
}
|
|
532
|
-
else {
|
|
533
|
-
const day = Math.floor((x % this.getCellWidth()) / dayWidth);
|
|
534
|
-
return matchDate?.start.addDays(day);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
// 获取指定时间范围的宽度
|
|
538
|
-
getDateRangeWidth(start, end) {
|
|
539
|
-
// addSeconds(1) 是因为计算相差天会以一个整天来计算 end时间一般是59分59秒不是一个整天,所以需要加1
|
|
540
|
-
return this.getDateIntervalWidth(this.startOfPrecision(start), this.endOfPrecision(end).addSeconds(1));
|
|
541
|
-
}
|
|
542
|
-
// 根据日期精度获取最小时间范围的宽度
|
|
543
|
-
getMinRangeWidthByPrecisionUnit(date) {
|
|
544
|
-
switch (this.options.datePrecisionUnit) {
|
|
545
|
-
case 'minute':
|
|
546
|
-
return this.getDayOccupancyWidth(date) / 24 / 60;
|
|
547
|
-
case 'hour':
|
|
548
|
-
return this.getDayOccupancyWidth(date) / 24;
|
|
549
|
-
default:
|
|
550
|
-
return this.getDayOccupancyWidth(date);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
381
|
+
const sideWidth = 400;
|
|
382
|
+
const sideMiddleWidth = 500;
|
|
383
|
+
const sideMaxWidth = 600;
|
|
384
|
+
const sideMinWidth = 400;
|
|
385
|
+
const barBackground = '#6698ff';
|
|
386
|
+
const rangeHeight = 17;
|
|
387
|
+
const todayHeight = 24;
|
|
388
|
+
const todayWidth = 35;
|
|
389
|
+
const todayBorderRadius = 4;
|
|
554
390
|
|
|
555
391
|
var GanttI18nLocale;
|
|
556
392
|
(function (GanttI18nLocale) {
|
|
@@ -563,7 +399,7 @@ var GanttI18nLocale;
|
|
|
563
399
|
})(GanttI18nLocale || (GanttI18nLocale = {}));
|
|
564
400
|
const GANTT_I18N_LOCALE_TOKEN = new InjectionToken('gantt-i18n-locale');
|
|
565
401
|
|
|
566
|
-
var
|
|
402
|
+
var zhHansLocale = {
|
|
567
403
|
id: GanttI18nLocale.zhHans,
|
|
568
404
|
views: {
|
|
569
405
|
[GanttViewType.hour]: {
|
|
@@ -610,7 +446,7 @@ var zhHans = {
|
|
|
610
446
|
}
|
|
611
447
|
};
|
|
612
448
|
|
|
613
|
-
var
|
|
449
|
+
var zhHantLocale = {
|
|
614
450
|
id: GanttI18nLocale.zhHant,
|
|
615
451
|
views: {
|
|
616
452
|
[GanttViewType.hour]: {
|
|
@@ -657,50 +493,188 @@ var zhHant = {
|
|
|
657
493
|
}
|
|
658
494
|
};
|
|
659
495
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
[
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
},
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
496
|
+
const defaultConfig = {
|
|
497
|
+
locale: GanttI18nLocale.zhHans,
|
|
498
|
+
linkOptions: {
|
|
499
|
+
dependencyTypes: [GanttLinkType.fs],
|
|
500
|
+
showArrow: false,
|
|
501
|
+
lineType: GanttLinkLineType.curve
|
|
502
|
+
},
|
|
503
|
+
styleOptions: {
|
|
504
|
+
headerHeight: 44,
|
|
505
|
+
lineHeight: 44,
|
|
506
|
+
barHeight: 22
|
|
507
|
+
},
|
|
508
|
+
dateOptions: {
|
|
509
|
+
weekStartsOn: 1
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
const GANTT_GLOBAL_CONFIG = new InjectionToken('GANTT_GLOBAL_CONFIG');
|
|
513
|
+
class GanttConfigService {
|
|
514
|
+
constructor(globalConfig) {
|
|
515
|
+
const localeId = globalConfig.locale || defaultConfig.locale;
|
|
516
|
+
this.config = {
|
|
517
|
+
locale: localeId,
|
|
518
|
+
dateFormat: Object.assign({}, defaultConfig.dateFormat, globalConfig.dateFormat),
|
|
519
|
+
styleOptions: Object.assign({}, defaultConfig.styleOptions, globalConfig.styleOptions),
|
|
520
|
+
linkOptions: Object.assign({}, defaultConfig.linkOptions, globalConfig.linkOptions),
|
|
521
|
+
dateOptions: Object.assign({}, defaultConfig.dateOptions, globalConfig.dateOptions)
|
|
522
|
+
};
|
|
523
|
+
this.i18nLocales = inject(GANTT_I18N_LOCALE_TOKEN).reduce((result, localeConfig) => {
|
|
524
|
+
result[localeConfig.id] = localeConfig; // 这里使用 `id` 作为 key
|
|
525
|
+
return result;
|
|
526
|
+
}, {
|
|
527
|
+
['zh-cn']: zhHansLocale,
|
|
528
|
+
['zh-tw']: zhHantLocale
|
|
529
|
+
});
|
|
530
|
+
if (this.config.dateOptions?.timeZone) {
|
|
531
|
+
setDefaultTimeZone(this.config.dateOptions.timeZone);
|
|
532
|
+
}
|
|
533
|
+
setDefaultOptions({
|
|
534
|
+
locale: this.getDateLocale(),
|
|
535
|
+
weekStartsOn: this.config?.dateOptions?.weekStartsOn
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
setLocale(locale) {
|
|
539
|
+
this.config.locale = locale;
|
|
540
|
+
}
|
|
541
|
+
getLocaleConfig() {
|
|
542
|
+
return this.i18nLocales[this.config.locale] ?? this.i18nLocales[this.config.locale.toLowerCase()] ?? zhHansLocale;
|
|
543
|
+
}
|
|
544
|
+
getViewsLocale() {
|
|
545
|
+
return this.getLocaleConfig().views;
|
|
546
|
+
}
|
|
547
|
+
getDateLocale() {
|
|
548
|
+
return this.config.dateOptions?.locale ?? this.getLocaleConfig().dateLocale;
|
|
549
|
+
}
|
|
550
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, deps: [{ token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
551
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, providedIn: 'root' }); }
|
|
552
|
+
}
|
|
553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, decorators: [{
|
|
554
|
+
type: Injectable,
|
|
555
|
+
args: [{ providedIn: 'root' }]
|
|
556
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
557
|
+
type: Inject,
|
|
558
|
+
args: [GANTT_GLOBAL_CONFIG]
|
|
559
|
+
}] }] });
|
|
560
|
+
|
|
561
|
+
function isNumber(value) {
|
|
562
|
+
return typeof value === 'number';
|
|
563
|
+
}
|
|
564
|
+
function isString(value) {
|
|
565
|
+
return typeof value === 'string';
|
|
566
|
+
}
|
|
567
|
+
function isUndefined(value) {
|
|
568
|
+
return value === undefined;
|
|
569
|
+
}
|
|
570
|
+
function hexToRgb(color, opacity = 1) {
|
|
571
|
+
if (/^#/g.test(color)) {
|
|
572
|
+
return `rgba(${parseInt(color.slice(1, 3), 16)},${parseInt(color.slice(3, 5), 16)},${parseInt(color.slice(5, 7), 16)},${opacity})`;
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
return color;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
function uniqBy(array, key) {
|
|
579
|
+
const valuesMap = {};
|
|
580
|
+
const result = [];
|
|
581
|
+
(array || []).forEach((value) => {
|
|
582
|
+
const _key = value[key];
|
|
583
|
+
if (!valuesMap[_key]) {
|
|
584
|
+
valuesMap[_key] = value;
|
|
585
|
+
result.push(value);
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
return result;
|
|
589
|
+
}
|
|
590
|
+
function flatten(array) {
|
|
591
|
+
return array.reduce((pre, cur) => {
|
|
592
|
+
return pre.concat(Array.isArray(cur) ? flatten(cur) : cur);
|
|
593
|
+
}, []);
|
|
594
|
+
}
|
|
595
|
+
// export function recursiveItems(items: GanttItemInternal[]) {
|
|
596
|
+
// const result = [];
|
|
597
|
+
// (items || []).forEach((item) => {
|
|
598
|
+
// result.push(item);
|
|
599
|
+
// if (item.expanded && item.children) {
|
|
600
|
+
// result.push(...recursiveItems(item.children));
|
|
601
|
+
// }
|
|
602
|
+
// });
|
|
603
|
+
// return result;
|
|
604
|
+
// }
|
|
605
|
+
function recursiveItems(items) {
|
|
606
|
+
const result = [];
|
|
607
|
+
(items || []).forEach((item) => {
|
|
608
|
+
result.push(item);
|
|
609
|
+
if (item.expanded && item.children) {
|
|
610
|
+
result.push(...recursiveItems(item.children));
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
return result;
|
|
614
|
+
}
|
|
615
|
+
function getFlatItems(items) {
|
|
616
|
+
const result = [];
|
|
617
|
+
(items || []).forEach((item) => {
|
|
618
|
+
result.push(item);
|
|
619
|
+
if (item.children) {
|
|
620
|
+
result.push(...getFlatItems(item.children));
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
return result;
|
|
624
|
+
}
|
|
625
|
+
function keyBy(array, key) {
|
|
626
|
+
const result = {};
|
|
627
|
+
array.forEach((item) => {
|
|
628
|
+
const keyValue = item[key];
|
|
629
|
+
result[keyValue] = item;
|
|
630
|
+
});
|
|
631
|
+
return result;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
var enUsLocale = {
|
|
635
|
+
id: GanttI18nLocale.enUs,
|
|
636
|
+
views: {
|
|
637
|
+
[GanttViewType.hour]: {
|
|
638
|
+
label: 'Hourly',
|
|
639
|
+
dateFormats: {
|
|
640
|
+
primary: 'MMM d',
|
|
641
|
+
secondary: 'HH:mm'
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
[GanttViewType.day]: {
|
|
645
|
+
label: 'Daily',
|
|
646
|
+
dateFormats: {
|
|
647
|
+
primary: 'MMM yyyy',
|
|
648
|
+
secondary: 'd'
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
[GanttViewType.week]: {
|
|
652
|
+
label: 'Weekly',
|
|
653
|
+
dateFormats: {
|
|
654
|
+
primary: 'yyyy',
|
|
655
|
+
secondary: 'wo'
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
[GanttViewType.month]: {
|
|
659
|
+
label: 'Monthly',
|
|
660
|
+
dateFormats: {
|
|
661
|
+
primary: "yyyy 'Q'Q",
|
|
662
|
+
secondary: 'MMM'
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
[GanttViewType.quarter]: {
|
|
666
|
+
label: 'Quarterly',
|
|
667
|
+
dateFormats: {
|
|
668
|
+
primary: 'yyyy',
|
|
669
|
+
secondary: "yyyy 'Q'Q"
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
[GanttViewType.year]: {
|
|
673
|
+
label: 'Yearly',
|
|
674
|
+
dateFormats: {
|
|
675
|
+
secondary: 'yyyy'
|
|
676
|
+
}
|
|
677
|
+
}
|
|
704
678
|
}
|
|
705
679
|
};
|
|
706
680
|
|
|
@@ -848,121 +822,202 @@ var ruRuLocale = {
|
|
|
848
822
|
};
|
|
849
823
|
|
|
850
824
|
const i18nLocaleProvides = [
|
|
851
|
-
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue:
|
|
852
|
-
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue:
|
|
825
|
+
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: zhHansLocale, multi: true },
|
|
826
|
+
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: zhHantLocale, multi: true },
|
|
853
827
|
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: enUsLocale, multi: true },
|
|
854
828
|
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: jaJpLocale, multi: true },
|
|
855
829
|
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: deDeLocale, multi: true },
|
|
856
830
|
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: ruRuLocale, multi: true }
|
|
857
831
|
];
|
|
858
832
|
|
|
859
|
-
const
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
833
|
+
const primaryDatePointTop = '40%';
|
|
834
|
+
const secondaryDatePointTop = '80%';
|
|
835
|
+
const viewOptions$6 = {
|
|
836
|
+
min: new GanttDate().addYears(-1).startOfYear(),
|
|
837
|
+
max: new GanttDate().addYears(1).endOfYear(),
|
|
838
|
+
datePrecisionUnit: 'day',
|
|
839
|
+
dragPreviewDateFormat: 'MM-dd'
|
|
866
840
|
};
|
|
867
|
-
class
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
this.viewType = GanttViewType.month;
|
|
841
|
+
class GanttView {
|
|
842
|
+
get start() {
|
|
843
|
+
return this.start$.getValue();
|
|
871
844
|
}
|
|
872
|
-
|
|
873
|
-
return
|
|
845
|
+
get end() {
|
|
846
|
+
return this.end$.getValue();
|
|
874
847
|
}
|
|
875
|
-
|
|
876
|
-
|
|
848
|
+
constructor(start, end, options) {
|
|
849
|
+
this.showTimeline = true;
|
|
850
|
+
this.dateFormats = {};
|
|
851
|
+
this.options = Object.assign({}, viewOptions$6, options);
|
|
852
|
+
const startDate = start.isCustom
|
|
853
|
+
? this.viewStartOf(start.date)
|
|
854
|
+
: this.viewStartOf(start.date.value < this.options.start.value ? start.date : this.options.start);
|
|
855
|
+
const endDate = end.isCustom
|
|
856
|
+
? this.viewEndOf(end.date)
|
|
857
|
+
: this.viewEndOf(end.date.value > this.options.end.value ? end.date : this.options.end);
|
|
858
|
+
this.start$ = new BehaviorSubject(startDate);
|
|
859
|
+
this.end$ = new BehaviorSubject(endDate);
|
|
860
|
+
this.initialize();
|
|
877
861
|
}
|
|
878
|
-
|
|
879
|
-
|
|
862
|
+
/**
|
|
863
|
+
* deprecated, please use viewStartOf()
|
|
864
|
+
* @deprecated
|
|
865
|
+
*/
|
|
866
|
+
startOf(date) {
|
|
867
|
+
return this.viewStartOf(date);
|
|
880
868
|
}
|
|
881
|
-
|
|
882
|
-
|
|
869
|
+
/**
|
|
870
|
+
* deprecated, please use viewEndOf()
|
|
871
|
+
* @deprecated
|
|
872
|
+
*/
|
|
873
|
+
endOf(date) {
|
|
874
|
+
return this.viewEndOf(date);
|
|
883
875
|
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
876
|
+
hideHoliday(date) {
|
|
877
|
+
return this.options.hoilday?.hideHoliday && this.options.hoilday?.isHoliday?.(date);
|
|
878
|
+
}
|
|
879
|
+
startOfPrecision(date) {
|
|
880
|
+
switch (this.options.datePrecisionUnit) {
|
|
881
|
+
case 'minute':
|
|
882
|
+
return date.startOfMinute();
|
|
883
|
+
case 'hour':
|
|
884
|
+
return date.startOfHour();
|
|
885
|
+
default:
|
|
886
|
+
return date.startOfDay();
|
|
891
887
|
}
|
|
892
|
-
return points;
|
|
893
888
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
889
|
+
endOfPrecision(date) {
|
|
890
|
+
switch (this.options.datePrecisionUnit) {
|
|
891
|
+
case 'minute':
|
|
892
|
+
return date.endOfMinute();
|
|
893
|
+
case 'hour':
|
|
894
|
+
return date.endOfHour();
|
|
895
|
+
default:
|
|
896
|
+
return date.endOfDay();
|
|
901
897
|
}
|
|
902
|
-
return points;
|
|
903
898
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
addUnit: 'year',
|
|
914
|
-
dateDisplayFormats: zhHant.views.quarter.dateFormats
|
|
915
|
-
};
|
|
916
|
-
class GanttViewQuarter extends GanttView {
|
|
917
|
-
constructor(start, end, options) {
|
|
918
|
-
super(start, end, Object.assign({}, viewOptions$4, options));
|
|
919
|
-
this.viewType = GanttViewType.quarter;
|
|
899
|
+
differenceByPrecisionUnit(dateLeft, dateRight) {
|
|
900
|
+
switch (this.options.datePrecisionUnit) {
|
|
901
|
+
case 'minute':
|
|
902
|
+
return differenceInMinutes(dateLeft.value, dateRight.value);
|
|
903
|
+
case 'hour':
|
|
904
|
+
return differenceInHours(dateLeft.value, dateRight.value);
|
|
905
|
+
default:
|
|
906
|
+
return differenceInCalendarDays(dateLeft.value, dateRight.value);
|
|
907
|
+
}
|
|
920
908
|
}
|
|
921
|
-
|
|
922
|
-
|
|
909
|
+
getDateIntervalWidth(start, end) {
|
|
910
|
+
let result = 0;
|
|
911
|
+
const days = differenceInDays(end.value, start.value);
|
|
912
|
+
for (let i = 0; i < Math.abs(days); i++) {
|
|
913
|
+
result += this.getDayOccupancyWidth(start.addDays(i));
|
|
914
|
+
}
|
|
915
|
+
result = days >= 0 ? result : -result;
|
|
916
|
+
return Number(result.toFixed(3));
|
|
923
917
|
}
|
|
924
|
-
|
|
925
|
-
|
|
918
|
+
initialize() {
|
|
919
|
+
this.cellWidth = this.getCellWidth();
|
|
920
|
+
this.primaryDatePoints = this.getPrimaryDatePoints();
|
|
921
|
+
this.secondaryDatePoints = this.getSecondaryDatePoints();
|
|
922
|
+
this.width = this.getWidth();
|
|
923
|
+
this.primaryWidth = this.getPrimaryWidth();
|
|
926
924
|
}
|
|
927
|
-
|
|
928
|
-
|
|
925
|
+
addStartDate() {
|
|
926
|
+
const start = this.viewStartOf(this.start.add(this.options.addAmount * -1, this.options.addUnit));
|
|
927
|
+
if (start.value >= this.options.min.value) {
|
|
928
|
+
const origin = this.start;
|
|
929
|
+
this.start$.next(start);
|
|
930
|
+
this.initialize();
|
|
931
|
+
return { start: this.start, end: origin };
|
|
932
|
+
}
|
|
933
|
+
return null;
|
|
929
934
|
}
|
|
930
|
-
|
|
931
|
-
|
|
935
|
+
addEndDate() {
|
|
936
|
+
const end = this.viewEndOf(this.end.add(this.options.addAmount, this.options.addUnit));
|
|
937
|
+
if (end.value <= this.options.max.value) {
|
|
938
|
+
const origin = this.end;
|
|
939
|
+
this.end$.next(end);
|
|
940
|
+
this.initialize();
|
|
941
|
+
return { start: origin, end: this.end };
|
|
942
|
+
}
|
|
943
|
+
return null;
|
|
932
944
|
}
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.year || this.options.dateDisplayFormats.primary)}`, (this.getCellWidth() * 4) / 2 + i * (this.getCellWidth() * 4), primaryDatePointTop);
|
|
939
|
-
points.push(point);
|
|
945
|
+
updateDate(start, end) {
|
|
946
|
+
start = this.viewStartOf(start);
|
|
947
|
+
end = this.viewEndOf(end);
|
|
948
|
+
if (start.value < this.start.value) {
|
|
949
|
+
this.start$.next(start);
|
|
940
950
|
}
|
|
941
|
-
|
|
951
|
+
if (end.value > this.end.value) {
|
|
952
|
+
this.end$.next(end);
|
|
953
|
+
}
|
|
954
|
+
this.initialize();
|
|
942
955
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
956
|
+
// 获取View的宽度
|
|
957
|
+
getWidth() {
|
|
958
|
+
return this.getCellWidth() * this.secondaryDatePoints.length;
|
|
959
|
+
}
|
|
960
|
+
// 获取单个网格的宽度
|
|
961
|
+
getCellWidth() {
|
|
962
|
+
return this.options.cellWidth;
|
|
963
|
+
}
|
|
964
|
+
// 获取当前时间的X坐标
|
|
965
|
+
getTodayXPoint() {
|
|
966
|
+
const toady = new GanttDate().startOfDay();
|
|
967
|
+
if (toady.value > this.start.value && toady.value < this.end.value) {
|
|
968
|
+
const x = this.getXPointByDate(toady) + this.getDayOccupancyWidth(toady) / 2;
|
|
969
|
+
return x;
|
|
970
|
+
}
|
|
971
|
+
else {
|
|
972
|
+
return null;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
// 获取指定时间的X坐标
|
|
976
|
+
getXPointByDate(date) {
|
|
977
|
+
return this.getDateIntervalWidth(this.start, date);
|
|
978
|
+
}
|
|
979
|
+
// 根据X坐标获取对应时间
|
|
980
|
+
getDateByXPoint(x) {
|
|
981
|
+
const indexOfSecondaryDate = Math.max(Math.floor(x / this.getCellWidth()), 0);
|
|
982
|
+
const matchDate = this.secondaryDatePoints[Math.min(this.secondaryDatePoints.length - 1, indexOfSecondaryDate)];
|
|
983
|
+
const dayWidth = this.getDayOccupancyWidth(matchDate?.start);
|
|
984
|
+
if (dayWidth === this.getCellWidth()) {
|
|
985
|
+
return matchDate?.start;
|
|
986
|
+
}
|
|
987
|
+
else {
|
|
988
|
+
const day = Math.floor((x % this.getCellWidth()) / dayWidth);
|
|
989
|
+
return matchDate?.start.addDays(day);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
// 获取指定时间范围的宽度
|
|
993
|
+
getDateRangeWidth(start, end) {
|
|
994
|
+
// addSeconds(1) 是因为计算相差天会以一个整天来计算 end时间一般是59分59秒不是一个整天,所以需要加1
|
|
995
|
+
return this.getDateIntervalWidth(this.startOfPrecision(start), this.endOfPrecision(end).addSeconds(1));
|
|
996
|
+
}
|
|
997
|
+
// 根据日期精度获取最小时间范围的宽度
|
|
998
|
+
getMinRangeWidthByPrecisionUnit(date) {
|
|
999
|
+
switch (this.options.datePrecisionUnit) {
|
|
1000
|
+
case 'minute':
|
|
1001
|
+
return this.getDayOccupancyWidth(date) / 24 / 60;
|
|
1002
|
+
case 'hour':
|
|
1003
|
+
return this.getDayOccupancyWidth(date) / 24;
|
|
1004
|
+
default:
|
|
1005
|
+
return this.getDayOccupancyWidth(date);
|
|
950
1006
|
}
|
|
951
|
-
return points;
|
|
952
1007
|
}
|
|
953
1008
|
}
|
|
954
1009
|
|
|
955
|
-
const viewOptions$
|
|
1010
|
+
const viewOptions$5 = {
|
|
956
1011
|
cellWidth: 35,
|
|
957
1012
|
start: new GanttDate().startOfYear().startOfWeek(),
|
|
958
1013
|
end: new GanttDate().endOfYear().endOfWeek(),
|
|
959
1014
|
addAmount: 1,
|
|
960
1015
|
addUnit: 'month',
|
|
961
|
-
dateDisplayFormats:
|
|
1016
|
+
dateDisplayFormats: zhHantLocale.views.day.dateFormats
|
|
962
1017
|
};
|
|
963
1018
|
class GanttViewDay extends GanttView {
|
|
964
1019
|
constructor(start, end, options) {
|
|
965
|
-
super(start, end, Object.assign({}, viewOptions$
|
|
1020
|
+
super(start, end, Object.assign({}, viewOptions$5, options));
|
|
966
1021
|
this.showTimeline = false;
|
|
967
1022
|
this.viewType = GanttViewType.day;
|
|
968
1023
|
}
|
|
@@ -975,7 +1030,10 @@ class GanttViewDay extends GanttView {
|
|
|
975
1030
|
getPrimaryWidth() {
|
|
976
1031
|
return this.getCellWidth() * 7;
|
|
977
1032
|
}
|
|
978
|
-
getDayOccupancyWidth() {
|
|
1033
|
+
getDayOccupancyWidth(date) {
|
|
1034
|
+
if (this.hideHoliday(date)) {
|
|
1035
|
+
return 0;
|
|
1036
|
+
}
|
|
979
1037
|
return this.cellWidth;
|
|
980
1038
|
}
|
|
981
1039
|
getPrimaryDatePoints() {
|
|
@@ -983,14 +1041,19 @@ class GanttViewDay extends GanttView {
|
|
|
983
1041
|
const points = [];
|
|
984
1042
|
for (let i = 0; i < weeks.length; i++) {
|
|
985
1043
|
const weekStart = new GanttDate(weeks[i]);
|
|
1044
|
+
const weekEnd = weekStart.addWeeks(1);
|
|
986
1045
|
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
987
|
-
const
|
|
1046
|
+
const pointWidth = this.getDateIntervalWidth(weekStart, weekEnd);
|
|
1047
|
+
const lastPoint = points[points.length - 1];
|
|
1048
|
+
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.yearMonth || this.options.dateDisplayFormats.primary), pointWidth / 2 + (lastPoint?.rightX || 0), primaryDatePointTop);
|
|
1049
|
+
point.leftX = lastPoint?.rightX || 0;
|
|
1050
|
+
point.rightX = point.leftX + pointWidth;
|
|
988
1051
|
points.push(point);
|
|
989
1052
|
}
|
|
990
1053
|
return points;
|
|
991
1054
|
}
|
|
992
1055
|
getSecondaryDatePoints() {
|
|
993
|
-
const days = eachDayOfInterval({ start: this.start.value, end: this.end.value });
|
|
1056
|
+
const days = eachDayOfInterval({ start: this.start.value, end: this.end.value }).filter((day) => !this.hideHoliday(new GanttDate(day)));
|
|
994
1057
|
const points = [];
|
|
995
1058
|
for (let i = 0; i < days.length; i++) {
|
|
996
1059
|
const start = new GanttDate(days[i]);
|
|
@@ -1004,115 +1067,19 @@ class GanttViewDay extends GanttView {
|
|
|
1004
1067
|
}
|
|
1005
1068
|
}
|
|
1006
1069
|
|
|
1007
|
-
const viewOptions$
|
|
1008
|
-
cellWidth: 280,
|
|
1009
|
-
start: new GanttDate().startOfYear().startOfWeek(),
|
|
1010
|
-
end: new GanttDate().endOfYear().endOfWeek(),
|
|
1011
|
-
addAmount: 1,
|
|
1012
|
-
addUnit: 'month',
|
|
1013
|
-
dateDisplayFormats: zhHant.views.week.dateFormats
|
|
1014
|
-
};
|
|
1015
|
-
class GanttViewWeek extends GanttView {
|
|
1016
|
-
constructor(start, end, options) {
|
|
1017
|
-
super(start, end, Object.assign({}, viewOptions$2, options));
|
|
1018
|
-
this.viewType = GanttViewType.week;
|
|
1019
|
-
}
|
|
1020
|
-
viewStartOf(date) {
|
|
1021
|
-
return date.startOfWeek();
|
|
1022
|
-
}
|
|
1023
|
-
viewEndOf(date) {
|
|
1024
|
-
return date.endOfWeek();
|
|
1025
|
-
}
|
|
1026
|
-
getPrimaryWidth() {
|
|
1027
|
-
return this.getCellWidth();
|
|
1028
|
-
}
|
|
1029
|
-
getDayOccupancyWidth() {
|
|
1030
|
-
return this.cellWidth / 7;
|
|
1031
|
-
}
|
|
1032
|
-
getPrimaryDatePoints() {
|
|
1033
|
-
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
|
|
1034
|
-
const points = [];
|
|
1035
|
-
for (let i = 0; i < weeks.length; i++) {
|
|
1036
|
-
const weekStart = new GanttDate(weeks[i]);
|
|
1037
|
-
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
1038
|
-
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.year || this.options.dateDisplayFormats.primary), this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
1039
|
-
points.push(point);
|
|
1040
|
-
}
|
|
1041
|
-
return points;
|
|
1042
|
-
}
|
|
1043
|
-
getSecondaryDatePoints() {
|
|
1044
|
-
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
|
|
1045
|
-
const points = [];
|
|
1046
|
-
for (let i = 0; i < weeks.length; i++) {
|
|
1047
|
-
const start = new GanttDate(weeks[i]);
|
|
1048
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.week || this.options.dateDisplayFormats.secondary)}`, i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
1049
|
-
points.push(point);
|
|
1050
|
-
}
|
|
1051
|
-
return points;
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
const viewOptions$1 = {
|
|
1056
|
-
cellWidth: 480,
|
|
1057
|
-
start: new GanttDate().addYears(-2).startOfYear(),
|
|
1058
|
-
end: new GanttDate().addYears(2).endOfYear(),
|
|
1059
|
-
addAmount: 1,
|
|
1060
|
-
addUnit: 'year',
|
|
1061
|
-
dateDisplayFormats: zhHant.views.year.dateFormats
|
|
1062
|
-
};
|
|
1063
|
-
class GanttViewYear extends GanttView {
|
|
1064
|
-
constructor(start, end, options) {
|
|
1065
|
-
super(start, end, Object.assign({}, viewOptions$1, options));
|
|
1066
|
-
this.viewType = GanttViewType.year;
|
|
1067
|
-
}
|
|
1068
|
-
viewStartOf(date) {
|
|
1069
|
-
return date.startOfYear();
|
|
1070
|
-
}
|
|
1071
|
-
viewEndOf(date) {
|
|
1072
|
-
return date.endOfYear();
|
|
1073
|
-
}
|
|
1074
|
-
getPrimaryWidth() {
|
|
1075
|
-
return this.getCellWidth();
|
|
1076
|
-
}
|
|
1077
|
-
getDayOccupancyWidth(date) {
|
|
1078
|
-
return this.cellWidth / date.getDaysInYear();
|
|
1079
|
-
}
|
|
1080
|
-
getPrimaryDatePoints() {
|
|
1081
|
-
const years = eachYearOfInterval({ start: this.start.value, end: this.end.value });
|
|
1082
|
-
const points = [];
|
|
1083
|
-
for (let i = 0; i < years.length; i++) {
|
|
1084
|
-
const start = new GanttDate(years[i]);
|
|
1085
|
-
const point = new GanttDatePoint(start, ``, this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
1086
|
-
points.push(point);
|
|
1087
|
-
}
|
|
1088
|
-
return points;
|
|
1089
|
-
}
|
|
1090
|
-
getSecondaryDatePoints() {
|
|
1091
|
-
const years = differenceInCalendarYears(this.end.value, this.start.value);
|
|
1092
|
-
const points = [];
|
|
1093
|
-
const pointTop = '60%';
|
|
1094
|
-
for (let i = 0; i <= years; i++) {
|
|
1095
|
-
const start = this.start.addYears(i);
|
|
1096
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.year || this.options.dateDisplayFormats.secondary || this.options.dateDisplayFormats.primary)}`, i * this.getCellWidth() + this.getCellWidth() / 2, pointTop);
|
|
1097
|
-
points.push(point);
|
|
1098
|
-
}
|
|
1099
|
-
return points;
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
const viewOptions = {
|
|
1070
|
+
const viewOptions$4 = {
|
|
1104
1071
|
cellWidth: 80,
|
|
1105
1072
|
start: new GanttDate().startOfMonth(),
|
|
1106
1073
|
end: new GanttDate().endOfMonth(),
|
|
1107
1074
|
datePrecisionUnit: 'minute',
|
|
1108
1075
|
addAmount: 1,
|
|
1109
1076
|
addUnit: 'week',
|
|
1110
|
-
dateDisplayFormats:
|
|
1077
|
+
dateDisplayFormats: zhHantLocale.views.hour.dateFormats,
|
|
1111
1078
|
dragPreviewDateFormat: 'HH:mm'
|
|
1112
1079
|
};
|
|
1113
1080
|
class GanttViewHour extends GanttView {
|
|
1114
1081
|
constructor(start, end, options) {
|
|
1115
|
-
super(start, end, Object.assign({}, viewOptions, options));
|
|
1082
|
+
super(start, end, Object.assign({}, viewOptions$4, options));
|
|
1116
1083
|
this.showTimeline = true;
|
|
1117
1084
|
this.viewType = GanttViewType.hour;
|
|
1118
1085
|
}
|
|
@@ -1183,158 +1150,212 @@ class GanttViewHour extends GanttView {
|
|
|
1183
1150
|
}
|
|
1184
1151
|
}
|
|
1185
1152
|
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1153
|
+
const viewOptions$3 = {
|
|
1154
|
+
start: new GanttDate().startOfQuarter().addQuarters(-1),
|
|
1155
|
+
end: new GanttDate().endOfQuarter().addQuarters(2),
|
|
1156
|
+
cellWidth: 280,
|
|
1157
|
+
addAmount: 1,
|
|
1158
|
+
addUnit: 'quarter',
|
|
1159
|
+
dateDisplayFormats: zhHantLocale.views.month.dateFormats
|
|
1193
1160
|
};
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1161
|
+
class GanttViewMonth extends GanttView {
|
|
1162
|
+
constructor(start, end, options) {
|
|
1163
|
+
super(start, end, Object.assign({}, viewOptions$3, options));
|
|
1164
|
+
this.viewType = GanttViewType.month;
|
|
1165
|
+
}
|
|
1166
|
+
viewStartOf(date) {
|
|
1167
|
+
return date.startOfQuarter();
|
|
1168
|
+
}
|
|
1169
|
+
viewEndOf(date) {
|
|
1170
|
+
return date.endOfQuarter();
|
|
1171
|
+
}
|
|
1172
|
+
getPrimaryWidth() {
|
|
1173
|
+
return this.getCellWidth() * 3;
|
|
1174
|
+
}
|
|
1175
|
+
getDayOccupancyWidth(date) {
|
|
1176
|
+
return this.cellWidth / date.getDaysInMonth();
|
|
1177
|
+
}
|
|
1178
|
+
getPrimaryDatePoints() {
|
|
1179
|
+
const quarters = differenceInCalendarQuarters(this.end.addSeconds(1).value, this.start.value);
|
|
1180
|
+
const points = [];
|
|
1181
|
+
for (let i = 0; i < quarters; i++) {
|
|
1182
|
+
const start = this.start.addQuarters(i);
|
|
1183
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.yearQuarter || this.options.dateDisplayFormats.primary), (this.getCellWidth() * 3) / 2 + i * (this.getCellWidth() * 3), primaryDatePointTop);
|
|
1184
|
+
points.push(point);
|
|
1185
|
+
}
|
|
1186
|
+
return points;
|
|
1187
|
+
}
|
|
1188
|
+
getSecondaryDatePoints() {
|
|
1189
|
+
const months = eachMonthOfInterval({ start: this.start.value, end: this.end.value });
|
|
1190
|
+
const points = [];
|
|
1191
|
+
for (let i = 0; i < months.length; i++) {
|
|
1192
|
+
const start = new GanttDate(months[i]);
|
|
1193
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.month || this.options.dateDisplayFormats.secondary), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
1194
|
+
points.push(point);
|
|
1195
|
+
}
|
|
1196
|
+
return points;
|
|
1197
|
+
}
|
|
1199
1198
|
}
|
|
1200
1199
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1200
|
+
const viewOptions$2 = {
|
|
1201
|
+
start: new GanttDate().addYears(-1).startOfYear(),
|
|
1202
|
+
end: new GanttDate().addYears(1).endOfYear(),
|
|
1203
|
+
min: new GanttDate().addYears(-2).startOfYear(),
|
|
1204
|
+
max: new GanttDate().addYears(2).endOfYear(),
|
|
1205
|
+
cellWidth: 500,
|
|
1206
|
+
addAmount: 1,
|
|
1207
|
+
addUnit: 'year',
|
|
1208
|
+
dateDisplayFormats: zhHantLocale.views.quarter.dateFormats
|
|
1209
|
+
};
|
|
1210
|
+
class GanttViewQuarter extends GanttView {
|
|
1211
|
+
constructor(start, end, options) {
|
|
1212
|
+
super(start, end, Object.assign({}, viewOptions$2, options));
|
|
1213
|
+
this.viewType = GanttViewType.quarter;
|
|
1213
1214
|
}
|
|
1214
|
-
|
|
1215
|
-
return
|
|
1215
|
+
viewStartOf(date) {
|
|
1216
|
+
return date.startOfYear();
|
|
1216
1217
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1218
|
+
viewEndOf(date) {
|
|
1219
|
+
return date.endOfYear();
|
|
1220
|
+
}
|
|
1221
|
+
getPrimaryWidth() {
|
|
1222
|
+
return this.getCellWidth() * 4;
|
|
1223
|
+
}
|
|
1224
|
+
getDayOccupancyWidth(date) {
|
|
1225
|
+
return this.cellWidth / date.getDaysInQuarter();
|
|
1226
|
+
}
|
|
1227
|
+
getPrimaryDatePoints() {
|
|
1228
|
+
const years = eachYearOfInterval({ start: this.start.value, end: this.end.value });
|
|
1229
|
+
const points = [];
|
|
1230
|
+
for (let i = 0; i < years.length; i++) {
|
|
1231
|
+
const start = new GanttDate(years[i]);
|
|
1232
|
+
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.year || this.options.dateDisplayFormats.primary)}`, (this.getCellWidth() * 4) / 2 + i * (this.getCellWidth() * 4), primaryDatePointTop);
|
|
1233
|
+
points.push(point);
|
|
1226
1234
|
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
// const result = [];
|
|
1237
|
-
// (items || []).forEach((item) => {
|
|
1238
|
-
// result.push(item);
|
|
1239
|
-
// if (item.expanded && item.children) {
|
|
1240
|
-
// result.push(...recursiveItems(item.children));
|
|
1241
|
-
// }
|
|
1242
|
-
// });
|
|
1243
|
-
// return result;
|
|
1244
|
-
// }
|
|
1245
|
-
function recursiveItems(items) {
|
|
1246
|
-
const result = [];
|
|
1247
|
-
(items || []).forEach((item) => {
|
|
1248
|
-
result.push(item);
|
|
1249
|
-
if (item.expanded && item.children) {
|
|
1250
|
-
result.push(...recursiveItems(item.children));
|
|
1235
|
+
return points;
|
|
1236
|
+
}
|
|
1237
|
+
getSecondaryDatePoints() {
|
|
1238
|
+
const quarters = differenceInCalendarQuarters(this.end.value, this.start.value);
|
|
1239
|
+
const points = [];
|
|
1240
|
+
for (let i = 0; i <= quarters; i++) {
|
|
1241
|
+
const start = this.start.addQuarters(i);
|
|
1242
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.quarter || this.options.dateDisplayFormats.secondary), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
1243
|
+
points.push(point);
|
|
1251
1244
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1245
|
+
return points;
|
|
1246
|
+
}
|
|
1254
1247
|
}
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1248
|
+
|
|
1249
|
+
const viewOptions$1 = {
|
|
1250
|
+
cellWidth: 280,
|
|
1251
|
+
start: new GanttDate().startOfYear().startOfWeek(),
|
|
1252
|
+
end: new GanttDate().endOfYear().endOfWeek(),
|
|
1253
|
+
addAmount: 1,
|
|
1254
|
+
addUnit: 'month',
|
|
1255
|
+
dateDisplayFormats: zhHantLocale.views.week.dateFormats
|
|
1256
|
+
};
|
|
1257
|
+
class GanttViewWeek extends GanttView {
|
|
1258
|
+
constructor(start, end, options) {
|
|
1259
|
+
super(start, end, Object.assign({}, viewOptions$1, options));
|
|
1260
|
+
this.viewType = GanttViewType.week;
|
|
1261
|
+
}
|
|
1262
|
+
viewStartOf(date) {
|
|
1263
|
+
return date.startOfWeek();
|
|
1264
|
+
}
|
|
1265
|
+
viewEndOf(date) {
|
|
1266
|
+
return date.endOfWeek();
|
|
1267
|
+
}
|
|
1268
|
+
getPrimaryWidth() {
|
|
1269
|
+
return this.getCellWidth();
|
|
1270
|
+
}
|
|
1271
|
+
getDayOccupancyWidth() {
|
|
1272
|
+
return this.cellWidth / 7;
|
|
1273
|
+
}
|
|
1274
|
+
getPrimaryDatePoints() {
|
|
1275
|
+
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
|
|
1276
|
+
const points = [];
|
|
1277
|
+
for (let i = 0; i < weeks.length; i++) {
|
|
1278
|
+
const weekStart = new GanttDate(weeks[i]);
|
|
1279
|
+
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
1280
|
+
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.year || this.options.dateDisplayFormats.primary), this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
1281
|
+
points.push(point);
|
|
1261
1282
|
}
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1283
|
+
return points;
|
|
1284
|
+
}
|
|
1285
|
+
getSecondaryDatePoints() {
|
|
1286
|
+
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
|
|
1287
|
+
const points = [];
|
|
1288
|
+
for (let i = 0; i < weeks.length; i++) {
|
|
1289
|
+
const start = new GanttDate(weeks[i]);
|
|
1290
|
+
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.week || this.options.dateDisplayFormats.secondary)}`, i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
1291
|
+
points.push(point);
|
|
1292
|
+
}
|
|
1293
|
+
return points;
|
|
1294
|
+
}
|
|
1272
1295
|
}
|
|
1273
1296
|
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
styleOptions: {
|
|
1282
|
-
headerHeight: 44,
|
|
1283
|
-
lineHeight: 44,
|
|
1284
|
-
barHeight: 22
|
|
1285
|
-
},
|
|
1286
|
-
dateOptions: {
|
|
1287
|
-
weekStartsOn: 1
|
|
1288
|
-
}
|
|
1297
|
+
const viewOptions = {
|
|
1298
|
+
cellWidth: 480,
|
|
1299
|
+
start: new GanttDate().addYears(-2).startOfYear(),
|
|
1300
|
+
end: new GanttDate().addYears(2).endOfYear(),
|
|
1301
|
+
addAmount: 1,
|
|
1302
|
+
addUnit: 'year',
|
|
1303
|
+
dateDisplayFormats: zhHantLocale.views.year.dateFormats
|
|
1289
1304
|
};
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
this.config = {
|
|
1295
|
-
locale: localeId,
|
|
1296
|
-
dateFormat: Object.assign({}, defaultConfig.dateFormat, globalConfig.dateFormat),
|
|
1297
|
-
styleOptions: Object.assign({}, defaultConfig.styleOptions, globalConfig.styleOptions),
|
|
1298
|
-
linkOptions: Object.assign({}, defaultConfig.linkOptions, globalConfig.linkOptions),
|
|
1299
|
-
dateOptions: Object.assign({}, defaultConfig.dateOptions, globalConfig.dateOptions)
|
|
1300
|
-
};
|
|
1301
|
-
this.i18nLocales = inject(GANTT_I18N_LOCALE_TOKEN).reduce((result, localeConfig) => {
|
|
1302
|
-
result[localeConfig.id] = localeConfig; // 这里使用 `id` 作为 key
|
|
1303
|
-
return result;
|
|
1304
|
-
}, {
|
|
1305
|
-
['zh-cn']: zhHans,
|
|
1306
|
-
['zh-tw']: zhHant
|
|
1307
|
-
});
|
|
1308
|
-
if (this.config.dateOptions?.timeZone) {
|
|
1309
|
-
setDefaultTimeZone(this.config.dateOptions.timeZone);
|
|
1310
|
-
}
|
|
1311
|
-
setDefaultOptions({
|
|
1312
|
-
locale: this.getDateLocale(),
|
|
1313
|
-
weekStartsOn: this.config?.dateOptions?.weekStartsOn
|
|
1314
|
-
});
|
|
1305
|
+
class GanttViewYear extends GanttView {
|
|
1306
|
+
constructor(start, end, options) {
|
|
1307
|
+
super(start, end, Object.assign({}, viewOptions, options));
|
|
1308
|
+
this.viewType = GanttViewType.year;
|
|
1315
1309
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1310
|
+
viewStartOf(date) {
|
|
1311
|
+
return date.startOfYear();
|
|
1318
1312
|
}
|
|
1319
|
-
|
|
1320
|
-
return
|
|
1313
|
+
viewEndOf(date) {
|
|
1314
|
+
return date.endOfYear();
|
|
1321
1315
|
}
|
|
1322
|
-
|
|
1323
|
-
return this.
|
|
1316
|
+
getPrimaryWidth() {
|
|
1317
|
+
return this.getCellWidth();
|
|
1324
1318
|
}
|
|
1325
|
-
|
|
1326
|
-
return this.
|
|
1319
|
+
getDayOccupancyWidth(date) {
|
|
1320
|
+
return this.cellWidth / date.getDaysInYear();
|
|
1321
|
+
}
|
|
1322
|
+
getPrimaryDatePoints() {
|
|
1323
|
+
const years = eachYearOfInterval({ start: this.start.value, end: this.end.value });
|
|
1324
|
+
const points = [];
|
|
1325
|
+
for (let i = 0; i < years.length; i++) {
|
|
1326
|
+
const start = new GanttDate(years[i]);
|
|
1327
|
+
const point = new GanttDatePoint(start, ``, this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
1328
|
+
points.push(point);
|
|
1329
|
+
}
|
|
1330
|
+
return points;
|
|
1331
|
+
}
|
|
1332
|
+
getSecondaryDatePoints() {
|
|
1333
|
+
const years = differenceInCalendarYears(this.end.value, this.start.value);
|
|
1334
|
+
const points = [];
|
|
1335
|
+
const pointTop = '60%';
|
|
1336
|
+
for (let i = 0; i <= years; i++) {
|
|
1337
|
+
const start = this.start.addYears(i);
|
|
1338
|
+
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.year || this.options.dateDisplayFormats.secondary || this.options.dateDisplayFormats.primary)}`, i * this.getCellWidth() + this.getCellWidth() / 2, pointTop);
|
|
1339
|
+
points.push(point);
|
|
1340
|
+
}
|
|
1341
|
+
return points;
|
|
1327
1342
|
}
|
|
1328
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, deps: [{ token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1329
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, providedIn: 'root' }); }
|
|
1330
1343
|
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1344
|
+
|
|
1345
|
+
const ganttViewsMap = {
|
|
1346
|
+
[GanttViewType.hour]: GanttViewHour,
|
|
1347
|
+
[GanttViewType.day]: GanttViewDay,
|
|
1348
|
+
[GanttViewType.week]: GanttViewWeek,
|
|
1349
|
+
[GanttViewType.month]: GanttViewMonth,
|
|
1350
|
+
[GanttViewType.quarter]: GanttViewQuarter,
|
|
1351
|
+
[GanttViewType.year]: GanttViewYear
|
|
1352
|
+
};
|
|
1353
|
+
function registerView(type, view) {
|
|
1354
|
+
ganttViewsMap[type] = view;
|
|
1355
|
+
}
|
|
1356
|
+
function createViewFactory(type, start, end, options) {
|
|
1357
|
+
return new ganttViewsMap[type](start, end, options);
|
|
1358
|
+
}
|
|
1338
1359
|
|
|
1339
1360
|
class GanttUpper {
|
|
1340
1361
|
set linkOptions(options) {
|
|
@@ -1396,7 +1417,6 @@ class GanttUpper {
|
|
|
1396
1417
|
this.viewChange = new EventEmitter();
|
|
1397
1418
|
this.expandChange = new EventEmitter();
|
|
1398
1419
|
this.configService = inject(GanttConfigService);
|
|
1399
|
-
this.computeAllRefs = true;
|
|
1400
1420
|
this.linkDragEnded = new EventEmitter();
|
|
1401
1421
|
this.items = [];
|
|
1402
1422
|
this.groups = [];
|
|
@@ -1503,14 +1523,12 @@ class GanttUpper {
|
|
|
1503
1523
|
};
|
|
1504
1524
|
}
|
|
1505
1525
|
computeRefs() {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
this.computeItemsRefs(...items);
|
|
1513
|
-
}
|
|
1526
|
+
this.groups.forEach((group) => {
|
|
1527
|
+
const groupItems = recursiveItems(group.items);
|
|
1528
|
+
this.computeItemsRefs(...groupItems);
|
|
1529
|
+
});
|
|
1530
|
+
const items = recursiveItems(this.items);
|
|
1531
|
+
this.computeItemsRefs(...items);
|
|
1514
1532
|
}
|
|
1515
1533
|
initSelectionModel() {
|
|
1516
1534
|
return new SelectionModel(this.multiple, []);
|
|
@@ -1524,7 +1542,7 @@ class GanttUpper {
|
|
|
1524
1542
|
this.groups.forEach((group) => {
|
|
1525
1543
|
group.setExpand(expanded);
|
|
1526
1544
|
});
|
|
1527
|
-
this.expandChange.
|
|
1545
|
+
this.expandChange.emit(this.groups);
|
|
1528
1546
|
this.cdr.detectChanges();
|
|
1529
1547
|
}
|
|
1530
1548
|
ngOnInit() {
|
|
@@ -1732,6 +1750,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
1732
1750
|
}] } });
|
|
1733
1751
|
const GANTT_UPPER_TOKEN = new InjectionToken('GANTT_UPPER_TOKEN');
|
|
1734
1752
|
|
|
1753
|
+
class GanttItemUpper {
|
|
1754
|
+
constructor(elementRef, ganttUpper) {
|
|
1755
|
+
this.elementRef = elementRef;
|
|
1756
|
+
this.ganttUpper = ganttUpper;
|
|
1757
|
+
this.firstChange = true;
|
|
1758
|
+
this.unsubscribe$ = new Subject();
|
|
1759
|
+
this.refsUnsubscribe$ = new Subject();
|
|
1760
|
+
}
|
|
1761
|
+
ngOnInit() {
|
|
1762
|
+
this.firstChange = false;
|
|
1763
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
1764
|
+
this.setPositions();
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
ngOnChanges(changes) {
|
|
1768
|
+
if (!this.firstChange) {
|
|
1769
|
+
this.itemChange(changes.item.currentValue);
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
itemChange(item) {
|
|
1773
|
+
this.refsUnsubscribe$.next();
|
|
1774
|
+
this.refsUnsubscribe$.complete();
|
|
1775
|
+
this.item = item;
|
|
1776
|
+
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
1777
|
+
this.setPositions();
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
setPositions() {
|
|
1781
|
+
const itemElement = this.elementRef.nativeElement;
|
|
1782
|
+
itemElement.style.left = this.item.refs?.x + 'px';
|
|
1783
|
+
itemElement.style.top = this.item.refs?.y + 'px';
|
|
1784
|
+
itemElement.style.width = this.item.refs?.width + 'px';
|
|
1785
|
+
if (this.item.type === GanttItemType.bar) {
|
|
1786
|
+
itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
|
|
1787
|
+
}
|
|
1788
|
+
else if (this.item.type === GanttItemType.range) {
|
|
1789
|
+
itemElement.style.height = rangeHeight + 'px';
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
ngOnDestroy() {
|
|
1793
|
+
this.unsubscribe$.next();
|
|
1794
|
+
this.unsubscribe$.complete();
|
|
1795
|
+
this.refsUnsubscribe$.next();
|
|
1796
|
+
this.refsUnsubscribe$.complete();
|
|
1797
|
+
}
|
|
1798
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1799
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.3", type: GanttItemUpper, isStandalone: true, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 }); }
|
|
1800
|
+
}
|
|
1801
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, decorators: [{
|
|
1802
|
+
type: Directive
|
|
1803
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
1804
|
+
type: Inject,
|
|
1805
|
+
args: [GANTT_UPPER_TOKEN]
|
|
1806
|
+
}] }], propDecorators: { template: [{
|
|
1807
|
+
type: Input
|
|
1808
|
+
}], item: [{
|
|
1809
|
+
type: Input
|
|
1810
|
+
}] } });
|
|
1811
|
+
|
|
1735
1812
|
function getDependencyType(path, dependencyTypes) {
|
|
1736
1813
|
if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
|
|
1737
1814
|
return GanttLinkType.ss;
|
|
@@ -2323,7 +2400,8 @@ class GanttBarDrag {
|
|
|
2323
2400
|
const currentX = this.item().refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
2324
2401
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
2325
2402
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
2326
|
-
const
|
|
2403
|
+
const currentEndDate = this.ganttUpper.view.getDateByXPoint(currentX + this.item().refs.width);
|
|
2404
|
+
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(currentEndDate, currentDate);
|
|
2327
2405
|
let start = currentDate;
|
|
2328
2406
|
let end = currentDate.add(diffs, this.ganttUpper.view?.options?.datePrecisionUnit);
|
|
2329
2407
|
// 日视图特殊逻辑处理
|
|
@@ -2513,114 +2591,45 @@ class GanttBarDrag {
|
|
|
2513
2591
|
dragRef.disabled = this.dragDisabled;
|
|
2514
2592
|
});
|
|
2515
2593
|
}
|
|
2516
|
-
else if (!this.dragDisabled) {
|
|
2517
|
-
this.barHandleDragRefs = this.createBarHandleDrags();
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
createLinkDragRefs() {
|
|
2521
|
-
if (this.linkDragRefs.length > 0) {
|
|
2522
|
-
this.linkDragRefs.forEach((dragRef) => {
|
|
2523
|
-
dragRef.disabled = this.linkDragDisabled;
|
|
2524
|
-
});
|
|
2525
|
-
}
|
|
2526
|
-
else if (!this.linkDragDisabled) {
|
|
2527
|
-
this.linkDragRefs = this.createLinkHandleDrags();
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
|
-
createDrags() {
|
|
2531
|
-
this.createMouseEvents();
|
|
2532
|
-
this.createBarDragRef();
|
|
2533
|
-
this.createBarHandleDragRefs();
|
|
2534
|
-
this.createLinkDragRefs();
|
|
2535
|
-
}
|
|
2536
|
-
updateItem(item) {
|
|
2537
|
-
this.item.set(item);
|
|
2538
|
-
}
|
|
2539
|
-
ngOnDestroy() {
|
|
2540
|
-
this.closeDragBackdrop();
|
|
2541
|
-
this.barDragRef?.dispose();
|
|
2542
|
-
this.linkDragRefs?.forEach((dragRef) => dragRef.dispose());
|
|
2543
|
-
this.barHandleDragRefs?.forEach((dragRef) => dragRef.dispose());
|
|
2544
|
-
this.destroy$.next();
|
|
2545
|
-
this.destroy$.complete();
|
|
2546
|
-
this.stopScrolling();
|
|
2547
|
-
this.stopScrollTimers$.complete();
|
|
2548
|
-
}
|
|
2549
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag, deps: [{ token: i1.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2550
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag }); }
|
|
2551
|
-
}
|
|
2552
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag, decorators: [{
|
|
2553
|
-
type: Injectable
|
|
2554
|
-
}], ctorParameters: () => [{ type: i1.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }] });
|
|
2555
|
-
|
|
2556
|
-
const sideWidth = 400;
|
|
2557
|
-
const sideMiddleWidth = 500;
|
|
2558
|
-
const sideMaxWidth = 600;
|
|
2559
|
-
const sideMinWidth = 400;
|
|
2560
|
-
const barBackground = '#6698ff';
|
|
2561
|
-
const rangeHeight = 17;
|
|
2562
|
-
const todayHeight = 24;
|
|
2563
|
-
const todayWidth = 35;
|
|
2564
|
-
const todayBorderRadius = 4;
|
|
2565
|
-
|
|
2566
|
-
class GanttItemUpper {
|
|
2567
|
-
constructor(elementRef, ganttUpper) {
|
|
2568
|
-
this.elementRef = elementRef;
|
|
2569
|
-
this.ganttUpper = ganttUpper;
|
|
2570
|
-
this.firstChange = true;
|
|
2571
|
-
this.unsubscribe$ = new Subject();
|
|
2572
|
-
this.refsUnsubscribe$ = new Subject();
|
|
2573
|
-
}
|
|
2574
|
-
ngOnInit() {
|
|
2575
|
-
this.firstChange = false;
|
|
2576
|
-
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
2577
|
-
this.setPositions();
|
|
2578
|
-
});
|
|
2579
|
-
}
|
|
2580
|
-
ngOnChanges(changes) {
|
|
2581
|
-
if (!this.firstChange) {
|
|
2582
|
-
this.itemChange(changes.item.currentValue);
|
|
2583
|
-
}
|
|
2584
|
-
}
|
|
2585
|
-
itemChange(item) {
|
|
2586
|
-
this.refsUnsubscribe$.next();
|
|
2587
|
-
this.refsUnsubscribe$.complete();
|
|
2588
|
-
this.item = item;
|
|
2589
|
-
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
2590
|
-
this.setPositions();
|
|
2591
|
-
});
|
|
2592
|
-
}
|
|
2593
|
-
setPositions() {
|
|
2594
|
-
const itemElement = this.elementRef.nativeElement;
|
|
2595
|
-
itemElement.style.left = this.item.refs?.x + 'px';
|
|
2596
|
-
itemElement.style.top = this.item.refs?.y + 'px';
|
|
2597
|
-
itemElement.style.width = this.item.refs?.width + 'px';
|
|
2598
|
-
if (this.item.type === GanttItemType.bar) {
|
|
2599
|
-
itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
|
|
2600
|
-
}
|
|
2601
|
-
else if (this.item.type === GanttItemType.range) {
|
|
2602
|
-
itemElement.style.height = rangeHeight + 'px';
|
|
2594
|
+
else if (!this.dragDisabled) {
|
|
2595
|
+
this.barHandleDragRefs = this.createBarHandleDrags();
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
createLinkDragRefs() {
|
|
2599
|
+
if (this.linkDragRefs.length > 0) {
|
|
2600
|
+
this.linkDragRefs.forEach((dragRef) => {
|
|
2601
|
+
dragRef.disabled = this.linkDragDisabled;
|
|
2602
|
+
});
|
|
2603
|
+
}
|
|
2604
|
+
else if (!this.linkDragDisabled) {
|
|
2605
|
+
this.linkDragRefs = this.createLinkHandleDrags();
|
|
2603
2606
|
}
|
|
2604
2607
|
}
|
|
2608
|
+
createDrags() {
|
|
2609
|
+
this.createMouseEvents();
|
|
2610
|
+
this.createBarDragRef();
|
|
2611
|
+
this.createBarHandleDragRefs();
|
|
2612
|
+
this.createLinkDragRefs();
|
|
2613
|
+
}
|
|
2614
|
+
updateItem(item) {
|
|
2615
|
+
this.item.set(item);
|
|
2616
|
+
}
|
|
2605
2617
|
ngOnDestroy() {
|
|
2606
|
-
this.
|
|
2607
|
-
this.
|
|
2608
|
-
this.
|
|
2609
|
-
this.
|
|
2618
|
+
this.closeDragBackdrop();
|
|
2619
|
+
this.barDragRef?.dispose();
|
|
2620
|
+
this.linkDragRefs?.forEach((dragRef) => dragRef.dispose());
|
|
2621
|
+
this.barHandleDragRefs?.forEach((dragRef) => dragRef.dispose());
|
|
2622
|
+
this.destroy$.next();
|
|
2623
|
+
this.destroy$.complete();
|
|
2624
|
+
this.stopScrolling();
|
|
2625
|
+
this.stopScrollTimers$.complete();
|
|
2610
2626
|
}
|
|
2611
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
2612
|
-
static { this.ɵ
|
|
2627
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag, deps: [{ token: i1.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2628
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag }); }
|
|
2613
2629
|
}
|
|
2614
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
2615
|
-
type:
|
|
2616
|
-
}], ctorParameters: () => [{ type:
|
|
2617
|
-
type: Inject,
|
|
2618
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2619
|
-
}] }], propDecorators: { template: [{
|
|
2620
|
-
type: Input
|
|
2621
|
-
}], item: [{
|
|
2622
|
-
type: Input
|
|
2623
|
-
}] } });
|
|
2630
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag, decorators: [{
|
|
2631
|
+
type: Injectable
|
|
2632
|
+
}], ctorParameters: () => [{ type: i1.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }] });
|
|
2624
2633
|
|
|
2625
2634
|
function linearGradient(sideOrCorner, color, stop) {
|
|
2626
2635
|
return `linear-gradient(${sideOrCorner},${color} 0%,${stop} 40%)`;
|
|
@@ -2682,10 +2691,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2682
2691
|
this.barClick.emit({ event, item: this.item.origin });
|
|
2683
2692
|
}
|
|
2684
2693
|
setContentBackground() {
|
|
2694
|
+
let style = { ...(this.item.barStyle || {}) };
|
|
2695
|
+
const contentElement = this.contentElementRef.nativeElement;
|
|
2685
2696
|
if (this.item.refs?.width) {
|
|
2686
|
-
const contentElement = this.contentElementRef.nativeElement;
|
|
2687
2697
|
const color = this.item.color || barBackground;
|
|
2688
|
-
const style = this.item.barStyle || {};
|
|
2689
2698
|
const barElement = this.elementRef.nativeElement;
|
|
2690
2699
|
if (this.item.origin.start && this.item.origin.end) {
|
|
2691
2700
|
style.background = color;
|
|
@@ -2706,13 +2715,13 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2706
2715
|
if (this.item.progress >= 0) {
|
|
2707
2716
|
const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
2708
2717
|
style.background = hexToRgb(color, 0.3);
|
|
2709
|
-
style.borderRadius = '';
|
|
2710
2718
|
contentProgressElement.style.background = color;
|
|
2711
2719
|
}
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2720
|
+
}
|
|
2721
|
+
style = Object.assign({}, style, this.item.barStyle || {});
|
|
2722
|
+
for (const key in style) {
|
|
2723
|
+
if (style.hasOwnProperty(key)) {
|
|
2724
|
+
contentElement.style[key] = style[key];
|
|
2716
2725
|
}
|
|
2717
2726
|
}
|
|
2718
2727
|
}
|
|
@@ -2808,234 +2817,449 @@ class GanttCalendarGridComponent {
|
|
|
2808
2817
|
}
|
|
2809
2818
|
}
|
|
2810
2819
|
ngOnInit() {
|
|
2811
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2812
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2813
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2814
|
-
.subscribe(() => {
|
|
2815
|
-
this.setTodayPoint();
|
|
2816
|
-
});
|
|
2817
|
-
});
|
|
2820
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2821
|
+
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2822
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
2823
|
+
.subscribe(() => {
|
|
2824
|
+
this.setTodayPoint();
|
|
2825
|
+
});
|
|
2826
|
+
});
|
|
2827
|
+
}
|
|
2828
|
+
ngOnDestroy() {
|
|
2829
|
+
this.unsubscribe$.next();
|
|
2830
|
+
this.unsubscribe$.complete();
|
|
2831
|
+
}
|
|
2832
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarGridComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2833
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttCalendarGridComponent, isStandalone: true, selector: "gantt-calendar-grid", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"mainHeight\" class=\"primary-line\"></line>\n }\n </g>\n </g>\n</svg>\n" }); }
|
|
2834
|
+
}
|
|
2835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
|
|
2836
|
+
type: Component,
|
|
2837
|
+
args: [{ selector: 'gantt-calendar-grid', standalone: true, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"mainHeight\" class=\"primary-line\"></line>\n }\n </g>\n </g>\n</svg>\n" }]
|
|
2838
|
+
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2839
|
+
type: Inject,
|
|
2840
|
+
args: [GANTT_UPPER_TOKEN]
|
|
2841
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }], propDecorators: { className: [{
|
|
2842
|
+
type: HostBinding,
|
|
2843
|
+
args: ['class']
|
|
2844
|
+
}] } });
|
|
2845
|
+
|
|
2846
|
+
class GanttCalendarHeaderComponent {
|
|
2847
|
+
get view() {
|
|
2848
|
+
return this.ganttUpper.view;
|
|
2849
|
+
}
|
|
2850
|
+
get height() {
|
|
2851
|
+
return this.ganttUpper.styles.headerHeight + 'px';
|
|
2852
|
+
}
|
|
2853
|
+
constructor(ganttUpper, ngZone, elementRef) {
|
|
2854
|
+
this.ganttUpper = ganttUpper;
|
|
2855
|
+
this.ngZone = ngZone;
|
|
2856
|
+
this.elementRef = elementRef;
|
|
2857
|
+
this.unsubscribe$ = new Subject();
|
|
2858
|
+
this.viewTypes = GanttViewType;
|
|
2859
|
+
this.className = `gantt-calendar gantt-calendar-header`;
|
|
2860
|
+
}
|
|
2861
|
+
ngOnInit() {
|
|
2862
|
+
// 头部日期定位
|
|
2863
|
+
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2864
|
+
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2865
|
+
.pipe(takeUntil(this.unsubscribe$))
|
|
2866
|
+
.subscribe(() => {
|
|
2867
|
+
if (this.ganttUpper.viewType === GanttViewType.day)
|
|
2868
|
+
this.setTodayPoint();
|
|
2869
|
+
});
|
|
2870
|
+
});
|
|
2871
|
+
}
|
|
2872
|
+
setTodayPoint() {
|
|
2873
|
+
const x = this.view.getTodayXPoint();
|
|
2874
|
+
const today = new GanttDate().getDate();
|
|
2875
|
+
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2876
|
+
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
2877
|
+
if (isNumber(x)) {
|
|
2878
|
+
if (rect) {
|
|
2879
|
+
rect.style.left = `${x - todayWidth / 2}px`;
|
|
2880
|
+
rect.style.top = `${this.ganttUpper.styles.headerHeight - todayHeight}px`;
|
|
2881
|
+
rect.innerHTML = today.toString();
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
else {
|
|
2885
|
+
todayEle.style.display = 'none';
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarHeaderComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2889
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttCalendarHeaderComponent, isStandalone: true, selector: "gantt-calendar-header", host: { properties: { "class": "this.className", "style.height": "this.height" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"ganttUpper.styles.headerHeight\" class=\"primary-line\"></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
|
2890
|
+
}
|
|
2891
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
2892
|
+
type: Component,
|
|
2893
|
+
args: [{ selector: 'gantt-calendar-header', imports: [NgStyle], template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"ganttUpper.styles.headerHeight\" class=\"primary-line\"></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
|
|
2894
|
+
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2895
|
+
type: Inject,
|
|
2896
|
+
args: [GANTT_UPPER_TOKEN]
|
|
2897
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }], propDecorators: { className: [{
|
|
2898
|
+
type: HostBinding,
|
|
2899
|
+
args: ['class']
|
|
2900
|
+
}], height: [{
|
|
2901
|
+
type: HostBinding,
|
|
2902
|
+
args: ['style.height']
|
|
2903
|
+
}] } });
|
|
2904
|
+
|
|
2905
|
+
class GanttDragBackdropComponent {
|
|
2906
|
+
constructor(ganttUpper) {
|
|
2907
|
+
this.ganttUpper = ganttUpper;
|
|
2908
|
+
}
|
|
2909
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragBackdropComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2910
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttDragBackdropComponent, isStandalone: true, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }); }
|
|
2911
|
+
}
|
|
2912
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
|
|
2913
|
+
type: Component,
|
|
2914
|
+
args: [{ selector: 'gantt-drag-backdrop', host: {
|
|
2915
|
+
class: 'gantt-drag-backdrop'
|
|
2916
|
+
}, standalone: true, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
|
|
2917
|
+
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2918
|
+
type: Inject,
|
|
2919
|
+
args: [GANTT_UPPER_TOKEN]
|
|
2920
|
+
}] }] });
|
|
2921
|
+
|
|
2922
|
+
class GanttLoaderComponent {
|
|
2923
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2924
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttLoaderComponent, isStandalone: true, selector: "gantt-loader", host: { classAttribute: "gantt-loader gantt-loader-overlay" }, ngImport: i0, template: `
|
|
2925
|
+
<div class="gantt-loader-wrapper">
|
|
2926
|
+
<div class="gantt-loader-loading">
|
|
2927
|
+
<span class="gantt-loader-loading-spot"></span>
|
|
2928
|
+
</div>
|
|
2929
|
+
</div>
|
|
2930
|
+
`, isInline: true }); }
|
|
2931
|
+
}
|
|
2932
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, decorators: [{
|
|
2933
|
+
type: Component,
|
|
2934
|
+
args: [{
|
|
2935
|
+
selector: 'gantt-loader',
|
|
2936
|
+
template: `
|
|
2937
|
+
<div class="gantt-loader-wrapper">
|
|
2938
|
+
<div class="gantt-loader-loading">
|
|
2939
|
+
<span class="gantt-loader-loading-spot"></span>
|
|
2940
|
+
</div>
|
|
2941
|
+
</div>
|
|
2942
|
+
`,
|
|
2943
|
+
host: {
|
|
2944
|
+
class: 'gantt-loader gantt-loader-overlay'
|
|
2945
|
+
},
|
|
2946
|
+
standalone: true
|
|
2947
|
+
}]
|
|
2948
|
+
}] });
|
|
2949
|
+
|
|
2950
|
+
class NgxGanttRangeComponent extends GanttItemUpper {
|
|
2951
|
+
constructor(elementRef, ganttUpper) {
|
|
2952
|
+
super(elementRef, ganttUpper);
|
|
2953
|
+
this.ganttRangeClass = true;
|
|
2954
|
+
}
|
|
2955
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2956
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttRangeComponent, isStandalone: true, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
2957
|
+
}
|
|
2958
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
|
|
2959
|
+
type: Component,
|
|
2960
|
+
args: [{ selector: 'ngx-gantt-range,gantt-range', imports: [NgTemplateOutlet], template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n" }]
|
|
2961
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
2962
|
+
type: Inject,
|
|
2963
|
+
args: [GANTT_UPPER_TOKEN]
|
|
2964
|
+
}] }], propDecorators: { ganttRangeClass: [{
|
|
2965
|
+
type: HostBinding,
|
|
2966
|
+
args: ['class.gantt-range']
|
|
2967
|
+
}] } });
|
|
2968
|
+
|
|
2969
|
+
class GanttSyncScrollService {
|
|
2970
|
+
constructor() {
|
|
2971
|
+
this.ngZone = inject(NgZone);
|
|
2972
|
+
this.scrollGroupsMap = new Map();
|
|
2973
|
+
}
|
|
2974
|
+
registerScrollEvent(groupName, element, direction) {
|
|
2975
|
+
const group = this.scrollGroupsMap.get(groupName) || { elements: [], destroy$: new Subject(), direction };
|
|
2976
|
+
group.elements.push(element);
|
|
2977
|
+
this.scrollGroupsMap.set(groupName, group);
|
|
2978
|
+
this.monitorScrollChange(group);
|
|
2979
|
+
}
|
|
2980
|
+
unregisterScrollEvent(groupName, element) {
|
|
2981
|
+
const group = this.scrollGroupsMap.get(groupName);
|
|
2982
|
+
if (group) {
|
|
2983
|
+
group.elements = group.elements.filter((el) => el !== element);
|
|
2984
|
+
if (!group.elements.length) {
|
|
2985
|
+
this.scrollGroupsMap.delete(groupName);
|
|
2986
|
+
}
|
|
2987
|
+
else {
|
|
2988
|
+
this.scrollGroupsMap.set(groupName, group);
|
|
2989
|
+
}
|
|
2990
|
+
this.monitorScrollChange(group);
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
monitorScrollChange(group) {
|
|
2994
|
+
const { elements, destroy$, direction } = group;
|
|
2995
|
+
destroy$.next();
|
|
2996
|
+
destroy$.complete();
|
|
2997
|
+
if (elements.length) {
|
|
2998
|
+
const scrollObservers = elements.map((el) => fromEvent(el, 'scroll', passiveListenerOptions));
|
|
2999
|
+
this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
3000
|
+
.pipe(takeUntil$1(destroy$))
|
|
3001
|
+
.subscribe((event) => {
|
|
3002
|
+
elements.forEach((el) => {
|
|
3003
|
+
if (direction === 'x') {
|
|
3004
|
+
el.scrollLeft = event.currentTarget.scrollLeft;
|
|
3005
|
+
}
|
|
3006
|
+
else {
|
|
3007
|
+
el.scrollTop = event.currentTarget.scrollTop;
|
|
3008
|
+
}
|
|
3009
|
+
});
|
|
3010
|
+
}));
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3014
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService }); }
|
|
3015
|
+
}
|
|
3016
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, decorators: [{
|
|
3017
|
+
type: Injectable
|
|
3018
|
+
}], ctorParameters: () => [] });
|
|
3019
|
+
|
|
3020
|
+
class GanttSyncScrollXDirective {
|
|
3021
|
+
constructor() {
|
|
3022
|
+
this.syncScrollX = input();
|
|
3023
|
+
this.elementRef = inject((ElementRef));
|
|
3024
|
+
this.syncScrollService = inject(GanttSyncScrollService);
|
|
3025
|
+
}
|
|
3026
|
+
ngOnInit() {
|
|
3027
|
+
this.syncScrollService.registerScrollEvent(this.syncScrollX(), this.elementRef.nativeElement, 'x');
|
|
2818
3028
|
}
|
|
2819
3029
|
ngOnDestroy() {
|
|
2820
|
-
this.
|
|
2821
|
-
this.unsubscribe$.complete();
|
|
3030
|
+
this.syncScrollService.unregisterScrollEvent(this.syncScrollX(), this.elementRef.nativeElement);
|
|
2822
3031
|
}
|
|
2823
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
2824
|
-
static { this.ɵ
|
|
3032
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollXDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3033
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.3", type: GanttSyncScrollXDirective, isStandalone: true, selector: "[syncScrollX]", inputs: { syncScrollX: { classPropertyName: "syncScrollX", publicName: "syncScrollX", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
2825
3034
|
}
|
|
2826
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
2827
|
-
type:
|
|
2828
|
-
args: [{
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
get view() {
|
|
2839
|
-
return this.ganttUpper.view;
|
|
2840
|
-
}
|
|
2841
|
-
get height() {
|
|
2842
|
-
return this.ganttUpper.styles.headerHeight + 'px';
|
|
2843
|
-
}
|
|
2844
|
-
constructor(ganttUpper, ngZone, elementRef) {
|
|
2845
|
-
this.ganttUpper = ganttUpper;
|
|
2846
|
-
this.ngZone = ngZone;
|
|
2847
|
-
this.elementRef = elementRef;
|
|
2848
|
-
this.unsubscribe$ = new Subject();
|
|
2849
|
-
this.viewTypes = GanttViewType;
|
|
2850
|
-
this.className = `gantt-calendar gantt-calendar-header`;
|
|
3035
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollXDirective, decorators: [{
|
|
3036
|
+
type: Directive,
|
|
3037
|
+
args: [{
|
|
3038
|
+
selector: '[syncScrollX]',
|
|
3039
|
+
standalone: true
|
|
3040
|
+
}]
|
|
3041
|
+
}], ctorParameters: () => [] });
|
|
3042
|
+
class GanttSyncScrollYDirective {
|
|
3043
|
+
constructor() {
|
|
3044
|
+
this.syncScrollY = input();
|
|
3045
|
+
this.syncScrollService = inject(GanttSyncScrollService);
|
|
3046
|
+
this.elementRef = inject((ElementRef));
|
|
2851
3047
|
}
|
|
2852
3048
|
ngOnInit() {
|
|
2853
|
-
|
|
2854
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2855
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2856
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2857
|
-
.subscribe(() => {
|
|
2858
|
-
if (this.ganttUpper.viewType === GanttViewType.day)
|
|
2859
|
-
this.setTodayPoint();
|
|
2860
|
-
});
|
|
2861
|
-
});
|
|
3049
|
+
this.syncScrollService.registerScrollEvent(this.syncScrollY(), this.elementRef.nativeElement, 'y');
|
|
2862
3050
|
}
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
const today = new GanttDate().getDate();
|
|
2866
|
-
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2867
|
-
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
2868
|
-
if (isNumber(x)) {
|
|
2869
|
-
if (rect) {
|
|
2870
|
-
rect.style.left = `${x - todayWidth / 2}px`;
|
|
2871
|
-
rect.style.top = `${this.ganttUpper.styles.headerHeight - todayHeight}px`;
|
|
2872
|
-
rect.innerHTML = today.toString();
|
|
2873
|
-
}
|
|
2874
|
-
}
|
|
2875
|
-
else {
|
|
2876
|
-
todayEle.style.display = 'none';
|
|
2877
|
-
}
|
|
3051
|
+
ngOnDestroy() {
|
|
3052
|
+
this.syncScrollService.unregisterScrollEvent(this.syncScrollY(), this.elementRef.nativeElement);
|
|
2878
3053
|
}
|
|
2879
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
2880
|
-
static { this.ɵ
|
|
3054
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3055
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.3", type: GanttSyncScrollYDirective, isStandalone: true, selector: "[syncScrollY]", inputs: { syncScrollY: { classPropertyName: "syncScrollY", publicName: "syncScrollY", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
2881
3056
|
}
|
|
2882
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
3057
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, decorators: [{
|
|
3058
|
+
type: Directive,
|
|
3059
|
+
args: [{
|
|
3060
|
+
selector: '[syncScrollY]',
|
|
3061
|
+
standalone: true
|
|
3062
|
+
}]
|
|
3063
|
+
}], ctorParameters: () => [] });
|
|
3064
|
+
|
|
3065
|
+
class GanttScrollbarComponent {
|
|
3066
|
+
constructor(ganttUpper) {
|
|
3067
|
+
this.ganttUpper = ganttUpper;
|
|
3068
|
+
this.hasFooter = input(false);
|
|
3069
|
+
this.tableWidth = input();
|
|
3070
|
+
this.ganttRoot = input();
|
|
3071
|
+
this.tableScrollWidth = input(0);
|
|
3072
|
+
}
|
|
3073
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttScrollbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3074
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.3", type: GanttScrollbarComponent, isStandalone: true, selector: "gantt-scrollbar", inputs: { hasFooter: { classPropertyName: "hasFooter", publicName: "hasFooter", isSignal: true, isRequired: false, transformFunction: null }, tableWidth: { classPropertyName: "tableWidth", publicName: "tableWidth", isSignal: true, isRequired: false, transformFunction: null }, ganttRoot: { classPropertyName: "ganttRoot", publicName: "ganttRoot", isSignal: true, isRequired: false, transformFunction: null }, tableScrollWidth: { classPropertyName: "tableScrollWidth", publicName: "tableScrollWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"gantt-scrollbar\"\n [ngClass]=\"{ 'gantt-scrollbar-bg': hasFooter() }\"\n [style.height.px]=\"ganttRoot()?.horizontalScrollbarHeight + 1\"\n [style.right.px]=\"ganttRoot()?.verticalScrollbarWidth\"\n>\n <div\n class=\"gantt-table-scrollbar\"\n syncScrollX=\"ganttTableXScroll\"\n [class.with-scrollbar]=\"ganttRoot()?.horizontalScrollbarHeight\"\n [style.width.px]=\"tableWidth()\"\n >\n <div class=\"h-100\" [style.width.px]=\"tableScrollWidth() - 1\"></div>\n </div>\n <div class=\"gantt-main-scrollbar\" syncScrollX=\"ganttMainXScroll\">\n <div class=\"h-100\" [style.width.px]=\"ganttRoot()['view']?.width\"></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }] }); }
|
|
3075
|
+
}
|
|
3076
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttScrollbarComponent, decorators: [{
|
|
2883
3077
|
type: Component,
|
|
2884
|
-
args: [{ selector: 'gantt-
|
|
3078
|
+
args: [{ selector: 'gantt-scrollbar', imports: [NgClass, GanttSyncScrollXDirective], template: "<div\n class=\"gantt-scrollbar\"\n [ngClass]=\"{ 'gantt-scrollbar-bg': hasFooter() }\"\n [style.height.px]=\"ganttRoot()?.horizontalScrollbarHeight + 1\"\n [style.right.px]=\"ganttRoot()?.verticalScrollbarWidth\"\n>\n <div\n class=\"gantt-table-scrollbar\"\n syncScrollX=\"ganttTableXScroll\"\n [class.with-scrollbar]=\"ganttRoot()?.horizontalScrollbarHeight\"\n [style.width.px]=\"tableWidth()\"\n >\n <div class=\"h-100\" [style.width.px]=\"tableScrollWidth() - 1\"></div>\n </div>\n <div class=\"gantt-main-scrollbar\" syncScrollX=\"ganttMainXScroll\">\n <div class=\"h-100\" [style.width.px]=\"ganttRoot()['view']?.width\"></div>\n </div>\n</div>\n" }]
|
|
2885
3079
|
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2886
3080
|
type: Inject,
|
|
2887
3081
|
args: [GANTT_UPPER_TOKEN]
|
|
2888
|
-
}] }
|
|
2889
|
-
type: HostBinding,
|
|
2890
|
-
args: ['class']
|
|
2891
|
-
}], height: [{
|
|
2892
|
-
type: HostBinding,
|
|
2893
|
-
args: ['style.height']
|
|
2894
|
-
}] } });
|
|
3082
|
+
}] }] });
|
|
2895
3083
|
|
|
2896
|
-
class
|
|
3084
|
+
class NgxGanttToolbarComponent {
|
|
3085
|
+
get top() {
|
|
3086
|
+
return this.ganttUpper.styles.headerHeight + 16 + 'px';
|
|
3087
|
+
}
|
|
2897
3088
|
constructor(ganttUpper) {
|
|
2898
3089
|
this.ganttUpper = ganttUpper;
|
|
3090
|
+
this.ganttItemClass = true;
|
|
3091
|
+
this.views = inject(GanttConfigService).getViewsLocale();
|
|
2899
3092
|
}
|
|
2900
|
-
|
|
2901
|
-
|
|
3093
|
+
selectView(view) {
|
|
3094
|
+
this.ganttUpper.changeView(view);
|
|
3095
|
+
}
|
|
3096
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttToolbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3097
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttToolbarComponent, isStandalone: true, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: { template: "template" }, host: { properties: { "class.gantt-toolbar": "this.ganttItemClass", "style.top": "this.top" } }, ngImport: i0, template: "<div class=\"toolbar-container\">\n @if (!template) {\n @if (this.ganttUpper.toolbarOptions?.viewTypes?.length) {\n <div class=\"toolbar-views\">\n @for (viewType of this.ganttUpper.toolbarOptions?.viewTypes; track viewType) {\n @if (views[viewType]) {\n <div class=\"toolbar-view\" [class.active]=\"viewType === this.ganttUpper.viewType\" (click)=\"selectView(viewType)\">\n {{ views[viewType].label }}\n </div>\n }\n }\n </div>\n }\n }\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
2902
3098
|
}
|
|
2903
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
3099
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
|
|
2904
3100
|
type: Component,
|
|
2905
|
-
args: [{ selector: 'gantt-
|
|
2906
|
-
class: 'gantt-drag-backdrop'
|
|
2907
|
-
}, standalone: true, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
|
|
3101
|
+
args: [{ selector: 'ngx-gantt-toolbar,gantt-toolbar', imports: [NgTemplateOutlet], template: "<div class=\"toolbar-container\">\n @if (!template) {\n @if (this.ganttUpper.toolbarOptions?.viewTypes?.length) {\n <div class=\"toolbar-views\">\n @for (viewType of this.ganttUpper.toolbarOptions?.viewTypes; track viewType) {\n @if (views[viewType]) {\n <div class=\"toolbar-view\" [class.active]=\"viewType === this.ganttUpper.viewType\" (click)=\"selectView(viewType)\">\n {{ views[viewType].label }}\n </div>\n }\n }\n </div>\n }\n }\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n" }]
|
|
2908
3102
|
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2909
3103
|
type: Inject,
|
|
2910
3104
|
args: [GANTT_UPPER_TOKEN]
|
|
2911
|
-
}] }]
|
|
3105
|
+
}] }], propDecorators: { template: [{
|
|
3106
|
+
type: Input
|
|
3107
|
+
}], ganttItemClass: [{
|
|
3108
|
+
type: HostBinding,
|
|
3109
|
+
args: ['class.gantt-toolbar']
|
|
3110
|
+
}], top: [{
|
|
3111
|
+
type: HostBinding,
|
|
3112
|
+
args: ['style.top']
|
|
3113
|
+
}] } });
|
|
2912
3114
|
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
const
|
|
2917
|
-
const
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
const
|
|
2992
|
-
const
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
};
|
|
3115
|
+
class GanttPrintService {
|
|
3116
|
+
constructor() { }
|
|
3117
|
+
setInlineStyles(targetElem) {
|
|
3118
|
+
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
3119
|
+
for (const svgElement of svgElements) {
|
|
3120
|
+
this.recursElementChildren(svgElement);
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
recursElementChildren(node) {
|
|
3124
|
+
const transformProperties = [
|
|
3125
|
+
'fill',
|
|
3126
|
+
'color',
|
|
3127
|
+
'font-size',
|
|
3128
|
+
'stroke',
|
|
3129
|
+
'font',
|
|
3130
|
+
'text-anchor',
|
|
3131
|
+
'stroke-dasharray',
|
|
3132
|
+
'shape-rendering',
|
|
3133
|
+
'stroke-width'
|
|
3134
|
+
];
|
|
3135
|
+
if (!node.style) {
|
|
3136
|
+
return;
|
|
3137
|
+
}
|
|
3138
|
+
const styles = getComputedStyle(node);
|
|
3139
|
+
for (const transformProperty of transformProperties) {
|
|
3140
|
+
node.style[transformProperty] = styles[transformProperty];
|
|
3141
|
+
}
|
|
3142
|
+
for (const child of Array.from(node.childNodes)) {
|
|
3143
|
+
this.recursElementChildren(child);
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
register(root) {
|
|
3147
|
+
this.root = root.nativeElement;
|
|
3148
|
+
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
3149
|
+
}
|
|
3150
|
+
async print(name = 'download', ignoreElementClass) {
|
|
3151
|
+
const root = this.root;
|
|
3152
|
+
const mainContainer = this.mainContainer;
|
|
3153
|
+
// set print width
|
|
3154
|
+
const printWidth = root.offsetWidth;
|
|
3155
|
+
// set print height
|
|
3156
|
+
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
3157
|
+
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
3158
|
+
html2canvas(root, {
|
|
3159
|
+
logging: false,
|
|
3160
|
+
allowTaint: true,
|
|
3161
|
+
useCORS: true,
|
|
3162
|
+
width: printWidth,
|
|
3163
|
+
height: printHeight,
|
|
3164
|
+
ignoreElements: (element) => {
|
|
3165
|
+
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
3166
|
+
return true;
|
|
3167
|
+
}
|
|
3168
|
+
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
3169
|
+
return true;
|
|
3170
|
+
}
|
|
3171
|
+
},
|
|
3172
|
+
onclone: (cloneDocument) => {
|
|
3173
|
+
const ganttClass = root.className;
|
|
3174
|
+
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
3175
|
+
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
3176
|
+
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
3177
|
+
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
3178
|
+
// change targetDom width
|
|
3179
|
+
cloneGanttDom.style.width = `${printWidth}px`;
|
|
3180
|
+
cloneGanttDom.style.height = `${printHeight}px`;
|
|
3181
|
+
cloneGanttDom.style.overflow = `unset`;
|
|
3182
|
+
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
3183
|
+
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
3184
|
+
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
3185
|
+
if (cloneLinksOverlay) {
|
|
3186
|
+
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
3187
|
+
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
3188
|
+
}
|
|
3189
|
+
// setInlineStyles for svg
|
|
3190
|
+
this.setInlineStyles(cloneGanttDom);
|
|
3191
|
+
}
|
|
3192
|
+
}).then((canvas) => {
|
|
3193
|
+
const link = document.createElement('a');
|
|
3194
|
+
const dataUrl = canvas.toDataURL('image/png');
|
|
3195
|
+
link.download = `${name}.png`;
|
|
3196
|
+
link.href = dataUrl;
|
|
3197
|
+
link.click();
|
|
3198
|
+
});
|
|
3199
|
+
}
|
|
3200
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3201
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService }); }
|
|
3202
|
+
}
|
|
3203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
3204
|
+
type: Injectable
|
|
3205
|
+
}], ctorParameters: () => [] });
|
|
3005
3206
|
|
|
3006
|
-
class
|
|
3007
|
-
|
|
3008
|
-
|
|
3207
|
+
class IsGanttRangeItemPipe {
|
|
3208
|
+
transform(value) {
|
|
3209
|
+
return value === GanttItemType.range;
|
|
3009
3210
|
}
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3211
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3212
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, isStandalone: true, name: "isGanttRangeItem" }); }
|
|
3213
|
+
}
|
|
3214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
|
|
3215
|
+
type: Pipe,
|
|
3216
|
+
args: [{
|
|
3217
|
+
name: 'isGanttRangeItem',
|
|
3218
|
+
standalone: true
|
|
3219
|
+
}]
|
|
3220
|
+
}] });
|
|
3221
|
+
class IsGanttBarItemPipe {
|
|
3222
|
+
transform(value) {
|
|
3223
|
+
return value === GanttItemType.bar;
|
|
3013
3224
|
}
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3225
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3226
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, isStandalone: true, name: "isGanttBarItem" }); }
|
|
3227
|
+
}
|
|
3228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
|
|
3229
|
+
type: Pipe,
|
|
3230
|
+
args: [{
|
|
3231
|
+
name: 'isGanttBarItem',
|
|
3232
|
+
standalone: true
|
|
3233
|
+
}]
|
|
3234
|
+
}] });
|
|
3235
|
+
class IsGanttCustomItemPipe {
|
|
3236
|
+
transform(value) {
|
|
3237
|
+
return value === GanttItemType.custom;
|
|
3022
3238
|
}
|
|
3023
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
3024
|
-
static { this.ɵ
|
|
3239
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3240
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, isStandalone: true, name: "isGanttCustomItem" }); }
|
|
3025
3241
|
}
|
|
3026
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
3027
|
-
type:
|
|
3242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
|
|
3243
|
+
type: Pipe,
|
|
3028
3244
|
args: [{
|
|
3029
|
-
|
|
3030
|
-
template: '',
|
|
3245
|
+
name: 'isGanttCustomItem',
|
|
3031
3246
|
standalone: true
|
|
3032
3247
|
}]
|
|
3033
|
-
}]
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3248
|
+
}] });
|
|
3249
|
+
class IsGanttGroupPipe {
|
|
3250
|
+
transform(data) {
|
|
3251
|
+
return !!data.items;
|
|
3252
|
+
}
|
|
3253
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3254
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, isStandalone: true, name: "isGanttGroup" }); }
|
|
3255
|
+
}
|
|
3256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, decorators: [{
|
|
3257
|
+
type: Pipe,
|
|
3258
|
+
args: [{
|
|
3259
|
+
name: 'isGanttGroup',
|
|
3260
|
+
standalone: true
|
|
3261
|
+
}]
|
|
3262
|
+
}] });
|
|
3039
3263
|
|
|
3040
3264
|
class GanttLinkLine {
|
|
3041
3265
|
constructor() { }
|
|
@@ -3332,7 +3556,19 @@ class GanttLinksComponent {
|
|
|
3332
3556
|
if (target && (target.origin.start || target.origin.end)) {
|
|
3333
3557
|
let defaultColor = LinkColors.default;
|
|
3334
3558
|
let activeColor = LinkColors.active;
|
|
3335
|
-
if (link.type === GanttLinkType.
|
|
3559
|
+
if (link.type === GanttLinkType.ff && source.end.getTime() > target.end.getTime()) {
|
|
3560
|
+
defaultColor = LinkColors.blocked;
|
|
3561
|
+
activeColor = LinkColors.blocked;
|
|
3562
|
+
}
|
|
3563
|
+
else if (link.type === GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
|
|
3564
|
+
defaultColor = LinkColors.blocked;
|
|
3565
|
+
activeColor = LinkColors.blocked;
|
|
3566
|
+
}
|
|
3567
|
+
else if (link.type === GanttLinkType.sf && source.start.getTime() > target.end.getTime()) {
|
|
3568
|
+
defaultColor = LinkColors.blocked;
|
|
3569
|
+
activeColor = LinkColors.blocked;
|
|
3570
|
+
}
|
|
3571
|
+
else if (link.type === GanttLinkType.ss && source.start.getTime() > target.start.getTime()) {
|
|
3336
3572
|
defaultColor = LinkColors.blocked;
|
|
3337
3573
|
activeColor = LinkColors.blocked;
|
|
3338
3574
|
}
|
|
@@ -3363,147 +3599,170 @@ class GanttLinksComponent {
|
|
|
3363
3599
|
trackBy(index) {
|
|
3364
3600
|
return index;
|
|
3365
3601
|
}
|
|
3366
|
-
onLineClick(event, link) {
|
|
3367
|
-
this.lineClick.emit({
|
|
3368
|
-
event,
|
|
3369
|
-
source: link.source,
|
|
3370
|
-
target: link.target
|
|
3371
|
-
});
|
|
3602
|
+
onLineClick(event, link) {
|
|
3603
|
+
this.lineClick.emit({
|
|
3604
|
+
event,
|
|
3605
|
+
source: link.source,
|
|
3606
|
+
target: link.target
|
|
3607
|
+
});
|
|
3608
|
+
}
|
|
3609
|
+
mouseEnterPath(link, index) {
|
|
3610
|
+
link.color = link.activeColor || link.defaultColor;
|
|
3611
|
+
if (index < this.links.length - 1) {
|
|
3612
|
+
this.links.splice(index, 1);
|
|
3613
|
+
this.links.push(link);
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
mouseLeavePath(link) {
|
|
3617
|
+
link.color = link.defaultColor;
|
|
3618
|
+
}
|
|
3619
|
+
ngOnDestroy() {
|
|
3620
|
+
this.unsubscribe$.next();
|
|
3621
|
+
this.unsubscribe$.complete();
|
|
3622
|
+
}
|
|
3623
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3624
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttLinksComponent, isStandalone: true, selector: "gantt-links-overlay", inputs: { flatItems: "flatItems" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n @for (link of links; track trackBy(i); let i = $index) {\n <ng-container>\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n @if (showArrow) {\n <defs>\n @if (link.type === ganttLinkTypes.sf) {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"180\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n } @else {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n }\n </defs>\n }\n </ng-container>\n }\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }); }
|
|
3625
|
+
}
|
|
3626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
3627
|
+
type: Component,
|
|
3628
|
+
args: [{ selector: 'gantt-links-overlay', imports: [], template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n @for (link of links; track trackBy(i); let i = $index) {\n <ng-container>\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n @if (showArrow) {\n <defs>\n @if (link.type === ganttLinkTypes.sf) {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"180\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n } @else {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n }\n </defs>\n }\n </ng-container>\n }\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }]
|
|
3629
|
+
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
3630
|
+
type: Inject,
|
|
3631
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3632
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }], propDecorators: { flatItems: [{
|
|
3633
|
+
type: Input
|
|
3634
|
+
}], lineClick: [{
|
|
3635
|
+
type: Output
|
|
3636
|
+
}], ganttLinksOverlay: [{
|
|
3637
|
+
type: HostBinding,
|
|
3638
|
+
args: ['class.gantt-links-overlay']
|
|
3639
|
+
}] } });
|
|
3640
|
+
|
|
3641
|
+
const angleRight = `<svg xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="amnavigation/angle-right" stroke-width="1" fill-rule="evenodd"><path d="M7.978 11.498l-.005.005L2.3 5.831 3.13 5l4.848 4.848L12.826 5l.83.831-5.673 5.672-.005-.005z" transform="rotate(-90 7.978 8.252)"></path></g></svg>`;
|
|
3642
|
+
const angleDown = `<svg xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="aknavigation/angle-down" stroke-width="1" fill-rule="evenodd"><path d="M7.978 11.997l-.005.006L2.3 6.33l.83-.831 4.848 4.848L12.826 5.5l.83.83-5.673 5.673-.005-.006z" ></path></g></svg>`;
|
|
3643
|
+
const plusSquare = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="kxaction/plus-square" stroke-width="1" fill-rule="evenodd"><path d="M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm5.45 6.2V4.75h1.2V7.4h2.65v1.2H8.65v2.65h-1.2V8.6H4.8V7.4h2.65z"></path></g></svg>`;
|
|
3644
|
+
const minusSquare = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="jnaction/minus-square" stroke-width="1" fill-rule="evenodd"><path d="M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm2.8 6.2h6.5v1.2H4.8V7.4z"></path></g></svg>`;
|
|
3645
|
+
const loadingIcon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve">
|
|
3646
|
+
<path fill="#aaa" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)">
|
|
3647
|
+
<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform>
|
|
3648
|
+
</path>
|
|
3649
|
+
</svg>`;
|
|
3650
|
+
const emptyIcon = `<svg
|
|
3651
|
+
width="148px"
|
|
3652
|
+
height="134px"
|
|
3653
|
+
viewBox="0 0 148 134"
|
|
3654
|
+
version="1.1"
|
|
3655
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3656
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3657
|
+
>
|
|
3658
|
+
<defs>
|
|
3659
|
+
<filter x="0.0%" y="0.0%" width="100.0%" height="100.0%" filterUnits="objectBoundingBox" id="filter-1">
|
|
3660
|
+
<feGaussianBlur stdDeviation="0" in="SourceGraphic"></feGaussianBlur>
|
|
3661
|
+
</filter>
|
|
3662
|
+
</defs>
|
|
3663
|
+
<g id="148x134" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
3664
|
+
<g id="编组-6" transform="translate(1.000000, 1.000000)">
|
|
3665
|
+
<ellipse
|
|
3666
|
+
id="椭圆形"
|
|
3667
|
+
fill="#EDEEF2"
|
|
3668
|
+
opacity="0.3"
|
|
3669
|
+
filter="url(#filter-1)"
|
|
3670
|
+
cx="73.0800017"
|
|
3671
|
+
cy="115.920003"
|
|
3672
|
+
rx="73.0800017"
|
|
3673
|
+
ry="16.8000004"
|
|
3674
|
+
></ellipse>
|
|
3675
|
+
<g id="编组-5" transform="translate(15.120000, 0.000000)">
|
|
3676
|
+
<polygon
|
|
3677
|
+
id="矩形"
|
|
3678
|
+
fill="#E2E4E9"
|
|
3679
|
+
points="19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267"
|
|
3680
|
+
></polygon>
|
|
3681
|
+
<path
|
|
3682
|
+
d="M23.5200005,0 L94.0800002,0 C97.7913538,2.06413823e-16 100.8,3.00864655 100.8,6.72000015 L100.8,99.1200023 L100.8,99.1200023 L16.8000004,99.1200023 L16.8000004,6.72000015 C16.8000004,3.00864655 19.8086469,1.56994302e-15 23.5200005,0 Z"
|
|
3683
|
+
id="矩形"
|
|
3684
|
+
fill="#F9FAFB"
|
|
3685
|
+
></path>
|
|
3686
|
+
<path
|
|
3687
|
+
d="M30.9200007,12.4400003 L86.6800019,12.4400003 C88.5356787,12.4400003 90.040002,13.9443236 90.040002,15.8000004 L90.040002,42.000001 C90.040002,43.8556778 88.5356787,45.360001 86.6800019,45.360001 L30.9200007,45.360001 C29.0643239,45.360001 27.5600006,43.8556778 27.5600006,42.000001 L27.5600006,15.8000004 C27.5600006,13.9443236 29.0643239,12.4400003 30.9200007,12.4400003 Z"
|
|
3688
|
+
id="矩形"
|
|
3689
|
+
fill="#E8EAEE"
|
|
3690
|
+
></path>
|
|
3691
|
+
<text
|
|
3692
|
+
id="</null>"
|
|
3693
|
+
font-family="PingFangSC-Medium, PingFang SC"
|
|
3694
|
+
font-size="15.1200003"
|
|
3695
|
+
font-weight="400"
|
|
3696
|
+
fill="#BCBECD"
|
|
3697
|
+
>
|
|
3698
|
+
<tspan x="33.6000008" y="32.8000004"></null></tspan>
|
|
3699
|
+
</text>
|
|
3700
|
+
<rect id="矩形" fill="#E8EAEE" x="27.5600006" y="52.0800012" width="61.4800014" height="5.04000011" rx="2.52000006"></rect>
|
|
3701
|
+
<rect
|
|
3702
|
+
id="矩形备份"
|
|
3703
|
+
fill="#E8EAEE"
|
|
3704
|
+
x="27.5600006"
|
|
3705
|
+
y="63.8400014"
|
|
3706
|
+
width="61.4800014"
|
|
3707
|
+
height="5.04000011"
|
|
3708
|
+
rx="2.52000006"
|
|
3709
|
+
></rect>
|
|
3710
|
+
<path
|
|
3711
|
+
d="M0,75.6000017 L29.280235,75.6000017 C32.0637502,75.6000017 34.3202352,77.8564866 34.3202352,80.6400018 L34.3202352,86.2591426 C34.3202352,89.0426578 36.5767201,91.2991427 39.3602353,91.2991427 L78.4136737,91.2991427 C81.1971889,91.2991427 83.4536738,89.0426578 83.4536738,86.2591426 L83.4536738,80.6400018 C83.4536738,77.8564866 85.7101587,75.6000017 88.4936739,75.6000017 L117.600003,75.6000017 L117.600003,75.6000017 L117.600003,110.880003 C117.600003,115.519195 113.839194,119.280003 109.200002,119.280003 L8.40000019,119.280003 C3.76080819,119.280003 -6.53729019e-15,115.519195 0,110.880003 L0,75.6000017 L0,75.6000017 Z"
|
|
3712
|
+
id="矩形"
|
|
3713
|
+
fill="#EDEFF2"
|
|
3714
|
+
></path>
|
|
3715
|
+
</g>
|
|
3716
|
+
</g>
|
|
3717
|
+
</g>
|
|
3718
|
+
</svg>`;
|
|
3719
|
+
const dragIcon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="aijaction/drag--" stroke-width="1" fill-rule="evenodd"><g id="aij拖动" transform="translate(5 1)" fill-rule="nonzero"><path d="M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" id="aij形状结合"></path></g></g></svg>`;
|
|
3720
|
+
const arrowLeftIcon = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" height="1em" width="1em" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="adinavigation/arrow-left" stroke-width="1" fill-rule="evenodd"><path d="M7.4 4.15L4.438 7.315a.6.6 0 0 1-.876-.82l3.97-4.243a.598.598 0 0 1 .93-.057l3.97 4.323a.6.6 0 1 1-.885.812L8.6 4.118v9.149c0 .404-.269.733-.6.733-.332 0-.6-.329-.6-.733V4.15z" id="adi形状结合" transform="rotate(-90 7.995 8)"></path></g></svg>`;
|
|
3721
|
+
const arrowRightIcon = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" height="1em" width="1em" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="adlnavigation/arrow-right" stroke-width="1" fill-rule="evenodd"><path d="M7.4 4.15L4.438 7.315a.6.6 0 0 1-.876-.82l3.97-4.243a.598.598 0 0 1 .93-.057l3.97 4.323a.6.6 0 1 1-.885.812L8.6 4.118v9.149c0 .404-.269.733-.6.733-.332 0-.6-.329-.6-.733V4.15z" id="adl形状结合" transform="rotate(90 7.995 8)"></path></g></svg>`;
|
|
3722
|
+
const icons = {
|
|
3723
|
+
'angle-right': angleRight,
|
|
3724
|
+
'angle-down': angleDown,
|
|
3725
|
+
'plus-square': plusSquare,
|
|
3726
|
+
'minus-square': minusSquare,
|
|
3727
|
+
loading: loadingIcon,
|
|
3728
|
+
empty: emptyIcon,
|
|
3729
|
+
drag: dragIcon,
|
|
3730
|
+
'arrow-left': arrowLeftIcon,
|
|
3731
|
+
'arrow-right': arrowRightIcon
|
|
3732
|
+
};
|
|
3733
|
+
|
|
3734
|
+
class GanttIconComponent {
|
|
3735
|
+
set iconName(name) {
|
|
3736
|
+
this.setSvg(name);
|
|
3737
|
+
}
|
|
3738
|
+
constructor(elementRef) {
|
|
3739
|
+
this.elementRef = elementRef;
|
|
3740
|
+
this.isIcon = true;
|
|
3372
3741
|
}
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
if (
|
|
3376
|
-
this.
|
|
3377
|
-
|
|
3742
|
+
setSvg(name) {
|
|
3743
|
+
const iconSvg = icons[name];
|
|
3744
|
+
if (iconSvg) {
|
|
3745
|
+
this.elementRef.nativeElement.innerHTML = iconSvg;
|
|
3746
|
+
}
|
|
3747
|
+
else {
|
|
3748
|
+
this.elementRef.nativeElement.innerHTML = '';
|
|
3378
3749
|
}
|
|
3379
3750
|
}
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
}
|
|
3383
|
-
ngOnDestroy() {
|
|
3384
|
-
this.unsubscribe$.next();
|
|
3385
|
-
this.unsubscribe$.complete();
|
|
3386
|
-
}
|
|
3387
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3388
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttLinksComponent, isStandalone: true, selector: "gantt-links-overlay", inputs: { flatItems: "flatItems" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n @for (link of links; track trackBy(i); let i = $index) {\n <ng-container>\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n @if (showArrow) {\n <defs>\n @if (link.type === ganttLinkTypes.sf) {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"180\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n } @else {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n }\n </defs>\n }\n </ng-container>\n }\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }); }
|
|
3389
|
-
}
|
|
3390
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
3391
|
-
type: Component,
|
|
3392
|
-
args: [{ selector: 'gantt-links-overlay', imports: [], template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n @for (link of links; track trackBy(i); let i = $index) {\n <ng-container>\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n @if (showArrow) {\n <defs>\n @if (link.type === ganttLinkTypes.sf) {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"180\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n } @else {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n }\n </defs>\n }\n </ng-container>\n }\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }]
|
|
3393
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
3394
|
-
type: Inject,
|
|
3395
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3396
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }], propDecorators: { flatItems: [{
|
|
3397
|
-
type: Input
|
|
3398
|
-
}], lineClick: [{
|
|
3399
|
-
type: Output
|
|
3400
|
-
}], ganttLinksOverlay: [{
|
|
3401
|
-
type: HostBinding,
|
|
3402
|
-
args: ['class.gantt-links-overlay']
|
|
3403
|
-
}] } });
|
|
3404
|
-
|
|
3405
|
-
class GanttLoaderComponent {
|
|
3406
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3407
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttLoaderComponent, isStandalone: true, selector: "gantt-loader", host: { classAttribute: "gantt-loader gantt-loader-overlay" }, ngImport: i0, template: `
|
|
3408
|
-
<div class="gantt-loader-wrapper">
|
|
3409
|
-
<div class="gantt-loader-loading">
|
|
3410
|
-
<span class="gantt-loader-loading-spot"></span>
|
|
3411
|
-
</div>
|
|
3412
|
-
</div>
|
|
3413
|
-
`, isInline: true }); }
|
|
3751
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttIconComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3752
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttIconComponent, isStandalone: true, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0, template: '', isInline: true }); }
|
|
3414
3753
|
}
|
|
3415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
3754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttIconComponent, decorators: [{
|
|
3416
3755
|
type: Component,
|
|
3417
3756
|
args: [{
|
|
3418
|
-
selector: 'gantt-
|
|
3419
|
-
template:
|
|
3420
|
-
<div class="gantt-loader-wrapper">
|
|
3421
|
-
<div class="gantt-loader-loading">
|
|
3422
|
-
<span class="gantt-loader-loading-spot"></span>
|
|
3423
|
-
</div>
|
|
3424
|
-
</div>
|
|
3425
|
-
`,
|
|
3426
|
-
host: {
|
|
3427
|
-
class: 'gantt-loader gantt-loader-overlay'
|
|
3428
|
-
},
|
|
3429
|
-
standalone: true
|
|
3430
|
-
}]
|
|
3431
|
-
}] });
|
|
3432
|
-
|
|
3433
|
-
class IsGanttRangeItemPipe {
|
|
3434
|
-
transform(value) {
|
|
3435
|
-
return value === GanttItemType.range;
|
|
3436
|
-
}
|
|
3437
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3438
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, isStandalone: true, name: "isGanttRangeItem" }); }
|
|
3439
|
-
}
|
|
3440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
|
|
3441
|
-
type: Pipe,
|
|
3442
|
-
args: [{
|
|
3443
|
-
name: 'isGanttRangeItem',
|
|
3444
|
-
standalone: true
|
|
3445
|
-
}]
|
|
3446
|
-
}] });
|
|
3447
|
-
class IsGanttBarItemPipe {
|
|
3448
|
-
transform(value) {
|
|
3449
|
-
return value === GanttItemType.bar;
|
|
3450
|
-
}
|
|
3451
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3452
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, isStandalone: true, name: "isGanttBarItem" }); }
|
|
3453
|
-
}
|
|
3454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
|
|
3455
|
-
type: Pipe,
|
|
3456
|
-
args: [{
|
|
3457
|
-
name: 'isGanttBarItem',
|
|
3458
|
-
standalone: true
|
|
3459
|
-
}]
|
|
3460
|
-
}] });
|
|
3461
|
-
class IsGanttCustomItemPipe {
|
|
3462
|
-
transform(value) {
|
|
3463
|
-
return value === GanttItemType.custom;
|
|
3464
|
-
}
|
|
3465
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3466
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, isStandalone: true, name: "isGanttCustomItem" }); }
|
|
3467
|
-
}
|
|
3468
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
|
|
3469
|
-
type: Pipe,
|
|
3470
|
-
args: [{
|
|
3471
|
-
name: 'isGanttCustomItem',
|
|
3472
|
-
standalone: true
|
|
3473
|
-
}]
|
|
3474
|
-
}] });
|
|
3475
|
-
class IsGanttGroupPipe {
|
|
3476
|
-
transform(data) {
|
|
3477
|
-
return !!data.items;
|
|
3478
|
-
}
|
|
3479
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3480
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, isStandalone: true, name: "isGanttGroup" }); }
|
|
3481
|
-
}
|
|
3482
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, decorators: [{
|
|
3483
|
-
type: Pipe,
|
|
3484
|
-
args: [{
|
|
3485
|
-
name: 'isGanttGroup',
|
|
3757
|
+
selector: 'gantt-icon',
|
|
3758
|
+
template: '',
|
|
3486
3759
|
standalone: true
|
|
3487
3760
|
}]
|
|
3488
|
-
}] }
|
|
3489
|
-
|
|
3490
|
-
class NgxGanttRangeComponent extends GanttItemUpper {
|
|
3491
|
-
constructor(elementRef, ganttUpper) {
|
|
3492
|
-
super(elementRef, ganttUpper);
|
|
3493
|
-
this.ganttRangeClass = true;
|
|
3494
|
-
}
|
|
3495
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3496
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttRangeComponent, isStandalone: true, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
3497
|
-
}
|
|
3498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
|
|
3499
|
-
type: Component,
|
|
3500
|
-
args: [{ selector: 'ngx-gantt-range,gantt-range', imports: [NgTemplateOutlet], template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n" }]
|
|
3501
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3502
|
-
type: Inject,
|
|
3503
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3504
|
-
}] }], propDecorators: { ganttRangeClass: [{
|
|
3761
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { isIcon: [{
|
|
3505
3762
|
type: HostBinding,
|
|
3506
|
-
args: ['class.gantt-
|
|
3763
|
+
args: ['class.gantt-icon']
|
|
3764
|
+
}], iconName: [{
|
|
3765
|
+
type: Input
|
|
3507
3766
|
}] } });
|
|
3508
3767
|
|
|
3509
3768
|
class GanttMainComponent {
|
|
@@ -3584,123 +3843,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
3584
3843
|
type: Output
|
|
3585
3844
|
}], lineClick: [{
|
|
3586
3845
|
type: Output
|
|
3587
|
-
}], ganttMainClass: [{
|
|
3588
|
-
type: HostBinding,
|
|
3589
|
-
args: ['class.gantt-main-container']
|
|
3590
|
-
}] } });
|
|
3591
|
-
|
|
3592
|
-
const GANTT_ABSTRACT_TOKEN = new InjectionToken('gantt-abstract-token');
|
|
3593
|
-
|
|
3594
|
-
const supports = (typeof window !== 'undefined' && !!window.CSS && CSS.supports) || (() => false);
|
|
3595
|
-
/**
|
|
3596
|
-
* Note: we don't need to add vendor prefixes within `.scss` files since they're added automatically.
|
|
3597
|
-
* This function is necessary when the `element.style` is updated directly through the JavaScript.
|
|
3598
|
-
* This is not required to be used with CSS properties that don't require vendor prefixes (e.g. `opacity`).
|
|
3599
|
-
*/
|
|
3600
|
-
function setStyleWithVendorPrefix({ element, style, value }) {
|
|
3601
|
-
element.style[style] = value;
|
|
3602
|
-
if (supports(`-webkit-${style}: ${value}`)) {
|
|
3603
|
-
// Note: some browsers still require setting `-webkit` vendor prefix. E.g. Mozilla 49 has implemented
|
|
3604
|
-
// the 3D support for `transform`, but it requires setting `-webkit-` prefix.
|
|
3605
|
-
element.style[`-webkit-${style}`] = value;
|
|
3606
|
-
}
|
|
3607
|
-
}
|
|
3608
|
-
|
|
3609
|
-
class GanttSyncScrollService {
|
|
3610
|
-
constructor() {
|
|
3611
|
-
this.ngZone = inject(NgZone);
|
|
3612
|
-
this.scrollGroupsMap = new Map();
|
|
3613
|
-
}
|
|
3614
|
-
registerScrollEvent(groupName, element, direction) {
|
|
3615
|
-
const group = this.scrollGroupsMap.get(groupName) || { elements: [], destroy$: new Subject(), direction };
|
|
3616
|
-
group.elements.push(element);
|
|
3617
|
-
this.scrollGroupsMap.set(groupName, group);
|
|
3618
|
-
this.monitorScrollChange(group);
|
|
3619
|
-
}
|
|
3620
|
-
unregisterScrollEvent(groupName, element) {
|
|
3621
|
-
const group = this.scrollGroupsMap.get(groupName);
|
|
3622
|
-
if (group) {
|
|
3623
|
-
group.elements = group.elements.filter((el) => el !== element);
|
|
3624
|
-
if (!group.elements.length) {
|
|
3625
|
-
this.scrollGroupsMap.delete(groupName);
|
|
3626
|
-
}
|
|
3627
|
-
else {
|
|
3628
|
-
this.scrollGroupsMap.set(groupName, group);
|
|
3629
|
-
}
|
|
3630
|
-
this.monitorScrollChange(group);
|
|
3631
|
-
}
|
|
3632
|
-
}
|
|
3633
|
-
monitorScrollChange(group) {
|
|
3634
|
-
const { elements, destroy$, direction } = group;
|
|
3635
|
-
destroy$.next();
|
|
3636
|
-
destroy$.complete();
|
|
3637
|
-
if (elements.length) {
|
|
3638
|
-
const scrollObservers = elements.map((el) => fromEvent(el, 'scroll', passiveListenerOptions));
|
|
3639
|
-
this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
3640
|
-
.pipe(takeUntil$1(destroy$))
|
|
3641
|
-
.subscribe((event) => {
|
|
3642
|
-
elements.forEach((el) => {
|
|
3643
|
-
if (direction === 'x') {
|
|
3644
|
-
el.scrollLeft = event.currentTarget.scrollLeft;
|
|
3645
|
-
}
|
|
3646
|
-
else {
|
|
3647
|
-
el.scrollTop = event.currentTarget.scrollTop;
|
|
3648
|
-
}
|
|
3649
|
-
});
|
|
3650
|
-
}));
|
|
3651
|
-
}
|
|
3652
|
-
}
|
|
3653
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3654
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService }); }
|
|
3655
|
-
}
|
|
3656
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, decorators: [{
|
|
3657
|
-
type: Injectable
|
|
3658
|
-
}], ctorParameters: () => [] });
|
|
3846
|
+
}], ganttMainClass: [{
|
|
3847
|
+
type: HostBinding,
|
|
3848
|
+
args: ['class.gantt-main-container']
|
|
3849
|
+
}] } });
|
|
3659
3850
|
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
}
|
|
3675
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollXDirective, decorators: [{
|
|
3676
|
-
type: Directive,
|
|
3677
|
-
args: [{
|
|
3678
|
-
selector: '[syncScrollX]',
|
|
3679
|
-
standalone: true
|
|
3680
|
-
}]
|
|
3681
|
-
}], ctorParameters: () => [] });
|
|
3682
|
-
class GanttSyncScrollYDirective {
|
|
3683
|
-
constructor() {
|
|
3684
|
-
this.syncScrollY = input();
|
|
3685
|
-
this.syncScrollService = inject(GanttSyncScrollService);
|
|
3686
|
-
this.elementRef = inject((ElementRef));
|
|
3687
|
-
}
|
|
3688
|
-
ngOnInit() {
|
|
3689
|
-
this.syncScrollService.registerScrollEvent(this.syncScrollY(), this.elementRef.nativeElement, 'y');
|
|
3690
|
-
}
|
|
3691
|
-
ngOnDestroy() {
|
|
3692
|
-
this.syncScrollService.unregisterScrollEvent(this.syncScrollY(), this.elementRef.nativeElement);
|
|
3851
|
+
const GANTT_ABSTRACT_TOKEN = new InjectionToken('gantt-abstract-token');
|
|
3852
|
+
|
|
3853
|
+
const supports = (typeof window !== 'undefined' && !!window.CSS && CSS.supports) || (() => false);
|
|
3854
|
+
/**
|
|
3855
|
+
* Note: we don't need to add vendor prefixes within `.scss` files since they're added automatically.
|
|
3856
|
+
* This function is necessary when the `element.style` is updated directly through the JavaScript.
|
|
3857
|
+
* This is not required to be used with CSS properties that don't require vendor prefixes (e.g. `opacity`).
|
|
3858
|
+
*/
|
|
3859
|
+
function setStyleWithVendorPrefix({ element, style, value }) {
|
|
3860
|
+
element.style[style] = value;
|
|
3861
|
+
if (supports(`-webkit-${style}: ${value}`)) {
|
|
3862
|
+
// Note: some browsers still require setting `-webkit` vendor prefix. E.g. Mozilla 49 has implemented
|
|
3863
|
+
// the 3D support for `transform`, but it requires setting `-webkit-` prefix.
|
|
3864
|
+
element.style[`-webkit-${style}`] = value;
|
|
3693
3865
|
}
|
|
3694
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3695
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.3", type: GanttSyncScrollYDirective, isStandalone: true, selector: "[syncScrollY]", inputs: { syncScrollY: { classPropertyName: "syncScrollY", publicName: "syncScrollY", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
3696
3866
|
}
|
|
3697
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, decorators: [{
|
|
3698
|
-
type: Directive,
|
|
3699
|
-
args: [{
|
|
3700
|
-
selector: '[syncScrollY]',
|
|
3701
|
-
standalone: true
|
|
3702
|
-
}]
|
|
3703
|
-
}], ctorParameters: () => [] });
|
|
3704
3867
|
|
|
3705
3868
|
const defaultColumnWidth = 100;
|
|
3706
3869
|
const minColumnWidth = 80;
|
|
@@ -4162,148 +4325,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4162
4325
|
args: [(CdkDrag)]
|
|
4163
4326
|
}] } });
|
|
4164
4327
|
|
|
4165
|
-
class NgxGanttToolbarComponent {
|
|
4166
|
-
get top() {
|
|
4167
|
-
return this.ganttUpper.styles.headerHeight + 16 + 'px';
|
|
4168
|
-
}
|
|
4169
|
-
constructor(ganttUpper) {
|
|
4170
|
-
this.ganttUpper = ganttUpper;
|
|
4171
|
-
this.ganttItemClass = true;
|
|
4172
|
-
this.views = inject(GanttConfigService).getViewsLocale();
|
|
4173
|
-
}
|
|
4174
|
-
selectView(view) {
|
|
4175
|
-
this.ganttUpper.changeView(view);
|
|
4176
|
-
}
|
|
4177
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttToolbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4178
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttToolbarComponent, isStandalone: true, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: { template: "template" }, host: { properties: { "class.gantt-toolbar": "this.ganttItemClass", "style.top": "this.top" } }, ngImport: i0, template: "<div class=\"toolbar-container\">\n @if (!template) {\n @if (this.ganttUpper.toolbarOptions?.viewTypes?.length) {\n <div class=\"toolbar-views\">\n @for (viewType of this.ganttUpper.toolbarOptions?.viewTypes; track viewType) {\n @if (views[viewType]) {\n <div class=\"toolbar-view\" [class.active]=\"viewType === this.ganttUpper.viewType\" (click)=\"selectView(viewType)\">\n {{ views[viewType].label }}\n </div>\n }\n }\n </div>\n }\n }\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
4179
|
-
}
|
|
4180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
|
|
4181
|
-
type: Component,
|
|
4182
|
-
args: [{ selector: 'ngx-gantt-toolbar,gantt-toolbar', imports: [NgTemplateOutlet], template: "<div class=\"toolbar-container\">\n @if (!template) {\n @if (this.ganttUpper.toolbarOptions?.viewTypes?.length) {\n <div class=\"toolbar-views\">\n @for (viewType of this.ganttUpper.toolbarOptions?.viewTypes; track viewType) {\n @if (views[viewType]) {\n <div class=\"toolbar-view\" [class.active]=\"viewType === this.ganttUpper.viewType\" (click)=\"selectView(viewType)\">\n {{ views[viewType].label }}\n </div>\n }\n }\n </div>\n }\n }\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n" }]
|
|
4183
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
4184
|
-
type: Inject,
|
|
4185
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4186
|
-
}] }], propDecorators: { template: [{
|
|
4187
|
-
type: Input
|
|
4188
|
-
}], ganttItemClass: [{
|
|
4189
|
-
type: HostBinding,
|
|
4190
|
-
args: ['class.gantt-toolbar']
|
|
4191
|
-
}], top: [{
|
|
4192
|
-
type: HostBinding,
|
|
4193
|
-
args: ['style.top']
|
|
4194
|
-
}] } });
|
|
4195
|
-
|
|
4196
|
-
class GanttScrollbarComponent {
|
|
4197
|
-
constructor(ganttUpper) {
|
|
4198
|
-
this.ganttUpper = ganttUpper;
|
|
4199
|
-
this.hasFooter = input(false);
|
|
4200
|
-
this.tableWidth = input();
|
|
4201
|
-
this.ganttRoot = input();
|
|
4202
|
-
this.tableScrollWidth = input(0);
|
|
4203
|
-
}
|
|
4204
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttScrollbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4205
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.3", type: GanttScrollbarComponent, isStandalone: true, selector: "gantt-scrollbar", inputs: { hasFooter: { classPropertyName: "hasFooter", publicName: "hasFooter", isSignal: true, isRequired: false, transformFunction: null }, tableWidth: { classPropertyName: "tableWidth", publicName: "tableWidth", isSignal: true, isRequired: false, transformFunction: null }, ganttRoot: { classPropertyName: "ganttRoot", publicName: "ganttRoot", isSignal: true, isRequired: false, transformFunction: null }, tableScrollWidth: { classPropertyName: "tableScrollWidth", publicName: "tableScrollWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"gantt-scrollbar\"\n [ngClass]=\"{ 'gantt-scrollbar-bg': hasFooter() }\"\n [style.height.px]=\"ganttRoot()?.horizontalScrollbarHeight + 1\"\n [style.right.px]=\"ganttRoot()?.verticalScrollbarWidth\"\n>\n <div\n class=\"gantt-table-scrollbar\"\n syncScrollX=\"ganttTableXScroll\"\n [class.with-scrollbar]=\"ganttRoot()?.horizontalScrollbarHeight\"\n [style.width.px]=\"tableWidth()\"\n >\n <div class=\"h-100\" [style.width.px]=\"tableScrollWidth() - 1\"></div>\n </div>\n <div class=\"gantt-main-scrollbar\" syncScrollX=\"ganttMainXScroll\">\n <div class=\"h-100\" [style.width.px]=\"ganttRoot()['view']?.width\"></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }] }); }
|
|
4206
|
-
}
|
|
4207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttScrollbarComponent, decorators: [{
|
|
4208
|
-
type: Component,
|
|
4209
|
-
args: [{ selector: 'gantt-scrollbar', imports: [NgClass, GanttSyncScrollXDirective], template: "<div\n class=\"gantt-scrollbar\"\n [ngClass]=\"{ 'gantt-scrollbar-bg': hasFooter() }\"\n [style.height.px]=\"ganttRoot()?.horizontalScrollbarHeight + 1\"\n [style.right.px]=\"ganttRoot()?.verticalScrollbarWidth\"\n>\n <div\n class=\"gantt-table-scrollbar\"\n syncScrollX=\"ganttTableXScroll\"\n [class.with-scrollbar]=\"ganttRoot()?.horizontalScrollbarHeight\"\n [style.width.px]=\"tableWidth()\"\n >\n <div class=\"h-100\" [style.width.px]=\"tableScrollWidth() - 1\"></div>\n </div>\n <div class=\"gantt-main-scrollbar\" syncScrollX=\"ganttMainXScroll\">\n <div class=\"h-100\" [style.width.px]=\"ganttRoot()['view']?.width\"></div>\n </div>\n</div>\n" }]
|
|
4210
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
4211
|
-
type: Inject,
|
|
4212
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4213
|
-
}] }] });
|
|
4214
|
-
|
|
4215
|
-
class GanttPrintService {
|
|
4216
|
-
constructor() { }
|
|
4217
|
-
setInlineStyles(targetElem) {
|
|
4218
|
-
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
4219
|
-
for (const svgElement of svgElements) {
|
|
4220
|
-
this.recursElementChildren(svgElement);
|
|
4221
|
-
}
|
|
4222
|
-
}
|
|
4223
|
-
recursElementChildren(node) {
|
|
4224
|
-
const transformProperties = [
|
|
4225
|
-
'fill',
|
|
4226
|
-
'color',
|
|
4227
|
-
'font-size',
|
|
4228
|
-
'stroke',
|
|
4229
|
-
'font',
|
|
4230
|
-
'text-anchor',
|
|
4231
|
-
'stroke-dasharray',
|
|
4232
|
-
'shape-rendering',
|
|
4233
|
-
'stroke-width'
|
|
4234
|
-
];
|
|
4235
|
-
if (!node.style) {
|
|
4236
|
-
return;
|
|
4237
|
-
}
|
|
4238
|
-
const styles = getComputedStyle(node);
|
|
4239
|
-
for (const transformProperty of transformProperties) {
|
|
4240
|
-
node.style[transformProperty] = styles[transformProperty];
|
|
4241
|
-
}
|
|
4242
|
-
for (const child of Array.from(node.childNodes)) {
|
|
4243
|
-
this.recursElementChildren(child);
|
|
4244
|
-
}
|
|
4245
|
-
}
|
|
4246
|
-
register(root) {
|
|
4247
|
-
this.root = root.nativeElement;
|
|
4248
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
4249
|
-
}
|
|
4250
|
-
async print(name = 'download', ignoreElementClass) {
|
|
4251
|
-
const root = this.root;
|
|
4252
|
-
const mainContainer = this.mainContainer;
|
|
4253
|
-
// set print width
|
|
4254
|
-
const printWidth = root.offsetWidth;
|
|
4255
|
-
// set print height
|
|
4256
|
-
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
4257
|
-
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
4258
|
-
html2canvas(root, {
|
|
4259
|
-
logging: false,
|
|
4260
|
-
allowTaint: true,
|
|
4261
|
-
useCORS: true,
|
|
4262
|
-
width: printWidth,
|
|
4263
|
-
height: printHeight,
|
|
4264
|
-
ignoreElements: (element) => {
|
|
4265
|
-
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
4266
|
-
return true;
|
|
4267
|
-
}
|
|
4268
|
-
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
4269
|
-
return true;
|
|
4270
|
-
}
|
|
4271
|
-
},
|
|
4272
|
-
onclone: (cloneDocument) => {
|
|
4273
|
-
const ganttClass = root.className;
|
|
4274
|
-
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
4275
|
-
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
4276
|
-
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
4277
|
-
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
4278
|
-
// change targetDom width
|
|
4279
|
-
cloneGanttDom.style.width = `${printWidth}px`;
|
|
4280
|
-
cloneGanttDom.style.height = `${printHeight}px`;
|
|
4281
|
-
cloneGanttDom.style.overflow = `unset`;
|
|
4282
|
-
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
4283
|
-
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
4284
|
-
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
4285
|
-
if (cloneLinksOverlay) {
|
|
4286
|
-
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
4287
|
-
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
4288
|
-
}
|
|
4289
|
-
// setInlineStyles for svg
|
|
4290
|
-
this.setInlineStyles(cloneGanttDom);
|
|
4291
|
-
}
|
|
4292
|
-
}).then((canvas) => {
|
|
4293
|
-
const link = document.createElement('a');
|
|
4294
|
-
const dataUrl = canvas.toDataURL('image/png');
|
|
4295
|
-
link.download = `${name}.png`;
|
|
4296
|
-
link.href = dataUrl;
|
|
4297
|
-
link.click();
|
|
4298
|
-
});
|
|
4299
|
-
}
|
|
4300
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4301
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService }); }
|
|
4302
|
-
}
|
|
4303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
4304
|
-
type: Injectable
|
|
4305
|
-
}], ctorParameters: () => [] });
|
|
4306
|
-
|
|
4307
4328
|
class NgxGanttRootComponent {
|
|
4308
4329
|
get view() {
|
|
4309
4330
|
return this.ganttUpper.view;
|
|
@@ -4596,11 +4617,9 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4596
4617
|
this._loading = false;
|
|
4597
4618
|
this.rangeStart = 0;
|
|
4598
4619
|
this.rangeEnd = 0;
|
|
4599
|
-
this.computeAllRefs = false;
|
|
4600
4620
|
}
|
|
4601
4621
|
ngOnInit() {
|
|
4602
4622
|
super.ngOnInit();
|
|
4603
|
-
this.buildFlatItems();
|
|
4604
4623
|
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
4605
4624
|
// the `onStable` will never emit any value.
|
|
4606
4625
|
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
@@ -4616,27 +4635,35 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4616
4635
|
});
|
|
4617
4636
|
});
|
|
4618
4637
|
});
|
|
4619
|
-
|
|
4620
|
-
this.computeTempDataRefs();
|
|
4621
|
-
});
|
|
4638
|
+
// 如果虚拟滚动未启用,初始化时需要手动填充 viewportItems
|
|
4622
4639
|
if (!this.virtualScrollEnabled) {
|
|
4623
4640
|
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
4624
|
-
this.
|
|
4641
|
+
this.computeRefs();
|
|
4625
4642
|
}
|
|
4626
4643
|
}
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
if (
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4644
|
+
computeRefs() {
|
|
4645
|
+
const tempItemData = [];
|
|
4646
|
+
this.viewportItems.forEach((data) => {
|
|
4647
|
+
if (!data.hasOwnProperty('items')) {
|
|
4648
|
+
const item = data;
|
|
4649
|
+
if (item.links) {
|
|
4650
|
+
item.links.forEach((link) => {
|
|
4651
|
+
if (this.flatItemsMap[link.link]) {
|
|
4652
|
+
tempItemData.push(this.flatItemsMap[link.link]);
|
|
4653
|
+
}
|
|
4654
|
+
});
|
|
4655
|
+
}
|
|
4656
|
+
tempItemData.push(data);
|
|
4638
4657
|
}
|
|
4639
|
-
}
|
|
4658
|
+
});
|
|
4659
|
+
this.computeItemsRefs(...uniqBy(tempItemData, 'id'));
|
|
4660
|
+
this.flatItems = [...this.flatItems];
|
|
4661
|
+
this.viewportItems = [...this.viewportItems];
|
|
4662
|
+
}
|
|
4663
|
+
setupItems() {
|
|
4664
|
+
super.setupItems();
|
|
4665
|
+
this.buildFlatItems();
|
|
4666
|
+
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
4640
4667
|
}
|
|
4641
4668
|
ngAfterViewInit() {
|
|
4642
4669
|
if (this.virtualScrollEnabled) {
|
|
@@ -4647,7 +4674,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4647
4674
|
this.rangeEnd = range.end;
|
|
4648
4675
|
this.viewportItems = this.flatItems.slice(range.start, range.end);
|
|
4649
4676
|
this.appendDraggingItemToViewportItems();
|
|
4650
|
-
this.
|
|
4677
|
+
this.computeRefs();
|
|
4651
4678
|
});
|
|
4652
4679
|
}
|
|
4653
4680
|
this.initScrollContainerObserver();
|
|
@@ -4690,25 +4717,6 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4690
4717
|
this.buildFlatItems();
|
|
4691
4718
|
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
4692
4719
|
}
|
|
4693
|
-
computeTempDataRefs() {
|
|
4694
|
-
const tempItemData = [];
|
|
4695
|
-
this.viewportItems.forEach((data) => {
|
|
4696
|
-
if (!data.hasOwnProperty('items')) {
|
|
4697
|
-
const item = data;
|
|
4698
|
-
if (item.links) {
|
|
4699
|
-
item.links.forEach((link) => {
|
|
4700
|
-
if (this.flatItemsMap[link.link]) {
|
|
4701
|
-
tempItemData.push(this.flatItemsMap[link.link]);
|
|
4702
|
-
}
|
|
4703
|
-
});
|
|
4704
|
-
}
|
|
4705
|
-
tempItemData.push(data);
|
|
4706
|
-
}
|
|
4707
|
-
});
|
|
4708
|
-
this.computeItemsRefs(...uniqBy(tempItemData, 'id'));
|
|
4709
|
-
this.flatItems = [...this.flatItems];
|
|
4710
|
-
this.viewportItems = [...this.viewportItems];
|
|
4711
|
-
}
|
|
4712
4720
|
appendDraggingItemToViewportItems() {
|
|
4713
4721
|
if (this.draggingItem) {
|
|
4714
4722
|
let flatItem = this.viewportItems.find((item) => {
|
|
@@ -4789,23 +4797,18 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4789
4797
|
count: this.flatItems.length
|
|
4790
4798
|
});
|
|
4791
4799
|
}
|
|
4792
|
-
changeView(type) {
|
|
4793
|
-
super.changeView(type);
|
|
4794
|
-
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
4795
|
-
this.computeTempDataRefs();
|
|
4796
|
-
}
|
|
4797
4800
|
expandGroups(expanded) {
|
|
4798
4801
|
this.groups.forEach((group) => {
|
|
4799
4802
|
group.setExpand(expanded);
|
|
4800
4803
|
});
|
|
4801
4804
|
this.afterExpand();
|
|
4802
|
-
this.expandChange.
|
|
4805
|
+
this.expandChange.emit(this.groups);
|
|
4803
4806
|
this.cdr.detectChanges();
|
|
4804
4807
|
}
|
|
4805
4808
|
expandGroup(group) {
|
|
4806
4809
|
group.setExpand(!group.expanded);
|
|
4807
4810
|
this.afterExpand();
|
|
4808
|
-
this.expandChange.emit();
|
|
4811
|
+
this.expandChange.emit(group);
|
|
4809
4812
|
this.cdr.detectChanges();
|
|
4810
4813
|
}
|
|
4811
4814
|
itemDragStarted(event) {
|
|
@@ -4847,7 +4850,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4847
4850
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
4848
4851
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
4849
4852
|
}
|
|
4850
|
-
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }, { propertyName: "ganttTableBody", first: true, predicate: ["ganttTableBody"], descendants: true, static: true }], usesInheritance: true,
|
|
4853
|
+
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }, { propertyName: "ganttTableBody", first: true, predicate: ["ganttTableBody"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n ></gantt-calendar-header>\n </div>\n </div>\n @if (loading) {\n <gantt-loader></gantt-loader>\n }\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [ngClass]=\"{\n 'gantt-normal-viewport': !virtualScrollEnabled,\n 'gantt-scroll-container': virtualScrollEnabled,\n 'with-footer': table?.tableFooterTemplate || footerTemplate\n }\"\n [style.top.px]=\"styles.headerHeight\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n (scrolledIndexChange)=\"scrolledIndexChange($event)\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\" [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\" syncScrollX=\"ganttTableXScroll\" syncScrollY=\"ganttMainYScroll\">\n <div class=\"gantt-table\">\n <gantt-table-body\n #ganttTableBody\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"table.tableEmptyTemplate || tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"itemDragStarted($event)\"\n (dragEnded)=\"itemDragEnded($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n syncScrollX=\"ganttMainXScroll\"\n syncScrollY=\"ganttMainYScroll\"\n [ganttRoot]=\"ganttRoot\"\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n [baselineTemplate]=\"baselineTemplate\"\n [quickTimeFocus]=\"quickTimeFocus\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n\n <gantt-scrollbar\n [ganttRoot]=\"ganttRoot\"\n [hasFooter]=\"!!table?.tableFooterTemplate\"\n [tableWidth]=\"tableHeader.tableWidth\"\n [tableScrollWidth]=\"tableScrollWidth()\"\n ></gantt-scrollbar>\n\n @if (table?.tableFooterTemplate || footerTemplate) {\n <div\n class=\"gantt-footer\"\n cdkScrollable\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n @if (table?.tableFooterTemplate) {\n <div class=\"gantt-table-footer\" syncScrollX=\"ganttTableXScroll\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n }\n @if (footerTemplate) {\n <div class=\"gantt-container-footer\" syncScrollX=\"ganttMainXScroll\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n }\n </div>\n }\n</ngx-gantt-root>\n", dependencies: [{ kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["viewportItems", "flatItems", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "dragStarted", "dragEnded", "itemClick"] }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["viewportItems", "flatItems", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate", "baselineTemplate", "ganttRoot", "quickTimeFocus"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: GanttScrollbarComponent, selector: "gantt-scrollbar", inputs: ["hasFooter", "tableWidth", "ganttRoot", "tableScrollWidth"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }, { kind: "directive", type: GanttSyncScrollYDirective, selector: "[syncScrollY]", inputs: ["syncScrollY"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4851
4854
|
}
|
|
4852
4855
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
4853
4856
|
type: Component,
|
|
@@ -5042,5 +5045,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
5042
5045
|
* Generated bundle index. Do not edit.
|
|
5043
5046
|
*/
|
|
5044
5047
|
|
|
5045
|
-
export { GANTT_GLOBAL_CONFIG, GANTT_I18N_LOCALE_TOKEN, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttConfigService, GanttDate, GanttDatePoint, GanttDragBackdropComponent, GanttDragEvent, GanttGroupInternal, GanttI18nLocale, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttScrollbarComponent, GanttSelectedEvent, GanttTableDragDroppedEvent, GanttTableDragEndedEvent, GanttTableDragEnterPredicateContext, GanttTableDragStartedEvent, GanttTableEvent, GanttTableItemClickEvent, GanttUpper, GanttView, GanttViewType, GanttVirtualScrolledIndexChangeEvent, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttGroupPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, deDeLocale, defaultConfig, enUsLocale, getDefaultTimeZone, jaJpLocale, primaryDatePointTop, registerView, ruRuLocale, secondaryDatePointTop, setDefaultTimeZone,
|
|
5048
|
+
export { GANTT_GLOBAL_CONFIG, GANTT_I18N_LOCALE_TOKEN, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttConfigService, GanttDate, GanttDatePoint, GanttDragBackdropComponent, GanttDragEvent, GanttGroupInternal, GanttI18nLocale, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttScrollbarComponent, GanttSelectedEvent, GanttTableDragDroppedEvent, GanttTableDragEndedEvent, GanttTableDragEnterPredicateContext, GanttTableDragStartedEvent, GanttTableEvent, GanttTableItemClickEvent, GanttUpper, GanttView, GanttViewType, GanttVirtualScrolledIndexChangeEvent, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttGroupPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, deDeLocale, defaultConfig, enUsLocale, getDefaultTimeZone, jaJpLocale, primaryDatePointTop, registerView, ruRuLocale, secondaryDatePointTop, setDefaultTimeZone, zhHansLocale, zhHantLocale };
|
|
5046
5049
|
//# sourceMappingURL=worktile-gantt.mjs.map
|