@worktile/gantt 19.0.6 → 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 +4 -1
- package/components/bar/bar.component.d.ts +4 -4
- package/components/calendar/calendar.scss +8 -3
- package/components/scrollbar/scrollbar.component.d.ts +5 -4
- package/components/table/gantt-table.scss +2 -0
- package/fesm2022/worktile-gantt.mjs +1286 -1262
- package/fesm2022/worktile-gantt.mjs.map +1 -1
- package/gantt-upper.d.ts +10 -11
- package/gantt.component.d.ts +8 -5
- package/gantt.component.scss +0 -1
- 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 -2
- package/views/factory.d.ts +5 -5
- package/views/hour.d.ts +0 -1
- package/views/view.d.ts +5 -1
|
@@ -1,28 +1,31 @@
|
|
|
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 {
|
|
19
|
-
constructor(start, text, x, y, additions, style
|
|
19
|
+
constructor(start, text, x, y, additions, style,
|
|
20
|
+
// set fill color
|
|
21
|
+
fill) {
|
|
20
22
|
this.start = start;
|
|
21
23
|
this.text = text;
|
|
22
24
|
this.x = x;
|
|
23
25
|
this.y = y;
|
|
24
26
|
this.additions = additions;
|
|
25
27
|
this.style = style;
|
|
28
|
+
this.fill = fill;
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
|
|
@@ -375,179 +378,15 @@ class GanttBaselineItemInternal {
|
|
|
375
378
|
}
|
|
376
379
|
}
|
|
377
380
|
|
|
378
|
-
const
|
|
379
|
-
const
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
get start() {
|
|
388
|
-
return this.start$.getValue();
|
|
389
|
-
}
|
|
390
|
-
get end() {
|
|
391
|
-
return this.end$.getValue();
|
|
392
|
-
}
|
|
393
|
-
constructor(start, end, options) {
|
|
394
|
-
this.showTimeline = true;
|
|
395
|
-
this.dateFormats = {};
|
|
396
|
-
this.options = Object.assign({}, viewOptions$6, options);
|
|
397
|
-
const startDate = start.isCustom
|
|
398
|
-
? this.viewStartOf(start.date)
|
|
399
|
-
: this.viewStartOf(start.date.value < this.options.start.value ? start.date : this.options.start);
|
|
400
|
-
const endDate = end.isCustom
|
|
401
|
-
? this.viewEndOf(end.date)
|
|
402
|
-
: this.viewEndOf(end.date.value > this.options.end.value ? end.date : this.options.end);
|
|
403
|
-
this.start$ = new BehaviorSubject(startDate);
|
|
404
|
-
this.end$ = new BehaviorSubject(endDate);
|
|
405
|
-
this.initialize();
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* deprecated, please use viewStartOf()
|
|
409
|
-
* @deprecated
|
|
410
|
-
*/
|
|
411
|
-
startOf(date) {
|
|
412
|
-
return this.viewStartOf(date);
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* deprecated, please use viewEndOf()
|
|
416
|
-
* @deprecated
|
|
417
|
-
*/
|
|
418
|
-
endOf(date) {
|
|
419
|
-
return this.viewEndOf(date);
|
|
420
|
-
}
|
|
421
|
-
startOfPrecision(date) {
|
|
422
|
-
switch (this.options.datePrecisionUnit) {
|
|
423
|
-
case 'minute':
|
|
424
|
-
return date.startOfMinute();
|
|
425
|
-
case 'hour':
|
|
426
|
-
return date.startOfHour();
|
|
427
|
-
default:
|
|
428
|
-
return date.startOfDay();
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
endOfPrecision(date) {
|
|
432
|
-
switch (this.options.datePrecisionUnit) {
|
|
433
|
-
case 'minute':
|
|
434
|
-
return date.endOfMinute();
|
|
435
|
-
case 'hour':
|
|
436
|
-
return date.endOfHour();
|
|
437
|
-
default:
|
|
438
|
-
return date.endOfDay();
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
differenceByPrecisionUnit(dateLeft, dateRight) {
|
|
442
|
-
switch (this.options.datePrecisionUnit) {
|
|
443
|
-
case 'minute':
|
|
444
|
-
return differenceInMinutes(dateLeft.value, dateRight.value);
|
|
445
|
-
case 'hour':
|
|
446
|
-
return differenceInHours(dateLeft.value, dateRight.value);
|
|
447
|
-
default:
|
|
448
|
-
return differenceInCalendarDays(dateLeft.value, dateRight.value);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
getDateIntervalWidth(start, end) {
|
|
452
|
-
let result = 0;
|
|
453
|
-
const days = differenceInDays(end.value, start.value);
|
|
454
|
-
for (let i = 0; i < Math.abs(days); i++) {
|
|
455
|
-
result += this.getDayOccupancyWidth(start.addDays(i));
|
|
456
|
-
}
|
|
457
|
-
result = days >= 0 ? result : -result;
|
|
458
|
-
return Number(result.toFixed(3));
|
|
459
|
-
}
|
|
460
|
-
initialize() {
|
|
461
|
-
this.primaryDatePoints = this.getPrimaryDatePoints();
|
|
462
|
-
this.secondaryDatePoints = this.getSecondaryDatePoints();
|
|
463
|
-
this.width = this.getWidth();
|
|
464
|
-
this.cellWidth = this.getCellWidth();
|
|
465
|
-
this.primaryWidth = this.getPrimaryWidth();
|
|
466
|
-
}
|
|
467
|
-
addStartDate() {
|
|
468
|
-
const start = this.viewStartOf(this.start.add(this.options.addAmount * -1, this.options.addUnit));
|
|
469
|
-
if (start.value >= this.options.min.value) {
|
|
470
|
-
const origin = this.start;
|
|
471
|
-
this.start$.next(start);
|
|
472
|
-
this.initialize();
|
|
473
|
-
return { start: this.start, end: origin };
|
|
474
|
-
}
|
|
475
|
-
return null;
|
|
476
|
-
}
|
|
477
|
-
addEndDate() {
|
|
478
|
-
const end = this.viewEndOf(this.end.add(this.options.addAmount, this.options.addUnit));
|
|
479
|
-
if (end.value <= this.options.max.value) {
|
|
480
|
-
const origin = this.end;
|
|
481
|
-
this.end$.next(end);
|
|
482
|
-
this.initialize();
|
|
483
|
-
return { start: origin, end: this.end };
|
|
484
|
-
}
|
|
485
|
-
return null;
|
|
486
|
-
}
|
|
487
|
-
updateDate(start, end) {
|
|
488
|
-
start = this.viewStartOf(start);
|
|
489
|
-
end = this.viewEndOf(end);
|
|
490
|
-
if (start.value < this.start.value) {
|
|
491
|
-
this.start$.next(start);
|
|
492
|
-
}
|
|
493
|
-
if (end.value > this.end.value) {
|
|
494
|
-
this.end$.next(end);
|
|
495
|
-
}
|
|
496
|
-
this.initialize();
|
|
497
|
-
}
|
|
498
|
-
// 获取View的宽度
|
|
499
|
-
getWidth() {
|
|
500
|
-
return this.getCellWidth() * this.secondaryDatePoints.length;
|
|
501
|
-
}
|
|
502
|
-
// 获取单个网格的宽度
|
|
503
|
-
getCellWidth() {
|
|
504
|
-
return this.options.cellWidth;
|
|
505
|
-
}
|
|
506
|
-
// 获取当前时间的X坐标
|
|
507
|
-
getTodayXPoint() {
|
|
508
|
-
const toady = new GanttDate().startOfDay();
|
|
509
|
-
if (toady.value > this.start.value && toady.value < this.end.value) {
|
|
510
|
-
const x = this.getXPointByDate(toady) + this.getDayOccupancyWidth(toady) / 2;
|
|
511
|
-
return x;
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
return null;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
// 获取指定时间的X坐标
|
|
518
|
-
getXPointByDate(date) {
|
|
519
|
-
return this.getDateIntervalWidth(this.start, date);
|
|
520
|
-
}
|
|
521
|
-
// 根据X坐标获取对应时间
|
|
522
|
-
getDateByXPoint(x) {
|
|
523
|
-
const indexOfSecondaryDate = Math.max(Math.floor(x / this.getCellWidth()), 0);
|
|
524
|
-
const matchDate = this.secondaryDatePoints[Math.min(this.secondaryDatePoints.length - 1, indexOfSecondaryDate)];
|
|
525
|
-
const dayWidth = this.getDayOccupancyWidth(matchDate?.start);
|
|
526
|
-
if (dayWidth === this.getCellWidth()) {
|
|
527
|
-
return matchDate?.start;
|
|
528
|
-
}
|
|
529
|
-
else {
|
|
530
|
-
const day = Math.floor((x % this.getCellWidth()) / dayWidth);
|
|
531
|
-
return matchDate?.start.addDays(day);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
// 获取指定时间范围的宽度
|
|
535
|
-
getDateRangeWidth(start, end) {
|
|
536
|
-
// addSeconds(1) 是因为计算相差天会以一个整天来计算 end时间一般是59分59秒不是一个整天,所以需要加1
|
|
537
|
-
return this.getDateIntervalWidth(this.startOfPrecision(start), this.endOfPrecision(end).addSeconds(1));
|
|
538
|
-
}
|
|
539
|
-
// 根据日期精度获取最小时间范围的宽度
|
|
540
|
-
getMinRangeWidthByPrecisionUnit(date) {
|
|
541
|
-
switch (this.options.datePrecisionUnit) {
|
|
542
|
-
case 'minute':
|
|
543
|
-
return this.getDayOccupancyWidth(date) / 24 / 60;
|
|
544
|
-
case 'hour':
|
|
545
|
-
return this.getDayOccupancyWidth(date) / 24;
|
|
546
|
-
default:
|
|
547
|
-
return this.getDayOccupancyWidth(date);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
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;
|
|
551
390
|
|
|
552
391
|
var GanttI18nLocale;
|
|
553
392
|
(function (GanttI18nLocale) {
|
|
@@ -560,7 +399,7 @@ var GanttI18nLocale;
|
|
|
560
399
|
})(GanttI18nLocale || (GanttI18nLocale = {}));
|
|
561
400
|
const GANTT_I18N_LOCALE_TOKEN = new InjectionToken('gantt-i18n-locale');
|
|
562
401
|
|
|
563
|
-
var
|
|
402
|
+
var zhHansLocale = {
|
|
564
403
|
id: GanttI18nLocale.zhHans,
|
|
565
404
|
views: {
|
|
566
405
|
[GanttViewType.hour]: {
|
|
@@ -607,7 +446,7 @@ var zhHans = {
|
|
|
607
446
|
}
|
|
608
447
|
};
|
|
609
448
|
|
|
610
|
-
var
|
|
449
|
+
var zhHantLocale = {
|
|
611
450
|
id: GanttI18nLocale.zhHant,
|
|
612
451
|
views: {
|
|
613
452
|
[GanttViewType.hour]: {
|
|
@@ -654,50 +493,188 @@ var zhHant = {
|
|
|
654
493
|
}
|
|
655
494
|
};
|
|
656
495
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
701
678
|
}
|
|
702
679
|
};
|
|
703
680
|
|
|
@@ -845,122 +822,202 @@ var ruRuLocale = {
|
|
|
845
822
|
};
|
|
846
823
|
|
|
847
824
|
const i18nLocaleProvides = [
|
|
848
|
-
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue:
|
|
849
|
-
{ 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 },
|
|
850
827
|
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: enUsLocale, multi: true },
|
|
851
828
|
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: jaJpLocale, multi: true },
|
|
852
829
|
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: deDeLocale, multi: true },
|
|
853
830
|
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: ruRuLocale, multi: true }
|
|
854
831
|
];
|
|
855
832
|
|
|
856
|
-
const
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
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'
|
|
863
840
|
};
|
|
864
|
-
class
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
this.viewType = GanttViewType.month;
|
|
841
|
+
class GanttView {
|
|
842
|
+
get start() {
|
|
843
|
+
return this.start$.getValue();
|
|
868
844
|
}
|
|
869
|
-
|
|
870
|
-
return
|
|
845
|
+
get end() {
|
|
846
|
+
return this.end$.getValue();
|
|
871
847
|
}
|
|
872
|
-
|
|
873
|
-
|
|
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();
|
|
874
861
|
}
|
|
875
|
-
|
|
876
|
-
|
|
862
|
+
/**
|
|
863
|
+
* deprecated, please use viewStartOf()
|
|
864
|
+
* @deprecated
|
|
865
|
+
*/
|
|
866
|
+
startOf(date) {
|
|
867
|
+
return this.viewStartOf(date);
|
|
877
868
|
}
|
|
878
|
-
|
|
879
|
-
|
|
869
|
+
/**
|
|
870
|
+
* deprecated, please use viewEndOf()
|
|
871
|
+
* @deprecated
|
|
872
|
+
*/
|
|
873
|
+
endOf(date) {
|
|
874
|
+
return this.viewEndOf(date);
|
|
880
875
|
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
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();
|
|
888
887
|
}
|
|
889
|
-
return points;
|
|
890
888
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
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();
|
|
898
897
|
}
|
|
899
|
-
return points;
|
|
900
898
|
}
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
addUnit: 'year',
|
|
911
|
-
dateDisplayFormats: zhHant.views.quarter.dateFormats
|
|
912
|
-
};
|
|
913
|
-
class GanttViewQuarter extends GanttView {
|
|
914
|
-
constructor(start, end, options) {
|
|
915
|
-
super(start, end, Object.assign({}, viewOptions$4, options));
|
|
916
|
-
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
|
+
}
|
|
917
908
|
}
|
|
918
|
-
|
|
919
|
-
|
|
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));
|
|
920
917
|
}
|
|
921
|
-
|
|
922
|
-
|
|
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();
|
|
923
924
|
}
|
|
924
|
-
|
|
925
|
-
|
|
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;
|
|
926
934
|
}
|
|
927
|
-
|
|
928
|
-
|
|
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;
|
|
929
944
|
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.year || this.options.dateDisplayFormats.primary)}`, (this.getCellWidth() * 4) / 2 + i * (this.getCellWidth() * 4), primaryDatePointTop);
|
|
936
|
-
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);
|
|
937
950
|
}
|
|
938
|
-
|
|
951
|
+
if (end.value > this.end.value) {
|
|
952
|
+
this.end$.next(end);
|
|
953
|
+
}
|
|
954
|
+
this.initialize();
|
|
939
955
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
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);
|
|
947
1006
|
}
|
|
948
|
-
return points;
|
|
949
1007
|
}
|
|
950
1008
|
}
|
|
951
1009
|
|
|
952
|
-
const viewOptions$
|
|
1010
|
+
const viewOptions$5 = {
|
|
953
1011
|
cellWidth: 35,
|
|
954
1012
|
start: new GanttDate().startOfYear().startOfWeek(),
|
|
955
1013
|
end: new GanttDate().endOfYear().endOfWeek(),
|
|
956
1014
|
addAmount: 1,
|
|
957
1015
|
addUnit: 'month',
|
|
958
|
-
dateDisplayFormats:
|
|
1016
|
+
dateDisplayFormats: zhHantLocale.views.day.dateFormats
|
|
959
1017
|
};
|
|
960
1018
|
class GanttViewDay extends GanttView {
|
|
961
1019
|
constructor(start, end, options) {
|
|
962
|
-
super(start, end, Object.assign({}, viewOptions$
|
|
963
|
-
this.showWeekBackdrop = true;
|
|
1020
|
+
super(start, end, Object.assign({}, viewOptions$5, options));
|
|
964
1021
|
this.showTimeline = false;
|
|
965
1022
|
this.viewType = GanttViewType.day;
|
|
966
1023
|
}
|
|
@@ -973,7 +1030,10 @@ class GanttViewDay extends GanttView {
|
|
|
973
1030
|
getPrimaryWidth() {
|
|
974
1031
|
return this.getCellWidth() * 7;
|
|
975
1032
|
}
|
|
976
|
-
getDayOccupancyWidth() {
|
|
1033
|
+
getDayOccupancyWidth(date) {
|
|
1034
|
+
if (this.hideHoliday(date)) {
|
|
1035
|
+
return 0;
|
|
1036
|
+
}
|
|
977
1037
|
return this.cellWidth;
|
|
978
1038
|
}
|
|
979
1039
|
getPrimaryDatePoints() {
|
|
@@ -981,14 +1041,19 @@ class GanttViewDay extends GanttView {
|
|
|
981
1041
|
const points = [];
|
|
982
1042
|
for (let i = 0; i < weeks.length; i++) {
|
|
983
1043
|
const weekStart = new GanttDate(weeks[i]);
|
|
1044
|
+
const weekEnd = weekStart.addWeeks(1);
|
|
984
1045
|
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
985
|
-
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;
|
|
986
1051
|
points.push(point);
|
|
987
1052
|
}
|
|
988
1053
|
return points;
|
|
989
1054
|
}
|
|
990
1055
|
getSecondaryDatePoints() {
|
|
991
|
-
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)));
|
|
992
1057
|
const points = [];
|
|
993
1058
|
for (let i = 0; i < days.length; i++) {
|
|
994
1059
|
const start = new GanttDate(days[i]);
|
|
@@ -1002,116 +1067,19 @@ class GanttViewDay extends GanttView {
|
|
|
1002
1067
|
}
|
|
1003
1068
|
}
|
|
1004
1069
|
|
|
1005
|
-
const viewOptions$
|
|
1006
|
-
cellWidth: 280,
|
|
1007
|
-
start: new GanttDate().startOfYear().startOfWeek(),
|
|
1008
|
-
end: new GanttDate().endOfYear().endOfWeek(),
|
|
1009
|
-
addAmount: 1,
|
|
1010
|
-
addUnit: 'month',
|
|
1011
|
-
dateDisplayFormats: zhHant.views.week.dateFormats
|
|
1012
|
-
};
|
|
1013
|
-
class GanttViewWeek extends GanttView {
|
|
1014
|
-
constructor(start, end, options) {
|
|
1015
|
-
super(start, end, Object.assign({}, viewOptions$2, options));
|
|
1016
|
-
this.viewType = GanttViewType.week;
|
|
1017
|
-
}
|
|
1018
|
-
viewStartOf(date) {
|
|
1019
|
-
return date.startOfWeek();
|
|
1020
|
-
}
|
|
1021
|
-
viewEndOf(date) {
|
|
1022
|
-
return date.endOfWeek();
|
|
1023
|
-
}
|
|
1024
|
-
getPrimaryWidth() {
|
|
1025
|
-
return this.getCellWidth();
|
|
1026
|
-
}
|
|
1027
|
-
getDayOccupancyWidth() {
|
|
1028
|
-
return this.cellWidth / 7;
|
|
1029
|
-
}
|
|
1030
|
-
getPrimaryDatePoints() {
|
|
1031
|
-
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
|
|
1032
|
-
const points = [];
|
|
1033
|
-
for (let i = 0; i < weeks.length; i++) {
|
|
1034
|
-
const weekStart = new GanttDate(weeks[i]);
|
|
1035
|
-
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
1036
|
-
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.year || this.options.dateDisplayFormats.primary), this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
1037
|
-
points.push(point);
|
|
1038
|
-
}
|
|
1039
|
-
return points;
|
|
1040
|
-
}
|
|
1041
|
-
getSecondaryDatePoints() {
|
|
1042
|
-
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
|
|
1043
|
-
const points = [];
|
|
1044
|
-
for (let i = 0; i < weeks.length; i++) {
|
|
1045
|
-
const start = new GanttDate(weeks[i]);
|
|
1046
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.week || this.options.dateDisplayFormats.secondary)}`, i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
1047
|
-
points.push(point);
|
|
1048
|
-
}
|
|
1049
|
-
return points;
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
const viewOptions$1 = {
|
|
1054
|
-
cellWidth: 480,
|
|
1055
|
-
start: new GanttDate().addYears(-2).startOfYear(),
|
|
1056
|
-
end: new GanttDate().addYears(2).endOfYear(),
|
|
1057
|
-
addAmount: 1,
|
|
1058
|
-
addUnit: 'year',
|
|
1059
|
-
dateDisplayFormats: zhHant.views.year.dateFormats
|
|
1060
|
-
};
|
|
1061
|
-
class GanttViewYear extends GanttView {
|
|
1062
|
-
constructor(start, end, options) {
|
|
1063
|
-
super(start, end, Object.assign({}, viewOptions$1, options));
|
|
1064
|
-
this.viewType = GanttViewType.year;
|
|
1065
|
-
}
|
|
1066
|
-
viewStartOf(date) {
|
|
1067
|
-
return date.startOfYear();
|
|
1068
|
-
}
|
|
1069
|
-
viewEndOf(date) {
|
|
1070
|
-
return date.endOfYear();
|
|
1071
|
-
}
|
|
1072
|
-
getPrimaryWidth() {
|
|
1073
|
-
return this.getCellWidth();
|
|
1074
|
-
}
|
|
1075
|
-
getDayOccupancyWidth(date) {
|
|
1076
|
-
return this.cellWidth / date.getDaysInYear();
|
|
1077
|
-
}
|
|
1078
|
-
getPrimaryDatePoints() {
|
|
1079
|
-
const years = eachYearOfInterval({ start: this.start.value, end: this.end.value });
|
|
1080
|
-
const points = [];
|
|
1081
|
-
for (let i = 0; i < years.length; i++) {
|
|
1082
|
-
const start = new GanttDate(years[i]);
|
|
1083
|
-
const point = new GanttDatePoint(start, ``, this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
1084
|
-
points.push(point);
|
|
1085
|
-
}
|
|
1086
|
-
return points;
|
|
1087
|
-
}
|
|
1088
|
-
getSecondaryDatePoints() {
|
|
1089
|
-
const years = differenceInCalendarYears(this.end.value, this.start.value);
|
|
1090
|
-
const points = [];
|
|
1091
|
-
const pointTop = '60%';
|
|
1092
|
-
for (let i = 0; i <= years; i++) {
|
|
1093
|
-
const start = this.start.addYears(i);
|
|
1094
|
-
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);
|
|
1095
|
-
points.push(point);
|
|
1096
|
-
}
|
|
1097
|
-
return points;
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
const viewOptions = {
|
|
1070
|
+
const viewOptions$4 = {
|
|
1102
1071
|
cellWidth: 80,
|
|
1103
1072
|
start: new GanttDate().startOfMonth(),
|
|
1104
1073
|
end: new GanttDate().endOfMonth(),
|
|
1105
1074
|
datePrecisionUnit: 'minute',
|
|
1106
1075
|
addAmount: 1,
|
|
1107
1076
|
addUnit: 'week',
|
|
1108
|
-
dateDisplayFormats:
|
|
1077
|
+
dateDisplayFormats: zhHantLocale.views.hour.dateFormats,
|
|
1109
1078
|
dragPreviewDateFormat: 'HH:mm'
|
|
1110
1079
|
};
|
|
1111
1080
|
class GanttViewHour extends GanttView {
|
|
1112
1081
|
constructor(start, end, options) {
|
|
1113
|
-
super(start, end, Object.assign({}, viewOptions, options));
|
|
1114
|
-
this.showWeekBackdrop = true;
|
|
1082
|
+
super(start, end, Object.assign({}, viewOptions$4, options));
|
|
1115
1083
|
this.showTimeline = true;
|
|
1116
1084
|
this.viewType = GanttViewType.hour;
|
|
1117
1085
|
}
|
|
@@ -1182,158 +1150,212 @@ class GanttViewHour extends GanttView {
|
|
|
1182
1150
|
}
|
|
1183
1151
|
}
|
|
1184
1152
|
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
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
|
|
1192
1160
|
};
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
|
|
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
|
+
}
|
|
1198
1198
|
}
|
|
1199
1199
|
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
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;
|
|
1212
1214
|
}
|
|
1213
|
-
|
|
1214
|
-
return
|
|
1215
|
+
viewStartOf(date) {
|
|
1216
|
+
return date.startOfYear();
|
|
1215
1217
|
}
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
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);
|
|
1225
1234
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
// const result = [];
|
|
1236
|
-
// (items || []).forEach((item) => {
|
|
1237
|
-
// result.push(item);
|
|
1238
|
-
// if (item.expanded && item.children) {
|
|
1239
|
-
// result.push(...recursiveItems(item.children));
|
|
1240
|
-
// }
|
|
1241
|
-
// });
|
|
1242
|
-
// return result;
|
|
1243
|
-
// }
|
|
1244
|
-
function recursiveItems(items) {
|
|
1245
|
-
const result = [];
|
|
1246
|
-
(items || []).forEach((item) => {
|
|
1247
|
-
result.push(item);
|
|
1248
|
-
if (item.expanded && item.children) {
|
|
1249
|
-
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);
|
|
1250
1244
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1245
|
+
return points;
|
|
1246
|
+
}
|
|
1253
1247
|
}
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
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);
|
|
1260
1282
|
}
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
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
|
+
}
|
|
1271
1295
|
}
|
|
1272
1296
|
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
styleOptions: {
|
|
1281
|
-
headerHeight: 44,
|
|
1282
|
-
lineHeight: 44,
|
|
1283
|
-
barHeight: 22
|
|
1284
|
-
},
|
|
1285
|
-
dateOptions: {
|
|
1286
|
-
weekStartsOn: 1
|
|
1287
|
-
}
|
|
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
|
|
1288
1304
|
};
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
this.config = {
|
|
1294
|
-
locale: localeId,
|
|
1295
|
-
dateFormat: Object.assign({}, defaultConfig.dateFormat, globalConfig.dateFormat),
|
|
1296
|
-
styleOptions: Object.assign({}, defaultConfig.styleOptions, globalConfig.styleOptions),
|
|
1297
|
-
linkOptions: Object.assign({}, defaultConfig.linkOptions, globalConfig.linkOptions),
|
|
1298
|
-
dateOptions: Object.assign({}, defaultConfig.dateOptions, globalConfig.dateOptions)
|
|
1299
|
-
};
|
|
1300
|
-
this.i18nLocales = inject(GANTT_I18N_LOCALE_TOKEN).reduce((result, localeConfig) => {
|
|
1301
|
-
result[localeConfig.id] = localeConfig; // 这里使用 `id` 作为 key
|
|
1302
|
-
return result;
|
|
1303
|
-
}, {
|
|
1304
|
-
['zh-cn']: zhHans,
|
|
1305
|
-
['zh-tw']: zhHant
|
|
1306
|
-
});
|
|
1307
|
-
if (this.config.dateOptions?.timeZone) {
|
|
1308
|
-
setDefaultTimeZone(this.config.dateOptions.timeZone);
|
|
1309
|
-
}
|
|
1310
|
-
setDefaultOptions({
|
|
1311
|
-
locale: this.getDateLocale(),
|
|
1312
|
-
weekStartsOn: this.config?.dateOptions?.weekStartsOn
|
|
1313
|
-
});
|
|
1305
|
+
class GanttViewYear extends GanttView {
|
|
1306
|
+
constructor(start, end, options) {
|
|
1307
|
+
super(start, end, Object.assign({}, viewOptions, options));
|
|
1308
|
+
this.viewType = GanttViewType.year;
|
|
1314
1309
|
}
|
|
1315
|
-
|
|
1316
|
-
|
|
1310
|
+
viewStartOf(date) {
|
|
1311
|
+
return date.startOfYear();
|
|
1317
1312
|
}
|
|
1318
|
-
|
|
1319
|
-
return
|
|
1313
|
+
viewEndOf(date) {
|
|
1314
|
+
return date.endOfYear();
|
|
1320
1315
|
}
|
|
1321
|
-
|
|
1322
|
-
return this.
|
|
1316
|
+
getPrimaryWidth() {
|
|
1317
|
+
return this.getCellWidth();
|
|
1323
1318
|
}
|
|
1324
|
-
|
|
1325
|
-
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;
|
|
1326
1342
|
}
|
|
1327
|
-
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 }); }
|
|
1328
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, providedIn: 'root' }); }
|
|
1329
1343
|
}
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
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
|
+
}
|
|
1337
1359
|
|
|
1338
1360
|
class GanttUpper {
|
|
1339
1361
|
set linkOptions(options) {
|
|
@@ -1395,7 +1417,6 @@ class GanttUpper {
|
|
|
1395
1417
|
this.viewChange = new EventEmitter();
|
|
1396
1418
|
this.expandChange = new EventEmitter();
|
|
1397
1419
|
this.configService = inject(GanttConfigService);
|
|
1398
|
-
this.computeAllRefs = true;
|
|
1399
1420
|
this.linkDragEnded = new EventEmitter();
|
|
1400
1421
|
this.items = [];
|
|
1401
1422
|
this.groups = [];
|
|
@@ -1502,14 +1523,12 @@ class GanttUpper {
|
|
|
1502
1523
|
};
|
|
1503
1524
|
}
|
|
1504
1525
|
computeRefs() {
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
this.computeItemsRefs(...items);
|
|
1512
|
-
}
|
|
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);
|
|
1513
1532
|
}
|
|
1514
1533
|
initSelectionModel() {
|
|
1515
1534
|
return new SelectionModel(this.multiple, []);
|
|
@@ -1523,7 +1542,7 @@ class GanttUpper {
|
|
|
1523
1542
|
this.groups.forEach((group) => {
|
|
1524
1543
|
group.setExpand(expanded);
|
|
1525
1544
|
});
|
|
1526
|
-
this.expandChange.
|
|
1545
|
+
this.expandChange.emit(this.groups);
|
|
1527
1546
|
this.cdr.detectChanges();
|
|
1528
1547
|
}
|
|
1529
1548
|
ngOnInit() {
|
|
@@ -1729,7 +1748,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
1729
1748
|
type: HostBinding,
|
|
1730
1749
|
args: ['class.gantt']
|
|
1731
1750
|
}] } });
|
|
1732
|
-
const GANTT_UPPER_TOKEN = new InjectionToken('GANTT_UPPER_TOKEN');
|
|
1751
|
+
const GANTT_UPPER_TOKEN = new InjectionToken('GANTT_UPPER_TOKEN');
|
|
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
|
+
}] } });
|
|
1733
1811
|
|
|
1734
1812
|
function getDependencyType(path, dependencyTypes) {
|
|
1735
1813
|
if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
|
|
@@ -2322,7 +2400,8 @@ class GanttBarDrag {
|
|
|
2322
2400
|
const currentX = this.item().refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
2323
2401
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
2324
2402
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
2325
|
-
const
|
|
2403
|
+
const currentEndDate = this.ganttUpper.view.getDateByXPoint(currentX + this.item().refs.width);
|
|
2404
|
+
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(currentEndDate, currentDate);
|
|
2326
2405
|
let start = currentDate;
|
|
2327
2406
|
let end = currentDate.add(diffs, this.ganttUpper.view?.options?.datePrecisionUnit);
|
|
2328
2407
|
// 日视图特殊逻辑处理
|
|
@@ -2552,75 +2631,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
2552
2631
|
type: Injectable
|
|
2553
2632
|
}], ctorParameters: () => [{ type: i1.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }] });
|
|
2554
2633
|
|
|
2555
|
-
const sideWidth = 400;
|
|
2556
|
-
const sideMiddleWidth = 500;
|
|
2557
|
-
const sideMaxWidth = 600;
|
|
2558
|
-
const sideMinWidth = 400;
|
|
2559
|
-
const barBackground = '#6698ff';
|
|
2560
|
-
const rangeHeight = 17;
|
|
2561
|
-
const todayHeight = 24;
|
|
2562
|
-
const todayWidth = 35;
|
|
2563
|
-
const todayBorderRadius = 4;
|
|
2564
|
-
|
|
2565
|
-
class GanttItemUpper {
|
|
2566
|
-
constructor(elementRef, ganttUpper) {
|
|
2567
|
-
this.elementRef = elementRef;
|
|
2568
|
-
this.ganttUpper = ganttUpper;
|
|
2569
|
-
this.firstChange = true;
|
|
2570
|
-
this.unsubscribe$ = new Subject();
|
|
2571
|
-
this.refsUnsubscribe$ = new Subject();
|
|
2572
|
-
}
|
|
2573
|
-
ngOnInit() {
|
|
2574
|
-
this.firstChange = false;
|
|
2575
|
-
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
2576
|
-
this.setPositions();
|
|
2577
|
-
});
|
|
2578
|
-
}
|
|
2579
|
-
ngOnChanges(changes) {
|
|
2580
|
-
if (!this.firstChange) {
|
|
2581
|
-
this.itemChange(changes.item.currentValue);
|
|
2582
|
-
}
|
|
2583
|
-
}
|
|
2584
|
-
itemChange(item) {
|
|
2585
|
-
this.refsUnsubscribe$.next();
|
|
2586
|
-
this.refsUnsubscribe$.complete();
|
|
2587
|
-
this.item = item;
|
|
2588
|
-
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
2589
|
-
this.setPositions();
|
|
2590
|
-
});
|
|
2591
|
-
}
|
|
2592
|
-
setPositions() {
|
|
2593
|
-
const itemElement = this.elementRef.nativeElement;
|
|
2594
|
-
itemElement.style.left = this.item.refs?.x + 'px';
|
|
2595
|
-
itemElement.style.top = this.item.refs?.y + 'px';
|
|
2596
|
-
itemElement.style.width = this.item.refs?.width + 'px';
|
|
2597
|
-
if (this.item.type === GanttItemType.bar) {
|
|
2598
|
-
itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
|
|
2599
|
-
}
|
|
2600
|
-
else if (this.item.type === GanttItemType.range) {
|
|
2601
|
-
itemElement.style.height = rangeHeight + 'px';
|
|
2602
|
-
}
|
|
2603
|
-
}
|
|
2604
|
-
ngOnDestroy() {
|
|
2605
|
-
this.unsubscribe$.next();
|
|
2606
|
-
this.unsubscribe$.complete();
|
|
2607
|
-
this.refsUnsubscribe$.next();
|
|
2608
|
-
this.refsUnsubscribe$.complete();
|
|
2609
|
-
}
|
|
2610
|
-
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 }); }
|
|
2611
|
-
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 }); }
|
|
2612
|
-
}
|
|
2613
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, decorators: [{
|
|
2614
|
-
type: Directive
|
|
2615
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
2616
|
-
type: Inject,
|
|
2617
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2618
|
-
}] }], propDecorators: { template: [{
|
|
2619
|
-
type: Input
|
|
2620
|
-
}], item: [{
|
|
2621
|
-
type: Input
|
|
2622
|
-
}] } });
|
|
2623
|
-
|
|
2624
2634
|
function linearGradient(sideOrCorner, color, stop) {
|
|
2625
2635
|
return `linear-gradient(${sideOrCorner},${color} 0%,${stop} 40%)`;
|
|
2626
2636
|
}
|
|
@@ -2681,10 +2691,10 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2681
2691
|
this.barClick.emit({ event, item: this.item.origin });
|
|
2682
2692
|
}
|
|
2683
2693
|
setContentBackground() {
|
|
2694
|
+
let style = { ...(this.item.barStyle || {}) };
|
|
2695
|
+
const contentElement = this.contentElementRef.nativeElement;
|
|
2684
2696
|
if (this.item.refs?.width) {
|
|
2685
|
-
const contentElement = this.contentElementRef.nativeElement;
|
|
2686
2697
|
const color = this.item.color || barBackground;
|
|
2687
|
-
const style = this.item.barStyle || {};
|
|
2688
2698
|
const barElement = this.elementRef.nativeElement;
|
|
2689
2699
|
if (this.item.origin.start && this.item.origin.end) {
|
|
2690
2700
|
style.background = color;
|
|
@@ -2705,13 +2715,13 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2705
2715
|
if (this.item.progress >= 0) {
|
|
2706
2716
|
const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
2707
2717
|
style.background = hexToRgb(color, 0.3);
|
|
2708
|
-
style.borderRadius = '';
|
|
2709
2718
|
contentProgressElement.style.background = color;
|
|
2710
2719
|
}
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
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];
|
|
2715
2725
|
}
|
|
2716
2726
|
}
|
|
2717
2727
|
}
|
|
@@ -2807,234 +2817,449 @@ class GanttCalendarGridComponent {
|
|
|
2807
2817
|
}
|
|
2808
2818
|
}
|
|
2809
2819
|
ngOnInit() {
|
|
2810
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2811
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2812
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2813
|
-
.subscribe(() => {
|
|
2814
|
-
this.setTodayPoint();
|
|
2815
|
-
});
|
|
2816
|
-
});
|
|
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');
|
|
2817
3028
|
}
|
|
2818
3029
|
ngOnDestroy() {
|
|
2819
|
-
this.
|
|
2820
|
-
this.unsubscribe$.complete();
|
|
3030
|
+
this.syncScrollService.unregisterScrollEvent(this.syncScrollX(), this.elementRef.nativeElement);
|
|
2821
3031
|
}
|
|
2822
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
2823
|
-
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 }); }
|
|
2824
3034
|
}
|
|
2825
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
2826
|
-
type:
|
|
2827
|
-
args: [{
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
get view() {
|
|
2838
|
-
return this.ganttUpper.view;
|
|
2839
|
-
}
|
|
2840
|
-
get height() {
|
|
2841
|
-
return this.ganttUpper.styles.headerHeight + 'px';
|
|
2842
|
-
}
|
|
2843
|
-
constructor(ganttUpper, ngZone, elementRef) {
|
|
2844
|
-
this.ganttUpper = ganttUpper;
|
|
2845
|
-
this.ngZone = ngZone;
|
|
2846
|
-
this.elementRef = elementRef;
|
|
2847
|
-
this.unsubscribe$ = new Subject();
|
|
2848
|
-
this.viewTypes = GanttViewType;
|
|
2849
|
-
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));
|
|
2850
3047
|
}
|
|
2851
3048
|
ngOnInit() {
|
|
2852
|
-
|
|
2853
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2854
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2855
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2856
|
-
.subscribe(() => {
|
|
2857
|
-
if (this.ganttUpper.viewType === GanttViewType.day)
|
|
2858
|
-
this.setTodayPoint();
|
|
2859
|
-
});
|
|
2860
|
-
});
|
|
3049
|
+
this.syncScrollService.registerScrollEvent(this.syncScrollY(), this.elementRef.nativeElement, 'y');
|
|
2861
3050
|
}
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
const today = new GanttDate().getDate();
|
|
2865
|
-
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2866
|
-
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
2867
|
-
if (isNumber(x)) {
|
|
2868
|
-
if (rect) {
|
|
2869
|
-
rect.style.left = `${x - todayWidth / 2}px`;
|
|
2870
|
-
rect.style.top = `${this.ganttUpper.styles.headerHeight - todayHeight}px`;
|
|
2871
|
-
rect.innerHTML = today.toString();
|
|
2872
|
-
}
|
|
2873
|
-
}
|
|
2874
|
-
else {
|
|
2875
|
-
todayEle.style.display = 'none';
|
|
2876
|
-
}
|
|
3051
|
+
ngOnDestroy() {
|
|
3052
|
+
this.syncScrollService.unregisterScrollEvent(this.syncScrollY(), this.elementRef.nativeElement);
|
|
2877
3053
|
}
|
|
2878
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
2879
|
-
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 }); }
|
|
2880
3056
|
}
|
|
2881
|
-
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: [{
|
|
2882
3077
|
type: Component,
|
|
2883
|
-
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" }]
|
|
2884
3079
|
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2885
3080
|
type: Inject,
|
|
2886
3081
|
args: [GANTT_UPPER_TOKEN]
|
|
2887
|
-
}] }
|
|
2888
|
-
type: HostBinding,
|
|
2889
|
-
args: ['class']
|
|
2890
|
-
}], height: [{
|
|
2891
|
-
type: HostBinding,
|
|
2892
|
-
args: ['style.height']
|
|
2893
|
-
}] } });
|
|
3082
|
+
}] }] });
|
|
2894
3083
|
|
|
2895
|
-
class
|
|
3084
|
+
class NgxGanttToolbarComponent {
|
|
3085
|
+
get top() {
|
|
3086
|
+
return this.ganttUpper.styles.headerHeight + 16 + 'px';
|
|
3087
|
+
}
|
|
2896
3088
|
constructor(ganttUpper) {
|
|
2897
3089
|
this.ganttUpper = ganttUpper;
|
|
3090
|
+
this.ganttItemClass = true;
|
|
3091
|
+
this.views = inject(GanttConfigService).getViewsLocale();
|
|
2898
3092
|
}
|
|
2899
|
-
|
|
2900
|
-
|
|
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"] }] }); }
|
|
2901
3098
|
}
|
|
2902
|
-
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: [{
|
|
2903
3100
|
type: Component,
|
|
2904
|
-
args: [{ selector: 'gantt-
|
|
2905
|
-
class: 'gantt-drag-backdrop'
|
|
2906
|
-
}, 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" }]
|
|
2907
3102
|
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2908
3103
|
type: Inject,
|
|
2909
3104
|
args: [GANTT_UPPER_TOKEN]
|
|
2910
|
-
}] }]
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
2928
|
-
>
|
|
2929
|
-
<defs>
|
|
2930
|
-
<filter x="0.0%" y="0.0%" width="100.0%" height="100.0%" filterUnits="objectBoundingBox" id="filter-1">
|
|
2931
|
-
<feGaussianBlur stdDeviation="0" in="SourceGraphic"></feGaussianBlur>
|
|
2932
|
-
</filter>
|
|
2933
|
-
</defs>
|
|
2934
|
-
<g id="148x134" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
2935
|
-
<g id="编组-6" transform="translate(1.000000, 1.000000)">
|
|
2936
|
-
<ellipse
|
|
2937
|
-
id="椭圆形"
|
|
2938
|
-
fill="#EDEEF2"
|
|
2939
|
-
opacity="0.3"
|
|
2940
|
-
filter="url(#filter-1)"
|
|
2941
|
-
cx="73.0800017"
|
|
2942
|
-
cy="115.920003"
|
|
2943
|
-
rx="73.0800017"
|
|
2944
|
-
ry="16.8000004"
|
|
2945
|
-
></ellipse>
|
|
2946
|
-
<g id="编组-5" transform="translate(15.120000, 0.000000)">
|
|
2947
|
-
<polygon
|
|
2948
|
-
id="矩形"
|
|
2949
|
-
fill="#E2E4E9"
|
|
2950
|
-
points="19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267"
|
|
2951
|
-
></polygon>
|
|
2952
|
-
<path
|
|
2953
|
-
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"
|
|
2954
|
-
id="矩形"
|
|
2955
|
-
fill="#F9FAFB"
|
|
2956
|
-
></path>
|
|
2957
|
-
<path
|
|
2958
|
-
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"
|
|
2959
|
-
id="矩形"
|
|
2960
|
-
fill="#E8EAEE"
|
|
2961
|
-
></path>
|
|
2962
|
-
<text
|
|
2963
|
-
id="</null>"
|
|
2964
|
-
font-family="PingFangSC-Medium, PingFang SC"
|
|
2965
|
-
font-size="15.1200003"
|
|
2966
|
-
font-weight="400"
|
|
2967
|
-
fill="#BCBECD"
|
|
2968
|
-
>
|
|
2969
|
-
<tspan x="33.6000008" y="32.8000004"></null></tspan>
|
|
2970
|
-
</text>
|
|
2971
|
-
<rect id="矩形" fill="#E8EAEE" x="27.5600006" y="52.0800012" width="61.4800014" height="5.04000011" rx="2.52000006"></rect>
|
|
2972
|
-
<rect
|
|
2973
|
-
id="矩形备份"
|
|
2974
|
-
fill="#E8EAEE"
|
|
2975
|
-
x="27.5600006"
|
|
2976
|
-
y="63.8400014"
|
|
2977
|
-
width="61.4800014"
|
|
2978
|
-
height="5.04000011"
|
|
2979
|
-
rx="2.52000006"
|
|
2980
|
-
></rect>
|
|
2981
|
-
<path
|
|
2982
|
-
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"
|
|
2983
|
-
id="矩形"
|
|
2984
|
-
fill="#EDEFF2"
|
|
2985
|
-
></path>
|
|
2986
|
-
</g>
|
|
2987
|
-
</g>
|
|
2988
|
-
</g>
|
|
2989
|
-
</svg>`;
|
|
2990
|
-
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>`;
|
|
2991
|
-
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>`;
|
|
2992
|
-
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>`;
|
|
2993
|
-
const icons = {
|
|
2994
|
-
'angle-right': angleRight,
|
|
2995
|
-
'angle-down': angleDown,
|
|
2996
|
-
'plus-square': plusSquare,
|
|
2997
|
-
'minus-square': minusSquare,
|
|
2998
|
-
loading: loadingIcon,
|
|
2999
|
-
empty: emptyIcon,
|
|
3000
|
-
drag: dragIcon,
|
|
3001
|
-
'arrow-left': arrowLeftIcon,
|
|
3002
|
-
'arrow-right': arrowRightIcon
|
|
3003
|
-
};
|
|
3004
|
-
|
|
3005
|
-
class GanttIconComponent {
|
|
3006
|
-
set iconName(name) {
|
|
3007
|
-
this.setSvg(name);
|
|
3008
|
-
}
|
|
3009
|
-
constructor(elementRef) {
|
|
3010
|
-
this.elementRef = elementRef;
|
|
3011
|
-
this.isIcon = true;
|
|
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
|
+
}] } });
|
|
3114
|
+
|
|
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
|
+
}
|
|
3012
3122
|
}
|
|
3013
|
-
|
|
3014
|
-
const
|
|
3015
|
-
|
|
3016
|
-
|
|
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;
|
|
3017
3137
|
}
|
|
3018
|
-
|
|
3019
|
-
|
|
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);
|
|
3020
3144
|
}
|
|
3021
3145
|
}
|
|
3022
|
-
|
|
3023
|
-
|
|
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 }); }
|
|
3024
3202
|
}
|
|
3025
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
3026
|
-
type:
|
|
3203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
3204
|
+
type: Injectable
|
|
3205
|
+
}], ctorParameters: () => [] });
|
|
3206
|
+
|
|
3207
|
+
class IsGanttRangeItemPipe {
|
|
3208
|
+
transform(value) {
|
|
3209
|
+
return value === GanttItemType.range;
|
|
3210
|
+
}
|
|
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,
|
|
3027
3216
|
args: [{
|
|
3028
|
-
|
|
3029
|
-
template: '',
|
|
3217
|
+
name: 'isGanttRangeItem',
|
|
3030
3218
|
standalone: true
|
|
3031
3219
|
}]
|
|
3032
|
-
}]
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3220
|
+
}] });
|
|
3221
|
+
class IsGanttBarItemPipe {
|
|
3222
|
+
transform(value) {
|
|
3223
|
+
return value === GanttItemType.bar;
|
|
3224
|
+
}
|
|
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;
|
|
3238
|
+
}
|
|
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" }); }
|
|
3241
|
+
}
|
|
3242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
|
|
3243
|
+
type: Pipe,
|
|
3244
|
+
args: [{
|
|
3245
|
+
name: 'isGanttCustomItem',
|
|
3246
|
+
standalone: true
|
|
3247
|
+
}]
|
|
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
|
+
}] });
|
|
3038
3263
|
|
|
3039
3264
|
class GanttLinkLine {
|
|
3040
3265
|
constructor() { }
|
|
@@ -3331,7 +3556,19 @@ class GanttLinksComponent {
|
|
|
3331
3556
|
if (target && (target.origin.start || target.origin.end)) {
|
|
3332
3557
|
let defaultColor = LinkColors.default;
|
|
3333
3558
|
let activeColor = LinkColors.active;
|
|
3334
|
-
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()) {
|
|
3335
3572
|
defaultColor = LinkColors.blocked;
|
|
3336
3573
|
activeColor = LinkColors.blocked;
|
|
3337
3574
|
}
|
|
@@ -3401,108 +3638,131 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
3401
3638
|
args: ['class.gantt-links-overlay']
|
|
3402
3639
|
}] } });
|
|
3403
3640
|
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
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
|
+
};
|
|
3431
3733
|
|
|
3432
|
-
class
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
}
|
|
3436
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3437
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, isStandalone: true, name: "isGanttRangeItem" }); }
|
|
3438
|
-
}
|
|
3439
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
|
|
3440
|
-
type: Pipe,
|
|
3441
|
-
args: [{
|
|
3442
|
-
name: 'isGanttRangeItem',
|
|
3443
|
-
standalone: true
|
|
3444
|
-
}]
|
|
3445
|
-
}] });
|
|
3446
|
-
class IsGanttBarItemPipe {
|
|
3447
|
-
transform(value) {
|
|
3448
|
-
return value === GanttItemType.bar;
|
|
3734
|
+
class GanttIconComponent {
|
|
3735
|
+
set iconName(name) {
|
|
3736
|
+
this.setSvg(name);
|
|
3449
3737
|
}
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
|
|
3454
|
-
type: Pipe,
|
|
3455
|
-
args: [{
|
|
3456
|
-
name: 'isGanttBarItem',
|
|
3457
|
-
standalone: true
|
|
3458
|
-
}]
|
|
3459
|
-
}] });
|
|
3460
|
-
class IsGanttCustomItemPipe {
|
|
3461
|
-
transform(value) {
|
|
3462
|
-
return value === GanttItemType.custom;
|
|
3738
|
+
constructor(elementRef) {
|
|
3739
|
+
this.elementRef = elementRef;
|
|
3740
|
+
this.isIcon = true;
|
|
3463
3741
|
}
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
}]
|
|
3473
|
-
}] });
|
|
3474
|
-
class IsGanttGroupPipe {
|
|
3475
|
-
transform(data) {
|
|
3476
|
-
return !!data.items;
|
|
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 = '';
|
|
3749
|
+
}
|
|
3477
3750
|
}
|
|
3478
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
3479
|
-
static { this.ɵ
|
|
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 }); }
|
|
3480
3753
|
}
|
|
3481
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type:
|
|
3482
|
-
type:
|
|
3754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttIconComponent, decorators: [{
|
|
3755
|
+
type: Component,
|
|
3483
3756
|
args: [{
|
|
3484
|
-
|
|
3757
|
+
selector: 'gantt-icon',
|
|
3758
|
+
template: '',
|
|
3485
3759
|
standalone: true
|
|
3486
3760
|
}]
|
|
3487
|
-
}] }
|
|
3488
|
-
|
|
3489
|
-
class NgxGanttRangeComponent extends GanttItemUpper {
|
|
3490
|
-
constructor(elementRef, ganttUpper) {
|
|
3491
|
-
super(elementRef, ganttUpper);
|
|
3492
|
-
this.ganttRangeClass = true;
|
|
3493
|
-
}
|
|
3494
|
-
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 }); }
|
|
3495
|
-
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"] }] }); }
|
|
3496
|
-
}
|
|
3497
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
|
|
3498
|
-
type: Component,
|
|
3499
|
-
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" }]
|
|
3500
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3501
|
-
type: Inject,
|
|
3502
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3503
|
-
}] }], propDecorators: { ganttRangeClass: [{
|
|
3761
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { isIcon: [{
|
|
3504
3762
|
type: HostBinding,
|
|
3505
|
-
args: ['class.gantt-
|
|
3763
|
+
args: ['class.gantt-icon']
|
|
3764
|
+
}], iconName: [{
|
|
3765
|
+
type: Input
|
|
3506
3766
|
}] } });
|
|
3507
3767
|
|
|
3508
3768
|
class GanttMainComponent {
|
|
@@ -3558,148 +3818,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
3558
3818
|
IsGanttGroupPipe,
|
|
3559
3819
|
GanttIconComponent
|
|
3560
3820
|
], template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n @for (data of viewportItems; track trackBy($index, data)) {\n @if (data | isGanttGroup) {\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [ngClass]=\"data.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n }\n @if (!(data | isGanttGroup)) {\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [style]=\"data.laneStyle\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n @if (data.type | isGanttCustomItem) {\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n }\n @if ((data.type | isGanttRangeItem) || (data.type | isGanttBarItem)) {\n @if (data.type | isGanttRangeItem) {\n <gantt-range [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n }\n @if (data.type | isGanttBarItem) {\n <gantt-bar [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n }\n @if (ganttUpper.baselineItemsMap[data.id]) {\n <gantt-baseline [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\" [template]=\"baselineTemplate\"></gantt-baseline>\n }\n }\n </div>\n }\n }\n</div>\n\n@if (quickTimeFocus) {\n <div class=\"gantt-quick-time-focus-container\" [style.width.px]=\"ganttUpper.view.width\">\n <div class=\"gantt-quick-time-focus\" [style.width.px]=\"dom.visibleRangeX().max - dom.visibleRangeX().min\">\n @for (data of viewportItems; track trackBy(i, data); let i = $index) {\n @let item = toItemType(data);\n <div class=\"gantt-quick-time-focus-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\n <span class=\"ml-2\">\n @if (item.refs?.x < dom.visibleRangeX().min && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n <span class=\"mr-2\">\n @if (item.refs?.x + item.refs?.width > dom.visibleRangeX().max && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n }\n </div>\n </div>\n}\n" }]
|
|
3561
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
3562
|
-
type: Inject,
|
|
3563
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3564
|
-
}] }, { type: GanttDomService }, { type: i0.NgZone }], propDecorators: { viewportItems: [{
|
|
3565
|
-
type: Input
|
|
3566
|
-
}], flatItems: [{
|
|
3567
|
-
type: Input
|
|
3568
|
-
}], groupHeaderTemplate: [{
|
|
3569
|
-
type: Input
|
|
3570
|
-
}], itemTemplate: [{
|
|
3571
|
-
type: Input
|
|
3572
|
-
}], barTemplate: [{
|
|
3573
|
-
type: Input
|
|
3574
|
-
}], rangeTemplate: [{
|
|
3575
|
-
type: Input
|
|
3576
|
-
}], baselineTemplate: [{
|
|
3577
|
-
type: Input
|
|
3578
|
-
}], ganttRoot: [{
|
|
3579
|
-
type: Input
|
|
3580
|
-
}], quickTimeFocus: [{
|
|
3581
|
-
type: Input
|
|
3582
|
-
}], barClick: [{
|
|
3583
|
-
type: Output
|
|
3584
|
-
}], lineClick: [{
|
|
3585
|
-
type: Output
|
|
3586
|
-
}], ganttMainClass: [{
|
|
3587
|
-
type: HostBinding,
|
|
3588
|
-
args: ['class.gantt-main-container']
|
|
3589
|
-
}] } });
|
|
3590
|
-
|
|
3591
|
-
const GANTT_ABSTRACT_TOKEN = new InjectionToken('gantt-abstract-token');
|
|
3592
|
-
|
|
3593
|
-
const supports = (typeof window !== 'undefined' && !!window.CSS && CSS.supports) || (() => false);
|
|
3594
|
-
/**
|
|
3595
|
-
* Note: we don't need to add vendor prefixes within `.scss` files since they're added automatically.
|
|
3596
|
-
* This function is necessary when the `element.style` is updated directly through the JavaScript.
|
|
3597
|
-
* This is not required to be used with CSS properties that don't require vendor prefixes (e.g. `opacity`).
|
|
3598
|
-
*/
|
|
3599
|
-
function setStyleWithVendorPrefix({ element, style, value }) {
|
|
3600
|
-
element.style[style] = value;
|
|
3601
|
-
if (supports(`-webkit-${style}: ${value}`)) {
|
|
3602
|
-
// Note: some browsers still require setting `-webkit` vendor prefix. E.g. Mozilla 49 has implemented
|
|
3603
|
-
// the 3D support for `transform`, but it requires setting `-webkit-` prefix.
|
|
3604
|
-
element.style[`-webkit-${style}`] = value;
|
|
3605
|
-
}
|
|
3606
|
-
}
|
|
3607
|
-
|
|
3608
|
-
class GanttSyncScrollService {
|
|
3609
|
-
constructor() {
|
|
3610
|
-
this.ngZone = inject(NgZone);
|
|
3611
|
-
this.scrollGroupsMap = new Map();
|
|
3612
|
-
}
|
|
3613
|
-
registerScrollEvent(groupName, element, direction) {
|
|
3614
|
-
const group = this.scrollGroupsMap.get(groupName) || { elements: [], destroy$: new Subject(), direction };
|
|
3615
|
-
group.elements.push(element);
|
|
3616
|
-
this.scrollGroupsMap.set(groupName, group);
|
|
3617
|
-
this.monitorScrollChange(group);
|
|
3618
|
-
}
|
|
3619
|
-
unregisterScrollEvent(groupName, element) {
|
|
3620
|
-
const group = this.scrollGroupsMap.get(groupName);
|
|
3621
|
-
if (group) {
|
|
3622
|
-
group.elements = group.elements.filter((el) => el !== element);
|
|
3623
|
-
if (!group.elements.length) {
|
|
3624
|
-
this.scrollGroupsMap.delete(groupName);
|
|
3625
|
-
}
|
|
3626
|
-
else {
|
|
3627
|
-
this.scrollGroupsMap.set(groupName, group);
|
|
3628
|
-
}
|
|
3629
|
-
this.monitorScrollChange(group);
|
|
3630
|
-
}
|
|
3631
|
-
}
|
|
3632
|
-
monitorScrollChange(group) {
|
|
3633
|
-
const { elements, destroy$, direction } = group;
|
|
3634
|
-
destroy$.next();
|
|
3635
|
-
destroy$.complete();
|
|
3636
|
-
if (elements.length) {
|
|
3637
|
-
const scrollObservers = elements.map((el) => fromEvent(el, 'scroll', passiveListenerOptions));
|
|
3638
|
-
this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
3639
|
-
.pipe(takeUntil$1(destroy$))
|
|
3640
|
-
.subscribe((event) => {
|
|
3641
|
-
elements.forEach((el) => {
|
|
3642
|
-
if (direction === 'x') {
|
|
3643
|
-
el.scrollLeft = event.currentTarget.scrollLeft;
|
|
3644
|
-
}
|
|
3645
|
-
else {
|
|
3646
|
-
el.scrollTop = event.currentTarget.scrollTop;
|
|
3647
|
-
}
|
|
3648
|
-
});
|
|
3649
|
-
}));
|
|
3650
|
-
}
|
|
3651
|
-
}
|
|
3652
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3653
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService }); }
|
|
3654
|
-
}
|
|
3655
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, decorators: [{
|
|
3656
|
-
type: Injectable
|
|
3657
|
-
}], ctorParameters: () => [] });
|
|
3658
|
-
|
|
3659
|
-
class GanttSyncScrollXDirective {
|
|
3660
|
-
constructor() {
|
|
3661
|
-
this.syncScrollX = input();
|
|
3662
|
-
this.elementRef = inject((ElementRef));
|
|
3663
|
-
this.syncScrollService = inject(GanttSyncScrollService);
|
|
3664
|
-
}
|
|
3665
|
-
ngOnInit() {
|
|
3666
|
-
this.syncScrollService.registerScrollEvent(this.syncScrollX(), this.elementRef.nativeElement, 'x');
|
|
3667
|
-
}
|
|
3668
|
-
ngOnDestroy() {
|
|
3669
|
-
this.syncScrollService.unregisterScrollEvent(this.syncScrollX(), this.elementRef.nativeElement);
|
|
3670
|
-
}
|
|
3671
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollXDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3672
|
-
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 }); }
|
|
3673
|
-
}
|
|
3674
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollXDirective, decorators: [{
|
|
3675
|
-
type: Directive,
|
|
3676
|
-
args: [{
|
|
3677
|
-
selector: '[syncScrollX]',
|
|
3678
|
-
standalone: true
|
|
3679
|
-
}]
|
|
3680
|
-
}], ctorParameters: () => [] });
|
|
3681
|
-
class GanttSyncScrollYDirective {
|
|
3682
|
-
constructor() {
|
|
3683
|
-
this.syncScrollY = input();
|
|
3684
|
-
this.syncScrollService = inject(GanttSyncScrollService);
|
|
3685
|
-
this.elementRef = inject((ElementRef));
|
|
3686
|
-
}
|
|
3687
|
-
ngOnInit() {
|
|
3688
|
-
this.syncScrollService.registerScrollEvent(this.syncScrollY(), this.elementRef.nativeElement, 'y');
|
|
3689
|
-
}
|
|
3690
|
-
ngOnDestroy() {
|
|
3691
|
-
this.syncScrollService.unregisterScrollEvent(this.syncScrollY(), this.elementRef.nativeElement);
|
|
3821
|
+
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
3822
|
+
type: Inject,
|
|
3823
|
+
args: [GANTT_UPPER_TOKEN]
|
|
3824
|
+
}] }, { type: GanttDomService }, { type: i0.NgZone }], propDecorators: { viewportItems: [{
|
|
3825
|
+
type: Input
|
|
3826
|
+
}], flatItems: [{
|
|
3827
|
+
type: Input
|
|
3828
|
+
}], groupHeaderTemplate: [{
|
|
3829
|
+
type: Input
|
|
3830
|
+
}], itemTemplate: [{
|
|
3831
|
+
type: Input
|
|
3832
|
+
}], barTemplate: [{
|
|
3833
|
+
type: Input
|
|
3834
|
+
}], rangeTemplate: [{
|
|
3835
|
+
type: Input
|
|
3836
|
+
}], baselineTemplate: [{
|
|
3837
|
+
type: Input
|
|
3838
|
+
}], ganttRoot: [{
|
|
3839
|
+
type: Input
|
|
3840
|
+
}], quickTimeFocus: [{
|
|
3841
|
+
type: Input
|
|
3842
|
+
}], barClick: [{
|
|
3843
|
+
type: Output
|
|
3844
|
+
}], lineClick: [{
|
|
3845
|
+
type: Output
|
|
3846
|
+
}], ganttMainClass: [{
|
|
3847
|
+
type: HostBinding,
|
|
3848
|
+
args: ['class.gantt-main-container']
|
|
3849
|
+
}] } });
|
|
3850
|
+
|
|
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;
|
|
3692
3865
|
}
|
|
3693
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3694
|
-
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 }); }
|
|
3695
3866
|
}
|
|
3696
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, decorators: [{
|
|
3697
|
-
type: Directive,
|
|
3698
|
-
args: [{
|
|
3699
|
-
selector: '[syncScrollY]',
|
|
3700
|
-
standalone: true
|
|
3701
|
-
}]
|
|
3702
|
-
}], ctorParameters: () => [] });
|
|
3703
3867
|
|
|
3704
3868
|
const defaultColumnWidth = 100;
|
|
3705
3869
|
const minColumnWidth = 80;
|
|
@@ -4161,151 +4325,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4161
4325
|
args: [(CdkDrag)]
|
|
4162
4326
|
}] } });
|
|
4163
4327
|
|
|
4164
|
-
class NgxGanttToolbarComponent {
|
|
4165
|
-
get top() {
|
|
4166
|
-
return this.ganttUpper.styles.headerHeight + 16 + 'px';
|
|
4167
|
-
}
|
|
4168
|
-
constructor(ganttUpper) {
|
|
4169
|
-
this.ganttUpper = ganttUpper;
|
|
4170
|
-
this.ganttItemClass = true;
|
|
4171
|
-
this.views = inject(GanttConfigService).getViewsLocale();
|
|
4172
|
-
}
|
|
4173
|
-
selectView(view) {
|
|
4174
|
-
this.ganttUpper.changeView(view);
|
|
4175
|
-
}
|
|
4176
|
-
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 }); }
|
|
4177
|
-
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"] }] }); }
|
|
4178
|
-
}
|
|
4179
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
|
|
4180
|
-
type: Component,
|
|
4181
|
-
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" }]
|
|
4182
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
4183
|
-
type: Inject,
|
|
4184
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4185
|
-
}] }], propDecorators: { template: [{
|
|
4186
|
-
type: Input
|
|
4187
|
-
}], ganttItemClass: [{
|
|
4188
|
-
type: HostBinding,
|
|
4189
|
-
args: ['class.gantt-toolbar']
|
|
4190
|
-
}], top: [{
|
|
4191
|
-
type: HostBinding,
|
|
4192
|
-
args: ['style.top']
|
|
4193
|
-
}] } });
|
|
4194
|
-
|
|
4195
|
-
class GanttScrollbarComponent {
|
|
4196
|
-
constructor(ganttUpper) {
|
|
4197
|
-
this.ganttUpper = ganttUpper;
|
|
4198
|
-
this.hasFooter = false;
|
|
4199
|
-
}
|
|
4200
|
-
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 }); }
|
|
4201
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttScrollbarComponent, isStandalone: true, selector: "gantt-scrollbar", inputs: { hasFooter: "hasFooter", tableWidth: "tableWidth", ganttRoot: "ganttRoot" }, 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]=\"ganttRoot.ganttUpper['ganttTableBody']?.elementRef?.nativeElement?.offsetWidth - 1 || 0\"></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"] }] }); }
|
|
4202
|
-
}
|
|
4203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttScrollbarComponent, decorators: [{
|
|
4204
|
-
type: Component,
|
|
4205
|
-
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]=\"ganttRoot.ganttUpper['ganttTableBody']?.elementRef?.nativeElement?.offsetWidth - 1 || 0\"></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" }]
|
|
4206
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
4207
|
-
type: Inject,
|
|
4208
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4209
|
-
}] }], propDecorators: { hasFooter: [{
|
|
4210
|
-
type: Input
|
|
4211
|
-
}], tableWidth: [{
|
|
4212
|
-
type: Input
|
|
4213
|
-
}], ganttRoot: [{
|
|
4214
|
-
type: Input
|
|
4215
|
-
}] } });
|
|
4216
|
-
|
|
4217
|
-
class GanttPrintService {
|
|
4218
|
-
constructor() { }
|
|
4219
|
-
setInlineStyles(targetElem) {
|
|
4220
|
-
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
4221
|
-
for (const svgElement of svgElements) {
|
|
4222
|
-
this.recursElementChildren(svgElement);
|
|
4223
|
-
}
|
|
4224
|
-
}
|
|
4225
|
-
recursElementChildren(node) {
|
|
4226
|
-
const transformProperties = [
|
|
4227
|
-
'fill',
|
|
4228
|
-
'color',
|
|
4229
|
-
'font-size',
|
|
4230
|
-
'stroke',
|
|
4231
|
-
'font',
|
|
4232
|
-
'text-anchor',
|
|
4233
|
-
'stroke-dasharray',
|
|
4234
|
-
'shape-rendering',
|
|
4235
|
-
'stroke-width'
|
|
4236
|
-
];
|
|
4237
|
-
if (!node.style) {
|
|
4238
|
-
return;
|
|
4239
|
-
}
|
|
4240
|
-
const styles = getComputedStyle(node);
|
|
4241
|
-
for (const transformProperty of transformProperties) {
|
|
4242
|
-
node.style[transformProperty] = styles[transformProperty];
|
|
4243
|
-
}
|
|
4244
|
-
for (const child of Array.from(node.childNodes)) {
|
|
4245
|
-
this.recursElementChildren(child);
|
|
4246
|
-
}
|
|
4247
|
-
}
|
|
4248
|
-
register(root) {
|
|
4249
|
-
this.root = root.nativeElement;
|
|
4250
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
4251
|
-
}
|
|
4252
|
-
async print(name = 'download', ignoreElementClass) {
|
|
4253
|
-
const root = this.root;
|
|
4254
|
-
const mainContainer = this.mainContainer;
|
|
4255
|
-
// set print width
|
|
4256
|
-
const printWidth = root.offsetWidth;
|
|
4257
|
-
// set print height
|
|
4258
|
-
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
4259
|
-
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
4260
|
-
html2canvas(root, {
|
|
4261
|
-
logging: false,
|
|
4262
|
-
allowTaint: true,
|
|
4263
|
-
useCORS: true,
|
|
4264
|
-
width: printWidth,
|
|
4265
|
-
height: printHeight,
|
|
4266
|
-
ignoreElements: (element) => {
|
|
4267
|
-
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
4268
|
-
return true;
|
|
4269
|
-
}
|
|
4270
|
-
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
4271
|
-
return true;
|
|
4272
|
-
}
|
|
4273
|
-
},
|
|
4274
|
-
onclone: (cloneDocument) => {
|
|
4275
|
-
const ganttClass = root.className;
|
|
4276
|
-
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
4277
|
-
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
4278
|
-
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
4279
|
-
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
4280
|
-
// change targetDom width
|
|
4281
|
-
cloneGanttDom.style.width = `${printWidth}px`;
|
|
4282
|
-
cloneGanttDom.style.height = `${printHeight}px`;
|
|
4283
|
-
cloneGanttDom.style.overflow = `unset`;
|
|
4284
|
-
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
4285
|
-
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
4286
|
-
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
4287
|
-
if (cloneLinksOverlay) {
|
|
4288
|
-
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
4289
|
-
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
4290
|
-
}
|
|
4291
|
-
// setInlineStyles for svg
|
|
4292
|
-
this.setInlineStyles(cloneGanttDom);
|
|
4293
|
-
}
|
|
4294
|
-
}).then((canvas) => {
|
|
4295
|
-
const link = document.createElement('a');
|
|
4296
|
-
const dataUrl = canvas.toDataURL('image/png');
|
|
4297
|
-
link.download = `${name}.png`;
|
|
4298
|
-
link.href = dataUrl;
|
|
4299
|
-
link.click();
|
|
4300
|
-
});
|
|
4301
|
-
}
|
|
4302
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4303
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService }); }
|
|
4304
|
-
}
|
|
4305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
4306
|
-
type: Injectable
|
|
4307
|
-
}], ctorParameters: () => [] });
|
|
4308
|
-
|
|
4309
4328
|
class NgxGanttRootComponent {
|
|
4310
4329
|
get view() {
|
|
4311
4330
|
return this.ganttUpper.view;
|
|
@@ -4592,16 +4611,15 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4592
4611
|
this.lineClick = new EventEmitter();
|
|
4593
4612
|
this.selectedChange = new EventEmitter();
|
|
4594
4613
|
this.virtualScrolledIndexChange = new EventEmitter();
|
|
4614
|
+
this.tableScrollWidth = signal(0);
|
|
4595
4615
|
this.flatItems = [];
|
|
4596
4616
|
this.viewportItems = [];
|
|
4597
4617
|
this._loading = false;
|
|
4598
4618
|
this.rangeStart = 0;
|
|
4599
4619
|
this.rangeEnd = 0;
|
|
4600
|
-
this.computeAllRefs = false;
|
|
4601
4620
|
}
|
|
4602
4621
|
ngOnInit() {
|
|
4603
4622
|
super.ngOnInit();
|
|
4604
|
-
this.buildFlatItems();
|
|
4605
4623
|
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
4606
4624
|
// the `onStable` will never emit any value.
|
|
4607
4625
|
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take(1));
|
|
@@ -4617,27 +4635,35 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4617
4635
|
});
|
|
4618
4636
|
});
|
|
4619
4637
|
});
|
|
4620
|
-
|
|
4621
|
-
this.computeTempDataRefs();
|
|
4622
|
-
});
|
|
4638
|
+
// 如果虚拟滚动未启用,初始化时需要手动填充 viewportItems
|
|
4623
4639
|
if (!this.virtualScrollEnabled) {
|
|
4624
4640
|
this.viewportItems = this.flatItems.slice(this.rangeStart, this.rangeEnd);
|
|
4625
|
-
this.
|
|
4641
|
+
this.computeRefs();
|
|
4626
4642
|
}
|
|
4627
4643
|
}
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
if (
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
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);
|
|
4639
4657
|
}
|
|
4640
|
-
}
|
|
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);
|
|
4641
4667
|
}
|
|
4642
4668
|
ngAfterViewInit() {
|
|
4643
4669
|
if (this.virtualScrollEnabled) {
|
|
@@ -4648,9 +4674,10 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4648
4674
|
this.rangeEnd = range.end;
|
|
4649
4675
|
this.viewportItems = this.flatItems.slice(range.start, range.end);
|
|
4650
4676
|
this.appendDraggingItemToViewportItems();
|
|
4651
|
-
this.
|
|
4677
|
+
this.computeRefs();
|
|
4652
4678
|
});
|
|
4653
4679
|
}
|
|
4680
|
+
this.initScrollContainerObserver();
|
|
4654
4681
|
}
|
|
4655
4682
|
ngAfterViewChecked() {
|
|
4656
4683
|
if (this.virtualScrollEnabled && this.viewportRuler && this.virtualScroll.getRenderedRange().end > 0) {
|
|
@@ -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) {
|
|
@@ -4816,6 +4819,27 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4816
4819
|
this.table.dragEnded.emit(event);
|
|
4817
4820
|
this.draggingItem = null;
|
|
4818
4821
|
}
|
|
4822
|
+
initScrollContainerObserver() {
|
|
4823
|
+
if (this.ganttTableBody && this.ganttTableBody['elementRef']?.nativeElement) {
|
|
4824
|
+
this.tableScrollWidth.set(this.ganttTableBody['elementRef'].nativeElement.clientWidth);
|
|
4825
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
4826
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
4827
|
+
const newWidth = entries[0].target.clientWidth;
|
|
4828
|
+
if (this.tableScrollWidth() !== newWidth) {
|
|
4829
|
+
this.tableScrollWidth.set(newWidth);
|
|
4830
|
+
this.cdr.markForCheck();
|
|
4831
|
+
}
|
|
4832
|
+
});
|
|
4833
|
+
this.resizeObserver.observe(this.ganttTableBody['elementRef'].nativeElement);
|
|
4834
|
+
}
|
|
4835
|
+
}
|
|
4836
|
+
}
|
|
4837
|
+
ngOnDestroy() {
|
|
4838
|
+
super.ngOnDestroy();
|
|
4839
|
+
if (this.resizeObserver) {
|
|
4840
|
+
this.resizeObserver.disconnect();
|
|
4841
|
+
}
|
|
4842
|
+
}
|
|
4819
4843
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1$1.ViewportRuler }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4820
4844
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttComponent, isStandalone: true, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", virtualScrollEnabled: "virtualScrollEnabled", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange", virtualScrolledIndexChange: "virtualScrolledIndexChange" }, providers: [
|
|
4821
4845
|
{
|
|
@@ -4826,7 +4850,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4826
4850
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
4827
4851
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
4828
4852
|
}
|
|
4829
|
-
], 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 }); }
|
|
4830
4854
|
}
|
|
4831
4855
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
4832
4856
|
type: Component,
|
|
@@ -4856,7 +4880,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4856
4880
|
NgTemplateOutlet,
|
|
4857
4881
|
GanttSyncScrollXDirective,
|
|
4858
4882
|
GanttSyncScrollYDirective
|
|
4859
|
-
], 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 ></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" }]
|
|
4883
|
+
], 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" }]
|
|
4860
4884
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$1.ViewportRuler }, { type: undefined, decorators: [{
|
|
4861
4885
|
type: Inject,
|
|
4862
4886
|
args: [GANTT_GLOBAL_CONFIG]
|
|
@@ -5021,5 +5045,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
5021
5045
|
* Generated bundle index. Do not edit.
|
|
5022
5046
|
*/
|
|
5023
5047
|
|
|
5024
|
-
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 };
|
|
5025
5049
|
//# sourceMappingURL=worktile-gantt.mjs.map
|