@worktile/gantt 19.0.8-next.4 → 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 +1404 -1506
- 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 -16
- 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 -97
- 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() {
|
|
@@ -1005,198 +734,323 @@ class GanttView {
|
|
|
1005
734
|
return this.getDayOccupancyWidth(date);
|
|
1006
735
|
}
|
|
1007
736
|
}
|
|
1008
|
-
/**
|
|
1009
|
-
* 根据起始日期和宽度计算结束日期
|
|
1010
|
-
* @param start 起始日期
|
|
1011
|
-
* @param width 视觉宽度
|
|
1012
|
-
* @returns 结束日期
|
|
1013
|
-
*/
|
|
1014
|
-
getEndDateByWidth(start, width) {
|
|
1015
|
-
const startX = this.getXPointByDate(start);
|
|
1016
|
-
// 减去偏移量避免因为 getDateRangeWidth 加了 1 秒而多算一天
|
|
1017
|
-
const endX = startX + width - 0.1;
|
|
1018
|
-
return this.getDateByXPoint(endX);
|
|
1019
|
-
}
|
|
1020
737
|
}
|
|
1021
738
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}
|
|
1042
|
-
getPrimaryWidth() {
|
|
1043
|
-
return this.getCellWidth() * 7;
|
|
1044
|
-
}
|
|
1045
|
-
getDayOccupancyWidth(date) {
|
|
1046
|
-
if (this.hideHoliday(date)) {
|
|
1047
|
-
return 0;
|
|
1048
|
-
}
|
|
1049
|
-
return this.cellWidth;
|
|
1050
|
-
}
|
|
1051
|
-
getPrimaryDatePoints() {
|
|
1052
|
-
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
|
|
1053
|
-
const points = [];
|
|
1054
|
-
for (let i = 0; i < weeks.length; i++) {
|
|
1055
|
-
const weekStart = new GanttDate(weeks[i]);
|
|
1056
|
-
const weekEnd = weekStart.addWeeks(1);
|
|
1057
|
-
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
1058
|
-
const pointWidth = this.getDateIntervalWidth(weekStart, weekEnd);
|
|
1059
|
-
const lastPoint = points[points.length - 1];
|
|
1060
|
-
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.yearMonth || this.options.dateDisplayFormats.primary), pointWidth / 2 + (lastPoint?.rightX || 0), primaryDatePointTop);
|
|
1061
|
-
point.leftX = lastPoint?.rightX || 0;
|
|
1062
|
-
point.rightX = point.leftX + pointWidth;
|
|
1063
|
-
points.push(point);
|
|
1064
|
-
}
|
|
1065
|
-
return points;
|
|
1066
|
-
}
|
|
1067
|
-
getSecondaryDatePoints() {
|
|
1068
|
-
const days = eachDayOfInterval({ start: this.start.value, end: this.end.value }).filter((day) => !this.hideHoliday(new GanttDate(day)));
|
|
1069
|
-
const points = [];
|
|
1070
|
-
for (let i = 0; i < days.length; i++) {
|
|
1071
|
-
const start = new GanttDate(days[i]);
|
|
1072
|
-
const point = new GanttDatePoint(start, start.format(this.options.dateDisplayFormats.secondary) || start.getDate().toString(), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
|
|
1073
|
-
isWeekend: start.isWeekend(),
|
|
1074
|
-
isToday: start.isToday()
|
|
1075
|
-
});
|
|
1076
|
-
points.push(point);
|
|
1077
|
-
}
|
|
1078
|
-
return points;
|
|
1079
|
-
}
|
|
1080
|
-
getEndDateByWidth(start, width) {
|
|
1081
|
-
if (!this.options.hoilday?.hideHoliday) {
|
|
1082
|
-
return super.getEndDateByWidth(start, width);
|
|
1083
|
-
}
|
|
1084
|
-
// 通过宽度计算包含多少个工作日(每个工作日的宽度是 cellWidth)
|
|
1085
|
-
const workingDaysCount = Math.round(width / this.getCellWidth());
|
|
1086
|
-
let end = start;
|
|
1087
|
-
let addedWorkingDays = 0;
|
|
1088
|
-
let attempts = 0;
|
|
1089
|
-
const maxAttempts = 365;
|
|
1090
|
-
while (addedWorkingDays < workingDaysCount && attempts < maxAttempts) {
|
|
1091
|
-
if (this.getDayOccupancyWidth(end) > 0) {
|
|
1092
|
-
addedWorkingDays++;
|
|
1093
|
-
if (addedWorkingDays < workingDaysCount) {
|
|
1094
|
-
end = end.addDays(1);
|
|
1095
|
-
}
|
|
739
|
+
var GanttI18nLocale;
|
|
740
|
+
(function (GanttI18nLocale) {
|
|
741
|
+
GanttI18nLocale["zhHans"] = "zh-hans";
|
|
742
|
+
GanttI18nLocale["zhHant"] = "zh-hant";
|
|
743
|
+
GanttI18nLocale["enUs"] = "en-us";
|
|
744
|
+
GanttI18nLocale["deDe"] = "de-de";
|
|
745
|
+
GanttI18nLocale["jaJp"] = "ja-jp";
|
|
746
|
+
GanttI18nLocale["ruRu"] = "ru-ru";
|
|
747
|
+
})(GanttI18nLocale || (GanttI18nLocale = {}));
|
|
748
|
+
const GANTT_I18N_LOCALE_TOKEN = new InjectionToken('gantt-i18n-locale');
|
|
749
|
+
|
|
750
|
+
var zhHans = {
|
|
751
|
+
id: GanttI18nLocale.zhHans,
|
|
752
|
+
views: {
|
|
753
|
+
[GanttViewType.hour]: {
|
|
754
|
+
label: '小时',
|
|
755
|
+
dateFormats: {
|
|
756
|
+
primary: 'M月d日',
|
|
757
|
+
secondary: 'HH:mm'
|
|
1096
758
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
759
|
+
},
|
|
760
|
+
[GanttViewType.day]: {
|
|
761
|
+
label: '天',
|
|
762
|
+
dateFormats: {
|
|
763
|
+
primary: 'yyyy年MM月',
|
|
764
|
+
secondary: 'd'
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
[GanttViewType.week]: {
|
|
768
|
+
label: '周',
|
|
769
|
+
dateFormats: {
|
|
770
|
+
primary: 'yyyy年',
|
|
771
|
+
secondary: '第w周'
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
[GanttViewType.month]: {
|
|
775
|
+
label: '月',
|
|
776
|
+
dateFormats: {
|
|
777
|
+
primary: `yyyy年'Q'Q`,
|
|
778
|
+
secondary: 'M月'
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
[GanttViewType.quarter]: {
|
|
782
|
+
label: '季',
|
|
783
|
+
dateFormats: {
|
|
784
|
+
primary: 'yyyy年',
|
|
785
|
+
secondary: `yyyy年'Q'Q`
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
[GanttViewType.year]: {
|
|
789
|
+
label: '年',
|
|
790
|
+
dateFormats: {
|
|
791
|
+
secondary: 'yyyy年'
|
|
1099
792
|
}
|
|
1100
|
-
attempts++;
|
|
1101
793
|
}
|
|
1102
|
-
return end;
|
|
1103
794
|
}
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
const viewOptions$4 = {
|
|
1107
|
-
cellWidth: 80,
|
|
1108
|
-
start: new GanttDate().startOfMonth(),
|
|
1109
|
-
end: new GanttDate().endOfMonth(),
|
|
1110
|
-
datePrecisionUnit: 'minute',
|
|
1111
|
-
addAmount: 1,
|
|
1112
|
-
addUnit: 'week',
|
|
1113
|
-
dateDisplayFormats: zhHantLocale.views.hour.dateFormats,
|
|
1114
|
-
dragPreviewDateFormat: 'HH:mm'
|
|
1115
795
|
};
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
796
|
+
|
|
797
|
+
var zhHant = {
|
|
798
|
+
id: GanttI18nLocale.zhHant,
|
|
799
|
+
views: {
|
|
800
|
+
[GanttViewType.hour]: {
|
|
801
|
+
label: '小時',
|
|
802
|
+
dateFormats: {
|
|
803
|
+
primary: 'M月d日',
|
|
804
|
+
secondary: 'HH:mm'
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
[GanttViewType.day]: {
|
|
808
|
+
label: '天',
|
|
809
|
+
dateFormats: {
|
|
810
|
+
primary: 'yyyy年MM月',
|
|
811
|
+
secondary: 'd'
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
[GanttViewType.week]: {
|
|
815
|
+
label: '週',
|
|
816
|
+
dateFormats: {
|
|
817
|
+
primary: 'yyyy年',
|
|
818
|
+
secondary: '第w週'
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
[GanttViewType.month]: {
|
|
822
|
+
label: '月',
|
|
823
|
+
dateFormats: {
|
|
824
|
+
primary: `yyyy年'Q'Q`,
|
|
825
|
+
secondary: 'M月'
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
[GanttViewType.quarter]: {
|
|
829
|
+
label: '季',
|
|
830
|
+
dateFormats: {
|
|
831
|
+
primary: 'yyyy年',
|
|
832
|
+
secondary: `yyyy年'Q'Q`
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
[GanttViewType.year]: {
|
|
836
|
+
label: '年',
|
|
837
|
+
dateFormats: {
|
|
838
|
+
secondary: 'yyyy年'
|
|
839
|
+
}
|
|
1144
840
|
}
|
|
1145
|
-
return points;
|
|
1146
841
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
var enUsLocale = {
|
|
845
|
+
id: GanttI18nLocale.enUs,
|
|
846
|
+
views: {
|
|
847
|
+
[GanttViewType.hour]: {
|
|
848
|
+
label: 'Hourly',
|
|
849
|
+
dateFormats: {
|
|
850
|
+
primary: 'MMM d',
|
|
851
|
+
secondary: 'HH:mm'
|
|
852
|
+
}
|
|
853
|
+
},
|
|
854
|
+
[GanttViewType.day]: {
|
|
855
|
+
label: 'Daily',
|
|
856
|
+
dateFormats: {
|
|
857
|
+
primary: 'MMM yyyy',
|
|
858
|
+
secondary: 'd'
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
[GanttViewType.week]: {
|
|
862
|
+
label: 'Weekly',
|
|
863
|
+
dateFormats: {
|
|
864
|
+
primary: 'yyyy',
|
|
865
|
+
secondary: 'wo'
|
|
866
|
+
}
|
|
867
|
+
},
|
|
868
|
+
[GanttViewType.month]: {
|
|
869
|
+
label: 'Monthly',
|
|
870
|
+
dateFormats: {
|
|
871
|
+
primary: "yyyy 'Q'Q",
|
|
872
|
+
secondary: 'MMM'
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
[GanttViewType.quarter]: {
|
|
876
|
+
label: 'Quarterly',
|
|
877
|
+
dateFormats: {
|
|
878
|
+
primary: 'yyyy',
|
|
879
|
+
secondary: "yyyy 'Q'Q"
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
[GanttViewType.year]: {
|
|
883
|
+
label: 'Yearly',
|
|
884
|
+
dateFormats: {
|
|
885
|
+
secondary: 'yyyy'
|
|
886
|
+
}
|
|
1157
887
|
}
|
|
1158
|
-
return points;
|
|
1159
888
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
var jaJpLocale = {
|
|
892
|
+
id: GanttI18nLocale.jaJp,
|
|
893
|
+
views: {
|
|
894
|
+
[GanttViewType.hour]: {
|
|
895
|
+
label: '毎時',
|
|
896
|
+
dateFormats: {
|
|
897
|
+
primary: 'M月d日',
|
|
898
|
+
secondary: 'HH:mm'
|
|
899
|
+
}
|
|
900
|
+
},
|
|
901
|
+
[GanttViewType.day]: {
|
|
902
|
+
label: '日',
|
|
903
|
+
dateFormats: {
|
|
904
|
+
primary: 'yyyy年M月d日',
|
|
905
|
+
secondary: 'd'
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
[GanttViewType.week]: {
|
|
909
|
+
label: '週',
|
|
910
|
+
dateFormats: {
|
|
911
|
+
primary: 'yyyy年',
|
|
912
|
+
secondary: '第w週'
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
[GanttViewType.month]: {
|
|
916
|
+
label: '月',
|
|
917
|
+
dateFormats: {
|
|
918
|
+
primary: `yyyy年M月`,
|
|
919
|
+
secondary: 'M月'
|
|
920
|
+
}
|
|
921
|
+
},
|
|
922
|
+
[GanttViewType.quarter]: {
|
|
923
|
+
label: '四半期',
|
|
924
|
+
dateFormats: {
|
|
925
|
+
primary: 'yyyy年',
|
|
926
|
+
secondary: `yyyy年第Q四半期`
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
[GanttViewType.year]: {
|
|
930
|
+
label: '年',
|
|
931
|
+
dateFormats: {
|
|
932
|
+
secondary: 'yyyy年'
|
|
933
|
+
}
|
|
1165
934
|
}
|
|
1166
|
-
|
|
1167
|
-
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
var deDeLocale = {
|
|
939
|
+
id: GanttI18nLocale.deDe,
|
|
940
|
+
dateLocale: de,
|
|
941
|
+
views: {
|
|
942
|
+
[GanttViewType.hour]: {
|
|
943
|
+
label: 'Stündlich',
|
|
944
|
+
dateFormats: {
|
|
945
|
+
primary: 'dd. MMM',
|
|
946
|
+
secondary: 'HH:mm'
|
|
947
|
+
}
|
|
948
|
+
},
|
|
949
|
+
[GanttViewType.day]: {
|
|
950
|
+
label: 'Täglich',
|
|
951
|
+
dateFormats: {
|
|
952
|
+
primary: 'MMM yyyy',
|
|
953
|
+
secondary: 'd'
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
[GanttViewType.week]: {
|
|
957
|
+
label: 'Wöchentlich',
|
|
958
|
+
dateFormats: {
|
|
959
|
+
primary: 'yyyy',
|
|
960
|
+
secondary: `w. 'Woche'`
|
|
961
|
+
}
|
|
962
|
+
},
|
|
963
|
+
[GanttViewType.month]: {
|
|
964
|
+
label: 'Monatlich',
|
|
965
|
+
dateFormats: {
|
|
966
|
+
primary: 'MMM yyyy',
|
|
967
|
+
secondary: 'MMM'
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
[GanttViewType.quarter]: {
|
|
971
|
+
label: 'Vierteljährlich',
|
|
972
|
+
dateFormats: {
|
|
973
|
+
primary: 'yyyy',
|
|
974
|
+
secondary: `Q. 'Quartal' yyyy`
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
[GanttViewType.year]: {
|
|
978
|
+
label: 'Jährlich',
|
|
979
|
+
dateFormats: {
|
|
980
|
+
secondary: 'yyyy'
|
|
981
|
+
}
|
|
1168
982
|
}
|
|
1169
983
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
var ruRuLocale = {
|
|
987
|
+
id: GanttI18nLocale.ruRu,
|
|
988
|
+
dateLocale: ru,
|
|
989
|
+
views: {
|
|
990
|
+
[GanttViewType.hour]: {
|
|
991
|
+
label: 'Ежечасно',
|
|
992
|
+
dateFormats: {
|
|
993
|
+
primary: 'd MMM',
|
|
994
|
+
secondary: 'HH:mm'
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
[GanttViewType.day]: {
|
|
998
|
+
label: 'Ежедневно',
|
|
999
|
+
dateFormats: {
|
|
1000
|
+
primary: 'MMMM yyyy',
|
|
1001
|
+
secondary: 'd'
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
[GanttViewType.week]: {
|
|
1005
|
+
label: 'Еженедельно',
|
|
1006
|
+
dateFormats: {
|
|
1007
|
+
primary: 'yyyy',
|
|
1008
|
+
secondary: 'Неделя w'
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
[GanttViewType.month]: {
|
|
1012
|
+
label: 'Ежемесячно',
|
|
1013
|
+
dateFormats: {
|
|
1014
|
+
primary: 'MMMM yyyy',
|
|
1015
|
+
secondary: 'MMM'
|
|
1016
|
+
}
|
|
1017
|
+
},
|
|
1018
|
+
[GanttViewType.quarter]: {
|
|
1019
|
+
label: 'Ежеквартально',
|
|
1020
|
+
dateFormats: {
|
|
1021
|
+
primary: 'yyyy',
|
|
1022
|
+
secondary: 'Квартал Q yyyy'
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
[GanttViewType.year]: {
|
|
1026
|
+
label: 'Ежегодно',
|
|
1027
|
+
dateFormats: {
|
|
1028
|
+
secondary: 'yyyy'
|
|
1029
|
+
}
|
|
1175
1030
|
}
|
|
1176
|
-
result = minutes >= 0 ? result : -result;
|
|
1177
|
-
return Number(result.toFixed(3));
|
|
1178
1031
|
}
|
|
1179
|
-
|
|
1180
|
-
const hourWidth = this.getHourOccupancyWidth();
|
|
1181
|
-
const indexOfSecondaryDate = Math.max(Math.floor(x / hourWidth), 0);
|
|
1182
|
-
const matchDate = this.secondaryDatePoints[Math.min(this.secondaryDatePoints.length - 1, indexOfSecondaryDate)];
|
|
1183
|
-
const minuteWidth = hourWidth / 60;
|
|
1184
|
-
const underOneHourMinutes = Math.floor((x % hourWidth) / minuteWidth);
|
|
1185
|
-
return matchDate?.start.addMinutes(underOneHourMinutes);
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1032
|
+
};
|
|
1188
1033
|
|
|
1189
|
-
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 = {
|
|
1190
1044
|
start: new GanttDate().startOfQuarter().addQuarters(-1),
|
|
1191
1045
|
end: new GanttDate().endOfQuarter().addQuarters(2),
|
|
1192
1046
|
cellWidth: 280,
|
|
1193
1047
|
addAmount: 1,
|
|
1194
1048
|
addUnit: 'quarter',
|
|
1195
|
-
dateDisplayFormats:
|
|
1049
|
+
dateDisplayFormats: zhHant.views.month.dateFormats
|
|
1196
1050
|
};
|
|
1197
1051
|
class GanttViewMonth extends GanttView {
|
|
1198
1052
|
constructor(start, end, options) {
|
|
1199
|
-
super(start, end, Object.assign({}, viewOptions$
|
|
1053
|
+
super(start, end, Object.assign({}, viewOptions$5, options));
|
|
1200
1054
|
this.viewType = GanttViewType.month;
|
|
1201
1055
|
}
|
|
1202
1056
|
viewStartOf(date) {
|
|
@@ -1233,7 +1087,7 @@ class GanttViewMonth extends GanttView {
|
|
|
1233
1087
|
}
|
|
1234
1088
|
}
|
|
1235
1089
|
|
|
1236
|
-
const viewOptions$
|
|
1090
|
+
const viewOptions$4 = {
|
|
1237
1091
|
start: new GanttDate().addYears(-1).startOfYear(),
|
|
1238
1092
|
end: new GanttDate().addYears(1).endOfYear(),
|
|
1239
1093
|
min: new GanttDate().addYears(-2).startOfYear(),
|
|
@@ -1241,11 +1095,11 @@ const viewOptions$2 = {
|
|
|
1241
1095
|
cellWidth: 500,
|
|
1242
1096
|
addAmount: 1,
|
|
1243
1097
|
addUnit: 'year',
|
|
1244
|
-
dateDisplayFormats:
|
|
1098
|
+
dateDisplayFormats: zhHant.views.quarter.dateFormats
|
|
1245
1099
|
};
|
|
1246
1100
|
class GanttViewQuarter extends GanttView {
|
|
1247
1101
|
constructor(start, end, options) {
|
|
1248
|
-
super(start, end, Object.assign({}, viewOptions$
|
|
1102
|
+
super(start, end, Object.assign({}, viewOptions$4, options));
|
|
1249
1103
|
this.viewType = GanttViewType.quarter;
|
|
1250
1104
|
}
|
|
1251
1105
|
viewStartOf(date) {
|
|
@@ -1282,17 +1136,69 @@ class GanttViewQuarter extends GanttView {
|
|
|
1282
1136
|
}
|
|
1283
1137
|
}
|
|
1284
1138
|
|
|
1285
|
-
const viewOptions$
|
|
1139
|
+
const viewOptions$3 = {
|
|
1140
|
+
cellWidth: 35,
|
|
1141
|
+
start: new GanttDate().startOfYear().startOfWeek(),
|
|
1142
|
+
end: new GanttDate().endOfYear().endOfWeek(),
|
|
1143
|
+
addAmount: 1,
|
|
1144
|
+
addUnit: 'month',
|
|
1145
|
+
dateDisplayFormats: zhHant.views.day.dateFormats
|
|
1146
|
+
};
|
|
1147
|
+
class GanttViewDay extends GanttView {
|
|
1148
|
+
constructor(start, end, options) {
|
|
1149
|
+
super(start, end, Object.assign({}, viewOptions$3, options));
|
|
1150
|
+
this.showTimeline = false;
|
|
1151
|
+
this.viewType = GanttViewType.day;
|
|
1152
|
+
}
|
|
1153
|
+
viewStartOf(date) {
|
|
1154
|
+
return date.startOfWeek();
|
|
1155
|
+
}
|
|
1156
|
+
viewEndOf(date) {
|
|
1157
|
+
return date.endOfWeek();
|
|
1158
|
+
}
|
|
1159
|
+
getPrimaryWidth() {
|
|
1160
|
+
return this.getCellWidth() * 7;
|
|
1161
|
+
}
|
|
1162
|
+
getDayOccupancyWidth() {
|
|
1163
|
+
return this.cellWidth;
|
|
1164
|
+
}
|
|
1165
|
+
getPrimaryDatePoints() {
|
|
1166
|
+
const weeks = eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value });
|
|
1167
|
+
const points = [];
|
|
1168
|
+
for (let i = 0; i < weeks.length; i++) {
|
|
1169
|
+
const weekStart = new GanttDate(weeks[i]);
|
|
1170
|
+
const increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
1171
|
+
const point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat?.yearMonth || this.options.dateDisplayFormats.primary), (this.getCellWidth() * 7) / 2 + i * (this.getCellWidth() * 7), primaryDatePointTop);
|
|
1172
|
+
points.push(point);
|
|
1173
|
+
}
|
|
1174
|
+
return points;
|
|
1175
|
+
}
|
|
1176
|
+
getSecondaryDatePoints() {
|
|
1177
|
+
const days = eachDayOfInterval({ start: this.start.value, end: this.end.value });
|
|
1178
|
+
const points = [];
|
|
1179
|
+
for (let i = 0; i < days.length; i++) {
|
|
1180
|
+
const start = new GanttDate(days[i]);
|
|
1181
|
+
const point = new GanttDatePoint(start, start.format(this.options.dateDisplayFormats.secondary) || start.getDate().toString(), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
|
|
1182
|
+
isWeekend: start.isWeekend(),
|
|
1183
|
+
isToday: start.isToday()
|
|
1184
|
+
});
|
|
1185
|
+
points.push(point);
|
|
1186
|
+
}
|
|
1187
|
+
return points;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
const viewOptions$2 = {
|
|
1286
1192
|
cellWidth: 280,
|
|
1287
1193
|
start: new GanttDate().startOfYear().startOfWeek(),
|
|
1288
1194
|
end: new GanttDate().endOfYear().endOfWeek(),
|
|
1289
1195
|
addAmount: 1,
|
|
1290
1196
|
addUnit: 'month',
|
|
1291
|
-
dateDisplayFormats:
|
|
1197
|
+
dateDisplayFormats: zhHant.views.week.dateFormats
|
|
1292
1198
|
};
|
|
1293
1199
|
class GanttViewWeek extends GanttView {
|
|
1294
1200
|
constructor(start, end, options) {
|
|
1295
|
-
super(start, end, Object.assign({}, viewOptions$
|
|
1201
|
+
super(start, end, Object.assign({}, viewOptions$2, options));
|
|
1296
1202
|
this.viewType = GanttViewType.week;
|
|
1297
1203
|
}
|
|
1298
1204
|
viewStartOf(date) {
|
|
@@ -1330,17 +1236,17 @@ class GanttViewWeek extends GanttView {
|
|
|
1330
1236
|
}
|
|
1331
1237
|
}
|
|
1332
1238
|
|
|
1333
|
-
const viewOptions = {
|
|
1239
|
+
const viewOptions$1 = {
|
|
1334
1240
|
cellWidth: 480,
|
|
1335
1241
|
start: new GanttDate().addYears(-2).startOfYear(),
|
|
1336
1242
|
end: new GanttDate().addYears(2).endOfYear(),
|
|
1337
1243
|
addAmount: 1,
|
|
1338
1244
|
addUnit: 'year',
|
|
1339
|
-
dateDisplayFormats:
|
|
1245
|
+
dateDisplayFormats: zhHant.views.year.dateFormats
|
|
1340
1246
|
};
|
|
1341
1247
|
class GanttViewYear extends GanttView {
|
|
1342
1248
|
constructor(start, end, options) {
|
|
1343
|
-
super(start, end, Object.assign({}, viewOptions, options));
|
|
1249
|
+
super(start, end, Object.assign({}, viewOptions$1, options));
|
|
1344
1250
|
this.viewType = GanttViewType.year;
|
|
1345
1251
|
}
|
|
1346
1252
|
viewStartOf(date) {
|
|
@@ -1377,21 +1283,167 @@ class GanttViewYear extends GanttView {
|
|
|
1377
1283
|
return points;
|
|
1378
1284
|
}
|
|
1379
1285
|
}
|
|
1380
|
-
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
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;
|
|
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' }); }
|
|
1442
|
+
}
|
|
1443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttConfigService, decorators: [{
|
|
1444
|
+
type: Injectable,
|
|
1445
|
+
args: [{ providedIn: 'root' }]
|
|
1446
|
+
}], ctorParameters: () => [] });
|
|
1395
1447
|
|
|
1396
1448
|
class GanttUpper {
|
|
1397
1449
|
set linkOptions(options) {
|
|
@@ -1425,12 +1477,11 @@ class GanttUpper {
|
|
|
1425
1477
|
get element() {
|
|
1426
1478
|
return this.elementRef.nativeElement;
|
|
1427
1479
|
}
|
|
1428
|
-
constructor(
|
|
1429
|
-
|
|
1430
|
-
this.
|
|
1431
|
-
this.
|
|
1432
|
-
this.
|
|
1433
|
-
this.config = config;
|
|
1480
|
+
constructor() {
|
|
1481
|
+
this.elementRef = inject(ElementRef);
|
|
1482
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
1483
|
+
this.ngZone = inject(NgZone);
|
|
1484
|
+
this.config = inject(GANTT_GLOBAL_CONFIG);
|
|
1434
1485
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
1435
1486
|
this.originItems = [];
|
|
1436
1487
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
@@ -1703,12 +1754,12 @@ class GanttUpper {
|
|
|
1703
1754
|
rerenderView() {
|
|
1704
1755
|
this.changeView(this.viewType);
|
|
1705
1756
|
}
|
|
1706
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1707
|
-
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 }); }
|
|
1708
1759
|
}
|
|
1709
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1760
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttUpper, decorators: [{
|
|
1710
1761
|
type: Directive
|
|
1711
|
-
}], ctorParameters: () => [
|
|
1762
|
+
}], ctorParameters: () => [], propDecorators: { originItems: [{
|
|
1712
1763
|
type: Input,
|
|
1713
1764
|
args: ['items']
|
|
1714
1765
|
}], originGroups: [{
|
|
@@ -1786,65 +1837,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
1786
1837
|
}] } });
|
|
1787
1838
|
const GANTT_UPPER_TOKEN = new InjectionToken('GANTT_UPPER_TOKEN');
|
|
1788
1839
|
|
|
1789
|
-
class GanttItemUpper {
|
|
1790
|
-
constructor(elementRef, ganttUpper) {
|
|
1791
|
-
this.elementRef = elementRef;
|
|
1792
|
-
this.ganttUpper = ganttUpper;
|
|
1793
|
-
this.firstChange = true;
|
|
1794
|
-
this.unsubscribe$ = new Subject();
|
|
1795
|
-
this.refsUnsubscribe$ = new Subject();
|
|
1796
|
-
}
|
|
1797
|
-
ngOnInit() {
|
|
1798
|
-
this.firstChange = false;
|
|
1799
|
-
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
1800
|
-
this.setPositions();
|
|
1801
|
-
});
|
|
1802
|
-
}
|
|
1803
|
-
ngOnChanges(changes) {
|
|
1804
|
-
if (!this.firstChange) {
|
|
1805
|
-
this.itemChange(changes.item.currentValue);
|
|
1806
|
-
}
|
|
1807
|
-
}
|
|
1808
|
-
itemChange(item) {
|
|
1809
|
-
this.refsUnsubscribe$.next();
|
|
1810
|
-
this.refsUnsubscribe$.complete();
|
|
1811
|
-
this.item = item;
|
|
1812
|
-
this.item.refs$.pipe(takeUntil(this.refsUnsubscribe$)).subscribe(() => {
|
|
1813
|
-
this.setPositions();
|
|
1814
|
-
});
|
|
1815
|
-
}
|
|
1816
|
-
setPositions() {
|
|
1817
|
-
const itemElement = this.elementRef.nativeElement;
|
|
1818
|
-
itemElement.style.left = this.item.refs?.x + 'px';
|
|
1819
|
-
itemElement.style.top = this.item.refs?.y + 'px';
|
|
1820
|
-
itemElement.style.width = this.item.refs?.width + 'px';
|
|
1821
|
-
if (this.item.type === GanttItemType.bar) {
|
|
1822
|
-
itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
|
|
1823
|
-
}
|
|
1824
|
-
else if (this.item.type === GanttItemType.range) {
|
|
1825
|
-
itemElement.style.height = rangeHeight + 'px';
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
ngOnDestroy() {
|
|
1829
|
-
this.unsubscribe$.next();
|
|
1830
|
-
this.unsubscribe$.complete();
|
|
1831
|
-
this.refsUnsubscribe$.next();
|
|
1832
|
-
this.refsUnsubscribe$.complete();
|
|
1833
|
-
}
|
|
1834
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1835
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.3", type: GanttItemUpper, isStandalone: true, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0 }); }
|
|
1836
|
-
}
|
|
1837
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttItemUpper, decorators: [{
|
|
1838
|
-
type: Directive
|
|
1839
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
1840
|
-
type: Inject,
|
|
1841
|
-
args: [GANTT_UPPER_TOKEN]
|
|
1842
|
-
}] }], propDecorators: { template: [{
|
|
1843
|
-
type: Input
|
|
1844
|
-
}], item: [{
|
|
1845
|
-
type: Input
|
|
1846
|
-
}] } });
|
|
1847
|
-
|
|
1848
1840
|
function getDependencyType(path, dependencyTypes) {
|
|
1849
1841
|
if (dependencyTypes.includes(GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
|
|
1850
1842
|
return GanttLinkType.ss;
|
|
@@ -1863,8 +1855,8 @@ var InBarPosition;
|
|
|
1863
1855
|
InBarPosition["finish"] = "finish";
|
|
1864
1856
|
})(InBarPosition || (InBarPosition = {}));
|
|
1865
1857
|
class GanttDragContainer {
|
|
1866
|
-
constructor(
|
|
1867
|
-
this.ganttUpper =
|
|
1858
|
+
constructor() {
|
|
1859
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
1868
1860
|
this.dragStarted = new EventEmitter();
|
|
1869
1861
|
this.dragMoved = new EventEmitter();
|
|
1870
1862
|
this.dragEnded = new EventEmitter();
|
|
@@ -1908,15 +1900,12 @@ class GanttDragContainer {
|
|
|
1908
1900
|
this.linkDraggingId = null;
|
|
1909
1901
|
this.linkDragPath = { from: null, to: null };
|
|
1910
1902
|
}
|
|
1911
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1912
|
-
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 }); }
|
|
1913
1905
|
}
|
|
1914
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1906
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttDragContainer, decorators: [{
|
|
1915
1907
|
type: Injectable
|
|
1916
|
-
}], ctorParameters: () => [
|
|
1917
|
-
type: Inject,
|
|
1918
|
-
args: [GANTT_UPPER_TOKEN]
|
|
1919
|
-
}] }] });
|
|
1908
|
+
}], ctorParameters: () => [] });
|
|
1920
1909
|
|
|
1921
1910
|
/**
|
|
1922
1911
|
* Proximity, as a ratio to width/height at which to start auto-scrolling the drop list or the
|
|
@@ -2002,122 +1991,6 @@ function normalizePassiveListenerOptions(options) {
|
|
|
2002
1991
|
/** Options used to bind passive event listeners. */
|
|
2003
1992
|
const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
2004
1993
|
|
|
2005
|
-
const scrollThreshold = 50;
|
|
2006
|
-
var ScrollDirection;
|
|
2007
|
-
(function (ScrollDirection) {
|
|
2008
|
-
ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
|
|
2009
|
-
ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
|
|
2010
|
-
ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
|
|
2011
|
-
})(ScrollDirection || (ScrollDirection = {}));
|
|
2012
|
-
class GanttDomService {
|
|
2013
|
-
constructor(ngZone, platformId) {
|
|
2014
|
-
this.ngZone = ngZone;
|
|
2015
|
-
this.platformId = platformId;
|
|
2016
|
-
this.visibleRangeX = signal({ min: 0, max: 0 });
|
|
2017
|
-
this.unsubscribe$ = new Subject();
|
|
2018
|
-
}
|
|
2019
|
-
disableBrowserWheelEvent() {
|
|
2020
|
-
const container = this.mainContainer;
|
|
2021
|
-
this.ngZone.runOutsideAngular(() => fromEvent(container, 'wheel')
|
|
2022
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2023
|
-
.subscribe((event) => {
|
|
2024
|
-
const delta = event.deltaX;
|
|
2025
|
-
if (!delta) {
|
|
2026
|
-
return;
|
|
2027
|
-
}
|
|
2028
|
-
if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
|
|
2029
|
-
(container.scrollLeft === 0 && delta < 0)) {
|
|
2030
|
-
event.preventDefault();
|
|
2031
|
-
}
|
|
2032
|
-
}));
|
|
2033
|
-
}
|
|
2034
|
-
initialize(root) {
|
|
2035
|
-
this.root = root.nativeElement;
|
|
2036
|
-
this.side = this.root.getElementsByClassName('gantt-side')[0];
|
|
2037
|
-
this.container = this.root.getElementsByClassName('gantt-container')[0];
|
|
2038
|
-
this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
|
|
2039
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
2040
|
-
this.mainScrollbar = this.root.getElementsByClassName('gantt-main-scrollbar')[0];
|
|
2041
|
-
this.mainFooter = this.root.getElementsByClassName('gantt-container-footer')[0];
|
|
2042
|
-
this.verticalScrollContainer = this.root.getElementsByClassName('gantt-scroll-container')[0];
|
|
2043
|
-
const mainItems = this.mainContainer.getElementsByClassName('gantt-main-items')[0];
|
|
2044
|
-
const mainGroups = this.mainContainer.getElementsByClassName('gantt-main-groups')[0];
|
|
2045
|
-
this.mainItems = mainItems || mainGroups;
|
|
2046
|
-
this.calendarHeader = this.root.getElementsByClassName('gantt-calendar-header')[0];
|
|
2047
|
-
this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-grid')[0];
|
|
2048
|
-
this.disableBrowserWheelEvent();
|
|
2049
|
-
}
|
|
2050
|
-
/**
|
|
2051
|
-
* @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
|
|
2052
|
-
* to run the change detection if needed.
|
|
2053
|
-
*/
|
|
2054
|
-
getViewerScroll(options) {
|
|
2055
|
-
const scrollObservers = [fromEvent(this.mainContainer, 'scroll', options)];
|
|
2056
|
-
this.mainFooter && scrollObservers.push(fromEvent(this.mainFooter, 'scroll', options));
|
|
2057
|
-
this.mainScrollbar && scrollObservers.push(fromEvent(this.mainScrollbar, 'scroll', options));
|
|
2058
|
-
return new Observable((subscriber) => this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
2059
|
-
.pipe(map(() => this.mainContainer.scrollLeft), pairwise(), map(([previous, current]) => {
|
|
2060
|
-
this.setVisibleRangeX();
|
|
2061
|
-
const event = {
|
|
2062
|
-
target: this.mainContainer,
|
|
2063
|
-
direction: ScrollDirection.NONE
|
|
2064
|
-
};
|
|
2065
|
-
if (current - previous < 0) {
|
|
2066
|
-
if (this.mainContainer.scrollLeft < scrollThreshold && this.mainContainer.scrollLeft > 0) {
|
|
2067
|
-
event.direction = ScrollDirection.LEFT;
|
|
2068
|
-
}
|
|
2069
|
-
}
|
|
2070
|
-
if (current - previous > 0) {
|
|
2071
|
-
if (this.mainContainer.scrollWidth - this.mainContainer.clientWidth - this.mainContainer.scrollLeft <
|
|
2072
|
-
scrollThreshold) {
|
|
2073
|
-
event.direction = ScrollDirection.RIGHT;
|
|
2074
|
-
}
|
|
2075
|
-
}
|
|
2076
|
-
return event;
|
|
2077
|
-
}))
|
|
2078
|
-
.subscribe(subscriber)));
|
|
2079
|
-
}
|
|
2080
|
-
getResize() {
|
|
2081
|
-
return isPlatformServer(this.platformId) ? EMPTY : fromEvent(window, 'resize').pipe(auditTime(150));
|
|
2082
|
-
}
|
|
2083
|
-
getResizeByElement(element) {
|
|
2084
|
-
return new Observable((observer) => {
|
|
2085
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
2086
|
-
observer.next();
|
|
2087
|
-
});
|
|
2088
|
-
resizeObserver.observe(element);
|
|
2089
|
-
});
|
|
2090
|
-
}
|
|
2091
|
-
scrollMainContainer(left) {
|
|
2092
|
-
if (isNumber(left)) {
|
|
2093
|
-
const scrollLeft = left - this.mainContainer.clientWidth / 2;
|
|
2094
|
-
this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
|
|
2095
|
-
this.calendarHeader.scrollLeft = this.mainContainer.scrollLeft;
|
|
2096
|
-
this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
|
|
2097
|
-
this.mainScrollbar && (this.mainScrollbar.scrollLeft = this.mainContainer.scrollLeft);
|
|
2098
|
-
this.mainFooter && (this.mainFooter.scrollLeft = this.mainContainer.scrollLeft);
|
|
2099
|
-
}
|
|
2100
|
-
}
|
|
2101
|
-
setVisibleRangeX() {
|
|
2102
|
-
this.visibleRangeX.set({
|
|
2103
|
-
min: this.mainContainer.scrollLeft,
|
|
2104
|
-
max: this.mainContainer.scrollLeft + this.mainContainer.clientWidth
|
|
2105
|
-
});
|
|
2106
|
-
}
|
|
2107
|
-
ngOnDestroy() {
|
|
2108
|
-
this.unsubscribe$.next();
|
|
2109
|
-
this.unsubscribe$.complete();
|
|
2110
|
-
}
|
|
2111
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDomService, deps: [{ token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2112
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDomService }); }
|
|
2113
|
-
}
|
|
2114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDomService, decorators: [{
|
|
2115
|
-
type: Injectable
|
|
2116
|
-
}], ctorParameters: () => [{ type: i0.NgZone }, { type: undefined, decorators: [{
|
|
2117
|
-
type: Inject,
|
|
2118
|
-
args: [PLATFORM_ID]
|
|
2119
|
-
}] }] });
|
|
2120
|
-
|
|
2121
1994
|
/**
|
|
2122
1995
|
* Proximity, as a ratio to width/height, at which a
|
|
2123
1996
|
* dragged item will affect the drop container.
|
|
@@ -2146,12 +2019,12 @@ class GanttBarDrag {
|
|
|
2146
2019
|
get autoScrollStep() {
|
|
2147
2020
|
return Math.pow(autoScrollBaseStep, this.autoScrollSpeedRates);
|
|
2148
2021
|
}
|
|
2149
|
-
constructor(
|
|
2150
|
-
this.dragDrop =
|
|
2151
|
-
this.dom =
|
|
2152
|
-
this.dragContainer =
|
|
2153
|
-
this._ngZone =
|
|
2154
|
-
this.item = signal(null);
|
|
2022
|
+
constructor() {
|
|
2023
|
+
this.dragDrop = inject(DragDrop);
|
|
2024
|
+
this.dom = inject(GanttDomService);
|
|
2025
|
+
this.dragContainer = inject(GanttDragContainer);
|
|
2026
|
+
this._ngZone = inject(NgZone);
|
|
2027
|
+
this.item = signal(null, ...(ngDevMode ? [{ debugName: "item" }] : []));
|
|
2155
2028
|
this.linkDragRefs = [];
|
|
2156
2029
|
this.barHandleDragRefs = [];
|
|
2157
2030
|
this.destroy$ = new Subject();
|
|
@@ -2434,13 +2307,24 @@ class GanttBarDrag {
|
|
|
2434
2307
|
}
|
|
2435
2308
|
barDragMove() {
|
|
2436
2309
|
const currentX = this.item().refs.x + this.barDragMoveDistance + this.dragScrollDistance;
|
|
2437
|
-
const
|
|
2438
|
-
const
|
|
2310
|
+
const currentDate = this.ganttUpper.view.getDateByXPoint(currentX);
|
|
2311
|
+
const currentStartX = this.ganttUpper.view.getXPointByDate(currentDate);
|
|
2312
|
+
const diffs = this.ganttUpper.view.differenceByPrecisionUnit(this.item().end, this.item().start);
|
|
2313
|
+
let start = currentDate;
|
|
2314
|
+
let end = currentDate.add(diffs, this.ganttUpper.view?.options?.datePrecisionUnit);
|
|
2315
|
+
// 日视图特殊逻辑处理
|
|
2316
|
+
if (this.ganttUpper.view.viewType === GanttViewType.day) {
|
|
2317
|
+
const dayWidth = this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
2318
|
+
if (currentX > currentStartX + dayWidth / 2) {
|
|
2319
|
+
start = start.addDays(1);
|
|
2320
|
+
end = end.addDays(1);
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2439
2323
|
if (this.dragScrolling) {
|
|
2440
2324
|
const left = currentX - this.barDragMoveDistance;
|
|
2441
2325
|
this.barElement.style.left = left + 'px';
|
|
2442
2326
|
}
|
|
2443
|
-
this.openDragBackdrop(this.barElement,
|
|
2327
|
+
this.openDragBackdrop(this.barElement, this.ganttUpper.view.getDateByXPoint(currentX), this.ganttUpper.view.getDateByXPoint(currentX + this.item().refs.width));
|
|
2444
2328
|
if (!this.isStartOrEndInsideView(start, end)) {
|
|
2445
2329
|
return;
|
|
2446
2330
|
}
|
|
@@ -2625,46 +2509,112 @@ class GanttBarDrag {
|
|
|
2625
2509
|
dragRef.disabled = this.linkDragDisabled;
|
|
2626
2510
|
});
|
|
2627
2511
|
}
|
|
2628
|
-
else if (!this.linkDragDisabled) {
|
|
2629
|
-
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';
|
|
2630
2589
|
}
|
|
2631
2590
|
}
|
|
2632
|
-
createDrags() {
|
|
2633
|
-
this.createMouseEvents();
|
|
2634
|
-
this.createBarDragRef();
|
|
2635
|
-
this.createBarHandleDragRefs();
|
|
2636
|
-
this.createLinkDragRefs();
|
|
2637
|
-
}
|
|
2638
|
-
updateItem(item) {
|
|
2639
|
-
this.item.set(item);
|
|
2640
|
-
}
|
|
2641
2591
|
ngOnDestroy() {
|
|
2642
|
-
this.
|
|
2643
|
-
this.
|
|
2644
|
-
this.
|
|
2645
|
-
this.
|
|
2646
|
-
this.destroy$.next();
|
|
2647
|
-
this.destroy$.complete();
|
|
2648
|
-
this.stopScrolling();
|
|
2649
|
-
this.stopScrollTimers$.complete();
|
|
2592
|
+
this.unsubscribe$.next();
|
|
2593
|
+
this.unsubscribe$.complete();
|
|
2594
|
+
this.refsUnsubscribe$.next();
|
|
2595
|
+
this.refsUnsubscribe$.complete();
|
|
2650
2596
|
}
|
|
2651
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2652
|
-
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 }); }
|
|
2653
2599
|
}
|
|
2654
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2655
|
-
type:
|
|
2656
|
-
}], 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
|
+
}] } });
|
|
2657
2607
|
|
|
2658
2608
|
function linearGradient(sideOrCorner, color, stop) {
|
|
2659
2609
|
return `linear-gradient(${sideOrCorner},${color} 0%,${stop} 40%)`;
|
|
2660
2610
|
}
|
|
2661
2611
|
class NgxGanttBarComponent extends GanttItemUpper {
|
|
2662
|
-
constructor(
|
|
2663
|
-
super(
|
|
2664
|
-
this.dragContainer =
|
|
2665
|
-
this.drag =
|
|
2666
|
-
this.ganttUpper =
|
|
2667
|
-
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);
|
|
2668
2618
|
this.barClick = new EventEmitter();
|
|
2669
2619
|
this.ganttItemClass = true;
|
|
2670
2620
|
}
|
|
@@ -2715,11 +2665,11 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2715
2665
|
this.barClick.emit({ event, item: this.item.origin });
|
|
2716
2666
|
}
|
|
2717
2667
|
setContentBackground() {
|
|
2718
|
-
let style = { ...(this.item.barStyle || {}) };
|
|
2719
|
-
const contentElement = this.contentElementRef.nativeElement;
|
|
2720
|
-
const barElement = this.elementRef.nativeElement;
|
|
2721
2668
|
if (this.item.refs?.width) {
|
|
2669
|
+
const contentElement = this.contentElementRef.nativeElement;
|
|
2722
2670
|
const color = this.item.color || barBackground;
|
|
2671
|
+
const style = this.item.barStyle || {};
|
|
2672
|
+
const barElement = this.elementRef.nativeElement;
|
|
2723
2673
|
if (this.item.origin.start && this.item.origin.end) {
|
|
2724
2674
|
style.background = color;
|
|
2725
2675
|
style.borderRadius = '';
|
|
@@ -2739,29 +2689,26 @@ class NgxGanttBarComponent extends GanttItemUpper {
|
|
|
2739
2689
|
if (this.item.progress >= 0) {
|
|
2740
2690
|
const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
2741
2691
|
style.background = hexToRgb(color, 0.3);
|
|
2692
|
+
style.borderRadius = '';
|
|
2742
2693
|
contentProgressElement.style.background = color;
|
|
2743
2694
|
}
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
contentElement.style[key] = style[key];
|
|
2695
|
+
for (const key in style) {
|
|
2696
|
+
if (style.hasOwnProperty(key)) {
|
|
2697
|
+
contentElement.style[key] = style[key];
|
|
2698
|
+
}
|
|
2749
2699
|
}
|
|
2750
2700
|
}
|
|
2751
2701
|
}
|
|
2752
2702
|
stopPropagation(event) {
|
|
2753
2703
|
event.stopPropagation();
|
|
2754
2704
|
}
|
|
2755
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2756
|
-
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"] }] }); }
|
|
2757
2707
|
}
|
|
2758
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2708
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttBarComponent, decorators: [{
|
|
2759
2709
|
type: Component,
|
|
2760
2710
|
args: [{ selector: 'ngx-gantt-bar,gantt-bar', providers: [GanttBarDrag], imports: [NgTemplateOutlet], template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n @if (item.draggable && ganttUpper.draggable) {\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n }\n </div>\n @if (item.linkable && ganttUpper.linkable) {\n <div class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n }\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n @if (item.progress >= 0) {\n <div class=\"gantt-bar-content-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"> </ng-template>\n</div>\n" }]
|
|
2761
|
-
}], ctorParameters: () => [
|
|
2762
|
-
type: Inject,
|
|
2763
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2764
|
-
}] }, { type: i0.NgZone }], propDecorators: { barClick: [{
|
|
2711
|
+
}], ctorParameters: () => [], propDecorators: { barClick: [{
|
|
2765
2712
|
type: Output
|
|
2766
2713
|
}], contentElementRef: [{
|
|
2767
2714
|
type: ViewChild,
|
|
@@ -2775,9 +2722,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
2775
2722
|
}] } });
|
|
2776
2723
|
|
|
2777
2724
|
class NgxGanttBaselineComponent {
|
|
2778
|
-
constructor(
|
|
2779
|
-
this.elementRef =
|
|
2780
|
-
this.ganttUpper =
|
|
2725
|
+
constructor() {
|
|
2726
|
+
this.elementRef = inject(ElementRef);
|
|
2727
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
2781
2728
|
this.unsubscribe$ = new Subject();
|
|
2782
2729
|
this.ganttBaselineClass = true;
|
|
2783
2730
|
}
|
|
@@ -2790,500 +2737,273 @@ class NgxGanttBaselineComponent {
|
|
|
2790
2737
|
const itemElement = this.elementRef.nativeElement;
|
|
2791
2738
|
itemElement.style.left = this.baselineItem.refs.x + 'px';
|
|
2792
2739
|
itemElement.style.bottom = '2px';
|
|
2793
|
-
itemElement.style.width = this.baselineItem.refs.width + 'px';
|
|
2794
|
-
}
|
|
2795
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttBaselineComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2796
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttBaselineComponent, isStandalone: true, selector: "ngx-gantt-baseline,gantt-baseline", inputs: { baselineItem: "baselineItem", template: "template" }, host: { properties: { "class.gantt-baseline": "this.ganttBaselineClass" } }, ngImport: i0, template: "@if (baselineItem) {\n <div #content class=\"baseline-content\">\n <ng-template\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ item: baselineItem.origin, refs: baselineItem.refs }\"\n ></ng-template>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
2797
|
-
}
|
|
2798
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttBaselineComponent, decorators: [{
|
|
2799
|
-
type: Component,
|
|
2800
|
-
args: [{ selector: 'ngx-gantt-baseline,gantt-baseline', imports: [NgTemplateOutlet], template: "@if (baselineItem) {\n <div #content class=\"baseline-content\">\n <ng-template\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{ item: baselineItem.origin, refs: baselineItem.refs }\"\n ></ng-template>\n </div>\n}\n" }]
|
|
2801
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
2802
|
-
type: Inject,
|
|
2803
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2804
|
-
}] }], propDecorators: { baselineItem: [{
|
|
2805
|
-
type: Input
|
|
2806
|
-
}], template: [{
|
|
2807
|
-
type: Input
|
|
2808
|
-
}], ganttBaselineClass: [{
|
|
2809
|
-
type: HostBinding,
|
|
2810
|
-
args: ['class.gantt-baseline']
|
|
2811
|
-
}] } });
|
|
2812
|
-
|
|
2813
|
-
const mainHeight = 5000;
|
|
2814
|
-
class GanttCalendarGridComponent {
|
|
2815
|
-
get view() {
|
|
2816
|
-
return this.ganttUpper.view;
|
|
2817
|
-
}
|
|
2818
|
-
constructor(ganttUpper, ngZone, elementRef) {
|
|
2819
|
-
this.ganttUpper = ganttUpper;
|
|
2820
|
-
this.ngZone = ngZone;
|
|
2821
|
-
this.elementRef = elementRef;
|
|
2822
|
-
this.unsubscribe$ = new Subject();
|
|
2823
|
-
this.mainHeight = mainHeight;
|
|
2824
|
-
this.todayBorderRadius = todayBorderRadius;
|
|
2825
|
-
this.viewTypes = GanttViewType;
|
|
2826
|
-
this.className = `gantt-calendar gantt-calendar-grid`;
|
|
2827
|
-
}
|
|
2828
|
-
setTodayPoint() {
|
|
2829
|
-
const x = this.view.getTodayXPoint();
|
|
2830
|
-
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2831
|
-
const line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
|
|
2832
|
-
if (isNumber(x)) {
|
|
2833
|
-
if (line) {
|
|
2834
|
-
line.style.left = `${x}px`;
|
|
2835
|
-
line.style.top = `0px`;
|
|
2836
|
-
line.style.bottom = `${-mainHeight}px`;
|
|
2837
|
-
}
|
|
2838
|
-
}
|
|
2839
|
-
else {
|
|
2840
|
-
todayEle.style.display = 'none';
|
|
2841
|
-
}
|
|
2842
|
-
}
|
|
2843
|
-
ngOnInit() {
|
|
2844
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2845
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2846
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2847
|
-
.subscribe(() => {
|
|
2848
|
-
this.setTodayPoint();
|
|
2849
|
-
});
|
|
2850
|
-
});
|
|
2851
|
-
}
|
|
2852
|
-
ngOnDestroy() {
|
|
2853
|
-
this.unsubscribe$.next();
|
|
2854
|
-
this.unsubscribe$.complete();
|
|
2855
|
-
}
|
|
2856
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarGridComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2857
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttCalendarGridComponent, isStandalone: true, selector: "gantt-calendar-grid", host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"mainHeight\" class=\"primary-line\"></line>\n }\n </g>\n </g>\n</svg>\n" }); }
|
|
2858
|
-
}
|
|
2859
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
|
|
2860
|
-
type: Component,
|
|
2861
|
-
args: [{ selector: 'gantt-calendar-grid', standalone: true, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"mainHeight\" class=\"primary-line\"></line>\n }\n </g>\n </g>\n</svg>\n" }]
|
|
2862
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2863
|
-
type: Inject,
|
|
2864
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2865
|
-
}] }, { type: i0.NgZone }, { type: i0.ElementRef }], propDecorators: { className: [{
|
|
2866
|
-
type: HostBinding,
|
|
2867
|
-
args: ['class']
|
|
2868
|
-
}] } });
|
|
2869
|
-
|
|
2870
|
-
class GanttCalendarHeaderComponent {
|
|
2871
|
-
get view() {
|
|
2872
|
-
return this.ganttUpper.view;
|
|
2873
|
-
}
|
|
2874
|
-
get height() {
|
|
2875
|
-
return this.ganttUpper.styles.headerHeight + 'px';
|
|
2876
|
-
}
|
|
2877
|
-
constructor(ganttUpper, ngZone, elementRef) {
|
|
2878
|
-
this.ganttUpper = ganttUpper;
|
|
2879
|
-
this.ngZone = ngZone;
|
|
2880
|
-
this.elementRef = elementRef;
|
|
2881
|
-
this.unsubscribe$ = new Subject();
|
|
2882
|
-
this.viewTypes = GanttViewType;
|
|
2883
|
-
this.className = `gantt-calendar gantt-calendar-header`;
|
|
2884
|
-
}
|
|
2885
|
-
ngOnInit() {
|
|
2886
|
-
// 头部日期定位
|
|
2887
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
2888
|
-
merge(this.ganttUpper.viewChange, this.ganttUpper.view.start$)
|
|
2889
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
2890
|
-
.subscribe(() => {
|
|
2891
|
-
if (this.ganttUpper.viewType === GanttViewType.day)
|
|
2892
|
-
this.setTodayPoint();
|
|
2893
|
-
});
|
|
2894
|
-
});
|
|
2895
|
-
}
|
|
2896
|
-
setTodayPoint() {
|
|
2897
|
-
const x = this.view.getTodayXPoint();
|
|
2898
|
-
const today = new GanttDate().getDate();
|
|
2899
|
-
const todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2900
|
-
const rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
2901
|
-
if (isNumber(x)) {
|
|
2902
|
-
if (rect) {
|
|
2903
|
-
rect.style.left = `${x - todayWidth / 2}px`;
|
|
2904
|
-
rect.style.top = `${this.ganttUpper.styles.headerHeight - todayHeight}px`;
|
|
2905
|
-
rect.innerHTML = today.toString();
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
else {
|
|
2909
|
-
todayEle.style.display = 'none';
|
|
2910
|
-
}
|
|
2911
|
-
}
|
|
2912
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarHeaderComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2913
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: GanttCalendarHeaderComponent, isStandalone: true, selector: "gantt-calendar-header", host: { properties: { "class": "this.className", "style.height": "this.height" } }, ngImport: i0, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"ganttUpper.styles.headerHeight\" class=\"primary-line\"></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n", dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
|
2914
|
-
}
|
|
2915
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
2916
|
-
type: Component,
|
|
2917
|
-
args: [{ selector: 'gantt-calendar-header', imports: [NgStyle], template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point?.x) {\n @let rightX = point?.rightX ?? ($index + 1) * view.primaryWidth;\n <line [attr.x1]=\"rightX\" [attr.x2]=\"rightX\" [attr.y1]=\"0\" [attr.y2]=\"ganttUpper.styles.headerHeight\" class=\"primary-line\"></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
|
|
2918
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2919
|
-
type: Inject,
|
|
2920
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2921
|
-
}] }, { type: i0.NgZone }, { type: i0.ElementRef }], propDecorators: { className: [{
|
|
2922
|
-
type: HostBinding,
|
|
2923
|
-
args: ['class']
|
|
2924
|
-
}], height: [{
|
|
2925
|
-
type: HostBinding,
|
|
2926
|
-
args: ['style.height']
|
|
2927
|
-
}] } });
|
|
2928
|
-
|
|
2929
|
-
class GanttDragBackdropComponent {
|
|
2930
|
-
constructor(ganttUpper) {
|
|
2931
|
-
this.ganttUpper = ganttUpper;
|
|
2932
|
-
}
|
|
2933
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragBackdropComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2934
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttDragBackdropComponent, isStandalone: true, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }); }
|
|
2935
|
-
}
|
|
2936
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttDragBackdropComponent, decorators: [{
|
|
2937
|
-
type: Component,
|
|
2938
|
-
args: [{ selector: 'gantt-drag-backdrop', host: {
|
|
2939
|
-
class: 'gantt-drag-backdrop'
|
|
2940
|
-
}, standalone: true, template: "<div class=\"gantt-drag-mask\" [style.top.px]=\"ganttUpper.styles.headerHeight\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" }]
|
|
2941
|
-
}], ctorParameters: () => [{ type: GanttUpper, decorators: [{
|
|
2942
|
-
type: Inject,
|
|
2943
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2944
|
-
}] }] });
|
|
2945
|
-
|
|
2946
|
-
class GanttLoaderComponent {
|
|
2947
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2948
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: GanttLoaderComponent, isStandalone: true, selector: "gantt-loader", host: { classAttribute: "gantt-loader gantt-loader-overlay" }, ngImport: i0, template: `
|
|
2949
|
-
<div class="gantt-loader-wrapper">
|
|
2950
|
-
<div class="gantt-loader-loading">
|
|
2951
|
-
<span class="gantt-loader-loading-spot"></span>
|
|
2952
|
-
</div>
|
|
2953
|
-
</div>
|
|
2954
|
-
`, isInline: true }); }
|
|
2955
|
-
}
|
|
2956
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttLoaderComponent, decorators: [{
|
|
2957
|
-
type: Component,
|
|
2958
|
-
args: [{
|
|
2959
|
-
selector: 'gantt-loader',
|
|
2960
|
-
template: `
|
|
2961
|
-
<div class="gantt-loader-wrapper">
|
|
2962
|
-
<div class="gantt-loader-loading">
|
|
2963
|
-
<span class="gantt-loader-loading-spot"></span>
|
|
2964
|
-
</div>
|
|
2965
|
-
</div>
|
|
2966
|
-
`,
|
|
2967
|
-
host: {
|
|
2968
|
-
class: 'gantt-loader gantt-loader-overlay'
|
|
2969
|
-
},
|
|
2970
|
-
standalone: true
|
|
2971
|
-
}]
|
|
2972
|
-
}] });
|
|
2973
|
-
|
|
2974
|
-
class NgxGanttRangeComponent extends GanttItemUpper {
|
|
2975
|
-
constructor(elementRef, ganttUpper) {
|
|
2976
|
-
super(elementRef, ganttUpper);
|
|
2977
|
-
this.ganttRangeClass = true;
|
|
2978
|
-
}
|
|
2979
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, deps: [{ token: i0.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2980
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.3", type: NgxGanttRangeComponent, isStandalone: true, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0, template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
2981
|
-
}
|
|
2982
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: NgxGanttRangeComponent, decorators: [{
|
|
2983
|
-
type: Component,
|
|
2984
|
-
args: [{ selector: 'ngx-gantt-range,gantt-range', imports: [NgTemplateOutlet], template: "@if (item.start && item.end) {\n <div class=\"gantt-range-main\">\n @if (item.progress >= 0) {\n <div class=\"gantt-range-main-progress\" [style.width.%]=\"item.progress * 100\"></div>\n }\n </div>\n <div class=\"gantt-range-triangle left\"></div>\n <div class=\"gantt-range-triangle right\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n}\n" }]
|
|
2985
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: GanttUpper, decorators: [{
|
|
2986
|
-
type: Inject,
|
|
2987
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2988
|
-
}] }], propDecorators: { ganttRangeClass: [{
|
|
2989
|
-
type: HostBinding,
|
|
2990
|
-
args: ['class.gantt-range']
|
|
2991
|
-
}] } });
|
|
2992
|
-
|
|
2993
|
-
class GanttSyncScrollService {
|
|
2994
|
-
constructor() {
|
|
2995
|
-
this.ngZone = inject(NgZone);
|
|
2996
|
-
this.scrollGroupsMap = new Map();
|
|
2997
|
-
}
|
|
2998
|
-
registerScrollEvent(groupName, element, direction) {
|
|
2999
|
-
const group = this.scrollGroupsMap.get(groupName) || { elements: [], destroy$: new Subject(), direction };
|
|
3000
|
-
group.elements.push(element);
|
|
3001
|
-
this.scrollGroupsMap.set(groupName, group);
|
|
3002
|
-
this.monitorScrollChange(group);
|
|
3003
|
-
}
|
|
3004
|
-
unregisterScrollEvent(groupName, element) {
|
|
3005
|
-
const group = this.scrollGroupsMap.get(groupName);
|
|
3006
|
-
if (group) {
|
|
3007
|
-
group.elements = group.elements.filter((el) => el !== element);
|
|
3008
|
-
if (!group.elements.length) {
|
|
3009
|
-
this.scrollGroupsMap.delete(groupName);
|
|
3010
|
-
}
|
|
3011
|
-
else {
|
|
3012
|
-
this.scrollGroupsMap.set(groupName, group);
|
|
3013
|
-
}
|
|
3014
|
-
this.monitorScrollChange(group);
|
|
3015
|
-
}
|
|
3016
|
-
}
|
|
3017
|
-
monitorScrollChange(group) {
|
|
3018
|
-
const { elements, destroy$, direction } = group;
|
|
3019
|
-
destroy$.next();
|
|
3020
|
-
destroy$.complete();
|
|
3021
|
-
if (elements.length) {
|
|
3022
|
-
const scrollObservers = elements.map((el) => fromEvent(el, 'scroll', passiveListenerOptions));
|
|
3023
|
-
this.ngZone.runOutsideAngular(() => merge(...scrollObservers)
|
|
3024
|
-
.pipe(takeUntil$1(destroy$))
|
|
3025
|
-
.subscribe((event) => {
|
|
3026
|
-
elements.forEach((el) => {
|
|
3027
|
-
if (direction === 'x') {
|
|
3028
|
-
el.scrollLeft = event.currentTarget.scrollLeft;
|
|
3029
|
-
}
|
|
3030
|
-
else {
|
|
3031
|
-
el.scrollTop = event.currentTarget.scrollTop;
|
|
3032
|
-
}
|
|
3033
|
-
});
|
|
3034
|
-
}));
|
|
3035
|
-
}
|
|
3036
|
-
}
|
|
3037
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3038
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService }); }
|
|
3039
|
-
}
|
|
3040
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollService, decorators: [{
|
|
3041
|
-
type: Injectable
|
|
3042
|
-
}], ctorParameters: () => [] });
|
|
3043
|
-
|
|
3044
|
-
class GanttSyncScrollXDirective {
|
|
3045
|
-
constructor() {
|
|
3046
|
-
this.syncScrollX = input();
|
|
3047
|
-
this.elementRef = inject((ElementRef));
|
|
3048
|
-
this.syncScrollService = inject(GanttSyncScrollService);
|
|
3049
|
-
}
|
|
3050
|
-
ngOnInit() {
|
|
3051
|
-
this.syncScrollService.registerScrollEvent(this.syncScrollX(), this.elementRef.nativeElement, 'x');
|
|
3052
|
-
}
|
|
3053
|
-
ngOnDestroy() {
|
|
3054
|
-
this.syncScrollService.unregisterScrollEvent(this.syncScrollX(), this.elementRef.nativeElement);
|
|
2740
|
+
itemElement.style.width = this.baselineItem.refs.width + 'px';
|
|
3055
2741
|
}
|
|
3056
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3057
|
-
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"] }] }); }
|
|
3058
2744
|
}
|
|
3059
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3060
|
-
type:
|
|
3061
|
-
args: [{
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
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
|
+
}
|
|
3067
2762
|
constructor() {
|
|
3068
|
-
this.
|
|
3069
|
-
this.
|
|
3070
|
-
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
|
+
}
|
|
3071
2786
|
}
|
|
3072
2787
|
ngOnInit() {
|
|
3073
|
-
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
|
+
});
|
|
3074
2795
|
}
|
|
3075
2796
|
ngOnDestroy() {
|
|
3076
|
-
this.
|
|
3077
|
-
|
|
3078
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3079
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.3", type: GanttSyncScrollYDirective, isStandalone: true, selector: "[syncScrollY]", inputs: { syncScrollY: { classPropertyName: "syncScrollY", publicName: "syncScrollY", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
3080
|
-
}
|
|
3081
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: GanttSyncScrollYDirective, decorators: [{
|
|
3082
|
-
type: Directive,
|
|
3083
|
-
args: [{
|
|
3084
|
-
selector: '[syncScrollY]',
|
|
3085
|
-
standalone: true
|
|
3086
|
-
}]
|
|
3087
|
-
}], ctorParameters: () => [] });
|
|
3088
|
-
|
|
3089
|
-
class GanttScrollbarComponent {
|
|
3090
|
-
constructor(ganttUpper) {
|
|
3091
|
-
this.ganttUpper = ganttUpper;
|
|
3092
|
-
this.hasFooter = input(false);
|
|
3093
|
-
this.tableWidth = input();
|
|
3094
|
-
this.ganttRoot = input();
|
|
3095
|
-
this.tableScrollWidth = input(0);
|
|
2797
|
+
this.unsubscribe$.next();
|
|
2798
|
+
this.unsubscribe$.complete();
|
|
3096
2799
|
}
|
|
3097
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3098
|
-
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" }); }
|
|
3099
2802
|
}
|
|
3100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2803
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttCalendarGridComponent, decorators: [{
|
|
3101
2804
|
type: Component,
|
|
3102
|
-
args: [{ selector: 'gantt-
|
|
3103
|
-
}], ctorParameters: () => [
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
2805
|
+
args: [{ selector: 'gantt-calendar-grid', standalone: true, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n @if (ganttUpper.showTodayLine) {\n <span class=\"today-line\"> </span>\n }\n</div>\n<svg class=\"gantt-calendar-grid-fill\" [attr.width]=\"view.width\" [attr.height]=\"1\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect [attr.x]=\"$index * view.cellWidth\" y=\"0\" [attr.width]=\"view.cellWidth\" [attr.height]=\"mainHeight\" [attr.fill]=\"point.fill\" />\n }\n }\n </g>\n</svg>\n\n<svg class=\"gantt-calendar-grid-main\" [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight - 1\">\n <g>\n @if (view.showTimeline) {\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.cellWidth\"\n [attr.x2]=\"($index + 1) * view.cellWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n }\n </g>\n }\n <g>\n @for (point of view.primaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.primaryWidth\"\n [attr.x2]=\"($index + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n }\n </g>\n </g>\n</svg>\n" }]
|
|
2806
|
+
}], ctorParameters: () => [], propDecorators: { className: [{
|
|
2807
|
+
type: HostBinding,
|
|
2808
|
+
args: ['class']
|
|
2809
|
+
}] } });
|
|
3107
2810
|
|
|
3108
|
-
class
|
|
3109
|
-
get
|
|
3110
|
-
return this.ganttUpper.
|
|
2811
|
+
class GanttCalendarHeaderComponent {
|
|
2812
|
+
get view() {
|
|
2813
|
+
return this.ganttUpper.view;
|
|
3111
2814
|
}
|
|
3112
|
-
|
|
3113
|
-
this.ganttUpper
|
|
3114
|
-
this.ganttItemClass = true;
|
|
3115
|
-
this.views = inject(GanttConfigService).getViewsLocale();
|
|
2815
|
+
get height() {
|
|
2816
|
+
return this.ganttUpper.styles.headerHeight + 'px';
|
|
3116
2817
|
}
|
|
3117
|
-
|
|
3118
|
-
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
|
+
}
|
|
3119
2852
|
}
|
|
3120
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3121
|
-
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"] }] }); }
|
|
3122
2855
|
}
|
|
3123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttCalendarHeaderComponent, decorators: [{
|
|
3124
2857
|
type: Component,
|
|
3125
|
-
args: [{ selector: '
|
|
3126
|
-
}], ctorParameters: () => [
|
|
3127
|
-
type: Inject,
|
|
3128
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3129
|
-
}] }], propDecorators: { template: [{
|
|
3130
|
-
type: Input
|
|
3131
|
-
}], ganttItemClass: [{
|
|
2858
|
+
args: [{ selector: 'gantt-calendar-header', imports: [NgStyle], template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n</div>\n<svg [attr.width]=\"view.width\" [attr.height]=\"ganttUpper.styles.headerHeight\">\n <g>\n @for (point of view.secondaryDatePoints; track point.x) {\n @if (point.fill) {\n <rect\n [attr.x]=\"$index * view.cellWidth\"\n y=\"0\"\n [attr.width]=\"view.cellWidth\"\n [attr.height]=\"ganttUpper.styles.headerHeight\"\n [attr.fill]=\"point.fill\"\n />\n }\n <text\n class=\"secondary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n @for (point of view.primaryDatePoints; track point.x) {\n <text\n class=\"primary-text\"\n [ngStyle]=\"point.style\"\n [class.today]=\"point.additions?.isToday\"\n [class.weekend]=\"point.additions?.isWeekend\"\n [attr.x]=\"point.x\"\n [attr.y]=\"point.y\"\n >\n {{ point.text }}\n </text>\n }\n\n <g>\n @for (point of view.primaryDatePoints; track point.x) {\n <line\n [attr.x1]=\"($index + 1) * view.primaryWidth\"\n [attr.x2]=\"($index + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"primary-line\"\n ></line>\n }\n </g>\n\n <g>\n <line\n [attr.x1]=\"0\"\n [attr.x2]=\"view.width\"\n [attr.y1]=\"ganttUpper.styles.headerHeight\"\n [attr.y2]=\"ganttUpper.styles.headerHeight\"\n class=\"header-line\"\n ></line>\n </g>\n </g>\n</svg>\n" }]
|
|
2859
|
+
}], ctorParameters: () => [], propDecorators: { className: [{
|
|
3132
2860
|
type: HostBinding,
|
|
3133
|
-
args: ['class
|
|
3134
|
-
}],
|
|
2861
|
+
args: ['class']
|
|
2862
|
+
}], height: [{
|
|
3135
2863
|
type: HostBinding,
|
|
3136
|
-
args: ['style.
|
|
2864
|
+
args: ['style.height']
|
|
3137
2865
|
}] } });
|
|
3138
2866
|
|
|
3139
|
-
class
|
|
3140
|
-
constructor() {
|
|
3141
|
-
|
|
3142
|
-
const svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
3143
|
-
for (const svgElement of svgElements) {
|
|
3144
|
-
this.recursElementChildren(svgElement);
|
|
3145
|
-
}
|
|
3146
|
-
}
|
|
3147
|
-
recursElementChildren(node) {
|
|
3148
|
-
const transformProperties = [
|
|
3149
|
-
'fill',
|
|
3150
|
-
'color',
|
|
3151
|
-
'font-size',
|
|
3152
|
-
'stroke',
|
|
3153
|
-
'font',
|
|
3154
|
-
'text-anchor',
|
|
3155
|
-
'stroke-dasharray',
|
|
3156
|
-
'shape-rendering',
|
|
3157
|
-
'stroke-width'
|
|
3158
|
-
];
|
|
3159
|
-
if (!node.style) {
|
|
3160
|
-
return;
|
|
3161
|
-
}
|
|
3162
|
-
const styles = getComputedStyle(node);
|
|
3163
|
-
for (const transformProperty of transformProperties) {
|
|
3164
|
-
node.style[transformProperty] = styles[transformProperty];
|
|
3165
|
-
}
|
|
3166
|
-
for (const child of Array.from(node.childNodes)) {
|
|
3167
|
-
this.recursElementChildren(child);
|
|
3168
|
-
}
|
|
3169
|
-
}
|
|
3170
|
-
register(root) {
|
|
3171
|
-
this.root = root.nativeElement;
|
|
3172
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
3173
|
-
}
|
|
3174
|
-
async print(name = 'download', ignoreElementClass) {
|
|
3175
|
-
const root = this.root;
|
|
3176
|
-
const mainContainer = this.mainContainer;
|
|
3177
|
-
// set print width
|
|
3178
|
-
const printWidth = root.offsetWidth;
|
|
3179
|
-
// set print height
|
|
3180
|
-
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
3181
|
-
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
3182
|
-
html2canvas(root, {
|
|
3183
|
-
logging: false,
|
|
3184
|
-
allowTaint: true,
|
|
3185
|
-
useCORS: true,
|
|
3186
|
-
width: printWidth,
|
|
3187
|
-
height: printHeight,
|
|
3188
|
-
ignoreElements: (element) => {
|
|
3189
|
-
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
3190
|
-
return true;
|
|
3191
|
-
}
|
|
3192
|
-
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
3193
|
-
return true;
|
|
3194
|
-
}
|
|
3195
|
-
},
|
|
3196
|
-
onclone: (cloneDocument) => {
|
|
3197
|
-
const ganttClass = root.className;
|
|
3198
|
-
const cloneGanttDom = cloneDocument.querySelector(`.${ganttClass.replace(/\s+/g, '.')}`);
|
|
3199
|
-
const cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
3200
|
-
const cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-grid-main');
|
|
3201
|
-
const cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
3202
|
-
// change targetDom width
|
|
3203
|
-
cloneGanttDom.style.width = `${printWidth}px`;
|
|
3204
|
-
cloneGanttDom.style.height = `${printHeight}px`;
|
|
3205
|
-
cloneGanttDom.style.overflow = `unset`;
|
|
3206
|
-
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
3207
|
-
cloneCalendarOverlay.setAttribute('height', `${printHeight}`);
|
|
3208
|
-
cloneCalendarOverlay.setAttribute('style', `background: transparent`);
|
|
3209
|
-
if (cloneLinksOverlay) {
|
|
3210
|
-
cloneLinksOverlay.setAttribute('height', `${printHeight}`);
|
|
3211
|
-
cloneLinksOverlay.setAttribute('style', `height: ${printHeight}px`);
|
|
3212
|
-
}
|
|
3213
|
-
// setInlineStyles for svg
|
|
3214
|
-
this.setInlineStyles(cloneGanttDom);
|
|
3215
|
-
}
|
|
3216
|
-
}).then((canvas) => {
|
|
3217
|
-
const link = document.createElement('a');
|
|
3218
|
-
const dataUrl = canvas.toDataURL('image/png');
|
|
3219
|
-
link.download = `${name}.png`;
|
|
3220
|
-
link.href = dataUrl;
|
|
3221
|
-
link.click();
|
|
3222
|
-
});
|
|
2867
|
+
class GanttDragBackdropComponent {
|
|
2868
|
+
constructor() {
|
|
2869
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
3223
2870
|
}
|
|
3224
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3225
|
-
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" }); }
|
|
3226
2873
|
}
|
|
3227
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3228
|
-
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" }]
|
|
3229
2879
|
}], ctorParameters: () => [] });
|
|
3230
2880
|
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
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);
|
|
3248
2977
|
}
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: IsGanttBarItemPipe, decorators: [{
|
|
3253
|
-
type: Pipe,
|
|
3254
|
-
args: [{
|
|
3255
|
-
name: 'isGanttBarItem',
|
|
3256
|
-
standalone: true
|
|
3257
|
-
}]
|
|
3258
|
-
}] });
|
|
3259
|
-
class IsGanttCustomItemPipe {
|
|
3260
|
-
transform(value) {
|
|
3261
|
-
return value === GanttItemType.custom;
|
|
2978
|
+
constructor() {
|
|
2979
|
+
this.elementRef = inject(ElementRef);
|
|
2980
|
+
this.isIcon = true;
|
|
3262
2981
|
}
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
}]
|
|
3272
|
-
}] });
|
|
3273
|
-
class IsGanttGroupPipe {
|
|
3274
|
-
transform(data) {
|
|
3275
|
-
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
|
+
}
|
|
3276
2990
|
}
|
|
3277
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3278
|
-
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 }); }
|
|
3279
2993
|
}
|
|
3280
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3281
|
-
type:
|
|
2994
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttIconComponent, decorators: [{
|
|
2995
|
+
type: Component,
|
|
3282
2996
|
args: [{
|
|
3283
|
-
|
|
2997
|
+
selector: 'gantt-icon',
|
|
2998
|
+
template: '',
|
|
3284
2999
|
standalone: true
|
|
3285
3000
|
}]
|
|
3286
|
-
}]
|
|
3001
|
+
}], ctorParameters: () => [], propDecorators: { isIcon: [{
|
|
3002
|
+
type: HostBinding,
|
|
3003
|
+
args: ['class.gantt-icon']
|
|
3004
|
+
}], iconName: [{
|
|
3005
|
+
type: Input
|
|
3006
|
+
}] } });
|
|
3287
3007
|
|
|
3288
3008
|
class GanttLinkLine {
|
|
3289
3009
|
constructor() { }
|
|
@@ -3465,12 +3185,12 @@ function createLineGenerator(type, ganttUpper) {
|
|
|
3465
3185
|
}
|
|
3466
3186
|
|
|
3467
3187
|
class GanttLinksComponent {
|
|
3468
|
-
constructor(
|
|
3469
|
-
this.ganttUpper =
|
|
3470
|
-
this.cdr =
|
|
3471
|
-
this.elementRef =
|
|
3472
|
-
this.ganttDragContainer =
|
|
3473
|
-
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);
|
|
3474
3194
|
// @Input() groups: GanttGroupInternal[] = [];
|
|
3475
3195
|
// @Input() items: GanttItemInternal[] = [];
|
|
3476
3196
|
this.flatItems = [];
|
|
@@ -3644,16 +3364,13 @@ class GanttLinksComponent {
|
|
|
3644
3364
|
this.unsubscribe$.next();
|
|
3645
3365
|
this.unsubscribe$.complete();
|
|
3646
3366
|
}
|
|
3647
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3648
|
-
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" }); }
|
|
3649
3369
|
}
|
|
3650
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttLinksComponent, decorators: [{
|
|
3651
3371
|
type: Component,
|
|
3652
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" }]
|
|
3653
|
-
}], ctorParameters: () => [
|
|
3654
|
-
type: Inject,
|
|
3655
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3656
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: GanttDragContainer }, { type: i0.NgZone }], propDecorators: { flatItems: [{
|
|
3373
|
+
}], ctorParameters: () => [], propDecorators: { flatItems: [{
|
|
3657
3374
|
type: Input
|
|
3658
3375
|
}], lineClick: [{
|
|
3659
3376
|
type: Output
|
|
@@ -3662,138 +3379,112 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
3662
3379
|
args: ['class.gantt-links-overlay']
|
|
3663
3380
|
}] } });
|
|
3664
3381
|
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
<
|
|
3671
|
-
|
|
3672
|
-
</
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
>
|
|
3682
|
-
<
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
opacity="0.3"
|
|
3693
|
-
filter="url(#filter-1)"
|
|
3694
|
-
cx="73.0800017"
|
|
3695
|
-
cy="115.920003"
|
|
3696
|
-
rx="73.0800017"
|
|
3697
|
-
ry="16.8000004"
|
|
3698
|
-
></ellipse>
|
|
3699
|
-
<g id="编组-5" transform="translate(15.120000, 0.000000)">
|
|
3700
|
-
<polygon
|
|
3701
|
-
id="矩形"
|
|
3702
|
-
fill="#E2E4E9"
|
|
3703
|
-
points="19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267"
|
|
3704
|
-
></polygon>
|
|
3705
|
-
<path
|
|
3706
|
-
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"
|
|
3707
|
-
id="矩形"
|
|
3708
|
-
fill="#F9FAFB"
|
|
3709
|
-
></path>
|
|
3710
|
-
<path
|
|
3711
|
-
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"
|
|
3712
|
-
id="矩形"
|
|
3713
|
-
fill="#E8EAEE"
|
|
3714
|
-
></path>
|
|
3715
|
-
<text
|
|
3716
|
-
id="</null>"
|
|
3717
|
-
font-family="PingFangSC-Medium, PingFang SC"
|
|
3718
|
-
font-size="15.1200003"
|
|
3719
|
-
font-weight="400"
|
|
3720
|
-
fill="#BCBECD"
|
|
3721
|
-
>
|
|
3722
|
-
<tspan x="33.6000008" y="32.8000004"></null></tspan>
|
|
3723
|
-
</text>
|
|
3724
|
-
<rect id="矩形" fill="#E8EAEE" x="27.5600006" y="52.0800012" width="61.4800014" height="5.04000011" rx="2.52000006"></rect>
|
|
3725
|
-
<rect
|
|
3726
|
-
id="矩形备份"
|
|
3727
|
-
fill="#E8EAEE"
|
|
3728
|
-
x="27.5600006"
|
|
3729
|
-
y="63.8400014"
|
|
3730
|
-
width="61.4800014"
|
|
3731
|
-
height="5.04000011"
|
|
3732
|
-
rx="2.52000006"
|
|
3733
|
-
></rect>
|
|
3734
|
-
<path
|
|
3735
|
-
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"
|
|
3736
|
-
id="矩形"
|
|
3737
|
-
fill="#EDEFF2"
|
|
3738
|
-
></path>
|
|
3739
|
-
</g>
|
|
3740
|
-
</g>
|
|
3741
|
-
</g>
|
|
3742
|
-
</svg>`;
|
|
3743
|
-
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>`;
|
|
3744
|
-
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>`;
|
|
3745
|
-
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>`;
|
|
3746
|
-
const icons = {
|
|
3747
|
-
'angle-right': angleRight,
|
|
3748
|
-
'angle-down': angleDown,
|
|
3749
|
-
'plus-square': plusSquare,
|
|
3750
|
-
'minus-square': minusSquare,
|
|
3751
|
-
loading: loadingIcon,
|
|
3752
|
-
empty: emptyIcon,
|
|
3753
|
-
drag: dragIcon,
|
|
3754
|
-
'arrow-left': arrowLeftIcon,
|
|
3755
|
-
'arrow-right': arrowRightIcon
|
|
3756
|
-
};
|
|
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
|
+
}] });
|
|
3757
3409
|
|
|
3758
|
-
class
|
|
3759
|
-
|
|
3760
|
-
|
|
3410
|
+
class IsGanttRangeItemPipe {
|
|
3411
|
+
transform(value) {
|
|
3412
|
+
return value === GanttItemType.range;
|
|
3761
3413
|
}
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
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;
|
|
3765
3441
|
}
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
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;
|
|
3774
3455
|
}
|
|
3775
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3776
|
-
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" }); }
|
|
3777
3458
|
}
|
|
3778
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3779
|
-
type:
|
|
3459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: IsGanttGroupPipe, decorators: [{
|
|
3460
|
+
type: Pipe,
|
|
3780
3461
|
args: [{
|
|
3781
|
-
|
|
3782
|
-
template: '',
|
|
3462
|
+
name: 'isGanttGroup',
|
|
3783
3463
|
standalone: true
|
|
3784
3464
|
}]
|
|
3785
|
-
}]
|
|
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: [{
|
|
3786
3479
|
type: HostBinding,
|
|
3787
|
-
args: ['class.gantt-
|
|
3788
|
-
}], iconName: [{
|
|
3789
|
-
type: Input
|
|
3480
|
+
args: ['class.gantt-range']
|
|
3790
3481
|
}] } });
|
|
3791
3482
|
|
|
3792
3483
|
class GanttMainComponent {
|
|
3793
|
-
constructor(
|
|
3794
|
-
this.ganttUpper =
|
|
3795
|
-
this.dom =
|
|
3796
|
-
this.ngZone =
|
|
3484
|
+
constructor() {
|
|
3485
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
3486
|
+
this.dom = inject(GanttDomService);
|
|
3487
|
+
this.ngZone = inject(NgZone);
|
|
3797
3488
|
this.barClick = new EventEmitter();
|
|
3798
3489
|
this.lineClick = new EventEmitter();
|
|
3799
3490
|
this.ganttMainClass = true;
|
|
@@ -3824,10 +3515,10 @@ class GanttMainComponent {
|
|
|
3824
3515
|
const date = type === 'left' ? item.start || item.end : item.end || item.start;
|
|
3825
3516
|
this.ganttRoot.scrollToDate(date);
|
|
3826
3517
|
}
|
|
3827
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3828
|
-
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" }] }); }
|
|
3829
3520
|
}
|
|
3830
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttMainComponent, decorators: [{
|
|
3831
3522
|
type: Component,
|
|
3832
3523
|
args: [{ selector: 'gantt-main', imports: [
|
|
3833
3524
|
GanttLinksComponent,
|
|
@@ -3841,11 +3532,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
3841
3532
|
IsGanttCustomItemPipe,
|
|
3842
3533
|
IsGanttGroupPipe,
|
|
3843
3534
|
GanttIconComponent
|
|
3844
|
-
], 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
|
|
3845
|
-
}], ctorParameters: () => [
|
|
3846
|
-
type: Inject,
|
|
3847
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3848
|
-
}] }, { 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: [{
|
|
3849
3537
|
type: Input
|
|
3850
3538
|
}], flatItems: [{
|
|
3851
3539
|
type: Input
|
|
@@ -3889,6 +3577,102 @@ function setStyleWithVendorPrefix({ element, style, value }) {
|
|
|
3889
3577
|
}
|
|
3890
3578
|
}
|
|
3891
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
|
+
|
|
3892
3676
|
const defaultColumnWidth = 100;
|
|
3893
3677
|
const minColumnWidth = 80;
|
|
3894
3678
|
class GanttTableHeaderComponent {
|
|
@@ -3898,10 +3682,10 @@ class GanttTableHeaderComponent {
|
|
|
3898
3682
|
get lineHeight() {
|
|
3899
3683
|
return this.gantt.styles.headerHeight + 'px';
|
|
3900
3684
|
}
|
|
3901
|
-
constructor(
|
|
3902
|
-
this.elementRef =
|
|
3903
|
-
this.gantt =
|
|
3904
|
-
this.cdr =
|
|
3685
|
+
constructor() {
|
|
3686
|
+
this.elementRef = inject(ElementRef);
|
|
3687
|
+
this.gantt = inject(GANTT_ABSTRACT_TOKEN);
|
|
3688
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
3905
3689
|
this.tableWidth = 0;
|
|
3906
3690
|
this.unsubscribe$ = new Subject();
|
|
3907
3691
|
this.className = `gantt-table-header `;
|
|
@@ -4006,16 +3790,13 @@ class GanttTableHeaderComponent {
|
|
|
4006
3790
|
this.unsubscribe$.next();
|
|
4007
3791
|
this.unsubscribe$.complete();
|
|
4008
3792
|
}
|
|
4009
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4010
|
-
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"] }] }); }
|
|
4011
3795
|
}
|
|
4012
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3796
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttTableHeaderComponent, decorators: [{
|
|
4013
3797
|
type: Component,
|
|
4014
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" }]
|
|
4015
|
-
}], ctorParameters: () => [
|
|
4016
|
-
type: Inject,
|
|
4017
|
-
args: [GANTT_ABSTRACT_TOKEN]
|
|
4018
|
-
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { columns: [{
|
|
3799
|
+
}], ctorParameters: () => [], propDecorators: { columns: [{
|
|
4019
3800
|
type: Input
|
|
4020
3801
|
}], resizeLineElementRef: [{
|
|
4021
3802
|
type: ViewChild,
|
|
@@ -4043,12 +3824,12 @@ class GanttTableBodyComponent {
|
|
|
4043
3824
|
get viewportItems() {
|
|
4044
3825
|
return this._viewportItems;
|
|
4045
3826
|
}
|
|
4046
|
-
constructor(
|
|
4047
|
-
this.gantt =
|
|
4048
|
-
this.ganttUpper =
|
|
4049
|
-
this.cdr =
|
|
4050
|
-
this.document =
|
|
4051
|
-
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);
|
|
4052
3833
|
this.draggable = false;
|
|
4053
3834
|
this.dragDropped = new EventEmitter();
|
|
4054
3835
|
this.dragStarted = new EventEmitter();
|
|
@@ -4291,22 +4072,13 @@ class GanttTableBodyComponent {
|
|
|
4291
4072
|
this.document.querySelectorAll('.drop-position-after').forEach((element) => element.classList.remove('drop-position-after'));
|
|
4292
4073
|
this.document.querySelectorAll('.drop-position-inside').forEach((element) => element.classList.remove('drop-position-inside'));
|
|
4293
4074
|
}
|
|
4294
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4295
|
-
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" }] }); }
|
|
4296
4077
|
}
|
|
4297
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: GanttTableBodyComponent, decorators: [{
|
|
4298
4079
|
type: Component,
|
|
4299
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" }]
|
|
4300
|
-
}], ctorParameters: () => [
|
|
4301
|
-
type: Inject,
|
|
4302
|
-
args: [GANTT_ABSTRACT_TOKEN]
|
|
4303
|
-
}] }, { type: GanttUpper, decorators: [{
|
|
4304
|
-
type: Inject,
|
|
4305
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4306
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: Document, decorators: [{
|
|
4307
|
-
type: Inject,
|
|
4308
|
-
args: [DOCUMENT]
|
|
4309
|
-
}] }, { type: i0.ElementRef }], propDecorators: { viewportItems: [{
|
|
4081
|
+
}], ctorParameters: () => [], propDecorators: { viewportItems: [{
|
|
4310
4082
|
type: Input
|
|
4311
4083
|
}], flatItems: [{
|
|
4312
4084
|
type: Input
|
|
@@ -4349,6 +4121,142 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4349
4121
|
args: [(CdkDrag)]
|
|
4350
4122
|
}] } });
|
|
4351
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
|
+
|
|
4352
4260
|
class NgxGanttRootComponent {
|
|
4353
4261
|
get view() {
|
|
4354
4262
|
return this.ganttUpper.view;
|
|
@@ -4356,16 +4264,17 @@ class NgxGanttRootComponent {
|
|
|
4356
4264
|
onWindowResize() {
|
|
4357
4265
|
this.computeScrollBarOffset();
|
|
4358
4266
|
}
|
|
4359
|
-
constructor(
|
|
4360
|
-
this.elementRef =
|
|
4361
|
-
this.ngZone =
|
|
4362
|
-
this.dom =
|
|
4363
|
-
this.dragContainer =
|
|
4364
|
-
this.ganttUpper =
|
|
4365
|
-
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 });
|
|
4366
4274
|
this.verticalScrollbarWidth = 0;
|
|
4367
4275
|
this.horizontalScrollbarHeight = 0;
|
|
4368
4276
|
this.unsubscribe$ = new Subject();
|
|
4277
|
+
const dragContainer = this.dragContainer;
|
|
4369
4278
|
this.ganttUpper.dragContainer = dragContainer;
|
|
4370
4279
|
}
|
|
4371
4280
|
ngOnInit() {
|
|
@@ -4467,10 +4376,10 @@ class NgxGanttRootComponent {
|
|
|
4467
4376
|
}
|
|
4468
4377
|
this.dom.scrollMainContainer(x);
|
|
4469
4378
|
}
|
|
4470
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4471
|
-
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"] }] }); }
|
|
4472
4381
|
}
|
|
4473
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttRootComponent, decorators: [{
|
|
4474
4383
|
type: Component,
|
|
4475
4384
|
args: [{ selector: 'ngx-gantt-root', providers: [GanttDomService, GanttDragContainer, GanttSyncScrollService], host: {
|
|
4476
4385
|
class: 'gantt'
|
|
@@ -4484,12 +4393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4484
4393
|
GanttSyncScrollXDirective,
|
|
4485
4394
|
GanttSyncScrollYDirective
|
|
4486
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" }]
|
|
4487
|
-
}], ctorParameters: () => [
|
|
4488
|
-
type: Inject,
|
|
4489
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4490
|
-
}] }, { type: GanttPrintService, decorators: [{
|
|
4491
|
-
type: Optional
|
|
4492
|
-
}] }], propDecorators: { sideWidth: [{
|
|
4396
|
+
}], ctorParameters: () => [], propDecorators: { sideWidth: [{
|
|
4493
4397
|
type: Input
|
|
4494
4398
|
}], sideTemplate: [{
|
|
4495
4399
|
type: ContentChild,
|
|
@@ -4509,17 +4413,17 @@ class NgxGanttTableColumnComponent {
|
|
|
4509
4413
|
set width(width) {
|
|
4510
4414
|
this.columnWidth = coerceCssPixelValue(width);
|
|
4511
4415
|
}
|
|
4512
|
-
constructor(
|
|
4513
|
-
this.ganttUpper =
|
|
4514
|
-
this.elementRef =
|
|
4416
|
+
constructor() {
|
|
4417
|
+
this.ganttUpper = inject(GANTT_UPPER_TOKEN);
|
|
4418
|
+
this.elementRef = inject(ElementRef);
|
|
4515
4419
|
}
|
|
4516
4420
|
get classList() {
|
|
4517
4421
|
return this.elementRef.nativeElement.classList;
|
|
4518
4422
|
}
|
|
4519
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4520
|
-
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 }); }
|
|
4521
4425
|
}
|
|
4522
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableColumnComponent, decorators: [{
|
|
4523
4427
|
type: Component,
|
|
4524
4428
|
args: [{
|
|
4525
4429
|
selector: 'ngx-gantt-column',
|
|
@@ -4529,10 +4433,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4529
4433
|
},
|
|
4530
4434
|
standalone: true
|
|
4531
4435
|
}]
|
|
4532
|
-
}], ctorParameters: () => [
|
|
4533
|
-
type: Inject,
|
|
4534
|
-
args: [GANTT_UPPER_TOKEN]
|
|
4535
|
-
}] }, { type: i0.ElementRef }], propDecorators: { width: [{
|
|
4436
|
+
}], ctorParameters: () => [], propDecorators: { width: [{
|
|
4536
4437
|
type: Input
|
|
4537
4438
|
}], name: [{
|
|
4538
4439
|
type: Input
|
|
@@ -4556,10 +4457,10 @@ class NgxGanttTableComponent {
|
|
|
4556
4457
|
this.resizeChange = new EventEmitter();
|
|
4557
4458
|
this.itemClick = new EventEmitter();
|
|
4558
4459
|
}
|
|
4559
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4560
|
-
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 }); }
|
|
4561
4462
|
}
|
|
4562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttTableComponent, decorators: [{
|
|
4563
4464
|
type: Component,
|
|
4564
4465
|
args: [{
|
|
4565
4466
|
selector: 'ngx-gantt-table',
|
|
@@ -4624,9 +4525,9 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4624
4525
|
get loading() {
|
|
4625
4526
|
return this._loading;
|
|
4626
4527
|
}
|
|
4627
|
-
constructor(
|
|
4628
|
-
super(
|
|
4629
|
-
this.viewportRuler =
|
|
4528
|
+
constructor() {
|
|
4529
|
+
super();
|
|
4530
|
+
this.viewportRuler = inject(ViewportRuler);
|
|
4630
4531
|
this.maxLevel = 2;
|
|
4631
4532
|
this.virtualScrollEnabled = true;
|
|
4632
4533
|
this.loadingDelay = 0;
|
|
@@ -4635,7 +4536,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4635
4536
|
this.lineClick = new EventEmitter();
|
|
4636
4537
|
this.selectedChange = new EventEmitter();
|
|
4637
4538
|
this.virtualScrolledIndexChange = new EventEmitter();
|
|
4638
|
-
this.tableScrollWidth = signal(0);
|
|
4539
|
+
this.tableScrollWidth = signal(0, ...(ngDevMode ? [{ debugName: "tableScrollWidth" }] : []));
|
|
4639
4540
|
this.flatItems = [];
|
|
4640
4541
|
this.viewportItems = [];
|
|
4641
4542
|
this._loading = false;
|
|
@@ -4864,8 +4765,8 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4864
4765
|
this.resizeObserver.disconnect();
|
|
4865
4766
|
}
|
|
4866
4767
|
}
|
|
4867
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4868
|
-
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: [
|
|
4869
4770
|
{
|
|
4870
4771
|
provide: GANTT_UPPER_TOKEN,
|
|
4871
4772
|
useExisting: NgxGanttComponent
|
|
@@ -4876,7 +4777,7 @@ class NgxGanttComponent extends GanttUpper {
|
|
|
4876
4777
|
}
|
|
4877
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 }); }
|
|
4878
4779
|
}
|
|
4879
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4780
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttComponent, decorators: [{
|
|
4880
4781
|
type: Component,
|
|
4881
4782
|
args: [{ selector: 'ngx-gantt', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
4882
4783
|
{
|
|
@@ -4905,10 +4806,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4905
4806
|
GanttSyncScrollXDirective,
|
|
4906
4807
|
GanttSyncScrollYDirective
|
|
4907
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" }]
|
|
4908
|
-
}], ctorParameters: () => [
|
|
4909
|
-
type: Inject,
|
|
4910
|
-
args: [GANTT_GLOBAL_CONFIG]
|
|
4911
|
-
}] }], propDecorators: { maxLevel: [{
|
|
4809
|
+
}], ctorParameters: () => [], propDecorators: { maxLevel: [{
|
|
4912
4810
|
type: Input
|
|
4913
4811
|
}], async: [{
|
|
4914
4812
|
type: Input
|
|
@@ -4957,8 +4855,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
4957
4855
|
|
|
4958
4856
|
class NgxGanttModule {
|
|
4959
4857
|
constructor() { }
|
|
4960
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4961
|
-
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,
|
|
4962
4860
|
DragDropModule,
|
|
4963
4861
|
ScrollingModule,
|
|
4964
4862
|
NgxGanttComponent,
|
|
@@ -4994,7 +4892,7 @@ class NgxGanttModule {
|
|
|
4994
4892
|
GanttCalendarGridComponent,
|
|
4995
4893
|
GanttDragBackdropComponent,
|
|
4996
4894
|
GanttScrollbarComponent] }); }
|
|
4997
|
-
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: [
|
|
4998
4896
|
CdkVirtualScrollViewport,
|
|
4999
4897
|
{
|
|
5000
4898
|
provide: GANTT_GLOBAL_CONFIG,
|
|
@@ -5006,7 +4904,7 @@ class NgxGanttModule {
|
|
|
5006
4904
|
ScrollingModule,
|
|
5007
4905
|
NgxGanttComponent] }); }
|
|
5008
4906
|
}
|
|
5009
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NgxGanttModule, decorators: [{
|
|
5010
4908
|
type: NgModule,
|
|
5011
4909
|
args: [{
|
|
5012
4910
|
imports: [
|
|
@@ -5069,5 +4967,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
5069
4967
|
* Generated bundle index. Do not edit.
|
|
5070
4968
|
*/
|
|
5071
4969
|
|
|
5072
|
-
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 };
|
|
5073
4971
|
//# sourceMappingURL=worktile-gantt.mjs.map
|