@worktile/gantt 12.2.0 → 12.2.3
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/bundles/worktile-gantt.umd.js +437 -388
- package/bundles/worktile-gantt.umd.js.map +1 -1
- package/class/link.d.ts +7 -2
- package/components/bar/bar-drag.d.ts +4 -2
- package/components/bar/bar.component.d.ts +4 -4
- package/components/calendar/calendar.component.d.ts +3 -5
- package/components/drag-backdrop/drag-backdrop.component.d.ts +1 -5
- package/components/icon/icon.component.d.ts +2 -4
- package/components/links/links.component.d.ts +1 -1
- package/components/main/gantt-main.component.d.ts +2 -3
- package/components/range/range.component.d.ts +2 -5
- package/components/table/gantt-table.component.d.ts +2 -3
- package/esm2015/class/link.js +1 -1
- package/esm2015/components/bar/bar-drag.js +31 -20
- package/esm2015/components/bar/bar.component.js +22 -15
- package/esm2015/components/calendar/calendar.component.js +18 -13
- package/esm2015/components/drag-backdrop/drag-backdrop.component.js +10 -14
- package/esm2015/components/icon/icon.component.js +4 -6
- package/esm2015/components/links/links.component.js +28 -14
- package/esm2015/components/main/gantt-main.component.js +4 -5
- package/esm2015/components/range/range.component.js +4 -13
- package/esm2015/components/table/gantt-table.component.js +10 -6
- package/esm2015/gantt-dom.service.js +41 -27
- package/esm2015/gantt-drag-container.js +17 -15
- package/esm2015/gantt-item-upper.js +7 -7
- package/esm2015/gantt-print.service.js +53 -50
- package/esm2015/gantt-upper.js +29 -20
- package/esm2015/gantt.component.js +20 -19
- package/esm2015/gantt.module.js +4 -4
- package/esm2015/gantt.pipe.js +9 -9
- package/esm2015/root.component.js +43 -31
- package/esm2015/table/gantt-column.component.js +4 -5
- package/esm2015/table/gantt-table.component.js +5 -6
- package/esm2015/utils/passive-listeners.js +30 -0
- package/esm2015/utils/set-style-with-vendor-prefix.js +15 -0
- package/esm2015/views/day.js +1 -1
- package/fesm2015/worktile-gantt.js +381 -281
- package/fesm2015/worktile-gantt.js.map +1 -1
- package/gantt-dom.service.d.ts +11 -4
- package/gantt-drag-container.d.ts +1 -1
- package/gantt-item-upper.d.ts +5 -5
- package/gantt-print.service.d.ts +1 -1
- package/gantt-upper.d.ts +5 -5
- package/gantt.component.d.ts +2 -4
- package/main.bundle.scss +3 -2
- package/package.json +1 -1
- package/root.component.d.ts +5 -3
- package/table/gantt-column.component.d.ts +2 -3
- package/table/gantt-table.component.d.ts +2 -4
- package/utils/passive-listeners.d.ts +13 -0
- package/utils/set-style-with-vendor-prefix.d.ts +12 -0
- package/README.md +0 -24
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs/operators'), require('rxjs'), require('date-fns'), require('@angular/cdk/collections'), require('@angular/cdk/coercion'), require('@angular/cdk/drag-drop')
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@worktile/gantt', ['exports', '@angular/core', '@angular/common', 'rxjs/operators', 'rxjs', 'date-fns', '@angular/cdk/collections', '@angular/cdk/coercion', '@angular/cdk/drag-drop'
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.gantt = {}), global.ng.core, global.ng.common, global.rxjs.operators, global.rxjs, global.dateFns, global.ng.cdk.collections, global.ng.cdk.coercion, global.ng.cdk.dragDrop
|
|
5
|
-
}(this, (function (exports, i0, i2, operators, rxjs, dateFns, collections, coercion, i1
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs/operators'), require('rxjs'), require('date-fns'), require('@angular/cdk/collections'), require('@angular/cdk/coercion'), require('@angular/cdk/drag-drop')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@worktile/gantt', ['exports', '@angular/core', '@angular/common', 'rxjs/operators', 'rxjs', 'date-fns', '@angular/cdk/collections', '@angular/cdk/coercion', '@angular/cdk/drag-drop'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.gantt = {}), global.ng.core, global.ng.common, global.rxjs.operators, global.rxjs, global.dateFns, global.ng.cdk.collections, global.ng.cdk.coercion, global.ng.cdk.dragDrop));
|
|
5
|
+
})(this, (function (exports, i0, i2, operators, rxjs, dateFns, collections, coercion, i1) { 'use strict';
|
|
8
6
|
|
|
9
7
|
function _interopNamespace(e) {
|
|
10
8
|
if (e && e.__esModule) return e;
|
|
@@ -15,21 +13,18 @@
|
|
|
15
13
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
14
|
Object.defineProperty(n, k, d.get ? d : {
|
|
17
15
|
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return e[k];
|
|
20
|
-
}
|
|
16
|
+
get: function () { return e[k]; }
|
|
21
17
|
});
|
|
22
18
|
}
|
|
23
19
|
});
|
|
24
20
|
}
|
|
25
|
-
n[
|
|
21
|
+
n["default"] = e;
|
|
26
22
|
return Object.freeze(n);
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
30
26
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
31
27
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
32
|
-
var html2canvas__default = /*#__PURE__*/_interopDefaultLegacy(html2canvas);
|
|
33
28
|
|
|
34
29
|
/*! *****************************************************************************
|
|
35
30
|
Copyright (c) Microsoft Corporation.
|
|
@@ -266,7 +261,7 @@
|
|
|
266
261
|
ar[i] = from[i];
|
|
267
262
|
}
|
|
268
263
|
}
|
|
269
|
-
return to.concat(ar || from);
|
|
264
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
270
265
|
}
|
|
271
266
|
function __await(v) {
|
|
272
267
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -1180,7 +1175,9 @@
|
|
|
1180
1175
|
this.cdr = cdr;
|
|
1181
1176
|
this.ngZone = ngZone;
|
|
1182
1177
|
this.config = config;
|
|
1178
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
1183
1179
|
this.originItems = [];
|
|
1180
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
1184
1181
|
this.originGroups = [];
|
|
1185
1182
|
this.viewType = exports.GanttViewType.month;
|
|
1186
1183
|
this.showTodayLine = true;
|
|
@@ -1349,7 +1346,7 @@
|
|
|
1349
1346
|
GanttUpper.prototype.initSelectionModel = function () {
|
|
1350
1347
|
return new collections.SelectionModel(this.multiple, []);
|
|
1351
1348
|
};
|
|
1352
|
-
GanttUpper.prototype.
|
|
1349
|
+
GanttUpper.prototype.ngOnInit = function () {
|
|
1353
1350
|
var _this = this;
|
|
1354
1351
|
this.styles = Object.assign({}, defaultStyles, this.styles);
|
|
1355
1352
|
this.viewOptions.dateFormat = Object.assign({}, defaultConfig.dateFormat, this.config.dateFormat, this.viewOptions.dateFormat);
|
|
@@ -1359,25 +1356,32 @@
|
|
|
1359
1356
|
this.computeRefs();
|
|
1360
1357
|
this.initSelectionModel();
|
|
1361
1358
|
this.firstChange = false;
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
_this.
|
|
1359
|
+
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
1360
|
+
// the `onStable` will never emit any value.
|
|
1361
|
+
var onStable$ = this.ngZone.isStable ? rxjs.from(Promise.resolve()) : this.ngZone.onStable.pipe(operators.take(1));
|
|
1362
|
+
// Normally this isn't in the zone, but it can cause performance regressions for apps
|
|
1363
|
+
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
1364
|
+
this.ngZone.runOutsideAngular(function () {
|
|
1365
|
+
onStable$.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
|
|
1366
|
+
_this.element.style.opacity = '1';
|
|
1367
|
+
_this.dragContainer.dragStarted.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function (event) {
|
|
1368
|
+
_this.dragStarted.emit(event);
|
|
1369
|
+
});
|
|
1370
|
+
_this.dragContainer.dragMoved.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function (event) {
|
|
1371
|
+
_this.dragMoved.emit(event);
|
|
1372
|
+
});
|
|
1373
|
+
_this.dragContainer.dragEnded.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function (event) {
|
|
1374
|
+
_this.dragEnded.emit(event);
|
|
1375
|
+
_this.computeRefs();
|
|
1376
|
+
_this.detectChanges();
|
|
1377
|
+
});
|
|
1374
1378
|
});
|
|
1375
1379
|
});
|
|
1376
1380
|
this.view.start$.pipe(operators.skip(1), operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
1377
1381
|
_this.computeRefs();
|
|
1378
1382
|
});
|
|
1379
1383
|
};
|
|
1380
|
-
GanttUpper.prototype.
|
|
1384
|
+
GanttUpper.prototype.ngOnChanges = function (changes) {
|
|
1381
1385
|
if (!this.firstChange) {
|
|
1382
1386
|
if (changes.viewType && changes.viewType.currentValue) {
|
|
1383
1387
|
this.createView();
|
|
@@ -1394,7 +1398,7 @@
|
|
|
1394
1398
|
}
|
|
1395
1399
|
}
|
|
1396
1400
|
};
|
|
1397
|
-
GanttUpper.prototype.
|
|
1401
|
+
GanttUpper.prototype.ngOnDestroy = function () {
|
|
1398
1402
|
this.unsubscribe$.next();
|
|
1399
1403
|
this.unsubscribe$.complete();
|
|
1400
1404
|
};
|
|
@@ -1454,9 +1458,9 @@
|
|
|
1454
1458
|
};
|
|
1455
1459
|
return GanttUpper;
|
|
1456
1460
|
}());
|
|
1457
|
-
GanttUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1458
|
-
GanttUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.
|
|
1459
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1461
|
+
GanttUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttUpper, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
1462
|
+
GanttUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.5", type: GanttUpper, inputs: { originItems: ["items", "originItems"], originGroups: ["groups", "originGroups"], viewType: "viewType", start: "start", end: "end", showTodayLine: "showTodayLine", draggable: "draggable", styles: "styles", viewOptions: "viewOptions", linkOptions: "linkOptions", disabledLoadOnScroll: "disabledLoadOnScroll", selectable: "selectable", multiple: "multiple" }, outputs: { loadOnScroll: "loadOnScroll", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", barClick: "barClick" }, 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: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ["groupHeader"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace });
|
|
1463
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttUpper, decorators: [{
|
|
1460
1464
|
type: i0.Directive
|
|
1461
1465
|
}], ctorParameters: function () {
|
|
1462
1466
|
return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
|
|
@@ -1533,12 +1537,11 @@
|
|
|
1533
1537
|
enumerable: false,
|
|
1534
1538
|
configurable: true
|
|
1535
1539
|
});
|
|
1536
|
-
NgxGanttTableColumnComponent.prototype.ngOnInit = function () { };
|
|
1537
1540
|
return NgxGanttTableColumnComponent;
|
|
1538
1541
|
}());
|
|
1539
|
-
NgxGanttTableColumnComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1540
|
-
NgxGanttTableColumnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
1541
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1542
|
+
NgxGanttTableColumnComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1543
|
+
NgxGanttTableColumnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttTableColumnComponent, selector: "ngx-gantt-column", inputs: { width: "width", name: "name" }, queries: [{ propertyName: "templateRef", first: true, predicate: ["cell"], descendants: true, static: true }, { propertyName: "headerTemplateRef", first: true, predicate: ["header"], descendants: true, static: true }], ngImport: i0__namespace, template: '', isInline: true });
|
|
1544
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, decorators: [{
|
|
1542
1545
|
type: i0.Component,
|
|
1543
1546
|
args: [{
|
|
1544
1547
|
selector: 'ngx-gantt-column',
|
|
@@ -1565,18 +1568,17 @@
|
|
|
1565
1568
|
function NgxGanttTableComponent() {
|
|
1566
1569
|
this.columnChanges = new i0.EventEmitter();
|
|
1567
1570
|
}
|
|
1568
|
-
NgxGanttTableComponent.prototype.ngOnInit = function () { };
|
|
1569
1571
|
return NgxGanttTableComponent;
|
|
1570
1572
|
}());
|
|
1571
|
-
NgxGanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1572
|
-
NgxGanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
1573
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1573
|
+
NgxGanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1574
|
+
NgxGanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttTableComponent, selector: "ngx-gantt-table", outputs: { columnChanges: "columnChanges" }, queries: [{ propertyName: "rowBeforeTemplate", first: true, predicate: ["rowBeforeSlot"], descendants: true, static: true }, { propertyName: "rowAfterTemplate", first: true, predicate: ["rowAfterSlot"], descendants: true, static: true }], ngImport: i0__namespace, template: '', isInline: true });
|
|
1575
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableComponent, decorators: [{
|
|
1574
1576
|
type: i0.Component,
|
|
1575
1577
|
args: [{
|
|
1576
1578
|
selector: 'ngx-gantt-table',
|
|
1577
1579
|
template: ''
|
|
1578
1580
|
}]
|
|
1579
|
-
}],
|
|
1581
|
+
}], propDecorators: { columnChanges: [{
|
|
1580
1582
|
type: i0.Output
|
|
1581
1583
|
}], rowBeforeTemplate: [{
|
|
1582
1584
|
type: i0.ContentChild,
|
|
@@ -1588,6 +1590,22 @@
|
|
|
1588
1590
|
|
|
1589
1591
|
var GANTT_ABSTRACT_TOKEN = new i0.InjectionToken('gantt-abstract-token');
|
|
1590
1592
|
|
|
1593
|
+
var supports = (typeof window !== 'undefined' && !!window.CSS && CSS.supports) || (function () { return false; });
|
|
1594
|
+
/**
|
|
1595
|
+
* Note: we don't need to add vendor prefixes within `.scss` files since they're added automatically.
|
|
1596
|
+
* This function is necessary when the `element.style` is updated directly through the JavaScript.
|
|
1597
|
+
* This is not required to be used with CSS properties that don't require vendor prefixes (e.g. `opacity`).
|
|
1598
|
+
*/
|
|
1599
|
+
function setStyleWithVendorPrefix(_a) {
|
|
1600
|
+
var element = _a.element, style = _a.style, value = _a.value;
|
|
1601
|
+
element.style[style] = value;
|
|
1602
|
+
if (supports("-webkit-" + style + ": " + value)) {
|
|
1603
|
+
// Note: some browsers still require setting `-webkit` vendor prefix. E.g. Mozilla 49 has implemented
|
|
1604
|
+
// the 3D support for `transform`, but it requires setting `-webkit-` prefix.
|
|
1605
|
+
element.style["-webkit-" + style] = value;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1591
1609
|
var 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>";
|
|
1592
1610
|
var 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>";
|
|
1593
1611
|
var 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>";
|
|
@@ -1615,8 +1633,6 @@
|
|
|
1615
1633
|
enumerable: false,
|
|
1616
1634
|
configurable: true
|
|
1617
1635
|
});
|
|
1618
|
-
GanttIconComponent.prototype.ngOnInit = function () { };
|
|
1619
|
-
GanttIconComponent.prototype.ngAfterViewInit = function () { };
|
|
1620
1636
|
GanttIconComponent.prototype.setSvg = function (name) {
|
|
1621
1637
|
var iconSvg = icons[name];
|
|
1622
1638
|
if (iconSvg) {
|
|
@@ -1628,9 +1644,9 @@
|
|
|
1628
1644
|
};
|
|
1629
1645
|
return GanttIconComponent;
|
|
1630
1646
|
}());
|
|
1631
|
-
GanttIconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1632
|
-
GanttIconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
1633
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1647
|
+
GanttIconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttIconComponent, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1648
|
+
GanttIconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttIconComponent, selector: "gantt-icon", inputs: { iconName: "iconName" }, host: { properties: { "class.gantt-icon": "this.isIcon" } }, ngImport: i0__namespace, template: '', isInline: true });
|
|
1649
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttIconComponent, decorators: [{
|
|
1634
1650
|
type: i0.Component,
|
|
1635
1651
|
args: [{
|
|
1636
1652
|
selector: 'gantt-icon',
|
|
@@ -1651,9 +1667,9 @@
|
|
|
1651
1667
|
};
|
|
1652
1668
|
return IsGanttRangeItemPipe;
|
|
1653
1669
|
}());
|
|
1654
|
-
IsGanttRangeItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1655
|
-
IsGanttRangeItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.
|
|
1656
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1670
|
+
IsGanttRangeItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1671
|
+
IsGanttRangeItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
|
|
1672
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, decorators: [{
|
|
1657
1673
|
type: i0.Pipe,
|
|
1658
1674
|
args: [{
|
|
1659
1675
|
name: 'isGanttRangeItem'
|
|
@@ -1667,9 +1683,9 @@
|
|
|
1667
1683
|
};
|
|
1668
1684
|
return IsGanttBarItemPipe;
|
|
1669
1685
|
}());
|
|
1670
|
-
IsGanttBarItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1671
|
-
IsGanttBarItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.
|
|
1672
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1686
|
+
IsGanttBarItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1687
|
+
IsGanttBarItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
|
|
1688
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, decorators: [{
|
|
1673
1689
|
type: i0.Pipe,
|
|
1674
1690
|
args: [{
|
|
1675
1691
|
name: 'isGanttBarItem'
|
|
@@ -1683,9 +1699,9 @@
|
|
|
1683
1699
|
};
|
|
1684
1700
|
return IsGanttCustomItemPipe;
|
|
1685
1701
|
}());
|
|
1686
|
-
IsGanttCustomItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1687
|
-
IsGanttCustomItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.
|
|
1688
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1702
|
+
IsGanttCustomItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1703
|
+
IsGanttCustomItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
|
|
1704
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, decorators: [{
|
|
1689
1705
|
type: i0.Pipe,
|
|
1690
1706
|
args: [{
|
|
1691
1707
|
name: 'isGanttCustomItem'
|
|
@@ -1715,7 +1731,6 @@
|
|
|
1715
1731
|
enumerable: false,
|
|
1716
1732
|
configurable: true
|
|
1717
1733
|
});
|
|
1718
|
-
GanttTableComponent.prototype.ngOnInit = function () { };
|
|
1719
1734
|
GanttTableComponent.prototype.ngOnChanges = function (changes) {
|
|
1720
1735
|
var _a, _b;
|
|
1721
1736
|
if (!((_a = changes.groups.currentValue) === null || _a === void 0 ? void 0 : _a.length) && !((_b = changes.items.currentValue) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
@@ -1727,7 +1742,11 @@
|
|
|
1727
1742
|
};
|
|
1728
1743
|
GanttTableComponent.prototype.dragFixed = function (config) {
|
|
1729
1744
|
if (config.movedWidth < config.minWidth) {
|
|
1730
|
-
|
|
1745
|
+
setStyleWithVendorPrefix({
|
|
1746
|
+
element: config.target,
|
|
1747
|
+
style: 'transform',
|
|
1748
|
+
value: "translate3d(" + (config.minWidth - config.originWidth) + "px, 0, 0)"
|
|
1749
|
+
});
|
|
1731
1750
|
}
|
|
1732
1751
|
};
|
|
1733
1752
|
GanttTableComponent.prototype.expandGroup = function (group) {
|
|
@@ -1809,9 +1828,9 @@
|
|
|
1809
1828
|
};
|
|
1810
1829
|
return GanttTableComponent;
|
|
1811
1830
|
}());
|
|
1812
|
-
GanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1813
|
-
GanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
1814
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
1831
|
+
GanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttTableComponent, deps: [{ token: GANTT_ABSTRACT_TOKEN }, { token: GANTT_UPPER_TOKEN }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1832
|
+
GanttTableComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttTableComponent, selector: "gantt-table", inputs: { groups: "groups", items: "items", columns: "columns", groupTemplate: "groupTemplate", emptyTemplate: "emptyTemplate", rowBeforeTemplate: "rowBeforeTemplate", rowAfterTemplate: "rowAfterTemplate" }, outputs: { itemClick: "itemClick" }, host: { properties: { "class.gantt-table": "this.ganttTableClass", "class.gantt-table-empty": "this.ganttTableEmptyClass" } }, viewQueries: [{ propertyName: "draglineElementRef", first: true, predicate: ["dragLine"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"gantt-table-header gantt-table-row\">\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let i = index\" [style.width]=\"column.columnWidth\">\n <ng-container *ngIf=\"column.headerTemplateRef; else default\" [ngTemplateOutlet]=\"column.headerTemplateRef\"></ng-container>\n <ng-template #default>\n {{ column.name }}\n </ng-template>\n <div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event, column)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"columnDragEnded($event, column)\"\n ></div>\n </div>\n</div>\n<div class=\"gantt-table-body\">\n <ng-container *ngIf=\"!groups.length && !items.length\">\n <ng-container *ngIf=\"!emptyTemplate\">\n <gantt-icon class=\"empty-icon\" iconName=\"empty\"></gantt-icon>\n <div class=\"empty-text\">\u6CA1\u6709\u6570\u636E</div>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"groups && groups.length > 0; else itemsTemplate\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-table-group\" [ngClass]=\"group.class\">\n <div class=\"gantt-table-group-title\" [class.expanded]=\"group.expanded\" (click)=\"expandGroup(group)\">\n <gantt-icon class=\"expand-icon\" [iconName]=\"group.expanded ? 'angle-down' : 'angle-right'\"></gantt-icon>\n <ng-container *ngIf=\"groupTemplate; else default\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"\n ></ng-template>\n </ng-container>\n <ng-template #default>\n <span class=\"group-title\">{{ group.title }}</span>\n </ng-template>\n </div>\n </div>\n\n <ng-container *ngIf=\"group.expanded\">\n <ng-template\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ group: group, items: group.items, level: 0 }\"\n ></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n</div>\n\n<div\n class=\"gantt-table-drag-trigger\"\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragBoundary=\".gantt\"\n (cdkDragMoved)=\"dragMoved($event)\"\n (cdkDragStarted)=\"dragStarted($event)\"\n (cdkDragEnded)=\"tableDragEnded($event)\"\n></div>\n\n<div #dragLine class=\"gantt-table-drag-auxiliary-line\"></div>\n\n<ng-template #itemsTemplate>\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items, level: 0 }\"></ng-template>\n</ng-template>\n\n<ng-template #ganttItems let-group=\"group\" let-items=\"items\" let-level=\"level\">\n <ng-container *ngFor=\"let item of items; trackBy: trackBy\">\n <div\n (click)=\"itemClick.emit({ event: $event, selectedValue: this.item.origin })\"\n class=\"gantt-table-item gantt-table-row\"\n [class.gantt-table-item-first-level-group]=\"level === 0 && (item.type | isGanttRangeItem)\"\n [class.gantt-table-item-with-group]=\"group\"\n [class.gantt-table-item-active]=\"ganttUpper.isSelected(item.id)\"\n [style.height.px]=\"gantt.styles.lineHeight\"\n [style.lineHeight.px]=\"gantt.styles.lineHeight\"\n >\n <ng-template\n [ngTemplateOutlet]=\"rowBeforeTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n <div class=\"gantt-table-column\" *ngFor=\"let column of columnList; let first = first\" [style.width]=\"column.columnWidth\">\n <div *ngIf=\"first\" class=\"gantt-expand-icon\" [style.marginLeft.px]=\"level * 20\">\n <ng-container *ngIf=\"level < gantt.maxLevel - 1 && item.expandable\">\n <gantt-icon\n *ngIf=\"!item.loading\"\n class=\"expand-icon\"\n [iconName]=\"item.expanded ? 'angle-down' : 'angle-right'\"\n (click)=\"expandChildren($event, item)\"\n ></gantt-icon>\n <gantt-icon *ngIf=\"item.loading\" [iconName]=\"'loading'\"></gantt-icon>\n </ng-container>\n </div>\n <div class=\"gantt-table-column-content\">\n <ng-template\n [ngTemplateOutlet]=\"column.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n </div>\n <ng-template\n [ngTemplateOutlet]=\"rowAfterTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.origin, item: item.origin }\"\n ></ng-template>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children, level: level + 1, group: group }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", components: [{ type: GanttIconComponent, selector: "gantt-icon", inputs: ["iconName"] }], directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "isGanttRangeItem": IsGanttRangeItemPipe } });
|
|
1833
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttTableComponent, decorators: [{
|
|
1815
1834
|
type: i0.Component,
|
|
1816
1835
|
args: [{
|
|
1817
1836
|
selector: 'gantt-table',
|
|
@@ -1852,6 +1871,36 @@
|
|
|
1852
1871
|
args: ['class.gantt-table-empty']
|
|
1853
1872
|
}] } });
|
|
1854
1873
|
|
|
1874
|
+
/** Cached result of whether the user's browser supports passive event listeners. */
|
|
1875
|
+
var supportsPassiveEvents;
|
|
1876
|
+
/**
|
|
1877
|
+
* Checks whether the user's browser supports passive event listeners.
|
|
1878
|
+
* See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
|
|
1879
|
+
*/
|
|
1880
|
+
function supportsPassiveEventListeners() {
|
|
1881
|
+
if (supportsPassiveEvents == null && typeof window !== 'undefined') {
|
|
1882
|
+
try {
|
|
1883
|
+
window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
|
|
1884
|
+
get: function () { return (supportsPassiveEvents = true); }
|
|
1885
|
+
}));
|
|
1886
|
+
}
|
|
1887
|
+
finally {
|
|
1888
|
+
supportsPassiveEvents = supportsPassiveEvents || false;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
return supportsPassiveEvents;
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Normalizes an `AddEventListener` object to something that can be passed
|
|
1895
|
+
* to `addEventListener` on any browser, no matter whether it supports the
|
|
1896
|
+
* `options` parameter.
|
|
1897
|
+
*/
|
|
1898
|
+
function normalizePassiveListenerOptions(options) {
|
|
1899
|
+
return supportsPassiveEventListeners() ? options : !!options.capture;
|
|
1900
|
+
}
|
|
1901
|
+
/** Options used to bind passive event listeners. */
|
|
1902
|
+
var passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
1903
|
+
|
|
1855
1904
|
var scrollThreshold = 50;
|
|
1856
1905
|
var ScrollDirection;
|
|
1857
1906
|
(function (ScrollDirection) {
|
|
@@ -1860,25 +1909,27 @@
|
|
|
1860
1909
|
ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
|
|
1861
1910
|
})(ScrollDirection || (ScrollDirection = {}));
|
|
1862
1911
|
var GanttDomService = /** @class */ (function () {
|
|
1863
|
-
function GanttDomService() {
|
|
1912
|
+
function GanttDomService(ngZone, platformId) {
|
|
1913
|
+
this.ngZone = ngZone;
|
|
1914
|
+
this.platformId = platformId;
|
|
1864
1915
|
this.unsubscribe$ = new rxjs.Subject();
|
|
1865
1916
|
}
|
|
1866
1917
|
GanttDomService.prototype.monitorScrollChange = function () {
|
|
1867
1918
|
var _this = this;
|
|
1868
|
-
rxjs.merge(rxjs.fromEvent(
|
|
1869
|
-
.pipe(operators.takeUntil(
|
|
1919
|
+
this.ngZone.runOutsideAngular(function () { return rxjs.merge(rxjs.fromEvent(_this.mainContainer, 'scroll', passiveListenerOptions), rxjs.fromEvent(_this.sideContainer, 'scroll', passiveListenerOptions))
|
|
1920
|
+
.pipe(operators.takeUntil(_this.unsubscribe$))
|
|
1870
1921
|
.subscribe(function (event) {
|
|
1871
1922
|
_this.syncScroll(event);
|
|
1872
|
-
});
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
});
|
|
1923
|
+
}); });
|
|
1924
|
+
// fromEvent(this.mainContainer, 'scroll')
|
|
1925
|
+
// .pipe(startWith(), takeUntil(this.unsubscribe$))
|
|
1926
|
+
// .subscribe((event) => {
|
|
1927
|
+
// // if (this.mainContainer.scrollLeft > 0) {
|
|
1928
|
+
// // this.side.classList.add('gantt-side-has-shadow');
|
|
1929
|
+
// // } else {
|
|
1930
|
+
// // this.side.classList.remove('gantt-side-has-shadow');
|
|
1931
|
+
// // }
|
|
1932
|
+
// });
|
|
1882
1933
|
};
|
|
1883
1934
|
GanttDomService.prototype.syncScroll = function (event) {
|
|
1884
1935
|
var target = event.currentTarget;
|
|
@@ -1887,9 +1938,10 @@
|
|
|
1887
1938
|
this.mainContainer.scrollTop = target.scrollTop;
|
|
1888
1939
|
};
|
|
1889
1940
|
GanttDomService.prototype.disableBrowserWheelEvent = function () {
|
|
1941
|
+
var _this = this;
|
|
1890
1942
|
var container = this.mainContainer;
|
|
1891
|
-
rxjs.fromEvent(container, 'wheel')
|
|
1892
|
-
.pipe(operators.takeUntil(
|
|
1943
|
+
this.ngZone.runOutsideAngular(function () { return rxjs.fromEvent(container, 'wheel')
|
|
1944
|
+
.pipe(operators.takeUntil(_this.unsubscribe$))
|
|
1893
1945
|
.subscribe(function (event) {
|
|
1894
1946
|
var delta = event.deltaX;
|
|
1895
1947
|
if (!delta) {
|
|
@@ -1899,7 +1951,7 @@
|
|
|
1899
1951
|
(container.scrollLeft === 0 && delta < 0)) {
|
|
1900
1952
|
event.preventDefault();
|
|
1901
1953
|
}
|
|
1902
|
-
});
|
|
1954
|
+
}); });
|
|
1903
1955
|
};
|
|
1904
1956
|
GanttDomService.prototype.initialize = function (root) {
|
|
1905
1957
|
this.root = root.nativeElement;
|
|
@@ -1911,9 +1963,14 @@
|
|
|
1911
1963
|
this.monitorScrollChange();
|
|
1912
1964
|
this.disableBrowserWheelEvent();
|
|
1913
1965
|
};
|
|
1914
|
-
|
|
1966
|
+
/**
|
|
1967
|
+
* @returns An observable that will emit outside the Angular zone. Note, consumers should re-enter the Angular zone
|
|
1968
|
+
* to run the change detection if needed.
|
|
1969
|
+
*/
|
|
1970
|
+
GanttDomService.prototype.getViewerScroll = function (options) {
|
|
1915
1971
|
var _this = this;
|
|
1916
|
-
return rxjs.
|
|
1972
|
+
return new rxjs.Observable(function (subscriber) { return _this.ngZone.runOutsideAngular(function () { return rxjs.fromEvent(_this.mainContainer, 'scroll', options)
|
|
1973
|
+
.pipe(operators.map(function () { return _this.mainContainer.scrollLeft; }), operators.pairwise(), operators.map(function (_a) {
|
|
1917
1974
|
var _b = __read(_a, 2), previous = _b[0], current = _b[1];
|
|
1918
1975
|
var event = {
|
|
1919
1976
|
target: _this.mainContainer,
|
|
@@ -1925,15 +1982,17 @@
|
|
|
1925
1982
|
}
|
|
1926
1983
|
}
|
|
1927
1984
|
if (current - previous > 0) {
|
|
1928
|
-
if (_this.mainContainer.scrollWidth - _this.mainContainer.clientWidth - _this.mainContainer.scrollLeft <
|
|
1985
|
+
if (_this.mainContainer.scrollWidth - _this.mainContainer.clientWidth - _this.mainContainer.scrollLeft <
|
|
1986
|
+
scrollThreshold) {
|
|
1929
1987
|
event.direction = ScrollDirection.RIGHT;
|
|
1930
1988
|
}
|
|
1931
1989
|
}
|
|
1932
1990
|
return event;
|
|
1933
|
-
}))
|
|
1991
|
+
}))
|
|
1992
|
+
.subscribe(subscriber); }); });
|
|
1934
1993
|
};
|
|
1935
1994
|
GanttDomService.prototype.getResize = function () {
|
|
1936
|
-
return rxjs.fromEvent(window, 'resize').pipe(operators.auditTime(150));
|
|
1995
|
+
return i2.isPlatformServer(this.platformId) ? rxjs.EMPTY : rxjs.fromEvent(window, 'resize').pipe(operators.auditTime(150));
|
|
1937
1996
|
};
|
|
1938
1997
|
GanttDomService.prototype.scrollMainContainer = function (left) {
|
|
1939
1998
|
if (isNumber(left)) {
|
|
@@ -1948,11 +2007,16 @@
|
|
|
1948
2007
|
};
|
|
1949
2008
|
return GanttDomService;
|
|
1950
2009
|
}());
|
|
1951
|
-
GanttDomService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
1952
|
-
GanttDomService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.
|
|
1953
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2010
|
+
GanttDomService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService, deps: [{ token: i0__namespace.NgZone }, { token: i0.PLATFORM_ID }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2011
|
+
GanttDomService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService });
|
|
2012
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService, decorators: [{
|
|
1954
2013
|
type: i0.Injectable
|
|
1955
|
-
}], ctorParameters: function () {
|
|
2014
|
+
}], ctorParameters: function () {
|
|
2015
|
+
return [{ type: i0__namespace.NgZone }, { type: undefined, decorators: [{
|
|
2016
|
+
type: i0.Inject,
|
|
2017
|
+
args: [i0.PLATFORM_ID]
|
|
2018
|
+
}] }];
|
|
2019
|
+
} });
|
|
1956
2020
|
|
|
1957
2021
|
function getDependencyType(path, dependencyTypes) {
|
|
1958
2022
|
if (dependencyTypes.includes(exports.GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
|
|
@@ -2002,25 +2066,27 @@
|
|
|
2002
2066
|
};
|
|
2003
2067
|
GanttDragContainer.prototype.emitLinkDragEnded = function (to) {
|
|
2004
2068
|
var _a;
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2069
|
+
if (to) {
|
|
2070
|
+
this.linkDragPath.to = to;
|
|
2071
|
+
var dependencyType = getDependencyType(this.linkDragPath, (_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.dependencyTypes);
|
|
2072
|
+
this.linkDragPath.from.item.addLink({
|
|
2073
|
+
link: this.linkDragPath.to.item.id,
|
|
2074
|
+
type: dependencyType
|
|
2075
|
+
});
|
|
2076
|
+
this.linkDragEnded.emit({
|
|
2077
|
+
source: this.linkDragPath.from.item.origin,
|
|
2078
|
+
target: this.linkDragPath.to.item.origin,
|
|
2079
|
+
type: dependencyType
|
|
2080
|
+
});
|
|
2081
|
+
}
|
|
2016
2082
|
this.linkDraggingId = null;
|
|
2017
2083
|
this.linkDragPath = { from: null, to: null };
|
|
2018
2084
|
};
|
|
2019
2085
|
return GanttDragContainer;
|
|
2020
2086
|
}());
|
|
2021
|
-
GanttDragContainer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2022
|
-
GanttDragContainer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.
|
|
2023
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2087
|
+
GanttDragContainer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2088
|
+
GanttDragContainer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer });
|
|
2089
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer, decorators: [{
|
|
2024
2090
|
type: i0.Injectable
|
|
2025
2091
|
}], ctorParameters: function () {
|
|
2026
2092
|
return [{ type: GanttUpper, decorators: [{
|
|
@@ -2029,6 +2095,24 @@
|
|
|
2029
2095
|
}] }];
|
|
2030
2096
|
} });
|
|
2031
2097
|
|
|
2098
|
+
var GanttDragBackdropComponent = /** @class */ (function () {
|
|
2099
|
+
function GanttDragBackdropComponent() {
|
|
2100
|
+
}
|
|
2101
|
+
return GanttDragBackdropComponent;
|
|
2102
|
+
}());
|
|
2103
|
+
GanttDragBackdropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragBackdropComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2104
|
+
GanttDragBackdropComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop", host: { classAttribute: "gantt-drag-backdrop" }, ngImport: i0__namespace, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" });
|
|
2105
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragBackdropComponent, decorators: [{
|
|
2106
|
+
type: i0.Component,
|
|
2107
|
+
args: [{
|
|
2108
|
+
selector: 'gantt-drag-backdrop',
|
|
2109
|
+
templateUrl: "./drag-backdrop.component.html",
|
|
2110
|
+
host: {
|
|
2111
|
+
class: 'gantt-drag-backdrop'
|
|
2112
|
+
}
|
|
2113
|
+
}]
|
|
2114
|
+
}] });
|
|
2115
|
+
|
|
2032
2116
|
var GanttPrintService = /** @class */ (function () {
|
|
2033
2117
|
function GanttPrintService() {
|
|
2034
2118
|
}
|
|
@@ -2098,61 +2182,71 @@
|
|
|
2098
2182
|
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
2099
2183
|
};
|
|
2100
2184
|
GanttPrintService.prototype.print = function (name, ignoreElementClass) {
|
|
2101
|
-
var _this = this;
|
|
2102
2185
|
if (name === void 0) { name = 'download'; }
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2186
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2187
|
+
var root, mainContainer, printWidth, printHeight, html2canvas;
|
|
2188
|
+
var _this = this;
|
|
2189
|
+
return __generator(this, function (_a) {
|
|
2190
|
+
switch (_a.label) {
|
|
2191
|
+
case 0:
|
|
2192
|
+
root = this.root;
|
|
2193
|
+
mainContainer = this.mainContainer;
|
|
2194
|
+
printWidth = root.offsetWidth;
|
|
2195
|
+
printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
2196
|
+
return [4 /*yield*/, import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')];
|
|
2197
|
+
case 1:
|
|
2198
|
+
html2canvas = (_a.sent()).default;
|
|
2199
|
+
html2canvas(root, {
|
|
2200
|
+
logging: false,
|
|
2201
|
+
allowTaint: true,
|
|
2202
|
+
useCORS: true,
|
|
2203
|
+
width: printWidth,
|
|
2204
|
+
height: printHeight,
|
|
2205
|
+
ignoreElements: function (element) {
|
|
2206
|
+
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
2207
|
+
return true;
|
|
2208
|
+
}
|
|
2209
|
+
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
2210
|
+
return true;
|
|
2211
|
+
}
|
|
2212
|
+
},
|
|
2213
|
+
onclone: function (cloneDocument) {
|
|
2214
|
+
var ganttClass = root.className;
|
|
2215
|
+
var cloneGanttDom = cloneDocument.querySelector("." + ganttClass.replace(/\s+/g, '.'));
|
|
2216
|
+
var cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
2217
|
+
var cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
|
|
2218
|
+
var cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
2219
|
+
// change targetDom width
|
|
2220
|
+
cloneGanttDom.style.width = printWidth + "px";
|
|
2221
|
+
cloneGanttDom.style.height = printHeight + "px";
|
|
2222
|
+
cloneGanttDom.style.overflow = "unset";
|
|
2223
|
+
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
2224
|
+
cloneCalendarOverlay.setAttribute('height', "" + printHeight);
|
|
2225
|
+
cloneCalendarOverlay.setAttribute('style', "background: transparent");
|
|
2226
|
+
if (cloneLinksOverlay) {
|
|
2227
|
+
cloneLinksOverlay.setAttribute('height', "" + printHeight);
|
|
2228
|
+
cloneLinksOverlay.setAttribute('style', "height: " + printHeight + "px");
|
|
2229
|
+
}
|
|
2230
|
+
// setInlineStyles for svg
|
|
2231
|
+
_this.setInlineStyles(cloneGanttDom);
|
|
2232
|
+
}
|
|
2233
|
+
}).then(function (canvas) {
|
|
2234
|
+
var link = document.createElement('a');
|
|
2235
|
+
var dataUrl = canvas.toDataURL('image/png');
|
|
2236
|
+
link.download = name + ".png";
|
|
2237
|
+
link.href = dataUrl;
|
|
2238
|
+
link.click();
|
|
2239
|
+
});
|
|
2240
|
+
return [2 /*return*/];
|
|
2139
2241
|
}
|
|
2140
|
-
|
|
2141
|
-
_this.setInlineStyles(cloneGanttDom);
|
|
2142
|
-
}
|
|
2143
|
-
}).then(function (canvas) {
|
|
2144
|
-
var link = document.createElement('a');
|
|
2145
|
-
var dataUrl = canvas.toDataURL('image/png');
|
|
2146
|
-
link.download = name + ".png";
|
|
2147
|
-
link.href = dataUrl;
|
|
2148
|
-
link.click();
|
|
2242
|
+
});
|
|
2149
2243
|
});
|
|
2150
2244
|
};
|
|
2151
2245
|
return GanttPrintService;
|
|
2152
2246
|
}());
|
|
2153
|
-
GanttPrintService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2154
|
-
GanttPrintService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.
|
|
2155
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2247
|
+
GanttPrintService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2248
|
+
GanttPrintService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService });
|
|
2249
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService, decorators: [{
|
|
2156
2250
|
type: i0.Injectable
|
|
2157
2251
|
}], ctorParameters: function () { return []; } });
|
|
2158
2252
|
|
|
@@ -2162,7 +2256,6 @@
|
|
|
2162
2256
|
this.ganttUpper = ganttUpper;
|
|
2163
2257
|
this.ngZone = ngZone;
|
|
2164
2258
|
this.elementRef = elementRef;
|
|
2165
|
-
this.unsubscribe$ = new rxjs.Subject();
|
|
2166
2259
|
this.headerHeight = headerHeight;
|
|
2167
2260
|
this.mainHeight = mainHeight;
|
|
2168
2261
|
this.todayHeight = todayHeight;
|
|
@@ -2170,6 +2263,7 @@
|
|
|
2170
2263
|
this.todayBorderRadius = todayBorderRadius;
|
|
2171
2264
|
this.viewTypes = exports.GanttViewType;
|
|
2172
2265
|
this.className = true;
|
|
2266
|
+
this.unsubscribe$ = new rxjs.Subject();
|
|
2173
2267
|
}
|
|
2174
2268
|
Object.defineProperty(GanttCalendarComponent.prototype, "view", {
|
|
2175
2269
|
get: function () {
|
|
@@ -2202,16 +2296,21 @@
|
|
|
2202
2296
|
};
|
|
2203
2297
|
GanttCalendarComponent.prototype.ngOnInit = function () {
|
|
2204
2298
|
var _this = this;
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2299
|
+
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
2300
|
+
// the `onStable` will never emit any value.
|
|
2301
|
+
var onStable$ = this.ngZone.isStable ? rxjs.from(Promise.resolve()) : this.ngZone.onStable.pipe(operators.take(1));
|
|
2302
|
+
// Normally this isn't in the zone, but it can cause performance regressions for apps
|
|
2303
|
+
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
2304
|
+
this.ngZone.runOutsideAngular(function () {
|
|
2305
|
+
onStable$.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
|
|
2306
|
+
rxjs.merge(_this.ganttUpper.viewChange, _this.ganttUpper.view.start$)
|
|
2307
|
+
.pipe(operators.takeUntil(_this.unsubscribe$))
|
|
2308
|
+
.subscribe(function () {
|
|
2309
|
+
_this.setTodayPoint();
|
|
2310
|
+
});
|
|
2210
2311
|
});
|
|
2211
2312
|
});
|
|
2212
2313
|
};
|
|
2213
|
-
GanttCalendarComponent.prototype.ngAfterViewInit = function () { };
|
|
2214
|
-
GanttCalendarComponent.prototype.ngOnChanges = function (changes) { };
|
|
2215
2314
|
GanttCalendarComponent.prototype.trackBy = function (index, point) {
|
|
2216
2315
|
return point.text || index;
|
|
2217
2316
|
};
|
|
@@ -2221,9 +2320,9 @@
|
|
|
2221
2320
|
};
|
|
2222
2321
|
return GanttCalendarComponent;
|
|
2223
2322
|
}());
|
|
2224
|
-
GanttCalendarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2225
|
-
GanttCalendarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2226
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2323
|
+
GanttCalendarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttCalendarComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0__namespace.NgZone }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2324
|
+
GanttCalendarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttCalendarComponent, selector: "gantt-calendar-overlay", host: { properties: { "class.gantt-calendar-overlay": "this.className" } }, ngImport: i0__namespace, template: "<div class=\"gantt-calendar-today-overlay\" [style.width.px]=\"view.width\">\n <span class=\"today-rect\" [hidden]=\"ganttUpper.viewType !== viewTypes.day\"> </span>\n <span class=\"today-line\" *ngIf=\"ganttUpper.showTodayLine\"> </span>\n</div>\n\n<svg class=\"gantt-calendar-overlay-main\" [attr.width]=\"view.width\" [attr.height]=\"headerHeight\">\n <g>\n <text class=\"primary-text\" *ngFor=\"let point of view.primaryDatePoints; trackBy: trackBy\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n <ng-container *ngFor=\"let point of view.secondaryDatePoints; trackBy: trackBy\">\n <text class=\"secondary-text\" [class.secondary-text-weekend]=\"point.additions?.isWeekend\" [attr.x]=\"point.x\" [attr.y]=\"point.y\">\n {{ point.text }}\n </text>\n </ng-container>\n\n <g>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n\n <g>\n <line [attr.x1]=\"0\" [attr.x2]=\"view.width\" [attr.y1]=\"headerHeight\" [attr.y2]=\"headerHeight\" class=\"header-line\"></line>\n </g>\n </g>\n <g>\n <g *ngIf=\"view.showTimeline\">\n <line\n *ngFor=\"let point of view.secondaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.cellWidth\"\n [attr.x2]=\"(i + 1) * view.cellWidth\"\n [attr.y1]=\"headerHeight\"\n [attr.y2]=\"mainHeight\"\n class=\"secondary-line\"\n ></line>\n <line\n *ngFor=\"let point of view.primaryDatePoints; let i = index; trackBy: trackBy\"\n [attr.x1]=\"(i + 1) * view.primaryWidth\"\n [attr.x2]=\"(i + 1) * view.primaryWidth\"\n [attr.y1]=\"0\"\n [attr.y2]=\"mainHeight\"\n class=\"primary-line\"\n ></line>\n </g>\n </g>\n</svg>\n", directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
2325
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttCalendarComponent, decorators: [{
|
|
2227
2326
|
type: i0.Component,
|
|
2228
2327
|
args: [{
|
|
2229
2328
|
selector: 'gantt-calendar-overlay',
|
|
@@ -2239,26 +2338,6 @@
|
|
|
2239
2338
|
args: ['class.gantt-calendar-overlay']
|
|
2240
2339
|
}] } });
|
|
2241
2340
|
|
|
2242
|
-
var GanttDragBackdropComponent = /** @class */ (function () {
|
|
2243
|
-
function GanttDragBackdropComponent() {
|
|
2244
|
-
this.backdropClass = true;
|
|
2245
|
-
}
|
|
2246
|
-
GanttDragBackdropComponent.prototype.ngOnInit = function () { };
|
|
2247
|
-
return GanttDragBackdropComponent;
|
|
2248
|
-
}());
|
|
2249
|
-
GanttDragBackdropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragBackdropComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2250
|
-
GanttDragBackdropComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.2", type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop", host: { properties: { "class.gantt-drag-backdrop": "this.backdropClass" } }, ngImport: i0__namespace, template: "<div class=\"gantt-drag-mask\">\n <div class=\"date-range\">\n <span class=\"start\"></span>\n <span class=\"end\"></span>\n </div>\n</div>\n" });
|
|
2251
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.2", ngImport: i0__namespace, type: GanttDragBackdropComponent, decorators: [{
|
|
2252
|
-
type: i0.Component,
|
|
2253
|
-
args: [{
|
|
2254
|
-
selector: 'gantt-drag-backdrop',
|
|
2255
|
-
templateUrl: "./drag-backdrop.component.html"
|
|
2256
|
-
}]
|
|
2257
|
-
}], ctorParameters: function () { return []; }, propDecorators: { backdropClass: [{
|
|
2258
|
-
type: i0.HostBinding,
|
|
2259
|
-
args: ['class.gantt-drag-backdrop']
|
|
2260
|
-
}] } });
|
|
2261
|
-
|
|
2262
2341
|
var NgxGanttRootComponent = /** @class */ (function () {
|
|
2263
2342
|
function NgxGanttRootComponent(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
|
|
2264
2343
|
this.elementRef = elementRef;
|
|
@@ -2267,7 +2346,6 @@
|
|
|
2267
2346
|
this.dragContainer = dragContainer;
|
|
2268
2347
|
this.ganttUpper = ganttUpper;
|
|
2269
2348
|
this.printService = printService;
|
|
2270
|
-
this.ganttClass = true;
|
|
2271
2349
|
this.unsubscribe$ = new rxjs.Subject();
|
|
2272
2350
|
this.ganttUpper.dragContainer = dragContainer;
|
|
2273
2351
|
}
|
|
@@ -2280,45 +2358,53 @@
|
|
|
2280
2358
|
});
|
|
2281
2359
|
NgxGanttRootComponent.prototype.ngOnInit = function () {
|
|
2282
2360
|
var _this = this;
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
_this.
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
_this.
|
|
2361
|
+
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
2362
|
+
// the `onStable` will never emit any value.
|
|
2363
|
+
var onStable$ = this.ngZone.isStable ? rxjs.from(Promise.resolve()) : this.ngZone.onStable.pipe(operators.take(1));
|
|
2364
|
+
// Normally this isn't in the zone, but it can cause performance regressions for apps
|
|
2365
|
+
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
2366
|
+
this.ngZone.runOutsideAngular(function () {
|
|
2367
|
+
onStable$.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
|
|
2368
|
+
_this.dom.initialize(_this.elementRef);
|
|
2369
|
+
if (_this.printService) {
|
|
2370
|
+
_this.printService.register(_this.elementRef);
|
|
2371
|
+
}
|
|
2372
|
+
_this.setupScrollClass();
|
|
2373
|
+
_this.setupResize();
|
|
2374
|
+
_this.setupViewScroll();
|
|
2375
|
+
// 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
|
|
2376
|
+
_this.elementRef.nativeElement.style.opacity = '1';
|
|
2377
|
+
_this.ganttUpper.viewChange.pipe(operators.startWith(null), operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
|
|
2378
|
+
_this.scrollToToday();
|
|
2379
|
+
});
|
|
2295
2380
|
});
|
|
2296
2381
|
});
|
|
2297
2382
|
};
|
|
2383
|
+
NgxGanttRootComponent.prototype.ngOnDestroy = function () {
|
|
2384
|
+
this.unsubscribe$.next();
|
|
2385
|
+
};
|
|
2298
2386
|
NgxGanttRootComponent.prototype.setupViewScroll = function () {
|
|
2299
2387
|
var _this = this;
|
|
2300
2388
|
if (this.ganttUpper.disabledLoadOnScroll) {
|
|
2301
2389
|
return;
|
|
2302
2390
|
}
|
|
2303
2391
|
this.dom
|
|
2304
|
-
.getViewerScroll()
|
|
2392
|
+
.getViewerScroll(passiveListenerOptions)
|
|
2305
2393
|
.pipe(operators.takeUntil(this.unsubscribe$))
|
|
2306
2394
|
.subscribe(function (event) {
|
|
2307
2395
|
if (event.direction === ScrollDirection.LEFT) {
|
|
2308
2396
|
var dates_1 = _this.view.addStartDate();
|
|
2309
2397
|
if (dates_1) {
|
|
2310
2398
|
event.target.scrollLeft += _this.view.getDateRangeWidth(dates_1.start, dates_1.end);
|
|
2311
|
-
_this.
|
|
2312
|
-
_this.ganttUpper.loadOnScroll.emit({ start: dates_1.start.getUnixTime(), end: dates_1.end.getUnixTime() });
|
|
2313
|
-
}
|
|
2399
|
+
if (_this.ganttUpper.loadOnScroll.observers) {
|
|
2400
|
+
_this.ngZone.run(function () { return _this.ganttUpper.loadOnScroll.emit({ start: dates_1.start.getUnixTime(), end: dates_1.end.getUnixTime() }); });
|
|
2401
|
+
}
|
|
2314
2402
|
}
|
|
2315
2403
|
}
|
|
2316
2404
|
if (event.direction === ScrollDirection.RIGHT) {
|
|
2317
2405
|
var dates_2 = _this.view.addEndDate();
|
|
2318
|
-
if (dates_2) {
|
|
2319
|
-
_this.ngZone.run(function () {
|
|
2320
|
-
_this.ganttUpper.loadOnScroll.emit({ start: dates_2.start.getUnixTime(), end: dates_2.end.getUnixTime() });
|
|
2321
|
-
});
|
|
2406
|
+
if (dates_2 && _this.ganttUpper.loadOnScroll.observers) {
|
|
2407
|
+
_this.ngZone.run(function () { return _this.ganttUpper.loadOnScroll.emit({ start: dates_2.start.getUnixTime(), end: dates_2.end.getUnixTime() }); });
|
|
2322
2408
|
}
|
|
2323
2409
|
}
|
|
2324
2410
|
});
|
|
@@ -2349,14 +2435,17 @@
|
|
|
2349
2435
|
};
|
|
2350
2436
|
return NgxGanttRootComponent;
|
|
2351
2437
|
}());
|
|
2352
|
-
NgxGanttRootComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2353
|
-
NgxGanttRootComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2354
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2438
|
+
NgxGanttRootComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRootComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: GanttDomService }, { token: GanttDragContainer }, { token: GANTT_UPPER_TOKEN }, { token: GanttPrintService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2439
|
+
NgxGanttRootComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { classAttribute: "gantt" }, providers: [GanttDomService, GanttDragContainer], 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: i0.ElementRef, static: true }], ngImport: i0__namespace, template: "<div class=\"gantt-side\" [style.width.px]=\"sideWidth\">\n <div class=\"gantt-side-container\">\n <ng-template [ngTemplateOutlet]=\"sideTemplate\"></ng-template>\n </div>\n</div>\n<div class=\"gantt-container\">\n <gantt-calendar-overlay></gantt-calendar-overlay>\n <gantt-drag-backdrop></gantt-drag-backdrop>\n <div class=\"gantt-main\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\"></ng-template>\n </div>\n</div>\n", components: [{ type: GanttCalendarComponent, selector: "gantt-calendar-overlay" }, { type: GanttDragBackdropComponent, selector: "gantt-drag-backdrop" }], directives: [{ type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
2440
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRootComponent, decorators: [{
|
|
2355
2441
|
type: i0.Component,
|
|
2356
2442
|
args: [{
|
|
2357
2443
|
selector: 'ngx-gantt-root',
|
|
2358
2444
|
templateUrl: './root.component.html',
|
|
2359
|
-
providers: [GanttDomService, GanttDragContainer]
|
|
2445
|
+
providers: [GanttDomService, GanttDragContainer],
|
|
2446
|
+
host: {
|
|
2447
|
+
class: 'gantt'
|
|
2448
|
+
}
|
|
2360
2449
|
}]
|
|
2361
2450
|
}], ctorParameters: function () {
|
|
2362
2451
|
return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
|
|
@@ -2367,15 +2456,15 @@
|
|
|
2367
2456
|
}] }];
|
|
2368
2457
|
}, propDecorators: { sideWidth: [{
|
|
2369
2458
|
type: i0.Input
|
|
2370
|
-
}], ganttClass: [{
|
|
2371
|
-
type: i0.HostBinding,
|
|
2372
|
-
args: ['class.gantt']
|
|
2373
2459
|
}], sideTemplate: [{
|
|
2374
2460
|
type: i0.ContentChild,
|
|
2375
2461
|
args: ['sideTemplate', { static: true }]
|
|
2376
2462
|
}], mainTemplate: [{
|
|
2377
2463
|
type: i0.ContentChild,
|
|
2378
2464
|
args: ['mainTemplate', { static: true }]
|
|
2465
|
+
}], backdrop: [{
|
|
2466
|
+
type: i0.ViewChild,
|
|
2467
|
+
args: [GanttDragBackdropComponent, { static: true, read: i0.ElementRef }]
|
|
2379
2468
|
}] } });
|
|
2380
2469
|
|
|
2381
2470
|
var GanttLinkLine = /** @class */ (function () {
|
|
@@ -2564,7 +2653,7 @@
|
|
|
2564
2653
|
_this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
2565
2654
|
});
|
|
2566
2655
|
rxjs.merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
|
|
2567
|
-
.pipe(operators.
|
|
2656
|
+
.pipe(operators.skip(1), operators.debounceTime(0), operators.takeUntil(this.unsubscribe$))
|
|
2568
2657
|
.subscribe(function () {
|
|
2569
2658
|
_this.elementRef.nativeElement.style.visibility = 'visible';
|
|
2570
2659
|
_this.buildLinks();
|
|
@@ -2625,16 +2714,30 @@
|
|
|
2625
2714
|
source.links.forEach(function (link) {
|
|
2626
2715
|
var target = _this.linkItems.find(function (item) { return item.id === link.link; });
|
|
2627
2716
|
if (target && (target.origin.start || target.origin.end)) {
|
|
2628
|
-
var
|
|
2717
|
+
var defaultColor = exports.LinkColors.default;
|
|
2718
|
+
var activeColor = exports.LinkColors.active;
|
|
2629
2719
|
if (link.type === exports.GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
|
|
2630
|
-
|
|
2720
|
+
defaultColor = exports.LinkColors.blocked;
|
|
2721
|
+
activeColor = exports.LinkColors.blocked;
|
|
2722
|
+
}
|
|
2723
|
+
if (link.color) {
|
|
2724
|
+
if (typeof link.color === 'string') {
|
|
2725
|
+
defaultColor = link.color;
|
|
2726
|
+
activeColor = link.color;
|
|
2727
|
+
}
|
|
2728
|
+
else {
|
|
2729
|
+
defaultColor = link.color.default;
|
|
2730
|
+
activeColor = link.color.active;
|
|
2731
|
+
}
|
|
2631
2732
|
}
|
|
2632
2733
|
_this.links.push({
|
|
2633
2734
|
path: _this.linkLine.generatePath(source, target, link.type),
|
|
2634
2735
|
source: source.origin,
|
|
2635
2736
|
target: target.origin,
|
|
2636
2737
|
type: link.type,
|
|
2637
|
-
color:
|
|
2738
|
+
color: defaultColor,
|
|
2739
|
+
defaultColor: defaultColor,
|
|
2740
|
+
activeColor: activeColor
|
|
2638
2741
|
});
|
|
2639
2742
|
}
|
|
2640
2743
|
});
|
|
@@ -2651,15 +2754,15 @@
|
|
|
2651
2754
|
target: link.target
|
|
2652
2755
|
});
|
|
2653
2756
|
};
|
|
2654
|
-
GanttLinksComponent.prototype.mouseEnterPath = function (link) {
|
|
2655
|
-
|
|
2656
|
-
|
|
2757
|
+
GanttLinksComponent.prototype.mouseEnterPath = function (link, index) {
|
|
2758
|
+
link.color = link.activeColor || link.defaultColor;
|
|
2759
|
+
if (index < this.links.length - 1) {
|
|
2760
|
+
this.links.splice(index, 1);
|
|
2761
|
+
this.links.push(link);
|
|
2657
2762
|
}
|
|
2658
2763
|
};
|
|
2659
2764
|
GanttLinksComponent.prototype.mouseLeavePath = function (link) {
|
|
2660
|
-
|
|
2661
|
-
link.color = exports.LinkColors.default;
|
|
2662
|
-
}
|
|
2765
|
+
link.color = link.defaultColor;
|
|
2663
2766
|
};
|
|
2664
2767
|
GanttLinksComponent.prototype.ngOnDestroy = function () {
|
|
2665
2768
|
this.unsubscribe$.next();
|
|
@@ -2667,9 +2770,9 @@
|
|
|
2667
2770
|
};
|
|
2668
2771
|
return GanttLinksComponent;
|
|
2669
2772
|
}());
|
|
2670
|
-
GanttLinksComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2671
|
-
GanttLinksComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2672
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2773
|
+
GanttLinksComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttLinksComponent, deps: [{ token: GANTT_UPPER_TOKEN }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ElementRef }, { token: GanttDragContainer }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2774
|
+
GanttLinksComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: { groups: "groups", items: "items" }, outputs: { lineClick: "lineClick" }, host: { properties: { "class.gantt-links-overlay": "this.ganttLinksOverlay" } }, usesOnChanges: true, ngImport: i0__namespace, template: "<svg [attr.width]=\"ganttUpper.view.width\" class=\"gantt-links-overlay-main\">\n <ng-container *ngFor=\"let link of links; let i = index; trackBy: trackBy\">\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\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 <defs *ngIf=\"showArrow\">\n <marker\n *ngIf=\"link.type === ganttLinkTypes.sf; else markerEnd\"\n [id]=\"'triangle' + i\"\n markerUnits=\"strokeWidth\"\n markerWidth=\"5\"\n markerHeight=\"4\"\n refX=\"5\"\n refY=\"2\"\n orient=\"180\"\n >\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 <ng-template #markerEnd>\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 </ng-template>\n </defs>\n </ng-container>\n <line class=\"link-dragging-line\"></line>\n</svg>\n", directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2775
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttLinksComponent, decorators: [{
|
|
2673
2776
|
type: i0.Component,
|
|
2674
2777
|
args: [{
|
|
2675
2778
|
selector: 'gantt-links-overlay',
|
|
@@ -2698,14 +2801,14 @@
|
|
|
2698
2801
|
this.firstChange = true;
|
|
2699
2802
|
this.unsubscribe$ = new rxjs.Subject();
|
|
2700
2803
|
}
|
|
2701
|
-
GanttItemUpper.prototype.
|
|
2804
|
+
GanttItemUpper.prototype.ngOnInit = function () {
|
|
2702
2805
|
var _this = this;
|
|
2703
2806
|
this.firstChange = false;
|
|
2704
2807
|
this.item.refs$.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
2705
2808
|
_this.setPositions();
|
|
2706
2809
|
});
|
|
2707
2810
|
};
|
|
2708
|
-
GanttItemUpper.prototype.
|
|
2811
|
+
GanttItemUpper.prototype.ngOnChanges = function () {
|
|
2709
2812
|
if (!this.firstChange) {
|
|
2710
2813
|
this.setPositions();
|
|
2711
2814
|
}
|
|
@@ -2724,15 +2827,15 @@
|
|
|
2724
2827
|
else {
|
|
2725
2828
|
}
|
|
2726
2829
|
};
|
|
2727
|
-
GanttItemUpper.prototype.
|
|
2830
|
+
GanttItemUpper.prototype.ngOnDestroy = function () {
|
|
2728
2831
|
this.unsubscribe$.next();
|
|
2729
2832
|
this.unsubscribe$.complete();
|
|
2730
2833
|
};
|
|
2731
2834
|
return GanttItemUpper;
|
|
2732
2835
|
}());
|
|
2733
|
-
GanttItemUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2734
|
-
GanttItemUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.
|
|
2735
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2836
|
+
GanttItemUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttItemUpper, deps: [{ token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
2837
|
+
GanttItemUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.5", type: GanttItemUpper, inputs: { template: "template", item: "item" }, usesOnChanges: true, ngImport: i0__namespace });
|
|
2838
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttItemUpper, decorators: [{
|
|
2736
2839
|
type: i0.Directive
|
|
2737
2840
|
}], ctorParameters: function () {
|
|
2738
2841
|
return [{ type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
|
|
@@ -2752,20 +2855,11 @@
|
|
|
2752
2855
|
_this.ganttRangeClass = true;
|
|
2753
2856
|
return _this;
|
|
2754
2857
|
}
|
|
2755
|
-
NgxGanttRangeComponent.prototype.ngOnInit = function () {
|
|
2756
|
-
_super.prototype.onInit.call(this);
|
|
2757
|
-
};
|
|
2758
|
-
NgxGanttRangeComponent.prototype.ngOnChanges = function () {
|
|
2759
|
-
_super.prototype.onChanges.call(this);
|
|
2760
|
-
};
|
|
2761
|
-
NgxGanttRangeComponent.prototype.ngOnDestroy = function () {
|
|
2762
|
-
_super.prototype.onDestroy.call(this);
|
|
2763
|
-
};
|
|
2764
2858
|
return NgxGanttRangeComponent;
|
|
2765
2859
|
}(GanttItemUpper));
|
|
2766
|
-
NgxGanttRangeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
2767
|
-
NgxGanttRangeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
2768
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
2860
|
+
NgxGanttRangeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRangeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2861
|
+
NgxGanttRangeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range", host: { properties: { "class.gantt-range": "this.ganttRangeClass" } }, usesInheritance: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"item.start && item.end\">\n <div class=\"gantt-range-main\">\n <div class=\"gantt-range-main-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\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</ng-container>\n", directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
2862
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRangeComponent, decorators: [{
|
|
2769
2863
|
type: i0.Component,
|
|
2770
2864
|
args: [{
|
|
2771
2865
|
selector: 'ngx-gantt-range,gantt-range',
|
|
@@ -2791,10 +2885,11 @@
|
|
|
2791
2885
|
return element;
|
|
2792
2886
|
}
|
|
2793
2887
|
var GanttBarDrag = /** @class */ (function () {
|
|
2794
|
-
function GanttBarDrag(dragDrop, dom, dragContainer) {
|
|
2888
|
+
function GanttBarDrag(dragDrop, dom, dragContainer, root) {
|
|
2795
2889
|
this.dragDrop = dragDrop;
|
|
2796
2890
|
this.dom = dom;
|
|
2797
2891
|
this.dragContainer = dragContainer;
|
|
2892
|
+
this.root = root;
|
|
2798
2893
|
this.dragRefs = [];
|
|
2799
2894
|
this.destroy$ = new rxjs.Subject();
|
|
2800
2895
|
}
|
|
@@ -2819,9 +2914,9 @@
|
|
|
2819
2914
|
((_c = this.ganttUpper.config.linkOptions) === null || _c === void 0 ? void 0 : _c.dependencyTypes[0]) === exports.GanttLinkType.fs
|
|
2820
2915
|
? singleDropActiveClass
|
|
2821
2916
|
: dropActiveClass;
|
|
2822
|
-
rxjs.fromEvent(this.barElement, 'mouseenter')
|
|
2917
|
+
rxjs.fromEvent(this.barElement, 'mouseenter', passiveListenerOptions)
|
|
2823
2918
|
.pipe(operators.takeUntil(this.destroy$))
|
|
2824
|
-
.subscribe(function (
|
|
2919
|
+
.subscribe(function () {
|
|
2825
2920
|
if (_this.dragContainer.linkDraggingId && _this.dragContainer.linkDraggingId !== _this.item.id) {
|
|
2826
2921
|
if (_this.item.linkable) {
|
|
2827
2922
|
_this.barElement.classList.add(dropClass);
|
|
@@ -2835,9 +2930,9 @@
|
|
|
2835
2930
|
_this.barElement.classList.add(activeClass);
|
|
2836
2931
|
}
|
|
2837
2932
|
});
|
|
2838
|
-
rxjs.fromEvent(this.barElement, 'mouseleave')
|
|
2933
|
+
rxjs.fromEvent(this.barElement, 'mouseleave', passiveListenerOptions)
|
|
2839
2934
|
.pipe(operators.takeUntil(this.destroy$))
|
|
2840
|
-
.subscribe(function (
|
|
2935
|
+
.subscribe(function () {
|
|
2841
2936
|
if (!_this.dragContainer.linkDraggingId) {
|
|
2842
2937
|
_this.barElement.classList.remove(activeClass);
|
|
2843
2938
|
}
|
|
@@ -2900,7 +2995,7 @@
|
|
|
2900
2995
|
if (width > dragMinWidth) {
|
|
2901
2996
|
_this.barElement.style.width = width + 'px';
|
|
2902
2997
|
_this.barElement.style.left = x + 'px';
|
|
2903
|
-
_this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), _this.
|
|
2998
|
+
_this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), _this.item.end);
|
|
2904
2999
|
_this.item.updateDate(_this.ganttUpper.view.getDateByXPoint(x), _this.item.end);
|
|
2905
3000
|
}
|
|
2906
3001
|
}
|
|
@@ -2908,7 +3003,7 @@
|
|
|
2908
3003
|
var width = _this.item.refs.width + event.distance.x;
|
|
2909
3004
|
if (width > dragMinWidth) {
|
|
2910
3005
|
_this.barElement.style.width = width + 'px';
|
|
2911
|
-
_this.openDragBackdrop(_this.barElement, _this.
|
|
3006
|
+
_this.openDragBackdrop(_this.barElement, _this.item.start, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
|
|
2912
3007
|
}
|
|
2913
3008
|
_this.item.updateDate(_this.item.start, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
|
|
2914
3009
|
}
|
|
@@ -2982,6 +3077,9 @@
|
|
|
2982
3077
|
? InBarPosition.start
|
|
2983
3078
|
: InBarPosition.finish }));
|
|
2984
3079
|
}
|
|
3080
|
+
else {
|
|
3081
|
+
_this.dragContainer.emitLinkDragEnded();
|
|
3082
|
+
}
|
|
2985
3083
|
event.source.reset();
|
|
2986
3084
|
_this.barElement.classList.remove(activeClass);
|
|
2987
3085
|
_this.destroyLinkDraggingLine();
|
|
@@ -2991,22 +3089,24 @@
|
|
|
2991
3089
|
return dragRefs;
|
|
2992
3090
|
};
|
|
2993
3091
|
GanttBarDrag.prototype.openDragBackdrop = function (dragElement, start, end) {
|
|
2994
|
-
var
|
|
2995
|
-
var
|
|
3092
|
+
var dragBackdropElement = this.root.backdrop.nativeElement;
|
|
3093
|
+
var dragMaskElement = dragBackdropElement.querySelector('.gantt-drag-mask');
|
|
2996
3094
|
var rootRect = this.dom.root.getBoundingClientRect();
|
|
2997
3095
|
var dragRect = dragElement.getBoundingClientRect();
|
|
2998
3096
|
var left = dragRect.left - rootRect.left - this.dom.side.clientWidth;
|
|
2999
3097
|
var width = dragRect.right - dragRect.left;
|
|
3098
|
+
// Note: updating styles will cause re-layout so we have to place them consistently one by one.
|
|
3000
3099
|
dragMaskElement.style.left = left + 'px';
|
|
3001
3100
|
dragMaskElement.style.width = width + 'px';
|
|
3002
|
-
dragMaskElement.querySelector('.start').innerHTML = start.format('MM-dd');
|
|
3003
|
-
dragMaskElement.querySelector('.end').innerHTML = end.format('MM-dd');
|
|
3004
3101
|
dragMaskElement.style.display = 'block';
|
|
3005
3102
|
dragBackdropElement.style.display = 'block';
|
|
3103
|
+
// This will invalidate the layout, but we won't need re-layout, because we set styles previously.
|
|
3104
|
+
dragMaskElement.querySelector('.start').innerHTML = start.format('MM-dd');
|
|
3105
|
+
dragMaskElement.querySelector('.end').innerHTML = end.format('MM-dd');
|
|
3006
3106
|
};
|
|
3007
3107
|
GanttBarDrag.prototype.closeDragBackdrop = function () {
|
|
3008
|
-
var
|
|
3009
|
-
var
|
|
3108
|
+
var dragBackdropElement = this.root.backdrop.nativeElement;
|
|
3109
|
+
var dragMaskElement = dragBackdropElement.querySelector('.gantt-drag-mask');
|
|
3010
3110
|
dragMaskElement.style.display = 'none';
|
|
3011
3111
|
dragBackdropElement.style.display = 'none';
|
|
3012
3112
|
};
|
|
@@ -3050,7 +3150,8 @@
|
|
|
3050
3150
|
this.item = item;
|
|
3051
3151
|
this.barElement = elementRef.nativeElement;
|
|
3052
3152
|
this.ganttUpper = ganttUpper;
|
|
3053
|
-
if (!item.draggable || (this.dragDisabled && this.linkDragDisabled)) {
|
|
3153
|
+
// if (!item.draggable || (this.dragDisabled && this.linkDragDisabled)) {
|
|
3154
|
+
if (this.dragDisabled && this.linkDragDisabled) {
|
|
3054
3155
|
return;
|
|
3055
3156
|
}
|
|
3056
3157
|
else {
|
|
@@ -3074,22 +3175,27 @@
|
|
|
3074
3175
|
};
|
|
3075
3176
|
return GanttBarDrag;
|
|
3076
3177
|
}());
|
|
3077
|
-
GanttBarDrag.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
3078
|
-
GanttBarDrag.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.
|
|
3079
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3178
|
+
GanttBarDrag.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag, deps: [{ token: i1__namespace.DragDrop }, { token: GanttDomService }, { token: GanttDragContainer }, { token: NgxGanttRootComponent, skipSelf: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3179
|
+
GanttBarDrag.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag });
|
|
3180
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag, decorators: [{
|
|
3080
3181
|
type: i0.Injectable
|
|
3081
|
-
}], ctorParameters: function () {
|
|
3182
|
+
}], ctorParameters: function () {
|
|
3183
|
+
return [{ type: i1__namespace.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }, { type: NgxGanttRootComponent, decorators: [{
|
|
3184
|
+
type: i0.SkipSelf
|
|
3185
|
+
}] }];
|
|
3186
|
+
} });
|
|
3082
3187
|
|
|
3083
3188
|
function linearGradient(sideOrCorner, color, stop) {
|
|
3084
3189
|
return "linear-gradient(" + sideOrCorner + "," + color + " 0%," + stop + " 40%)";
|
|
3085
3190
|
}
|
|
3086
3191
|
var NgxGanttBarComponent = /** @class */ (function (_super) {
|
|
3087
3192
|
__extends(NgxGanttBarComponent, _super);
|
|
3088
|
-
function NgxGanttBarComponent(dragContainer, drag, elementRef, ganttUpper) {
|
|
3193
|
+
function NgxGanttBarComponent(dragContainer, drag, elementRef, ganttUpper, ngZone) {
|
|
3089
3194
|
var _this = _super.call(this, elementRef, ganttUpper) || this;
|
|
3090
3195
|
_this.dragContainer = dragContainer;
|
|
3091
3196
|
_this.drag = drag;
|
|
3092
3197
|
_this.ganttUpper = ganttUpper;
|
|
3198
|
+
_this.ngZone = ngZone;
|
|
3093
3199
|
_this.barClick = new i0.EventEmitter();
|
|
3094
3200
|
_this.ganttItemClass = true;
|
|
3095
3201
|
_this.color = 'red';
|
|
@@ -3097,17 +3203,24 @@
|
|
|
3097
3203
|
}
|
|
3098
3204
|
NgxGanttBarComponent.prototype.ngOnInit = function () {
|
|
3099
3205
|
var _this = this;
|
|
3100
|
-
_super.prototype.
|
|
3206
|
+
_super.prototype.ngOnInit.call(this);
|
|
3101
3207
|
this.dragContainer.dragEnded.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
3102
3208
|
_this.setContentBackground();
|
|
3103
3209
|
});
|
|
3104
3210
|
};
|
|
3105
3211
|
NgxGanttBarComponent.prototype.ngAfterViewInit = function () {
|
|
3212
|
+
var _this = this;
|
|
3106
3213
|
this.drag.createDrags(this.elementRef, this.item, this.ganttUpper);
|
|
3107
3214
|
this.setContentBackground();
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3215
|
+
this.handles.changes
|
|
3216
|
+
.pipe(operators.startWith(this.handles), operators.switchMap(function () {
|
|
3217
|
+
// Note: we need to explicitly subscribe outside of the Angular zone since `addEventListener`
|
|
3218
|
+
// is called when the `fromEvent` is subscribed.
|
|
3219
|
+
return new rxjs.Observable(function (subscriber) { return _this.ngZone.runOutsideAngular(function () { return rxjs.merge.apply(void 0, __spreadArray([], __read(_this.handles.toArray().map(function (handle) { return rxjs.fromEvent(handle.nativeElement, 'mousedown'); })))).subscribe(subscriber); }); });
|
|
3220
|
+
}), operators.takeUntil(this.unsubscribe$))
|
|
3221
|
+
.subscribe(function (event) {
|
|
3222
|
+
event.stopPropagation();
|
|
3223
|
+
});
|
|
3111
3224
|
};
|
|
3112
3225
|
NgxGanttBarComponent.prototype.onBarClick = function (event) {
|
|
3113
3226
|
this.barClick.emit({ event: event, item: this.item.origin });
|
|
@@ -3143,14 +3256,11 @@
|
|
|
3143
3256
|
NgxGanttBarComponent.prototype.stopPropagation = function (event) {
|
|
3144
3257
|
event.stopPropagation();
|
|
3145
3258
|
};
|
|
3146
|
-
NgxGanttBarComponent.prototype.ngOnDestroy = function () {
|
|
3147
|
-
_super.prototype.onDestroy.call(this);
|
|
3148
|
-
};
|
|
3149
3259
|
return NgxGanttBarComponent;
|
|
3150
3260
|
}(GanttItemUpper));
|
|
3151
|
-
NgxGanttBarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
3152
|
-
NgxGanttBarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
3153
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3261
|
+
NgxGanttBarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttBarComponent, deps: [{ token: GanttDragContainer }, { token: GanttBarDrag }, { token: i0__namespace.ElementRef }, { token: GANTT_UPPER_TOKEN }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3262
|
+
NgxGanttBarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttBarComponent, 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, ngImport: i0__namespace, template: "<div class=\"gantt-bar-layer\">\n <div class=\"drag-handles\">\n <ng-container *ngIf=\"item.draggable && ganttUpper.draggable\">\n <span class=\"handle\" #handle></span>\n <span class=\"handle\" #handle></span>\n </ng-container>\n </div>\n <div *ngIf=\"item.linkable && ganttUpper.linkable\" class=\"link-handles\">\n <span class=\"handle\"><span class=\"point\"></span></span>\n <span class=\"handle\"> <span class=\"point\"></span></span>\n </div>\n</div>\n<div class=\"gantt-bar-border\"></div>\n<div #content class=\"gantt-bar-content\" (click)=\"onBarClick($event)\">\n <div class=\"gantt-bar-content-progress\" *ngIf=\"item.progress >= 0\" [style.width.%]=\"item.progress * 100\"></div>\n <ng-template [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n</div>\n", directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
3263
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttBarComponent, decorators: [{
|
|
3154
3264
|
type: i0.Component,
|
|
3155
3265
|
args: [{
|
|
3156
3266
|
selector: 'ngx-gantt-bar,gantt-bar',
|
|
@@ -3161,7 +3271,7 @@
|
|
|
3161
3271
|
return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3162
3272
|
type: i0.Inject,
|
|
3163
3273
|
args: [GANTT_UPPER_TOKEN]
|
|
3164
|
-
}] }];
|
|
3274
|
+
}] }, { type: i0__namespace.NgZone }];
|
|
3165
3275
|
}, propDecorators: { barClick: [{
|
|
3166
3276
|
type: i0.Output
|
|
3167
3277
|
}], contentElementRef: [{
|
|
@@ -3170,6 +3280,9 @@
|
|
|
3170
3280
|
}], ganttItemClass: [{
|
|
3171
3281
|
type: i0.HostBinding,
|
|
3172
3282
|
args: ['class.gantt-bar']
|
|
3283
|
+
}], handles: [{
|
|
3284
|
+
type: i0.ViewChildren,
|
|
3285
|
+
args: ['handle']
|
|
3173
3286
|
}] } });
|
|
3174
3287
|
|
|
3175
3288
|
var GanttMainComponent = /** @class */ (function () {
|
|
@@ -3179,15 +3292,14 @@
|
|
|
3179
3292
|
this.lineClick = new i0.EventEmitter();
|
|
3180
3293
|
this.ganttMainClass = true;
|
|
3181
3294
|
}
|
|
3182
|
-
GanttMainComponent.prototype.ngOnInit = function () { };
|
|
3183
3295
|
GanttMainComponent.prototype.trackBy = function (index, item) {
|
|
3184
3296
|
return item.id || index;
|
|
3185
3297
|
};
|
|
3186
3298
|
return GanttMainComponent;
|
|
3187
3299
|
}());
|
|
3188
|
-
GanttMainComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
3189
|
-
GanttMainComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
3190
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3300
|
+
GanttMainComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttMainComponent, deps: [{ token: GANTT_UPPER_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3301
|
+
GanttMainComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: GanttMainComponent, selector: "gantt-main", inputs: { groups: "groups", items: "items", groupHeaderTemplate: "groupHeaderTemplate", itemTemplate: "itemTemplate", barTemplate: "barTemplate", rangeTemplate: "rangeTemplate" }, outputs: { barClick: "barClick", lineClick: "lineClick" }, host: { properties: { "class.gantt-main-container": "this.ganttMainClass" } }, ngImport: i0__namespace, template: "<gantt-links-overlay [groups]=\"groups\" [items]=\"items\" (lineClick)=\"lineClick.emit($event)\"></gantt-links-overlay>\n<!-- groups -->\n<div class=\"gantt-main-groups\" *ngIf=\"groups && groups.length > 0; else itemsTemplate\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-container *ngFor=\"let group of groups; trackBy: trackBy\">\n <div class=\"gantt-group\" [ngClass]=\"group.class\">\n <ng-template [ngTemplateOutlet]=\"groupHeaderTemplate\" [ngTemplateOutletContext]=\"{ group: group }\"></ng-template>\n </div>\n <div *ngIf=\"group.expanded\" class=\"gantt-items\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: group.items }\"></ng-template>\n </div>\n </ng-container>\n</div>\n<!-- items -->\n<ng-template #itemsTemplate>\n <div class=\"gantt-main-items\" [style.width.px]=\"ganttUpper.view.width\">\n <ng-template [ngTemplateOutlet]=\"ganttItems\" [ngTemplateOutletContext]=\"{ items: items }\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #ganttItems let-items=\"items\">\n <ng-container *ngFor=\"let item of items;\">\n <div\n class=\"gantt-item\"\n [style.height.px]=\"ganttUpper.styles.lineHeight\"\n [class.gantt-main-item-active]=\"ganttUpper.isSelected(item.id)\"\n >\n <ng-container *ngIf=\"item.type | isGanttCustomItem\">\n <ng-template [ngTemplateOutlet]=\"itemTemplate\" [ngTemplateOutletContext]=\"{ item: item.origin, refs: item.refs }\"></ng-template>\n </ng-container>\n <gantt-range *ngIf=\"item.type | isGanttRangeItem\" [template]=\"rangeTemplate\" [item]=\"item\"></gantt-range>\n <gantt-bar *ngIf=\"item.type | isGanttBarItem\" [item]=\"item\" [template]=\"barTemplate\" (barClick)=\"barClick.emit($event)\"></gantt-bar>\n </div>\n <ng-template\n *ngIf=\"item.children && item.expanded\"\n [ngTemplateOutlet]=\"ganttItems\"\n [ngTemplateOutletContext]=\"{ items: item.children }\"\n ></ng-template>\n </ng-container>\n</ng-template>\n", components: [{ type: GanttLinksComponent, selector: "gantt-links-overlay", inputs: ["groups", "items"], outputs: ["lineClick"] }, { type: NgxGanttRangeComponent, selector: "ngx-gantt-range,gantt-range" }, { type: NgxGanttBarComponent, selector: "ngx-gantt-bar,gantt-bar", outputs: ["barClick"] }], directives: [{ type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "isGanttCustomItem": IsGanttCustomItemPipe, "isGanttRangeItem": IsGanttRangeItemPipe, "isGanttBarItem": IsGanttBarItemPipe } });
|
|
3302
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttMainComponent, decorators: [{
|
|
3191
3303
|
type: i0.Component,
|
|
3192
3304
|
args: [{
|
|
3193
3305
|
selector: 'gantt-main',
|
|
@@ -3234,13 +3346,20 @@
|
|
|
3234
3346
|
}
|
|
3235
3347
|
NgxGanttComponent.prototype.ngOnInit = function () {
|
|
3236
3348
|
var _this = this;
|
|
3237
|
-
_super.prototype.
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3349
|
+
_super.prototype.ngOnInit.call(this);
|
|
3350
|
+
// Note: the zone may be nooped through `BootstrapOptions` when bootstrapping the root module. This means
|
|
3351
|
+
// the `onStable` will never emit any value.
|
|
3352
|
+
var onStable$ = this.ngZone.isStable ? rxjs.from(Promise.resolve()) : this.ngZone.onStable.pipe(operators.take(1));
|
|
3353
|
+
// Normally this isn't in the zone, but it can cause performance regressions for apps
|
|
3354
|
+
// using `zone-patch-rxjs` because it'll trigger a change detection when it unsubscribes.
|
|
3355
|
+
this.ngZone.runOutsideAngular(function () {
|
|
3356
|
+
onStable$.pipe(operators.takeUntil(_this.unsubscribe$)).subscribe(function () {
|
|
3357
|
+
_this.dragContainer.linkDragStarted.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
|
|
3358
|
+
_this.linkDragStarted.emit(event);
|
|
3359
|
+
});
|
|
3360
|
+
_this.dragContainer.linkDragEnded.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
|
|
3361
|
+
_this.linkDragEnded.emit(event);
|
|
3362
|
+
});
|
|
3244
3363
|
});
|
|
3245
3364
|
});
|
|
3246
3365
|
};
|
|
@@ -3255,9 +3374,6 @@
|
|
|
3255
3374
|
_this.cdr.detectChanges();
|
|
3256
3375
|
});
|
|
3257
3376
|
};
|
|
3258
|
-
NgxGanttComponent.prototype.ngOnChanges = function (changes) {
|
|
3259
|
-
_super.prototype.onChanges.call(this, changes);
|
|
3260
|
-
};
|
|
3261
3377
|
NgxGanttComponent.prototype.expandChildren = function (item) {
|
|
3262
3378
|
var _this = this;
|
|
3263
3379
|
if (!item.expanded) {
|
|
@@ -3302,13 +3418,10 @@
|
|
|
3302
3418
|
this.selectedChange.emit({ event: event, selectedValue: _selectedValue });
|
|
3303
3419
|
}
|
|
3304
3420
|
};
|
|
3305
|
-
NgxGanttComponent.prototype.ngOnDestroy = function () {
|
|
3306
|
-
_super.prototype.onDestroy.call(this);
|
|
3307
|
-
};
|
|
3308
3421
|
return NgxGanttComponent;
|
|
3309
3422
|
}(GanttUpper));
|
|
3310
|
-
NgxGanttComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
3311
|
-
NgxGanttComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.
|
|
3423
|
+
NgxGanttComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: GANTT_GLOBAL_CONFIG }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3424
|
+
NgxGanttComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttComponent, selector: "ngx-gantt", inputs: { maxLevel: "maxLevel", async: "async", childrenResolve: "childrenResolve", linkable: "linkable" }, outputs: { linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", selectedChange: "selectedChange" }, providers: [
|
|
3312
3425
|
{
|
|
3313
3426
|
provide: GANTT_UPPER_TOKEN,
|
|
3314
3427
|
useExisting: NgxGanttComponent
|
|
@@ -3317,8 +3430,8 @@
|
|
|
3317
3430
|
provide: GANTT_ABSTRACT_TOKEN,
|
|
3318
3431
|
useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
|
|
3319
3432
|
}
|
|
3320
|
-
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], usesInheritance: true,
|
|
3321
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3433
|
+
], queries: [{ propertyName: "table", first: true, predicate: NgxGanttTableComponent, descendants: true }, { propertyName: "tableEmptyTemplate", first: true, predicate: ["tableEmpty"], descendants: true, static: true }, { propertyName: "columns", predicate: NgxGanttTableColumnComponent, descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ngx-gantt-root>\n <ng-template #sideTemplate>\n <gantt-table\n [groups]=\"groups\"\n [items]=\"items\"\n [columns]=\"columns\"\n [groupTemplate]=\"groupTemplate\"\n [emptyTemplate]=\"tableEmptyTemplate\"\n [rowBeforeTemplate]=\"table?.rowBeforeTemplate\"\n [rowAfterTemplate]=\"table?.rowAfterTemplate\"\n (itemClick)=\"selectItem($event)\"\n ></gantt-table>\n </ng-template>\n <ng-template #mainTemplate>\n <gantt-main\n [groups]=\"groups\"\n [items]=\"items\"\n [groupHeaderTemplate]=\"groupHeaderTemplate\"\n [itemTemplate]=\"itemTemplate\"\n [barTemplate]=\"barTemplate\"\n [rangeTemplate]=\"rangeTemplate\"\n (barClick)=\"barClick.emit($event)\"\n (lineClick)=\"lineClick.emit($event)\"\n >\n </gantt-main>\n </ng-template>\n</ngx-gantt-root>\n", components: [{ type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: ["sideWidth"] }, { type: GanttTableComponent, selector: "gantt-table", inputs: ["groups", "items", "columns", "groupTemplate", "emptyTemplate", "rowBeforeTemplate", "rowAfterTemplate"], outputs: ["itemClick"] }, { type: GanttMainComponent, selector: "gantt-main", inputs: ["groups", "items", "groupHeaderTemplate", "itemTemplate", "barTemplate", "rangeTemplate"], outputs: ["barClick", "lineClick"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
3434
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttComponent, decorators: [{
|
|
3322
3435
|
type: i0.Component,
|
|
3323
3436
|
args: [{
|
|
3324
3437
|
selector: 'ngx-gantt',
|
|
@@ -3372,8 +3485,8 @@
|
|
|
3372
3485
|
}
|
|
3373
3486
|
return NgxGanttModule;
|
|
3374
3487
|
}());
|
|
3375
|
-
NgxGanttModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.
|
|
3376
|
-
NgxGanttModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.
|
|
3488
|
+
NgxGanttModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3489
|
+
NgxGanttModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3377
3490
|
NgxGanttTableComponent,
|
|
3378
3491
|
NgxGanttTableColumnComponent,
|
|
3379
3492
|
GanttTableComponent,
|
|
@@ -3393,13 +3506,13 @@
|
|
|
3393
3506
|
NgxGanttRootComponent,
|
|
3394
3507
|
NgxGanttBarComponent,
|
|
3395
3508
|
NgxGanttRangeComponent] });
|
|
3396
|
-
NgxGanttModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.
|
|
3509
|
+
NgxGanttModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, providers: [
|
|
3397
3510
|
{
|
|
3398
3511
|
provide: GANTT_GLOBAL_CONFIG,
|
|
3399
3512
|
useValue: defaultConfig
|
|
3400
3513
|
}
|
|
3401
3514
|
], imports: [[i2.CommonModule, i1.DragDropModule]] });
|
|
3402
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.
|
|
3515
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, decorators: [{
|
|
3403
3516
|
type: i0.NgModule,
|
|
3404
3517
|
args: [{
|
|
3405
3518
|
imports: [i2.CommonModule, i1.DragDropModule],
|
|
@@ -3447,195 +3560,131 @@
|
|
|
3447
3560
|
|
|
3448
3561
|
Object.defineProperty(exports, 'addDays', {
|
|
3449
3562
|
enumerable: true,
|
|
3450
|
-
get: function () {
|
|
3451
|
-
return dateFns.addDays;
|
|
3452
|
-
}
|
|
3563
|
+
get: function () { return dateFns.addDays; }
|
|
3453
3564
|
});
|
|
3454
3565
|
Object.defineProperty(exports, 'addHours', {
|
|
3455
3566
|
enumerable: true,
|
|
3456
|
-
get: function () {
|
|
3457
|
-
return dateFns.addHours;
|
|
3458
|
-
}
|
|
3567
|
+
get: function () { return dateFns.addHours; }
|
|
3459
3568
|
});
|
|
3460
3569
|
Object.defineProperty(exports, 'addMinutes', {
|
|
3461
3570
|
enumerable: true,
|
|
3462
|
-
get: function () {
|
|
3463
|
-
return dateFns.addMinutes;
|
|
3464
|
-
}
|
|
3571
|
+
get: function () { return dateFns.addMinutes; }
|
|
3465
3572
|
});
|
|
3466
3573
|
Object.defineProperty(exports, 'addMonths', {
|
|
3467
3574
|
enumerable: true,
|
|
3468
|
-
get: function () {
|
|
3469
|
-
return dateFns.addMonths;
|
|
3470
|
-
}
|
|
3575
|
+
get: function () { return dateFns.addMonths; }
|
|
3471
3576
|
});
|
|
3472
3577
|
Object.defineProperty(exports, 'addQuarters', {
|
|
3473
3578
|
enumerable: true,
|
|
3474
|
-
get: function () {
|
|
3475
|
-
return dateFns.addQuarters;
|
|
3476
|
-
}
|
|
3579
|
+
get: function () { return dateFns.addQuarters; }
|
|
3477
3580
|
});
|
|
3478
3581
|
Object.defineProperty(exports, 'addSeconds', {
|
|
3479
3582
|
enumerable: true,
|
|
3480
|
-
get: function () {
|
|
3481
|
-
return dateFns.addSeconds;
|
|
3482
|
-
}
|
|
3583
|
+
get: function () { return dateFns.addSeconds; }
|
|
3483
3584
|
});
|
|
3484
3585
|
Object.defineProperty(exports, 'addWeeks', {
|
|
3485
3586
|
enumerable: true,
|
|
3486
|
-
get: function () {
|
|
3487
|
-
return dateFns.addWeeks;
|
|
3488
|
-
}
|
|
3587
|
+
get: function () { return dateFns.addWeeks; }
|
|
3489
3588
|
});
|
|
3490
3589
|
Object.defineProperty(exports, 'addYears', {
|
|
3491
3590
|
enumerable: true,
|
|
3492
|
-
get: function () {
|
|
3493
|
-
return dateFns.addYears;
|
|
3494
|
-
}
|
|
3591
|
+
get: function () { return dateFns.addYears; }
|
|
3495
3592
|
});
|
|
3496
3593
|
Object.defineProperty(exports, 'differenceInCalendarDays', {
|
|
3497
3594
|
enumerable: true,
|
|
3498
|
-
get: function () {
|
|
3499
|
-
return dateFns.differenceInCalendarDays;
|
|
3500
|
-
}
|
|
3595
|
+
get: function () { return dateFns.differenceInCalendarDays; }
|
|
3501
3596
|
});
|
|
3502
3597
|
Object.defineProperty(exports, 'differenceInCalendarQuarters', {
|
|
3503
3598
|
enumerable: true,
|
|
3504
|
-
get: function () {
|
|
3505
|
-
return dateFns.differenceInCalendarQuarters;
|
|
3506
|
-
}
|
|
3599
|
+
get: function () { return dateFns.differenceInCalendarQuarters; }
|
|
3507
3600
|
});
|
|
3508
3601
|
Object.defineProperty(exports, 'differenceInDays', {
|
|
3509
3602
|
enumerable: true,
|
|
3510
|
-
get: function () {
|
|
3511
|
-
return dateFns.differenceInDays;
|
|
3512
|
-
}
|
|
3603
|
+
get: function () { return dateFns.differenceInDays; }
|
|
3513
3604
|
});
|
|
3514
3605
|
Object.defineProperty(exports, 'eachDayOfInterval', {
|
|
3515
3606
|
enumerable: true,
|
|
3516
|
-
get: function () {
|
|
3517
|
-
return dateFns.eachDayOfInterval;
|
|
3518
|
-
}
|
|
3607
|
+
get: function () { return dateFns.eachDayOfInterval; }
|
|
3519
3608
|
});
|
|
3520
3609
|
Object.defineProperty(exports, 'eachMonthOfInterval', {
|
|
3521
3610
|
enumerable: true,
|
|
3522
|
-
get: function () {
|
|
3523
|
-
return dateFns.eachMonthOfInterval;
|
|
3524
|
-
}
|
|
3611
|
+
get: function () { return dateFns.eachMonthOfInterval; }
|
|
3525
3612
|
});
|
|
3526
3613
|
Object.defineProperty(exports, 'eachWeekOfInterval', {
|
|
3527
3614
|
enumerable: true,
|
|
3528
|
-
get: function () {
|
|
3529
|
-
return dateFns.eachWeekOfInterval;
|
|
3530
|
-
}
|
|
3615
|
+
get: function () { return dateFns.eachWeekOfInterval; }
|
|
3531
3616
|
});
|
|
3532
3617
|
Object.defineProperty(exports, 'endOfDay', {
|
|
3533
3618
|
enumerable: true,
|
|
3534
|
-
get: function () {
|
|
3535
|
-
return dateFns.endOfDay;
|
|
3536
|
-
}
|
|
3619
|
+
get: function () { return dateFns.endOfDay; }
|
|
3537
3620
|
});
|
|
3538
3621
|
Object.defineProperty(exports, 'endOfMonth', {
|
|
3539
3622
|
enumerable: true,
|
|
3540
|
-
get: function () {
|
|
3541
|
-
return dateFns.endOfMonth;
|
|
3542
|
-
}
|
|
3623
|
+
get: function () { return dateFns.endOfMonth; }
|
|
3543
3624
|
});
|
|
3544
3625
|
Object.defineProperty(exports, 'endOfQuarter', {
|
|
3545
3626
|
enumerable: true,
|
|
3546
|
-
get: function () {
|
|
3547
|
-
return dateFns.endOfQuarter;
|
|
3548
|
-
}
|
|
3627
|
+
get: function () { return dateFns.endOfQuarter; }
|
|
3549
3628
|
});
|
|
3550
3629
|
Object.defineProperty(exports, 'endOfWeek', {
|
|
3551
3630
|
enumerable: true,
|
|
3552
|
-
get: function () {
|
|
3553
|
-
return dateFns.endOfWeek;
|
|
3554
|
-
}
|
|
3631
|
+
get: function () { return dateFns.endOfWeek; }
|
|
3555
3632
|
});
|
|
3556
3633
|
Object.defineProperty(exports, 'endOfYear', {
|
|
3557
3634
|
enumerable: true,
|
|
3558
|
-
get: function () {
|
|
3559
|
-
return dateFns.endOfYear;
|
|
3560
|
-
}
|
|
3635
|
+
get: function () { return dateFns.endOfYear; }
|
|
3561
3636
|
});
|
|
3562
3637
|
Object.defineProperty(exports, 'format', {
|
|
3563
3638
|
enumerable: true,
|
|
3564
|
-
get: function () {
|
|
3565
|
-
return dateFns.format;
|
|
3566
|
-
}
|
|
3639
|
+
get: function () { return dateFns.format; }
|
|
3567
3640
|
});
|
|
3568
3641
|
Object.defineProperty(exports, 'fromUnixTime', {
|
|
3569
3642
|
enumerable: true,
|
|
3570
|
-
get: function () {
|
|
3571
|
-
return dateFns.fromUnixTime;
|
|
3572
|
-
}
|
|
3643
|
+
get: function () { return dateFns.fromUnixTime; }
|
|
3573
3644
|
});
|
|
3574
3645
|
Object.defineProperty(exports, 'getDaysInMonth', {
|
|
3575
3646
|
enumerable: true,
|
|
3576
|
-
get: function () {
|
|
3577
|
-
return dateFns.getDaysInMonth;
|
|
3578
|
-
}
|
|
3647
|
+
get: function () { return dateFns.getDaysInMonth; }
|
|
3579
3648
|
});
|
|
3580
3649
|
Object.defineProperty(exports, 'getUnixTime', {
|
|
3581
3650
|
enumerable: true,
|
|
3582
|
-
get: function () {
|
|
3583
|
-
return dateFns.getUnixTime;
|
|
3584
|
-
}
|
|
3651
|
+
get: function () { return dateFns.getUnixTime; }
|
|
3585
3652
|
});
|
|
3586
3653
|
Object.defineProperty(exports, 'getWeek', {
|
|
3587
3654
|
enumerable: true,
|
|
3588
|
-
get: function () {
|
|
3589
|
-
return dateFns.getWeek;
|
|
3590
|
-
}
|
|
3655
|
+
get: function () { return dateFns.getWeek; }
|
|
3591
3656
|
});
|
|
3592
3657
|
Object.defineProperty(exports, 'isToday', {
|
|
3593
3658
|
enumerable: true,
|
|
3594
|
-
get: function () {
|
|
3595
|
-
return dateFns.isToday;
|
|
3596
|
-
}
|
|
3659
|
+
get: function () { return dateFns.isToday; }
|
|
3597
3660
|
});
|
|
3598
3661
|
Object.defineProperty(exports, 'isWeekend', {
|
|
3599
3662
|
enumerable: true,
|
|
3600
|
-
get: function () {
|
|
3601
|
-
return dateFns.isWeekend;
|
|
3602
|
-
}
|
|
3663
|
+
get: function () { return dateFns.isWeekend; }
|
|
3603
3664
|
});
|
|
3604
3665
|
Object.defineProperty(exports, 'setDate', {
|
|
3605
3666
|
enumerable: true,
|
|
3606
|
-
get: function () {
|
|
3607
|
-
return dateFns.setDate;
|
|
3608
|
-
}
|
|
3667
|
+
get: function () { return dateFns.setDate; }
|
|
3609
3668
|
});
|
|
3610
3669
|
Object.defineProperty(exports, 'startOfDay', {
|
|
3611
3670
|
enumerable: true,
|
|
3612
|
-
get: function () {
|
|
3613
|
-
return dateFns.startOfDay;
|
|
3614
|
-
}
|
|
3671
|
+
get: function () { return dateFns.startOfDay; }
|
|
3615
3672
|
});
|
|
3616
3673
|
Object.defineProperty(exports, 'startOfMonth', {
|
|
3617
3674
|
enumerable: true,
|
|
3618
|
-
get: function () {
|
|
3619
|
-
return dateFns.startOfMonth;
|
|
3620
|
-
}
|
|
3675
|
+
get: function () { return dateFns.startOfMonth; }
|
|
3621
3676
|
});
|
|
3622
3677
|
Object.defineProperty(exports, 'startOfQuarter', {
|
|
3623
3678
|
enumerable: true,
|
|
3624
|
-
get: function () {
|
|
3625
|
-
return dateFns.startOfQuarter;
|
|
3626
|
-
}
|
|
3679
|
+
get: function () { return dateFns.startOfQuarter; }
|
|
3627
3680
|
});
|
|
3628
3681
|
Object.defineProperty(exports, 'startOfWeek', {
|
|
3629
3682
|
enumerable: true,
|
|
3630
|
-
get: function () {
|
|
3631
|
-
return dateFns.startOfWeek;
|
|
3632
|
-
}
|
|
3683
|
+
get: function () { return dateFns.startOfWeek; }
|
|
3633
3684
|
});
|
|
3634
3685
|
Object.defineProperty(exports, 'startOfYear', {
|
|
3635
3686
|
enumerable: true,
|
|
3636
|
-
get: function () {
|
|
3637
|
-
return dateFns.startOfYear;
|
|
3638
|
-
}
|
|
3687
|
+
get: function () { return dateFns.startOfYear; }
|
|
3639
3688
|
});
|
|
3640
3689
|
exports.GANTT_GLOBAL_CONFIG = GANTT_GLOBAL_CONFIG;
|
|
3641
3690
|
exports.GANTT_UPPER_TOKEN = GANTT_UPPER_TOKEN;
|
|
@@ -3670,5 +3719,5 @@
|
|
|
3670
3719
|
|
|
3671
3720
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3672
3721
|
|
|
3673
|
-
}))
|
|
3722
|
+
}));
|
|
3674
3723
|
//# sourceMappingURL=worktile-gantt.umd.js.map
|