@worktile/gantt 19.0.8-next.5 → 20.0.0-next.1

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.
Files changed (73) hide show
  1. package/components/table/gantt-table.scss +0 -2
  2. package/fesm2022/worktile-gantt.mjs +1407 -1509
  3. package/fesm2022/worktile-gantt.mjs.map +1 -1
  4. package/gantt.component.scss +0 -4
  5. package/index.d.ts +1406 -5
  6. package/package.json +4 -4
  7. package/class/baseline.d.ts +0 -26
  8. package/class/date-point.d.ts +0 -19
  9. package/class/event.d.ts +0 -64
  10. package/class/group.d.ts +0 -22
  11. package/class/index.d.ts +0 -8
  12. package/class/item.d.ts +0 -76
  13. package/class/link.d.ts +0 -54
  14. package/class/toolbar.d.ts +0 -4
  15. package/class/view-type.d.ts +0 -8
  16. package/components/bar/bar-drag.d.ts +0 -78
  17. package/components/bar/bar.component.d.ts +0 -26
  18. package/components/baseline/baseline.component.d.ts +0 -18
  19. package/components/calendar/grid/calendar-grid.component.d.ts +0 -21
  20. package/components/calendar/header/calendar-header.component.d.ts +0 -19
  21. package/components/drag-backdrop/drag-backdrop.component.d.ts +0 -8
  22. package/components/icon/icon.component.d.ts +0 -11
  23. package/components/icon/icons.d.ts +0 -11
  24. package/components/links/lines/curve.d.ts +0 -10
  25. package/components/links/lines/factory.d.ts +0 -5
  26. package/components/links/lines/line.d.ts +0 -8
  27. package/components/links/lines/straight.d.ts +0 -9
  28. package/components/links/links.component.d.ts +0 -37
  29. package/components/loader/loader.component.d.ts +0 -5
  30. package/components/main/gantt-main.component.d.ts +0 -32
  31. package/components/range/range.component.d.ts +0 -10
  32. package/components/scrollbar/scrollbar.component.d.ts +0 -13
  33. package/components/table/body/gantt-table-body.component.d.ts +0 -62
  34. package/components/table/header/gantt-table-header.component.d.ts +0 -35
  35. package/components/toolbar/toolbar.component.d.ts +0 -21
  36. package/directives/sync-scroll.directive.d.ts +0 -22
  37. package/gantt-abstract.d.ts +0 -14
  38. package/gantt-dom.service.d.ts +0 -48
  39. package/gantt-drag-container.d.ts +0 -36
  40. package/gantt-item-upper.d.ts +0 -22
  41. package/gantt-print.service.d.ts +0 -14
  42. package/gantt-sync-scroll.service.d.ts +0 -11
  43. package/gantt-upper.d.ts +0 -101
  44. package/gantt.component.d.ts +0 -66
  45. package/gantt.config.d.ts +0 -50
  46. package/gantt.module.d.ts +0 -29
  47. package/gantt.pipe.d.ts +0 -23
  48. package/gantt.styles.d.ts +0 -9
  49. package/i18n/i18n.d.ts +0 -23
  50. package/i18n/index.d.ts +0 -10
  51. package/i18n/locales/de-de.d.ts +0 -49
  52. package/i18n/locales/en-us.d.ts +0 -48
  53. package/i18n/locales/ja-jp.d.ts +0 -48
  54. package/i18n/locales/ru-ru.d.ts +0 -49
  55. package/i18n/locales/zh-hans.d.ts +0 -48
  56. package/i18n/locales/zh-hant.d.ts +0 -48
  57. package/public-api.d.ts +0 -26
  58. package/root.component.d.ts +0 -36
  59. package/table/gantt-column.component.d.ts +0 -17
  60. package/table/gantt-table.component.d.ts +0 -22
  61. package/utils/date.d.ts +0 -66
  62. package/utils/drag-scroll.d.ts +0 -27
  63. package/utils/helpers.d.ts +0 -15
  64. package/utils/passive-listeners.d.ts +0 -13
  65. package/utils/set-style-with-vendor-prefix.d.ts +0 -12
  66. package/views/day.d.ts +0 -16
  67. package/views/factory.d.ts +0 -10
  68. package/views/hour.d.ts +0 -19
  69. package/views/month.d.ts +0 -14
  70. package/views/quarter.d.ts +0 -14
  71. package/views/view.d.ts +0 -97
  72. package/views/week.d.ts +0 -14
  73. package/views/year.d.ts +0 -14
@@ -1,18 +1,16 @@
1
- import { fromUnixTime, getWeek, getDaysInMonth, differenceInCalendarDays, setDate, addSeconds, addMinutes, addHours, addDays, addWeeks, addMonths, addQuarters, addYears, startOfMinute, startOfHour, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfMinute, endOfHour, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, getUnixTime, format, isWeekend, isToday, setDefaultOptions, differenceInHours, differenceInMinutes, differenceInDays, eachWeekOfInterval, eachDayOfInterval, eachHourOfInterval, differenceInCalendarQuarters, eachMonthOfInterval, eachYearOfInterval, differenceInCalendarYears } from 'date-fns';
1
+ import { DragDrop, CdkDrag, CdkDropList, CdkDragHandle, DragDropModule } from '@angular/cdk/drag-drop';
2
+ import { CdkScrollable, ViewportRuler, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, ScrollingModule } from '@angular/cdk/scrolling';
3
+ import { isPlatformServer, NgTemplateOutlet, NgStyle, NgClass, CommonModule } from '@angular/common';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, NgZone, PLATFORM_ID, signal, Injectable, InjectionToken, ElementRef, ChangeDetectorRef, EventEmitter, HostBinding, ContentChild, Output, Input, Directive, effect, ViewChildren, ViewChild, Component, Inject, Pipe, input, DOCUMENT, HostListener, forwardRef, ContentChildren, ChangeDetectionStrategy, NgModule } from '@angular/core';
6
+ import { BehaviorSubject, Subject, fromEvent, Observable, merge, EMPTY, from, interval, animationFrameScheduler, take as take$1, takeUntil as takeUntil$1, combineLatest, startWith as startWith$1, auditTime as auditTime$1, filter } from 'rxjs';
7
+ import { takeUntil, map, pairwise, auditTime, take, skip, startWith, switchMap, debounceTime, finalize } from 'rxjs/operators';
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';
2
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';
3
10
  import { TZDate } from '@date-fns/tz';
4
- import { BehaviorSubject, Subject, from, fromEvent, Observable, merge, EMPTY, interval, animationFrameScheduler, takeUntil as takeUntil$1, take as take$1, combineLatest, startWith as startWith$1, auditTime as auditTime$1, filter } from 'rxjs';
5
- import { isPlatformServer, NgTemplateOutlet, NgStyle, NgClass, DOCUMENT, CommonModule } from '@angular/common';
6
- import * as i0 from '@angular/core';
7
- import { InjectionToken, inject, Inject, Injectable, EventEmitter, HostBinding, ContentChild, Output, Input, Directive, signal, PLATFORM_ID, effect, ViewChildren, ViewChild, Component, NgZone, input, ElementRef, Pipe, HostListener, Optional, forwardRef, ContentChildren, ChangeDetectionStrategy, NgModule } from '@angular/core';
8
- import { take, takeUntil, skip, map, pairwise, auditTime, startWith, switchMap, debounceTime, finalize } from 'rxjs/operators';
9
- import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
10
- import { SelectionModel } from '@angular/cdk/collections';
11
11
  import { de, ru } from 'date-fns/locale';
12
- import * as i1 from '@angular/cdk/drag-drop';
13
- import { CdkDrag, CdkDropList, CdkDragHandle, DragDropModule } from '@angular/cdk/drag-drop';
14
- import * as i1$1 from '@angular/cdk/scrolling';
15
- import { CdkScrollable, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, ScrollingModule } from '@angular/cdk/scrolling';
12
+ import { SelectionModel } from '@angular/cdk/collections';
13
+ import { coerceBooleanProperty, coerceCssPixelValue } from '@angular/cdk/coercion';
16
14
  import { __decorate, __param } from 'tslib';
17
15
 
18
16
  class GanttDatePoint {
@@ -378,186 +376,6 @@ class GanttBaselineItemInternal {
378
376
  }
379
377
  }
380
378
 
381
- const sideWidth = 400;
382
- const sideMiddleWidth = 500;
383
- const sideMaxWidth = 600;
384
- const sideMinWidth = 400;
385
- const barBackground = '#6698ff';
386
- const rangeHeight = 17;
387
- const todayHeight = 24;
388
- const todayWidth = 35;
389
- const todayBorderRadius = 4;
390
-
391
- var GanttI18nLocale;
392
- (function (GanttI18nLocale) {
393
- GanttI18nLocale["zhHans"] = "zh-hans";
394
- GanttI18nLocale["zhHant"] = "zh-hant";
395
- GanttI18nLocale["enUs"] = "en-us";
396
- GanttI18nLocale["deDe"] = "de-de";
397
- GanttI18nLocale["jaJp"] = "ja-jp";
398
- GanttI18nLocale["ruRu"] = "ru-ru";
399
- })(GanttI18nLocale || (GanttI18nLocale = {}));
400
- const GANTT_I18N_LOCALE_TOKEN = new InjectionToken('gantt-i18n-locale');
401
-
402
- var zhHansLocale = {
403
- id: GanttI18nLocale.zhHans,
404
- views: {
405
- [GanttViewType.hour]: {
406
- label: '小时',
407
- dateFormats: {
408
- primary: 'M月d日',
409
- secondary: 'HH:mm'
410
- }
411
- },
412
- [GanttViewType.day]: {
413
- label: '天',
414
- dateFormats: {
415
- primary: 'yyyy年MM月',
416
- secondary: 'd'
417
- }
418
- },
419
- [GanttViewType.week]: {
420
- label: '周',
421
- dateFormats: {
422
- primary: 'yyyy年',
423
- secondary: '第w周'
424
- }
425
- },
426
- [GanttViewType.month]: {
427
- label: '月',
428
- dateFormats: {
429
- primary: `yyyy年'Q'Q`,
430
- secondary: 'M月'
431
- }
432
- },
433
- [GanttViewType.quarter]: {
434
- label: '季',
435
- dateFormats: {
436
- primary: 'yyyy年',
437
- secondary: `yyyy年'Q'Q`
438
- }
439
- },
440
- [GanttViewType.year]: {
441
- label: '年',
442
- dateFormats: {
443
- secondary: 'yyyy年'
444
- }
445
- }
446
- }
447
- };
448
-
449
- var zhHantLocale = {
450
- id: GanttI18nLocale.zhHant,
451
- views: {
452
- [GanttViewType.hour]: {
453
- label: '小時',
454
- dateFormats: {
455
- primary: 'M月d日',
456
- secondary: 'HH:mm'
457
- }
458
- },
459
- [GanttViewType.day]: {
460
- label: '天',
461
- dateFormats: {
462
- primary: 'yyyy年MM月',
463
- secondary: 'd'
464
- }
465
- },
466
- [GanttViewType.week]: {
467
- label: '週',
468
- dateFormats: {
469
- primary: 'yyyy年',
470
- secondary: '第w週'
471
- }
472
- },
473
- [GanttViewType.month]: {
474
- label: '月',
475
- dateFormats: {
476
- primary: `yyyy年'Q'Q`,
477
- secondary: 'M月'
478
- }
479
- },
480
- [GanttViewType.quarter]: {
481
- label: '季',
482
- dateFormats: {
483
- primary: 'yyyy年',
484
- secondary: `yyyy年'Q'Q`
485
- }
486
- },
487
- [GanttViewType.year]: {
488
- label: '年',
489
- dateFormats: {
490
- secondary: 'yyyy年'
491
- }
492
- }
493
- }
494
- };
495
-
496
- const defaultConfig = {
497
- locale: GanttI18nLocale.zhHans,
498
- linkOptions: {
499
- dependencyTypes: [GanttLinkType.fs],
500
- showArrow: false,
501
- lineType: GanttLinkLineType.curve
502
- },
503
- styleOptions: {
504
- headerHeight: 44,
505
- lineHeight: 44,
506
- barHeight: 22
507
- },
508
- dateOptions: {
509
- weekStartsOn: 1
510
- }
511
- };
512
- const GANTT_GLOBAL_CONFIG = new InjectionToken('GANTT_GLOBAL_CONFIG');
513
- class GanttConfigService {
514
- constructor(globalConfig) {
515
- const localeId = globalConfig.locale || defaultConfig.locale;
516
- this.config = {
517
- locale: localeId,
518
- dateFormat: Object.assign({}, defaultConfig.dateFormat, globalConfig.dateFormat),
519
- styleOptions: Object.assign({}, defaultConfig.styleOptions, globalConfig.styleOptions),
520
- linkOptions: Object.assign({}, defaultConfig.linkOptions, globalConfig.linkOptions),
521
- dateOptions: Object.assign({}, defaultConfig.dateOptions, globalConfig.dateOptions)
522
- };
523
- this.i18nLocales = inject(GANTT_I18N_LOCALE_TOKEN).reduce((result, localeConfig) => {
524
- result[localeConfig.id] = localeConfig; // 这里使用 `id` 作为 key
525
- return result;
526
- }, {
527
- ['zh-cn']: zhHansLocale,
528
- ['zh-tw']: zhHantLocale
529
- });
530
- if (this.config.dateOptions?.timeZone) {
531
- setDefaultTimeZone(this.config.dateOptions.timeZone);
532
- }
533
- setDefaultOptions({
534
- locale: this.getDateLocale(),
535
- weekStartsOn: this.config?.dateOptions?.weekStartsOn
536
- });
537
- }
538
- setLocale(locale) {
539
- this.config.locale = locale;
540
- }
541
- getLocaleConfig() {
542
- return this.i18nLocales[this.config.locale] ?? this.i18nLocales[this.config.locale.toLowerCase()] ?? zhHansLocale;
543
- }
544
- getViewsLocale() {
545
- return this.getLocaleConfig().views;
546
- }
547
- getDateLocale() {
548
- return this.config.dateOptions?.locale ?? this.getLocaleConfig().dateLocale;
549
- }
550
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, deps: [{ token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
551
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, providedIn: 'root' }); }
552
- }
553
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttConfigService, decorators: [{
554
- type: Injectable,
555
- args: [{ providedIn: 'root' }]
556
- }], ctorParameters: () => [{ type: undefined, decorators: [{
557
- type: Inject,
558
- args: [GANTT_GLOBAL_CONFIG]
559
- }] }] });
560
-
561
379
  function isNumber(value) {
562
380
  return typeof value === 'number';
563
381
  }
@@ -631,204 +449,118 @@ function keyBy(array, key) {
631
449
  return result;
632
450
  }
633
451
 
634
- var enUsLocale = {
635
- id: GanttI18nLocale.enUs,
636
- views: {
637
- [GanttViewType.hour]: {
638
- label: 'Hourly',
639
- dateFormats: {
640
- primary: 'MMM d',
641
- secondary: 'HH:mm'
642
- }
643
- },
644
- [GanttViewType.day]: {
645
- label: 'Daily',
646
- dateFormats: {
647
- primary: 'MMM yyyy',
648
- secondary: 'd'
649
- }
650
- },
651
- [GanttViewType.week]: {
652
- label: 'Weekly',
653
- dateFormats: {
654
- primary: 'yyyy',
655
- secondary: 'wo'
656
- }
657
- },
658
- [GanttViewType.month]: {
659
- label: 'Monthly',
660
- dateFormats: {
661
- primary: "yyyy 'Q'Q",
662
- secondary: 'MMM'
663
- }
664
- },
665
- [GanttViewType.quarter]: {
666
- label: 'Quarterly',
667
- dateFormats: {
668
- primary: 'yyyy',
669
- secondary: "yyyy 'Q'Q"
670
- }
671
- },
672
- [GanttViewType.year]: {
673
- label: 'Yearly',
674
- dateFormats: {
675
- secondary: 'yyyy'
676
- }
677
- }
452
+ const scrollThreshold = 50;
453
+ var ScrollDirection;
454
+ (function (ScrollDirection) {
455
+ ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
456
+ ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
457
+ ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
458
+ })(ScrollDirection || (ScrollDirection = {}));
459
+ class GanttDomService {
460
+ constructor() {
461
+ this.ngZone = inject(NgZone);
462
+ this.platformId = inject(PLATFORM_ID);
463
+ this.visibleRangeX = signal({ min: 0, max: 0 }, ...(ngDevMode ? [{ debugName: "visibleRangeX" }] : []));
464
+ this.unsubscribe$ = new Subject();
678
465
  }
679
- };
680
-
681
- var jaJpLocale = {
682
- id: GanttI18nLocale.jaJp,
683
- views: {
684
- [GanttViewType.hour]: {
685
- label: '毎時',
686
- dateFormats: {
687
- primary: 'M月d日',
688
- secondary: 'HH:mm'
466
+ disableBrowserWheelEvent() {
467
+ const container = this.mainContainer;
468
+ this.ngZone.runOutsideAngular(() => fromEvent(container, 'wheel')
469
+ .pipe(takeUntil(this.unsubscribe$))
470
+ .subscribe((event) => {
471
+ const delta = event.deltaX;
472
+ if (!delta) {
473
+ return;
689
474
  }
690
- },
691
- [GanttViewType.day]: {
692
- label: '日',
693
- dateFormats: {
694
- primary: 'yyyy年M月d日',
695
- secondary: 'd'
475
+ if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
476
+ (container.scrollLeft === 0 && delta < 0)) {
477
+ event.preventDefault();
696
478
  }
697
- },
698
- [GanttViewType.week]: {
699
- label: '週',
700
- dateFormats: {
701
- primary: 'yyyy年',
702
- secondary: '第w週'
703
- }
704
- },
705
- [GanttViewType.month]: {
706
- label: '月',
707
- dateFormats: {
708
- primary: `yyyy年M月`,
709
- secondary: 'M月'
710
- }
711
- },
712
- [GanttViewType.quarter]: {
713
- label: '四半期',
714
- dateFormats: {
715
- primary: 'yyyy年',
716
- secondary: `yyyy年第Q四半期`
717
- }
718
- },
719
- [GanttViewType.year]: {
720
- label: '年',
721
- dateFormats: {
722
- secondary: 'yyyy年'
723
- }
724
- }
479
+ }));
725
480
  }
726
- };
727
-
728
- var deDeLocale = {
729
- id: GanttI18nLocale.deDe,
730
- dateLocale: de,
731
- views: {
732
- [GanttViewType.hour]: {
733
- label: 'Stündlich',
734
- dateFormats: {
735
- primary: 'dd. MMM',
736
- secondary: 'HH:mm'
737
- }
738
- },
739
- [GanttViewType.day]: {
740
- label: 'Täglich',
741
- dateFormats: {
742
- primary: 'MMM yyyy',
743
- secondary: 'd'
744
- }
745
- },
746
- [GanttViewType.week]: {
747
- label: 'Wöchentlich',
748
- dateFormats: {
749
- primary: 'yyyy',
750
- secondary: `w. 'Woche'`
751
- }
752
- },
753
- [GanttViewType.month]: {
754
- label: 'Monatlich',
755
- dateFormats: {
756
- primary: 'MMM yyyy',
757
- secondary: 'MMM'
758
- }
759
- },
760
- [GanttViewType.quarter]: {
761
- label: 'Vierteljährlich',
762
- dateFormats: {
763
- primary: 'yyyy',
764
- secondary: `Q. 'Quartal' yyyy`
765
- }
766
- },
767
- [GanttViewType.year]: {
768
- label: 'Jährlich',
769
- dateFormats: {
770
- secondary: 'yyyy'
771
- }
772
- }
481
+ initialize(root) {
482
+ this.root = root.nativeElement;
483
+ this.side = this.root.getElementsByClassName('gantt-side')[0];
484
+ this.container = this.root.getElementsByClassName('gantt-container')[0];
485
+ this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
486
+ this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
487
+ this.mainScrollbar = this.root.getElementsByClassName('gantt-main-scrollbar')[0];
488
+ this.mainFooter = this.root.getElementsByClassName('gantt-container-footer')[0];
489
+ this.verticalScrollContainer = this.root.getElementsByClassName('gantt-scroll-container')[0];
490
+ const mainItems = this.mainContainer.getElementsByClassName('gantt-main-items')[0];
491
+ const mainGroups = this.mainContainer.getElementsByClassName('gantt-main-groups')[0];
492
+ this.mainItems = mainItems || mainGroups;
493
+ this.calendarHeader = this.root.getElementsByClassName('gantt-calendar-header')[0];
494
+ this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-grid')[0];
495
+ this.disableBrowserWheelEvent();
773
496
  }
774
- };
775
-
776
- var ruRuLocale = {
777
- id: GanttI18nLocale.ruRu,
778
- dateLocale: ru,
779
- views: {
780
- [GanttViewType.hour]: {
781
- label: 'Ежечасно',
782
- dateFormats: {
783
- primary: 'd MMM',
784
- secondary: 'HH:mm'
785
- }
786
- },
787
- [GanttViewType.day]: {
788
- label: 'Ежедневно',
789
- dateFormats: {
790
- primary: 'MMMM yyyy',
791
- secondary: 'd'
792
- }
793
- },
794
- [GanttViewType.week]: {
795
- label: 'Еженедельно',
796
- dateFormats: {
797
- primary: 'yyyy',
798
- secondary: 'Неделя w'
799
- }
800
- },
801
- [GanttViewType.month]: {
802
- label: 'Ежемесячно',
803
- dateFormats: {
804
- primary: 'MMMM yyyy',
805
- secondary: 'MMM'
806
- }
807
- },
808
- [GanttViewType.quarter]: {
809
- label: 'Ежеквартально',
810
- dateFormats: {
811
- primary: 'yyyy',
812
- secondary: 'Квартал Q yyyy'
497
+ /**
498
+ * @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
499
+ * to run the change detection if needed.
500
+ */
501
+ getViewerScroll(options) {
502
+ const scrollObservers = [fromEvent(this.mainContainer, 'scroll', options)];
503
+ this.mainFooter && scrollObservers.push(fromEvent(this.mainFooter, 'scroll', options));
504
+ this.mainScrollbar && scrollObservers.push(fromEvent(this.mainScrollbar, 'scroll', options));
505
+ return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
506
+ .pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
507
+ this.setVisibleRangeX();
508
+ const event = {
509
+ target: this.mainContainer,
510
+ direction: ScrollDirection.NONE
511
+ };
512
+ if (current - previous < 0) {
513
+ if (this.mainContainer.scrollLeft < scrollThreshold && this.mainContainer.scrollLeft > 0) {
514
+ event.direction = ScrollDirection.LEFT;
515
+ }
813
516
  }
814
- },
815
- [GanttViewType.year]: {
816
- label: 'Ежегодно',
817
- dateFormats: {
818
- secondary: 'yyyy'
517
+ if (current - previous > 0) {
518
+ if (this.mainContainer.scrollWidth - this.mainContainer.clientWidth - this.mainContainer.scrollLeft <
519
+ scrollThreshold) {
520
+ event.direction = ScrollDirection.RIGHT;
521
+ }
819
522
  }
523
+ return event;
524
+ }))
525
+ .subscribe(subscriber)));
526
+ }
527
+ getResize() {
528
+ return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
529
+ }
530
+ getResizeByElement(element) {
531
+ return new Observable((observer) => {
532
+ const resizeObserver = new ResizeObserver(() => {
533
+ observer.next();
534
+ });
535
+ resizeObserver.observe(element);
536
+ });
537
+ }
538
+ scrollMainContainer(left) {
539
+ if (isNumber(left)) {
540
+ const scrollLeft = left - this.mainContainer.clientWidth / 2;
541
+ this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
542
+ this.calendarHeader.scrollLeft = this.mainContainer.scrollLeft;
543
+ this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
544
+ this.mainScrollbar && (this.mainScrollbar.scrollLeft = this.mainContainer.scrollLeft);
545
+ this.mainFooter && (this.mainFooter.scrollLeft = this.mainContainer.scrollLeft);
820
546
  }
821
547
  }
822
- };
823
-
824
- const i18nLocaleProvides = [
825
- { provide: GANTT_I18N_LOCALE_TOKEN, useValue: zhHansLocale, multi: true },
826
- { provide: GANTT_I18N_LOCALE_TOKEN, useValue: zhHantLocale, multi: true },
827
- { provide: GANTT_I18N_LOCALE_TOKEN, useValue: enUsLocale, multi: true },
828
- { provide: GANTT_I18N_LOCALE_TOKEN, useValue: jaJpLocale, multi: true },
829
- { provide: GANTT_I18N_LOCALE_TOKEN, useValue: deDeLocale, multi: true },
830
- { provide: GANTT_I18N_LOCALE_TOKEN, useValue: ruRuLocale, multi: true }
831
- ];
548
+ setVisibleRangeX() {
549
+ this.visibleRangeX.set({
550
+ min: this.mainContainer.scrollLeft,
551
+ max: this.mainContainer.scrollLeft + this.mainContainer.clientWidth
552
+ });
553
+ }
554
+ ngOnDestroy() {
555
+ this.unsubscribe$.next();
556
+ this.unsubscribe$.complete();
557
+ }
558
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDomService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
559
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDomService }); }
560
+ }
561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDomService, decorators: [{
562
+ type: Injectable
563
+ }], ctorParameters: () => [] });
832
564
 
