@worktile/gantt 19.0.8-next.3 → 20.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/table/gantt-table.scss +0 -2
- package/fesm2022/worktile-gantt.mjs +1405 -1483
- package/fesm2022/worktile-gantt.mjs.map +1 -1
- package/gantt.component.scss +0 -4
- package/index.d.ts +1405 -5
- package/package.json +4 -4
- package/class/baseline.d.ts +0 -26
- package/class/date-point.d.ts +0 -19
- package/class/event.d.ts +0 -64
- package/class/group.d.ts +0 -22
- package/class/index.d.ts +0 -8
- package/class/item.d.ts +0 -76
- package/class/link.d.ts +0 -54
- package/class/toolbar.d.ts +0 -4
- package/class/view-type.d.ts +0 -8
- package/components/bar/bar-drag.d.ts +0 -78
- package/components/bar/bar.component.d.ts +0 -26
- package/components/baseline/baseline.component.d.ts +0 -18
- package/components/calendar/grid/calendar-grid.component.d.ts +0 -21
- package/components/calendar/header/calendar-header.component.d.ts +0 -19
- package/components/drag-backdrop/drag-backdrop.component.d.ts +0 -8
- package/components/icon/icon.component.d.ts +0 -11
- package/components/icon/icons.d.ts +0 -11
- package/components/links/lines/curve.d.ts +0 -10
- package/components/links/lines/factory.d.ts +0 -5
- package/components/links/lines/line.d.ts +0 -8
- package/components/links/lines/straight.d.ts +0 -9
- package/components/links/links.component.d.ts +0 -37
- package/components/loader/loader.component.d.ts +0 -5
- package/components/main/gantt-main.component.d.ts +0 -32
- package/components/range/range.component.d.ts +0 -10
- package/components/scrollbar/scrollbar.component.d.ts +0 -13
- package/components/table/body/gantt-table-body.component.d.ts +0 -62
- package/components/table/header/gantt-table-header.component.d.ts +0 -35
- package/components/toolbar/toolbar.component.d.ts +0 -21
- package/directives/sync-scroll.directive.d.ts +0 -22
- package/gantt-abstract.d.ts +0 -14
- package/gantt-dom.service.d.ts +0 -48
- package/gantt-drag-container.d.ts +0 -36
- package/gantt-item-upper.d.ts +0 -22
- package/gantt-print.service.d.ts +0 -13
- package/gantt-sync-scroll.service.d.ts +0 -11
- package/gantt-upper.d.ts +0 -101
- package/gantt.component.d.ts +0 -66
- package/gantt.config.d.ts +0 -50
- package/gantt.module.d.ts +0 -29
- package/gantt.pipe.d.ts +0 -23
- package/gantt.styles.d.ts +0 -9
- package/i18n/i18n.d.ts +0 -23
- package/i18n/index.d.ts +0 -10
- package/i18n/locales/de-de.d.ts +0 -49
- package/i18n/locales/en-us.d.ts +0 -48
- package/i18n/locales/ja-jp.d.ts +0 -48
- package/i18n/locales/ru-ru.d.ts +0 -49
- package/i18n/locales/zh-hans.d.ts +0 -48
- package/i18n/locales/zh-hant.d.ts +0 -48
- package/public-api.d.ts +0 -26
- package/root.component.d.ts +0 -36
- package/table/gantt-column.component.d.ts +0 -17
- package/table/gantt-table.component.d.ts +0 -22
- package/utils/date.d.ts +0 -66
- package/utils/drag-scroll.d.ts +0 -27
- package/utils/helpers.d.ts +0 -15
- package/utils/passive-listeners.d.ts +0 -13
- package/utils/set-style-with-vendor-prefix.d.ts +0 -12
- package/views/day.d.ts +0 -15
- package/views/factory.d.ts +0 -10
- package/views/hour.d.ts +0 -19
- package/views/month.d.ts +0 -14
- package/views/quarter.d.ts +0 -14
- package/views/view.d.ts +0 -90
- package/views/week.d.ts +0 -14
- package/views/year.d.ts +0 -14
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
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
|
|
13
|
-
import {
|
|
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
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
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
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
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
|
-
|
|
692
|
-
|
|
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
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
[
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
[
|
|
740
|
-
|
|
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
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
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
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
{
|
|
829
|
-
|
|
830
|
-
|
|
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() {
|
|
@@ -1007,160 +736,321 @@ class GanttView {
|
|
|
1007
736
|
}
|
|
1008
737
|
}
|
|
1009
738
|
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
}
|
|
1066
|
-
return points;
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
const viewOptions$4 = {
|
|
1071
|
-
cellWidth: 80,
|
|
1072
|
-
start: new GanttDate().startOfMonth(),
|
|
1073
|
-
end: new GanttDate().endOfMonth(),
|
|
1074
|
-
datePrecisionUnit: 'minute',
|
|
1075
|
-
addAmount: 1,
|
|
1076
|
-
addUnit: 'week',
|
|
1077
|
-
dateDisplayFormats: zhHantLocale.views.hour.dateFormats,
|
|
1078
|
-
dragPreviewDateFormat: 'HH:mm'
|
|
1079
|
-
};
|
|
1080
|
-
class GanttViewHour extends GanttView {
|
|
1081
|
-
constructor(start, end, options) {
|
|
1082
|
-
super(start, end, Object.assign({}, viewOptions$4, options));
|
|
1083
|
-
this.showTimeline = true;
|
|
1084
|
-
this.viewType = GanttViewType.hour;
|
|
1085
|
-
}
|
|
1086
|
-
viewStartOf(date) {
|
|
1087
|
-
return date.startOfWeek();
|
|
1088
|
-
}
|
|
1089
|
-
viewEndOf(date) {
|
|
1090
|
-
return date.endOfWeek();
|
|
1091
|
-
}
|
|
1092
|
-
getPrimaryWidth() {
|
|
1093
|
-
return this.getCellWidth() * 24;
|
|
1094
|
-
}
|
|
1095
|
-
getDayOccupancyWidth() {
|
|
1096
|
-
return this.cellWidth * 60;
|
|
1097
|
-
}
|
|
1098
|
-
getHourOccupancyWidth() {
|
|
1099
|
-
return this.getDayOccupancyWidth() / 60;
|
|
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'
|
|
758
|
+
}
|
|
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年'
|
|
792
|
+
}
|
|
793
|
+
}
|
|
1100
794
|
}
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
795
|
+
};
|
|
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
|
+
}
|
|
1108
840
|
}
|
|
1109
|
-
return points;
|
|
1110
841
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
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
|
+
}
|
|
1121
887
|
}
|
|
1122
|
-
return points;
|
|
1123
888
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
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
|
+
}
|
|
1129
934
|
}
|
|
1130
|
-
|
|
1131
|
-
|
|
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
|
+
}
|
|
1132
982
|
}
|
|
1133
983
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
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
|
+
}
|
|
1139
1030
|
}
|
|
1140
|
-
result = minutes >= 0 ? result : -result;
|
|
1141
|
-
return Number(result.toFixed(3));
|
|
1142
|
-
}
|
|
1143
|
-
getDateByXPoint(x) {
|
|
1144
|
-
const hourWidth = this.getHourOccupancyWidth();
|
|
1145
|
-
const indexOfSecondaryDate = Math.max(Math.floor(x / hourWidth), 0);
|
|
1146
|
-
const matchDate = this.secondaryDatePoints[Math.min(this.secondaryDatePoints.length - 1, indexOfSecondaryDate)];
|
|
1147
|
-
const minuteWidth = hourWidth / 60;
|
|
1148
|
-
const underOneHourMinutes = Math.floor((x % hourWidth) / minuteWidth);
|
|
1149
|
-
return matchDate?.start.addMinutes(underOneHourMinutes);
|
|
1150
1031
|
}
|
|
1151
|
-
}
|
|
1032
|
+
};
|
|
1152
1033
|
|
|
1153
|
-
const
|
|
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 = {
|
|
1154
1044
|
start: new GanttDate().startOfQuarter().addQuarters(-1),
|
|
1155
1045
|
end: new GanttDate().endOfQuarter().addQuarters(2),
|
|
1156
1046
|
cellWidth: 280,
|
|
1157
1047
|
addAmount: 1,
|
|
1158
1048
|
addUnit: 'quarter',
|
|
1159
|
-
dateDisplayFormats:
|
|
1049
|
+
dateDisplayFormats: zhHant.views.month.dateFormats
|
|
1160
1050
|
};
|
|
1161
1051
|
class GanttViewMonth extends GanttView {
|
|
1162
1052
|
constructor(start, end, options) {
|
|
1163
|
-
super(start, end, Object.assign({}, viewOptions$
|
|
1053
|
+
super(start, end, Object.assign({}, viewOptions$5, options));
|
|
1164
1054
|
this.viewType = GanttViewType.month;
|
|
1165
1055
|
}
|
|
1166
1056
|
viewStartOf(date) {
|
|
@@ -1197,7 +1087,7 @@ class GanttViewMonth extends GanttView {
|
|
|
1197
1087
|
}
|
|
1198
1088
|
}
|
|
1199
1089
|
|
|
1200
|
-
const viewOptions$
|
|
1090
|
+
const viewOptions$4 = {
|
|
1201
1091
|
start: new GanttDate().addYears(-1).startOfYear(),
|
|
1202
1092
|
end: new GanttDate().addYears(1).endOfYear(),
|
|
1203
1093
|
min: new GanttDate().addYears(-2).startOfYear(),
|
|
@@ -1205,11 +1095,11 @@ const viewOptions$2 = {
|
|
|
1205
1095
|
cellWidth: 500,
|
|
1206
1096
|
addAmount: 1,
|
|
1207
1097
|
addUnit: 'year',
|
|
1208
|
-
dateDisplayFormats:
|
|
1098
|
+
dateDisplayFormats: zhHant.views.quarter.dateFormats
|
|
1209
1099
|
};
|
|
1210
1100
|
class GanttViewQuarter extends GanttView {
|
|
1211
1101
|
constructor(start, end, options) {
|
|
1212
|
-
super(start, end, Object.assign({}, viewOptions$
|
|
1102
|
+
super(start, end, Object.assign({}, viewOptions$4, options));
|
|
1213
1103
|
this.viewType = GanttViewType.quarter;
|
|
1214
1104
|
}
|
|
1215
1105
|
viewStartOf(date) {
|
|
@@ -1246,17 +1136,69 @@ class GanttViewQuarter extends GanttView {
|
|
|
1246
1136
|
}
|
|
1247
1137
|
}
|
|
1248
1138
|
|
|
1249
|
-
const viewOptions$
|
|
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 = {
|
|
1250
1192
|
cellWidth: 280,
|
|
1251
1193
|
start: new GanttDate().startOfYear().startOfWeek(),
|
|
1252
1194
|
end: new GanttDate().endOfYear().endOfWeek(),
|
|
1253
1195
|
addAmount: 1,
|
|
1254
1196
|
addUnit: 'month',
|
|
1255
|
-
dateDisplayFormats:
|
|
1197
|
+
dateDisplayFormats: zhHant.views.week.dateFormats
|
|
1256
1198
|
};
|
|
1257
1199
|
class GanttViewWeek extends GanttView {
|
|
1258
1200
|
constructor(start, end, options) {
|
|
1259
|
-
super(start, end, Object.assign({}, viewOptions$
|
|
1201
|
+
super(start, end, Object.assign({}, viewOptions$2, options));
|
|
1260
1202
|
this.viewType = GanttViewType.week;
|
|
1261
1203
|
}
|
|
1262
1204
|
viewStartOf(date) {
|
|
@@ -1294,17 +1236,17 @@ class GanttViewWeek extends GanttView {
|
|
|
1294
1236
|
}
|
|
1295
1237
|
}
|
|
1296
1238
|
|
|
1297
|
-
const viewOptions = {
|
|
1239
|
+
const viewOptions$1 = {
|
|
1298
1240
|
cellWidth: 480,
|
|
1299
1241
|
start: new GanttDate().addYears(-2).startOfYear(),
|
|
1300
1242
|
end: new GanttDate().addYears(2).endOfYear(),
|
|
1301
1243
|
addAmount: 1,
|
|
1302
1244
|
addUnit: 'year',
|
|
1303
|
-
dateDisplayFormats:
|
|
1245
|
+
dateDisplayFormats: zhHant.views.year.dateFormats
|
|
1304
1246
|
};
|
|
1305
1247
|
class GanttViewYear extends GanttView {
|
|
1306
1248
|
constructor(start, end, options) {
|
|
1307
|
-
super(start, end, Object.assign({}, viewOptions, options));
|
|
1249
|
+
super(start, end, Object.assign({}, viewOptions$1, options));
|
|
1308
1250
|
this.viewType = GanttViewType.year;
|
|
1309
1251
|
}
|
|
1310
1252
|
viewStartOf(date) {
|
|
@@ -1329,33 +1271,179 @@ class GanttViewYear extends GanttView {
|
|
|
1329
1271
|
}
|
|
1330
1272
|
return points;
|
|
1331
1273
|
}
|
|
1332
|
-
getSecondaryDatePoints() {
|
|
1333
|
-
const years = differenceInCalendarYears(this.end.value, this.start.value);
|
|
1334
|
-
const points = [];
|
|
1335
|
-
const pointTop = '60%';
|
|
1336
|
-
for (let i = 0; i <= years; i++) {
|
|
1337
|
-
const start = this.start.addYears(i);
|
|
1338
|
-
const point = new GanttDatePoint(start, `${start.format(this.options.dateFormat?.year || this.options.dateDisplayFormats.secondary || this.options.dateDisplayFormats.primary)}`, i * this.getCellWidth() + this.getCellWidth() / 2, pointTop);
|
|
1339
|
-
points.push(point);
|
|
1340
|
-
}
|
|
1341
|
-
return points;
|
|
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
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
setLocale(locale) {
|
|
1429
|
+
this.config.locale = locale;
|
|
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;
|
|
1342
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' }); }
|
|
1343
1442
|
}
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
[GanttViewType.week]: GanttViewWeek,
|
|
1349
|
-
[GanttViewType.month]: GanttViewMonth,
|
|
1350
|
-
[GanttViewType.quarter]: GanttViewQuarter,
|
|
1351
|
-
[GanttViewType.year]: GanttViewYear
|
|
1352
|
-
};
|
|
1353
|
-
function registerView(type, view) {
|
|
1354
|
-
ganttViewsMap[type] = view;
|
|
1355
|
-
}
|
|
1356
|
-
function createViewFactory(type, start, end, options) {
|
|
1357
|
-
return new ganttViewsMap[type](start, end, options);
|
|
1358
|
-
}
|
|
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: () => [] });
|
|
1359
1447
|
|
|
1360
1448
|
class GanttUpper {
|
|
1361
1449
|
set linkOptions(options) {
|
|
@@ -1389,12 +1477,11 @@ class GanttUpper {
|
|
|
1389
1477
|
get element() {
|
|
1390
1478
|
return this.elementRef.nativeElement;
|
|
1391
1479
|
}
|
|
1392
|
-
constructor(
|
|
1393
|
-
|
|
1394
|
-
this.
|
|
1395
|
-
this.
|
|
1396
|
-
this.
|
|
1397
|
-
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);
|
|
1398
1485
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
1399
1486
|
this.originItems = [];
|
|
1400
1487
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
@@ -1667,12 +1754,12 @@ class GanttUpper {
|
|
|
1667
1754
|
rerenderView() {
|
|
1668
1755
|
this.changeView(this.viewType);
|
|
1669
1756
|
}
|
|
1670
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1671
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
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 }); }
|
|
1672
1759
|
}
|
|
1673
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1760
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttUpper, decorators: [{
|
|
1674
1761
|
type: Directive
|
|
1675
|
-
}], ctorParameters: () => [
|
|
1762
|
+
}], ctorParameters: () => [], propDecorators: { originItems: [{
|
|
1676
1763
|
type: Input,
|
|
1677
1764
|
args: ['items']
|
|
1678
1765
|
}], originGroups: [{
|
|
@@ -1750,65 +1837,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
1750
1837
|
}] } });
|
|
1751
1838
|
const GANTT_UPPER_TOKEN = new InjectionToken('GANTT_UPPER_TOKEN');
|
|
1752
1839
|
|
|
1753
|
-
class GanttItemUpper {
|
|
1754
|
-
constructor(elementRef, ganttUpper) {
|
|
1755
|
-
this.elementRef = elementRef;
|
|
1756
|
-
this.ganttUpper = ganttUpper;
|
|
1757
|
-
this.firstChange = true;
|
|
1758
|
-
this.unsubscribe$ = new Subject();
|
|
1759
|
-
this.refsUnsubscribe$ = new Subject();
|
|
1760
|
-
}
|
|
1761
|
-
ngOnInit() {
|
|
1762
|
-
this.firstChange = false;
|
|
1763
|
-
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
1764
|
-
this.setPositions();
|
|
1765
|
-
});
|
|
1766
|
-
}
|
|
1767
|
-
ngOnChanges(changes) {
|
|
1768
|
-
if (!this.firstChange) {
|
|
1769
|
-
this.itemChange(changes.item.currentValue);
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
itemChange(item) {
|
|
1773
|
-
this.refsUnsubscribe$.next();
|
|
1774
|
-
this.refsUnsubscribe$.complete();
|
|
1775
|
-
this.item = item;
|
|
1776
|
-
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
1777
|
-
this.setPositions();
|
|
1778
|
-
});
|
|
1779
|
-
}
|
|
1780
|
-
setPositions() {
|
|
1781
|
-
const itemElement = this.elementRef.nativeElement;
|
|
1782
|
-
itemElement.style.left = this.item.refs?.x + 'px';
|
|
1783
|
-
itemElement.style.top = this.item.refs?.y + 'px';
|
|
1784
|
-
itemElement.style.width = this.item.refs?.width + 'px';
|
|
1785
|
-
if (this.item.type === GanttItemType.bar) {
|
|
1786
|
-
itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
|
|
1787
|
-
}
|
|
1788
|
-
else if (this.item.type === GanttItemType.range) {
|
|
1789
|
-
itemElement.style.height = rangeHeight + 'px';
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
ngOnDestroy() {
|
|
1793
|
-
this.unsubscribe$.next();
|
|
1794
|
-
this.unsubscribe$.complete();
|
|
1795
|
-
this.refsUnsubscribe$.next();
|
|
1796
|
-
this.refsUnsubscribe$.complete();
|
|
1797
|
-
}
|
|
1798
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1799
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.3", type: GanttItemUpper, isStandalone: true, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 }); }
|
|
1800
|
-
}
|
|
1801
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, decorators: [{
|
|
1802
|
-
type: Directive
|
|
1803
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
1804
|
-
type: Inject,
|
|
1805
|
-
args: [GANTT_UPPER_TOKEN]
|
|
1806
|
-
}] }], propDecorators: { template: [{
|
|
1807
|
-
type: Input
|
|
1808
|
-
}], item: [{
|
|
1809
|
-
type: Input
|
|
1810
|
-
}] } });
|
|
1811
|
-
|
|
1812
1840
|
function getDependencyType(path, dependencyTypes) {
|
|
1813
1841
|
if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
|
|
1814
1842
|
return GanttLinkType.ss;
|
|
@@ -1827,8 +1855,8 @@ var InBarPosition;
|
|
|
1827
1855
|
InBarPosition["finish"] = "finish";
|
|
1828
1856
|
})(InBarPosition || (InBarPosition = {}));
|
|
1829
1857
|
class GanttDragContainer {
|
|
1830
|
-
constructor(
|
|
1831
|
-
this.ganttUpper =
|
|
1858
|
+
constructor() {
|
|
1859
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
1832
1860
|
this.dragStarted = new EventEmitter();
|
|
1833
1861
|
this.dragMoved = new EventEmitter();
|
|
1834
1862
|
this.dragEnded = new EventEmitter();
|
|
@@ -1872,15 +1900,12 @@ class GanttDragContainer {
|
|
|
1872
1900
|
this.linkDraggingId = null;
|
|
1873
1901
|
this.linkDragPath = { from: null, to: null };
|
|
1874
1902
|
}
|
|
1875
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1876
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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 }); }
|
|
1877
1905
|
}
|
|
1878
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1906
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDragContainer, decorators: [{
|
|
1879
1907
|
type: Injectable
|
|
1880
|
-
}], ctorParameters: () => [
|
|
1881
|
-
type: Inject,
|
|
1882
|
-
args: [GANTT_UPPER_TOKEN]
|
|
1883
|
-
}] }] });
|
|
1908
|
+
}], ctorParameters: () => [] });
|
|
1884
1909
|
|
|
1885
1910
|
/**
|
|
1886
1911
|
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
@@ -1966,122 +1991,6 @@ function normalizePassiveListenerOptions(options) {
|
|
|
1966
1991
|
/** Options used to bind passive event listeners. */
|
|
1967
1992
|
const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
1968
1993
|
|
|
1969
|
-
const scrollThreshold = 50;
|
|
1970
|
-
var ScrollDirection;
|
|
1971
|
-
(function (ScrollDirection) {
|
|
1972
|
-
ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
|
|
1973
|
-
ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
|
|
1974
|
-
ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
|
|
1975
|
-
})(ScrollDirection || (ScrollDirection = {}));
|
|
1976
|
-
class GanttDomService {
|
|
1977
|
-
constructor(ngZone, platformId) {
|
|
1978
|
-
this.ngZone = ngZone;
|
|
1979
|
-
this.platformId = platformId;
|
|
1980
|
-
this.visibleRangeX = signal({ min: 0, max: 0 });
|
|
1981
|
-
this.unsubscribe$ = new Subject();
|
|
1982
|
-
}
|
|
1983
|
-
disableBrowserWheelEvent() {
|
|
1984
|
-
const container = this.mainContainer;
|
|
1985
|
-
this.ngZone.runOutsideAngular(() => fromEvent(container, 'wheel')
|
|
1986
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
1987
|
-
.subscribe((event) => {
|
|
1988
|
-
const delta = event.deltaX;
|
|
1989
|
-
if (!delta) {
|
|
1990
|
-
return;
|
|
1991
|
-
}
|
|
1992
|
-
if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
|
|
1993
|
-
(container.scrollLeft === 0 && delta < 0)) {
|
|
1994
|
-
event.preventDefault();
|
|
1995
|
-
}
|
|
1996
|
-
}));
|
|
1997
|
-
}
|
|
1998
|
-
initialize(root) {
|
|
1999
|
-
this.root = root.nativeElement;
|
|
2000
|
-
this.side = this.root.getElementsByClassName('gantt-side')[0];
|
|
2001
|
-
this.container = this.root.getElementsByClassName('gantt-container')[0];
|
|
2002
|
-
this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
|
|
2003
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
2004
|
-
this.mainScrollbar = this.root.getElementsByClassName('gantt-main-scrollbar')[0];
|
|
2005
|
-
this.mainFooter = this.root.getElementsByClassName('gantt-container-footer')[0];
|
|
2006
|
-
this.verticalScrollContainer = this.root.getElementsByClassName('gantt-scroll-container')[0];
|
|
2007
|
-
const mainItems = this.mainContainer.getElementsByClassName('gantt-main-items')[0];
|
|
2008
|
-
const mainGroups = this.mainContainer.getElementsByClassName('gantt-main-groups')[0];
|
|
2009
|
-
this.mainItems = mainItems || mainGroups;
|
|
2010
|
-
this.calendarHeader = this.root.getElementsByClassName('gantt-calendar-header')[0];
|
|
2011
|
-
this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-grid')[0];
|
|
2012
|
-
this.disableBrowserWheelEvent();
|
|
2013
|
-
}
|
|
2014
|
-
/**
|
|
2015
|
-
* @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
|
|
2016
|
-
* to run the change detection if needed.
|
|
2017
|
-
*/
|
|
2018
|
-
getViewerScroll(options) {
|
|
2019
|
-
const scrollObservers = [fromEvent(this.mainContainer, 'scroll', options)];
|
|
2020
|
-
this.mainFooter && scrollObservers.push(fromEvent(this.mainFooter, 'scroll', options));
|
|
2021
|
-
this.mainScrollbar && scrollObservers.push(fromEvent(this.mainScrollbar, 'scroll', options));
|
|
2022
|
-
return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
2023
|
-
.pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
|
|
2024
|
-
this.setVisibleRangeX();
|
|
2025
|
-
const event = {
|
|
2026
|
-
target: this.mainContainer,
|
|
2027
|
-
direction: ScrollDirection.NONE
|
|
2028
|
-
};
|
|
2029
|
-
if (current - previous < 0) {
|
|
2030
|
-
if (this.mainContainer.scrollLeft < scrollThreshold && this.mainContainer.scrollLeft > 0) {
|
|
2031
|
-
event.direction = ScrollDirection.LEFT;
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
if (current - previous > 0) {
|
|
2035
|
-
if (this.mainContainer.scrollWidth - this.mainContainer.clientWidth - this.mainContainer.scrollLeft <
|
|
2036
|
-
scrollThreshold) {
|
|
2037
|
-
event.direction = ScrollDirection.RIGHT;
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
return event;
|
|
2041
|
-
}))
|
|
2042
|
-
.subscribe(subscriber)));
|
|
2043
|
-
}
|
|
2044
|
-
getResize() {
|
|
2045
|
-
return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
|
|
2046
|
-
}
|
|
2047
|
-
getResizeByElement(element) {
|
|
2048
|
-
return new Observable((observer) => {
|
|
2049
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
2050
|
-
observer.next();
|
|
2051
|
-
});
|
|
2052
|
-
resizeObserver.observe(element);
|
|
2053
|
-
});
|
|
2054
|
-
}
|
|
2055
|
-
scrollMainContainer(left) {
|
|
2056
|
-
if (isNumber(left)) {
|
|
2057
|
-
const scrollLeft = left - this.mainContainer.clientWidth / 2;
|
|
2058
|
-
this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
|
|
2059
|
-
this.calendarHeader.scrollLeft = this.mainContainer.scrollLeft;
|
|
2060
|
-
this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
|
|
2061
|
-
this.mainScrollbar && (this.mainScrollbar.scrollLeft = this.mainContainer.scrollLeft);
|
|
2062
|
-
this.mainFooter && (this.mainFooter.scrollLeft = this.mainContainer.scrollLeft);
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
setVisibleRangeX() {
|
|
2066
|
-
this.visibleRangeX.set({
|
|
2067
|
-
min: this.mainContainer.scrollLeft,
|
|
2068
|
-
max: this.mainContainer.scrollLeft + this.mainContainer.clientWidth
|
|
2069
|
-
});
|
|
2070
|
-
}
|
|
2071
|
-
ngOnDestroy() {
|
|
2072
|
-
this.unsubscribe$.next();
|
|
2073
|
-
this.unsubscribe$.complete();
|
|
2074
|
-
}
|
|
2075
|
-
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 }); }
|
|
2076
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDomService }); }
|
|
2077
|
-
}
|
|
2078
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDomService, decorators: [{
|
|
2079
|
-
type: Injectable
|
|
2080
|
-
}], ctorParameters: () => [{ type: i0.NgZone }, { type: undefined, decorators: [{
|
|
2081
|
-
type: Inject,
|
|
2082
|
-
args: [PLATFORM_ID]
|
|
2083
|
-
}] }] });
|
|
2084
|
-
|
|
2085
1994
|
/**
|
|
2086
1995
|
* Proximity, as a ratio to width/height, at which a
|
|
2087
1996
|
* dragged item will affect the drop container.
|
|
@@ -2110,12 +2019,12 @@ class GanttBarDrag {
|
|
|
2110
2019
|
get autoScrollStep() {
|
|
2111
2020
|
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2112
2021
|
}
|
|
2113
|
-
constructor(
|
|
2114
|
-
this.dragDrop =
|
|
2115
|
-
this.dom =
|
|
2116
|
-
this.dragContainer =
|
|
2117
|
-
this._ngZone =
|
|
2118
|
-
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" }] : []));
|
|
2119
2028
|
this.linkDragRefs = [];
|
|
2120
2029
|
this.barHandleDragRefs = [];
|
|
2121
2030
|
this.destroy$ = new Subject();
|
|
@@ -2400,8 +2309,7 @@ class GanttBarDrag {
|
|
|
2400
2309
|
const currentX = this.item().refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
2401
2310
|
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
2402
2311
|
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
2403
|
-
const
|
|
2404
|
-
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(currentEndDate, currentDate);
|
|
2312
|
+
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(this.item().end, this.item().start);
|
|
2405
2313
|
let start = currentDate;
|
|
2406
2314
|
let end = currentDate.add(diffs, this.ganttUpper.view?.options?.datePrecisionUnit);
|
|
2407
2315
|
// 日视图特殊逻辑处理
|
|
@@ -2601,46 +2509,112 @@ class GanttBarDrag {
|
|
|
2601
2509
|
dragRef.disabled = this.linkDragDisabled;
|
|
2602
2510
|
});
|
|
2603
2511
|
}
|
|
2604
|
-
else if (!this.linkDragDisabled) {
|
|
2605
|
-
this.linkDragRefs = this.createLinkHandleDrags();
|
|
2512
|
+
else if (!this.linkDragDisabled) {
|
|
2513
|
+
this.linkDragRefs = this.createLinkHandleDrags();
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
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
|
+
});
|
|
2578
|
+
}
|
|
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';
|
|
2606
2589
|
}
|
|
2607
2590
|
}
|
|
2608
|
-
createDrags() {
|
|
2609
|
-
this.createMouseEvents();
|
|
2610
|
-
this.createBarDragRef();
|
|
2611
|
-
this.createBarHandleDragRefs();
|
|
2612
|
-
this.createLinkDragRefs();
|
|
2613
|
-
}
|
|
2614
|
-
updateItem(item) {
|
|
2615
|
-
this.item.set(item);
|
|
2616
|
-
}
|
|
2617
2591
|
ngOnDestroy() {
|
|
2618
|
-
this.
|
|
2619
|
-
this.
|
|
2620
|
-
this.
|
|
2621
|
-
this.
|
|
2622
|
-
this.destroy$.next();
|
|
2623
|
-
this.destroy$.complete();
|
|
2624
|
-
this.stopScrolling();
|
|
2625
|
-
this.stopScrollTimers$.complete();
|
|
2592
|
+
this.unsubscribe$.next();
|
|
2593
|
+
this.unsubscribe$.complete();
|
|
2594
|
+
this.refsUnsubscribe$.next();
|
|
2595
|
+
this.refsUnsubscribe$.complete();
|
|
2626
2596
|
}
|
|
2627
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2628
|
-
static { this.ɵ
|
|
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 }); }
|
|
2629
2599
|
}
|
|
2630
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2631
|
-
type:
|
|
2632
|
-
}], ctorParameters: () => [
|
|
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
|
+
}] } });
|
|
2633
2607
|
|
|
2634
2608
|
function linearGradient(sideOrCorner, color, stop) {
|
|
2635
2609
|
return `linear-gradient(${sideOrCorner},${color} 0%,${stop} 40%)`;
|
|
2636
2610
|
}
|
|
2637
2611
|
class NgxGanttBarComponent extends GanttItemUpper {
|
|
2638
|
-
constructor(
|
|
2639
|
-
super(
|
|
2640
|
-
this.dragContainer =
|
|
2641
|
-
this.drag =
|
|
2642
|
-
this.ganttUpper =
|
|
2643
|
-
this.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);
|
|
2644
2618
|
this.barClick = new EventEmitter();
|
|
2645
2619
|
this.ganttItemClass = true;
|
|
2646
2620
|
}
|
|
@@ -2691,11 +2665,11 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2691
2665
|
this.barClick.emit({ event, item: this.item.origin });
|
|
2692
2666
|
}
|
|
2693
2667
|
setContentBackground() {
|
|
2694
|
-
let style = { ...(this.item.barStyle || {}) };
|
|
2695
|
-
const contentElement = this.contentElementRef.nativeElement;
|
|
2696
|
-
const barElement = this.elementRef.nativeElement;
|
|
2697
2668
|
if (this.item.refs?.width) {
|
|
2669
|
+
const contentElement = this.contentElementRef.nativeElement;
|
|
2698
2670
|
const color = this.item.color || barBackground;
|
|
2671
|
+
const style = this.item.barStyle || {};
|
|
2672
|
+
const barElement = this.elementRef.nativeElement;
|
|
2699
2673
|
if (this.item.origin.start && this.item.origin.end) {
|
|
2700
2674
|
style.background = color;
|
|
2701
2675
|
style.borderRadius = '';
|
|
@@ -2715,29 +2689,26 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2715
2689
|
if (this.item.progress >= 0) {
|
|
2716
2690
|
const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
2717
2691
|
style.background = hexToRgb(color, 0.3);
|
|
2692
|
+
style.borderRadius = '';
|
|
2718
2693
|
contentProgressElement.style.background = color;
|
|
2719
2694
|
}
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
contentElement.style[key] = style[key];
|
|
2695
|
+
for (const key in style) {
|
|
2696
|
+
if (style.hasOwnProperty(key)) {
|
|
2697
|
+
contentElement.style[key] = style[key];
|
|
2698
|
+
}
|
|
2725
2699
|
}
|
|
2726
2700
|
}
|
|
2727
2701
|
}
|
|
2728
2702
|
stopPropagation(event) {
|
|
2729
2703
|
event.stopPropagation();
|
|
2730
2704
|
}
|
|
2731
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2732
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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"] }] }); }
|
|
2733
2707
|
}
|
|
2734
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2708
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
|
|
2735
2709
|
type: Component,
|
|
2736
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" }]
|
|
2737
|
-
}], ctorParameters: () => [
|
|
2738
|
-
type: Inject,
|
|
2739
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2740
|
-
}] }, { type: i0.NgZone }], propDecorators: { barClick: [{
|
|
2711
|
+
}], ctorParameters: () => [], propDecorators: { barClick: [{
|
|
2741
2712
|
type: Output
|
|
2742
2713
|
}], contentElementRef: [{
|
|
2743
2714
|
type: ViewChild,
|
|
@@ -2751,9 +2722,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
2751
2722
|
}] } });
|
|
2752
2723
|
|
|
2753
2724
|
class NgxGanttBaselineComponent {
|
|
2754
|
-
constructor(
|
|
2755
|
-
this.elementRef =
|
|
2756
|
-
this.ganttUpper =
|
|
2725
|
+
constructor() {
|
|
2726
|
+
this.elementRef = inject(ElementRef);
|
|
2727
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
2757
2728
|
this.unsubscribe$ = new Subject();
|
|
2758
2729
|
this.ganttBaselineClass = true;
|
|
2759
2730
|
}
|
|
@@ -2766,500 +2737,273 @@ class NgxGanttBaselineComponent {
|
|
|
2766
2737
|
const itemElement = this.elementRef.nativeElement;
|
|
2767
2738
|
itemElement.style.left = this.baselineItem.refs.x + 'px';
|
|
2768
2739
|
itemElement.style.bottom = '2px';
|
|
2769
|
-
itemElement.style.width = this.baselineItem.refs.width + 'px';
|
|
2770
|
-
}
|
|
2771
|
-
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 }); }
|
|
2772
|
-
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"] }] }); }
|
|
2773
|
-
}
|
|
2774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
|
|
2775
|
-
type: Component,
|
|
2776
|
-
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" }]
|
|
2777
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
2778
|
-
type: Inject,
|
|
2779
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2780
|
-
}] }], propDecorators: { baselineItem: [{
|
|
2781
|
-
type: Input
|
|
2782
|
-
}], template: [{
|
|
2783
|
-
type: Input
|
|
2784
|
-
}], ganttBaselineClass: [{
|
|
2785
|
-
type: HostBinding,
|
|
2786
|
-
args: ['class.gantt-baseline']
|
|
2787
|
-
}] } });
|
|
2788
|
-
|
|
2789
|
-
const mainHeight = 5000;
|
|
2790
|
-
class GanttCalendarGridComponent {
|
|
2791
|
-
get view() {
|
|
2792
|
-
return this.ganttUpper.view;
|
|
2793
|
-
}
|
|
2794
|
-
constructor(ganttUpper, ngZone, elementRef) {
|
|
2795
|
-
this.ganttUpper = ganttUpper;
|
|
2796
|
-
this.ngZone = ngZone;
|
|
2797
|
-
this.elementRef = elementRef;
|
|
2798
|
-
this.unsubscribe$ = new Subject();
|
|
2799
|
-
this.mainHeight = mainHeight;
|
|
2800
|
-
this.todayBorderRadius = todayBorderRadius;
|
|
2801
|
-
this.viewTypes = GanttViewType;
|
|
2802
|
-
this.className = `gantt-calendar gantt-calendar-grid`;
|
|
2803
|
-
}
|
|
2804
|
-
setTodayPoint() {
|
|
2805
|
-
const x = this.view.getTodayXPoint();
|
|
2806
|
-
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2807
|
-
const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
|
|
2808
|
-
if (isNumber(x)) {
|
|
2809
|
-
if (line) {
|
|
2810
|
-
line.style.left = `${x}px`;
|
|
2811
|
-
line.style.top = `0px`;
|
|
2812
|
-
line.style.bottom = `${-mainHeight}px`;
|
|
2813
|
-
}
|
|
2814
|
-
}
|
|
2815
|
-
else {
|
|
2816
|
-
todayEle.style.display = 'none';
|
|
2817
|
-
}
|
|
2818
|
-
}
|
|
2819
|
-
ngOnInit() {
|
|
2820
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2821
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2822
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2823
|
-
.subscribe(() => {
|
|
2824
|
-
this.setTodayPoint();
|
|
2825
|
-
});
|
|
2826
|
-
});
|
|
2827
|
-
}
|
|
2828
|
-
ngOnDestroy() {
|
|
2829
|
-
this.unsubscribe$.next();
|
|
2830
|
-
this.unsubscribe$.complete();
|
|
2831
|
-
}
|
|
2832
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarGridComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2833
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttCalendarGridComponent, isStandalone: true, selector: "gantt-calendar-grid", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"mainHeight\" class=\"primary-line\"></line>\n }\n </g>\n </g>\n</svg>\n" }); }
|
|
2834
|
-
}
|
|
2835
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
|
|
2836
|
-
type: Component,
|
|
2837
|
-
args: [{ selector: 'gantt-calendar-grid', standalone: true, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"mainHeight\" class=\"primary-line\"></line>\n }\n </g>\n </g>\n</svg>\n" }]
|
|
2838
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2839
|
-
type: Inject,
|
|
2840
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2841
|
-
}] }, { type: i0.NgZone }, { type: i0.ElementRef }], propDecorators: { className: [{
|
|
2842
|
-
type: HostBinding,
|
|
2843
|
-
args: ['class']
|
|
2844
|
-
}] } });
|
|
2845
|
-
|
|
2846
|
-
class GanttCalendarHeaderComponent {
|
|
2847
|
-
get view() {
|
|
2848
|
-
return this.ganttUpper.view;
|
|
2849
|
-
}
|
|
2850
|
-
get height() {
|
|
2851
|
-
return this.ganttUpper.styles.headerHeight + 'px';
|
|
2852
|
-
}
|
|
2853
|
-
constructor(ganttUpper, ngZone, elementRef) {
|
|
2854
|
-
this.ganttUpper = ganttUpper;
|
|
2855
|
-
this.ngZone = ngZone;
|
|
2856
|
-
this.elementRef = elementRef;
|
|
2857
|
-
this.unsubscribe$ = new Subject();
|
|
2858
|
-
this.viewTypes = GanttViewType;
|
|
2859
|
-
this.className = `gantt-calendar gantt-calendar-header`;
|
|
2860
|
-
}
|
|
2861
|
-
ngOnInit() {
|
|
2862
|
-
// 头部日期定位
|
|
2863
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2864
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2865
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2866
|
-
.subscribe(() => {
|
|
2867
|
-
if (this.ganttUpper.viewType === GanttViewType.day)
|
|
2868
|
-
this.setTodayPoint();
|
|
2869
|
-
});
|
|
2870
|
-
});
|
|
2871
|
-
}
|
|
2872
|
-
setTodayPoint() {
|
|
2873
|
-
const x = this.view.getTodayXPoint();
|
|
2874
|
-
const today = new GanttDate().getDate();
|
|
2875
|
-
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2876
|
-
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
2877
|
-
if (isNumber(x)) {
|
|
2878
|
-
if (rect) {
|
|
2879
|
-
rect.style.left = `${x - todayWidth / 2}px`;
|
|
2880
|
-
rect.style.top = `${this.ganttUpper.styles.headerHeight - todayHeight}px`;
|
|
2881
|
-
rect.innerHTML = today.toString();
|
|
2882
|
-
}
|
|
2883
|
-
}
|
|
2884
|
-
else {
|
|
2885
|
-
todayEle.style.display = 'none';
|
|
2886
|
-
}
|
|
2887
|
-
}
|
|
2888
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarHeaderComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2889
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttCalendarHeaderComponent, isStandalone: true, selector: "gantt-calendar-header", host: { properties: { "class": "this.className", "style.height": "this.height" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"ganttUpper.styles.headerHeight\" class=\"primary-line\"></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
|
2890
|
-
}
|
|
2891
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
2892
|
-
type: Component,
|
|
2893
|
-
args: [{ selector: 'gantt-calendar-header', imports: [NgStyle], template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"ganttUpper.styles.headerHeight\" class=\"primary-line\"></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
|
|
2894
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2895
|
-
type: Inject,
|
|
2896
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2897
|
-
}] }, { type: i0.NgZone }, { type: i0.ElementRef }], propDecorators: { className: [{
|
|
2898
|
-
type: HostBinding,
|
|
2899
|
-
args: ['class']
|
|
2900
|
-
}], height: [{
|
|
2901
|
-
type: HostBinding,
|
|
2902
|
-
args: ['style.height']
|
|
2903
|
-
}] } });
|
|
2904
|
-
|
|
2905
|
-
class GanttDragBackdropComponent {
|
|
2906
|
-
constructor(ganttUpper) {
|
|
2907
|
-
this.ganttUpper = ganttUpper;
|
|
2908
|
-
}
|
|
2909
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragBackdropComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2910
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttDragBackdropComponent, isStandalone: true, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }); }
|
|
2911
|
-
}
|
|
2912
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
|
|
2913
|
-
type: Component,
|
|
2914
|
-
args: [{ selector: 'gantt-drag-backdrop', host: {
|
|
2915
|
-
class: 'gantt-drag-backdrop'
|
|
2916
|
-
}, standalone: true, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
|
|
2917
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2918
|
-
type: Inject,
|
|
2919
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2920
|
-
}] }] });
|
|
2921
|
-
|
|
2922
|
-
class GanttLoaderComponent {
|
|
2923
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2924
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttLoaderComponent, isStandalone: true, selector: "gantt-loader", host: { classAttribute: "gantt-loader gantt-loader-overlay" }, ngImport: i0, template: `
|
|
2925
|
-
<div class="gantt-loader-wrapper">
|
|
2926
|
-
<div class="gantt-loader-loading">
|
|
2927
|
-
<span class="gantt-loader-loading-spot"></span>
|
|
2928
|
-
</div>
|
|
2929
|
-
</div>
|
|
2930
|
-
`, isInline: true }); }
|
|
2931
|
-
}
|
|
2932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, decorators: [{
|
|
2933
|
-
type: Component,
|
|
2934
|
-
args: [{
|
|
2935
|
-
selector: 'gantt-loader',
|
|
2936
|
-
template: `
|
|
2937
|
-
<div class="gantt-loader-wrapper">
|
|
2938
|
-
<div class="gantt-loader-loading">
|
|
2939
|
-
<span class="gantt-loader-loading-spot"></span>
|
|
2940
|
-
</div>
|
|
2941
|
-
</div>
|
|
2942
|
-
`,
|
|
2943
|
-
host: {
|
|
2944
|
-
class: 'gantt-loader gantt-loader-overlay'
|
|
2945
|
-
},
|
|
2946
|
-
standalone: true
|
|
2947
|
-
}]
|
|
2948
|
-
}] });
|
|
2949
|
-
|
|
2950
|
-
class NgxGanttRangeComponent extends GanttItemUpper {
|
|
2951
|
-
constructor(elementRef, ganttUpper) {
|
|
2952
|
-
super(elementRef, ganttUpper);
|
|
2953
|
-
this.ganttRangeClass = true;
|
|
2954
|
-
}
|
|
2955
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2956
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttRangeComponent, isStandalone: true, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
2957
|
-
}
|
|
2958
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
|
|
2959
|
-
type: Component,
|
|
2960
|
-
args: [{ selector: 'ngx-gantt-range,gantt-range', imports: [NgTemplateOutlet], template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n" }]
|
|
2961
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
2962
|
-
type: Inject,
|
|
2963
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2964
|
-
}] }], propDecorators: { ganttRangeClass: [{
|
|
2965
|
-
type: HostBinding,
|
|
2966
|
-
args: ['class.gantt-range']
|
|
2967
|
-
}] } });
|
|
2968
|
-
|
|
2969
|
-
class GanttSyncScrollService {
|
|
2970
|
-
constructor() {
|
|
2971
|
-
this.ngZone = inject(NgZone);
|
|
2972
|
-
this.scrollGroupsMap = new Map();
|
|
2973
|
-
}
|
|
2974
|
-
registerScrollEvent(groupName, element, direction) {
|
|
2975
|
-
const group = this.scrollGroupsMap.get(groupName) || { elements: [], destroy$: new Subject(), direction };
|
|
2976
|
-
group.elements.push(element);
|
|
2977
|
-
this.scrollGroupsMap.set(groupName, group);
|
|
2978
|
-
this.monitorScrollChange(group);
|
|
2979
|
-
}
|
|
2980
|
-
unregisterScrollEvent(groupName, element) {
|
|
2981
|
-
const group = this.scrollGroupsMap.get(groupName);
|
|
2982
|
-
if (group) {
|
|
2983
|
-
group.elements = group.elements.filter((el) => el !== element);
|
|
2984
|
-
if (!group.elements.length) {
|
|
2985
|
-
this.scrollGroupsMap.delete(groupName);
|
|
2986
|
-
}
|
|
2987
|
-
else {
|
|
2988
|
-
this.scrollGroupsMap.set(groupName, group);
|
|
2989
|
-
}
|
|
2990
|
-
this.monitorScrollChange(group);
|
|
2991
|
-
}
|
|
2992
|
-
}
|
|
2993
|
-
monitorScrollChange(group) {
|
|
2994
|
-
const { elements, destroy$, direction } = group;
|
|
2995
|
-
destroy$.next();
|
|
2996
|
-
destroy$.complete();
|
|
2997
|
-
if (elements.length) {
|
|
2998
|
-
const scrollObservers = elements.map((el) => fromEvent(el, 'scroll', passiveListenerOptions));
|
|
2999
|
-
this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
3000
|
-
.pipe(takeUntil$1(destroy$))
|
|
3001
|
-
.subscribe((event) => {
|
|
3002
|
-
elements.forEach((el) => {
|
|
3003
|
-
if (direction === 'x') {
|
|
3004
|
-
el.scrollLeft = event.currentTarget.scrollLeft;
|
|
3005
|
-
}
|
|
3006
|
-
else {
|
|
3007
|
-
el.scrollTop = event.currentTarget.scrollTop;
|
|
3008
|
-
}
|
|
3009
|
-
});
|
|
3010
|
-
}));
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3014
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService }); }
|
|
3015
|
-
}
|
|
3016
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, decorators: [{
|
|
3017
|
-
type: Injectable
|
|
3018
|
-
}], ctorParameters: () => [] });
|
|
3019
|
-
|
|
3020
|
-
class GanttSyncScrollXDirective {
|
|
3021
|
-
constructor() {
|
|
3022
|
-
this.syncScrollX = input();
|
|
3023
|
-
this.elementRef = inject((ElementRef));
|
|
3024
|
-
this.syncScrollService = inject(GanttSyncScrollService);
|
|
3025
|
-
}
|
|
3026
|
-
ngOnInit() {
|
|
3027
|
-
this.syncScrollService.registerScrollEvent(this.syncScrollX(), this.elementRef.nativeElement, 'x');
|
|
3028
|
-
}
|
|
3029
|
-
ngOnDestroy() {
|
|
3030
|
-
this.syncScrollService.unregisterScrollEvent(this.syncScrollX(), this.elementRef.nativeElement);
|
|
2740
|
+
itemElement.style.width = this.baselineItem.refs.width + 'px';
|
|
3031
2741
|
}
|
|
3032
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3033
|
-
static { this.ɵ
|
|
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"] }] }); }
|
|
3034
2744
|
}
|
|
3035
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3036
|
-
type:
|
|
3037
|
-
args: [{
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
2745
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
|
|
2746
|
+
type: Component,
|
|
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" }]
|
|
2748
|
+
}], ctorParameters: () => [], propDecorators: { baselineItem: [{
|
|
2749
|
+
type: Input
|
|
2750
|
+
}], template: [{
|
|
2751
|
+
type: Input
|
|
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;
|
|
2761
|
+
}
|
|
3043
2762
|
constructor() {
|
|
3044
|
-
this.
|
|
3045
|
-
this.
|
|
3046
|
-
this.elementRef = inject(
|
|
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
|
+
}
|
|
3047
2786
|
}
|
|
3048
2787
|
ngOnInit() {
|
|
3049
|
-
this.
|
|
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
|
+
});
|
|
3050
2795
|
}
|
|
3051
2796
|
ngOnDestroy() {
|
|
3052
|
-
this.
|
|
3053
|
-
|
|
3054
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3055
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.3", type: GanttSyncScrollYDirective, isStandalone: true, selector: "[syncScrollY]", inputs: { syncScrollY: { classPropertyName: "syncScrollY", publicName: "syncScrollY", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
3056
|
-
}
|
|
3057
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, decorators: [{
|
|
3058
|
-
type: Directive,
|
|
3059
|
-
args: [{
|
|
3060
|
-
selector: '[syncScrollY]',
|
|
3061
|
-
standalone: true
|
|
3062
|
-
}]
|
|
3063
|
-
}], ctorParameters: () => [] });
|
|
3064
|
-
|
|
3065
|
-
class GanttScrollbarComponent {
|
|
3066
|
-
constructor(ganttUpper) {
|
|
3067
|
-
this.ganttUpper = ganttUpper;
|
|
3068
|
-
this.hasFooter = input(false);
|
|
3069
|
-
this.tableWidth = input();
|
|
3070
|
-
this.ganttRoot = input();
|
|
3071
|
-
this.tableScrollWidth = input(0);
|
|
2797
|
+
this.unsubscribe$.next();
|
|
2798
|
+
this.unsubscribe$.complete();
|
|
3072
2799
|
}
|
|
3073
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3074
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
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" }); }
|
|
3075
2802
|
}
|
|
3076
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2803
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
|
|
3077
2804
|
type: Component,
|
|
3078
|
-
args: [{ selector: 'gantt-
|
|
3079
|
-
}], ctorParameters: () => [
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
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
|
+
}] } });
|
|
3083
2810
|
|
|
3084
|
-
class
|
|
3085
|
-
get
|
|
3086
|
-
return this.ganttUpper.
|
|
2811
|
+
class GanttCalendarHeaderComponent {
|
|
2812
|
+
get view() {
|
|
2813
|
+
return this.ganttUpper.view;
|
|
3087
2814
|
}
|
|
3088
|
-
|
|
3089
|
-
this.ganttUpper
|
|
3090
|
-
this.ganttItemClass = true;
|
|
3091
|
-
this.views = inject(GanttConfigService).getViewsLocale();
|
|
2815
|
+
get height() {
|
|
2816
|
+
return this.ganttUpper.styles.headerHeight + 'px';
|
|
3092
2817
|
}
|
|
3093
|
-
|
|
3094
|
-
this.ganttUpper
|
|
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
|
+
}
|
|
3095
2852
|
}
|
|
3096
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3097
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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"] }] }); }
|
|
3098
2855
|
}
|
|
3099
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
3100
2857
|
type: Component,
|
|
3101
|
-
args: [{ selector: '
|
|
3102
|
-
}], ctorParameters: () => [
|
|
3103
|
-
type: Inject,
|
|
3104
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3105
|
-
}] }], propDecorators: { template: [{
|
|
3106
|
-
type: Input
|
|
3107
|
-
}], 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: [{
|
|
3108
2860
|
type: HostBinding,
|
|
3109
|
-
args: ['class
|
|
3110
|
-
}],
|
|
2861
|
+
args: ['class']
|
|
2862
|
+
}], height: [{
|
|
3111
2863
|
type: HostBinding,
|
|
3112
|
-
args: ['style.
|
|
2864
|
+
args: ['style.height']
|
|
3113
2865
|
}] } });
|
|
3114
2866
|
|
|
3115
|
-
class
|
|
3116
|
-
constructor() {
|
|
3117
|
-
|
|
3118
|
-
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
3119
|
-
for (const svgElement of svgElements) {
|
|
3120
|
-
this.recursElementChildren(svgElement);
|
|
3121
|
-
}
|
|
3122
|
-
}
|
|
3123
|
-
recursElementChildren(node) {
|
|
3124
|
-
const transformProperties = [
|
|
3125
|
-
'fill',
|
|
3126
|
-
'color',
|
|
3127
|
-
'font-size',
|
|
3128
|
-
'stroke',
|
|
3129
|
-
'font',
|
|
3130
|
-
'text-anchor',
|
|
3131
|
-
'stroke-dasharray',
|
|
3132
|
-
'shape-rendering',
|
|
3133
|
-
'stroke-width'
|
|
3134
|
-
];
|
|
3135
|
-
if (!node.style) {
|
|
3136
|
-
return;
|
|
3137
|
-
}
|
|
3138
|
-
const styles = getComputedStyle(node);
|
|
3139
|
-
for (const transformProperty of transformProperties) {
|
|
3140
|
-
node.style[transformProperty] = styles[transformProperty];
|
|
3141
|
-
}
|
|
3142
|
-
for (const child of Array.from(node.childNodes)) {
|
|
3143
|
-
this.recursElementChildren(child);
|
|
3144
|
-
}
|
|
3145
|
-
}
|
|
3146
|
-
register(root) {
|
|
3147
|
-
this.root = root.nativeElement;
|
|
3148
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
3149
|
-
}
|
|
3150
|
-
async print(name = 'download', ignoreElementClass) {
|
|
3151
|
-
const root = this.root;
|
|
3152
|
-
const mainContainer = this.mainContainer;
|
|
3153
|
-
// set print width
|
|
3154
|
-
const printWidth = root.offsetWidth;
|
|
3155
|
-
// set print height
|
|
3156
|
-
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
3157
|
-
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
3158
|
-
html2canvas(root, {
|
|
3159
|
-
logging: false,
|
|
3160
|
-
allowTaint: true,
|
|
3161
|
-
useCORS: true,
|
|
3162
|
-
width: printWidth,
|
|
3163
|
-
height: printHeight,
|
|
3164
|
-
ignoreElements: (element) => {
|
|
3165
|
-
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
3166
|
-
return true;
|
|
3167
|
-
}
|
|
3168
|
-
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
3169
|
-
return true;
|
|
3170
|
-
}
|
|
3171
|
-
},
|
|
3172
|
-
onclone: (cloneDocument) => {
|
|
3173
|
-
const ganttClass = root.className;
|
|
3174
|
-
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
3175
|
-
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
3176
|
-
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
3177
|
-
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
3178
|
-
// change targetDom width
|
|
3179
|
-
cloneGanttDom.style.width = `${printWidth}px`;
|
|
3180
|
-
cloneGanttDom.style.height = `${printHeight}px`;
|
|
3181
|
-
cloneGanttDom.style.overflow = `unset`;
|
|
3182
|
-
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
3183
|
-
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
3184
|
-
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
3185
|
-
if (cloneLinksOverlay) {
|
|
3186
|
-
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
3187
|
-
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
3188
|
-
}
|
|
3189
|
-
// setInlineStyles for svg
|
|
3190
|
-
this.setInlineStyles(cloneGanttDom);
|
|
3191
|
-
}
|
|
3192
|
-
}).then((canvas) => {
|
|
3193
|
-
const link = document.createElement('a');
|
|
3194
|
-
const dataUrl = canvas.toDataURL('image/png');
|
|
3195
|
-
link.download = `${name}.png`;
|
|
3196
|
-
link.href = dataUrl;
|
|
3197
|
-
link.click();
|
|
3198
|
-
});
|
|
2867
|
+
class GanttDragBackdropComponent {
|
|
2868
|
+
constructor() {
|
|
2869
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
3199
2870
|
}
|
|
3200
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3201
|
-
static { this.ɵ
|
|
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" }); }
|
|
3202
2873
|
}
|
|
3203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3204
|
-
type:
|
|
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" }]
|
|
3205
2879
|
}], ctorParameters: () => [] });
|
|
3206
2880
|
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
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="</null>"
|
|
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"></null></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);
|
|
3224
2977
|
}
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
|
|
3229
|
-
type: Pipe,
|
|
3230
|
-
args: [{
|
|
3231
|
-
name: 'isGanttBarItem',
|
|
3232
|
-
standalone: true
|
|
3233
|
-
}]
|
|
3234
|
-
}] });
|
|
3235
|
-
class IsGanttCustomItemPipe {
|
|
3236
|
-
transform(value) {
|
|
3237
|
-
return value === GanttItemType.custom;
|
|
2978
|
+
constructor() {
|
|
2979
|
+
this.elementRef = inject(ElementRef);
|
|
2980
|
+
this.isIcon = true;
|
|
3238
2981
|
}
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
}]
|
|
3248
|
-
}] });
|
|
3249
|
-
class IsGanttGroupPipe {
|
|
3250
|
-
transform(data) {
|
|
3251
|
-
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
|
+
}
|
|
3252
2990
|
}
|
|
3253
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3254
|
-
static { this.ɵ
|
|
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 }); }
|
|
3255
2993
|
}
|
|
3256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3257
|
-
type:
|
|
2994
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttIconComponent, decorators: [{
|
|
2995
|
+
type: Component,
|
|
3258
2996
|
args: [{
|
|
3259
|
-
|
|
2997
|
+
selector: 'gantt-icon',
|
|
2998
|
+
template: '',
|
|
3260
2999
|
standalone: true
|
|
3261
3000
|
}]
|
|
3262
|
-
}]
|
|
3001
|
+
}], ctorParameters: () => [], propDecorators: { isIcon: [{
|
|
3002
|
+
type: HostBinding,
|
|
3003
|
+
args: ['class.gantt-icon']
|
|
3004
|
+
}], iconName: [{
|
|
3005
|
+
type: Input
|
|
3006
|
+
}] } });
|
|
3263
3007
|
|
|
3264
3008
|
class GanttLinkLine {
|
|
3265
3009
|
constructor() { }
|
|
@@ -3441,12 +3185,12 @@ function createLineGenerator(type, ganttUpper) {
|
|
|
3441
3185
|
}
|
|
3442
3186
|
|
|
3443
3187
|
class GanttLinksComponent {
|
|
3444
|
-
constructor(
|
|
3445
|
-
this.ganttUpper =
|
|
3446
|
-
this.cdr =
|
|
3447
|
-
this.elementRef =
|
|
3448
|
-
this.ganttDragContainer =
|
|
3449
|
-
this.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);
|
|
3450
3194
|
// @Input() groups: GanttGroupInternal[] = [];
|
|
3451
3195
|
// @Input() items: GanttItemInternal[] = [];
|
|
3452
3196
|
this.flatItems = [];
|
|
@@ -3620,16 +3364,13 @@ class GanttLinksComponent {
|
|
|
3620
3364
|
this.unsubscribe$.next();
|
|
3621
3365
|
this.unsubscribe$.complete();
|
|
3622
3366
|
}
|
|
3623
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3624
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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" }); }
|
|
3625
3369
|
}
|
|
3626
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
3627
3371
|
type: Component,
|
|
3628
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" }]
|
|
3629
|
-
}], ctorParameters: () => [
|
|
3630
|
-
type: Inject,
|
|
3631
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3632
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }], propDecorators: { flatItems: [{
|
|
3373
|
+
}], ctorParameters: () => [], propDecorators: { flatItems: [{
|
|
3633
3374
|
type: Input
|
|
3634
3375
|
}], lineClick: [{
|
|
3635
3376
|
type: Output
|
|
@@ -3638,138 +3379,112 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
3638
3379
|
args: ['class.gantt-links-overlay']
|
|
3639
3380
|
}] } });
|
|
3640
3381
|
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
<
|
|
3647
|
-
|
|
3648
|
-
</
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
>
|
|
3658
|
-
<
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
opacity="0.3"
|
|
3669
|
-
filter="url(#filter-1)"
|
|
3670
|
-
cx="73.0800017"
|
|
3671
|
-
cy="115.920003"
|
|
3672
|
-
rx="73.0800017"
|
|
3673
|
-
ry="16.8000004"
|
|
3674
|
-
></ellipse>
|
|
3675
|
-
<g id="编组-5" transform="translate(15.120000, 0.000000)">
|
|
3676
|
-
<polygon
|
|
3677
|
-
id="矩形"
|
|
3678
|
-
fill="#E2E4E9"
|
|
3679
|
-
points="19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267"
|
|
3680
|
-
></polygon>
|
|
3681
|
-
<path
|
|
3682
|
-
d="M23.5200005,0 L94.0800002,0 C97.7913538,2.06413823e-16 100.8,3.00864655 100.8,6.72000015 L100.8,99.1200023 L100.8,99.1200023 L16.8000004,99.1200023 L16.8000004,6.72000015 C16.8000004,3.00864655 19.8086469,1.56994302e-15 23.5200005,0 Z"
|
|
3683
|
-
id="矩形"
|
|
3684
|
-
fill="#F9FAFB"
|
|
3685
|
-
></path>
|
|
3686
|
-
<path
|
|
3687
|
-
d="M30.9200007,12.4400003 L86.6800019,12.4400003 C88.5356787,12.4400003 90.040002,13.9443236 90.040002,15.8000004 L90.040002,42.000001 C90.040002,43.8556778 88.5356787,45.360001 86.6800019,45.360001 L30.9200007,45.360001 C29.0643239,45.360001 27.5600006,43.8556778 27.5600006,42.000001 L27.5600006,15.8000004 C27.5600006,13.9443236 29.0643239,12.4400003 30.9200007,12.4400003 Z"
|
|
3688
|
-
id="矩形"
|
|
3689
|
-
fill="#E8EAEE"
|
|
3690
|
-
></path>
|
|
3691
|
-
<text
|
|
3692
|
-
id="</null>"
|
|
3693
|
-
font-family="PingFangSC-Medium, PingFang SC"
|
|
3694
|
-
font-size="15.1200003"
|
|
3695
|
-
font-weight="400"
|
|
3696
|
-
fill="#BCBECD"
|
|
3697
|
-
>
|
|
3698
|
-
<tspan x="33.6000008" y="32.8000004"></null></tspan>
|
|
3699
|
-
</text>
|
|
3700
|
-
<rect id="矩形" fill="#E8EAEE" x="27.5600006" y="52.0800012" width="61.4800014" height="5.04000011" rx="2.52000006"></rect>
|
|
3701
|
-
<rect
|
|
3702
|
-
id="矩形备份"
|
|
3703
|
-
fill="#E8EAEE"
|
|
3704
|
-
x="27.5600006"
|
|
3705
|
-
y="63.8400014"
|
|
3706
|
-
width="61.4800014"
|
|
3707
|
-
height="5.04000011"
|
|
3708
|
-
rx="2.52000006"
|
|
3709
|
-
></rect>
|
|
3710
|
-
<path
|
|
3711
|
-
d="M0,75.6000017 L29.280235,75.6000017 C32.0637502,75.6000017 34.3202352,77.8564866 34.3202352,80.6400018 L34.3202352,86.2591426 C34.3202352,89.0426578 36.5767201,91.2991427 39.3602353,91.2991427 L78.4136737,91.2991427 C81.1971889,91.2991427 83.4536738,89.0426578 83.4536738,86.2591426 L83.4536738,80.6400018 C83.4536738,77.8564866 85.7101587,75.6000017 88.4936739,75.6000017 L117.600003,75.6000017 L117.600003,75.6000017 L117.600003,110.880003 C117.600003,115.519195 113.839194,119.280003 109.200002,119.280003 L8.40000019,119.280003 C3.76080819,119.280003 -6.53729019e-15,115.519195 0,110.880003 L0,75.6000017 L0,75.6000017 Z"
|
|
3712
|
-
id="矩形"
|
|
3713
|
-
fill="#EDEFF2"
|
|
3714
|
-
></path>
|
|
3715
|
-
</g>
|
|
3716
|
-
</g>
|
|
3717
|
-
</g>
|
|
3718
|
-
</svg>`;
|
|
3719
|
-
const dragIcon = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="aijaction/drag--" stroke-width="1" fill-rule="evenodd"><g id="aij拖动" transform="translate(5 1)" fill-rule="nonzero"><path d="M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" id="aij形状结合"></path></g></g></svg>`;
|
|
3720
|
-
const arrowLeftIcon = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" height="1em" width="1em" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="adinavigation/arrow-left" stroke-width="1" fill-rule="evenodd"><path d="M7.4 4.15L4.438 7.315a.6.6 0 0 1-.876-.82l3.97-4.243a.598.598 0 0 1 .93-.057l3.97 4.323a.6.6 0 1 1-.885.812L8.6 4.118v9.149c0 .404-.269.733-.6.733-.332 0-.6-.329-.6-.733V4.15z" id="adi形状结合" transform="rotate(-90 7.995 8)"></path></g></svg>`;
|
|
3721
|
-
const arrowRightIcon = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fit="" height="1em" width="1em" preserveAspectRatio="xMidYMid meet" focusable="false"><g id="adlnavigation/arrow-right" stroke-width="1" fill-rule="evenodd"><path d="M7.4 4.15L4.438 7.315a.6.6 0 0 1-.876-.82l3.97-4.243a.598.598 0 0 1 .93-.057l3.97 4.323a.6.6 0 1 1-.885.812L8.6 4.118v9.149c0 .404-.269.733-.6.733-.332 0-.6-.329-.6-.733V4.15z" id="adl形状结合" transform="rotate(90 7.995 8)"></path></g></svg>`;
|
|
3722
|
-
const icons = {
|
|
3723
|
-
'angle-right': angleRight,
|
|
3724
|
-
'angle-down': angleDown,
|
|
3725
|
-
'plus-square': plusSquare,
|
|
3726
|
-
'minus-square': minusSquare,
|
|
3727
|
-
loading: loadingIcon,
|
|
3728
|
-
empty: emptyIcon,
|
|
3729
|
-
drag: dragIcon,
|
|
3730
|
-
'arrow-left': arrowLeftIcon,
|
|
3731
|
-
'arrow-right': arrowRightIcon
|
|
3732
|
-
};
|
|
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
|
+
}] });
|
|
3733
3409
|
|
|
3734
|
-
class
|
|
3735
|
-
|
|
3736
|
-
|
|
3410
|
+
class IsGanttRangeItemPipe {
|
|
3411
|
+
transform(value) {
|
|
3412
|
+
return value === GanttItemType.range;
|
|
3737
3413
|
}
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
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;
|
|
3741
3441
|
}
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
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;
|
|
3750
3455
|
}
|
|
3751
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3752
|
-
static { this.ɵ
|
|
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" }); }
|
|
3753
3458
|
}
|
|
3754
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3755
|
-
type:
|
|
3459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttGroupPipe, decorators: [{
|
|
3460
|
+
type: Pipe,
|
|
3756
3461
|
args: [{
|
|
3757
|
-
|
|
3758
|
-
template: '',
|
|
3462
|
+
name: 'isGanttGroup',
|
|
3759
3463
|
standalone: true
|
|
3760
3464
|
}]
|
|
3761
|
-
}]
|
|
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: [{
|
|
3762
3479
|
type: HostBinding,
|
|
3763
|
-
args: ['class.gantt-
|
|
3764
|
-
}], iconName: [{
|
|
3765
|
-
type: Input
|
|
3480
|
+
args: ['class.gantt-range']
|
|
3766
3481
|
}] } });
|
|
3767
3482
|
|
|
3768
3483
|
class GanttMainComponent {
|
|
3769
|
-
constructor(
|
|
3770
|
-
this.ganttUpper =
|
|
3771
|
-
this.dom =
|
|
3772
|
-
this.ngZone =
|
|
3484
|
+
constructor() {
|
|
3485
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
3486
|
+
this.dom = inject(GanttDomService);
|
|
3487
|
+
this.ngZone = inject(NgZone);
|
|
3773
3488
|
this.barClick = new EventEmitter();
|
|
3774
3489
|
this.lineClick = new EventEmitter();
|
|
3775
3490
|
this.ganttMainClass = true;
|
|
@@ -3800,10 +3515,10 @@ class GanttMainComponent {
|
|
|
3800
3515
|
const date = type === 'left' ? item.start || item.end : item.end || item.start;
|
|
3801
3516
|
this.ganttRoot.scrollToDate(date);
|
|
3802
3517
|
}
|
|
3803
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3804
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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" }] }); }
|
|
3805
3520
|
}
|
|
3806
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3807
3522
|
type: Component,
|
|
3808
3523
|
args: [{ selector: 'gantt-main', imports: [
|
|
3809
3524
|
GanttLinksComponent,
|
|
@@ -3817,11 +3532,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
3817
3532
|
IsGanttCustomItemPipe,
|
|
3818
3533
|
IsGanttGroupPipe,
|
|
3819
3534
|
GanttIconComponent
|
|
3820
|
-
], template: "<gantt-links-overlay [flatItems]=\"flatItems\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<div class=\"gantt-main-groups\" [style.width.px]=\"ganttUpper.view.width\">\n @for (data of viewportItems; track trackBy($index, data)) {\n @if (data | isGanttGroup) {\n <div class=\"gantt-group\" [style.height.px]=\"ganttUpper.styles.lineHeight\" [ngClass]=\"data.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: data }\"></ng-template>\n </div>\n }\n @if (!(data | isGanttGroup)) {\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [style]=\"data.laneStyle\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(data.id)\"\n >\n @if (data.type | isGanttCustomItem) {\n <ng-template\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{\n item: data.origin,\n refs: data.refs,\n baseline: ganttUpper.baselineItemsMap[data.id]?.origin,\n baselineRefs: ganttUpper.baselineItemsMap[data.id]?.refs\n }\"\n >\n </ng-template>\n }\n @if ((data.type | isGanttRangeItem) || (data.type | isGanttBarItem)) {\n @if (data.type | isGanttRangeItem) {\n <gantt-range [template]=\"rangeTemplate\" [item]=\"data\"></gantt-range>\n }\n @if (data.type | isGanttBarItem) {\n <gantt-bar [item]=\"data\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n }\n @if (ganttUpper.baselineItemsMap[data.id]) {\n <gantt-baseline [baselineItem]=\"ganttUpper.baselineItemsMap[data.id]\" [template]=\"baselineTemplate\"></gantt-baseline>\n }\n }\n </div>\n }\n }\n</div>\n\n@if (quickTimeFocus) {\n <div class=\"gantt-quick-time-focus-container\" [style.width.px]=\"ganttUpper.view.width\">\n <div class=\"gantt-quick-time-focus\" [style.width.px]=\"dom.visibleRangeX().max - dom.visibleRangeX().min\">\n @for (data of viewportItems; track trackBy(i, data); let i = $index) {\n @let item = toItemType(data);\n <div
|
|
3821
|
-
}], ctorParameters: () => [
|
|
3822
|
-
type: Inject,
|
|
3823
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3824
|
-
}] }, { 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: [{
|
|
3825
3537
|
type: Input
|
|
3826
3538
|
}], flatItems: [{
|
|
3827
3539
|
type: Input
|
|
@@ -3865,6 +3577,102 @@ function setStyleWithVendorPrefix({ element, style, value }) {
|
|
|
3865
3577
|
}
|
|
3866
3578
|
}
|
|
3867
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
|
+
|
|
3868
3676
|
const defaultColumnWidth = 100;
|
|
3869
3677
|
const minColumnWidth = 80;
|
|
3870
3678
|
class GanttTableHeaderComponent {
|
|
@@ -3874,10 +3682,10 @@ class GanttTableHeaderComponent {
|
|
|
3874
3682
|
get lineHeight() {
|
|
3875
3683
|
return this.gantt.styles.headerHeight + 'px';
|
|
3876
3684
|
}
|
|
3877
|
-
constructor(
|
|
3878
|
-
this.elementRef =
|
|
3879
|
-
this.gantt =
|
|
3880
|
-
this.cdr =
|
|
3685
|
+
constructor() {
|
|
3686
|
+
this.elementRef = inject(ElementRef);
|
|
3687
|
+
this.gantt = inject(GANTT_ABSTRACT_TOKEN);
|
|
3688
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
3881
3689
|
this.tableWidth = 0;
|
|
3882
3690
|
this.unsubscribe$ = new Subject();
|
|
3883
3691
|
this.className = `gantt-table-header `;
|
|
@@ -3982,16 +3790,13 @@ class GanttTableHeaderComponent {
|
|
|
3982
3790
|
this.unsubscribe$.next();
|
|
3983
3791
|
this.unsubscribe$.complete();
|
|
3984
3792
|
}
|
|
3985
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3986
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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"] }] }); }
|
|
3987
3795
|
}
|
|
3988
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3796
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttTableHeaderComponent, decorators: [{
|
|
3989
3797
|
type: Component,
|
|
3990
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" }]
|
|
3991
|
-
}], ctorParameters: () => [
|
|
3992
|
-
type: Inject,
|
|
3993
|
-
args: [GANTT_ABSTRACT_TOKEN]
|
|
3994
|
-
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { columns: [{
|
|
3799
|
+
}], ctorParameters: () => [], propDecorators: { columns: [{
|
|
3995
3800
|
type: Input
|
|
3996
3801
|
}], resizeLineElementRef: [{
|
|
3997
3802
|
type: ViewChild,
|
|
@@ -4019,12 +3824,12 @@ class GanttTableBodyComponent {
|
|
|
4019
3824
|
get viewportItems() {
|
|
4020
3825
|
return this._viewportItems;
|
|
4021
3826
|
}
|
|
4022
|
-
constructor(
|
|
4023
|
-
this.gantt =
|
|
4024
|
-
this.ganttUpper =
|
|
4025
|
-
this.cdr =
|
|
4026
|
-
this.document =
|
|
4027
|
-
this.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);
|
|
4028
3833
|
this.draggable = false;
|
|
4029
3834
|
this.dragDropped = new EventEmitter();
|
|
4030
3835
|
this.dragStarted = new EventEmitter();
|
|
@@ -4267,22 +4072,13 @@ class GanttTableBodyComponent {
|
|
|
4267
4072
|
this.document.querySelectorAll('.drop-position-after').forEach((element) => element.classList.remove('drop-position-after'));
|
|
4268
4073
|
this.document.querySelectorAll('.drop-position-inside').forEach((element) => element.classList.remove('drop-position-inside'));
|
|
4269
4074
|
}
|
|
4270
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4271
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
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" }] }); }
|
|
4272
4077
|
}
|
|
4273
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
4274
4079
|
type: Component,
|
|
4275
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" }]
|
|
4276
|
-
}], ctorParameters: () => [
|
|
4277
|
-
type: Inject,
|
|
4278
|
-
args: [GANTT_ABSTRACT_TOKEN]
|
|
4279
|
-
}] }, { type: GanttUpper, decorators: [{
|
|
4280
|
-
type: Inject,
|
|
4281
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4282
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: Document, decorators: [{
|
|
4283
|
-
type: Inject,
|
|
4284
|
-
args: [DOCUMENT]
|
|
4285
|
-
}] }, { type: i0.ElementRef }], propDecorators: { viewportItems: [{
|
|
4081
|
+
}], ctorParameters: () => [], propDecorators: { viewportItems: [{
|
|
4286
4082
|
type: Input
|
|
4287
4083
|
}], flatItems: [{
|
|
4288
4084
|
type: Input
|
|
@@ -4325,6 +4121,142 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4325
4121
|
args: [(CdkDrag)]
|
|
4326
4122
|
}] } });
|
|
4327
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 print(name = 'download', 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
|
+
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
|
+
}).then((canvas) => {
|
|
4246
|
+
const link = document.createElement('a');
|
|
4247
|
+
const dataUrl = canvas.toDataURL('image/png');
|
|
4248
|
+
link.download = `${name}.png`;
|
|
4249
|
+
link.href = dataUrl;
|
|
4250
|
+
link.click();
|
|
4251
|
+
});
|
|
4252
|
+
}
|
|
4253
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4254
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttPrintService }); }
|
|
4255
|
+
}
|
|
4256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
4257
|
+
type: Injectable
|
|
4258
|
+
}], ctorParameters: () => [] });
|
|
4259
|
+
|
|
4328
4260
|
class NgxGanttRootComponent {
|
|
4329
4261
|
get view() {
|
|
4330
4262
|
return this.ganttUpper.view;
|
|
@@ -4332,16 +4264,17 @@ class NgxGanttRootComponent {
|
|
|
4332
4264
|
onWindowResize() {
|
|
4333
4265
|
this.computeScrollBarOffset();
|
|
4334
4266
|
}
|
|
4335
|
-
constructor(
|
|
4336
|
-
this.elementRef =
|
|
4337
|
-
this.ngZone =
|
|
4338
|
-
this.dom =
|
|
4339
|
-
this.dragContainer =
|
|
4340
|
-
this.ganttUpper =
|
|
4341
|
-
this.printService =
|
|
4267
|
+
constructor() {
|
|
4268
|
+
this.elementRef = inject(ElementRef);
|
|
4269
|
+
this.ngZone = inject(NgZone);
|
|
4270
|
+
this.dom = inject(GanttDomService);
|
|
4271
|
+
this.dragContainer = inject(GanttDragContainer);
|
|
4272
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
4273
|
+
this.printService = inject(GanttPrintService, { optional: true });
|
|
4342
4274
|
this.verticalScrollbarWidth = 0;
|
|
4343
4275
|
this.horizontalScrollbarHeight = 0;
|
|
4344
4276
|
this.unsubscribe$ = new Subject();
|
|
4277
|
+
const dragContainer = this.dragContainer;
|
|
4345
4278
|
this.ganttUpper.dragContainer = dragContainer;
|
|
4346
4279
|
}
|
|
4347
4280
|
ngOnInit() {
|
|
@@ -4443,10 +4376,10 @@ class NgxGanttRootComponent {
|
|
|
4443
4376
|
}
|
|
4444
4377
|
this.dom.scrollMainContainer(x);
|
|
4445
4378
|
}
|
|
4446
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4447
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4379
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttRootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4380
|
+
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"] }] }); }
|
|
4448
4381
|
}
|
|
4449
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
|
|
4450
4383
|
type: Component,
|
|
4451
4384
|
args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer, GanttSyncScrollService], host: {
|
|
4452
4385
|
class: 'gantt'
|
|
@@ -4460,12 +4393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4460
4393
|
GanttSyncScrollXDirective,
|
|
4461
4394
|
GanttSyncScrollYDirective
|
|
4462
4395
|
], 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" }]
|
|
4463
|
-
}], ctorParameters: () => [
|
|
4464
|
-
type: Inject,
|
|
4465
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4466
|
-
}] }, { type: GanttPrintService, decorators: [{
|
|
4467
|
-
type: Optional
|
|
4468
|
-
}] }], propDecorators: { sideWidth: [{
|
|
4396
|
+
}], ctorParameters: () => [], propDecorators: { sideWidth: [{
|
|
4469
4397
|
type: Input
|
|
4470
4398
|
}], sideTemplate: [{
|
|
4471
4399
|
type: ContentChild,
|
|
@@ -4485,17 +4413,17 @@ class NgxGanttTableColumnComponent {
|
|
|
4485
4413
|
set width(width) {
|
|
4486
4414
|
this.columnWidth = coerceCssPixelValue(width);
|
|
4487
4415
|
}
|
|
4488
|
-
constructor(
|
|
4489
|
-
this.ganttUpper =
|
|
4490
|
-
this.elementRef =
|
|
4416
|
+
constructor() {
|
|
4417
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
4418
|
+
this.elementRef = inject(ElementRef);
|
|
4491
4419
|
}
|
|
4492
4420
|
get classList() {
|
|
4493
4421
|
return this.elementRef.nativeElement.classList;
|
|
4494
4422
|
}
|
|
4495
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4496
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
4423
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4424
|
+
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 }); }
|
|
4497
4425
|
}
|
|
4498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
|
|
4499
4427
|
type: Component,
|
|
4500
4428
|
args: [{
|
|
4501
4429
|
selector: 'ngx-gantt-column',
|
|
@@ -4505,10 +4433,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4505
4433
|
},
|
|
4506
4434
|
standalone: true
|
|
4507
4435
|
}]
|
|
4508
|
-
}], ctorParameters: () => [
|
|
4509
|
-
type: Inject,
|
|
4510
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4511
|
-
}] }, { type: i0.ElementRef }], propDecorators: { width: [{
|
|
4436
|
+
}], ctorParameters: () => [], propDecorators: { width: [{
|
|
4512
4437
|
type: Input
|
|
4513
4438
|
}], name: [{
|
|
4514
4439
|
type: Input
|
|
@@ -4532,10 +4457,10 @@ class NgxGanttTableComponent {
|
|
|
4532
4457
|
this.resizeChange = new EventEmitter();
|
|
4533
4458
|
this.itemClick = new EventEmitter();
|
|
4534
4459
|
}
|
|
4535
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4536
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
4460
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4461
|
+
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 }); }
|
|
4537
4462
|
}
|
|
4538
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
|
|
4539
4464
|
type: Component,
|
|
4540
4465
|
args: [{
|
|
4541
4466
|
selector: 'ngx-gantt-table',
|
|
@@ -4600,9 +4525,9 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4600
4525
|
get loading() {
|
|
4601
4526
|
return this._loading;
|
|
4602
4527
|
}
|
|
4603
|
-
constructor(
|
|
4604
|
-
super(
|
|
4605
|
-
this.viewportRuler =
|
|
4528
|
+
constructor() {
|
|
4529
|
+
super();
|
|
4530
|
+
this.viewportRuler = inject(ViewportRuler);
|
|
4606
4531
|
this.maxLevel = 2;
|
|
4607
4532
|
this.virtualScrollEnabled = true;
|
|
4608
4533
|
this.loadingDelay = 0;
|
|
@@ -4611,7 +4536,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4611
4536
|
this.lineClick = new EventEmitter();
|
|
4612
4537
|
this.selectedChange = new EventEmitter();
|
|
4613
4538
|
this.virtualScrolledIndexChange = new EventEmitter();
|
|
4614
|
-
this.tableScrollWidth = signal(0);
|
|
4539
|
+
this.tableScrollWidth = signal(0, ...(ngDevMode ? [{ debugName: "tableScrollWidth" }] : []));
|
|
4615
4540
|
this.flatItems = [];
|
|
4616
4541
|
this.viewportItems = [];
|
|
4617
4542
|
this._loading = false;
|
|
@@ -4840,8 +4765,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4840
4765
|
this.resizeObserver.disconnect();
|
|
4841
4766
|
}
|
|
4842
4767
|
}
|
|
4843
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4844
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4768
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4769
|
+
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: [
|
|
4845
4770
|
{
|
|
4846
4771
|
provide: GANTT_UPPER_TOKEN,
|
|
4847
4772
|
useExisting: NgxGanttComponent
|
|
@@ -4852,7 +4777,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4852
4777
|
}
|
|
4853
4778
|
], 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 }); }
|
|
4854
4779
|
}
|
|
4855
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4780
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
4856
4781
|
type: Component,
|
|
4857
4782
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
4858
4783
|
{
|
|
@@ -4881,10 +4806,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4881
4806
|
GanttSyncScrollXDirective,
|
|
4882
4807
|
GanttSyncScrollYDirective
|
|
4883
4808
|
], 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" }]
|
|
4884
|
-
}], ctorParameters: () => [
|
|
4885
|
-
type: Inject,
|
|
4886
|
-
args: [GANTT_GLOBAL_CONFIG]
|
|
4887
|
-
}] }], propDecorators: { maxLevel: [{
|
|
4809
|
+
}], ctorParameters: () => [], propDecorators: { maxLevel: [{
|
|
4888
4810
|
type: Input
|
|
4889
4811
|
}], async: [{
|
|
4890
4812
|
type: Input
|
|
@@ -4933,8 +4855,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4933
4855
|
|
|
4934
4856
|
class NgxGanttModule {
|
|
4935
4857
|
constructor() { }
|
|
4936
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4937
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
4858
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4859
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, imports: [CommonModule,
|
|
4938
4860
|
DragDropModule,
|
|
4939
4861
|
ScrollingModule,
|
|
4940
4862
|
NgxGanttComponent,
|
|
@@ -4970,7 +4892,7 @@ class NgxGanttModule {
|
|
|
4970
4892
|
GanttCalendarGridComponent,
|
|
4971
4893
|
GanttDragBackdropComponent,
|
|
4972
4894
|
GanttScrollbarComponent] }); }
|
|
4973
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
4895
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, providers: [
|
|
4974
4896
|
CdkVirtualScrollViewport,
|
|
4975
4897
|
{
|
|
4976
4898
|
provide: GANTT_GLOBAL_CONFIG,
|
|
@@ -4982,7 +4904,7 @@ class NgxGanttModule {
|
|
|
4982
4904
|
ScrollingModule,
|
|
4983
4905
|
NgxGanttComponent] }); }
|
|
4984
4906
|
}
|
|
4985
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, decorators: [{
|
|
4986
4908
|
type: NgModule,
|
|
4987
4909
|
args: [{
|
|
4988
4910
|
imports: [
|
|
@@ -5045,5 +4967,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
5045
4967
|
* Generated bundle index. Do not edit.
|
|
5046
4968
|
*/
|
|
5047
4969
|
|
|
5048
|
-
export { GANTT_GLOBAL_CONFIG, GANTT_I18N_LOCALE_TOKEN, GANTT_UPPER_TOKEN, GanttBarClickEvent, GanttBaselineItemInternal, GanttCalendarGridComponent, GanttCalendarHeaderComponent, GanttConfigService, GanttDate, GanttDatePoint, GanttDragBackdropComponent, GanttDragEvent, GanttGroupInternal, GanttI18nLocale, GanttItemInternal, GanttItemType, GanttItemUpper, GanttLineClickEvent, GanttLinkDragEvent, GanttLinkLineType, GanttLinkType, GanttLoadOnScrollEvent, GanttLoaderComponent, GanttPrintService, GanttScrollbarComponent, GanttSelectedEvent,
|
|
4970
|
+
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 };
|
|
5049
4971
|
//# sourceMappingURL=worktile-gantt.mjs.map
|