@worktile/gantt 18.0.4 → 18.1.0-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/event.d.ts +3 -1
- package/class/item.d.ts +2 -2
- package/class/view-type.d.ts +0 -4
- package/components/icon/icons.d.ts +2 -0
- package/components/main/gantt-main.component.d.ts +14 -4
- package/components/toolbar/toolbar.component.d.ts +1 -6
- package/esm2022/class/event.mjs +4 -2
- package/esm2022/class/item.mjs +1 -1
- package/esm2022/class/view-type.mjs +1 -23
- package/esm2022/components/bar/bar-drag.mjs +3 -3
- package/esm2022/components/icon/icons.mjs +6 -2
- package/esm2022/components/main/gantt-main.component.mjs +39 -9
- package/esm2022/components/table/body/gantt-table-body.component.mjs +3 -3
- package/esm2022/components/toolbar/toolbar.component.mjs +6 -7
- package/esm2022/gantt-dom.service.mjs +18 -2
- package/esm2022/gantt-upper.mjs +21 -16
- package/esm2022/gantt.component.mjs +10 -5
- package/esm2022/gantt.config.mjs +48 -12
- package/esm2022/gantt.module.mjs +27 -20
- package/esm2022/gantt.pipe.mjs +16 -1
- package/esm2022/i18n/i18n.mjs +12 -0
- package/esm2022/i18n/index.mjs +18 -0
- package/esm2022/i18n/locales/de-de.mjs +51 -0
- package/esm2022/i18n/locales/en-us.mjs +49 -0
- package/esm2022/i18n/locales/ja-jp.mjs +49 -0
- package/esm2022/i18n/locales/ru-ru.mjs +51 -0
- package/esm2022/i18n/locales/zh-hans.mjs +49 -0
- package/esm2022/i18n/locales/zh-hant.mjs +49 -0
- package/esm2022/public-api.mjs +2 -1
- package/esm2022/root.component.mjs +3 -3
- package/esm2022/table/gantt-table.component.mjs +5 -2
- package/esm2022/utils/date.mjs +9 -4
- package/esm2022/views/day.mjs +6 -4
- package/esm2022/views/hour.mjs +5 -3
- package/esm2022/views/month.mjs +6 -4
- package/esm2022/views/quarter.mjs +6 -4
- package/esm2022/views/view.mjs +2 -3
- package/esm2022/views/week.mjs +6 -4
- package/esm2022/views/year.mjs +5 -3
- package/fesm2022/worktile-gantt.mjs +526 -119
- package/fesm2022/worktile-gantt.mjs.map +1 -1
- package/gantt-dom.service.d.ts +7 -1
- package/gantt-upper.d.ts +7 -4
- package/gantt.component.d.ts +1 -1
- package/gantt.component.scss +53 -0
- package/gantt.config.d.ts +19 -0
- package/gantt.module.d.ts +3 -4
- package/gantt.pipe.d.ts +5 -0
- package/i18n/i18n.d.ts +23 -0
- package/i18n/index.d.ts +10 -0
- package/i18n/locales/de-de.d.ts +49 -0
- package/i18n/locales/en-us.d.ts +48 -0
- package/i18n/locales/ja-jp.d.ts +48 -0
- package/i18n/locales/ru-ru.d.ts +49 -0
- package/i18n/locales/zh-hans.d.ts +48 -0
- package/i18n/locales/zh-hant.d.ts +48 -0
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
- package/root.component.d.ts +1 -1
- package/table/gantt-table.component.d.ts +3 -2
- package/utils/date.d.ts +3 -1
- package/views/view.d.ts +9 -0
|
@@ -4,14 +4,17 @@ import * as i1$1 from '@angular/cdk/scrolling';
|
|
|
4
4
|
import { CdkScrollable, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, ScrollingModule } from '@angular/cdk/scrolling';
|
|
5
5
|
import { isPlatformServer, NgIf, NgTemplateOutlet, NgFor, NgStyle, NgClass, DOCUMENT, CommonModule } from '@angular/common';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
|
-
import { InjectionToken,
|
|
7
|
+
import { InjectionToken, inject, Injectable, Inject, EventEmitter, Directive, Input, Output, ContentChild, HostBinding, signal, PLATFORM_ID, effect, Component, ViewChild, ViewChildren, Pipe, ElementRef, Optional, HostListener, forwardRef, ChangeDetectionStrategy, ContentChildren, NgModule } from '@angular/core';
|
|
8
8
|
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';
|
|
9
9
|
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';
|
|
10
|
-
import { BehaviorSubject, Subject, from, fromEvent, merge, Observable, EMPTY, interval, animationFrameScheduler, takeUntil as takeUntil$1, startWith as startWith$1, auditTime as auditTime$1, filter } from 'rxjs';
|
|
10
|
+
import { BehaviorSubject, Subject, from, fromEvent, merge, Observable, EMPTY, interval, animationFrameScheduler, take as take$1, takeUntil as takeUntil$1, combineLatest, startWith as startWith$1, auditTime as auditTime$1, filter } from 'rxjs';
|
|
11
11
|
import { take, takeUntil, skip, map, pairwise, auditTime, startWith, switchMap, debounceTime, finalize } from 'rxjs/operators';
|
|
12
|
+
import { TZDate } from '@date-fns/tz';
|
|
13
|
+
import { de, ru } from 'date-fns/locale';
|
|
12
14
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
13
15
|
import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
14
16
|
import { __decorate, __param } from 'tslib';
|
|
17
|
+
import { setDefaultTimeZone as setDefaultTimeZone$1 } from 'ngx-gantt';
|
|
15
18
|
|
|
16
19
|
class GanttDatePoint {
|
|
17
20
|
constructor(start, text, x, y, additions, style) {
|
|
@@ -36,7 +39,9 @@ class GanttLineClickEvent {
|
|
|
36
39
|
}
|
|
37
40
|
class GanttBarClickEvent {
|
|
38
41
|
}
|
|
39
|
-
class
|
|
42
|
+
class GanttTableItemClickEvent {
|
|
43
|
+
}
|
|
44
|
+
class GanttSelectedEvent extends GanttTableItemClickEvent {
|
|
40
45
|
}
|
|
41
46
|
class GanttTableDragDroppedEvent {
|
|
42
47
|
}
|
|
@@ -49,6 +54,10 @@ class GanttTableDragEnterPredicateContext {
|
|
|
49
54
|
class GanttVirtualScrolledIndexChangeEvent {
|
|
50
55
|
}
|
|
51
56
|
|
|
57
|
+
let timeZone;
|
|
58
|
+
function setDefaultTimeZone(zone) {
|
|
59
|
+
timeZone = zone ?? undefined;
|
|
60
|
+
}
|
|
52
61
|
class GanttDate {
|
|
53
62
|
constructor(date) {
|
|
54
63
|
if (date) {
|
|
@@ -57,10 +66,10 @@ class GanttDate {
|
|
|
57
66
|
}
|
|
58
67
|
else if (typeof date === 'string' || typeof date === 'number') {
|
|
59
68
|
if (date.toString().length < 13) {
|
|
60
|
-
this.value = fromUnixTime(+date);
|
|
69
|
+
this.value = new TZDate(fromUnixTime(+date), timeZone);
|
|
61
70
|
}
|
|
62
71
|
else {
|
|
63
|
-
this.value = new
|
|
72
|
+
this.value = new TZDate(date, timeZone);
|
|
64
73
|
}
|
|
65
74
|
}
|
|
66
75
|
else {
|
|
@@ -69,7 +78,7 @@ class GanttDate {
|
|
|
69
78
|
}
|
|
70
79
|
}
|
|
71
80
|
else {
|
|
72
|
-
this.value = new Date();
|
|
81
|
+
this.value = new TZDate(new Date(), timeZone);
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
84
|
getYear() {
|
|
@@ -346,28 +355,6 @@ var GanttViewType;
|
|
|
346
355
|
GanttViewType["week"] = "week";
|
|
347
356
|
GanttViewType["hour"] = "hour";
|
|
348
357
|
})(GanttViewType || (GanttViewType = {}));
|
|
349
|
-
const ganttViews = [
|
|
350
|
-
{
|
|
351
|
-
name: '日',
|
|
352
|
-
value: GanttViewType.day
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
name: '周',
|
|
356
|
-
value: GanttViewType.week
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
name: '月',
|
|
360
|
-
value: GanttViewType.month
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
name: '季',
|
|
364
|
-
value: GanttViewType.quarter
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
name: '年',
|
|
368
|
-
value: GanttViewType.year
|
|
369
|
-
}
|
|
370
|
-
];
|
|
371
358
|
|
|
372
359
|
class GanttBaselineItemInternal {
|
|
373
360
|
get refs() {
|
|
@@ -385,36 +372,11 @@ class GanttBaselineItemInternal {
|
|
|
385
372
|
}
|
|
386
373
|
}
|
|
387
374
|
|
|
388
|
-
const defaultConfig = {
|
|
389
|
-
dateFormat: {
|
|
390
|
-
hour: 'HH:mm',
|
|
391
|
-
day: 'M月d日',
|
|
392
|
-
week: '第w周',
|
|
393
|
-
month: 'M月',
|
|
394
|
-
quarter: 'QQQ',
|
|
395
|
-
year: 'yyyy年',
|
|
396
|
-
yearMonth: 'yyyy年MM月',
|
|
397
|
-
yearQuarter: 'yyyy年QQQ'
|
|
398
|
-
},
|
|
399
|
-
linkOptions: {
|
|
400
|
-
dependencyTypes: [GanttLinkType.fs],
|
|
401
|
-
showArrow: false,
|
|
402
|
-
lineType: GanttLinkLineType.curve
|
|
403
|
-
},
|
|
404
|
-
styleOptions: {
|
|
405
|
-
headerHeight: 44,
|
|
406
|
-
lineHeight: 44,
|
|
407
|
-
barHeight: 22
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
const GANTT_GLOBAL_CONFIG = new InjectionToken('GANTT_GLOBAL_CONFIG');
|
|
411
|
-
|
|
412
375
|
const primaryDatePointTop = '40%';
|
|
413
376
|
const secondaryDatePointTop = '80%';
|
|
414
377
|
const viewOptions$6 = {
|
|
415
378
|
min: new GanttDate().addYears(-1).startOfYear(),
|
|
416
379
|
max: new GanttDate().addYears(1).endOfYear(),
|
|
417
|
-
dateFormat: defaultConfig.dateFormat,
|
|
418
380
|
datePrecisionUnit: 'day',
|
|
419
381
|
dragPreviewDateFormat: 'MM-dd'
|
|
420
382
|
};
|
|
@@ -427,6 +389,7 @@ class GanttView {
|
|
|
427
389
|
}
|
|
428
390
|
constructor(start, end, options) {
|
|
429
391
|
this.showTimeline = true;
|
|
392
|
+
this.dateFormats = {};
|
|
430
393
|
this.options = Object.assign({}, viewOptions$6, options);
|
|
431
394
|
const startDate = start.isCustom
|
|
432
395
|
? this.viewStartOf(start.date)
|
|
@@ -583,12 +546,317 @@ class GanttView {
|
|
|
583
546
|
}
|
|
584
547
|
}
|
|
585
548
|
|
|
549
|
+
var GanttI18nLocale;
|
|
550
|
+
(function (GanttI18nLocale) {
|
|
551
|
+
GanttI18nLocale["zhHans"] = "zh-hans";
|
|
552
|
+
GanttI18nLocale["zhHant"] = "zh-hant";
|
|
553
|
+
GanttI18nLocale["enUs"] = "en-us";
|
|
554
|
+
GanttI18nLocale["deDe"] = "de-de";
|
|
555
|
+
GanttI18nLocale["jaJp"] = "ja-jp";
|
|
556
|
+
GanttI18nLocale["ruRu"] = "ru-ru";
|
|
557
|
+
})(GanttI18nLocale || (GanttI18nLocale = {}));
|
|
558
|
+
const GANTT_I18N_LOCALE_TOKEN = new InjectionToken('gantt-i18n-locale');
|
|
559
|
+
|
|
560
|
+
var zhHans = {
|
|
561
|
+
id: GanttI18nLocale.zhHans,
|
|
562
|
+
views: {
|
|
563
|
+
[GanttViewType.hour]: {
|
|
564
|
+
label: '小时',
|
|
565
|
+
dateFormats: {
|
|
566
|
+
primary: 'M月d日',
|
|
567
|
+
secondary: 'HH:mm'
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
[GanttViewType.day]: {
|
|
571
|
+
label: '天',
|
|
572
|
+
dateFormats: {
|
|
573
|
+
primary: 'yyyy年MM月',
|
|
574
|
+
secondary: 'd'
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
[GanttViewType.week]: {
|
|
578
|
+
label: '周',
|
|
579
|
+
dateFormats: {
|
|
580
|
+
primary: 'yyyy年',
|
|
581
|
+
secondary: '第w周'
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
[GanttViewType.month]: {
|
|
585
|
+
label: '月',
|
|
586
|
+
dateFormats: {
|
|
587
|
+
primary: `yyyy年'Q'Q`,
|
|
588
|
+
secondary: 'M月'
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
[GanttViewType.quarter]: {
|
|
592
|
+
label: '季',
|
|
593
|
+
dateFormats: {
|
|
594
|
+
primary: 'yyyy年',
|
|
595
|
+
secondary: `yyyy年'Q'Q`
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
[GanttViewType.year]: {
|
|
599
|
+
label: '年',
|
|
600
|
+
dateFormats: {
|
|
601
|
+
secondary: 'yyyy年'
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
var zhHant = {
|
|
608
|
+
id: GanttI18nLocale.zhHant,
|
|
609
|
+
views: {
|
|
610
|
+
[GanttViewType.hour]: {
|
|
611
|
+
label: '小時',
|
|
612
|
+
dateFormats: {
|
|
613
|
+
primary: 'M月d日',
|
|
614
|
+
secondary: 'HH:mm'
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
[GanttViewType.day]: {
|
|
618
|
+
label: '天',
|
|
619
|
+
dateFormats: {
|
|
620
|
+
primary: 'yyyy年MM月',
|
|
621
|
+
secondary: 'd'
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
[GanttViewType.week]: {
|
|
625
|
+
label: '週',
|
|
626
|
+
dateFormats: {
|
|
627
|
+
primary: 'yyyy年',
|
|
628
|
+
secondary: '第w週'
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
[GanttViewType.month]: {
|
|
632
|
+
label: '月',
|
|
633
|
+
dateFormats: {
|
|
634
|
+
primary: `yyyy年'Q'Q`,
|
|
635
|
+
secondary: 'M月'
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
[GanttViewType.quarter]: {
|
|
639
|
+
label: '季',
|
|
640
|
+
dateFormats: {
|
|
641
|
+
primary: 'yyyy年',
|
|
642
|
+
secondary: `yyyy年'Q'Q`
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
[GanttViewType.year]: {
|
|
646
|
+
label: '年',
|
|
647
|
+
dateFormats: {
|
|
648
|
+
secondary: 'yyyy年'
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
var enUsLocale = {
|
|
655
|
+
id: GanttI18nLocale.enUs,
|
|
656
|
+
views: {
|
|
657
|
+
[GanttViewType.hour]: {
|
|
658
|
+
label: 'Hourly',
|
|
659
|
+
dateFormats: {
|
|
660
|
+
primary: 'MMM d',
|
|
661
|
+
secondary: 'HH:mm'
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
[GanttViewType.day]: {
|
|
665
|
+
label: 'Daily',
|
|
666
|
+
dateFormats: {
|
|
667
|
+
primary: 'MMM yyyy',
|
|
668
|
+
secondary: 'd'
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
[GanttViewType.week]: {
|
|
672
|
+
label: 'Weekly',
|
|
673
|
+
dateFormats: {
|
|
674
|
+
primary: 'yyyy',
|
|
675
|
+
secondary: 'wo'
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
[GanttViewType.month]: {
|
|
679
|
+
label: 'Monthly',
|
|
680
|
+
dateFormats: {
|
|
681
|
+
primary: "yyyy 'Q'Q",
|
|
682
|
+
secondary: 'MMM'
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
[GanttViewType.quarter]: {
|
|
686
|
+
label: 'Quarterly',
|
|
687
|
+
dateFormats: {
|
|
688
|
+
primary: 'yyyy',
|
|
689
|
+
secondary: "yyyy 'Q'Q"
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
[GanttViewType.year]: {
|
|
693
|
+
label: 'Yearly',
|
|
694
|
+
dateFormats: {
|
|
695
|
+
secondary: 'yyyy'
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
var jaJpLocale = {
|
|
702
|
+
id: GanttI18nLocale.jaJp,
|
|
703
|
+
views: {
|
|
704
|
+
[GanttViewType.hour]: {
|
|
705
|
+
label: '毎時',
|
|
706
|
+
dateFormats: {
|
|
707
|
+
primary: 'M月d日',
|
|
708
|
+
secondary: 'HH:mm'
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
[GanttViewType.day]: {
|
|
712
|
+
label: '日',
|
|
713
|
+
dateFormats: {
|
|
714
|
+
primary: 'yyyy年M月d日',
|
|
715
|
+
secondary: 'd'
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
[GanttViewType.week]: {
|
|
719
|
+
label: '週',
|
|
720
|
+
dateFormats: {
|
|
721
|
+
primary: 'yyyy年',
|
|
722
|
+
secondary: '第w週'
|
|
723
|
+
}
|
|
724
|
+
},
|
|
725
|
+
[GanttViewType.month]: {
|
|
726
|
+
label: '月',
|
|
727
|
+
dateFormats: {
|
|
728
|
+
primary: `yyyy年M月`,
|
|
729
|
+
secondary: 'M月'
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
[GanttViewType.quarter]: {
|
|
733
|
+
label: '四半期',
|
|
734
|
+
dateFormats: {
|
|
735
|
+
primary: 'yyyy年',
|
|
736
|
+
secondary: `yyyy年第Q四半期`
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
[GanttViewType.year]: {
|
|
740
|
+
label: '年',
|
|
741
|
+
dateFormats: {
|
|
742
|
+
secondary: 'yyyy年'
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
var deDeLocale = {
|
|
749
|
+
id: GanttI18nLocale.deDe,
|
|
750
|
+
dateLocale: de,
|
|
751
|
+
views: {
|
|
752
|
+
[GanttViewType.hour]: {
|
|
753
|
+
label: 'Stündlich',
|
|
754
|
+
dateFormats: {
|
|
755
|
+
primary: 'dd. MMM',
|
|
756
|
+
secondary: 'HH:mm'
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
[GanttViewType.day]: {
|
|
760
|
+
label: 'Täglich',
|
|
761
|
+
dateFormats: {
|
|
762
|
+
primary: 'MMM yyyy',
|
|
763
|
+
secondary: 'd'
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
[GanttViewType.week]: {
|
|
767
|
+
label: 'Wöchentlich',
|
|
768
|
+
dateFormats: {
|
|
769
|
+
primary: 'yyyy',
|
|
770
|
+
secondary: `w. 'Woche'`
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
[GanttViewType.month]: {
|
|
774
|
+
label: 'Monatlich',
|
|
775
|
+
dateFormats: {
|
|
776
|
+
primary: 'MMM yyyy',
|
|
777
|
+
secondary: 'MMM'
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
[GanttViewType.quarter]: {
|
|
781
|
+
label: 'Vierteljährlich',
|
|
782
|
+
dateFormats: {
|
|
783
|
+
primary: 'yyyy',
|
|
784
|
+
secondary: `Q. 'Quartal' yyyy`
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
[GanttViewType.year]: {
|
|
788
|
+
label: 'Jährlich',
|
|
789
|
+
dateFormats: {
|
|
790
|
+
secondary: 'yyyy'
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
var ruRuLocale = {
|
|
797
|
+
id: GanttI18nLocale.ruRu,
|
|
798
|
+
dateLocale: ru,
|
|
799
|
+
views: {
|
|
800
|
+
[GanttViewType.hour]: {
|
|
801
|
+
label: 'Ежечасно',
|
|
802
|
+
dateFormats: {
|
|
803
|
+
primary: 'd MMM',
|
|
804
|
+
secondary: 'HH:mm'
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
[GanttViewType.day]: {
|
|
808
|
+
label: 'Ежедневно',
|
|
809
|
+
dateFormats: {
|
|
810
|
+
primary: 'MMMM yyyy',
|
|
811
|
+
secondary: 'd'
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
[GanttViewType.week]: {
|
|
815
|
+
label: 'Еженедельно',
|
|
816
|
+
dateFormats: {
|
|
817
|
+
primary: 'yyyy',
|
|
818
|
+
secondary: 'Неделя w'
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
[GanttViewType.month]: {
|
|
822
|
+
label: 'Ежемесячно',
|
|
823
|
+
dateFormats: {
|
|
824
|
+
primary: 'MMMM yyyy',
|
|
825
|
+
secondary: 'MMM'
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
[GanttViewType.quarter]: {
|
|
829
|
+
label: 'Ежеквартально',
|
|
830
|
+
dateFormats: {
|
|
831
|
+
primary: 'yyyy',
|
|
832
|
+
secondary: 'Квартал Q yyyy'
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
[GanttViewType.year]: {
|
|
836
|
+
label: 'Ежегодно',
|
|
837
|
+
dateFormats: {
|
|
838
|
+
secondary: 'yyyy'
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
const i18nLocaleProvides = [
|
|
845
|
+
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: zhHans, multi: true },
|
|
846
|
+
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: zhHant, multi: true },
|
|
847
|
+
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: enUsLocale, multi: true },
|
|
848
|
+
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: jaJpLocale, multi: true },
|
|
849
|
+
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: deDeLocale, multi: true },
|
|
850
|
+
{ provide: GANTT_I18N_LOCALE_TOKEN, useValue: ruRuLocale, multi: true }
|
|
851
|
+
];
|
|
852
|
+
|
|
586
853
|
const viewOptions$5 = {
|
|
587
854
|
start: new GanttDate().startOfQuarter().addQuarters(-1),
|
|
588
855
|
end: new GanttDate().endOfQuarter().addQuarters(2),
|
|
589
856
|
cellWidth: 280,
|
|
590
857
|
addAmount: 1,
|
|
591
|
-
addUnit: 'quarter'
|
|
858
|
+
addUnit: 'quarter',
|
|
859
|
+
dateDisplayFormats: zhHant.views.month.dateFormats
|
|
592
860
|
};
|
|
593
861
|
class GanttViewMonth extends GanttView {
|
|
594
862
|
constructor(start, end, options) {
|
|
@@ -612,7 +880,7 @@ class GanttViewMonth extends GanttView {
|
|
|
612
880
|
const points = [];
|
|
613
881
|
for (let i = 0; i < quarters; i++) {
|
|
614
882
|
const start = this.start.addQuarters(i);
|
|
615
|
-
const point = new GanttDatePoint(start, start.format(this.options.dateFormat.
|
|
883
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.yearQuarter || this.options.dateDisplayFormats.primary), (this.getCellWidth() * 3) / 2 + i * (this.getCellWidth() * 3), primaryDatePointTop);
|
|
616
884
|
points.push(point);
|
|
617
885
|
}
|
|
618
886
|
return points;
|
|
@@ -622,7 +890,7 @@ class GanttViewMonth extends GanttView {
|
|
|
622
890
|
const points = [];
|
|
623
891
|
for (let i = 0; i < months.length; i++) {
|
|
624
892
|
const start = new GanttDate(months[i]);
|
|
625
|
-
const point = new GanttDatePoint(start, start.format(this.options.dateFormat.
|
|
893
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.month || this.options.dateDisplayFormats.secondary), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
626
894
|
points.push(point);
|
|
627
895
|
}
|
|
628
896
|
return points;
|
|
@@ -636,7 +904,8 @@ const viewOptions$4 = {
|
|
|
636
904
|
max: new GanttDate().addYears(2).endOfYear(),
|
|
637
905
|
cellWidth: 500,
|
|
638
906
|
addAmount: 1,
|
|
639
|
-
addUnit: 'year'
|
|
907
|
+
addUnit: 'year',
|
|
908
|
+
dateDisplayFormats: zhHant.views.quarter.dateFormats
|
|
640
909
|
};
|
|
641
910
|
class GanttViewQuarter extends GanttView {
|
|
642
911
|
constructor(start, end, options) {
|
|
@@ -660,7 +929,7 @@ class GanttViewQuarter extends GanttView {
|
|
|
660
929
|
const points = [];
|
|
661
930
|
for (let i = 0; i < years.length; i++) {
|
|
662
931
|
const start = new GanttDate(years[i]);
|
|
663
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat.
|
|
932
|
+
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.year || this.options.dateDisplayFormats.primary)}`, (this.getCellWidth() * 4) / 2 + i * (this.getCellWidth() * 4), primaryDatePointTop);
|
|
664
933
|
points.push(point);
|
|
665
934
|
}
|
|
666
935
|
return points;
|
|
@@ -670,7 +939,7 @@ class GanttViewQuarter extends GanttView {
|
|
|
670
939
|
const points = [];
|
|
671
940
|
for (let i = 0; i <= quarters; i++) {
|
|
672
941
|
const start = this.start.addQuarters(i);
|
|
673
|
-
const point = new GanttDatePoint(start, start.format(this.options.dateFormat.
|
|
942
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.quarter || this.options.dateDisplayFormats.secondary), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
674
943
|
points.push(point);
|
|
675
944
|
}
|
|
676
945
|
return points;
|
|
@@ -682,7 +951,8 @@ const viewOptions$3 = {
|
|
|
682
951
|
start: new GanttDate().startOfYear().startOfWeek(),
|
|
683
952
|
end: new GanttDate().endOfYear().endOfWeek(),
|
|
684
953
|
addAmount: 1,
|
|
685
|
-
addUnit: 'month'
|
|
954
|
+
addUnit: 'month',
|
|
955
|
+
dateDisplayFormats: zhHant.views.day.dateFormats
|
|
686
956
|
};
|
|
687
957
|
class GanttViewDay extends GanttView {
|
|
688
958
|
constructor(start, end, options) {
|
|
@@ -709,7 +979,7 @@ class GanttViewDay extends GanttView {
|
|
|
709
979
|
for (let i = 0; i < weeks.length; i++) {
|
|
710
980
|
const weekStart = new GanttDate(weeks[i]);
|
|
711
981
|
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
712
|
-
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat.
|
|
982
|
+
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.yearMonth || this.options.dateDisplayFormats.primary), (this.getCellWidth() * 7) / 2 + i * (this.getCellWidth() * 7), primaryDatePointTop);
|
|
713
983
|
points.push(point);
|
|
714
984
|
}
|
|
715
985
|
return points;
|
|
@@ -719,7 +989,7 @@ class GanttViewDay extends GanttView {
|
|
|
719
989
|
const points = [];
|
|
720
990
|
for (let i = 0; i < days.length; i++) {
|
|
721
991
|
const start = new GanttDate(days[i]);
|
|
722
|
-
const point = new GanttDatePoint(start, start.getDate().toString(), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
|
|
992
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateDisplayFormats.secondary) || start.getDate().toString(), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
|
|
723
993
|
isWeekend: start.isWeekend(),
|
|
724
994
|
isToday: start.isToday()
|
|
725
995
|
});
|
|
@@ -734,7 +1004,8 @@ const viewOptions$2 = {
|
|
|
734
1004
|
start: new GanttDate().startOfYear().startOfWeek(),
|
|
735
1005
|
end: new GanttDate().endOfYear().endOfWeek(),
|
|
736
1006
|
addAmount: 1,
|
|
737
|
-
addUnit: 'month'
|
|
1007
|
+
addUnit: 'month',
|
|
1008
|
+
dateDisplayFormats: zhHant.views.week.dateFormats
|
|
738
1009
|
};
|
|
739
1010
|
class GanttViewWeek extends GanttView {
|
|
740
1011
|
constructor(start, end, options) {
|
|
@@ -759,7 +1030,7 @@ class GanttViewWeek extends GanttView {
|
|
|
759
1030
|
for (let i = 0; i < weeks.length; i++) {
|
|
760
1031
|
const weekStart = new GanttDate(weeks[i]);
|
|
761
1032
|
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
762
|
-
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat.
|
|
1033
|
+
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.year || this.options.dateDisplayFormats.primary), this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
763
1034
|
points.push(point);
|
|
764
1035
|
}
|
|
765
1036
|
return points;
|
|
@@ -769,7 +1040,7 @@ class GanttViewWeek extends GanttView {
|
|
|
769
1040
|
const points = [];
|
|
770
1041
|
for (let i = 0; i < weeks.length; i++) {
|
|
771
1042
|
const start = new GanttDate(weeks[i]);
|
|
772
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat.
|
|
1043
|
+
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.week || this.options.dateDisplayFormats.secondary)}`, i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
773
1044
|
points.push(point);
|
|
774
1045
|
}
|
|
775
1046
|
return points;
|
|
@@ -781,7 +1052,8 @@ const viewOptions$1 = {
|
|
|
781
1052
|
start: new GanttDate().addYears(-2).startOfYear(),
|
|
782
1053
|
end: new GanttDate().addYears(2).endOfYear(),
|
|
783
1054
|
addAmount: 1,
|
|
784
|
-
addUnit: 'year'
|
|
1055
|
+
addUnit: 'year',
|
|
1056
|
+
dateDisplayFormats: zhHant.views.year.dateFormats
|
|
785
1057
|
};
|
|
786
1058
|
class GanttViewYear extends GanttView {
|
|
787
1059
|
constructor(start, end, options) {
|
|
@@ -816,7 +1088,7 @@ class GanttViewYear extends GanttView {
|
|
|
816
1088
|
const pointTop = '60%';
|
|
817
1089
|
for (let i = 0; i <= years; i++) {
|
|
818
1090
|
const start = this.start.addYears(i);
|
|
819
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat.
|
|
1091
|
+
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);
|
|
820
1092
|
points.push(point);
|
|
821
1093
|
}
|
|
822
1094
|
return points;
|
|
@@ -830,6 +1102,7 @@ const viewOptions = {
|
|
|
830
1102
|
datePrecisionUnit: 'minute',
|
|
831
1103
|
addAmount: 1,
|
|
832
1104
|
addUnit: 'week',
|
|
1105
|
+
dateDisplayFormats: zhHant.views.hour.dateFormats,
|
|
833
1106
|
dragPreviewDateFormat: 'HH:mm'
|
|
834
1107
|
};
|
|
835
1108
|
class GanttViewHour extends GanttView {
|
|
@@ -859,7 +1132,7 @@ class GanttViewHour extends GanttView {
|
|
|
859
1132
|
const points = [];
|
|
860
1133
|
for (let i = 0; i < days.length; i++) {
|
|
861
1134
|
const start = this.start.addDays(i);
|
|
862
|
-
const point = new GanttDatePoint(start, start.format(this.options.dateFormat.
|
|
1135
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.day || this.options.dateDisplayFormats.primary), (this.getCellWidth() * 24) / 2 + i * (this.getCellWidth() * 24), primaryDatePointTop);
|
|
863
1136
|
points.push(point);
|
|
864
1137
|
}
|
|
865
1138
|
return points;
|
|
@@ -869,7 +1142,7 @@ class GanttViewHour extends GanttView {
|
|
|
869
1142
|
const points = [];
|
|
870
1143
|
for (let i = 0; i < hours.length; i++) {
|
|
871
1144
|
const start = new GanttDate(hours[i]);
|
|
872
|
-
const point = new GanttDatePoint(start, start.format(this.options.dateFormat.
|
|
1145
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.hour || this.options.dateDisplayFormats.secondary), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
|
|
873
1146
|
isWeekend: start.isWeekend(),
|
|
874
1147
|
isToday: start.isToday()
|
|
875
1148
|
});
|
|
@@ -994,12 +1267,67 @@ function keyBy(array, key) {
|
|
|
994
1267
|
return result;
|
|
995
1268
|
}
|
|
996
1269
|
|
|
1270
|
+
const defaultConfig = {
|
|
1271
|
+
locale: GanttI18nLocale.zhHans,
|
|
1272
|
+
linkOptions: {
|
|
1273
|
+
dependencyTypes: [GanttLinkType.fs],
|
|
1274
|
+
showArrow: false,
|
|
1275
|
+
lineType: GanttLinkLineType.curve
|
|
1276
|
+
},
|
|
1277
|
+
styleOptions: {
|
|
1278
|
+
headerHeight: 44,
|
|
1279
|
+
lineHeight: 44,
|
|
1280
|
+
barHeight: 22
|
|
1281
|
+
},
|
|
1282
|
+
dateOptions: {
|
|
1283
|
+
weekStartsOn: 1
|
|
1284
|
+
}
|
|
1285
|
+
};
|
|
1286
|
+
const GANTT_GLOBAL_CONFIG = new InjectionToken('GANTT_GLOBAL_CONFIG');
|
|
1287
|
+
class GanttConfigService {
|
|
1288
|
+
constructor(globalConfig) {
|
|
1289
|
+
const localeId = globalConfig.locale || defaultConfig.locale;
|
|
1290
|
+
this.config = {
|
|
1291
|
+
locale: localeId,
|
|
1292
|
+
dateFormat: Object.assign({}, defaultConfig.dateFormat, globalConfig.dateFormat),
|
|
1293
|
+
styleOptions: Object.assign({}, defaultConfig.styleOptions, globalConfig.styleOptions),
|
|
1294
|
+
linkOptions: Object.assign({}, defaultConfig.linkOptions, globalConfig.linkOptions),
|
|
1295
|
+
dateOptions: Object.assign({}, defaultConfig.dateOptions, globalConfig.dateOptions)
|
|
1296
|
+
};
|
|
1297
|
+
this.i18nLocales = inject(GANTT_I18N_LOCALE_TOKEN).reduce((result, localeConfig) => {
|
|
1298
|
+
result[localeConfig.id] = localeConfig; // 这里使用 `id` 作为 key
|
|
1299
|
+
return result;
|
|
1300
|
+
}, {
|
|
1301
|
+
['zh-cn']: zhHans,
|
|
1302
|
+
['zh-tw']: zhHant
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
getLocaleConfig() {
|
|
1306
|
+
return this.i18nLocales[this.config.locale] ?? this.i18nLocales[this.config.locale.toLowerCase()] ?? zhHans;
|
|
1307
|
+
}
|
|
1308
|
+
getViewsLocale() {
|
|
1309
|
+
return this.getLocaleConfig().views;
|
|
1310
|
+
}
|
|
1311
|
+
getDateLocal() {
|
|
1312
|
+
return this.config.dateOptions?.locale ?? this.getLocaleConfig().dateLocale;
|
|
1313
|
+
}
|
|
1314
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttConfigService, deps: [{ token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1315
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttConfigService, providedIn: 'root' }); }
|
|
1316
|
+
}
|
|
1317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttConfigService, decorators: [{
|
|
1318
|
+
type: Injectable,
|
|
1319
|
+
args: [{ providedIn: 'root' }]
|
|
1320
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1321
|
+
type: Inject,
|
|
1322
|
+
args: [GANTT_GLOBAL_CONFIG]
|
|
1323
|
+
}] }] });
|
|
1324
|
+
|
|
997
1325
|
class GanttUpper {
|
|
998
1326
|
set linkOptions(options) {
|
|
999
1327
|
this._linkOptions = options;
|
|
1000
1328
|
}
|
|
1001
1329
|
get linkOptions() {
|
|
1002
|
-
return Object.assign({},
|
|
1330
|
+
return Object.assign({}, this.configService.config.linkOptions, this._linkOptions);
|
|
1003
1331
|
}
|
|
1004
1332
|
set selectable(value) {
|
|
1005
1333
|
this._selectable = coerceBooleanProperty(value);
|
|
@@ -1026,7 +1354,8 @@ class GanttUpper {
|
|
|
1026
1354
|
get element() {
|
|
1027
1355
|
return this.elementRef.nativeElement;
|
|
1028
1356
|
}
|
|
1029
|
-
constructor(elementRef, cdr, ngZone,
|
|
1357
|
+
constructor(elementRef, cdr, ngZone, // @Inject(GANTT_GLOBAL_CONFIG) public config: GanttGlobalConfig
|
|
1358
|
+
config) {
|
|
1030
1359
|
this.elementRef = elementRef;
|
|
1031
1360
|
this.cdr = cdr;
|
|
1032
1361
|
this.ngZone = ngZone;
|
|
@@ -1044,6 +1373,7 @@ class GanttUpper {
|
|
|
1044
1373
|
viewTypes: [GanttViewType.day, GanttViewType.month, GanttViewType.year]
|
|
1045
1374
|
};
|
|
1046
1375
|
this.viewOptions = {};
|
|
1376
|
+
this.quickTimeFocus = false;
|
|
1047
1377
|
this.loadOnScroll = new EventEmitter();
|
|
1048
1378
|
this.dragStarted = new EventEmitter();
|
|
1049
1379
|
this.dragMoved = new EventEmitter();
|
|
@@ -1051,6 +1381,7 @@ class GanttUpper {
|
|
|
1051
1381
|
this.barClick = new EventEmitter();
|
|
1052
1382
|
this.viewChange = new EventEmitter();
|
|
1053
1383
|
this.expandChange = new EventEmitter();
|
|
1384
|
+
this.configService = inject(GanttConfigService);
|
|
1054
1385
|
this.computeAllRefs = true;
|
|
1055
1386
|
this.linkDragEnded = new EventEmitter();
|
|
1056
1387
|
this.items = [];
|
|
@@ -1065,8 +1396,10 @@ class GanttUpper {
|
|
|
1065
1396
|
}
|
|
1066
1397
|
createView() {
|
|
1067
1398
|
const viewDate = this.getViewDate();
|
|
1068
|
-
this.
|
|
1069
|
-
this.viewOptions.
|
|
1399
|
+
this.styles = Object.assign({}, this.configService.config.styleOptions, this.styles);
|
|
1400
|
+
this.viewOptions.dateFormat = Object.assign({}, this.configService.config.dateFormat, this.viewOptions.dateFormat);
|
|
1401
|
+
this.viewOptions.styleOptions = Object.assign({}, this.configService.config.styleOptions, this.viewOptions.styleOptions);
|
|
1402
|
+
this.viewOptions.dateDisplayFormats = this.configService.getViewsLocale()[this.viewType]?.dateFormats;
|
|
1070
1403
|
this.view = createViewFactory(this.viewType, viewDate.start, viewDate.end, this.viewOptions);
|
|
1071
1404
|
}
|
|
1072
1405
|
setupGroups() {
|
|
@@ -1135,10 +1468,12 @@ class GanttUpper {
|
|
|
1135
1468
|
if (!this.start || !this.end) {
|
|
1136
1469
|
this.originItems.forEach((item) => {
|
|
1137
1470
|
if (item.start && !this.start) {
|
|
1138
|
-
|
|
1471
|
+
const itemStart = item.start instanceof Date ? item.start.getTime() / 1000 : item.start;
|
|
1472
|
+
start = start ? Math.min(start, itemStart) : itemStart;
|
|
1139
1473
|
}
|
|
1140
1474
|
if (item.end && !this.end) {
|
|
1141
|
-
|
|
1475
|
+
const itemEnd = item.start instanceof Date ? item.start.getTime() / 1000 : item.start;
|
|
1476
|
+
end = end ? Math.max(end, itemEnd) : itemEnd;
|
|
1142
1477
|
}
|
|
1143
1478
|
});
|
|
1144
1479
|
}
|
|
@@ -1174,7 +1509,6 @@ class GanttUpper {
|
|
|
1174
1509
|
this.cdr.detectChanges();
|
|
1175
1510
|
}
|
|
1176
1511
|
ngOnInit() {
|
|
1177
|
-
this.styles = Object.assign({}, defaultConfig.styleOptions, this.config.styleOptions, this.styles);
|
|
1178
1512
|
this.createView();
|
|
1179
1513
|
this.setupGroups();
|
|
1180
1514
|
this.setupItems();
|
|
@@ -1295,15 +1629,12 @@ class GanttUpper {
|
|
|
1295
1629
|
rerenderView() {
|
|
1296
1630
|
this.changeView(this.viewType);
|
|
1297
1631
|
}
|
|
1298
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttUpper, deps:
|
|
1299
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], originBaselineItems: ["baselineItems", "originBaselineItems"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", showToolbar: "showToolbar", toolbarOptions: "toolbarOptions", viewOptions: "viewOptions", linkOptions: "linkOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick", viewChange: "viewChange", expandChange: "expandChange" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "baselineTemplate", first: true, predicate: ["baseline"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }, { propertyName: "toolbarTemplate", first: true, predicate: ["toolbar"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0 }); }
|
|
1632
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttUpper, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1633
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], originBaselineItems: ["baselineItems", "originBaselineItems"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", showToolbar: "showToolbar", toolbarOptions: "toolbarOptions", viewOptions: "viewOptions", linkOptions: "linkOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple", quickTimeFocus: "quickTimeFocus" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick", viewChange: "viewChange", expandChange: "expandChange" }, host: { properties: { "class.gantt": "this.ganttClass" } }, queries: [{ propertyName: "barTemplate", first: true, predicate: ["bar"], descendants: true, static: true }, { propertyName: "rangeTemplate", first: true, predicate: ["range"], descendants: true, static: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], descendants: true, static: true }, { propertyName: "baselineTemplate", first: true, predicate: ["baseline"], descendants: true, static: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }, { propertyName: "toolbarTemplate", first: true, predicate: ["toolbar"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0 }); }
|
|
1300
1634
|
}
|
|
1301
1635
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttUpper, decorators: [{
|
|
1302
1636
|
type: Directive
|
|
1303
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined,
|
|
1304
|
-
type: Inject,
|
|
1305
|
-
args: [GANTT_GLOBAL_CONFIG]
|
|
1306
|
-
}] }], propDecorators: { originItems: [{
|
|
1637
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined }], propDecorators: { originItems: [{
|
|
1307
1638
|
type: Input,
|
|
1308
1639
|
args: ['items']
|
|
1309
1640
|
}], originGroups: [{
|
|
@@ -1338,6 +1669,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
1338
1669
|
type: Input
|
|
1339
1670
|
}], multiple: [{
|
|
1340
1671
|
type: Input
|
|
1672
|
+
}], quickTimeFocus: [{
|
|
1673
|
+
type: Input
|
|
1341
1674
|
}], loadOnScroll: [{
|
|
1342
1675
|
type: Output
|
|
1343
1676
|
}], dragStarted: [{
|
|
@@ -1547,6 +1880,7 @@ class GanttDomService {
|
|
|
1547
1880
|
constructor(ngZone, platformId) {
|
|
1548
1881
|
this.ngZone = ngZone;
|
|
1549
1882
|
this.platformId = platformId;
|
|
1883
|
+
this.visibleRangeX = signal({ min: 0, max: 0 });
|
|
1550
1884
|
this.unsubscribe$ = new Subject();
|
|
1551
1885
|
}
|
|
1552
1886
|
monitorScrollChange() {
|
|
@@ -1623,6 +1957,7 @@ class GanttDomService {
|
|
|
1623
1957
|
this.mainScrollbar && scrollObservers.push(fromEvent(this.mainScrollbar, 'scroll', options));
|
|
1624
1958
|
return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
1625
1959
|
.pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
|
|
1960
|
+
this.setVisibleRangeX();
|
|
1626
1961
|
const event = {
|
|
1627
1962
|
target: this.mainContainer,
|
|
1628
1963
|
direction: ScrollDirection.NONE
|
|
@@ -1645,6 +1980,14 @@ class GanttDomService {
|
|
|
1645
1980
|
getResize() {
|
|
1646
1981
|
return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
|
|
1647
1982
|
}
|
|
1983
|
+
getResizeByElement(element) {
|
|
1984
|
+
return new Observable((observer) => {
|
|
1985
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
1986
|
+
observer.next();
|
|
1987
|
+
});
|
|
1988
|
+
resizeObserver.observe(element);
|
|
1989
|
+
});
|
|
1990
|
+
}
|
|
1648
1991
|
scrollMainContainer(left) {
|
|
1649
1992
|
if (isNumber(left)) {
|
|
1650
1993
|
const scrollLeft = left - this.mainContainer.clientWidth / 2;
|
|
@@ -1655,6 +1998,12 @@ class GanttDomService {
|
|
|
1655
1998
|
this.mainFooter && (this.mainFooter.scrollLeft = this.mainContainer.scrollLeft);
|
|
1656
1999
|
}
|
|
1657
2000
|
}
|
|
2001
|
+
setVisibleRangeX() {
|
|
2002
|
+
this.visibleRangeX.set({
|
|
2003
|
+
min: this.mainContainer.scrollLeft,
|
|
2004
|
+
max: this.mainContainer.scrollLeft + this.mainContainer.clientWidth
|
|
2005
|
+
});
|
|
2006
|
+
}
|
|
1658
2007
|
ngOnDestroy() {
|
|
1659
2008
|
this.unsubscribe$.next();
|
|
1660
2009
|
this.unsubscribe$.complete();
|
|
@@ -1752,8 +2101,8 @@ class GanttBarDrag {
|
|
|
1752
2101
|
createMouseEvents() {
|
|
1753
2102
|
if (!this.hasMonitorMouseEvent && (!this.dragDisabled || !this.linkDragDisabled)) {
|
|
1754
2103
|
this.hasMonitorMouseEvent = true;
|
|
1755
|
-
const dropClass = this.ganttUpper.
|
|
1756
|
-
this.ganttUpper.
|
|
2104
|
+
const dropClass = this.ganttUpper.linkOptions?.dependencyTypes?.length === 1 &&
|
|
2105
|
+
this.ganttUpper.linkOptions?.dependencyTypes[0] === GanttLinkType.fs
|
|
1757
2106
|
? singleDropActiveClass
|
|
1758
2107
|
: dropActiveClass;
|
|
1759
2108
|
fromEvent(this.barElement, 'mouseenter', passiveListenerOptions)
|
|
@@ -2659,6 +3008,8 @@ xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
2659
3008
|
</g>
|
|
2660
3009
|
</svg>`;
|
|
2661
3010
|
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>`;
|
|
3011
|
+
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>`;
|
|
3012
|
+
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>`;
|
|
2662
3013
|
const icons = {
|
|
2663
3014
|
'angle-right': angleRight,
|
|
2664
3015
|
'angle-down': angleDown,
|
|
@@ -2666,7 +3017,9 @@ const icons = {
|
|
|
2666
3017
|
'minus-square': minusSquare,
|
|
2667
3018
|
loading: loadingIcon,
|
|
2668
3019
|
empty: emptyIcon,
|
|
2669
|
-
drag: dragIcon
|
|
3020
|
+
drag: dragIcon,
|
|
3021
|
+
'arrow-left': arrowLeftIcon,
|
|
3022
|
+
'arrow-right': arrowRightIcon
|
|
2670
3023
|
};
|
|
2671
3024
|
|
|
2672
3025
|
class GanttIconComponent {
|
|
@@ -3138,6 +3491,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
3138
3491
|
standalone: true
|
|
3139
3492
|
}]
|
|
3140
3493
|
}] });
|
|
3494
|
+
class GanttDateFormatPipe {
|
|
3495
|
+
transform(value, format) {
|
|
3496
|
+
return new GanttDate(value).format(format);
|
|
3497
|
+
}
|
|
3498
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttDateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3499
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: GanttDateFormatPipe, isStandalone: true, name: "dateFormat" }); }
|
|
3500
|
+
}
|
|
3501
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttDateFormatPipe, decorators: [{
|
|
3502
|
+
type: Pipe,
|
|
3503
|
+
args: [{
|
|
3504
|
+
name: 'dateFormat',
|
|
3505
|
+
standalone: true
|
|
3506
|
+
}]
|
|
3507
|
+
}] });
|
|
3141
3508
|
|
|
3142
3509
|
class NgxGanttRangeComponent extends GanttItemUpper {
|
|
3143
3510
|
constructor(elementRef, ganttUpper) {
|
|
@@ -3159,17 +3526,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
3159
3526
|
}] } });
|
|
3160
3527
|
|
|
3161
3528
|
class GanttMainComponent {
|
|
3162
|
-
constructor(ganttUpper) {
|
|
3529
|
+
constructor(ganttUpper, dom, ngZone) {
|
|
3163
3530
|
this.ganttUpper = ganttUpper;
|
|
3531
|
+
this.dom = dom;
|
|
3532
|
+
this.ngZone = ngZone;
|
|
3164
3533
|
this.barClick = new EventEmitter();
|
|
3165
3534
|
this.lineClick = new EventEmitter();
|
|
3166
3535
|
this.ganttMainClass = true;
|
|
3536
|
+
this.unsubscribe$ = new Subject();
|
|
3537
|
+
}
|
|
3538
|
+
ngOnInit() {
|
|
3539
|
+
const onStable$ = this.ngZone.isStable ? from(Promise.resolve()) : this.ngZone.onStable.pipe(take$1(1));
|
|
3540
|
+
this.ngZone.runOutsideAngular(() => {
|
|
3541
|
+
onStable$.pipe(takeUntil$1(this.unsubscribe$)).subscribe(() => {
|
|
3542
|
+
this.setupResize();
|
|
3543
|
+
});
|
|
3544
|
+
});
|
|
3167
3545
|
}
|
|
3168
3546
|
trackBy(index, item) {
|
|
3169
3547
|
return item.id || index;
|
|
3170
3548
|
}
|
|
3171
|
-
|
|
3172
|
-
|
|
3549
|
+
setupResize() {
|
|
3550
|
+
combineLatest([this.dom.getResize(), this.dom.getResizeByElement(this.dom.mainContainer)])
|
|
3551
|
+
.pipe(takeUntil$1(this.unsubscribe$))
|
|
3552
|
+
.subscribe(() => {
|
|
3553
|
+
this.dom.setVisibleRangeX();
|
|
3554
|
+
});
|
|
3555
|
+
}
|
|
3556
|
+
quickTime(item, type) {
|
|
3557
|
+
const date = type === 'left' ? item.start || item.end : item.end || item.start;
|
|
3558
|
+
this.ganttRoot.scrollToDate(date);
|
|
3559
|
+
}
|
|
3560
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: GanttDomService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3561
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: GanttMainComponent, isStandalone: true, selector: "gantt-main", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate", baselineTemplate: "baselineTemplate", ganttRoot: "ganttRoot", quickTimeFocus: "quickTimeFocus" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0, 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 <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [ngClass]=\"data.class\" *ngIf=\"data.items\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n <div\n *ngIf=\"!data.items\"\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n <ng-container *ngIf=\"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 </ng-container>\n\n <ng-container *ngIf=\"(data.type | isGanttRangeItem) || (data.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"data.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n <gantt-bar *ngIf=\"data.type | isGanttBarItem\" [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline\n *ngIf=\"ganttUpper.baselineItemsMap[data.id]\"\n [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"\n [template]=\"baselineTemplate\"\n ></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\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 <ng-container *ngFor=\"let data of viewportItems; let i = index; trackBy: trackBy\">\n <div class=\"gantt-quick-time-focus-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\n <span class=\"ml-2\">\n @if ((data.refs.x < dom.visibleRangeX().min ) && data.refs.width ) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(data.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n\n <span class=\"mr-2\">\n @if((data.refs.x + data.refs.width > dom.visibleRangeX().max) && data.refs.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(data.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n </ng-container>\n </div>\n</div>\n}\n", dependencies: [{ kind: "component", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["flatItems"], outputs: ["lineClick"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { kind: "component", type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }, { kind: "component", type: NgxGanttBaselineComponent, selector: "ngx-gantt-baseline,gantt-baseline", inputs: ["baselineItem", "template"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }, { kind: "pipe", type: IsGanttBarItemPipe, name: "isGanttBarItem" }, { kind: "pipe", type: IsGanttCustomItemPipe, name: "isGanttCustomItem" }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }] }); }
|
|
3173
3562
|
}
|
|
3174
3563
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3175
3564
|
type: Component,
|
|
@@ -3184,12 +3573,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
3184
3573
|
NgxGanttBaselineComponent,
|
|
3185
3574
|
IsGanttRangeItemPipe,
|
|
3186
3575
|
IsGanttBarItemPipe,
|
|
3187
|
-
IsGanttCustomItemPipe
|
|
3188
|
-
|
|
3576
|
+
IsGanttCustomItemPipe,
|
|
3577
|
+
GanttIconComponent
|
|
3578
|
+
], 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 <ng-container *ngFor=\"let data of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [ngClass]=\"data.class\" *ngIf=\"data.items\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n <div\n *ngIf=\"!data.items\"\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n <ng-container *ngIf=\"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 </ng-container>\n\n <ng-container *ngIf=\"(data.type | isGanttRangeItem) || (data.type | isGanttBarItem)\">\n <gantt-range *ngIf=\"data.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n <gantt-bar *ngIf=\"data.type | isGanttBarItem\" [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n <gantt-baseline\n *ngIf=\"ganttUpper.baselineItemsMap[data.id]\"\n [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\"\n [template]=\"baselineTemplate\"\n ></gantt-baseline>\n </ng-container>\n </div>\n </ng-container>\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 <ng-container *ngFor=\"let data of viewportItems; let i = index; trackBy: trackBy\">\n <div class=\"gantt-quick-time-focus-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\n <span class=\"ml-2\">\n @if ((data.refs.x < dom.visibleRangeX().min ) && data.refs.width ) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(data.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n\n <span class=\"mr-2\">\n @if((data.refs.x + data.refs.width > dom.visibleRangeX().max) && data.refs.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(data.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n </ng-container>\n </div>\n</div>\n}\n" }]
|
|
3189
3579
|
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
3190
3580
|
type: Inject,
|
|
3191
3581
|
args: [GANTT_UPPER_TOKEN]
|
|
3192
|
-
}] }], propDecorators: { viewportItems: [{
|
|
3582
|
+
}] }, { type: GanttDomService }, { type: i0.NgZone }], propDecorators: { viewportItems: [{
|
|
3193
3583
|
type: Input
|
|
3194
3584
|
}], flatItems: [{
|
|
3195
3585
|
type: Input
|
|
@@ -3203,6 +3593,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
3203
3593
|
type: Input
|
|
3204
3594
|
}], baselineTemplate: [{
|
|
3205
3595
|
type: Input
|
|
3596
|
+
}], ganttRoot: [{
|
|
3597
|
+
type: Input
|
|
3598
|
+
}], quickTimeFocus: [{
|
|
3599
|
+
type: Input
|
|
3206
3600
|
}], barClick: [{
|
|
3207
3601
|
type: Output
|
|
3208
3602
|
}], lineClick: [{
|
|
@@ -3633,11 +4027,11 @@ class GanttTableBodyComponent {
|
|
|
3633
4027
|
this.document.querySelectorAll('.drop-position-inside').forEach((element) => element.classList.remove('drop-position-inside'));
|
|
3634
4028
|
}
|
|
3635
4029
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttTableBodyComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3636
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: GanttTableBodyComponent, isStandalone: true, selector: "gantt-table-body", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] }); }
|
|
4030
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: GanttTableBodyComponent, isStandalone: true, selector: "gantt-table-body", inputs: { viewportItems: "viewportItems", flatItems: "flatItems", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate", draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", itemClick: "itemClick" }, host: { properties: { "class.gantt-table-draggable": "this.draggable", "class.gantt-table-body": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass", "class.gantt-table-dragging": "this.ganttTableDragging" } }, viewQueries: [{ propertyName: "cdkDrags", predicate: (CdkDrag), descendants: true }], ngImport: i0, template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, current: item.origin, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }] }); }
|
|
3637
4031
|
}
|
|
3638
4032
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
3639
4033
|
type: Component,
|
|
3640
|
-
args: [{ selector: 'gantt-table-body', standalone: true, imports: [CdkDropList, NgIf, GanttIconComponent, NgTemplateOutlet, NgFor, NgClass, CdkDrag, CdkDragHandle, IsGanttRangeItemPipe], template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n" }]
|
|
4034
|
+
args: [{ selector: 'gantt-table-body', standalone: true, imports: [CdkDropList, NgIf, GanttIconComponent, NgTemplateOutlet, NgFor, NgClass, CdkDrag, CdkDragHandle, IsGanttRangeItemPipe], template: "<div\n class=\"gantt-table-body-container\"\n cdkDropList\n [cdkDropListAutoScrollStep]=\"6\"\n [cdkDropListData]=\"viewportItems\"\n [cdkDropListSortingDisabled]=\"true\"\n (cdkDropListDropped)=\"onListDropped($event)\"\n>\n <ng-container *ngIf=\"!viewportItems?.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"viewportItems && viewportItems.length > 0\">\n <ng-container *ngFor=\"let item of viewportItems; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [ngClass]=\"item.class\" *ngIf=\"item.items\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"item.expanded\" (click)=\"expandGroup(item)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ item.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <div\n *ngIf=\"!item.items\"\n (click)=\"itemClick.emit({ event: $event, current: item.origin, selectedValue: item.origin })\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n (cdkDragStarted)=\"onItemDragStarted($event)\"\n (cdkDragEnded)=\"onItemDragEnded($event)\"\n (cdkDragMoved)=\"emitItemDragMoved($event)\"\n class=\"gantt-table-item\"\n [class.gantt-table-item-with-group]=\"hasGroup\"\n [class.gantt-table-item-first-level-group]=\"item.level === 0 && (item.type | isGanttRangeItem)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n\n <div [classList]=\"column.classList\" *ngFor=\"let column of columns; let first = first\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n <gantt-icon\n *ngIf=\"first && draggable\"\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n <!-- expand icon -->\n <div\n *ngIf=\"column?.showExpandIcon || (!hasExpandIcon && first)\"\n class=\"gantt-expand-icon\"\n [style.marginLeft.px]=\"item.level * 20\"\n >\n <ng-container *ngIf=\"item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <!-- column content -->\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </ng-container>\n </ng-container>\n</div>\n" }]
|
|
3641
4035
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
3642
4036
|
type: Inject,
|
|
3643
4037
|
args: [GANTT_ABSTRACT_TOKEN]
|
|
@@ -3697,17 +4091,17 @@ class NgxGanttToolbarComponent {
|
|
|
3697
4091
|
constructor(ganttUpper) {
|
|
3698
4092
|
this.ganttUpper = ganttUpper;
|
|
3699
4093
|
this.ganttItemClass = true;
|
|
3700
|
-
this.
|
|
4094
|
+
this.views = inject(GanttConfigService).getViewsLocale();
|
|
3701
4095
|
}
|
|
3702
4096
|
selectView(view) {
|
|
3703
4097
|
this.ganttUpper.changeView(view);
|
|
3704
4098
|
}
|
|
3705
4099
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttToolbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3706
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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 <ng-container *ngIf=\"!template\">\n <div class=\"toolbar-views\" *ngIf=\"this.ganttUpper.toolbarOptions?.viewTypes?.length\">\n <ng-container *ngFor=\"let
|
|
4100
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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 <ng-container *ngIf=\"!template\">\n <div class=\"toolbar-views\" *ngIf=\"this.ganttUpper.toolbarOptions?.viewTypes?.length\">\n <ng-container *ngFor=\"let viewType of this.ganttUpper.toolbarOptions?.viewTypes\">\n <div\n class=\"toolbar-view\"\n *ngIf=\"views[viewType]\"\n [class.active]=\"viewType === this.ganttUpper.viewType\"\n (click)=\"selectView(viewType)\"\n >\n {{ views[viewType].label }}\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
3707
4101
|
}
|
|
3708
4102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
|
|
3709
4103
|
type: Component,
|
|
3710
|
-
args: [{ selector: 'ngx-gantt-toolbar,gantt-toolbar', standalone: true, imports: [NgIf, NgFor, NgTemplateOutlet], template: "<div class=\"toolbar-container\">\n <ng-container *ngIf=\"!template\">\n <div class=\"toolbar-views\" *ngIf=\"this.ganttUpper.toolbarOptions?.viewTypes?.length\">\n <ng-container *ngFor=\"let
|
|
4104
|
+
args: [{ selector: 'ngx-gantt-toolbar,gantt-toolbar', standalone: true, imports: [NgIf, NgFor, NgTemplateOutlet], template: "<div class=\"toolbar-container\">\n <ng-container *ngIf=\"!template\">\n <div class=\"toolbar-views\" *ngIf=\"this.ganttUpper.toolbarOptions?.viewTypes?.length\">\n <ng-container *ngFor=\"let viewType of this.ganttUpper.toolbarOptions?.viewTypes\">\n <div\n class=\"toolbar-view\"\n *ngIf=\"views[viewType]\"\n [class.active]=\"viewType === this.ganttUpper.viewType\"\n (click)=\"selectView(viewType)\"\n >\n {{ views[viewType].label }}\n </div>\n </ng-container>\n </div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n" }]
|
|
3711
4105
|
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
3712
4106
|
type: Inject,
|
|
3713
4107
|
args: [GANTT_UPPER_TOKEN]
|
|
@@ -3874,7 +4268,7 @@ class NgxGanttRootComponent {
|
|
|
3874
4268
|
this.unsubscribe$.next();
|
|
3875
4269
|
}
|
|
3876
4270
|
setupViewScroll() {
|
|
3877
|
-
if (this.ganttUpper.disabledLoadOnScroll) {
|
|
4271
|
+
if (this.ganttUpper.disabledLoadOnScroll && !this.ganttUpper.quickTimeFocus) {
|
|
3878
4272
|
return;
|
|
3879
4273
|
}
|
|
3880
4274
|
this.dom
|
|
@@ -3923,7 +4317,7 @@ class NgxGanttRootComponent {
|
|
|
3923
4317
|
}
|
|
3924
4318
|
scrollToDate(date) {
|
|
3925
4319
|
let x;
|
|
3926
|
-
if (typeof date === 'number') {
|
|
4320
|
+
if (typeof date === 'number' || date instanceof Date) {
|
|
3927
4321
|
x = this.view.getXPointByDate(new GanttDate(date));
|
|
3928
4322
|
}
|
|
3929
4323
|
else {
|
|
@@ -4016,9 +4410,10 @@ class NgxGanttTableComponent {
|
|
|
4016
4410
|
this.dragStarted = new EventEmitter();
|
|
4017
4411
|
this.dragEnded = new EventEmitter();
|
|
4018
4412
|
this.columnChanges = new EventEmitter();
|
|
4413
|
+
this.itemClick = new EventEmitter();
|
|
4019
4414
|
}
|
|
4020
4415
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4021
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: NgxGanttTableComponent, isStandalone: true, selector: "ngx-gantt-table", inputs: { draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", columnChanges: "columnChanges" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "tableFooterTemplate", first: true, predicate: ["tableFooter"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true }); }
|
|
4416
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: NgxGanttTableComponent, isStandalone: true, selector: "ngx-gantt-table", inputs: { draggable: "draggable", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", columnChanges: "columnChanges", itemClick: "itemClick" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "tableFooterTemplate", first: true, predicate: ["tableFooter"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true }); }
|
|
4022
4417
|
}
|
|
4023
4418
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
|
|
4024
4419
|
type: Component,
|
|
@@ -4039,6 +4434,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4039
4434
|
type: Output
|
|
4040
4435
|
}], columnChanges: [{
|
|
4041
4436
|
type: Output
|
|
4437
|
+
}], itemClick: [{
|
|
4438
|
+
type: Output
|
|
4042
4439
|
}], rowBeforeTemplate: [{
|
|
4043
4440
|
type: ContentChild,
|
|
4044
4441
|
args: ['rowBeforeSlot', { static: true }]
|
|
@@ -4269,6 +4666,10 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4269
4666
|
}
|
|
4270
4667
|
}
|
|
4271
4668
|
selectItem(selectEvent) {
|
|
4669
|
+
this.table.itemClick.emit({
|
|
4670
|
+
event: selectEvent.event,
|
|
4671
|
+
current: selectEvent.current
|
|
4672
|
+
});
|
|
4272
4673
|
if (!this.selectable) {
|
|
4273
4674
|
return;
|
|
4274
4675
|
}
|
|
@@ -4332,7 +4733,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4332
4733
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
4333
4734
|
useExisting: forwardRef(() => NgxGanttComponent)
|
|
4334
4735
|
}
|
|
4335
|
-
], 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 }], usesInheritance: true, usesOnChanges: 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 [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\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\">\n <div class=\"gantt-table\">\n <gantt-table-body\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 [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 [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n [baselineTemplate]=\"baselineTemplate\"\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 <div\n class=\"gantt-footer\"\n *ngIf=\"table?.tableFooterTemplate || footerTemplate\"\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n <div class=\"gantt-table-footer\" [style.width.px]=\"tableHeader.tableWidth + 1\" *ngIf=\"table?.tableFooterTemplate\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n <div class=\"gantt-container-footer\" *ngIf=\"footerTemplate\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n </div>\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: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: GanttScrollbarComponent, selector: "gantt-scrollbar", inputs: ["hasFooter", "tableWidth", "ganttRoot"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4736
|
+
], 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 }], usesInheritance: true, usesOnChanges: 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 [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\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\">\n <div class=\"gantt-table\">\n <gantt-table-body\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 [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 [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 <div\n class=\"gantt-footer\"\n *ngIf=\"table?.tableFooterTemplate || footerTemplate\"\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n <div class=\"gantt-table-footer\" [style.width.px]=\"tableHeader.tableWidth + 1\" *ngIf=\"table?.tableFooterTemplate\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n <div class=\"gantt-container-footer\" *ngIf=\"footerTemplate\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n </div>\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: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4336
4737
|
}
|
|
4337
4738
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
4338
4739
|
type: Component,
|
|
@@ -4360,8 +4761,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4360
4761
|
GanttMainComponent,
|
|
4361
4762
|
GanttDragBackdropComponent,
|
|
4362
4763
|
GanttScrollbarComponent,
|
|
4363
|
-
NgTemplateOutlet
|
|
4364
|
-
|
|
4764
|
+
NgTemplateOutlet,
|
|
4765
|
+
NgFor
|
|
4766
|
+
], 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 [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"></gantt-calendar-header>\n </div>\n </div>\n <gantt-loader *ngIf=\"loading\"></gantt-loader>\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\">\n <div class=\"gantt-table\">\n <gantt-table-body\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 [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 [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 <div\n class=\"gantt-footer\"\n *ngIf=\"table?.tableFooterTemplate || footerTemplate\"\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n <div class=\"gantt-table-footer\" [style.width.px]=\"tableHeader.tableWidth + 1\" *ngIf=\"table?.tableFooterTemplate\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n <div class=\"gantt-container-footer\" *ngIf=\"footerTemplate\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n </div>\n</ngx-gantt-root>\n" }]
|
|
4365
4767
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$1.ViewportRuler }, { type: undefined, decorators: [{
|
|
4366
4768
|
type: Inject,
|
|
4367
4769
|
args: [GANTT_GLOBAL_CONFIG]
|
|
@@ -4410,13 +4812,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4410
4812
|
}] } });
|
|
4411
4813
|
|
|
4412
4814
|
class NgxGanttModule {
|
|
4413
|
-
constructor(
|
|
4815
|
+
constructor() {
|
|
4816
|
+
const configService = inject(GanttConfigService);
|
|
4414
4817
|
setDefaultOptions({
|
|
4415
|
-
locale:
|
|
4416
|
-
weekStartsOn:
|
|
4818
|
+
locale: configService.getDateLocal(),
|
|
4819
|
+
weekStartsOn: configService.config?.dateOptions?.weekStartsOn
|
|
4417
4820
|
});
|
|
4821
|
+
if (configService.config.dateOptions?.timeZone) {
|
|
4822
|
+
setDefaultTimeZone$1(configService.config.dateOptions.timeZone);
|
|
4823
|
+
}
|
|
4418
4824
|
}
|
|
4419
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttModule, deps: [
|
|
4825
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4420
4826
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttModule, imports: [CommonModule,
|
|
4421
4827
|
DragDropModule,
|
|
4422
4828
|
ScrollingModule,
|
|
@@ -4440,7 +4846,8 @@ class NgxGanttModule {
|
|
|
4440
4846
|
GanttScrollbarComponent,
|
|
4441
4847
|
IsGanttRangeItemPipe,
|
|
4442
4848
|
IsGanttBarItemPipe,
|
|
4443
|
-
IsGanttCustomItemPipe
|
|
4849
|
+
IsGanttCustomItemPipe,
|
|
4850
|
+
GanttDateFormatPipe], exports: [NgxGanttComponent,
|
|
4444
4851
|
NgxGanttTableComponent,
|
|
4445
4852
|
NgxGanttTableColumnComponent,
|
|
4446
4853
|
NgxGanttRootComponent,
|
|
@@ -4451,13 +4858,15 @@ class NgxGanttModule {
|
|
|
4451
4858
|
GanttCalendarHeaderComponent,
|
|
4452
4859
|
GanttCalendarGridComponent,
|
|
4453
4860
|
GanttDragBackdropComponent,
|
|
4454
|
-
GanttScrollbarComponent
|
|
4861
|
+
GanttScrollbarComponent,
|
|
4862
|
+
GanttDateFormatPipe] }); }
|
|
4455
4863
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: NgxGanttModule, providers: [
|
|
4456
4864
|
CdkVirtualScrollViewport,
|
|
4457
4865
|
{
|
|
4458
4866
|
provide: GANTT_GLOBAL_CONFIG,
|
|
4459
4867
|
useValue: defaultConfig
|
|
4460
|
-
}
|
|
4868
|
+
},
|
|
4869
|
+
...i18nLocaleProvides
|
|
4461
4870
|
], imports: [CommonModule,
|
|
4462
4871
|
DragDropModule,
|
|
4463
4872
|
ScrollingModule,
|
|
@@ -4490,7 +4899,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4490
4899
|
GanttScrollbarComponent,
|
|
4491
4900
|
IsGanttRangeItemPipe,
|
|
4492
4901
|
IsGanttBarItemPipe,
|
|
4493
|
-
IsGanttCustomItemPipe
|
|
4902
|
+
IsGanttCustomItemPipe,
|
|
4903
|
+
GanttDateFormatPipe
|
|
4494
4904
|
],
|
|
4495
4905
|
exports: [
|
|
4496
4906
|
NgxGanttComponent,
|
|
@@ -4504,22 +4914,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4504
4914
|
GanttCalendarHeaderComponent,
|
|
4505
4915
|
GanttCalendarGridComponent,
|
|
4506
4916
|
GanttDragBackdropComponent,
|
|
4507
|
-
GanttScrollbarComponent
|
|
4917
|
+
GanttScrollbarComponent,
|
|
4918
|
+
GanttDateFormatPipe
|
|
4508
4919
|
],
|
|
4509
4920
|
providers: [
|
|
4510
4921
|
CdkVirtualScrollViewport,
|
|
4511
4922
|
{
|
|
4512
4923
|
provide: GANTT_GLOBAL_CONFIG,
|
|
4513
4924
|
useValue: defaultConfig
|
|
4514
|
-
}
|
|
4925
|
+
},
|
|
4926
|
+
...i18nLocaleProvides
|
|
4515
4927
|
]
|
|
4516
4928
|
}]
|
|
4517
|
-
}], ctorParameters: () => [
|
|
4518
|
-
type: Optional
|
|
4519
|
-
}, {
|
|
4520
|
-
type: Inject,
|
|
4521
|
-
args: [GANTT_GLOBAL_CONFIG]
|
|
4522
|
-
}] }] });
|
|
4929
|
+
}], ctorParameters: () => [] });
|
|
4523
4930
|
|
|
4524
4931
|
/*
|
|
4525
4932
|
* Public API Surface of gantt
|
|
@@ -4529,5 +4936,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
4529
4936
|
* Generated bundle index. Do not edit.
|
|
4530
4937
|
*/
|
|
4531
4938
|
|
|
4532
|
-
export { GANTT_GLOBAL_CONFIG, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttDate, GanttDatePoint, GanttDragBackdropComponent, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttScrollbarComponent, GanttSelectedEvent, GanttTableDragDroppedEvent, GanttTableDragEndedEvent, GanttTableDragEnterPredicateContext, GanttTableDragStartedEvent, GanttTableEvent, GanttUpper, GanttView, GanttViewType, GanttVirtualScrolledIndexChangeEvent, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, defaultConfig,
|
|
4939
|
+
export { GANTT_GLOBAL_CONFIG, GANTT_I18N_LOCALE_TOKEN, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttConfigService, GanttDate, GanttDateFormatPipe, 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, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, deDeLocale, defaultConfig, enUsLocale, jaJpLocale, primaryDatePointTop, registerView, ruRuLocale, secondaryDatePointTop, setDefaultTimeZone, zhHans as zhHansLocale, zhHant as zhHantLocale };
|
|
4533
4940
|
//# sourceMappingURL=worktile-gantt.mjs.map
|