833
565
  const primaryDatePointTop = '40%';
834
566
  const secondaryDatePointTop = '80%';
@@ -873,9 +605,6 @@ class GanttView {
873
605
  endOf(date) {
874
606
  return this.viewEndOf(date);
875
607
  }
876
- hideHoliday(date) {
877
- return this.options.hoilday?.hideHoliday && this.options.hoilday?.isHoliday?.(date);
878
- }
879
608
  startOfPrecision(date) {
880
609
  switch (this.options.datePrecisionUnit) {
881
610
  case 'minute':
@@ -916,10 +645,10 @@ class GanttView {
916
645
  return Number(result.toFixed(3));
917
646
  }
918
647
  initialize() {
919
- this.cellWidth = this.getCellWidth();
920
648
  this.primaryDatePoints = this.getPrimaryDatePoints();
921
649
  this.secondaryDatePoints = this.getSecondaryDatePoints();
922
650
  this.width = this.getWidth();
651
+ this.cellWidth = this.getCellWidth();
923
652
  this.primaryWidth = this.getPrimaryWidth();
924
653
  }
925
654
  addStartDate() {
@@ -1005,198 +734,323 @@ class GanttView {
1005
734
  return this.getDayOccupancyWidth(date);
1006
735
  }
1007
736
  }
1008
- /**
1009
- * 根据起始日期和宽度计算结束日期
1010
- * @param start 起始日期
1011
- * @param width 视觉宽度
1012
- * @returns 结束日期
1013
- */
1014
- getEndDateByWidth(start, width) {
1015
- const startX = this.getXPointByDate(start);
1016
- // 减去偏移量避免因为 getDateRangeWidth 加了 1 秒而多算一天
1017
- const endX = startX + width - 0.1;
1018
- return this.getDateByXPoint(endX);
1019
- }
1020
737
  }
1021
738
 
1022
- const viewOptions$5 = {
1023
- cellWidth: 35,
1024
- start: new GanttDate().startOfYear().startOfWeek(),
1025
- end: new GanttDate().endOfYear().endOfWeek(),
1026
- addAmount: 1,
1027
- addUnit: 'month',
1028
- dateDisplayFormats: zhHantLocale.views.day.dateFormats
1029
- };
1030
- class GanttViewDay extends GanttView {
1031
- constructor(start, end, options) {
1032
- super(start, end, Object.assign({}, viewOptions$5, options));
1033
- this.showTimeline = false;
1034
- this.viewType = GanttViewType.day;
1035
- }
1036
- viewStartOf(date) {
1037
- return date.startOfWeek();
1038
- }
1039
- viewEndOf(date) {
1040
- return date.endOfWeek();
1041
- }
1042
- getPrimaryWidth() {
1043
- return this.getCellWidth() * 7;
1044
- }
1045
- getDayOccupancyWidth(date) {
1046
- if (this.hideHoliday(date)) {
1047
- return 0;
1048
- }
1049
- return this.cellWidth;
1050
- }
1051
- getPrimaryDatePoints() {
1052
- const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
1053
- const points = [];
1054
- for (let i = 0; i < weeks.length; i++) {
1055
- const weekStart = new GanttDate(weeks[i]);
1056
- const weekEnd = weekStart.addWeeks(1);
1057
- const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
1058
- const pointWidth = this.getDateIntervalWidth(weekStart, weekEnd);
1059
- const lastPoint = points[points.length - 1];
1060
- const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.yearMonth || this.options.dateDisplayFormats.primary), pointWidth / 2 + (lastPoint?.rightX || 0), primaryDatePointTop);
1061
- point.leftX = lastPoint?.rightX || 0;
1062
- point.rightX = point.leftX + pointWidth;
1063
- points.push(point);
1064
- }
1065
- return points;
1066
- }
1067
- getSecondaryDatePoints() {
1068
- const days = eachDayOfInterval({ start: this.start.value, end: this.end.value }).filter((day) => !this.hideHoliday(new GanttDate(day)));
1069
- const points = [];
1070
- for (let i = 0; i < days.length; i++) {
1071
- const start = new GanttDate(days[i]);
1072
- const point = new GanttDatePoint(start, start.format(this.options.dateDisplayFormats.secondary) || start.getDate().toString(), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
1073
- isWeekend: start.isWeekend(),
1074
- isToday: start.isToday()
1075
- });
1076
- points.push(point);
1077
- }
1078
- return points;
1079
- }
1080
- getEndDateByWidth(start, width) {
1081
- if (!this.options.hoilday?.hideHoliday) {
1082
- return super.getEndDateByWidth(start, width);
1083
- }
1084
- // 通过宽度计算包含多少个工作日(每个工作日的宽度是 cellWidth)
1085
- const workingDaysCount = Math.round(width / this.getCellWidth());
1086
- let end = start;
1087
- let addedWorkingDays = 0;
1088
- let attempts = 0;
1089
- const maxAttempts = 365;
1090
- while (addedWorkingDays < workingDaysCount && attempts < maxAttempts) {
1091
- if (this.getDayOccupancyWidth(end) > 0) {
1092
- addedWorkingDays++;
1093
- if (addedWorkingDays < workingDaysCount) {
1094
- end = end.addDays(1);
1095
- }
739
+ var GanttI18nLocale;
740
+ (function (GanttI18nLocale) {
741
+ GanttI18nLocale["zhHans"] = "zh-hans";
742
+ GanttI18nLocale["zhHant"] = "zh-hant";
743
+ GanttI18nLocale["enUs"] = "en-us";
744
+ GanttI18nLocale["deDe"] = "de-de";
745
+ GanttI18nLocale["jaJp"] = "ja-jp";
746
+ GanttI18nLocale["ruRu"] = "ru-ru";
747
+ })(GanttI18nLocale || (GanttI18nLocale = {}));
748
+ const GANTT_I18N_LOCALE_TOKEN = new InjectionToken('gantt-i18n-locale');
749
+
750
+ var zhHans = {
751
+ id: GanttI18nLocale.zhHans,
752
+ views: {
753
+ [GanttViewType.hour]: {
754
+ label: '小时',
755
+ dateFormats: {
756
+ primary: 'M月d日',
757
+ secondary: 'HH:mm'
1096
758
  }
1097
- else {
1098
- end = end.addDays(1);
759
+ },
760
+ [GanttViewType.day]: {
761
+ label: '天',
762
+ dateFormats: {
763
+ primary: 'yyyy年MM月',
764
+ secondary: 'd'
765
+ }
766
+ },
767
+ [GanttViewType.week]: {
768
+ label: '周',
769
+ dateFormats: {
770
+ primary: 'yyyy年',
771
+ secondary: '第w周'
772
+ }
773
+ },
774
+ [GanttViewType.month]: {
775
+ label: '月',
776
+ dateFormats: {
777
+ primary: `yyyy年'Q'Q`,
778
+ secondary: 'M月'
779
+ }
780
+ },
781
+ [GanttViewType.quarter]: {
782
+ label: '季',
783
+ dateFormats: {
784
+ primary: 'yyyy年',
785
+ secondary: `yyyy年'Q'Q`
786
+ }
787
+ },
788
+ [GanttViewType.year]: {
789
+ label: '年',
790
+ dateFormats: {
791
+ secondary: 'yyyy年'
1099
792
  }
1100
- attempts++;
1101
793
  }
1102
- return end;
1103
794
  }
1104
- }
1105
-
1106
- const viewOptions$4 = {
1107
- cellWidth: 80,
1108
- start: new GanttDate().startOfMonth(),
1109
- end: new GanttDate().endOfMonth(),
1110
- datePrecisionUnit: 'minute',
1111
- addAmount: 1,
1112
- addUnit: 'week',
1113
- dateDisplayFormats: zhHantLocale.views.hour.dateFormats,
1114
- dragPreviewDateFormat: 'HH:mm'
1115
795
  };
1116
- class GanttViewHour extends GanttView {
1117
- constructor(start, end, options) {
1118
- super(start, end, Object.assign({}, viewOptions$4, options));
1119
- this.showTimeline = true;
1120
- this.viewType = GanttViewType.hour;
1121
- }
1122
- viewStartOf(date) {
1123
- return date.startOfWeek();
1124
- }
1125
- viewEndOf(date) {
1126
- return date.endOfWeek();
1127
- }
1128
- getPrimaryWidth() {
1129
- return this.getCellWidth() * 24;
1130
- }
1131
- getDayOccupancyWidth() {
1132
- return this.cellWidth * 60;
1133
- }
1134
- getHourOccupancyWidth() {
1135
- return this.getDayOccupancyWidth() / 60;
1136
- }
1137
- getPrimaryDatePoints() {
1138
- const days = eachDayOfInterval({ start: this.start.value, end: this.end.value });
1139
- const points = [];
1140
- for (let i = 0; i < days.length; i++) {
1141
- const start = this.start.addDays(i);
1142
- const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.day || this.options.dateDisplayFormats.primary), (this.getCellWidth() * 24) / 2 + i * (this.getCellWidth() * 24), primaryDatePointTop);
1143
- points.push(point);
796
+
797
+ var zhHant = {
798
+ id: GanttI18nLocale.zhHant,
799
+ views: {
800
+ [GanttViewType.hour]: {
801
+ label: '小時',
802
+ dateFormats: {
803
+ primary: 'M月d日',
804
+ secondary: 'HH:mm'
805
+ }
806
+ },
807
+ [GanttViewType.day]: {
808
+ label: '天',
809
+ dateFormats: {
810
+ primary: 'yyyy年MM月',
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: `yyyy年'Q'Q`,
825
+ secondary: 'M月'
826
+ }
827
+ },
828
+ [GanttViewType.quarter]: {
829
+ label: '季',
830
+ dateFormats: {
831
+ primary: 'yyyy年',
832
+ secondary: `yyyy年'Q'Q`
833
+ }
834
+ },
835
+ [GanttViewType.year]: {
836
+ label: '年',
837
+ dateFormats: {
838
+ secondary: 'yyyy年'
839
+ }
1144
840
  }
1145
- return points;
1146
841
  }
1147
- getSecondaryDatePoints() {
1148
- const hours = eachHourOfInterval({ start: this.start.value, end: this.end.value });
1149
- const points = [];
1150
- for (let i = 0; i < hours.length; i++) {
1151
- const start = new GanttDate(hours[i]);
1152
- const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.hour || this.options.dateDisplayFormats.secondary), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
1153
- isWeekend: start.isWeekend(),
1154
- isToday: start.isToday()
1155
- });
1156
- points.push(point);
842
+ };
843
+
844
+ var enUsLocale = {
845
+ id: GanttI18nLocale.enUs,
846
+ views: {
847
+ [GanttViewType.hour]: {
848
+ label: 'Hourly',
849
+ dateFormats: {
850
+ primary: 'MMM d',
851
+ secondary: 'HH:mm'
852
+ }
853
+ },
854
+ [GanttViewType.day]: {
855
+ label: 'Daily',
856
+ dateFormats: {
857
+ primary: 'MMM yyyy',
858
+ secondary: 'd'
859
+ }
860
+ },
861
+ [GanttViewType.week]: {
862
+ label: 'Weekly',
863
+ dateFormats: {
864
+ primary: 'yyyy',
865
+ secondary: 'wo'
866
+ }
867
+ },
868
+ [GanttViewType.month]: {
869
+ label: 'Monthly',
870
+ dateFormats: {
871
+ primary: "yyyy 'Q'Q",
872
+ secondary: 'MMM'
873
+ }
874
+ },
875
+ [GanttViewType.quarter]: {
876
+ label: 'Quarterly',
877
+ dateFormats: {
878
+ primary: 'yyyy',
879
+ secondary: "yyyy 'Q'Q"
880
+ }
881
+ },
882
+ [GanttViewType.year]: {
883
+ label: 'Yearly',
884
+ dateFormats: {
885
+ secondary: 'yyyy'
886
+ }
1157
887
  }
1158
- return points;
1159
888
  }
1160
- getTodayXPoint() {
1161
- const toady = new GanttDate().startOfMinute();
1162
- if (toady.value > this.start.value && toady.value < this.end.value) {
1163
- const x = this.getXPointByDate(toady);
1164
- return x;
889
+ };
890
+
891
+ var jaJpLocale = {
892
+ id: GanttI18nLocale.jaJp,
893
+ views: {
894
+ [GanttViewType.hour]: {
895
+ label: '毎時',
896
+ dateFormats: {
897
+ primary: 'M月d日',
898
+ secondary: 'HH:mm'
899
+ }
900
+ },
901
+ [GanttViewType.day]: {
902
+ label: '日',
903
+ dateFormats: {
904
+ primary: 'yyyy年M月d日',
905
+ secondary: 'd'
906
+ }
907
+ },
908
+ [GanttViewType.week]: {
909
+ label: '週',
910
+ dateFormats: {
911
+ primary: 'yyyy年',
912
+ secondary: '第w週'
913
+ }
914
+ },
915
+ [GanttViewType.month]: {
916
+ label: '月',
917
+ dateFormats: {
918
+ primary: `yyyy年M月`,
919
+ secondary: 'M月'
920
+ }
921
+ },
922
+ [GanttViewType.quarter]: {
923
+ label: '四半期',
924
+ dateFormats: {
925
+ primary: 'yyyy年',
926
+ secondary: `yyyy年第Q四半期`
927
+ }
928
+ },
929
+ [GanttViewType.year]: {
930
+ label: '年',
931
+ dateFormats: {
932
+ secondary: 'yyyy年'
933
+ }
1165
934
  }
1166
- else {
1167
- return null;
935
+ }
936
+ };
937
+
938
+ var deDeLocale = {
939
+ id: GanttI18nLocale.deDe,
940
+ dateLocale: de,
941
+ views: {
942
+ [GanttViewType.hour]: {
943
+ label: 'Stündlich',
944
+ dateFormats: {
945
+ primary: 'dd. MMM',
946
+ secondary: 'HH:mm'
947
+ }
948
+ },
949
+ [GanttViewType.day]: {
950
+ label: 'Täglich',
951
+ dateFormats: {
952
+ primary: 'MMM yyyy',
953
+ secondary: 'd'
954
+ }
955
+ },
956
+ [GanttViewType.week]: {
957
+ label: 'Wöchentlich',
958
+ dateFormats: {
959
+ primary: 'yyyy',
960
+ secondary: `w. 'Woche'`
961
+ }
962
+ },
963
+ [GanttViewType.month]: {
964
+ label: 'Monatlich',
965
+ dateFormats: {
966
+ primary: 'MMM yyyy',
967
+ secondary: 'MMM'
968
+ }
969
+ },
970
+ [GanttViewType.quarter]: {
971
+ label: 'Vierteljährlich',
972
+ dateFormats: {
973
+ primary: 'yyyy',
974
+ secondary: `Q. 'Quartal' yyyy`
975
+ }
976
+ },
977
+ [GanttViewType.year]: {
978
+ label: 'Jährlich',
979
+ dateFormats: {
980
+ secondary: 'yyyy'
981
+ }
1168
982
  }
1169
983
  }
1170
- getDateIntervalWidth(start, end) {
1171
- let result = 0;
1172
- const minutes = differenceInMinutes(end.value, start.value);
1173
- for (let i = 0; i < minutes; i++) {
1174
- result += this.getHourOccupancyWidth() / 60;
984
+ };
985
+
986
+ var ruRuLocale = {
987
+ id: GanttI18nLocale.ruRu,
988
+ dateLocale: ru,
989
+ views: {
990
+ [GanttViewType.hour]: {
991
+ label: 'Ежечасно',
992
+ dateFormats: {
993
+ primary: 'd MMM',
994
+ secondary: 'HH:mm'
995
+ }
996
+ },
997
+ [GanttViewType.day]: {
998
+ label: 'Ежедневно',
999
+ dateFormats: {
1000
+ primary: 'MMMM yyyy',
1001
+ secondary: 'd'
1002
+ }
1003
+ },
1004
+ [GanttViewType.week]: {
1005
+ label: 'Еженедельно',
1006
+ dateFormats: {
1007
+ primary: 'yyyy',
1008
+ secondary: 'Неделя w'
1009
+ }
1010
+ },
1011
+ [GanttViewType.month]: {
1012
+ label: 'Ежемесячно',
1013
+ dateFormats: {
1014
+ primary: 'MMMM yyyy',
1015
+ secondary: 'MMM'
1016
+ }
1017
+ },
1018
+ [GanttViewType.quarter]: {
1019
+ label: 'Ежеквартально',
1020
+ dateFormats: {
1021
+ primary: 'yyyy',
1022
+ secondary: 'Квартал Q yyyy'
1023
+ }
1024
+ },
1025
+ [GanttViewType.year]: {
1026
+ label: 'Ежегодно',
1027
+ dateFormats: {
1028
+ secondary: 'yyyy'
1029
+ }
1175
1030
  }
1176
- result = minutes >= 0 ? result : -result;
1177
- return Number(result.toFixed(3));
1178
- }
1179
- getDateByXPoint(x) {
1180
- const hourWidth = this.getHourOccupancyWidth();
1181
- const indexOfSecondaryDate = Math.max(Math.floor(x / hourWidth), 0);
1182
- const matchDate = this.secondaryDatePoints[Math.min(this.secondaryDatePoints.length - 1, indexOfSecondaryDate)];
1183
- const minuteWidth = hourWidth / 60;
1184
- const underOneHourMinutes = Math.floor((x % hourWidth) / minuteWidth);
1185
- return matchDate?.start.addMinutes(underOneHourMinutes);
1186
1031
  }
1187
- }
1032
+ };
1188
1033
 
1189
- const viewOptions$3 = {
1034
+ const i18nLocaleProvides = [
1035
+ { provide: GANTT_I18N_LOCALE_TOKEN, useValue: zhHans, multi: true },
1036
+ { provide: GANTT_I18N_LOCALE_TOKEN, useValue: zhHant, multi: true },
1037
+ { provide: GANTT_I18N_LOCALE_TOKEN, useValue: enUsLocale, multi: true },
1038
+ { provide: GANTT_I18N_LOCALE_TOKEN, useValue: jaJpLocale, multi: true },
1039
+ { provide: GANTT_I18N_LOCALE_TOKEN, useValue: deDeLocale, multi: true },
1040
+ { provide: GANTT_I18N_LOCALE_TOKEN, useValue: ruRuLocale, multi: true }
1041
+ ];
1042
+
1043
+ const viewOptions$5 = {
1190
1044
  start: new GanttDate().startOfQuarter().addQuarters(-1),
1191
1045
  end: new GanttDate().endOfQuarter().addQuarters(2),
1192
1046
  cellWidth: 280,
1193
1047
  addAmount: 1,
1194
1048
  addUnit: 'quarter',
1195
- dateDisplayFormats: zhHantLocale.views.month.dateFormats
1049
+ dateDisplayFormats: zhHant.views.month.dateFormats
1196
1050
  };
1197
1051
  class GanttViewMonth extends GanttView {
1198
1052
  constructor(start, end, options) {
1199
- super(start, end, Object.assign({}, viewOptions$3, options));
1053
+ super(start, end, Object.assign({}, viewOptions$5, options));
1200
1054
  this.viewType = GanttViewType.month;
1201
1055
  }
1202
1056
  viewStartOf(date) {
@@ -1233,7 +1087,7 @@ class GanttViewMonth extends GanttView {
1233
1087
  }
1234
1088
  }
1235
1089
 
1236
- const viewOptions$2 = {
1090
+ const viewOptions$4 = {
1237
1091
  start: new GanttDate().addYears(-1).startOfYear(),
1238
1092
  end: new GanttDate().addYears(1).endOfYear(),
1239
1093
  min: new GanttDate().addYears(-2).startOfYear(),
@@ -1241,11 +1095,11 @@ const viewOptions$2 = {
1241
1095
  cellWidth: 500,
1242
1096
  addAmount: 1,
1243
1097
  addUnit: 'year',
1244
- dateDisplayFormats: zhHantLocale.views.quarter.dateFormats
1098
+ dateDisplayFormats: zhHant.views.quarter.dateFormats
1245
1099
  };
1246
1100
  class GanttViewQuarter extends GanttView {
1247
1101
  constructor(start, end, options) {
1248
- super(start, end, Object.assign({}, viewOptions$2, options));
1102
+ super(start, end, Object.assign({}, viewOptions$4, options));
1249
1103
  this.viewType = GanttViewType.quarter;
1250
1104
  }
1251
1105
  viewStartOf(date) {
@@ -1282,17 +1136,69 @@ class GanttViewQuarter extends GanttView {
1282
1136
  }
1283
1137
  }
1284
1138
 
1285
- const viewOptions$1 = {
1139
+ const viewOptions$3 = {
1140
+ cellWidth: 35,
1141
+ start: new GanttDate().startOfYear().startOfWeek(),
1142
+ end: new GanttDate().endOfYear().endOfWeek(),
1143
+ addAmount: 1,
1144
+ addUnit: 'month',
1145
+ dateDisplayFormats: zhHant.views.day.dateFormats
1146
+ };
1147
+ class GanttViewDay extends GanttView {
1148
+ constructor(start, end, options) {
1149
+ super(start, end, Object.assign({}, viewOptions$3, options));
1150
+ this.showTimeline = false;
1151
+ this.viewType = GanttViewType.day;
1152
+ }
1153
+ viewStartOf(date) {
1154
+ return date.startOfWeek();
1155
+ }
1156
+ viewEndOf(date) {
1157
+ return date.endOfWeek();
1158
+ }
1159
+ getPrimaryWidth() {
1160
+ return this.getCellWidth() * 7;
1161
+ }
1162
+ getDayOccupancyWidth() {
1163
+ return this.cellWidth;
1164
+ }
1165
+ getPrimaryDatePoints() {
1166
+ const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
1167
+ const points = [];
1168
+ for (let i = 0; i < weeks.length; i++) {
1169
+ const weekStart = new GanttDate(weeks[i]);
1170
+ const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
1171
+ 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);
1172
+ points.push(point);
1173
+ }
1174
+ return points;
1175
+ }
1176
+ getSecondaryDatePoints() {
1177
+ const days = eachDayOfInterval({ start: this.start.value, end: this.end.value });
1178
+ const points = [];
1179
+ for (let i = 0; i < days.length; i++) {
1180
+ const start = new GanttDate(days[i]);
1181
+ const point = new GanttDatePoint(start, start.format(this.options.dateDisplayFormats.secondary) || start.getDate().toString(), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
1182
+ isWeekend: start.isWeekend(),
1183
+ isToday: start.isToday()
1184
+ });
1185
+ points.push(point);
1186
+ }
1187
+ return points;
1188
+ }
1189
+ }
1190
+
1191
+ const viewOptions$2 = {
1286
1192
  cellWidth: 280,
1287
1193
  start: new GanttDate().startOfYear().startOfWeek(),
1288
1194
  end: new GanttDate().endOfYear().endOfWeek(),
1289
1195
  addAmount: 1,
1290
1196
  addUnit: 'month',
1291
- dateDisplayFormats: zhHantLocale.views.week.dateFormats
1197
+ dateDisplayFormats: zhHant.views.week.dateFormats
1292
1198
  };
1293
1199
  class GanttViewWeek extends GanttView {
1294
1200
  constructor(start, end, options) {
1295
- super(start, end, Object.assign({}, viewOptions$1, options));
1201
+ super(start, end, Object.assign({}, viewOptions$2, options));
1296
1202
  this.viewType = GanttViewType.week;
1297
1203
  }
1298
1204
  viewStartOf(date) {
@@ -1330,17 +1236,17 @@ class GanttViewWeek extends GanttView {
1330
1236
  }
1331
1237
  }
1332
1238
 
1333
- const viewOptions = {
1239
+ const viewOptions$1 = {
1334
1240
  cellWidth: 480,
1335
1241
  start: new GanttDate().addYears(-2).startOfYear(),
1336
1242
  end: new GanttDate().addYears(2).endOfYear(),
1337
1243
  addAmount: 1,
1338
1244
  addUnit: 'year',
1339
- dateDisplayFormats: zhHantLocale.views.year.dateFormats
1245
+ dateDisplayFormats: zhHant.views.year.dateFormats
1340
1246
  };
1341
1247
  class GanttViewYear extends GanttView {
1342
1248
  constructor(start, end, options) {
1343
- super(start, end, Object.assign({}, viewOptions, options));
1249
+ super(start, end, Object.assign({}, viewOptions$1, options));
1344
1250
  this.viewType = GanttViewType.year;
1345
1251
  }
1346
1252
  viewStartOf(date) {
@@ -1363,35 +1269,181 @@ class GanttViewYear extends GanttView {
1363
1269
  const point = new GanttDatePoint(start, ``, this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
1364
1270
  points.push(point);
1365
1271
  }
1366
- return points;
1272
+ return points;
1273
+ }
1274
+ getSecondaryDatePoints() {
1275
+ const years = differenceInCalendarYears(this.end.value, this.start.value);
1276
+ const points = [];
1277
+ const pointTop = '60%';
1278
+ for (let i = 0; i <= years; i++) {
1279
+ const start = this.start.addYears(i);
1280
+ 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);
1281
+ points.push(point);
1282
+ }
1283
+ return points;
1284
+ }
1285
+ }
1286
+
1287
+ const viewOptions = {
1288
+ cellWidth: 80,
1289
+ start: new GanttDate().startOfMonth(),
1290
+ end: new GanttDate().endOfMonth(),
1291
+ datePrecisionUnit: 'minute',
1292
+ addAmount: 1,
1293
+ addUnit: 'week',
1294
+ dateDisplayFormats: zhHant.views.hour.dateFormats,
1295
+ dragPreviewDateFormat: 'HH:mm'
1296
+ };
1297
+ class GanttViewHour extends GanttView {
1298
+ constructor(start, end, options) {
1299
+ super(start, end, Object.assign({}, viewOptions, options));
1300
+ this.showTimeline = true;
1301
+ this.viewType = GanttViewType.hour;
1302
+ }
1303
+ viewStartOf(date) {
1304
+ return date.startOfWeek();
1305
+ }
1306
+ viewEndOf(date) {
1307
+ return date.endOfWeek();
1308
+ }
1309
+ getPrimaryWidth() {
1310
+ return this.getCellWidth() * 24;
1311
+ }
1312
+ getDayOccupancyWidth() {
1313
+ return this.cellWidth * 60;
1314
+ }
1315
+ getHourOccupancyWidth() {
1316
+ return this.getDayOccupancyWidth() / 60;
1317
+ }
1318
+ getPrimaryDatePoints() {
1319
+ const days = eachDayOfInterval({ start: this.start.value, end: this.end.value });
1320
+ const points = [];
1321
+ for (let i = 0; i < days.length; i++) {
1322
+ const start = this.start.addDays(i);
1323
+ const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.day || this.options.dateDisplayFormats.primary), (this.getCellWidth() * 24) / 2 + i * (this.getCellWidth() * 24), primaryDatePointTop);
1324
+ points.push(point);
1325
+ }
1326
+ return points;
1327
+ }
1328
+ getSecondaryDatePoints() {
1329
+ const hours = eachHourOfInterval({ start: this.start.value, end: this.end.value });
1330
+ const points = [];
1331
+ for (let i = 0; i < hours.length; i++) {
1332
+ const start = new GanttDate(hours[i]);
1333
+ const point = new GanttDatePoint(start, start.format(this.options.dateFormat?.hour || this.options.dateDisplayFormats.secondary), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
1334
+ isWeekend: start.isWeekend(),
1335
+ isToday: start.isToday()
1336
+ });
1337
+ points.push(point);
1338
+ }
1339
+ return points;
1340
+ }
1341
+ getTodayXPoint() {
1342
+ const toady = new GanttDate().startOfMinute();
1343
+ if (toady.value > this.start.value && toady.value < this.end.value) {
1344
+ const x = this.getXPointByDate(toady);
1345
+ return x;
1346
+ }
1347
+ else {
1348
+ return null;
1349
+ }
1350
+ }
1351
+ getDateIntervalWidth(start, end) {
1352
+ let result = 0;
1353
+ const minutes = differenceInMinutes(end.value, start.value);
1354
+ for (let i = 0; i < minutes; i++) {
1355
+ result += this.getHourOccupancyWidth() / 60;
1356
+ }
1357
+ result = minutes >= 0 ? result : -result;
1358
+ return Number(result.toFixed(3));
1359
+ }
1360
+ getDateByXPoint(x) {
1361
+ const hourWidth = this.getHourOccupancyWidth();
1362
+ const indexOfSecondaryDate = Math.max(Math.floor(x / hourWidth), 0);
1363
+ const matchDate = this.secondaryDatePoints[Math.min(this.secondaryDatePoints.length - 1, indexOfSecondaryDate)];
1364
+ const minuteWidth = hourWidth / 60;
1365
+ const underOneHourMinutes = Math.floor((x % hourWidth) / minuteWidth);
1366
+ return matchDate?.start.addMinutes(underOneHourMinutes);
1367
+ }
1368
+ }
1369
+
1370
+ const ganttViewsMap = {
1371
+ [GanttViewType.hour]: GanttViewHour,
1372
+ [GanttViewType.day]: GanttViewDay,
1373
+ [GanttViewType.week]: GanttViewWeek,
1374
+ [GanttViewType.month]: GanttViewMonth,
1375
+ [GanttViewType.quarter]: GanttViewQuarter,
1376
+ [GanttViewType.year]: GanttViewYear
1377
+ };
1378
+ function registerView(type, view) {
1379
+ ganttViewsMap[type] = view;
1380
+ }
1381
+ function createViewFactory(type, start, end, options) {
1382
+ return new ganttViewsMap[type](start, end, options);
1383
+ }
1384
+
1385
+ const defaultConfig = {
1386
+ locale: GanttI18nLocale.zhHans,
1387
+ linkOptions: {
1388
+ dependencyTypes: [GanttLinkType.fs],
1389
+ showArrow: false,
1390
+ lineType: GanttLinkLineType.curve
1391
+ },
1392
+ styleOptions: {
1393
+ headerHeight: 44,
1394
+ lineHeight: 44,
1395
+ barHeight: 22
1396
+ },
1397
+ dateOptions: {
1398
+ weekStartsOn: 1
1399
+ }
1400
+ };
1401
+ const GANTT_GLOBAL_CONFIG = new InjectionToken('GANTT_GLOBAL_CONFIG');
1402
+ class GanttConfigService {
1403
+ constructor() {
1404
+ const globalConfig = inject(GANTT_GLOBAL_CONFIG);
1405
+ const localeId = globalConfig.locale || defaultConfig.locale;
1406
+ this.config = {
1407
+ locale: localeId,
1408
+ dateFormat: Object.assign({}, defaultConfig.dateFormat, globalConfig.dateFormat),
1409
+ styleOptions: Object.assign({}, defaultConfig.styleOptions, globalConfig.styleOptions),
1410
+ linkOptions: Object.assign({}, defaultConfig.linkOptions, globalConfig.linkOptions),
1411
+ dateOptions: Object.assign({}, defaultConfig.dateOptions, globalConfig.dateOptions)
1412
+ };
1413
+ this.i18nLocales = inject(GANTT_I18N_LOCALE_TOKEN).reduce((result, localeConfig) => {
1414
+ result[localeConfig.id] = localeConfig; // 这里使用 `id` 作为 key
1415
+ return result;
1416
+ }, {
1417
+ ['zh-cn']: zhHans,
1418
+ ['zh-tw']: zhHant
1419
+ });
1420
+ if (this.config.dateOptions?.timeZone) {
1421
+ setDefaultTimeZone(this.config.dateOptions.timeZone);
1422
+ }
1423
+ setDefaultOptions({
1424
+ locale: this.getDateLocale(),
1425
+ weekStartsOn: this.config?.dateOptions?.weekStartsOn
1426
+ });
1367
1427
  }
1368
- getSecondaryDatePoints() {
1369
- const years = differenceInCalendarYears(this.end.value, this.start.value);
1370
- const points = [];
1371
- const pointTop = '60%';
1372
- for (let i = 0; i <= years; i++) {
1373
- const start = this.start.addYears(i);
1374
- 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);
1375
- points.push(point);
1376
- }
1377
- return points;
1428
+ setLocale(locale) {
1429
+ this.config.locale = locale;
1378
1430
  }
1431
+ getLocaleConfig() {
1432
+ return this.i18nLocales[this.config.locale] ?? this.i18nLocales[this.config.locale.toLowerCase()] ?? zhHans;
1433
+ }
1434
+ getViewsLocale() {
1435
+ return this.getLocaleConfig().views;
1436
+ }
1437
+ getDateLocale() {
1438
+ return this.config.dateOptions?.locale ?? this.getLocaleConfig().dateLocale;
1439
+ }
1440
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1441
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttConfigService, providedIn: 'root' }); }
1379
1442
  }
1380
-
1381
- const ganttViewsMap = {
1382
- [GanttViewType.hour]: GanttViewHour,
1383
- [GanttViewType.day]: GanttViewDay,
1384
- [GanttViewType.week]: GanttViewWeek,
1385
- [GanttViewType.month]: GanttViewMonth,
1386
- [GanttViewType.quarter]: GanttViewQuarter,
1387
- [GanttViewType.year]: GanttViewYear
1388
- };
1389
- function registerView(type, view) {
1390
- ganttViewsMap[type] = view;
1391
- }
1392
- function createViewFactory(type, start, end, options) {
1393
- return new ganttViewsMap[type](start, end, options);
1394
- }
1443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttConfigService, decorators: [{
1444
+ type: Injectable,
1445
+ args: [{ providedIn: 'root' }]
1446
+ }], ctorParameters: () => [] });
1395
1447
 
1396
1448
  class GanttUpper {
1397
1449
  set linkOptions(options) {
@@ -1425,12 +1477,11 @@ class GanttUpper {
1425
1477
  get element() {
1426
1478
  return this.elementRef.nativeElement;
1427
1479
  }
1428
- constructor(elementRef, cdr, ngZone, // @Inject(GANTT_GLOBAL_CONFIG) public config: GanttGlobalConfig
1429
- config) {
1430
- this.elementRef = elementRef;
1431
- this.cdr = cdr;
1432
- this.ngZone = ngZone;
1433
- this.config = config;
1480
+ constructor() {
1481
+ this.elementRef = inject(ElementRef);
1482
+ this.cdr = inject(ChangeDetectorRef);
1483
+ this.ngZone = inject(NgZone);
1484
+ this.config = inject(GANTT_GLOBAL_CONFIG);
1434
1485
  // eslint-disable-next-line @angular-eslint/no-input-rename
1435
1486
  this.originItems = [];
1436
1487
  // eslint-disable-next-line @angular-eslint/no-input-rename
@@ -1703,12 +1754,12 @@ class GanttUpper {
1703
1754
  rerenderView() {
1704
1755
  this.changeView(this.viewType);
1705
1756
  }
1706
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttUpper, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
1707
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.3", type: GanttUpper, isStandalone: true, 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 }); }
1757
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttUpper, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1758
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: GanttUpper, isStandalone: true, 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 }); }
1708
1759
  }
1709
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttUpper, decorators: [{
1760
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttUpper, decorators: [{
1710
1761
  type: Directive
1711
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined }], propDecorators: { originItems: [{
1762
+ }], ctorParameters: () => [], propDecorators: { originItems: [{
1712
1763
  type: Input,
1713
1764
  args: ['items']
1714
1765
  }], originGroups: [{
@@ -1786,65 +1837,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
1786
1837
  }] } });
1787
1838
  const GANTT_UPPER_TOKEN = new InjectionToken('GANTT_UPPER_TOKEN');
1788
1839
 
1789
- class GanttItemUpper {
1790
- constructor(elementRef, ganttUpper) {
1791
- this.elementRef = elementRef;
1792
- this.ganttUpper = ganttUpper;
1793
- this.firstChange = true;
1794
- this.unsubscribe$ = new Subject();
1795
- this.refsUnsubscribe$ = new Subject();
1796
- }
1797
- ngOnInit() {
1798
- this.firstChange = false;
1799
- this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
1800
- this.setPositions();
1801
- });
1802
- }
1803
- ngOnChanges(changes) {
1804
- if (!this.firstChange) {
1805
- this.itemChange(changes.item.currentValue);
1806
- }
1807
- }
1808
- itemChange(item) {
1809
- this.refsUnsubscribe$.next();
1810
- this.refsUnsubscribe$.complete();
1811
- this.item = item;
1812
- this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
1813
- this.setPositions();
1814
- });
1815
- }
1816
- setPositions() {
1817
- const itemElement = this.elementRef.nativeElement;
1818
- itemElement.style.left = this.item.refs?.x + 'px';
1819
- itemElement.style.top = this.item.refs?.y + 'px';
1820
- itemElement.style.width = this.item.refs?.width + 'px';
1821
- if (this.item.type === GanttItemType.bar) {
1822
- itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
1823
- }
1824
- else if (this.item.type === GanttItemType.range) {
1825
- itemElement.style.height = rangeHeight + 'px';
1826
- }
1827
- }
1828
- ngOnDestroy() {
1829
- this.unsubscribe$.next();
1830
- this.unsubscribe$.complete();
1831
- this.refsUnsubscribe$.next();
1832
- this.refsUnsubscribe$.complete();
1833
- }
1834
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive }); }
1835
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.3", type: GanttItemUpper, isStandalone: true, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 }); }
1836
- }
1837
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, decorators: [{
1838
- type: Directive
1839
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
1840
- type: Inject,
1841
- args: [GANTT_UPPER_TOKEN]
1842
- }] }], propDecorators: { template: [{
1843
- type: Input
1844
- }], item: [{
1845
- type: Input
1846
- }] } });
1847
-
1848
1840
  function getDependencyType(path, dependencyTypes) {
1849
1841
  if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
1850
1842
  return GanttLinkType.ss;
@@ -1863,8 +1855,8 @@ var InBarPosition;
1863
1855
  InBarPosition["finish"] = "finish";
1864
1856
  })(InBarPosition || (InBarPosition = {}));
1865
1857
  class GanttDragContainer {
1866
- constructor(ganttUpper) {
1867
- this.ganttUpper = ganttUpper;
1858
+ constructor() {
1859
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
1868
1860
  this.dragStarted = new EventEmitter();
1869
1861
  this.dragMoved = new EventEmitter();
1870
1862
  this.dragEnded = new EventEmitter();
@@ -1908,15 +1900,12 @@ class GanttDragContainer {
1908
1900
  this.linkDraggingId = null;
1909
1901
  this.linkDragPath = { from: null, to: null };
1910
1902
  }
1911
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragContainer, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
1912
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragContainer }); }
1903
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDragContainer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1904
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDragContainer }); }
1913
1905
  }
1914
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragContainer, decorators: [{
1906
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDragContainer, decorators: [{
1915
1907
  type: Injectable
1916
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
1917
- type: Inject,
1918
- args: [GANTT_UPPER_TOKEN]
1919
- }] }] });
1908
+ }], ctorParameters: () => [] });
1920
1909
 
1921
1910
  /**
1922
1911
  * Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
@@ -2002,122 +1991,6 @@ function normalizePassiveListenerOptions(options) {
2002
1991
  /** Options used to bind passive event listeners. */
2003
1992
  const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
2004
1993
 
2005
- const scrollThreshold = 50;
2006
- var ScrollDirection;
2007
- (function (ScrollDirection) {
2008
- ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
2009
- ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
2010
- ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
2011
- })(ScrollDirection || (ScrollDirection = {}));
2012
- class GanttDomService {
2013
- constructor(ngZone, platformId) {
2014
- this.ngZone = ngZone;
2015
- this.platformId = platformId;
2016
- this.visibleRangeX = signal({ min: 0, max: 0 });
2017
- this.unsubscribe$ = new Subject();
2018
- }
2019
- disableBrowserWheelEvent() {
2020
- const container = this.mainContainer;
2021
- this.ngZone.runOutsideAngular(() => fromEvent(container, 'wheel')
2022
- .pipe(takeUntil(this.unsubscribe$))
2023
- .subscribe((event) => {
2024
- const delta = event.deltaX;
2025
- if (!delta) {
2026
- return;
2027
- }
2028
- if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
2029
- (container.scrollLeft === 0 && delta < 0)) {
2030
- event.preventDefault();
2031
- }
2032
- }));
2033
- }
2034
- initialize(root) {
2035
- this.root = root.nativeElement;
2036
- this.side = this.root.getElementsByClassName('gantt-side')[0];
2037
- this.container = this.root.getElementsByClassName('gantt-container')[0];
2038
- this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
2039
- this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
2040
- this.mainScrollbar = this.root.getElementsByClassName('gantt-main-scrollbar')[0];
2041
- this.mainFooter = this.root.getElementsByClassName('gantt-container-footer')[0];
2042
- this.verticalScrollContainer = this.root.getElementsByClassName('gantt-scroll-container')[0];
2043
- const mainItems = this.mainContainer.getElementsByClassName('gantt-main-items')[0];
2044
- const mainGroups = this.mainContainer.getElementsByClassName('gantt-main-groups')[0];
2045
- this.mainItems = mainItems || mainGroups;
2046
- this.calendarHeader = this.root.getElementsByClassName('gantt-calendar-header')[0];
2047
- this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-grid')[0];
2048
- this.disableBrowserWheelEvent();
2049
- }
2050
- /**
2051
- * @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
2052
- * to run the change detection if needed.
2053
- */
2054
- getViewerScroll(options) {
2055
- const scrollObservers = [fromEvent(this.mainContainer, 'scroll', options)];
2056
- this.mainFooter && scrollObservers.push(fromEvent(this.mainFooter, 'scroll', options));
2057
- this.mainScrollbar && scrollObservers.push(fromEvent(this.mainScrollbar, 'scroll', options));
2058
- return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
2059
- .pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
2060
- this.setVisibleRangeX();
2061
- const event = {
2062
- target: this.mainContainer,
2063
- direction: ScrollDirection.NONE
2064
- };
2065
- if (current - previous < 0) {
2066
- if (this.mainContainer.scrollLeft < scrollThreshold && this.mainContainer.scrollLeft > 0) {
2067
- event.direction = ScrollDirection.LEFT;
2068
- }
2069
- }
2070
- if (current - previous > 0) {
2071
- if (this.mainContainer.scrollWidth - this.mainContainer.clientWidth - this.mainContainer.scrollLeft <
2072
- scrollThreshold) {
2073
- event.direction = ScrollDirection.RIGHT;
2074
- }
2075
- }
2076
- return event;
2077
- }))
2078
- .subscribe(subscriber)));
2079
- }
2080
- getResize() {
2081
- return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
2082
- }
2083
- getResizeByElement(element) {
2084
- return new Observable((observer) => {
2085
- const resizeObserver = new ResizeObserver(() => {
2086
- observer.next();
2087
- });
2088
- resizeObserver.observe(element);
2089
- });
2090
- }
2091
- scrollMainContainer(left) {
2092
- if (isNumber(left)) {
2093
- const scrollLeft = left - this.mainContainer.clientWidth / 2;
2094
- this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
2095
- this.calendarHeader.scrollLeft = this.mainContainer.scrollLeft;
2096
- this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
2097
- this.mainScrollbar && (this.mainScrollbar.scrollLeft = this.mainContainer.scrollLeft);
2098
- this.mainFooter && (this.mainFooter.scrollLeft = this.mainContainer.scrollLeft);
2099
- }
2100
- }
2101
- setVisibleRangeX() {
2102
- this.visibleRangeX.set({
2103
- min: this.mainContainer.scrollLeft,
2104
- max: this.mainContainer.scrollLeft + this.mainContainer.clientWidth
2105
- });
2106
- }
2107
- ngOnDestroy() {
2108
- this.unsubscribe$.next();
2109
- this.unsubscribe$.complete();
2110
- }
2111
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDomService, deps: [{ token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
2112
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDomService }); }
2113
- }
2114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDomService, decorators: [{
2115
- type: Injectable
2116
- }], ctorParameters: () => [{ type: i0.NgZone }, { type: undefined, decorators: [{
2117
- type: Inject,
2118
- args: [PLATFORM_ID]
2119
- }] }] });
2120
-
2121
1994
  /**
2122
1995
  * Proximity, as a ratio to width/height, at which a
2123
1996
  * dragged item will affect the drop container.
@@ -2146,12 +2019,12 @@ class GanttBarDrag {
2146
2019
  get autoScrollStep() {
2147
2020
  return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
2148
2021
  }
2149
- constructor(dragDrop, dom, dragContainer, _ngZone) {
2150
- this.dragDrop = dragDrop;
2151
- this.dom = dom;
2152
- this.dragContainer = dragContainer;
2153
- this._ngZone = _ngZone;
2154
- this.item = signal(null);
2022
+ constructor() {
2023
+ this.dragDrop = inject(DragDrop);
2024
+ this.dom = inject(GanttDomService);
2025
+ this.dragContainer = inject(GanttDragContainer);
2026
+ this._ngZone = inject(NgZone);
2027
+ this.item = signal(null, ...(ngDevMode ? [{ debugName: "item" }] : []));
2155
2028
  this.linkDragRefs = [];
2156
2029
  this.barHandleDragRefs = [];
2157
2030
  this.destroy$ = new Subject();
@@ -2434,13 +2307,24 @@ class GanttBarDrag {
2434
2307
  }
2435
2308
  barDragMove() {
2436
2309
  const currentX = this.item().refs.x + this.barDragMoveDistance + this.dragScrollDistance;
2437
- const start = this.ganttUpper.view.getDateByXPoint(currentX);
2438
- const end = this.ganttUpper.view.getEndDateByWidth(start, this.item().refs.width);
2310
+ const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
2311
+ const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
2312
+ const diffs = this.ganttUpper.view.differenceByPrecisionUnit(this.item().end, this.item().start);
2313
+ let start = currentDate;
2314
+ let end = currentDate.add(diffs, this.ganttUpper.view?.options?.datePrecisionUnit);
2315
+ // 日视图特殊逻辑处理
2316
+ if (this.ganttUpper.view.viewType === GanttViewType.day) {
2317
+ const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
2318
+ if (currentX > currentStartX + dayWidth / 2) {
2319
+ start = start.addDays(1);
2320
+ end = end.addDays(1);
2321
+ }
2322
+ }
2439
2323
  if (this.dragScrolling) {
2440
2324
  const left = currentX - this.barDragMoveDistance;
2441
2325
  this.barElement.style.left = left + 'px';
2442
2326
  }
2443
- this.openDragBackdrop(this.barElement, start, end);
2327
+ this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item().refs.width));
2444
2328
  if (!this.isStartOrEndInsideView(start, end)) {
2445
2329
  return;
2446
2330
  }
@@ -2629,42 +2513,108 @@ class GanttBarDrag {
2629
2513
  this.linkDragRefs = this.createLinkHandleDrags();
2630
2514
  }
2631
2515
  }
2632
- createDrags() {
2633
- this.createMouseEvents();
2634
- this.createBarDragRef();
2635
- this.createBarHandleDragRefs();
2636
- this.createLinkDragRefs();
2516
+ createDrags() {
2517
+ this.createMouseEvents();
2518
+ this.createBarDragRef();
2519
+ this.createBarHandleDragRefs();
2520
+ this.createLinkDragRefs();
2521
+ }
2522
+ updateItem(item) {
2523
+ this.item.set(item);
2524
+ }
2525
+ ngOnDestroy() {
2526
+ this.closeDragBackdrop();
2527
+ this.barDragRef?.dispose();
2528
+ this.linkDragRefs?.forEach((dragRef) => dragRef.dispose());
2529
+ this.barHandleDragRefs?.forEach((dragRef) => dragRef.dispose());
2530
+ this.destroy$.next();
2531
+ this.destroy$.complete();
2532
+ this.stopScrolling();
2533
+ this.stopScrollTimers$.complete();
2534
+ }
2535
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttBarDrag, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2536
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttBarDrag }); }
2537
+ }
2538
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttBarDrag, decorators: [{
2539
+ type: Injectable
2540
+ }], ctorParameters: () => [] });
2541
+
2542
+ const sideWidth = 400;
2543
+ const sideMiddleWidth = 500;
2544
+ const sideMaxWidth = 600;
2545
+ const sideMinWidth = 400;
2546
+ const barBackground = '#6698ff';
2547
+ const rangeHeight = 17;
2548
+ const todayHeight = 24;
2549
+ const todayWidth = 35;
2550
+ const todayBorderRadius = 4;
2551
+
2552
+ class GanttItemUpper {
2553
+ constructor() {
2554
+ this.elementRef = inject(ElementRef);
2555
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
2556
+ this.firstChange = true;
2557
+ this.unsubscribe$ = new Subject();
2558
+ this.refsUnsubscribe$ = new Subject();
2559
+ }
2560
+ ngOnInit() {
2561
+ this.firstChange = false;
2562
+ this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
2563
+ this.setPositions();
2564
+ });
2565
+ }
2566
+ ngOnChanges(changes) {
2567
+ if (!this.firstChange) {
2568
+ this.itemChange(changes.item.currentValue);
2569
+ }
2570
+ }
2571
+ itemChange(item) {
2572
+ this.refsUnsubscribe$.next();
2573
+ this.refsUnsubscribe$.complete();
2574
+ this.item = item;
2575
+ this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
2576
+ this.setPositions();
2577
+ });
2637
2578
  }
2638
- updateItem(item) {
2639
- this.item.set(item);
2579
+ setPositions() {
2580
+ const itemElement = this.elementRef.nativeElement;
2581
+ itemElement.style.left = this.item.refs?.x + 'px';
2582
+ itemElement.style.top = this.item.refs?.y + 'px';
2583
+ itemElement.style.width = this.item.refs?.width + 'px';
2584
+ if (this.item.type === GanttItemType.bar) {
2585
+ itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
2586
+ }
2587
+ else if (this.item.type === GanttItemType.range) {
2588
+ itemElement.style.height = rangeHeight + 'px';
2589
+ }
2640
2590
  }
2641
2591
  ngOnDestroy() {
2642
- this.closeDragBackdrop();
2643
- this.barDragRef?.dispose();
2644
- this.linkDragRefs?.forEach((dragRef) => dragRef.dispose());
2645
- this.barHandleDragRefs?.forEach((dragRef) => dragRef.dispose());
2646
- this.destroy$.next();
2647
- this.destroy$.complete();
2648
- this.stopScrolling();
2649
- this.stopScrollTimers$.complete();
2592
+ this.unsubscribe$.next();
2593
+ this.unsubscribe$.complete();
2594
+ this.refsUnsubscribe$.next();
2595
+ this.refsUnsubscribe$.complete();
2650
2596
  }
2651
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag, deps: [{ token: i1.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
2652
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag }); }
2597
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttItemUpper, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2598
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: GanttItemUpper, isStandalone: true, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 }); }
2653
2599
  }
2654
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttBarDrag, decorators: [{
2655
- type: Injectable
2656
- }], ctorParameters: () => [{ type: i1.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: i0.NgZone }] });
2600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttItemUpper, decorators: [{
2601
+ type: Directive
2602
+ }], ctorParameters: () => [], propDecorators: { template: [{
2603
+ type: Input
2604
+ }], item: [{
2605
+ type: Input
2606
+ }] } });
2657
2607
 
2658
2608
  function linearGradient(sideOrCorner, color, stop) {
2659
2609
  return `linear-gradient(${sideOrCorner},${color} 0%,${stop} 40%)`;
2660
2610
  }
2661
2611
  class NgxGanttBarComponent extends GanttItemUpper {
2662
- constructor(dragContainer, drag, elementRef, ganttUpper, ngZone) {
2663
- super(elementRef, ganttUpper);
2664
- this.dragContainer = dragContainer;
2665
- this.drag = drag;
2666
- this.ganttUpper = ganttUpper;
2667
- this.ngZone = ngZone;
2612
+ constructor() {
2613
+ super();
2614
+ this.dragContainer = inject(GanttDragContainer);
2615
+ this.drag = inject(GanttBarDrag);
2616
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
2617
+ this.ngZone = inject(NgZone);
2668
2618
  this.barClick = new EventEmitter();
2669
2619
  this.ganttItemClass = true;
2670
2620
  }
@@ -2715,11 +2665,11 @@ class NgxGanttBarComponent extends GanttItemUpper {
2715
2665
  this.barClick.emit({ event, item: this.item.origin });
2716
2666
  }
2717
2667
  setContentBackground() {
2718
- let style = { ...(this.item.barStyle || {}) };
2719
- const contentElement = this.contentElementRef.nativeElement;
2720
- const barElement = this.elementRef.nativeElement;
2721
2668
  if (this.item.refs?.width) {
2669
+ const contentElement = this.contentElementRef.nativeElement;
2722
2670
  const color = this.item.color || barBackground;
2671
+ const style = this.item.barStyle || {};
2672
+ const barElement = this.elementRef.nativeElement;
2723
2673
  if (this.item.origin.start && this.item.origin.end) {
2724
2674
  style.background = color;
2725
2675
  style.borderRadius = '';
@@ -2739,29 +2689,26 @@ class NgxGanttBarComponent extends GanttItemUpper {
2739
2689
  if (this.item.progress >= 0) {
2740
2690
  const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
2741
2691
  style.background = hexToRgb(color, 0.3);
2692
+ style.borderRadius = '';
2742
2693
  contentProgressElement.style.background = color;
2743
2694
  }
2744
- }
2745
- style = Object.assign({}, style, this.item.barStyle || {});
2746
- for (const key in style) {
2747
- if (style.hasOwnProperty(key)) {
2748
- contentElement.style[key] = style[key];
2695
+ for (const key in style) {
2696
+ if (style.hasOwnProperty(key)) {
2697
+ contentElement.style[key] = style[key];
2698
+ }
2749
2699
  }
2750
2700
  }
2751
2701
  }
2752
2702
  stopPropagation(event) {
2753
2703
  event.stopPropagation();
2754
2704
  }
2755
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
2756
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttBarComponent, isStandalone: true, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n @if (item.draggable && ganttUpper.draggable) {\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n }\n </div>\n @if (item.linkable && ganttUpper.linkable) {\n <div class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n }\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n @if (item.progress >= 0) {\n <div class=\"gantt-bar-content-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"> </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2705
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2706
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGanttBarComponent, isStandalone: true, selector: "ngx-gantt-bar,gantt-bar", outputs: { barClick: "barClick" }, host: { properties: { "class.gantt-bar": "this.ganttItemClass" } }, providers: [GanttBarDrag], viewQueries: [{ propertyName: "contentElementRef", first: true, predicate: ["content"], descendants: true }, { propertyName: "handles", predicate: ["handle"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n @if (item.draggable && ganttUpper.draggable) {\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n }\n </div>\n @if (item.linkable && ganttUpper.linkable) {\n <div class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n }\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n @if (item.progress >= 0) {\n <div class=\"gantt-bar-content-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"> </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2757
2707
  }
2758
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
2708
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
2759
2709
  type: Component,
2760
2710
  args: [{ selector: 'ngx-gantt-bar,gantt-bar', providers: [GanttBarDrag], imports: [NgTemplateOutlet], template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n @if (item.draggable && ganttUpper.draggable) {\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n }\n </div>\n @if (item.linkable && ganttUpper.linkable) {\n <div class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n }\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n @if (item.progress >= 0) {\n <div class=\"gantt-bar-content-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"> </ng-template>\n</div>\n" }]
2761
- }], ctorParameters: () => [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2762
- type: Inject,
2763
- args: [GANTT_UPPER_TOKEN]
2764
- }] }, { type: i0.NgZone }], propDecorators: { barClick: [{
2711
+ }], ctorParameters: () => [], propDecorators: { barClick: [{
2765
2712
  type: Output
2766
2713
  }], contentElementRef: [{
2767
2714
  type: ViewChild,
@@ -2775,9 +2722,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
2775
2722
  }] } });
2776
2723
 
2777
2724
  class NgxGanttBaselineComponent {
2778
- constructor(elementRef, ganttUpper) {
2779
- this.elementRef = elementRef;
2780
- this.ganttUpper = ganttUpper;
2725
+ constructor() {
2726
+ this.elementRef = inject(ElementRef);
2727
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
2781
2728
  this.unsubscribe$ = new Subject();
2782
2729
  this.ganttBaselineClass = true;
2783
2730
  }
@@ -2792,501 +2739,271 @@ class NgxGanttBaselineComponent {
2792
2739
  itemElement.style.bottom = '2px';
2793
2740
  itemElement.style.width = this.baselineItem.refs.width + 'px';
2794
2741
  }
2795
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttBaselineComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
2796
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttBaselineComponent, isStandalone: true, selector: "ngx-gantt-baseline,gantt-baseline", inputs: { baselineItem: "baselineItem", template: "template" }, host: { properties: { "class.gantt-baseline": "this.ganttBaselineClass" } }, ngImport: i0, template: "@if (baselineItem) {\n <div #content class=\"baseline-content\">\n <ng-template\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ item: baselineItem.origin, refs: baselineItem.refs }\"\n ></ng-template>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2742
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttBaselineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2743
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGanttBaselineComponent, isStandalone: true, selector: "ngx-gantt-baseline,gantt-baseline", inputs: { baselineItem: "baselineItem", template: "template" }, host: { properties: { "class.gantt-baseline": "this.ganttBaselineClass" } }, ngImport: i0, template: "@if (baselineItem) {\n <div #content class=\"baseline-content\">\n <ng-template\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ item: baselineItem.origin, refs: baselineItem.refs }\"\n ></ng-template>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2797
2744
  }
2798
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
2745
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
2799
2746
  type: Component,
2800
2747
  args: [{ selector: 'ngx-gantt-baseline,gantt-baseline', imports: [NgTemplateOutlet], template: "@if (baselineItem) {\n <div #content class=\"baseline-content\">\n <ng-template\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ item: baselineItem.origin, refs: baselineItem.refs }\"\n ></ng-template>\n </div>\n}\n" }]
2801
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2802
- type: Inject,
2803
- args: [GANTT_UPPER_TOKEN]
2804
- }] }], propDecorators: { baselineItem: [{
2748
+ }], ctorParameters: () => [], propDecorators: { baselineItem: [{
2805
2749
  type: Input
2806
2750
  }], template: [{
2807
2751
  type: Input
2808
- }], ganttBaselineClass: [{
2809
- type: HostBinding,
2810
- args: ['class.gantt-baseline']
2811
- }] } });
2812
-
2813
- const mainHeight = 5000;
2814
- class GanttCalendarGridComponent {
2815
- get view() {
2816
- return this.ganttUpper.view;
2817
- }
2818
- constructor(ganttUpper, ngZone, elementRef) {
2819
- this.ganttUpper = ganttUpper;
2820
- this.ngZone = ngZone;
2821
- this.elementRef = elementRef;
2822
- this.unsubscribe$ = new Subject();
2823
- this.mainHeight = mainHeight;
2824
- this.todayBorderRadius = todayBorderRadius;
2825
- this.viewTypes = GanttViewType;
2826
- this.className = `gantt-calendar gantt-calendar-grid`;
2827
- }
2828
- setTodayPoint() {
2829
- const x = this.view.getTodayXPoint();
2830
- const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
2831
- const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
2832
- if (isNumber(x)) {
2833
- if (line) {
2834
- line.style.left = `${x}px`;
2835
- line.style.top = `0px`;
2836
- line.style.bottom = `${-mainHeight}px`;
2837
- }
2838
- }
2839
- else {
2840
- todayEle.style.display = 'none';
2841
- }
2842
- }
2843
- ngOnInit() {
2844
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
2845
- merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
2846
- .pipe(takeUntil(this.unsubscribe$))
2847
- .subscribe(() => {
2848
- this.setTodayPoint();
2849
- });
2850
- });
2851
- }
2852
- ngOnDestroy() {
2853
- this.unsubscribe$.next();
2854
- this.unsubscribe$.complete();
2855
- }
2856
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarGridComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
2857
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttCalendarGridComponent, isStandalone: true, selector: "gantt-calendar-grid", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"mainHeight\" class=\"primary-line\"></line>\n }\n </g>\n </g>\n</svg>\n" }); }
2858
- }
2859
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
2860
- type: Component,
2861
- args: [{ selector: 'gantt-calendar-grid', standalone: true, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"mainHeight\" class=\"primary-line\"></line>\n }\n </g>\n </g>\n</svg>\n" }]
2862
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
2863
- type: Inject,
2864
- args: [GANTT_UPPER_TOKEN]
2865
- }] }, { type: i0.NgZone }, { type: i0.ElementRef }], propDecorators: { className: [{
2866
- type: HostBinding,
2867
- args: ['class']
2868
- }] } });
2869
-
2870
- class GanttCalendarHeaderComponent {
2871
- get view() {
2872
- return this.ganttUpper.view;
2873
- }
2874
- get height() {
2875
- return this.ganttUpper.styles.headerHeight + 'px';
2876
- }
2877
- constructor(ganttUpper, ngZone, elementRef) {
2878
- this.ganttUpper = ganttUpper;
2879
- this.ngZone = ngZone;
2880
- this.elementRef = elementRef;
2881
- this.unsubscribe$ = new Subject();
2882
- this.viewTypes = GanttViewType;
2883
- this.className = `gantt-calendar gantt-calendar-header`;
2884
- }
2885
- ngOnInit() {
2886
- // 头部日期定位
2887
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
2888
- merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
2889
- .pipe(takeUntil(this.unsubscribe$))
2890
- .subscribe(() => {
2891
- if (this.ganttUpper.viewType === GanttViewType.day)
2892
- this.setTodayPoint();
2893
- });
2894
- });
2895
- }
2896
- setTodayPoint() {
2897
- const x = this.view.getTodayXPoint();
2898
- const today = new GanttDate().getDate();
2899
- const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
2900
- const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
2901
- if (isNumber(x)) {
2902
- if (rect) {
2903
- rect.style.left = `${x - todayWidth / 2}px`;
2904
- rect.style.top = `${this.ganttUpper.styles.headerHeight - todayHeight}px`;
2905
- rect.innerHTML = today.toString();
2906
- }
2907
- }
2908
- else {
2909
- todayEle.style.display = 'none';
2910
- }
2911
- }
2912
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarHeaderComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
2913
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttCalendarHeaderComponent, isStandalone: true, selector: "gantt-calendar-header", host: { properties: { "class": "this.className", "style.height": "this.height" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"ganttUpper.styles.headerHeight\" class=\"primary-line\"></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
2914
- }
2915
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
2916
- type: Component,
2917
- args: [{ selector: 'gantt-calendar-header', imports: [NgStyle], template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"ganttUpper.styles.headerHeight\" class=\"primary-line\"></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
2918
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
2919
- type: Inject,
2920
- args: [GANTT_UPPER_TOKEN]
2921
- }] }, { type: i0.NgZone }, { type: i0.ElementRef }], propDecorators: { className: [{
2922
- type: HostBinding,
2923
- args: ['class']
2924
- }], height: [{
2925
- type: HostBinding,
2926
- args: ['style.height']
2927
- }] } });
2928
-
2929
- class GanttDragBackdropComponent {
2930
- constructor(ganttUpper) {
2931
- this.ganttUpper = ganttUpper;
2932
- }
2933
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragBackdropComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
2934
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttDragBackdropComponent, isStandalone: true, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }); }
2935
- }
2936
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
2937
- type: Component,
2938
- args: [{ selector: 'gantt-drag-backdrop', host: {
2939
- class: 'gantt-drag-backdrop'
2940
- }, standalone: true, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
2941
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
2942
- type: Inject,
2943
- args: [GANTT_UPPER_TOKEN]
2944
- }] }] });
2945
-
2946
- class GanttLoaderComponent {
2947
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2948
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttLoaderComponent, isStandalone: true, selector: "gantt-loader", host: { classAttribute: "gantt-loader gantt-loader-overlay" }, ngImport: i0, template: `
2949
- <div class="gantt-loader-wrapper">
2950
- <div class="gantt-loader-loading">
2951
- <span class="gantt-loader-loading-spot"></span>
2952
- </div>
2953
- </div>
2954
- `, isInline: true }); }
2955
- }
2956
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, decorators: [{
2957
- type: Component,
2958
- args: [{
2959
- selector: 'gantt-loader',
2960
- template: `
2961
- <div class="gantt-loader-wrapper">
2962
- <div class="gantt-loader-loading">
2963
- <span class="gantt-loader-loading-spot"></span>
2964
- </div>
2965
- </div>
2966
- `,
2967
- host: {
2968
- class: 'gantt-loader gantt-loader-overlay'
2969
- },
2970
- standalone: true
2971
- }]
2972
- }] });
2973
-
2974
- class NgxGanttRangeComponent extends GanttItemUpper {
2975
- constructor(elementRef, ganttUpper) {
2976
- super(elementRef, ganttUpper);
2977
- this.ganttRangeClass = true;
2978
- }
2979
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
2980
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttRangeComponent, isStandalone: true, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2981
- }
2982
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
2983
- type: Component,
2984
- args: [{ selector: 'ngx-gantt-range,gantt-range', imports: [NgTemplateOutlet], template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n" }]
2985
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
2986
- type: Inject,
2987
- args: [GANTT_UPPER_TOKEN]
2988
- }] }], propDecorators: { ganttRangeClass: [{
2989
- type: HostBinding,
2990
- args: ['class.gantt-range']
2991
- }] } });
2992
-
2993
- class GanttSyncScrollService {
2994
- constructor() {
2995
- this.ngZone = inject(NgZone);
2996
- this.scrollGroupsMap = new Map();
2997
- }
2998
- registerScrollEvent(groupName, element, direction) {
2999
- const group = this.scrollGroupsMap.get(groupName) || { elements: [], destroy$: new Subject(), direction };
3000
- group.elements.push(element);
3001
- this.scrollGroupsMap.set(groupName, group);
3002
- this.monitorScrollChange(group);
3003
- }
3004
- unregisterScrollEvent(groupName, element) {
3005
- const group = this.scrollGroupsMap.get(groupName);
3006
- if (group) {
3007
- group.elements = group.elements.filter((el) => el !== element);
3008
- if (!group.elements.length) {
3009
- this.scrollGroupsMap.delete(groupName);
3010
- }
3011
- else {
3012
- this.scrollGroupsMap.set(groupName, group);
3013
- }
3014
- this.monitorScrollChange(group);
3015
- }
3016
- }
3017
- monitorScrollChange(group) {
3018
- const { elements, destroy$, direction } = group;
3019
- destroy$.next();
3020
- destroy$.complete();
3021
- if (elements.length) {
3022
- const scrollObservers = elements.map((el) => fromEvent(el, 'scroll', passiveListenerOptions));
3023
- this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
3024
- .pipe(takeUntil$1(destroy$))
3025
- .subscribe((event) => {
3026
- elements.forEach((el) => {
3027
- if (direction === 'x') {
3028
- el.scrollLeft = event.currentTarget.scrollLeft;
3029
- }
3030
- else {
3031
- el.scrollTop = event.currentTarget.scrollTop;
3032
- }
3033
- });
3034
- }));
3035
- }
3036
- }
3037
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3038
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService }); }
3039
- }
3040
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, decorators: [{
3041
- type: Injectable
3042
- }], ctorParameters: () => [] });
3043
-
3044
- class GanttSyncScrollXDirective {
3045
- constructor() {
3046
- this.syncScrollX = input();
3047
- this.elementRef = inject((ElementRef));
3048
- this.syncScrollService = inject(GanttSyncScrollService);
3049
- }
3050
- ngOnInit() {
3051
- this.syncScrollService.registerScrollEvent(this.syncScrollX(), this.elementRef.nativeElement, 'x');
3052
- }
3053
- ngOnDestroy() {
3054
- this.syncScrollService.unregisterScrollEvent(this.syncScrollX(), this.elementRef.nativeElement);
2752
+ }], ganttBaselineClass: [{
2753
+ type: HostBinding,
2754
+ args: ['class.gantt-baseline']
2755
+ }] } });
2756
+
2757
+ const mainHeight = 5000;
2758
+ class GanttCalendarGridComponent {
2759
+ get view() {
2760
+ return this.ganttUpper.view;
3055
2761
  }
3056
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollXDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3057
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.3", type: GanttSyncScrollXDirective, isStandalone: true, selector: "[syncScrollX]", inputs: { syncScrollX: { classPropertyName: "syncScrollX", publicName: "syncScrollX", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
3058
- }
3059
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollXDirective, decorators: [{
3060
- type: Directive,
3061
- args: [{
3062
- selector: '[syncScrollX]',
3063
- standalone: true
3064
- }]
3065
- }], ctorParameters: () => [] });
3066
- class GanttSyncScrollYDirective {
3067
2762
  constructor() {
3068
- this.syncScrollY = input();
3069
- this.syncScrollService = inject(GanttSyncScrollService);
3070
- this.elementRef = inject((ElementRef));
2763
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
2764
+ this.ngZone = inject(NgZone);
2765
+ this.elementRef = inject(ElementRef);
2766
+ this.unsubscribe$ = new Subject();
2767
+ this.mainHeight = mainHeight;
2768
+ this.todayBorderRadius = todayBorderRadius;
2769
+ this.viewTypes = GanttViewType;
2770
+ this.className = `gantt-calendar gantt-calendar-grid`;
2771
+ }
2772
+ setTodayPoint() {
2773
+ const x = this.view.getTodayXPoint();
2774
+ const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
2775
+ const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
2776
+ if (isNumber(x)) {
2777
+ if (line) {
2778
+ line.style.left = `${x}px`;
2779
+ line.style.top = `0px`;
2780
+ line.style.bottom = `${-mainHeight}px`;
2781
+ }
2782
+ }
2783
+ else {
2784
+ todayEle.style.display = 'none';
2785
+ }
3071
2786
  }
3072
2787
  ngOnInit() {
3073
- this.syncScrollService.registerScrollEvent(this.syncScrollY(), this.elementRef.nativeElement, 'y');
2788
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
2789
+ merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
2790
+ .pipe(takeUntil(this.unsubscribe$))
2791
+ .subscribe(() => {
2792
+ this.setTodayPoint();
2793
+ });
2794
+ });
3074
2795
  }
3075
2796
  ngOnDestroy() {
3076
- this.syncScrollService.unregisterScrollEvent(this.syncScrollY(), this.elementRef.nativeElement);
3077
- }
3078
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3079
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.3", type: GanttSyncScrollYDirective, isStandalone: true, selector: "[syncScrollY]", inputs: { syncScrollY: { classPropertyName: "syncScrollY", publicName: "syncScrollY", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
3080
- }
3081
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, decorators: [{
3082
- type: Directive,
3083
- args: [{
3084
- selector: '[syncScrollY]',
3085
- standalone: true
3086
- }]
3087
- }], ctorParameters: () => [] });
3088
-
3089
- class GanttScrollbarComponent {
3090
- constructor(ganttUpper) {
3091
- this.ganttUpper = ganttUpper;
3092
- this.hasFooter = input(false);
3093
- this.tableWidth = input();
3094
- this.ganttRoot = input();
3095
- this.tableScrollWidth = input(0);
2797
+ this.unsubscribe$.next();
2798
+ this.unsubscribe$.complete();
3096
2799
  }
3097
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttScrollbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
3098
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.3", type: GanttScrollbarComponent, isStandalone: true, selector: "gantt-scrollbar", inputs: { hasFooter: { classPropertyName: "hasFooter", publicName: "hasFooter", isSignal: true, isRequired: false, transformFunction: null }, tableWidth: { classPropertyName: "tableWidth", publicName: "tableWidth", isSignal: true, isRequired: false, transformFunction: null }, ganttRoot: { classPropertyName: "ganttRoot", publicName: "ganttRoot", isSignal: true, isRequired: false, transformFunction: null }, tableScrollWidth: { classPropertyName: "tableScrollWidth", publicName: "tableScrollWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"gantt-scrollbar\"\n [ngClass]=\"{ 'gantt-scrollbar-bg': hasFooter() }\"\n [style.height.px]=\"ganttRoot()?.horizontalScrollbarHeight + 1\"\n [style.right.px]=\"ganttRoot()?.verticalScrollbarWidth\"\n>\n <div\n class=\"gantt-table-scrollbar\"\n syncScrollX=\"ganttTableXScroll\"\n [class.with-scrollbar]=\"ganttRoot()?.horizontalScrollbarHeight\"\n [style.width.px]=\"tableWidth()\"\n >\n <div class=\"h-100\" [style.width.px]=\"tableScrollWidth() - 1\"></div>\n </div>\n <div class=\"gantt-main-scrollbar\" syncScrollX=\"ganttMainXScroll\">\n <div class=\"h-100\" [style.width.px]=\"ganttRoot()['view']?.width\"></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }] }); }
2800
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttCalendarGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2801
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: GanttCalendarGridComponent, isStandalone: true, selector: "gantt-calendar-grid", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.primaryWidth\"\n [attr.x2]=\"($index + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n }\n </g>\n </g>\n</svg>\n" }); }
3099
2802
  }
3100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttScrollbarComponent, decorators: [{
2803
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
3101
2804
  type: Component,
3102
- args: [{ selector: 'gantt-scrollbar', imports: [NgClass, GanttSyncScrollXDirective], template: "<div\n class=\"gantt-scrollbar\"\n [ngClass]=\"{ 'gantt-scrollbar-bg': hasFooter() }\"\n [style.height.px]=\"ganttRoot()?.horizontalScrollbarHeight + 1\"\n [style.right.px]=\"ganttRoot()?.verticalScrollbarWidth\"\n>\n <div\n class=\"gantt-table-scrollbar\"\n syncScrollX=\"ganttTableXScroll\"\n [class.with-scrollbar]=\"ganttRoot()?.horizontalScrollbarHeight\"\n [style.width.px]=\"tableWidth()\"\n >\n <div class=\"h-100\" [style.width.px]=\"tableScrollWidth() - 1\"></div>\n </div>\n <div class=\"gantt-main-scrollbar\" syncScrollX=\"ganttMainXScroll\">\n <div class=\"h-100\" [style.width.px]=\"ganttRoot()['view']?.width\"></div>\n </div>\n</div>\n" }]
3103
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
3104
- type: Inject,
3105
- args: [GANTT_UPPER_TOKEN]
3106
- }] }] });
2805
+ args: [{ selector: 'gantt-calendar-grid', standalone: true, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.primaryWidth\"\n [attr.x2]=\"($index + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n }\n </g>\n </g>\n</svg>\n" }]
2806
+ }], ctorParameters: () => [], propDecorators: { className: [{
2807
+ type: HostBinding,
2808
+ args: ['class']
2809
+ }] } });
3107
2810
 
3108
- class NgxGanttToolbarComponent {
3109
- get top() {
3110
- return this.ganttUpper.styles.headerHeight + 16 + 'px';
2811
+ class GanttCalendarHeaderComponent {
2812
+ get view() {
2813
+ return this.ganttUpper.view;
3111
2814
  }
3112
- constructor(ganttUpper) {
3113
- this.ganttUpper = ganttUpper;
3114
- this.ganttItemClass = true;
3115
- this.views = inject(GanttConfigService).getViewsLocale();
2815
+ get height() {
2816
+ return this.ganttUpper.styles.headerHeight + 'px';
3116
2817
  }
3117
- selectView(view) {
3118
- this.ganttUpper.changeView(view);
2818
+ constructor() {
2819
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
2820
+ this.ngZone = inject(NgZone);
2821
+ this.elementRef = inject(ElementRef);
2822
+ this.unsubscribe$ = new Subject();
2823
+ this.viewTypes = GanttViewType;
2824
+ this.className = `gantt-calendar gantt-calendar-header`;
2825
+ }
2826
+ ngOnInit() {
2827
+ // 头部日期定位
2828
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
2829
+ merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
2830
+ .pipe(takeUntil(this.unsubscribe$))
2831
+ .subscribe(() => {
2832
+ if (this.ganttUpper.viewType === GanttViewType.day)
2833
+ this.setTodayPoint();
2834
+ });
2835
+ });
2836
+ }
2837
+ setTodayPoint() {
2838
+ const x = this.view.getTodayXPoint();
2839
+ const today = new GanttDate().getDate();
2840
+ const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
2841
+ const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
2842
+ if (isNumber(x)) {
2843
+ if (rect) {
2844
+ rect.style.left = `${x - todayWidth / 2}px`;
2845
+ rect.style.top = `${this.ganttUpper.styles.headerHeight - todayHeight}px`;
2846
+ rect.innerHTML = today.toString();
2847
+ }
2848
+ }
2849
+ else {
2850
+ todayEle.style.display = 'none';
2851
+ }
3119
2852
  }
3120
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttToolbarComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
3121
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttToolbarComponent, isStandalone: true, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: { template: "template" }, host: { properties: { "class.gantt-toolbar": "this.ganttItemClass", "style.top": "this.top" } }, ngImport: i0, template: "<div class=\"toolbar-container\">\n @if (!template) {\n @if (this.ganttUpper.toolbarOptions?.viewTypes?.length) {\n <div class=\"toolbar-views\">\n @for (viewType of this.ganttUpper.toolbarOptions?.viewTypes; track viewType) {\n @if (views[viewType]) {\n <div class=\"toolbar-view\" [class.active]=\"viewType === this.ganttUpper.viewType\" (click)=\"selectView(viewType)\">\n {{ views[viewType].label }}\n </div>\n }\n }\n </div>\n }\n }\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2853
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttCalendarHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2854
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: GanttCalendarHeaderComponent, isStandalone: true, selector: "gantt-calendar-header", host: { properties: { "class": "this.className", "style.height": "this.height" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.primaryWidth\"\n [attr.x2]=\"($index + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"primary-line\"\n ></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
3122
2855
  }
3123
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
2856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
3124
2857
  type: Component,
3125
- args: [{ selector: 'ngx-gantt-toolbar,gantt-toolbar', imports: [NgTemplateOutlet], template: "<div class=\"toolbar-container\">\n @if (!template) {\n @if (this.ganttUpper.toolbarOptions?.viewTypes?.length) {\n <div class=\"toolbar-views\">\n @for (viewType of this.ganttUpper.toolbarOptions?.viewTypes; track viewType) {\n @if (views[viewType]) {\n <div class=\"toolbar-view\" [class.active]=\"viewType === this.ganttUpper.viewType\" (click)=\"selectView(viewType)\">\n {{ views[viewType].label }}\n </div>\n }\n }\n </div>\n }\n }\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n" }]
3126
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
3127
- type: Inject,
3128
- args: [GANTT_UPPER_TOKEN]
3129
- }] }], propDecorators: { template: [{
3130
- type: Input
3131
- }], ganttItemClass: [{
2858
+ args: [{ selector: 'gantt-calendar-header', imports: [NgStyle], template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.primaryWidth\"\n [attr.x2]=\"($index + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"primary-line\"\n ></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
2859
+ }], ctorParameters: () => [], propDecorators: { className: [{
3132
2860
  type: HostBinding,
3133
- args: ['class.gantt-toolbar']
3134
- }], top: [{
2861
+ args: ['class']
2862
+ }], height: [{
3135
2863
  type: HostBinding,
3136
- args: ['style.top']
2864
+ args: ['style.height']
3137
2865
  }] } });
3138
2866
 
3139
- class GanttPrintService {
3140
- constructor() { }
3141
- setInlineStyles(targetElem) {
3142
- const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
3143
- for (const svgElement of svgElements) {
3144
- this.recursElementChildren(svgElement);
3145
- }
3146
- }
3147
- recursElementChildren(node) {
3148
- const transformProperties = [
3149
- 'fill',
3150
- 'color',
3151
- 'font-size',
3152
- 'stroke',
3153
- 'font',
3154
- 'text-anchor',
3155
- 'stroke-dasharray',
3156
- 'shape-rendering',
3157
- 'stroke-width'
3158
- ];
3159
- if (!node.style) {
3160
- return;
3161
- }
3162
- const styles = getComputedStyle(node);
3163
- for (const transformProperty of transformProperties) {
3164
- node.style[transformProperty] = styles[transformProperty];
3165
- }
3166
- for (const child of Array.from(node.childNodes)) {
3167
- this.recursElementChildren(child);
3168
- }
3169
- }
3170
- register(root) {
3171
- this.root = root.nativeElement;
3172
- this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
3173
- }
3174
- async html2canvas(ignoreElementClass) {
3175
- const root = this.root;
3176
- const mainContainer = this.mainContainer;
3177
- // set print width
3178
- const printWidth = root.offsetWidth;
3179
- // set print height
3180
- const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
3181
- const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
3182
- return html2canvas(root, {
3183
- logging: false,
3184
- allowTaint: true,
3185
- useCORS: true,
3186
- width: printWidth,
3187
- height: printHeight,
3188
- ignoreElements: (element) => {
3189
- if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
3190
- return true;
3191
- }
3192
- if (element.classList.contains('gantt-calendar-today-overlay')) {
3193
- return true;
3194
- }
3195
- },
3196
- onclone: (cloneDocument) => {
3197
- const ganttClass = root.className;
3198
- const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
3199
- const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
3200
- const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
3201
- const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
3202
- // change targetDom width
3203
- cloneGanttDom.style.width = `${printWidth}px`;
3204
- cloneGanttDom.style.height = `${printHeight}px`;
3205
- cloneGanttDom.style.overflow = `unset`;
3206
- cloneGanttContainerDom.style.backgroundColor = '#fff';
3207
- cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
3208
- cloneCalendarOverlay.setAttribute('style', `background: transparent`);
3209
- if (cloneLinksOverlay) {
3210
- cloneLinksOverlay.setAttribute('height', `${printHeight}`);
3211
- cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
3212
- }
3213
- // setInlineStyles for svg
3214
- this.setInlineStyles(cloneGanttDom);
3215
- }
3216
- });
3217
- }
3218
- async print(name = 'download', ignoreElementClass) {
3219
- this.html2canvas(ignoreElementClass).then((canvas) => {
3220
- const link = document.createElement('a');
3221
- const dataUrl = canvas.toDataURL('image/png');
3222
- link.download = `${name}.png`;
3223
- link.href = dataUrl;
3224
- link.click();
3225
- });
2867
+ class GanttDragBackdropComponent {
2868
+ constructor() {
2869
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
3226
2870
  }
3227
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3228
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService }); }
2871
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDragBackdropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2872
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: GanttDragBackdropComponent, isStandalone: true, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }); }
3229
2873
  }
3230
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttPrintService, decorators: [{
3231
- type: Injectable
2874
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
2875
+ type: Component,
2876
+ args: [{ selector: 'gantt-drag-backdrop', host: {
2877
+ class: 'gantt-drag-backdrop'
2878
+ }, standalone: true, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
3232
2879
  }], ctorParameters: () => [] });
3233
2880
 
3234
- class IsGanttRangeItemPipe {
3235
- transform(value) {
3236
- return value === GanttItemType.range;
3237
- }
3238
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3239
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, isStandalone: true, name: "isGanttRangeItem" }); }
3240
- }
3241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
3242
- type: Pipe,
3243
- args: [{
3244
- name: 'isGanttRangeItem',
3245
- standalone: true
3246
- }]
3247
- }] });
3248
- class IsGanttBarItemPipe {
3249
- transform(value) {
3250
- return value === GanttItemType.bar;
2881
+ const angleRight = `<svg xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="amnavigation/angle-right" stroke-width="1" fill-rule="evenodd"><path d="M7.978 11.498l-.005.005L2.3 5.831 3.13 5l4.848 4.848L12.826 5l.83.831-5.673 5.672-.005-.005z" transform="rotate(-90 7.978 8.252)"></path></g></svg>`;
2882
+ const angleDown = `<svg xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="aknavigation/angle-down" stroke-width="1" fill-rule="evenodd"><path d="M7.978 11.997l-.005.006L2.3 6.33l.83-.831 4.848 4.848L12.826 5.5l.83.83-5.673 5.673-.005-.006z" ></path></g></svg>`;
2883
+ const plusSquare = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="kxaction/plus-square" stroke-width="1" fill-rule="evenodd"><path d="M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm5.45 6.2V4.75h1.2V7.4h2.65v1.2H8.65v2.65h-1.2V8.6H4.8V7.4h2.65z"></path></g></svg>`;
2884
+ const minusSquare = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="jnaction/minus-square" stroke-width="1" fill-rule="evenodd"><path d="M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm2.8 6.2h6.5v1.2H4.8V7.4z"></path></g></svg>`;
2885
+ const loadingIcon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve">
2886
+ <path fill="#aaa" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)">
2887
+ <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform>
2888
+ </path>
2889
+ </svg>`;
2890
+ const emptyIcon = `<svg
2891
+ width="148px"
2892
+ height="134px"
2893
+ viewBox="0 0 148 134"
2894
+ version="1.1"
2895
+ xmlns="http://www.w3.org/2000/svg"
2896
+ xmlns:xlink="http://www.w3.org/1999/xlink"
2897
+ >
2898
+ <defs>
2899
+ <filter x="0.0%" y="0.0%" width="100.0%" height="100.0%" filterUnits="objectBoundingBox" id="filter-1">
2900
+ <feGaussianBlur stdDeviation="0" in="SourceGraphic"></feGaussianBlur>
2901
+ </filter>
2902
+ </defs>
2903
+ <g id="148x134" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
2904
+ <g id="编组-6" transform="translate(1.000000, 1.000000)">
2905
+ <ellipse
2906
+ id="椭圆形"
2907
+ fill="#EDEEF2"
2908
+ opacity="0.3"
2909
+ filter="url(#filter-1)"
2910
+ cx="73.0800017"
2911
+ cy="115.920003"
2912
+ rx="73.0800017"
2913
+ ry="16.8000004"
2914
+ ></ellipse>
2915
+ <g id="编组-5" transform="translate(15.120000, 0.000000)">
2916
+ <polygon
2917
+ id="矩形"
2918
+ fill="#E2E4E9"
2919
+ points="19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267"
2920
+ ></polygon>
2921
+ <path
2922
+ d="M23.5200005,0 L94.0800002,0 C97.7913538,2.06413823e-16 100.8,3.00864655 100.8,6.72000015 L100.8,99.1200023 L100.8,99.1200023 L16.8000004,99.1200023 L16.8000004,6.72000015 C16.8000004,3.00864655 19.8086469,1.56994302e-15 23.5200005,0 Z"
2923
+ id="矩形"
2924
+ fill="#F9FAFB"
2925
+ ></path>
2926
+ <path
2927
+ d="M30.9200007,12.4400003 L86.6800019,12.4400003 C88.5356787,12.4400003 90.040002,13.9443236 90.040002,15.8000004 L90.040002,42.000001 C90.040002,43.8556778 88.5356787,45.360001 86.6800019,45.360001 L30.9200007,45.360001 C29.0643239,45.360001 27.5600006,43.8556778 27.5600006,42.000001 L27.5600006,15.8000004 C27.5600006,13.9443236 29.0643239,12.4400003 30.9200007,12.4400003 Z"
2928
+ id="矩形"
2929
+ fill="#E8EAEE"
2930
+ ></path>
2931
+ <text
2932
+ id="&lt;/null&gt;"
2933
+ font-family="PingFangSC-Medium, PingFang SC"
2934
+ font-size="15.1200003"
2935
+ font-weight="400"
2936
+ fill="#BCBECD"
2937
+ >
2938
+ <tspan x="33.6000008" y="32.8000004">&lt;/null&gt;</tspan>
2939
+ </text>
2940
+ <rect id="矩形" fill="#E8EAEE" x="27.5600006" y="52.0800012" width="61.4800014" height="5.04000011" rx="2.52000006"></rect>
2941
+ <rect
2942
+ id="矩形备份"
2943
+ fill="#E8EAEE"
2944
+ x="27.5600006"
2945
+ y="63.8400014"
2946
+ width="61.4800014"
2947
+ height="5.04000011"
2948
+ rx="2.52000006"
2949
+ ></rect>
2950
+ <path
2951
+ d="M0,75.6000017 L29.280235,75.6000017 C32.0637502,75.6000017 34.3202352,77.8564866 34.3202352,80.6400018 L34.3202352,86.2591426 C34.3202352,89.0426578 36.5767201,91.2991427 39.3602353,91.2991427 L78.4136737,91.2991427 C81.1971889,91.2991427 83.4536738,89.0426578 83.4536738,86.2591426 L83.4536738,80.6400018 C83.4536738,77.8564866 85.7101587,75.6000017 88.4936739,75.6000017 L117.600003,75.6000017 L117.600003,75.6000017 L117.600003,110.880003 C117.600003,115.519195 113.839194,119.280003 109.200002,119.280003 L8.40000019,119.280003 C3.76080819,119.280003 -6.53729019e-15,115.519195 0,110.880003 L0,75.6000017 L0,75.6000017 Z"
2952
+ id="矩形"
2953
+ fill="#EDEFF2"
2954
+ ></path>
2955
+ </g>
2956
+ </g>
2957
+ </g>
2958
+ </svg>`;
2959
+ 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>`;
2960
+ 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>`;
2961
+ 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>`;
2962
+ const icons = {
2963
+ 'angle-right': angleRight,
2964
+ 'angle-down': angleDown,
2965
+ 'plus-square': plusSquare,
2966
+ 'minus-square': minusSquare,
2967
+ loading: loadingIcon,
2968
+ empty: emptyIcon,
2969
+ drag: dragIcon,
2970
+ 'arrow-left': arrowLeftIcon,
2971
+ 'arrow-right': arrowRightIcon
2972
+ };
2973
+
2974
+ class GanttIconComponent {
2975
+ set iconName(name) {
2976
+ this.setSvg(name);
3251
2977
  }
3252
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3253
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, isStandalone: true, name: "isGanttBarItem" }); }
3254
- }
3255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
3256
- type: Pipe,
3257
- args: [{
3258
- name: 'isGanttBarItem',
3259
- standalone: true
3260
- }]
3261
- }] });
3262
- class IsGanttCustomItemPipe {
3263
- transform(value) {
3264
- return value === GanttItemType.custom;
2978
+ constructor() {
2979
+ this.elementRef = inject(ElementRef);
2980
+ this.isIcon = true;
3265
2981
  }
3266
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3267
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, isStandalone: true, name: "isGanttCustomItem" }); }
3268
- }
3269
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
3270
- type: Pipe,
3271
- args: [{
3272
- name: 'isGanttCustomItem',
3273
- standalone: true
3274
- }]
3275
- }] });
3276
- class IsGanttGroupPipe {
3277
- transform(data) {
3278
- return !!data.items;
2982
+ setSvg(name) {
2983
+ const iconSvg = icons[name];
2984
+ if (iconSvg) {
2985
+ this.elementRef.nativeElement.innerHTML = iconSvg;
2986
+ }
2987
+ else {
2988
+ this.elementRef.nativeElement.innerHTML = '';
2989
+ }
3279
2990
  }
3280
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3281
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, isStandalone: true, name: "isGanttGroup" }); }
2991
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2992
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: GanttIconComponent, isStandalone: true, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0, template: '', isInline: true }); }
3282
2993
  }
3283
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttGroupPipe, decorators: [{
3284
- type: Pipe,
2994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttIconComponent, decorators: [{
2995
+ type: Component,
3285
2996
  args: [{
3286
- name: 'isGanttGroup',
2997
+ selector: 'gantt-icon',
2998
+ template: '',
3287
2999
  standalone: true
3288
3000
  }]
3289
- }] });
3001
+ }], ctorParameters: () => [], propDecorators: { isIcon: [{
3002
+ type: HostBinding,
3003
+ args: ['class.gantt-icon']
3004
+ }], iconName: [{
3005
+ type: Input
3006
+ }] } });
3290
3007
 
3291
3008
  class GanttLinkLine {
3292
3009
  constructor() { }
@@ -3468,12 +3185,12 @@ function createLineGenerator(type, ganttUpper) {
3468
3185
  }
3469
3186
 
3470
3187
  class GanttLinksComponent {
3471
- constructor(ganttUpper, cdr, elementRef, ganttDragContainer, ngZone) {
3472
- this.ganttUpper = ganttUpper;
3473
- this.cdr = cdr;
3474
- this.elementRef = elementRef;
3475
- this.ganttDragContainer = ganttDragContainer;
3476
- this.ngZone = ngZone;
3188
+ constructor() {
3189
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
3190
+ this.cdr = inject(ChangeDetectorRef);
3191
+ this.elementRef = inject(ElementRef);
3192
+ this.ganttDragContainer = inject(GanttDragContainer);
3193
+ this.ngZone = inject(NgZone);
3477
3194
  // @Input() groups: GanttGroupInternal[] = [];
3478
3195
  // @Input() items: GanttItemInternal[] = [];
3479
3196
  this.flatItems = [];
@@ -3647,16 +3364,13 @@ class GanttLinksComponent {
3647
3364
  this.unsubscribe$.next();
3648
3365
  this.unsubscribe$.complete();
3649
3366
  }
3650
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: GanttDragContainer }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
3651
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttLinksComponent, isStandalone: true, selector: "gantt-links-overlay", inputs: { flatItems: "flatItems" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n @for (link of links; track trackBy(i); let i = $index) {\n <ng-container>\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n @if (showArrow) {\n <defs>\n @if (link.type === ganttLinkTypes.sf) {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"180\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n } @else {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n }\n </defs>\n }\n </ng-container>\n }\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }); }
3367
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttLinksComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3368
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: GanttLinksComponent, isStandalone: true, selector: "gantt-links-overlay", inputs: { flatItems: "flatItems" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n @for (link of links; track trackBy(i); let i = $index) {\n <ng-container>\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n @if (showArrow) {\n <defs>\n @if (link.type === ganttLinkTypes.sf) {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"180\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n } @else {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n }\n </defs>\n }\n </ng-container>\n }\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }); }
3652
3369
  }
3653
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLinksComponent, decorators: [{
3370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttLinksComponent, decorators: [{
3654
3371
  type: Component,
3655
3372
  args: [{ selector: 'gantt-links-overlay', imports: [], template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n @for (link of links; track trackBy(i); let i = $index) {\n <ng-container>\n <path\n [attr.d]=\"link.path\"\n fill=\"transparent\"\n stroke-width=\"2\"\n [attr.stroke]=\"link.color\"\n pointer-events=\"none\"\n [attr.style]=\"link.type === ganttLinkTypes.sf ? 'marker-start: url(#triangle' + i + ')' : 'marker-end: url(#triangle' + i + ')'\"\n ></path>\n <g>\n <path\n class=\"link-line\"\n (click)=\"onLineClick($event, link)\"\n [attr.d]=\"link.path\"\n (mouseenter)=\"mouseEnterPath(link, i)\"\n (mouseleave)=\"mouseLeavePath(link)\"\n stroke=\"transparent\"\n stroke-width=\"9\"\n fill=\"none\"\n cursor=\"pointer\"\n ></path>\n </g>\n @if (showArrow) {\n <defs>\n @if (link.type === ganttLinkTypes.sf) {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"180\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n } @else {\n <marker [id]=\"'triangle' + i\" markerUnits=\"strokeWidth\" markerWidth=\"5\" markerHeight=\"4\" refX=\"5\" refY=\"2\" orient=\"auto\">\n <path [attr.fill]=\"link.color\" [attr.stroke]=\"link.color\" d=\"M 0 0 L 5 2 L 0 4 z\" />\n </marker>\n }\n </defs>\n }\n </ng-container>\n }\n <line class=\"link-dragging-line\"></line>\n</svg>\n" }]
3656
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
3657
- type: Inject,
3658
- args: [GANTT_UPPER_TOKEN]
3659
- }] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }], propDecorators: { flatItems: [{
3373
+ }], ctorParameters: () => [], propDecorators: { flatItems: [{
3660
3374
  type: Input
3661
3375
  }], lineClick: [{
3662
3376
  type: Output
@@ -3665,138 +3379,112 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
3665
3379
  args: ['class.gantt-links-overlay']
3666
3380
  }] } });
3667
3381
 
3668
- const angleRight = `<svg xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="amnavigation/angle-right" stroke-width="1" fill-rule="evenodd"><path d="M7.978 11.498l-.005.005L2.3 5.831 3.13 5l4.848 4.848L12.826 5l.83.831-5.673 5.672-.005-.005z" transform="rotate(-90 7.978 8.252)"></path></g></svg>`;
3669
- const angleDown = `<svg xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="aknavigation/angle-down" stroke-width="1" fill-rule="evenodd"><path d="M7.978 11.997l-.005.006L2.3 6.33l.83-.831 4.848 4.848L12.826 5.5l.83.83-5.673 5.673-.005-.006z" ></path></g></svg>`;
3670
- const plusSquare = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="kxaction/plus-square" stroke-width="1" fill-rule="evenodd"><path d="M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm5.45 6.2V4.75h1.2V7.4h2.65v1.2H8.65v2.65h-1.2V8.6H4.8V7.4h2.65z"></path></g></svg>`;
3671
- const minusSquare = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="jnaction/minus-square" stroke-width="1" fill-rule="evenodd"><path d="M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm2.8 6.2h6.5v1.2H4.8V7.4z"></path></g></svg>`;
3672
- const loadingIcon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve">
3673
- <path fill="#aaa" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)">
3674
- <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform>
3675
- </path>
3676
- </svg>`;
3677
- const emptyIcon = `<svg
3678
- width="148px"
3679
- height="134px"
3680
- viewBox="0 0 148 134"
3681
- version="1.1"
3682
- xmlns="http://www.w3.org/2000/svg"
3683
- xmlns:xlink="http://www.w3.org/1999/xlink"
3684
- >
3685
- <defs>
3686
- <filter x="0.0%" y="0.0%" width="100.0%" height="100.0%" filterUnits="objectBoundingBox" id="filter-1">
3687
- <feGaussianBlur stdDeviation="0" in="SourceGraphic"></feGaussianBlur>
3688
- </filter>
3689
- </defs>
3690
- <g id="148x134" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
3691
- <g id="编组-6" transform="translate(1.000000, 1.000000)">
3692
- <ellipse
3693
- id="椭圆形"
3694
- fill="#EDEEF2"
3695
- opacity="0.3"
3696
- filter="url(#filter-1)"
3697
- cx="73.0800017"
3698
- cy="115.920003"
3699
- rx="73.0800017"
3700
- ry="16.8000004"
3701
- ></ellipse>
3702
- <g id="编组-5" transform="translate(15.120000, 0.000000)">
3703
- <polygon
3704
- id="矩形"
3705
- fill="#E2E4E9"
3706
- points="19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267"
3707
- ></polygon>
3708
- <path
3709
- d="M23.5200005,0 L94.0800002,0 C97.7913538,2.06413823e-16 100.8,3.00864655 100.8,6.72000015 L100.8,99.1200023 L100.8,99.1200023 L16.8000004,99.1200023 L16.8000004,6.72000015 C16.8000004,3.00864655 19.8086469,1.56994302e-15 23.5200005,0 Z"
3710
- id="矩形"
3711
- fill="#F9FAFB"
3712
- ></path>
3713
- <path
3714
- d="M30.9200007,12.4400003 L86.6800019,12.4400003 C88.5356787,12.4400003 90.040002,13.9443236 90.040002,15.8000004 L90.040002,42.000001 C90.040002,43.8556778 88.5356787,45.360001 86.6800019,45.360001 L30.9200007,45.360001 C29.0643239,45.360001 27.5600006,43.8556778 27.5600006,42.000001 L27.5600006,15.8000004 C27.5600006,13.9443236 29.0643239,12.4400003 30.9200007,12.4400003 Z"
3715
- id="矩形"
3716
- fill="#E8EAEE"
3717
- ></path>
3718
- <text
3719
- id="&lt;/null&gt;"
3720
- font-family="PingFangSC-Medium, PingFang SC"
3721
- font-size="15.1200003"
3722
- font-weight="400"
3723
- fill="#BCBECD"
3724
- >
3725
- <tspan x="33.6000008" y="32.8000004">&lt;/null&gt;</tspan>
3726
- </text>
3727
- <rect id="矩形" fill="#E8EAEE" x="27.5600006" y="52.0800012" width="61.4800014" height="5.04000011" rx="2.52000006"></rect>
3728
- <rect
3729
- id="矩形备份"
3730
- fill="#E8EAEE"
3731
- x="27.5600006"
3732
- y="63.8400014"
3733
- width="61.4800014"
3734
- height="5.04000011"
3735
- rx="2.52000006"
3736
- ></rect>
3737
- <path
3738
- d="M0,75.6000017 L29.280235,75.6000017 C32.0637502,75.6000017 34.3202352,77.8564866 34.3202352,80.6400018 L34.3202352,86.2591426 C34.3202352,89.0426578 36.5767201,91.2991427 39.3602353,91.2991427 L78.4136737,91.2991427 C81.1971889,91.2991427 83.4536738,89.0426578 83.4536738,86.2591426 L83.4536738,80.6400018 C83.4536738,77.8564866 85.7101587,75.6000017 88.4936739,75.6000017 L117.600003,75.6000017 L117.600003,75.6000017 L117.600003,110.880003 C117.600003,115.519195 113.839194,119.280003 109.200002,119.280003 L8.40000019,119.280003 C3.76080819,119.280003 -6.53729019e-15,115.519195 0,110.880003 L0,75.6000017 L0,75.6000017 Z"
3739
- id="矩形"
3740
- fill="#EDEFF2"
3741
- ></path>
3742
- </g>
3743
- </g>
3744
- </g>
3745
- </svg>`;
3746
- 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>`;
3747
- 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>`;
3748
- 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>`;
3749
- const icons = {
3750
- 'angle-right': angleRight,
3751
- 'angle-down': angleDown,
3752
- 'plus-square': plusSquare,
3753
- 'minus-square': minusSquare,
3754
- loading: loadingIcon,
3755
- empty: emptyIcon,
3756
- drag: dragIcon,
3757
- 'arrow-left': arrowLeftIcon,
3758
- 'arrow-right': arrowRightIcon
3759
- };
3382
+ class GanttLoaderComponent {
3383
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3384
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: GanttLoaderComponent, isStandalone: true, selector: "gantt-loader", host: { classAttribute: "gantt-loader gantt-loader-overlay" }, ngImport: i0, template: `
3385
+ <div class="gantt-loader-wrapper">
3386
+ <div class="gantt-loader-loading">
3387
+ <span class="gantt-loader-loading-spot"></span>
3388
+ </div>
3389
+ </div>
3390
+ `, isInline: true }); }
3391
+ }
3392
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttLoaderComponent, decorators: [{
3393
+ type: Component,
3394
+ args: [{
3395
+ selector: 'gantt-loader',
3396
+ template: `
3397
+ <div class="gantt-loader-wrapper">
3398
+ <div class="gantt-loader-loading">
3399
+ <span class="gantt-loader-loading-spot"></span>
3400
+ </div>
3401
+ </div>
3402
+ `,
3403
+ host: {
3404
+ class: 'gantt-loader gantt-loader-overlay'
3405
+ },
3406
+ standalone: true
3407
+ }]
3408
+ }] });
3760
3409
 
3761
- class GanttIconComponent {
3762
- set iconName(name) {
3763
- this.setSvg(name);
3410
+ class IsGanttRangeItemPipe {
3411
+ transform(value) {
3412
+ return value === GanttItemType.range;
3764
3413
  }
3765
- constructor(elementRef) {
3766
- this.elementRef = elementRef;
3767
- this.isIcon = true;
3414
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttRangeItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3415
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: IsGanttRangeItemPipe, isStandalone: true, name: "isGanttRangeItem" }); }
3416
+ }
3417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttRangeItemPipe, decorators: [{
3418
+ type: Pipe,
3419
+ args: [{
3420
+ name: 'isGanttRangeItem',
3421
+ standalone: true
3422
+ }]
3423
+ }] });
3424
+ class IsGanttBarItemPipe {
3425
+ transform(value) {
3426
+ return value === GanttItemType.bar;
3427
+ }
3428
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttBarItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3429
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: IsGanttBarItemPipe, isStandalone: true, name: "isGanttBarItem" }); }
3430
+ }
3431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
3432
+ type: Pipe,
3433
+ args: [{
3434
+ name: 'isGanttBarItem',
3435
+ standalone: true
3436
+ }]
3437
+ }] });
3438
+ class IsGanttCustomItemPipe {
3439
+ transform(value) {
3440
+ return value === GanttItemType.custom;
3768
3441
  }
3769
- setSvg(name) {
3770
- const iconSvg = icons[name];
3771
- if (iconSvg) {
3772
- this.elementRef.nativeElement.innerHTML = iconSvg;
3773
- }
3774
- else {
3775
- this.elementRef.nativeElement.innerHTML = '';
3776
- }
3442
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttCustomItemPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3443
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: IsGanttCustomItemPipe, isStandalone: true, name: "isGanttCustomItem" }); }
3444
+ }
3445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttCustomItemPipe, decorators: [{
3446
+ type: Pipe,
3447
+ args: [{
3448
+ name: 'isGanttCustomItem',
3449
+ standalone: true
3450
+ }]
3451
+ }] });
3452
+ class IsGanttGroupPipe {
3453
+ transform(data) {
3454
+ return !!data.items;
3777
3455
  }
3778
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttIconComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
3779
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttIconComponent, isStandalone: true, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0, template: '', isInline: true }); }
3456
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttGroupPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
3457
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: IsGanttGroupPipe, isStandalone: true, name: "isGanttGroup" }); }
3780
3458
  }
3781
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttIconComponent, decorators: [{
3782
- type: Component,
3459
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttGroupPipe, decorators: [{
3460
+ type: Pipe,
3783
3461
  args: [{
3784
- selector: 'gantt-icon',
3785
- template: '',
3462
+ name: 'isGanttGroup',
3786
3463
  standalone: true
3787
3464
  }]
3788
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { isIcon: [{
3465
+ }] });
3466
+
3467
+ class NgxGanttRangeComponent extends GanttItemUpper {
3468
+ constructor() {
3469
+ super();
3470
+ this.ganttRangeClass = true;
3471
+ }
3472
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3473
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGanttRangeComponent, isStandalone: true, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
3474
+ }
3475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
3476
+ type: Component,
3477
+ args: [{ selector: 'ngx-gantt-range,gantt-range', imports: [NgTemplateOutlet], template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n" }]
3478
+ }], ctorParameters: () => [], propDecorators: { ganttRangeClass: [{
3789
3479
  type: HostBinding,
3790
- args: ['class.gantt-icon']
3791
- }], iconName: [{
3792
- type: Input
3480
+ args: ['class.gantt-range']
3793
3481
  }] } });
3794
3482
 
3795
3483
  class GanttMainComponent {
3796
- constructor(ganttUpper, dom, ngZone) {
3797
- this.ganttUpper = ganttUpper;
3798
- this.dom = dom;
3799
- this.ngZone = ngZone;
3484
+ constructor() {
3485
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
3486
+ this.dom = inject(GanttDomService);
3487
+ this.ngZone = inject(NgZone);
3800
3488
  this.barClick = new EventEmitter();
3801
3489
  this.lineClick = new EventEmitter();
3802
3490
  this.ganttMainClass = true;
@@ -3827,10 +3515,10 @@ class GanttMainComponent {
3827
3515
  const date = type === 'left' ? item.start || item.end : item.end || item.start;
3828
3516
  this.ganttRoot.scrollToDate(date);
3829
3517
  }
3830
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: GanttDomService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
3831
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", 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 @for (data of viewportItems; track trackBy($index, data)) {\n @if (data | isGanttGroup) {\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [ngClass]=\"data.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n }\n @if (!(data | isGanttGroup)) {\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [style]=\"data.laneStyle\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n @if (data.type | isGanttCustomItem) {\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n }\n @if ((data.type | isGanttRangeItem) || (data.type | isGanttBarItem)) {\n @if (data.type | isGanttRangeItem) {\n <gantt-range [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n }\n @if (data.type | isGanttBarItem) {\n <gantt-bar [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n }\n @if (ganttUpper.baselineItemsMap[data.id]) {\n <gantt-baseline [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\" [template]=\"baselineTemplate\"></gantt-baseline>\n }\n }\n </div>\n }\n }\n</div>\n\n@if (quickTimeFocus) {\n <div class=\"gantt-quick-time-focus-container\" [style.width.px]=\"ganttUpper.view.width\">\n <div class=\"gantt-quick-time-focus\" [style.width.px]=\"dom.visibleRangeX().max - dom.visibleRangeX().min\">\n @for (data of viewportItems; track trackBy(i, data); let i = $index) {\n @let item = toItemType(data);\n <div\n class=\"gantt-quick-time-focus-item\"\n [ngClass]=\"{ 'gantt-quick-time-focus-item-hide': !item?.refs?.width }\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n >\n <span class=\"ml-2\">\n @if (item.refs?.x < dom.visibleRangeX().min && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n <span class=\"mr-2\">\n @if (item.refs?.x + item.refs?.width > dom.visibleRangeX().max && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n }\n </div>\n </div>\n}\n", dependencies: [{ kind: "component", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["flatItems"], outputs: ["lineClick"] }, { 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: "pipe", type: IsGanttGroupPipe, name: "isGanttGroup" }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }] }); }
3518
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttMainComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3519
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", 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 @for (data of viewportItems; track trackBy($index, data)) {\n @if (data | isGanttGroup) {\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [ngClass]=\"data.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n }\n @if (!(data | isGanttGroup)) {\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [style]=\"data.laneStyle\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n @if (data.type | isGanttCustomItem) {\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n }\n @if ((data.type | isGanttRangeItem) || (data.type | isGanttBarItem)) {\n @if (data.type | isGanttRangeItem) {\n <gantt-range [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n }\n @if (data.type | isGanttBarItem) {\n <gantt-bar [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n }\n @if (ganttUpper.baselineItemsMap[data.id]) {\n <gantt-baseline [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\" [template]=\"baselineTemplate\"></gantt-baseline>\n }\n }\n </div>\n }\n }\n</div>\n\n@if (quickTimeFocus) {\n <div class=\"gantt-quick-time-focus-container\" [style.width.px]=\"ganttUpper.view.width\">\n <div class=\"gantt-quick-time-focus\" [style.width.px]=\"dom.visibleRangeX().max - dom.visibleRangeX().min\">\n @for (data of viewportItems; track trackBy(i, data); let i = $index) {\n @let item = toItemType(data);\n <div class=\"gantt-quick-time-focus-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\n <span class=\"ml-2\">\n @if (item.refs?.x < dom.visibleRangeX().min && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n <span class=\"mr-2\">\n @if (item.refs?.x + item.refs?.width > dom.visibleRangeX().max && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n }\n </div>\n </div>\n}\n", dependencies: [{ kind: "component", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["flatItems"], outputs: ["lineClick"] }, { 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: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "pipe", type: IsGanttRangeItemPipe, name: "isGanttRangeItem" }, { kind: "pipe", type: IsGanttBarItemPipe, name: "isGanttBarItem" }, { kind: "pipe", type: IsGanttCustomItemPipe, name: "isGanttCustomItem" }, { kind: "pipe", type: IsGanttGroupPipe, name: "isGanttGroup" }] }); }
3832
3520
  }
3833
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttMainComponent, decorators: [{
3521
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttMainComponent, decorators: [{
3834
3522
  type: Component,
3835
3523
  args: [{ selector: 'gantt-main', imports: [
3836
3524
  GanttLinksComponent,
@@ -3844,11 +3532,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
3844
3532
  IsGanttCustomItemPipe,
3845
3533
  IsGanttGroupPipe,
3846
3534
  GanttIconComponent
3847
- ], template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n @for (data of viewportItems; track trackBy($index, data)) {\n @if (data | isGanttGroup) {\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [ngClass]=\"data.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n }\n @if (!(data | isGanttGroup)) {\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [style]=\"data.laneStyle\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n @if (data.type | isGanttCustomItem) {\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n }\n @if ((data.type | isGanttRangeItem) || (data.type | isGanttBarItem)) {\n @if (data.type | isGanttRangeItem) {\n <gantt-range [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n }\n @if (data.type | isGanttBarItem) {\n <gantt-bar [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n }\n @if (ganttUpper.baselineItemsMap[data.id]) {\n <gantt-baseline [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\" [template]=\"baselineTemplate\"></gantt-baseline>\n }\n }\n </div>\n }\n }\n</div>\n\n@if (quickTimeFocus) {\n <div class=\"gantt-quick-time-focus-container\" [style.width.px]=\"ganttUpper.view.width\">\n <div class=\"gantt-quick-time-focus\" [style.width.px]=\"dom.visibleRangeX().max - dom.visibleRangeX().min\">\n @for (data of viewportItems; track trackBy(i, data); let i = $index) {\n @let item = toItemType(data);\n <div\n class=\"gantt-quick-time-focus-item\"\n [ngClass]=\"{ 'gantt-quick-time-focus-item-hide': !item?.refs?.width }\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n >\n <span class=\"ml-2\">\n @if (item.refs?.x < dom.visibleRangeX().min && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n <span class=\"mr-2\">\n @if (item.refs?.x + item.refs?.width > dom.visibleRangeX().max && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n }\n </div>\n </div>\n}\n" }]
3848
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
3849
- type: Inject,
3850
- args: [GANTT_UPPER_TOKEN]
3851
- }] }, { type: GanttDomService }, { type: i0.NgZone }], propDecorators: { viewportItems: [{
3535
+ ], template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n @for (data of viewportItems; track trackBy($index, data)) {\n @if (data | isGanttGroup) {\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [ngClass]=\"data.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n }\n @if (!(data | isGanttGroup)) {\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [style]=\"data.laneStyle\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n @if (data.type | isGanttCustomItem) {\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n }\n @if ((data.type | isGanttRangeItem) || (data.type | isGanttBarItem)) {\n @if (data.type | isGanttRangeItem) {\n <gantt-range [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n }\n @if (data.type | isGanttBarItem) {\n <gantt-bar [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n }\n @if (ganttUpper.baselineItemsMap[data.id]) {\n <gantt-baseline [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\" [template]=\"baselineTemplate\"></gantt-baseline>\n }\n }\n </div>\n }\n }\n</div>\n\n@if (quickTimeFocus) {\n <div class=\"gantt-quick-time-focus-container\" [style.width.px]=\"ganttUpper.view.width\">\n <div class=\"gantt-quick-time-focus\" [style.width.px]=\"dom.visibleRangeX().max - dom.visibleRangeX().min\">\n @for (data of viewportItems; track trackBy(i, data); let i = $index) {\n @let item = toItemType(data);\n <div class=\"gantt-quick-time-focus-item\" [style.height.px]=\"ganttUpper.styles.lineHeight\">\n <span class=\"ml-2\">\n @if (item.refs?.x < dom.visibleRangeX().min && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'left')\">\n <gantt-icon iconName=\"arrow-left\"></gantt-icon>\n </a>\n }\n </span>\n <span class=\"mr-2\">\n @if (item.refs?.x + item.refs?.width > dom.visibleRangeX().max && item.refs?.width) {\n <a class=\"gantt-quick-time-focus-item-arrow link-secondary\" href=\"javascript:;\" (click)=\"quickTime(item.origin, 'right')\">\n <gantt-icon iconName=\"arrow-right\"></gantt-icon>\n </a>\n }\n </span>\n </div>\n }\n </div>\n </div>\n}\n" }]
3536
+ }], ctorParameters: () => [], propDecorators: { viewportItems: [{
3852
3537
  type: Input
3853
3538
  }], flatItems: [{
3854
3539
  type: Input
@@ -3892,6 +3577,102 @@ function setStyleWithVendorPrefix({ element, style, value }) {
3892
3577
  }
3893
3578
  }
3894
3579
 
3580
+ class GanttSyncScrollService {
3581
+ constructor() {
3582
+ this.ngZone = inject(NgZone);
3583
+ this.scrollGroupsMap = new Map();
3584
+ }
3585
+ registerScrollEvent(groupName, element, direction) {
3586
+ const group = this.scrollGroupsMap.get(groupName) || { elements: [], destroy$: new Subject(), direction };
3587
+ group.elements.push(element);
3588
+ this.scrollGroupsMap.set(groupName, group);
3589
+ this.monitorScrollChange(group);
3590
+ }
3591
+ unregisterScrollEvent(groupName, element) {
3592
+ const group = this.scrollGroupsMap.get(groupName);
3593
+ if (group) {
3594
+ group.elements = group.elements.filter((el) => el !== element);
3595
+ if (!group.elements.length) {
3596
+ this.scrollGroupsMap.delete(groupName);
3597
+ }
3598
+ else {
3599
+ this.scrollGroupsMap.set(groupName, group);
3600
+ }
3601
+ this.monitorScrollChange(group);
3602
+ }
3603
+ }
3604
+ monitorScrollChange(group) {
3605
+ const { elements, destroy$, direction } = group;
3606
+ destroy$.next();
3607
+ destroy$.complete();
3608
+ if (elements.length) {
3609
+ const scrollObservers = elements.map((el) => fromEvent(el, 'scroll', passiveListenerOptions));
3610
+ this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
3611
+ .pipe(takeUntil$1(destroy$))
3612
+ .subscribe((event) => {
3613
+ elements.forEach((el) => {
3614
+ if (direction === 'x') {
3615
+ el.scrollLeft = event.currentTarget.scrollLeft;
3616
+ }
3617
+ else {
3618
+ el.scrollTop = event.currentTarget.scrollTop;
3619
+ }
3620
+ });
3621
+ }));
3622
+ }
3623
+ }
3624
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttSyncScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3625
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttSyncScrollService }); }
3626
+ }
3627
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttSyncScrollService, decorators: [{
3628
+ type: Injectable
3629
+ }], ctorParameters: () => [] });
3630
+
3631
+ class GanttSyncScrollXDirective {
3632
+ constructor() {
3633
+ this.syncScrollX = input(...(ngDevMode ? [undefined, { debugName: "syncScrollX" }] : []));
3634
+ this.elementRef = inject((ElementRef));
3635
+ this.syncScrollService = inject(GanttSyncScrollService);
3636
+ }
3637
+ ngOnInit() {
3638
+ this.syncScrollService.registerScrollEvent(this.syncScrollX(), this.elementRef.nativeElement, 'x');
3639
+ }
3640
+ ngOnDestroy() {
3641
+ this.syncScrollService.unregisterScrollEvent(this.syncScrollX(), this.elementRef.nativeElement);
3642
+ }
3643
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttSyncScrollXDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3644
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.10", type: GanttSyncScrollXDirective, isStandalone: true, selector: "[syncScrollX]", inputs: { syncScrollX: { classPropertyName: "syncScrollX", publicName: "syncScrollX", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
3645
+ }
3646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttSyncScrollXDirective, decorators: [{
3647
+ type: Directive,
3648
+ args: [{
3649
+ selector: '[syncScrollX]',
3650
+ standalone: true
3651
+ }]
3652
+ }], ctorParameters: () => [], propDecorators: { syncScrollX: [{ type: i0.Input, args: [{ isSignal: true, alias: "syncScrollX", required: false }] }] } });
3653
+ class GanttSyncScrollYDirective {
3654
+ constructor() {
3655
+ this.syncScrollY = input(...(ngDevMode ? [undefined, { debugName: "syncScrollY" }] : []));
3656
+ this.syncScrollService = inject(GanttSyncScrollService);
3657
+ this.elementRef = inject((ElementRef));
3658
+ }
3659
+ ngOnInit() {
3660
+ this.syncScrollService.registerScrollEvent(this.syncScrollY(), this.elementRef.nativeElement, 'y');
3661
+ }
3662
+ ngOnDestroy() {
3663
+ this.syncScrollService.unregisterScrollEvent(this.syncScrollY(), this.elementRef.nativeElement);
3664
+ }
3665
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttSyncScrollYDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3666
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.10", type: GanttSyncScrollYDirective, isStandalone: true, selector: "[syncScrollY]", inputs: { syncScrollY: { classPropertyName: "syncScrollY", publicName: "syncScrollY", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
3667
+ }
3668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttSyncScrollYDirective, decorators: [{
3669
+ type: Directive,
3670
+ args: [{
3671
+ selector: '[syncScrollY]',
3672
+ standalone: true
3673
+ }]
3674
+ }], ctorParameters: () => [], propDecorators: { syncScrollY: [{ type: i0.Input, args: [{ isSignal: true, alias: "syncScrollY", required: false }] }] } });
3675
+
3895
3676
  const defaultColumnWidth = 100;
3896
3677
  const minColumnWidth = 80;
3897
3678
  class GanttTableHeaderComponent {
@@ -3901,10 +3682,10 @@ class GanttTableHeaderComponent {
3901
3682
  get lineHeight() {
3902
3683
  return this.gantt.styles.headerHeight + 'px';
3903
3684
  }
3904
- constructor(elementRef, gantt, cdr) {
3905
- this.elementRef = elementRef;
3906
- this.gantt = gantt;
3907
- this.cdr = cdr;
3685
+ constructor() {
3686
+ this.elementRef = inject(ElementRef);
3687
+ this.gantt = inject(GANTT_ABSTRACT_TOKEN);
3688
+ this.cdr = inject(ChangeDetectorRef);
3908
3689
  this.tableWidth = 0;
3909
3690
  this.unsubscribe$ = new Subject();
3910
3691
  this.className = `gantt-table-header `;
@@ -4009,16 +3790,13 @@ class GanttTableHeaderComponent {
4009
3790
  this.unsubscribe$.next();
4010
3791
  this.unsubscribe$.complete();
4011
3792
  }
4012
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttTableHeaderComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_ABSTRACT_TOKEN }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4013
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttTableHeaderComponent, isStandalone: true, selector: "gantt-table-header", inputs: { columns: "columns" }, host: { properties: { "class": "this.className", "style.height": "this.height", "style.line-height": "this.lineHeight" } }, viewQueries: [{ propertyName: "resizeLineElementRef", first: true, predicate: ["resizeLine"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"gantt-table-header-container\" syncScrollX=\"ganttTableXScroll\" [style.width.px]=\"tableWidth\" cdkScrollable>\n @for (column of columns; track $index) {\n <div class=\"gantt-table-column\" [style.width]=\"column.columnWidth\">\n @if (column.headerTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"column.headerTemplateRef\"> </ng-container>\n } @else {\n {{ column.name }}\n }\n <div\n class=\"column-resize-handle\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"onResizeMoved($event, column)\"\n (cdkDragStarted)=\"onResizeStarted($event)\"\n (cdkDragEnded)=\"onResizeEnded($event, column)\"\n ></div>\n </div>\n }\n <div class=\"gantt-table-column gantt-table-column-placeholder\"></div>\n</div>\n\n@if (gantt?.table?.settingsSlot) {\n <ng-template [ngTemplateOutlet]=\"gantt?.table?.settingsSlot\"></ng-template>\n}\n\n<div\n class=\"table-resize-handle\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"onResizeMoved($event)\"\n (cdkDragStarted)=\"onResizeStarted($event)\"\n (cdkDragEnded)=\"onOverallResizeEnded($event)\"\n></div>\n\n<div #resizeLine class=\"table-resize-auxiliary-line\"></div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }] }); }
3793
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttTableHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3794
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: GanttTableHeaderComponent, isStandalone: true, selector: "gantt-table-header", inputs: { columns: "columns" }, host: { properties: { "class": "this.className", "style.height": "this.height", "style.line-height": "this.lineHeight" } }, viewQueries: [{ propertyName: "resizeLineElementRef", first: true, predicate: ["resizeLine"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"gantt-table-header-container\" syncScrollX=\"ganttTableXScroll\" [style.width.px]=\"tableWidth\" cdkScrollable>\n @for (column of columns; track $index) {\n <div class=\"gantt-table-column\" [style.width]=\"column.columnWidth\">\n @if (column.headerTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"column.headerTemplateRef\"> </ng-container>\n } @else {\n {{ column.name }}\n }\n <div\n class=\"column-resize-handle\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"onResizeMoved($event, column)\"\n (cdkDragStarted)=\"onResizeStarted($event)\"\n (cdkDragEnded)=\"onResizeEnded($event, column)\"\n ></div>\n </div>\n }\n <div class=\"gantt-table-column gantt-table-column-placeholder\"></div>\n</div>\n\n@if (gantt?.table?.settingsSlot) {\n <ng-template [ngTemplateOutlet]=\"gantt?.table?.settingsSlot\"></ng-template>\n}\n\n<div\n class=\"table-resize-handle\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"onResizeMoved($event)\"\n (cdkDragStarted)=\"onResizeStarted($event)\"\n (cdkDragEnded)=\"onOverallResizeEnded($event)\"\n></div>\n\n<div #resizeLine class=\"table-resize-auxiliary-line\"></div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }] }); }
4014
3795
  }
4015
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttTableHeaderComponent, decorators: [{
3796
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttTableHeaderComponent, decorators: [{
4016
3797
  type: Component,
4017
3798
  args: [{ selector: 'gantt-table-header', imports: [NgTemplateOutlet, CdkDrag, GanttSyncScrollXDirective], template: "<div class=\"gantt-table-header-container\" syncScrollX=\"ganttTableXScroll\" [style.width.px]=\"tableWidth\" cdkScrollable>\n @for (column of columns; track $index) {\n <div class=\"gantt-table-column\" [style.width]=\"column.columnWidth\">\n @if (column.headerTemplateRef) {\n <ng-container [ngTemplateOutlet]=\"column.headerTemplateRef\"> </ng-container>\n } @else {\n {{ column.name }}\n }\n <div\n class=\"column-resize-handle\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"onResizeMoved($event, column)\"\n (cdkDragStarted)=\"onResizeStarted($event)\"\n (cdkDragEnded)=\"onResizeEnded($event, column)\"\n ></div>\n </div>\n }\n <div class=\"gantt-table-column gantt-table-column-placeholder\"></div>\n</div>\n\n@if (gantt?.table?.settingsSlot) {\n <ng-template [ngTemplateOutlet]=\"gantt?.table?.settingsSlot\"></ng-template>\n}\n\n<div\n class=\"table-resize-handle\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"onResizeMoved($event)\"\n (cdkDragStarted)=\"onResizeStarted($event)\"\n (cdkDragEnded)=\"onOverallResizeEnded($event)\"\n></div>\n\n<div #resizeLine class=\"table-resize-auxiliary-line\"></div>\n" }]
4018
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
4019
- type: Inject,
4020
- args: [GANTT_ABSTRACT_TOKEN]
4021
- }] }, { type: i0.ChangeDetectorRef }], propDecorators: { columns: [{
3799
+ }], ctorParameters: () => [], propDecorators: { columns: [{
4022
3800
  type: Input
4023
3801
  }], resizeLineElementRef: [{
4024
3802
  type: ViewChild,
@@ -4046,12 +3824,12 @@ class GanttTableBodyComponent {
4046
3824
  get viewportItems() {
4047
3825
  return this._viewportItems;
4048
3826
  }
4049
- constructor(gantt, ganttUpper, cdr, document, elementRef) {
4050
- this.gantt = gantt;
4051
- this.ganttUpper = ganttUpper;
4052
- this.cdr = cdr;
4053
- this.document = document;
4054
- this.elementRef = elementRef;
3827
+ constructor() {
3828
+ this.gantt = inject(GANTT_ABSTRACT_TOKEN);
3829
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
3830
+ this.cdr = inject(ChangeDetectorRef);
3831
+ this.document = inject(DOCUMENT);
3832
+ this.elementRef = inject(ElementRef);
4055
3833
  this.draggable = false;
4056
3834
  this.dragDropped = new EventEmitter();
4057
3835
  this.dragStarted = new EventEmitter();
@@ -4294,22 +4072,13 @@ class GanttTableBodyComponent {
4294
4072
  this.document.querySelectorAll('.drop-position-after').forEach((element) => element.classList.remove('drop-position-after'));
4295
4073
  this.document.querySelectorAll('.drop-position-inside').forEach((element) => element.classList.remove('drop-position-inside'));
4296
4074
  }
4297
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttTableBodyComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0.ChangeDetectorRef }, { token: DOCUMENT }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
4298
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", 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 @if (!viewportItems?.length) {\n @if (!emptyTemplate) {\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n }\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n }\n\n @if (viewportItems && viewportItems.length > 0) {\n @for (item of viewportItems; track trackBy($index, item)) {\n @if (item | isGanttGroup) {\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [ngClass]=\"item.class\">\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 @if (groupTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n } @else {\n <span class=\"group-title\">{{ item.title }}</span>\n }\n </div>\n </div>\n }\n @if (!(item | isGanttGroup)) {\n <div\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 @for (column of columns; track $index; let first = $first) {\n <div [classList]=\"column.classList\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n @if (first && draggable) {\n <gantt-icon\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n }\n <!-- expand icon -->\n @if (column?.showExpandIcon || (!hasExpandIcon && first)) {\n <div class=\"gantt-expand-icon\" [style.marginLeft.px]=\"item.level * 20\">\n @if (item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)) {\n @if (!item.loading) {\n <gantt-icon\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n }\n @if (item.loading) {\n <gantt-icon [iconName]=\"'loading'\"></gantt-icon>\n }\n }\n </div>\n }\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 }\n <div class=\"gantt-table-column gantt-table-column-placeholder\"></div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n }\n }\n }\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: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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" }, { kind: "pipe", type: IsGanttGroupPipe, name: "isGanttGroup" }] }); }
4075
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttTableBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4076
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", 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 @if (!viewportItems?.length) {\n @if (!emptyTemplate) {\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n }\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n }\n\n @if (viewportItems && viewportItems.length > 0) {\n @for (item of viewportItems; track trackBy($index, item)) {\n @if (item | isGanttGroup) {\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [ngClass]=\"item.class\">\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 @if (groupTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n } @else {\n <span class=\"group-title\">{{ item.title }}</span>\n }\n </div>\n </div>\n }\n @if (!(item | isGanttGroup)) {\n <div\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 @for (column of columns; track $index; let first = $first) {\n <div [classList]=\"column.classList\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n @if (first && draggable) {\n <gantt-icon\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n }\n <!-- expand icon -->\n @if (column?.showExpandIcon || (!hasExpandIcon && first)) {\n <div class=\"gantt-expand-icon\" [style.marginLeft.px]=\"item.level * 20\">\n @if (item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)) {\n @if (!item.loading) {\n <gantt-icon\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n }\n @if (item.loading) {\n <gantt-icon [iconName]=\"'loading'\"></gantt-icon>\n }\n }\n </div>\n }\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 }\n <div class=\"gantt-table-column gantt-table-column-placeholder\"></div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n }\n }\n }\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", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "component", type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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" }, { kind: "pipe", type: IsGanttGroupPipe, name: "isGanttGroup" }] }); }
4299
4077
  }
4300
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
4078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
4301
4079
  type: Component,
4302
4080
  args: [{ selector: 'gantt-table-body', imports: [CdkDropList, GanttIconComponent, NgTemplateOutlet, NgClass, CdkDrag, CdkDragHandle, IsGanttRangeItemPipe, IsGanttGroupPipe], 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 @if (!viewportItems?.length) {\n @if (!emptyTemplate) {\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n }\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n }\n\n @if (viewportItems && viewportItems.length > 0) {\n @for (item of viewportItems; track trackBy($index, item)) {\n @if (item | isGanttGroup) {\n <div class=\"gantt-table-group\" [style.height.px]=\"gantt.styles.lineHeight\" [ngClass]=\"item.class\">\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 @if (groupTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, group: item.origin }\"\n ></ng-template>\n } @else {\n <span class=\"group-title\">{{ item.title }}</span>\n }\n </div>\n </div>\n }\n @if (!(item | isGanttGroup)) {\n <div\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 @for (column of columns; track $index; let first = $first) {\n <div [classList]=\"column.classList\" [style.width]=\"column.columnWidth\">\n <!-- drag icon -->\n @if (first && draggable) {\n <gantt-icon\n class=\"gantt-drag-handle\"\n iconName=\"drag\"\n cdkDragHandle\n [cdkDragHandleDisabled]=\"(draggable && item.itemDraggable === false) || !draggable\"\n ></gantt-icon>\n }\n <!-- expand icon -->\n @if (column?.showExpandIcon || (!hasExpandIcon && first)) {\n <div class=\"gantt-expand-icon\" [style.marginLeft.px]=\"item.level * 20\">\n @if (item.level < gantt.maxLevel - 1 && ((gantt.async && item.expandable) || item.children?.length > 0)) {\n @if (!item.loading) {\n <gantt-icon\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n >\n </gantt-icon>\n }\n @if (item.loading) {\n <gantt-icon [iconName]=\"'loading'\"></gantt-icon>\n }\n }\n </div>\n }\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 }\n <div class=\"gantt-table-column gantt-table-column-placeholder\"></div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n }\n }\n }\n</div>\n" }]
4303
- }], ctorParameters: () => [{ type: undefined, decorators: [{
4304
- type: Inject,
4305
- args: [GANTT_ABSTRACT_TOKEN]
4306
- }] }, { type: GanttUpper, decorators: [{
4307
- type: Inject,
4308
- args: [GANTT_UPPER_TOKEN]
4309
- }] }, { type: i0.ChangeDetectorRef }, { type: Document, decorators: [{
4310
- type: Inject,
4311
- args: [DOCUMENT]
4312
- }] }, { type: i0.ElementRef }], propDecorators: { viewportItems: [{
4081
+ }], ctorParameters: () => [], propDecorators: { viewportItems: [{
4313
4082
  type: Input
4314
4083
  }], flatItems: [{
4315
4084
  type: Input
@@ -4352,6 +4121,145 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
4352
4121
  args: [(CdkDrag)]
4353
4122
  }] } });
4354
4123
 
4124
+ class NgxGanttToolbarComponent {
4125
+ get top() {
4126
+ return this.ganttUpper.styles.headerHeight + 16 + 'px';
4127
+ }
4128
+ constructor() {
4129
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
4130
+ this.ganttItemClass = true;
4131
+ this.views = inject(GanttConfigService).getViewsLocale();
4132
+ }
4133
+ selectView(view) {
4134
+ this.ganttUpper.changeView(view);
4135
+ }
4136
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4137
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGanttToolbarComponent, isStandalone: true, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: { template: "template" }, host: { properties: { "class.gantt-toolbar": "this.ganttItemClass", "style.top": "this.top" } }, ngImport: i0, template: "<div class=\"toolbar-container\">\n @if (!template) {\n @if (this.ganttUpper.toolbarOptions?.viewTypes?.length) {\n <div class=\"toolbar-views\">\n @for (viewType of this.ganttUpper.toolbarOptions?.viewTypes; track viewType) {\n @if (views[viewType]) {\n <div class=\"toolbar-view\" [class.active]=\"viewType === this.ganttUpper.viewType\" (click)=\"selectView(viewType)\">\n {{ views[viewType].label }}\n </div>\n }\n }\n </div>\n }\n }\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
4138
+ }
4139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttToolbarComponent, decorators: [{
4140
+ type: Component,
4141
+ args: [{ selector: 'ngx-gantt-toolbar,gantt-toolbar', imports: [NgTemplateOutlet], template: "<div class=\"toolbar-container\">\n @if (!template) {\n @if (this.ganttUpper.toolbarOptions?.viewTypes?.length) {\n <div class=\"toolbar-views\">\n @for (viewType of this.ganttUpper.toolbarOptions?.viewTypes; track viewType) {\n @if (views[viewType]) {\n <div class=\"toolbar-view\" [class.active]=\"viewType === this.ganttUpper.viewType\" (click)=\"selectView(viewType)\">\n {{ views[viewType].label }}\n </div>\n }\n }\n </div>\n }\n }\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n</div>\n" }]
4142
+ }], ctorParameters: () => [], propDecorators: { template: [{
4143
+ type: Input
4144
+ }], ganttItemClass: [{
4145
+ type: HostBinding,
4146
+ args: ['class.gantt-toolbar']
4147
+ }], top: [{
4148
+ type: HostBinding,
4149
+ args: ['style.top']
4150
+ }] } });
4151
+
4152
+ class GanttScrollbarComponent {
4153
+ constructor() {
4154
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
4155
+ this.hasFooter = input(false, ...(ngDevMode ? [{ debugName: "hasFooter" }] : []));
4156
+ this.tableWidth = input(...(ngDevMode ? [undefined, { debugName: "tableWidth" }] : []));
4157
+ this.ganttRoot = input(...(ngDevMode ? [undefined, { debugName: "ganttRoot" }] : []));
4158
+ this.tableScrollWidth = input(0, ...(ngDevMode ? [{ debugName: "tableScrollWidth" }] : []));
4159
+ }
4160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttScrollbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4161
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.10", type: GanttScrollbarComponent, isStandalone: true, selector: "gantt-scrollbar", inputs: { hasFooter: { classPropertyName: "hasFooter", publicName: "hasFooter", isSignal: true, isRequired: false, transformFunction: null }, tableWidth: { classPropertyName: "tableWidth", publicName: "tableWidth", isSignal: true, isRequired: false, transformFunction: null }, ganttRoot: { classPropertyName: "ganttRoot", publicName: "ganttRoot", isSignal: true, isRequired: false, transformFunction: null }, tableScrollWidth: { classPropertyName: "tableScrollWidth", publicName: "tableScrollWidth", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"gantt-scrollbar\"\n [ngClass]=\"{ 'gantt-scrollbar-bg': hasFooter() }\"\n [style.height.px]=\"ganttRoot()?.horizontalScrollbarHeight + 1\"\n [style.right.px]=\"ganttRoot()?.verticalScrollbarWidth\"\n>\n <div\n class=\"gantt-table-scrollbar\"\n syncScrollX=\"ganttTableXScroll\"\n [class.with-scrollbar]=\"ganttRoot()?.horizontalScrollbarHeight\"\n [style.width.px]=\"tableWidth()\"\n >\n <div class=\"h-100\" [style.width.px]=\"tableScrollWidth() - 1\"></div>\n </div>\n <div class=\"gantt-main-scrollbar\" syncScrollX=\"ganttMainXScroll\">\n <div class=\"h-100\" [style.width.px]=\"ganttRoot()['view']?.width\"></div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }] }); }
4162
+ }
4163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttScrollbarComponent, decorators: [{
4164
+ type: Component,
4165
+ args: [{ selector: 'gantt-scrollbar', imports: [NgClass, GanttSyncScrollXDirective], template: "<div\n class=\"gantt-scrollbar\"\n [ngClass]=\"{ 'gantt-scrollbar-bg': hasFooter() }\"\n [style.height.px]=\"ganttRoot()?.horizontalScrollbarHeight + 1\"\n [style.right.px]=\"ganttRoot()?.verticalScrollbarWidth\"\n>\n <div\n class=\"gantt-table-scrollbar\"\n syncScrollX=\"ganttTableXScroll\"\n [class.with-scrollbar]=\"ganttRoot()?.horizontalScrollbarHeight\"\n [style.width.px]=\"tableWidth()\"\n >\n <div class=\"h-100\" [style.width.px]=\"tableScrollWidth() - 1\"></div>\n </div>\n <div class=\"gantt-main-scrollbar\" syncScrollX=\"ganttMainXScroll\">\n <div class=\"h-100\" [style.width.px]=\"ganttRoot()['view']?.width\"></div>\n </div>\n</div>\n" }]
4166
+ }], ctorParameters: () => [], propDecorators: { hasFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasFooter", required: false }] }], tableWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableWidth", required: false }] }], ganttRoot: [{ type: i0.Input, args: [{ isSignal: true, alias: "ganttRoot", required: false }] }], tableScrollWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableScrollWidth", required: false }] }] } });
4167
+
4168
+ class GanttPrintService {
4169
+ constructor() { }
4170
+ setInlineStyles(targetElem) {
4171
+ const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
4172
+ for (const svgElement of svgElements) {
4173
+ this.recursElementChildren(svgElement);
4174
+ }
4175
+ }
4176
+ recursElementChildren(node) {
4177
+ const transformProperties = [
4178
+ 'fill',
4179
+ 'color',
4180
+ 'font-size',
4181
+ 'stroke',
4182
+ 'font',
4183
+ 'text-anchor',
4184
+ 'stroke-dasharray',
4185
+ 'shape-rendering',
4186
+ 'stroke-width'
4187
+ ];
4188
+ if (!node.style) {
4189
+ return;
4190
+ }
4191
+ const styles = getComputedStyle(node);
4192
+ for (const transformProperty of transformProperties) {
4193
+ node.style[transformProperty] = styles[transformProperty];
4194
+ }
4195
+ for (const child of Array.from(node.childNodes)) {
4196
+ this.recursElementChildren(child);
4197
+ }
4198
+ }
4199
+ register(root) {
4200
+ this.root = root.nativeElement;
4201
+ this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
4202
+ }
4203
+ async html2canvas(ignoreElementClass) {
4204
+ const root = this.root;
4205
+ const mainContainer = this.mainContainer;
4206
+ // set print width
4207
+ const printWidth = root.offsetWidth;
4208
+ // set print height
4209
+ const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
4210
+ const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
4211
+ return html2canvas(root, {
4212
+ logging: false,
4213
+ allowTaint: true,
4214
+ useCORS: true,
4215
+ width: printWidth,
4216
+ height: printHeight,
4217
+ ignoreElements: (element) => {
4218
+ if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
4219
+ return true;
4220
+ }
4221
+ if (element.classList.contains('gantt-calendar-today-overlay')) {
4222
+ return true;
4223
+ }
4224
+ },
4225
+ onclone: (cloneDocument) => {
4226
+ const ganttClass = root.className;
4227
+ const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
4228
+ const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
4229
+ const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
4230
+ const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
4231
+ // change targetDom width
4232
+ cloneGanttDom.style.width = `${printWidth}px`;
4233
+ cloneGanttDom.style.height = `${printHeight}px`;
4234
+ cloneGanttDom.style.overflow = `unset`;
4235
+ cloneGanttContainerDom.style.backgroundColor = '#fff';
4236
+ cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
4237
+ cloneCalendarOverlay.setAttribute('style', `background: transparent`);
4238
+ if (cloneLinksOverlay) {
4239
+ cloneLinksOverlay.setAttribute('height', `${printHeight}`);
4240
+ cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
4241
+ }
4242
+ // setInlineStyles for svg
4243
+ this.setInlineStyles(cloneGanttDom);
4244
+ }
4245
+ });
4246
+ }
4247
+ async print(name = 'download', ignoreElementClass) {
4248
+ this.html2canvas(ignoreElementClass).then((canvas) => {
4249
+ const link = document.createElement('a');
4250
+ const dataUrl = canvas.toDataURL('image/png');
4251
+ link.download = `${name}.png`;
4252
+ link.href = dataUrl;
4253
+ link.click();
4254
+ });
4255
+ }
4256
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4257
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttPrintService }); }
4258
+ }
4259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttPrintService, decorators: [{
4260
+ type: Injectable
4261
+ }], ctorParameters: () => [] });
4262
+
4355
4263
  class NgxGanttRootComponent {
4356
4264
  get view() {
4357
4265
  return this.ganttUpper.view;
@@ -4359,16 +4267,17 @@ class NgxGanttRootComponent {
4359
4267
  onWindowResize() {
4360
4268
  this.computeScrollBarOffset();
4361
4269
  }
4362
- constructor(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
4363
- this.elementRef = elementRef;
4364
- this.ngZone = ngZone;
4365
- this.dom = dom;
4366
- this.dragContainer = dragContainer;
4367
- this.ganttUpper = ganttUpper;
4368
- this.printService = printService;
4270
+ constructor() {
4271
+ this.elementRef = inject(ElementRef);
4272
+ this.ngZone = inject(NgZone);
4273
+ this.dom = inject(GanttDomService);
4274
+ this.dragContainer = inject(GanttDragContainer);
4275
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
4276
+ this.printService = inject(GanttPrintService, { optional: true });
4369
4277
  this.verticalScrollbarWidth = 0;
4370
4278
  this.horizontalScrollbarHeight = 0;
4371
4279
  this.unsubscribe$ = new Subject();
4280
+ const dragContainer = this.dragContainer;
4372
4281
  this.ganttUpper.dragContainer = dragContainer;
4373
4282
  }
4374
4283
  ngOnInit() {
@@ -4470,10 +4379,10 @@ class NgxGanttRootComponent {
4470
4379
  }
4471
4380
  this.dom.scrollMainContainer(x);
4472
4381
  }
4473
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRootComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: GanttDomService }, { token: GanttDragContainer }, { token: GANTT_UPPER_TOKEN }, { token: GanttPrintService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
4474
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttRootComponent, isStandalone: true, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { listeners: { "window:resize": "onWindowResize()" }, classAttribute: "gantt" }, providers: [GanttDomService, GanttDragContainer, GanttSyncScrollService], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, static: true }], viewQueries: [{ propertyName: "backdrop", first: true, predicate: GanttDragBackdropComponent, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "@if (sideTemplate) {\n <div class=\"gantt-side\" [style.width.px]=\"sideWidth\" [style.padding-bottom.px]=\"horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\" syncScrollX=\"ganttTableXScroll\" syncScrollY=\"ganttMainYScroll\" cdkScrollable>\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n </div>\n}\n@if (mainTemplate) {\n <div class=\"gantt-container\">\n <gantt-calendar-header syncScrollX=\"ganttMainXScroll\" [style.padding-right.px]=\"verticalScrollbarWidth\"></gantt-calendar-header>\n <gantt-calendar-grid\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <div class=\"gantt-main-container\" syncScrollX=\"ganttMainXScroll\" syncScrollY=\"ganttMainYScroll\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n </div>\n </div>\n}\n<ng-content></ng-content>\n@if (ganttUpper.showToolbar || ganttUpper.toolbarTemplate) {\n <gantt-toolbar [template]=\"ganttUpper.toolbarTemplate\"> </gantt-toolbar>\n}\n", dependencies: [{ kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttToolbarComponent, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: ["template"] }, { kind: "directive", type: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }, { kind: "directive", type: GanttSyncScrollYDirective, selector: "[syncScrollY]", inputs: ["syncScrollY"] }] }); }
4382
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttRootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4383
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGanttRootComponent, isStandalone: true, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { listeners: { "window:resize": "onWindowResize()" }, classAttribute: "gantt" }, providers: [GanttDomService, GanttDragContainer, GanttSyncScrollService], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, static: true }], viewQueries: [{ propertyName: "backdrop", first: true, predicate: GanttDragBackdropComponent, descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "@if (sideTemplate) {\n <div class=\"gantt-side\" [style.width.px]=\"sideWidth\" [style.padding-bottom.px]=\"horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\" syncScrollX=\"ganttTableXScroll\" syncScrollY=\"ganttMainYScroll\" cdkScrollable>\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n </div>\n}\n@if (mainTemplate) {\n <div class=\"gantt-container\">\n <gantt-calendar-header syncScrollX=\"ganttMainXScroll\" [style.padding-right.px]=\"verticalScrollbarWidth\"></gantt-calendar-header>\n <gantt-calendar-grid\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <div class=\"gantt-main-container\" syncScrollX=\"ganttMainXScroll\" syncScrollY=\"ganttMainYScroll\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n </div>\n </div>\n}\n<ng-content></ng-content>\n@if (ganttUpper.showToolbar || ganttUpper.toolbarTemplate) {\n <gantt-toolbar [template]=\"ganttUpper.toolbarTemplate\"> </gantt-toolbar>\n}\n", dependencies: [{ kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: NgxGanttToolbarComponent, selector: "ngx-gantt-toolbar,gantt-toolbar", inputs: ["template"] }, { kind: "directive", type: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }, { kind: "directive", type: GanttSyncScrollYDirective, selector: "[syncScrollY]", inputs: ["syncScrollY"] }] }); }
4475
4384
  }
4476
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
4385
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
4477
4386
  type: Component,
4478
4387
  args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer, GanttSyncScrollService], host: {
4479
4388
  class: 'gantt'
@@ -4487,12 +4396,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
4487
4396
  GanttSyncScrollXDirective,
4488
4397
  GanttSyncScrollYDirective
4489
4398
  ], template: "@if (sideTemplate) {\n <div class=\"gantt-side\" [style.width.px]=\"sideWidth\" [style.padding-bottom.px]=\"horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\" syncScrollX=\"ganttTableXScroll\" syncScrollY=\"ganttMainYScroll\" cdkScrollable>\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n </div>\n}\n@if (mainTemplate) {\n <div class=\"gantt-container\">\n <gantt-calendar-header syncScrollX=\"ganttMainXScroll\" [style.padding-right.px]=\"verticalScrollbarWidth\"></gantt-calendar-header>\n <gantt-calendar-grid\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <div class=\"gantt-main-container\" syncScrollX=\"ganttMainXScroll\" syncScrollY=\"ganttMainYScroll\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n </div>\n </div>\n}\n<ng-content></ng-content>\n@if (ganttUpper.showToolbar || ganttUpper.toolbarTemplate) {\n <gantt-toolbar [template]=\"ganttUpper.toolbarTemplate\"> </gantt-toolbar>\n}\n" }]
4490
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
4491
- type: Inject,
4492
- args: [GANTT_UPPER_TOKEN]
4493
- }] }, { type: GanttPrintService, decorators: [{
4494
- type: Optional
4495
- }] }], propDecorators: { sideWidth: [{
4399
+ }], ctorParameters: () => [], propDecorators: { sideWidth: [{
4496
4400
  type: Input
4497
4401
  }], sideTemplate: [{
4498
4402
  type: ContentChild,
@@ -4512,17 +4416,17 @@ class NgxGanttTableColumnComponent {
4512
4416
  set width(width) {
4513
4417
  this.columnWidth = coerceCssPixelValue(width);
4514
4418
  }
4515
- constructor(ganttUpper, elementRef) {
4516
- this.ganttUpper = ganttUpper;
4517
- this.elementRef = elementRef;
4419
+ constructor() {
4420
+ this.ganttUpper = inject(GANTT_UPPER_TOKEN);
4421
+ this.elementRef = inject(ElementRef);
4518
4422
  }
4519
4423
  get classList() {
4520
4424
  return this.elementRef.nativeElement.classList;
4521
4425
  }
4522
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
4523
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: NgxGanttTableColumnComponent, isStandalone: true, selector: "ngx-gantt-column", inputs: { width: "width", name: "name", showExpandIcon: "showExpandIcon" }, host: { classAttribute: "gantt-table-column" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true }); }
4426
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4427
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: NgxGanttTableColumnComponent, isStandalone: true, selector: "ngx-gantt-column", inputs: { width: "width", name: "name", showExpandIcon: "showExpandIcon" }, host: { classAttribute: "gantt-table-column" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true }); }
4524
4428
  }
4525
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
4429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
4526
4430
  type: Component,
4527
4431
  args: [{
4528
4432
  selector: 'ngx-gantt-column',
@@ -4532,10 +4436,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
4532
4436
  },
4533
4437
  standalone: true
4534
4438
  }]
4535
- }], ctorParameters: () => [{ type: GanttUpper, decorators: [{
4536
- type: Inject,
4537
- args: [GANTT_UPPER_TOKEN]
4538
- }] }, { type: i0.ElementRef }], propDecorators: { width: [{
4439
+ }], ctorParameters: () => [], propDecorators: { width: [{
4539
4440
  type: Input
4540
4441
  }], name: [{
4541
4442
  type: Input
@@ -4559,10 +4460,10 @@ class NgxGanttTableComponent {
4559
4460
  this.resizeChange = new EventEmitter();
4560
4461
  this.itemClick = new EventEmitter();
4561
4462
  }
4562
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4563
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: NgxGanttTableComponent, isStandalone: true, selector: "ngx-gantt-table", inputs: { draggable: "draggable", maxWidth: "maxWidth", width: "width", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", columnChanges: "columnChanges", resizeChange: "resizeChange", 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 }, { propertyName: "settingsSlot", first: true, predicate: ["settingsSlot"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true }); }
4463
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4464
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: NgxGanttTableComponent, isStandalone: true, selector: "ngx-gantt-table", inputs: { draggable: "draggable", maxWidth: "maxWidth", width: "width", dropEnterPredicate: "dropEnterPredicate" }, outputs: { dragDropped: "dragDropped", dragStarted: "dragStarted", dragEnded: "dragEnded", columnChanges: "columnChanges", resizeChange: "resizeChange", 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 }, { propertyName: "settingsSlot", first: true, predicate: ["settingsSlot"], descendants: true, static: true }], ngImport: i0, template: '', isInline: true }); }
4564
4465
  }
4565
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
4466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
4566
4467
  type: Component,
4567
4468
  args: [{
4568
4469
  selector: 'ngx-gantt-table',
@@ -4627,9 +4528,9 @@ class NgxGanttComponent extends GanttUpper {
4627
4528
  get loading() {
4628
4529
  return this._loading;
4629
4530
  }
4630
- constructor(elementRef, cdr, ngZone, viewportRuler, config) {
4631
- super(elementRef, cdr, ngZone, config);
4632
- this.viewportRuler = viewportRuler;
4531
+ constructor() {
4532
+ super();
4533
+ this.viewportRuler = inject(ViewportRuler);
4633
4534
  this.maxLevel = 2;
4634
4535
  this.virtualScrollEnabled = true;
4635
4536
  this.loadingDelay = 0;
@@ -4638,7 +4539,7 @@ class NgxGanttComponent extends GanttUpper {
4638
4539
  this.lineClick = new EventEmitter();
4639
4540
  this.selectedChange = new EventEmitter();
4640
4541
  this.virtualScrolledIndexChange = new EventEmitter();
4641
- this.tableScrollWidth = signal(0);
4542
+ this.tableScrollWidth = signal(0, ...(ngDevMode ? [{ debugName: "tableScrollWidth" }] : []));
4642
4543
  this.flatItems = [];
4643
4544
  this.viewportItems = [];
4644
4545
  this._loading = false;
@@ -4867,8 +4768,8 @@ class NgxGanttComponent extends GanttUpper {
4867
4768
  this.resizeObserver.disconnect();
4868
4769
  }
4869
4770
  }
4870
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1$1.ViewportRuler }, { token: GANTT_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Component }); }
4871
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttComponent, isStandalone: true, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", virtualScrollEnabled: "virtualScrollEnabled", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange", virtualScrolledIndexChange: "virtualScrolledIndexChange" }, providers: [
4771
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4772
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: NgxGanttComponent, isStandalone: true, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable", loading: "loading", virtualScrollEnabled: "virtualScrollEnabled", loadingDelay: "loadingDelay" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange", virtualScrolledIndexChange: "virtualScrolledIndexChange" }, providers: [
4872
4773
  {
4873
4774
  provide: GANTT_UPPER_TOKEN,
4874
4775
  useExisting: NgxGanttComponent
@@ -4879,7 +4780,7 @@ class NgxGanttComponent extends GanttUpper {
4879
4780
  }
4880
4781
  ], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], viewQueries: [{ propertyName: "ganttRoot", first: true, predicate: ["ganttRoot"], descendants: true }, { propertyName: "virtualScroll", first: true, predicate: CdkVirtualScrollViewport, descendants: true }, { propertyName: "ganttTableBody", first: true, predicate: ["ganttTableBody"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n ></gantt-calendar-header>\n </div>\n </div>\n @if (loading) {\n <gantt-loader></gantt-loader>\n }\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [ngClass]=\"{\n 'gantt-normal-viewport': !virtualScrollEnabled,\n 'gantt-scroll-container': virtualScrollEnabled,\n 'with-footer': table?.tableFooterTemplate || footerTemplate\n }\"\n [style.top.px]=\"styles.headerHeight\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n (scrolledIndexChange)=\"scrolledIndexChange($event)\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\" [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\" syncScrollX=\"ganttTableXScroll\" syncScrollY=\"ganttMainYScroll\">\n <div class=\"gantt-table\">\n <gantt-table-body\n #ganttTableBody\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"table.tableEmptyTemplate || tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"itemDragStarted($event)\"\n (dragEnded)=\"itemDragEnded($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n syncScrollX=\"ganttMainXScroll\"\n syncScrollY=\"ganttMainYScroll\"\n [ganttRoot]=\"ganttRoot\"\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n [baselineTemplate]=\"baselineTemplate\"\n [quickTimeFocus]=\"quickTimeFocus\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n\n <gantt-scrollbar\n [ganttRoot]=\"ganttRoot\"\n [hasFooter]=\"!!table?.tableFooterTemplate\"\n [tableWidth]=\"tableHeader.tableWidth\"\n [tableScrollWidth]=\"tableScrollWidth()\"\n ></gantt-scrollbar>\n\n @if (table?.tableFooterTemplate || footerTemplate) {\n <div\n class=\"gantt-footer\"\n cdkScrollable\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n @if (table?.tableFooterTemplate) {\n <div class=\"gantt-table-footer\" syncScrollX=\"ganttTableXScroll\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n }\n @if (footerTemplate) {\n <div class=\"gantt-container-footer\" syncScrollX=\"ganttMainXScroll\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n }\n </div>\n }\n</ngx-gantt-root>\n", dependencies: [{ kind: "component", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { kind: "component", type: GanttTableHeaderComponent, selector: "gantt-table-header", inputs: ["columns"] }, { kind: "component", type: GanttCalendarHeaderComponent, selector: "gantt-calendar-header" }, { kind: "component", type: GanttLoaderComponent, selector: "gantt-loader" }, { kind: "component", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: GanttTableBodyComponent, selector: "gantt-table-body", inputs: ["viewportItems", "flatItems", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate", "draggable", "dropEnterPredicate"], outputs: ["dragDropped", "dragStarted", "dragEnded", "itemClick"] }, { kind: "component", type: GanttCalendarGridComponent, selector: "gantt-calendar-grid" }, { kind: "component", type: GanttMainComponent, selector: "gantt-main", inputs: ["viewportItems", "flatItems", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate", "baselineTemplate", "ganttRoot", "quickTimeFocus"], outputs: ["barClick", "lineClick"] }, { kind: "component", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }, { kind: "component", type: GanttScrollbarComponent, selector: "gantt-scrollbar", inputs: ["hasFooter", "tableWidth", "ganttRoot", "tableScrollWidth"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: GanttSyncScrollXDirective, selector: "[syncScrollX]", inputs: ["syncScrollX"] }, { kind: "directive", type: GanttSyncScrollYDirective, selector: "[syncScrollY]", inputs: ["syncScrollY"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4881
4782
  }
4882
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttComponent, decorators: [{
4783
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttComponent, decorators: [{
4883
4784
  type: Component,
4884
4785
  args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
4885
4786
  {
@@ -4908,10 +4809,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
4908
4809
  GanttSyncScrollXDirective,
4909
4810
  GanttSyncScrollYDirective
4910
4811
  ], template: "<ngx-gantt-root #ganttRoot>\n <div class=\"gantt-header\">\n <gantt-table-header #tableHeader [columns]=\"columns\"></gantt-table-header>\n <div class=\"gantt-container-header\">\n <gantt-calendar-header\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n ></gantt-calendar-header>\n </div>\n </div>\n @if (loading) {\n <gantt-loader></gantt-loader>\n }\n\n <cdk-virtual-scroll-viewport\n class=\"gantt-virtual-scroll-viewport\"\n [ngClass]=\"{\n 'gantt-normal-viewport': !virtualScrollEnabled,\n 'gantt-scroll-container': virtualScrollEnabled,\n 'with-footer': table?.tableFooterTemplate || footerTemplate\n }\"\n [style.top.px]=\"styles.headerHeight\"\n [itemSize]=\"styles.lineHeight\"\n [minBufferPx]=\"styles.lineHeight * 10\"\n [maxBufferPx]=\"styles.lineHeight * 20\"\n (scrolledIndexChange)=\"scrolledIndexChange($event)\"\n >\n <ng-container *cdkVirtualFor=\"let item of flatItems; trackBy: trackBy\"></ng-container>\n <div class=\"gantt-side\" [style.width.px]=\"tableHeader.tableWidth + 1\" [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\">\n <div class=\"gantt-side-container\" syncScrollX=\"ganttTableXScroll\" syncScrollY=\"ganttMainYScroll\">\n <div class=\"gantt-table\">\n <gantt-table-body\n #ganttTableBody\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"table.tableEmptyTemplate || tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n [draggable]=\"table.draggable\"\n [dropEnterPredicate]=\"table.dropEnterPredicate\"\n (dragDropped)=\"table.dragDropped.emit($event)\"\n (dragStarted)=\"itemDragStarted($event)\"\n (dragEnded)=\"itemDragEnded($event)\"\n (itemClick)=\"selectItem($event)\"\n >\n </gantt-table-body>\n </div>\n </div>\n </div>\n <div class=\"gantt-container\">\n <gantt-calendar-grid\n syncScrollX=\"ganttMainXScroll\"\n [style.padding-right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.padding-bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n ></gantt-calendar-grid>\n <div class=\"gantt-main\">\n <gantt-main\n syncScrollX=\"ganttMainXScroll\"\n syncScrollY=\"ganttMainYScroll\"\n [ganttRoot]=\"ganttRoot\"\n [flatItems]=\"flatItems\"\n [viewportItems]=\"viewportItems\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n [baselineTemplate]=\"baselineTemplate\"\n [quickTimeFocus]=\"quickTimeFocus\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </div>\n </div>\n </cdk-virtual-scroll-viewport>\n\n <gantt-drag-backdrop [style.left.px]=\"tableHeader.tableWidth + 1\"></gantt-drag-backdrop>\n\n <gantt-scrollbar\n [ganttRoot]=\"ganttRoot\"\n [hasFooter]=\"!!table?.tableFooterTemplate\"\n [tableWidth]=\"tableHeader.tableWidth\"\n [tableScrollWidth]=\"tableScrollWidth()\"\n ></gantt-scrollbar>\n\n @if (table?.tableFooterTemplate || footerTemplate) {\n <div\n class=\"gantt-footer\"\n cdkScrollable\n [style.right.px]=\"ganttRoot.verticalScrollbarWidth\"\n [style.bottom.px]=\"ganttRoot.horizontalScrollbarHeight\"\n >\n @if (table?.tableFooterTemplate) {\n <div class=\"gantt-table-footer\" syncScrollX=\"ganttTableXScroll\" [style.width.px]=\"tableHeader.tableWidth + 1\">\n <ng-template [ngTemplateOutlet]=\"table?.tableFooterTemplate\" [ngTemplateOutletContext]=\"{ columns: columns }\"> </ng-template>\n </div>\n }\n @if (footerTemplate) {\n <div class=\"gantt-container-footer\" syncScrollX=\"ganttMainXScroll\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"> </ng-template>\n </div>\n }\n </div>\n }\n</ngx-gantt-root>\n" }]
4911
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$1.ViewportRuler }, { type: undefined, decorators: [{
4912
- type: Inject,
4913
- args: [GANTT_GLOBAL_CONFIG]
4914
- }] }], propDecorators: { maxLevel: [{
4812
+ }], ctorParameters: () => [], propDecorators: { maxLevel: [{
4915
4813
  type: Input
4916
4814
  }], async: [{
4917
4815
  type: Input
@@ -4960,8 +4858,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
4960
4858
 
4961
4859
  class NgxGanttModule {
4962
4860
  constructor() { }
4963
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4964
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttModule, imports: [CommonModule,
4861
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4862
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, imports: [CommonModule,
4965
4863
  DragDropModule,
4966
4864
  ScrollingModule,
4967
4865
  NgxGanttComponent,
@@ -4997,7 +4895,7 @@ class NgxGanttModule {
4997
4895
  GanttCalendarGridComponent,
4998
4896
  GanttDragBackdropComponent,
4999
4897
  GanttScrollbarComponent] }); }
5000
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttModule, providers: [
4898
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, providers: [
5001
4899
  CdkVirtualScrollViewport,
5002
4900
  {
5003
4901
  provide: GANTT_GLOBAL_CONFIG,
@@ -5009,7 +4907,7 @@ class NgxGanttModule {
5009
4907
  ScrollingModule,
5010
4908
  NgxGanttComponent] }); }
5011
4909
  }
5012
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttModule, decorators: [{
4910
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, decorators: [{
5013
4911
  type: NgModule,
5014
4912
  args: [{
5015
4913
  imports: [
@@ -5072,5 +4970,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
5072
4970
  * Generated bundle index. Do not edit.
5073
4971
  */
5074
4972
 
5075
- export { GANTT_GLOBAL_CONFIG, GANTT_I18N_LOCALE_TOKEN, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttConfigService, GanttDate, GanttDatePoint, GanttDragBackdropComponent, GanttDragEvent, GanttGroupInternal, GanttI18nLocale, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttScrollbarComponent, GanttSelectedEvent, GanttSyncScrollService, GanttSyncScrollXDirective, GanttSyncScrollYDirective, GanttTableDragDroppedEvent, GanttTableDragEndedEvent, GanttTableDragEnterPredicateContext, GanttTableDragStartedEvent, GanttTableEvent, GanttTableItemClickEvent, GanttUpper, GanttView, GanttViewType, GanttVirtualScrolledIndexChangeEvent, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttGroupPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, deDeLocale, defaultConfig, enUsLocale, getDefaultTimeZone, jaJpLocale, primaryDatePointTop, registerView, ruRuLocale, secondaryDatePointTop, setDefaultTimeZone, zhHansLocale, zhHantLocale };
4973
+ export { GANTT_GLOBAL_CONFIG, GANTT_I18N_LOCALE_TOKEN, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttConfigService, GanttDate, GanttDatePoint, GanttDragBackdropComponent, GanttDragEvent, GanttGroupInternal, GanttI18nLocale, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttScrollbarComponent, GanttSelectedEvent, GanttTableDragDroppedEvent, GanttTableDragEndedEvent, GanttTableDragEnterPredicateContext, GanttTableDragStartedEvent, GanttTableEvent, GanttTableItemClickEvent, GanttUpper, GanttView, GanttViewType, GanttVirtualScrolledIndexChangeEvent, IsGanttBarItemPipe, IsGanttCustomItemPipe, IsGanttGroupPipe, IsGanttRangeItemPipe, LinkColors, NgxGanttBarComponent, NgxGanttBaselineComponent, NgxGanttComponent, NgxGanttModule, NgxGanttRangeComponent, NgxGanttRootComponent, NgxGanttTableColumnComponent, NgxGanttTableComponent, NgxGanttToolbarComponent, deDeLocale, defaultConfig, enUsLocale, getDefaultTimeZone, jaJpLocale, primaryDatePointTop, registerView, ruRuLocale, secondaryDatePointTop, setDefaultTimeZone, zhHans as zhHansLocale, zhHant as zhHantLocale };
5076
4974
  //# sourceMappingURL=worktile-gantt.mjs.map