@worktile/gantt 12.2.1 → 13.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bar/bar-drag.d.ts +4 -2
- package/components/bar/bar.component.d.ts +4 -4
- package/components/bar/bar.component.scss +201 -0
- package/components/calendar/calendar.component.d.ts +3 -5
- package/components/calendar/calendar.component.scss +79 -0
- package/components/drag-backdrop/drag-backdrop.component.d.ts +1 -5
- package/components/drag-backdrop/drag-backdrop.component.scss +50 -0
- package/components/icon/icon.component.d.ts +2 -4
- package/components/icon/icon.component.scss +13 -0
- package/components/links/links.component.scss +29 -0
- package/components/main/gantt-main.component.d.ts +2 -3
- package/components/range/range.component.d.ts +2 -5
- package/components/range/range.component.scss +35 -0
- package/components/table/gantt-table.component.d.ts +2 -3
- package/components/table/gantt-table.component.scss +153 -0
- package/{esm2015/class/date-point.js → esm2020/class/date-point.mjs} +0 -0
- package/{esm2015/class/event.js → esm2020/class/event.mjs} +0 -0
- package/{esm2015/class/group.js → esm2020/class/group.mjs} +0 -0
- package/{esm2015/class/index.js → esm2020/class/index.mjs} +0 -0
- package/{esm2015/class/item.js → esm2020/class/item.mjs} +0 -0
- package/{esm2015/class/link.js → esm2020/class/link.mjs} +0 -0
- package/{esm2015/class/view-type.js → esm2020/class/view-type.mjs} +0 -0
- package/esm2020/components/bar/bar-drag.mjs +308 -0
- package/esm2020/components/bar/bar.component.mjs +101 -0
- package/esm2020/components/calendar/calendar.component.mjs +88 -0
- package/esm2020/components/drag-backdrop/drag-backdrop.component.mjs +13 -0
- package/esm2020/components/icon/icon.component.mjs +36 -0
- package/{esm2015/components/icon/icons.js → esm2020/components/icon/icons.mjs} +0 -0
- package/esm2020/components/links/lines/curve.mjs +95 -0
- package/{esm2015/components/links/lines/factory.js → esm2020/components/links/lines/factory.mjs} +0 -0
- package/{esm2015/components/links/lines/line.js → esm2020/components/links/lines/line.mjs} +0 -0
- package/{esm2015/components/links/lines/straight.js → esm2020/components/links/lines/straight.mjs} +0 -0
- package/esm2020/components/links/links.component.mjs +178 -0
- package/esm2020/components/main/gantt-main.component.mjs +49 -0
- package/esm2020/components/range/range.component.mjs +25 -0
- package/esm2020/components/table/gantt-table.component.mjs +163 -0
- package/{esm2015/gantt-abstract.js → esm2020/gantt-abstract.mjs} +0 -0
- package/esm2020/gantt-dom.service.mjs +117 -0
- package/esm2020/gantt-drag-container.mjs +78 -0
- package/esm2020/gantt-item-upper.mjs +58 -0
- package/esm2020/gantt-print.service.mjs +94 -0
- package/esm2020/gantt-upper.mjs +339 -0
- package/esm2020/gantt.component.mjs +150 -0
- package/{esm2015/gantt.config.js → esm2020/gantt.config.mjs} +0 -0
- package/{esm2015/gantt.module.js → esm2020/gantt.module.mjs} +4 -4
- package/{esm2015/gantt.pipe.js → esm2020/gantt.pipe.mjs} +9 -9
- package/{esm2015/gantt.styles.js → esm2020/gantt.styles.mjs} +0 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/esm2020/root.component.mjs +130 -0
- package/esm2020/table/gantt-column.component.mjs +36 -0
- package/esm2020/table/gantt-table.component.mjs +25 -0
- package/{esm2015/utils/date.js → esm2020/utils/date.mjs} +0 -0
- package/{esm2015/utils/helpers.js → esm2020/utils/helpers.mjs} +0 -0
- package/esm2020/utils/passive-listeners.mjs +30 -0
- package/esm2020/utils/set-style-with-vendor-prefix.mjs +15 -0
- package/{esm2015/views/day.js → esm2020/views/day.mjs} +1 -1
- package/{esm2015/views/factory.js → esm2020/views/factory.mjs} +0 -0
- package/{esm2015/views/month.js → esm2020/views/month.mjs} +0 -0
- package/{esm2015/views/quarter.js → esm2020/views/quarter.mjs} +0 -0
- package/{esm2015/views/view.js → esm2020/views/view.mjs} +5 -5
- package/{esm2015/views/week.js → esm2020/views/week.mjs} +0 -0
- package/{esm2015/views/year.js → esm2020/views/year.mjs} +0 -0
- package/{esm2015/worktile-gantt.js → esm2020/worktile-gantt.mjs} +0 -0
- package/fesm2015/worktile-gantt.mjs +3080 -0
- package/fesm2015/worktile-gantt.mjs.map +1 -0
- package/{fesm2015/worktile-gantt.js → fesm2020/worktile-gantt.mjs} +344 -288
- package/fesm2020/worktile-gantt.mjs.map +1 -0
- package/gantt-dom.service.d.ts +11 -4
- package/gantt-drag-container.d.ts +1 -1
- package/gantt-item-upper.d.ts +6 -6
- package/gantt-print.service.d.ts +1 -1
- package/gantt-upper.d.ts +6 -6
- package/gantt.component.d.ts +2 -4
- package/gantt.component.scss +83 -0
- package/package.json +23 -9
- package/root.component.d.ts +5 -3
- package/styles/index.scss +10 -0
- package/styles/variables.scss +46 -0
- 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
- package/bundles/worktile-gantt.umd.js +0 -3622
- package/bundles/worktile-gantt.umd.js.map +0 -1
- package/esm2015/components/bar/bar-drag.js +0 -295
- package/esm2015/components/bar/bar.component.js +0 -98
- package/esm2015/components/calendar/calendar.component.js +0 -86
- package/esm2015/components/drag-backdrop/drag-backdrop.component.js +0 -21
- package/esm2015/components/icon/icon.component.js +0 -38
- package/esm2015/components/links/lines/curve.js +0 -96
- package/esm2015/components/links/links.component.js +0 -173
- package/esm2015/components/main/gantt-main.component.js +0 -53
- package/esm2015/components/range/range.component.js +0 -37
- package/esm2015/components/table/gantt-table.component.js +0 -163
- package/esm2015/gantt-dom.service.js +0 -103
- package/esm2015/gantt-drag-container.js +0 -77
- package/esm2015/gantt-item-upper.js +0 -58
- package/esm2015/gantt-print.service.js +0 -94
- package/esm2015/gantt-upper.js +0 -331
- package/esm2015/gantt.component.js +0 -155
- package/esm2015/root.component.js +0 -123
- package/esm2015/table/gantt-column.component.js +0 -37
- package/esm2015/table/gantt-table.component.js +0 -26
- package/fesm2015/worktile-gantt.js.map +0 -1
- package/main.bundle.scss +0 -687
|
@@ -1,3622 +0,0 @@
|
|
|
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'), require('html2canvas')) :
|
|
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', 'html2canvas'], 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, global.html2canvas));
|
|
5
|
-
})(this, (function (exports, i0, i2, operators, rxjs, dateFns, collections, coercion, i1, html2canvas) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return e[k]; }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n["default"] = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
-
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
29
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
30
|
-
var html2canvas__default = /*#__PURE__*/_interopDefaultLegacy(html2canvas);
|
|
31
|
-
|
|
32
|
-
/*! *****************************************************************************
|
|
33
|
-
Copyright (c) Microsoft Corporation.
|
|
34
|
-
|
|
35
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
36
|
-
purpose with or without fee is hereby granted.
|
|
37
|
-
|
|
38
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
39
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
40
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
41
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
42
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
43
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
44
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
45
|
-
***************************************************************************** */
|
|
46
|
-
/* global Reflect, Promise */
|
|
47
|
-
var extendStatics = function (d, b) {
|
|
48
|
-
extendStatics = Object.setPrototypeOf ||
|
|
49
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
50
|
-
function (d, b) { for (var p in b)
|
|
51
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
52
|
-
d[p] = b[p]; };
|
|
53
|
-
return extendStatics(d, b);
|
|
54
|
-
};
|
|
55
|
-
function __extends(d, b) {
|
|
56
|
-
if (typeof b !== "function" && b !== null)
|
|
57
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
58
|
-
extendStatics(d, b);
|
|
59
|
-
function __() { this.constructor = d; }
|
|
60
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
61
|
-
}
|
|
62
|
-
var __assign = function () {
|
|
63
|
-
__assign = Object.assign || function __assign(t) {
|
|
64
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
65
|
-
s = arguments[i];
|
|
66
|
-
for (var p in s)
|
|
67
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
68
|
-
t[p] = s[p];
|
|
69
|
-
}
|
|
70
|
-
return t;
|
|
71
|
-
};
|
|
72
|
-
return __assign.apply(this, arguments);
|
|
73
|
-
};
|
|
74
|
-
function __rest(s, e) {
|
|
75
|
-
var t = {};
|
|
76
|
-
for (var p in s)
|
|
77
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
78
|
-
t[p] = s[p];
|
|
79
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
80
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
81
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
82
|
-
t[p[i]] = s[p[i]];
|
|
83
|
-
}
|
|
84
|
-
return t;
|
|
85
|
-
}
|
|
86
|
-
function __decorate(decorators, target, key, desc) {
|
|
87
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
88
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
89
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
90
|
-
else
|
|
91
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
92
|
-
if (d = decorators[i])
|
|
93
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
94
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
95
|
-
}
|
|
96
|
-
function __param(paramIndex, decorator) {
|
|
97
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
98
|
-
}
|
|
99
|
-
function __metadata(metadataKey, metadataValue) {
|
|
100
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
101
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
102
|
-
}
|
|
103
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
104
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
105
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
106
|
-
function fulfilled(value) { try {
|
|
107
|
-
step(generator.next(value));
|
|
108
|
-
}
|
|
109
|
-
catch (e) {
|
|
110
|
-
reject(e);
|
|
111
|
-
} }
|
|
112
|
-
function rejected(value) { try {
|
|
113
|
-
step(generator["throw"](value));
|
|
114
|
-
}
|
|
115
|
-
catch (e) {
|
|
116
|
-
reject(e);
|
|
117
|
-
} }
|
|
118
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
119
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function __generator(thisArg, body) {
|
|
123
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
124
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
125
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
126
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
127
|
-
function step(op) {
|
|
128
|
-
if (f)
|
|
129
|
-
throw new TypeError("Generator is already executing.");
|
|
130
|
-
while (_)
|
|
131
|
-
try {
|
|
132
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
133
|
-
return t;
|
|
134
|
-
if (y = 0, t)
|
|
135
|
-
op = [op[0] & 2, t.value];
|
|
136
|
-
switch (op[0]) {
|
|
137
|
-
case 0:
|
|
138
|
-
case 1:
|
|
139
|
-
t = op;
|
|
140
|
-
break;
|
|
141
|
-
case 4:
|
|
142
|
-
_.label++;
|
|
143
|
-
return { value: op[1], done: false };
|
|
144
|
-
case 5:
|
|
145
|
-
_.label++;
|
|
146
|
-
y = op[1];
|
|
147
|
-
op = [0];
|
|
148
|
-
continue;
|
|
149
|
-
case 7:
|
|
150
|
-
op = _.ops.pop();
|
|
151
|
-
_.trys.pop();
|
|
152
|
-
continue;
|
|
153
|
-
default:
|
|
154
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
155
|
-
_ = 0;
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
159
|
-
_.label = op[1];
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
163
|
-
_.label = t[1];
|
|
164
|
-
t = op;
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
if (t && _.label < t[2]) {
|
|
168
|
-
_.label = t[2];
|
|
169
|
-
_.ops.push(op);
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
if (t[2])
|
|
173
|
-
_.ops.pop();
|
|
174
|
-
_.trys.pop();
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
op = body.call(thisArg, _);
|
|
178
|
-
}
|
|
179
|
-
catch (e) {
|
|
180
|
-
op = [6, e];
|
|
181
|
-
y = 0;
|
|
182
|
-
}
|
|
183
|
-
finally {
|
|
184
|
-
f = t = 0;
|
|
185
|
-
}
|
|
186
|
-
if (op[0] & 5)
|
|
187
|
-
throw op[1];
|
|
188
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
192
|
-
if (k2 === undefined)
|
|
193
|
-
k2 = k;
|
|
194
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
195
|
-
}) : (function (o, m, k, k2) {
|
|
196
|
-
if (k2 === undefined)
|
|
197
|
-
k2 = k;
|
|
198
|
-
o[k2] = m[k];
|
|
199
|
-
});
|
|
200
|
-
function __exportStar(m, o) {
|
|
201
|
-
for (var p in m)
|
|
202
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
203
|
-
__createBinding(o, m, p);
|
|
204
|
-
}
|
|
205
|
-
function __values(o) {
|
|
206
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
207
|
-
if (m)
|
|
208
|
-
return m.call(o);
|
|
209
|
-
if (o && typeof o.length === "number")
|
|
210
|
-
return {
|
|
211
|
-
next: function () {
|
|
212
|
-
if (o && i >= o.length)
|
|
213
|
-
o = void 0;
|
|
214
|
-
return { value: o && o[i++], done: !o };
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
218
|
-
}
|
|
219
|
-
function __read(o, n) {
|
|
220
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
221
|
-
if (!m)
|
|
222
|
-
return o;
|
|
223
|
-
var i = m.call(o), r, ar = [], e;
|
|
224
|
-
try {
|
|
225
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
226
|
-
ar.push(r.value);
|
|
227
|
-
}
|
|
228
|
-
catch (error) {
|
|
229
|
-
e = { error: error };
|
|
230
|
-
}
|
|
231
|
-
finally {
|
|
232
|
-
try {
|
|
233
|
-
if (r && !r.done && (m = i["return"]))
|
|
234
|
-
m.call(i);
|
|
235
|
-
}
|
|
236
|
-
finally {
|
|
237
|
-
if (e)
|
|
238
|
-
throw e.error;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return ar;
|
|
242
|
-
}
|
|
243
|
-
/** @deprecated */
|
|
244
|
-
function __spread() {
|
|
245
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
246
|
-
ar = ar.concat(__read(arguments[i]));
|
|
247
|
-
return ar;
|
|
248
|
-
}
|
|
249
|
-
/** @deprecated */
|
|
250
|
-
function __spreadArrays() {
|
|
251
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
252
|
-
s += arguments[i].length;
|
|
253
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
254
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
255
|
-
r[k] = a[j];
|
|
256
|
-
return r;
|
|
257
|
-
}
|
|
258
|
-
function __spreadArray(to, from, pack) {
|
|
259
|
-
if (pack || arguments.length === 2)
|
|
260
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
261
|
-
if (ar || !(i in from)) {
|
|
262
|
-
if (!ar)
|
|
263
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
264
|
-
ar[i] = from[i];
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
268
|
-
}
|
|
269
|
-
function __await(v) {
|
|
270
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
271
|
-
}
|
|
272
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
273
|
-
if (!Symbol.asyncIterator)
|
|
274
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
275
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
276
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
277
|
-
function verb(n) { if (g[n])
|
|
278
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
279
|
-
function resume(n, v) { try {
|
|
280
|
-
step(g[n](v));
|
|
281
|
-
}
|
|
282
|
-
catch (e) {
|
|
283
|
-
settle(q[0][3], e);
|
|
284
|
-
} }
|
|
285
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
286
|
-
function fulfill(value) { resume("next", value); }
|
|
287
|
-
function reject(value) { resume("throw", value); }
|
|
288
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
289
|
-
resume(q[0][0], q[0][1]); }
|
|
290
|
-
}
|
|
291
|
-
function __asyncDelegator(o) {
|
|
292
|
-
var i, p;
|
|
293
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
294
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
295
|
-
}
|
|
296
|
-
function __asyncValues(o) {
|
|
297
|
-
if (!Symbol.asyncIterator)
|
|
298
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
299
|
-
var m = o[Symbol.asyncIterator], i;
|
|
300
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
301
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
302
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
303
|
-
}
|
|
304
|
-
function __makeTemplateObject(cooked, raw) {
|
|
305
|
-
if (Object.defineProperty) {
|
|
306
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
cooked.raw = raw;
|
|
310
|
-
}
|
|
311
|
-
return cooked;
|
|
312
|
-
}
|
|
313
|
-
;
|
|
314
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
315
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
316
|
-
}) : function (o, v) {
|
|
317
|
-
o["default"] = v;
|
|
318
|
-
};
|
|
319
|
-
function __importStar(mod) {
|
|
320
|
-
if (mod && mod.__esModule)
|
|
321
|
-
return mod;
|
|
322
|
-
var result = {};
|
|
323
|
-
if (mod != null)
|
|
324
|
-
for (var k in mod)
|
|
325
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
326
|
-
__createBinding(result, mod, k);
|
|
327
|
-
__setModuleDefault(result, mod);
|
|
328
|
-
return result;
|
|
329
|
-
}
|
|
330
|
-
function __importDefault(mod) {
|
|
331
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
332
|
-
}
|
|
333
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
334
|
-
if (kind === "a" && !f)
|
|
335
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
336
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
337
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
338
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
339
|
-
}
|
|
340
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
341
|
-
if (kind === "m")
|
|
342
|
-
throw new TypeError("Private method is not writable");
|
|
343
|
-
if (kind === "a" && !f)
|
|
344
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
345
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
346
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
347
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
var GanttDatePoint = /** @class */ (function () {
|
|
351
|
-
function GanttDatePoint(start, text, x, y, additions) {
|
|
352
|
-
this.start = start;
|
|
353
|
-
this.text = text;
|
|
354
|
-
this.x = x;
|
|
355
|
-
this.y = y;
|
|
356
|
-
this.additions = additions;
|
|
357
|
-
}
|
|
358
|
-
return GanttDatePoint;
|
|
359
|
-
}());
|
|
360
|
-
|
|
361
|
-
var GanttDragEvent = /** @class */ (function () {
|
|
362
|
-
function GanttDragEvent() {
|
|
363
|
-
}
|
|
364
|
-
return GanttDragEvent;
|
|
365
|
-
}());
|
|
366
|
-
var GanttTableEvent = /** @class */ (function () {
|
|
367
|
-
function GanttTableEvent() {
|
|
368
|
-
}
|
|
369
|
-
return GanttTableEvent;
|
|
370
|
-
}());
|
|
371
|
-
var GanttLinkDragEvent = /** @class */ (function () {
|
|
372
|
-
function GanttLinkDragEvent() {
|
|
373
|
-
}
|
|
374
|
-
return GanttLinkDragEvent;
|
|
375
|
-
}());
|
|
376
|
-
var GanttLoadOnScrollEvent = /** @class */ (function () {
|
|
377
|
-
function GanttLoadOnScrollEvent() {
|
|
378
|
-
}
|
|
379
|
-
return GanttLoadOnScrollEvent;
|
|
380
|
-
}());
|
|
381
|
-
var GanttLineClickEvent = /** @class */ (function () {
|
|
382
|
-
function GanttLineClickEvent() {
|
|
383
|
-
}
|
|
384
|
-
return GanttLineClickEvent;
|
|
385
|
-
}());
|
|
386
|
-
var GanttBarClickEvent = /** @class */ (function () {
|
|
387
|
-
function GanttBarClickEvent() {
|
|
388
|
-
}
|
|
389
|
-
return GanttBarClickEvent;
|
|
390
|
-
}());
|
|
391
|
-
var GanttSelectedEvent = /** @class */ (function () {
|
|
392
|
-
function GanttSelectedEvent() {
|
|
393
|
-
}
|
|
394
|
-
return GanttSelectedEvent;
|
|
395
|
-
}());
|
|
396
|
-
|
|
397
|
-
var GanttDate = /** @class */ (function () {
|
|
398
|
-
function GanttDate(date) {
|
|
399
|
-
if (date) {
|
|
400
|
-
if (date instanceof Date) {
|
|
401
|
-
this.value = date;
|
|
402
|
-
}
|
|
403
|
-
else if (typeof date === 'string' || typeof date === 'number') {
|
|
404
|
-
if (date.toString().length < 13) {
|
|
405
|
-
this.value = dateFns.fromUnixTime(+date);
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
this.value = new Date(date);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
else {
|
|
412
|
-
throw new Error("The input date type is not supported expect Date | string\n | number | { date: number; with_time: 0 | 1}, actual " + JSON.stringify(date));
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
this.value = new Date();
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
GanttDate.prototype.getYear = function () {
|
|
420
|
-
return this.value.getFullYear();
|
|
421
|
-
};
|
|
422
|
-
GanttDate.prototype.getMonth = function () {
|
|
423
|
-
return this.value.getMonth();
|
|
424
|
-
};
|
|
425
|
-
GanttDate.prototype.getDay = function () {
|
|
426
|
-
return this.value.getDay();
|
|
427
|
-
};
|
|
428
|
-
GanttDate.prototype.getTime = function () {
|
|
429
|
-
return this.value.getTime();
|
|
430
|
-
};
|
|
431
|
-
GanttDate.prototype.getDate = function () {
|
|
432
|
-
return this.value.getDate();
|
|
433
|
-
};
|
|
434
|
-
GanttDate.prototype.getHours = function () {
|
|
435
|
-
return this.value.getHours();
|
|
436
|
-
};
|
|
437
|
-
GanttDate.prototype.getMinutes = function () {
|
|
438
|
-
return this.value.getMinutes();
|
|
439
|
-
};
|
|
440
|
-
GanttDate.prototype.getSeconds = function () {
|
|
441
|
-
return this.value.getSeconds();
|
|
442
|
-
};
|
|
443
|
-
GanttDate.prototype.getMilliseconds = function () {
|
|
444
|
-
return this.value.getMilliseconds();
|
|
445
|
-
};
|
|
446
|
-
GanttDate.prototype.getWeek = function (options) {
|
|
447
|
-
if (options === void 0) { options = { weekStartsOn: 1 }; }
|
|
448
|
-
return dateFns.getWeek(this.value, options);
|
|
449
|
-
};
|
|
450
|
-
GanttDate.prototype.getDaysInMonth = function () {
|
|
451
|
-
return dateFns.getDaysInMonth(this.value);
|
|
452
|
-
};
|
|
453
|
-
GanttDate.prototype.getDaysInQuarter = function () {
|
|
454
|
-
return dateFns.differenceInCalendarDays(this.endOfQuarter().addSeconds(1).value, this.startOfQuarter().value);
|
|
455
|
-
};
|
|
456
|
-
GanttDate.prototype.getDaysInYear = function () {
|
|
457
|
-
return dateFns.differenceInCalendarDays(this.endOfYear().addSeconds(1).value, this.startOfYear().value);
|
|
458
|
-
};
|
|
459
|
-
GanttDate.prototype.setDate = function (dayOfMonth) {
|
|
460
|
-
return new GanttDate(dateFns.setDate(this.value, dayOfMonth));
|
|
461
|
-
};
|
|
462
|
-
GanttDate.prototype.clone = function () {
|
|
463
|
-
return new GanttDate(new Date(this.value));
|
|
464
|
-
};
|
|
465
|
-
GanttDate.prototype.add = function (amount, unit) {
|
|
466
|
-
switch (unit) {
|
|
467
|
-
case 'second':
|
|
468
|
-
return new GanttDate(this.value).addSeconds(amount);
|
|
469
|
-
case 'minute':
|
|
470
|
-
return new GanttDate(this.value).addMinutes(amount);
|
|
471
|
-
case 'hour':
|
|
472
|
-
return new GanttDate(this.value).addHours(amount);
|
|
473
|
-
case 'day':
|
|
474
|
-
return new GanttDate(this.value).addDays(amount);
|
|
475
|
-
case 'week':
|
|
476
|
-
return new GanttDate(this.value).addWeeks(amount);
|
|
477
|
-
case 'month':
|
|
478
|
-
return new GanttDate(this.value).addMonths(amount);
|
|
479
|
-
case 'quarter':
|
|
480
|
-
return new GanttDate(this.value).addQuarters(amount);
|
|
481
|
-
case 'year':
|
|
482
|
-
return new GanttDate(this.value).addYears(amount);
|
|
483
|
-
default:
|
|
484
|
-
return new GanttDate(this.value).addSeconds(amount);
|
|
485
|
-
}
|
|
486
|
-
};
|
|
487
|
-
GanttDate.prototype.addSeconds = function (amount) {
|
|
488
|
-
return new GanttDate(dateFns.addSeconds(this.value, amount));
|
|
489
|
-
};
|
|
490
|
-
GanttDate.prototype.addMinutes = function (amount) {
|
|
491
|
-
return new GanttDate(dateFns.addMinutes(this.value, amount));
|
|
492
|
-
};
|
|
493
|
-
GanttDate.prototype.addHours = function (amount) {
|
|
494
|
-
return new GanttDate(dateFns.addHours(this.value, amount));
|
|
495
|
-
};
|
|
496
|
-
GanttDate.prototype.addDays = function (amount) {
|
|
497
|
-
return new GanttDate(dateFns.addDays(this.value, amount));
|
|
498
|
-
};
|
|
499
|
-
GanttDate.prototype.addWeeks = function (amount) {
|
|
500
|
-
return new GanttDate(dateFns.addWeeks(this.value, amount));
|
|
501
|
-
};
|
|
502
|
-
GanttDate.prototype.addMonths = function (amount) {
|
|
503
|
-
return new GanttDate(dateFns.addMonths(this.value, amount));
|
|
504
|
-
};
|
|
505
|
-
GanttDate.prototype.addQuarters = function (amount) {
|
|
506
|
-
return new GanttDate(dateFns.addQuarters(this.value, amount));
|
|
507
|
-
};
|
|
508
|
-
GanttDate.prototype.addYears = function (amount) {
|
|
509
|
-
return new GanttDate(dateFns.addYears(this.value, amount));
|
|
510
|
-
};
|
|
511
|
-
GanttDate.prototype.startOfDay = function () {
|
|
512
|
-
return new GanttDate(dateFns.startOfDay(this.value));
|
|
513
|
-
};
|
|
514
|
-
GanttDate.prototype.startOfWeek = function (options) {
|
|
515
|
-
return new GanttDate(dateFns.startOfWeek(this.value, options));
|
|
516
|
-
};
|
|
517
|
-
GanttDate.prototype.startOfMonth = function () {
|
|
518
|
-
return new GanttDate(dateFns.startOfMonth(this.value));
|
|
519
|
-
};
|
|
520
|
-
GanttDate.prototype.startOfQuarter = function () {
|
|
521
|
-
return new GanttDate(dateFns.startOfQuarter(this.value));
|
|
522
|
-
};
|
|
523
|
-
GanttDate.prototype.startOfYear = function () {
|
|
524
|
-
return new GanttDate(dateFns.startOfYear(this.value));
|
|
525
|
-
};
|
|
526
|
-
GanttDate.prototype.endOfDay = function () {
|
|
527
|
-
return new GanttDate(dateFns.endOfDay(this.value));
|
|
528
|
-
};
|
|
529
|
-
GanttDate.prototype.endOfWeek = function (options) {
|
|
530
|
-
return new GanttDate(dateFns.endOfWeek(this.value, options));
|
|
531
|
-
};
|
|
532
|
-
GanttDate.prototype.endOfMonth = function () {
|
|
533
|
-
return new GanttDate(dateFns.endOfMonth(this.value));
|
|
534
|
-
};
|
|
535
|
-
GanttDate.prototype.endOfQuarter = function () {
|
|
536
|
-
return new GanttDate(dateFns.endOfQuarter(this.value));
|
|
537
|
-
};
|
|
538
|
-
GanttDate.prototype.endOfYear = function () {
|
|
539
|
-
return new GanttDate(dateFns.endOfYear(this.value));
|
|
540
|
-
};
|
|
541
|
-
GanttDate.prototype.getUnixTime = function () {
|
|
542
|
-
return dateFns.getUnixTime(this.value);
|
|
543
|
-
};
|
|
544
|
-
GanttDate.prototype.format = function (mat, options) {
|
|
545
|
-
return dateFns.format(this.value, mat, options);
|
|
546
|
-
};
|
|
547
|
-
GanttDate.prototype.isWeekend = function () {
|
|
548
|
-
return dateFns.isWeekend(this.value);
|
|
549
|
-
};
|
|
550
|
-
GanttDate.prototype.isToday = function () {
|
|
551
|
-
return dateFns.isToday(this.value);
|
|
552
|
-
};
|
|
553
|
-
return GanttDate;
|
|
554
|
-
}());
|
|
555
|
-
|
|
556
|
-
exports.GanttViewType = void 0;
|
|
557
|
-
(function (GanttViewType) {
|
|
558
|
-
GanttViewType["day"] = "day";
|
|
559
|
-
GanttViewType["quarter"] = "quarter";
|
|
560
|
-
GanttViewType["month"] = "month";
|
|
561
|
-
GanttViewType["year"] = "year";
|
|
562
|
-
GanttViewType["week"] = "week";
|
|
563
|
-
})(exports.GanttViewType || (exports.GanttViewType = {}));
|
|
564
|
-
|
|
565
|
-
exports.GanttLinkType = void 0;
|
|
566
|
-
(function (GanttLinkType) {
|
|
567
|
-
GanttLinkType[GanttLinkType["fs"] = 1] = "fs";
|
|
568
|
-
GanttLinkType[GanttLinkType["ff"] = 2] = "ff";
|
|
569
|
-
GanttLinkType[GanttLinkType["ss"] = 3] = "ss";
|
|
570
|
-
GanttLinkType[GanttLinkType["sf"] = 4] = "sf";
|
|
571
|
-
})(exports.GanttLinkType || (exports.GanttLinkType = {}));
|
|
572
|
-
exports.GanttLinkLineType = void 0;
|
|
573
|
-
(function (GanttLinkLineType) {
|
|
574
|
-
GanttLinkLineType["curve"] = "curve";
|
|
575
|
-
GanttLinkLineType["straight"] = "straight";
|
|
576
|
-
})(exports.GanttLinkLineType || (exports.GanttLinkLineType = {}));
|
|
577
|
-
exports.LinkColors = void 0;
|
|
578
|
-
(function (LinkColors) {
|
|
579
|
-
LinkColors["default"] = "#cacaca";
|
|
580
|
-
LinkColors["blocked"] = "#FF7575";
|
|
581
|
-
LinkColors["active"] = "#348FE4";
|
|
582
|
-
})(exports.LinkColors || (exports.LinkColors = {}));
|
|
583
|
-
|
|
584
|
-
exports.GanttItemType = void 0;
|
|
585
|
-
(function (GanttItemType) {
|
|
586
|
-
GanttItemType["bar"] = "bar";
|
|
587
|
-
GanttItemType["range"] = "range";
|
|
588
|
-
GanttItemType["custom"] = "custom";
|
|
589
|
-
})(exports.GanttItemType || (exports.GanttItemType = {}));
|
|
590
|
-
var GanttItemInternal = /** @class */ (function () {
|
|
591
|
-
function GanttItemInternal(item, options) {
|
|
592
|
-
var _this = this;
|
|
593
|
-
this.refs$ = new rxjs.BehaviorSubject(null);
|
|
594
|
-
this.origin = item;
|
|
595
|
-
this.id = this.origin.id;
|
|
596
|
-
this.links = (this.origin.links || []).map(function (link) {
|
|
597
|
-
if (typeof link === 'string') {
|
|
598
|
-
return {
|
|
599
|
-
type: exports.GanttLinkType.fs,
|
|
600
|
-
link: link
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
else {
|
|
604
|
-
return link;
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
this.color = this.origin.color;
|
|
608
|
-
this.barStyle = this.origin.barStyle;
|
|
609
|
-
this.linkable = this.origin.linkable === undefined ? true : this.origin.linkable;
|
|
610
|
-
this.draggable = this.origin.draggable === undefined ? true : this.origin.draggable;
|
|
611
|
-
this.expandable = this.origin.expandable || (this.origin.children || []).length > 0;
|
|
612
|
-
this.expanded = this.origin.expanded === undefined ? false : this.origin.expanded;
|
|
613
|
-
this.start = item.start ? new GanttDate(item.start) : null;
|
|
614
|
-
this.end = item.end ? new GanttDate(item.end) : null;
|
|
615
|
-
this.viewType = options && options.viewType ? options.viewType : exports.GanttViewType.month;
|
|
616
|
-
this.children = (item.children || []).map(function (subItem) {
|
|
617
|
-
return new GanttItemInternal(subItem, { viewType: _this.viewType });
|
|
618
|
-
});
|
|
619
|
-
this.type = this.origin.type || exports.GanttItemType.bar;
|
|
620
|
-
this.progress = this.origin.progress;
|
|
621
|
-
// fill one month when start or end is null
|
|
622
|
-
this.fillItemStartOrEnd(item);
|
|
623
|
-
}
|
|
624
|
-
Object.defineProperty(GanttItemInternal.prototype, "refs", {
|
|
625
|
-
get: function () {
|
|
626
|
-
return this.refs$.getValue();
|
|
627
|
-
},
|
|
628
|
-
enumerable: false,
|
|
629
|
-
configurable: true
|
|
630
|
-
});
|
|
631
|
-
GanttItemInternal.prototype.fillItemStartOrEnd = function (item) {
|
|
632
|
-
var addInterval;
|
|
633
|
-
switch (this.viewType) {
|
|
634
|
-
case exports.GanttViewType.day:
|
|
635
|
-
case exports.GanttViewType.week:
|
|
636
|
-
addInterval = 0;
|
|
637
|
-
break;
|
|
638
|
-
default:
|
|
639
|
-
addInterval = 30;
|
|
640
|
-
break;
|
|
641
|
-
}
|
|
642
|
-
if (item.start && !item.end) {
|
|
643
|
-
this.end = new GanttDate(item.start).addDays(addInterval).endOfDay();
|
|
644
|
-
}
|
|
645
|
-
if (!item.start && item.end) {
|
|
646
|
-
this.start = new GanttDate(item.end).addDays(-addInterval).startOfDay();
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
GanttItemInternal.prototype.updateRefs = function (refs) {
|
|
650
|
-
this.refs$.next(refs);
|
|
651
|
-
};
|
|
652
|
-
GanttItemInternal.prototype.updateDate = function (start, end) {
|
|
653
|
-
this.start = start.startOfDay();
|
|
654
|
-
this.end = end.endOfDay();
|
|
655
|
-
this.origin.start = this.start.getUnixTime();
|
|
656
|
-
this.origin.end = this.end.getUnixTime();
|
|
657
|
-
};
|
|
658
|
-
GanttItemInternal.prototype.addChildren = function (items) {
|
|
659
|
-
var _this = this;
|
|
660
|
-
this.origin.children = items;
|
|
661
|
-
this.children = (items || []).map(function (subItem) {
|
|
662
|
-
return new GanttItemInternal(subItem, { viewType: _this.viewType });
|
|
663
|
-
});
|
|
664
|
-
};
|
|
665
|
-
GanttItemInternal.prototype.setExpand = function (expanded) {
|
|
666
|
-
this.expanded = expanded;
|
|
667
|
-
this.origin.expanded = expanded;
|
|
668
|
-
};
|
|
669
|
-
GanttItemInternal.prototype.addLink = function (link) {
|
|
670
|
-
console.log(link);
|
|
671
|
-
this.links = __spreadArray(__spreadArray([], __read(this.links)), [link]);
|
|
672
|
-
this.origin.links = this.links;
|
|
673
|
-
};
|
|
674
|
-
return GanttItemInternal;
|
|
675
|
-
}());
|
|
676
|
-
|
|
677
|
-
var GanttGroupInternal = /** @class */ (function () {
|
|
678
|
-
function GanttGroupInternal(group) {
|
|
679
|
-
this.refs = {};
|
|
680
|
-
this.id = group.id;
|
|
681
|
-
this.origin = group;
|
|
682
|
-
this.title = group.title;
|
|
683
|
-
this.expanded = group.expanded === undefined ? true : group.expanded;
|
|
684
|
-
this.items = [];
|
|
685
|
-
this.mergedItems = [[]];
|
|
686
|
-
this.class = group.class || '';
|
|
687
|
-
}
|
|
688
|
-
GanttGroupInternal.prototype.setExpand = function (expanded) {
|
|
689
|
-
this.expanded = expanded;
|
|
690
|
-
this.origin.expanded = expanded;
|
|
691
|
-
};
|
|
692
|
-
return GanttGroupInternal;
|
|
693
|
-
}());
|
|
694
|
-
|
|
695
|
-
var defaultConfig = {
|
|
696
|
-
dateFormat: {
|
|
697
|
-
week: '第w周',
|
|
698
|
-
month: 'M月',
|
|
699
|
-
quarter: 'QQQ',
|
|
700
|
-
year: 'yyyy年',
|
|
701
|
-
yearMonth: 'yyyy年MM月',
|
|
702
|
-
yearQuarter: 'yyyy年QQQ'
|
|
703
|
-
},
|
|
704
|
-
linkOptions: {
|
|
705
|
-
dependencyTypes: [exports.GanttLinkType.fs],
|
|
706
|
-
showArrow: false,
|
|
707
|
-
lineType: exports.GanttLinkLineType.curve
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
var GANTT_GLOBAL_CONFIG = new i0.InjectionToken('GANTT_GLOBAL_CONFIG');
|
|
711
|
-
|
|
712
|
-
var primaryDatePointTop = 18;
|
|
713
|
-
var secondaryDatePointTop = 36;
|
|
714
|
-
var viewOptions$5 = {
|
|
715
|
-
min: new GanttDate().addYears(-1).startOfYear(),
|
|
716
|
-
max: new GanttDate().addYears(1).endOfYear(),
|
|
717
|
-
dateFormat: defaultConfig.dateFormat
|
|
718
|
-
};
|
|
719
|
-
var GanttView = /** @class */ (function () {
|
|
720
|
-
function GanttView(start, end, options) {
|
|
721
|
-
this.showTimeline = true;
|
|
722
|
-
this.options = Object.assign({}, viewOptions$5, options);
|
|
723
|
-
var startDate = start.isCustom
|
|
724
|
-
? this.startOf(start.date)
|
|
725
|
-
: this.startOf(start.date.value < this.options.start.value ? start.date : this.options.start);
|
|
726
|
-
var endDate = end.isCustom
|
|
727
|
-
? this.endOf(end.date)
|
|
728
|
-
: this.endOf(end.date.value > this.options.end.value ? end.date : this.options.end);
|
|
729
|
-
this.start$ = new rxjs.BehaviorSubject(startDate);
|
|
730
|
-
this.end$ = new rxjs.BehaviorSubject(endDate);
|
|
731
|
-
this.initialize();
|
|
732
|
-
}
|
|
733
|
-
Object.defineProperty(GanttView.prototype, "start", {
|
|
734
|
-
get: function () {
|
|
735
|
-
return this.start$.getValue();
|
|
736
|
-
},
|
|
737
|
-
enumerable: false,
|
|
738
|
-
configurable: true
|
|
739
|
-
});
|
|
740
|
-
Object.defineProperty(GanttView.prototype, "end", {
|
|
741
|
-
get: function () {
|
|
742
|
-
return this.end$.getValue();
|
|
743
|
-
},
|
|
744
|
-
enumerable: false,
|
|
745
|
-
configurable: true
|
|
746
|
-
});
|
|
747
|
-
GanttView.prototype.getDateIntervalWidth = function (start, end) {
|
|
748
|
-
var result = 0;
|
|
749
|
-
var days = dateFns.differenceInDays(end.value, start.value);
|
|
750
|
-
for (var i = 0; i < Math.abs(days); i++) {
|
|
751
|
-
result += this.getDayOccupancyWidth(start.addDays(i));
|
|
752
|
-
}
|
|
753
|
-
result = days >= 0 ? result : -result;
|
|
754
|
-
return Number(result.toFixed(3));
|
|
755
|
-
};
|
|
756
|
-
GanttView.prototype.initialize = function () {
|
|
757
|
-
this.primaryDatePoints = this.getPrimaryDatePoints();
|
|
758
|
-
this.secondaryDatePoints = this.getSecondaryDatePoints();
|
|
759
|
-
this.width = this.getWidth();
|
|
760
|
-
this.cellWidth = this.getCellWidth();
|
|
761
|
-
this.primaryWidth = this.getPrimaryWidth();
|
|
762
|
-
};
|
|
763
|
-
GanttView.prototype.addStartDate = function () {
|
|
764
|
-
var start = this.startOf(this.start.add(this.options.addAmount * -1, this.options.addUnit));
|
|
765
|
-
if (start.value >= this.options.min.value) {
|
|
766
|
-
var origin = this.start;
|
|
767
|
-
this.start$.next(start);
|
|
768
|
-
this.initialize();
|
|
769
|
-
return { start: this.start, end: origin };
|
|
770
|
-
}
|
|
771
|
-
return null;
|
|
772
|
-
};
|
|
773
|
-
GanttView.prototype.addEndDate = function () {
|
|
774
|
-
var end = this.endOf(this.end.add(this.options.addAmount, this.options.addUnit));
|
|
775
|
-
if (end.value <= this.options.max.value) {
|
|
776
|
-
var origin = this.end;
|
|
777
|
-
this.end$.next(end);
|
|
778
|
-
this.initialize();
|
|
779
|
-
return { start: origin, end: this.end };
|
|
780
|
-
}
|
|
781
|
-
return null;
|
|
782
|
-
};
|
|
783
|
-
GanttView.prototype.updateDate = function (start, end) {
|
|
784
|
-
start = this.startOf(start);
|
|
785
|
-
end = this.endOf(end);
|
|
786
|
-
if (start.value < this.start.value) {
|
|
787
|
-
this.start$.next(start);
|
|
788
|
-
}
|
|
789
|
-
if (end.value > this.end.value) {
|
|
790
|
-
this.end$.next(end);
|
|
791
|
-
}
|
|
792
|
-
this.initialize();
|
|
793
|
-
};
|
|
794
|
-
// 获取View的宽度
|
|
795
|
-
GanttView.prototype.getWidth = function () {
|
|
796
|
-
return this.getCellWidth() * this.secondaryDatePoints.length;
|
|
797
|
-
};
|
|
798
|
-
// 获取单个网格的宽度
|
|
799
|
-
GanttView.prototype.getCellWidth = function () {
|
|
800
|
-
return this.options.cellWidth;
|
|
801
|
-
};
|
|
802
|
-
// 获取当前时间的X坐标
|
|
803
|
-
GanttView.prototype.getTodayXPoint = function () {
|
|
804
|
-
var toady = new GanttDate().startOfDay();
|
|
805
|
-
if (toady.value > this.start.value && toady.value < this.end.value) {
|
|
806
|
-
var x = this.getXPointByDate(toady) + this.getDayOccupancyWidth(toady) / 2;
|
|
807
|
-
return x;
|
|
808
|
-
}
|
|
809
|
-
else {
|
|
810
|
-
return null;
|
|
811
|
-
}
|
|
812
|
-
};
|
|
813
|
-
// 获取指定时间的X坐标
|
|
814
|
-
GanttView.prototype.getXPointByDate = function (date) {
|
|
815
|
-
return this.getDateIntervalWidth(this.start, date);
|
|
816
|
-
};
|
|
817
|
-
// 根据X坐标获取对应时间
|
|
818
|
-
GanttView.prototype.getDateByXPoint = function (x) {
|
|
819
|
-
var indexOfSecondaryDate = Math.floor(x / this.getCellWidth());
|
|
820
|
-
var matchDate = this.secondaryDatePoints[indexOfSecondaryDate];
|
|
821
|
-
var dayWidth = this.getDayOccupancyWidth(matchDate === null || matchDate === void 0 ? void 0 : matchDate.start);
|
|
822
|
-
if (dayWidth === this.getCellWidth()) {
|
|
823
|
-
return matchDate === null || matchDate === void 0 ? void 0 : matchDate.start;
|
|
824
|
-
}
|
|
825
|
-
else {
|
|
826
|
-
var day = Math.floor((x % this.getCellWidth()) / dayWidth) + 1;
|
|
827
|
-
if (this.getCellWidth() / dayWidth === 7) {
|
|
828
|
-
return matchDate === null || matchDate === void 0 ? void 0 : matchDate.start.addDays(day);
|
|
829
|
-
}
|
|
830
|
-
return matchDate === null || matchDate === void 0 ? void 0 : matchDate.start.setDate(day);
|
|
831
|
-
}
|
|
832
|
-
};
|
|
833
|
-
// 获取指定时间范围的宽度
|
|
834
|
-
GanttView.prototype.getDateRangeWidth = function (start, end) {
|
|
835
|
-
// addSeconds(1) 是因为计算相差天会以一个整天来计算 end时间一般是59分59秒不是一个整天,所以需要加1
|
|
836
|
-
return this.getDateIntervalWidth(start, end.addSeconds(1));
|
|
837
|
-
};
|
|
838
|
-
return GanttView;
|
|
839
|
-
}());
|
|
840
|
-
|
|
841
|
-
var viewOptions$4 = {
|
|
842
|
-
start: new GanttDate().startOfQuarter().addQuarters(-1),
|
|
843
|
-
end: new GanttDate().endOfQuarter().addQuarters(2),
|
|
844
|
-
cellWidth: 280,
|
|
845
|
-
addAmount: 1,
|
|
846
|
-
addUnit: 'quarter'
|
|
847
|
-
};
|
|
848
|
-
var GanttViewMonth = /** @class */ (function (_super) {
|
|
849
|
-
__extends(GanttViewMonth, _super);
|
|
850
|
-
function GanttViewMonth(start, end, options) {
|
|
851
|
-
return _super.call(this, start, end, Object.assign({}, viewOptions$4, options)) || this;
|
|
852
|
-
}
|
|
853
|
-
GanttViewMonth.prototype.startOf = function (date) {
|
|
854
|
-
return date.startOfQuarter();
|
|
855
|
-
};
|
|
856
|
-
GanttViewMonth.prototype.endOf = function (date) {
|
|
857
|
-
return date.endOfQuarter();
|
|
858
|
-
};
|
|
859
|
-
GanttViewMonth.prototype.getPrimaryWidth = function () {
|
|
860
|
-
return this.getCellWidth() * 3;
|
|
861
|
-
};
|
|
862
|
-
GanttViewMonth.prototype.getDayOccupancyWidth = function (date) {
|
|
863
|
-
return this.cellWidth / date.getDaysInMonth();
|
|
864
|
-
};
|
|
865
|
-
GanttViewMonth.prototype.getPrimaryDatePoints = function () {
|
|
866
|
-
var quarters = dateFns.differenceInCalendarQuarters(this.end.addSeconds(1).value, this.start.value);
|
|
867
|
-
var points = [];
|
|
868
|
-
for (var i = 0; i < quarters; i++) {
|
|
869
|
-
var start = this.start.addQuarters(i);
|
|
870
|
-
var point = new GanttDatePoint(start, start.format(this.options.dateFormat.yearQuarter), (this.getCellWidth() * 3) / 2 + i * (this.getCellWidth() * 3), primaryDatePointTop);
|
|
871
|
-
points.push(point);
|
|
872
|
-
}
|
|
873
|
-
return points;
|
|
874
|
-
};
|
|
875
|
-
GanttViewMonth.prototype.getSecondaryDatePoints = function () {
|
|
876
|
-
var months = dateFns.eachMonthOfInterval({ start: this.start.value, end: this.end.value });
|
|
877
|
-
var points = [];
|
|
878
|
-
for (var i = 0; i < months.length; i++) {
|
|
879
|
-
var start = new GanttDate(months[i]);
|
|
880
|
-
var point = new GanttDatePoint(start, start.format(this.options.dateFormat.month), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
881
|
-
points.push(point);
|
|
882
|
-
}
|
|
883
|
-
return points;
|
|
884
|
-
};
|
|
885
|
-
return GanttViewMonth;
|
|
886
|
-
}(GanttView));
|
|
887
|
-
|
|
888
|
-
var viewOptions$3 = {
|
|
889
|
-
start: new GanttDate().addYears(-1).startOfYear(),
|
|
890
|
-
end: new GanttDate().addYears(1).endOfYear(),
|
|
891
|
-
min: new GanttDate().addYears(-2).startOfYear(),
|
|
892
|
-
max: new GanttDate().addYears(2).endOfYear(),
|
|
893
|
-
cellWidth: 500,
|
|
894
|
-
addAmount: 1,
|
|
895
|
-
addUnit: 'year'
|
|
896
|
-
};
|
|
897
|
-
var GanttViewQuarter = /** @class */ (function (_super) {
|
|
898
|
-
__extends(GanttViewQuarter, _super);
|
|
899
|
-
function GanttViewQuarter(start, end, options) {
|
|
900
|
-
return _super.call(this, start, end, Object.assign({}, viewOptions$3, options)) || this;
|
|
901
|
-
}
|
|
902
|
-
GanttViewQuarter.prototype.startOf = function (date) {
|
|
903
|
-
return date.startOfYear();
|
|
904
|
-
};
|
|
905
|
-
GanttViewQuarter.prototype.endOf = function (date) {
|
|
906
|
-
return date.endOfYear();
|
|
907
|
-
};
|
|
908
|
-
GanttViewQuarter.prototype.getPrimaryWidth = function () {
|
|
909
|
-
return this.getCellWidth() * 4;
|
|
910
|
-
};
|
|
911
|
-
GanttViewQuarter.prototype.getDayOccupancyWidth = function (date) {
|
|
912
|
-
return this.cellWidth / date.getDaysInQuarter();
|
|
913
|
-
};
|
|
914
|
-
GanttViewQuarter.prototype.getPrimaryDatePoints = function () {
|
|
915
|
-
var years = dateFns.eachYearOfInterval({ start: this.start.value, end: this.end.value });
|
|
916
|
-
var points = [];
|
|
917
|
-
for (var i = 0; i < years.length; i++) {
|
|
918
|
-
var start = new GanttDate(years[i]);
|
|
919
|
-
var point = new GanttDatePoint(start, "" + start.format(this.options.dateFormat.year), (this.getCellWidth() * 4) / 2 + i * (this.getCellWidth() * 4), primaryDatePointTop);
|
|
920
|
-
points.push(point);
|
|
921
|
-
}
|
|
922
|
-
return points;
|
|
923
|
-
};
|
|
924
|
-
GanttViewQuarter.prototype.getSecondaryDatePoints = function () {
|
|
925
|
-
var quarters = dateFns.differenceInCalendarQuarters(this.end.value, this.start.value);
|
|
926
|
-
var points = [];
|
|
927
|
-
for (var i = 0; i <= quarters; i++) {
|
|
928
|
-
var start = this.start.addQuarters(i);
|
|
929
|
-
var point = new GanttDatePoint(start, start.format(this.options.dateFormat.quarter), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
930
|
-
points.push(point);
|
|
931
|
-
}
|
|
932
|
-
return points;
|
|
933
|
-
};
|
|
934
|
-
return GanttViewQuarter;
|
|
935
|
-
}(GanttView));
|
|
936
|
-
|
|
937
|
-
var viewOptions$2 = {
|
|
938
|
-
cellWidth: 35,
|
|
939
|
-
start: new GanttDate().startOfYear().startOfWeek({ weekStartsOn: 1 }),
|
|
940
|
-
end: new GanttDate().endOfYear().endOfWeek({ weekStartsOn: 1 }),
|
|
941
|
-
addAmount: 1,
|
|
942
|
-
addUnit: 'month'
|
|
943
|
-
};
|
|
944
|
-
var GanttViewDay = /** @class */ (function (_super) {
|
|
945
|
-
__extends(GanttViewDay, _super);
|
|
946
|
-
function GanttViewDay(start, end, options) {
|
|
947
|
-
var _this = _super.call(this, start, end, Object.assign({}, viewOptions$2, options)) || this;
|
|
948
|
-
_this.showWeekBackdrop = true;
|
|
949
|
-
_this.showTimeline = false;
|
|
950
|
-
return _this;
|
|
951
|
-
}
|
|
952
|
-
GanttViewDay.prototype.startOf = function (date) {
|
|
953
|
-
return date.startOfWeek({ weekStartsOn: 1 });
|
|
954
|
-
};
|
|
955
|
-
GanttViewDay.prototype.endOf = function (date) {
|
|
956
|
-
return date.endOfWeek({ weekStartsOn: 1 });
|
|
957
|
-
};
|
|
958
|
-
GanttViewDay.prototype.getPrimaryWidth = function () {
|
|
959
|
-
return this.getCellWidth() * 7;
|
|
960
|
-
};
|
|
961
|
-
GanttViewDay.prototype.getDayOccupancyWidth = function () {
|
|
962
|
-
return this.cellWidth;
|
|
963
|
-
};
|
|
964
|
-
GanttViewDay.prototype.getPrimaryDatePoints = function () {
|
|
965
|
-
var weeks = dateFns.eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value }, { weekStartsOn: 1 });
|
|
966
|
-
var points = [];
|
|
967
|
-
for (var i = 0; i < weeks.length; i++) {
|
|
968
|
-
var weekStart = new GanttDate(weeks[i]);
|
|
969
|
-
var increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
970
|
-
var point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat.yearMonth), (this.getCellWidth() * 7) / 2 + i * (this.getCellWidth() * 7), primaryDatePointTop);
|
|
971
|
-
points.push(point);
|
|
972
|
-
}
|
|
973
|
-
return points;
|
|
974
|
-
};
|
|
975
|
-
GanttViewDay.prototype.getSecondaryDatePoints = function () {
|
|
976
|
-
var days = dateFns.eachDayOfInterval({ start: this.start.value, end: this.end.value });
|
|
977
|
-
var points = [];
|
|
978
|
-
for (var i = 0; i < days.length; i++) {
|
|
979
|
-
var start = new GanttDate(days[i]);
|
|
980
|
-
var point = new GanttDatePoint(start, start.getDate().toString(), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop, {
|
|
981
|
-
isWeekend: start.isWeekend(),
|
|
982
|
-
isToday: start.isToday()
|
|
983
|
-
});
|
|
984
|
-
points.push(point);
|
|
985
|
-
}
|
|
986
|
-
return points;
|
|
987
|
-
};
|
|
988
|
-
return GanttViewDay;
|
|
989
|
-
}(GanttView));
|
|
990
|
-
|
|
991
|
-
var viewOptions$1 = {
|
|
992
|
-
cellWidth: 280,
|
|
993
|
-
start: new GanttDate().startOfYear().startOfWeek({ weekStartsOn: 1 }),
|
|
994
|
-
end: new GanttDate().endOfYear().endOfWeek({ weekStartsOn: 1 }),
|
|
995
|
-
addAmount: 1,
|
|
996
|
-
addUnit: 'month'
|
|
997
|
-
};
|
|
998
|
-
var GanttViewWeek = /** @class */ (function (_super) {
|
|
999
|
-
__extends(GanttViewWeek, _super);
|
|
1000
|
-
function GanttViewWeek(start, end, options) {
|
|
1001
|
-
return _super.call(this, start, end, Object.assign({}, viewOptions$1, options)) || this;
|
|
1002
|
-
}
|
|
1003
|
-
GanttViewWeek.prototype.startOf = function (date) {
|
|
1004
|
-
return date.startOfWeek({ weekStartsOn: 1 });
|
|
1005
|
-
};
|
|
1006
|
-
GanttViewWeek.prototype.endOf = function (date) {
|
|
1007
|
-
return date.endOfWeek({ weekStartsOn: 1 });
|
|
1008
|
-
};
|
|
1009
|
-
GanttViewWeek.prototype.getPrimaryWidth = function () {
|
|
1010
|
-
return this.getCellWidth();
|
|
1011
|
-
};
|
|
1012
|
-
GanttViewWeek.prototype.getDayOccupancyWidth = function () {
|
|
1013
|
-
return this.cellWidth / 7;
|
|
1014
|
-
};
|
|
1015
|
-
GanttViewWeek.prototype.getPrimaryDatePoints = function () {
|
|
1016
|
-
var weeks = dateFns.eachWeekOfInterval({ start: this.start.value, end: this.end.addSeconds(1).value }, { weekStartsOn: 1 });
|
|
1017
|
-
var points = [];
|
|
1018
|
-
for (var i = 0; i < weeks.length; i++) {
|
|
1019
|
-
var weekStart = new GanttDate(weeks[i]);
|
|
1020
|
-
var increaseWeek = weekStart.getDaysInMonth() - weekStart.getDate() >= 3 ? 0 : 1;
|
|
1021
|
-
var point = new GanttDatePoint(weekStart, weekStart.addWeeks(increaseWeek).format(this.options.dateFormat.year), this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
1022
|
-
points.push(point);
|
|
1023
|
-
}
|
|
1024
|
-
return points;
|
|
1025
|
-
};
|
|
1026
|
-
GanttViewWeek.prototype.getSecondaryDatePoints = function () {
|
|
1027
|
-
var weeks = dateFns.eachWeekOfInterval({ start: this.start.value, end: this.end.value });
|
|
1028
|
-
var points = [];
|
|
1029
|
-
for (var i = 0; i < weeks.length; i++) {
|
|
1030
|
-
var start = new GanttDate(weeks[i]);
|
|
1031
|
-
var point = new GanttDatePoint(start, "" + start.format(this.options.dateFormat.week), i * this.getCellWidth() + this.getCellWidth() / 2, secondaryDatePointTop);
|
|
1032
|
-
points.push(point);
|
|
1033
|
-
}
|
|
1034
|
-
return points;
|
|
1035
|
-
};
|
|
1036
|
-
return GanttViewWeek;
|
|
1037
|
-
}(GanttView));
|
|
1038
|
-
|
|
1039
|
-
var viewOptions = {
|
|
1040
|
-
cellWidth: 480,
|
|
1041
|
-
start: new GanttDate().addYears(-2).startOfYear(),
|
|
1042
|
-
end: new GanttDate().addYears(2).endOfYear(),
|
|
1043
|
-
addAmount: 1,
|
|
1044
|
-
addUnit: 'year'
|
|
1045
|
-
};
|
|
1046
|
-
var GanttViewYear = /** @class */ (function (_super) {
|
|
1047
|
-
__extends(GanttViewYear, _super);
|
|
1048
|
-
function GanttViewYear(start, end, options) {
|
|
1049
|
-
return _super.call(this, start, end, Object.assign({}, viewOptions, options)) || this;
|
|
1050
|
-
}
|
|
1051
|
-
GanttViewYear.prototype.startOf = function (date) {
|
|
1052
|
-
return date.startOfYear();
|
|
1053
|
-
};
|
|
1054
|
-
GanttViewYear.prototype.endOf = function (date) {
|
|
1055
|
-
return date.endOfYear();
|
|
1056
|
-
};
|
|
1057
|
-
GanttViewYear.prototype.getPrimaryWidth = function () {
|
|
1058
|
-
return this.getCellWidth();
|
|
1059
|
-
};
|
|
1060
|
-
GanttViewYear.prototype.getDayOccupancyWidth = function (date) {
|
|
1061
|
-
return this.cellWidth / date.getDaysInYear();
|
|
1062
|
-
};
|
|
1063
|
-
GanttViewYear.prototype.getPrimaryDatePoints = function () {
|
|
1064
|
-
var years = dateFns.eachYearOfInterval({ start: this.start.value, end: this.end.value });
|
|
1065
|
-
var points = [];
|
|
1066
|
-
for (var i = 0; i < years.length; i++) {
|
|
1067
|
-
var start = new GanttDate(years[i]);
|
|
1068
|
-
var point = new GanttDatePoint(start, "", this.getCellWidth() / 2 + i * this.getCellWidth(), primaryDatePointTop);
|
|
1069
|
-
points.push(point);
|
|
1070
|
-
}
|
|
1071
|
-
return points;
|
|
1072
|
-
};
|
|
1073
|
-
GanttViewYear.prototype.getSecondaryDatePoints = function () {
|
|
1074
|
-
var years = dateFns.differenceInCalendarYears(this.end.value, this.start.value);
|
|
1075
|
-
var points = [];
|
|
1076
|
-
var pointTop = 27;
|
|
1077
|
-
for (var i = 0; i <= years; i++) {
|
|
1078
|
-
var start = this.start.addYears(i);
|
|
1079
|
-
var point = new GanttDatePoint(start, "" + start.format(this.options.dateFormat.year), i * this.getCellWidth() + this.getCellWidth() / 2, pointTop);
|
|
1080
|
-
points.push(point);
|
|
1081
|
-
}
|
|
1082
|
-
return points;
|
|
1083
|
-
};
|
|
1084
|
-
return GanttViewYear;
|
|
1085
|
-
}(GanttView));
|
|
1086
|
-
|
|
1087
|
-
function createViewFactory(type, start, end, options) {
|
|
1088
|
-
switch (type) {
|
|
1089
|
-
case exports.GanttViewType.month:
|
|
1090
|
-
return new GanttViewMonth(start, end, options);
|
|
1091
|
-
case exports.GanttViewType.week:
|
|
1092
|
-
return new GanttViewWeek(start, end, options);
|
|
1093
|
-
case exports.GanttViewType.quarter:
|
|
1094
|
-
return new GanttViewQuarter(start, end, options);
|
|
1095
|
-
case exports.GanttViewType.day:
|
|
1096
|
-
return new GanttViewDay(start, end, options);
|
|
1097
|
-
case exports.GanttViewType.year:
|
|
1098
|
-
return new GanttViewYear(start, end, options);
|
|
1099
|
-
default:
|
|
1100
|
-
throw new Error('gantt view type invalid');
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
var defaultStyles = {
|
|
1105
|
-
lineHeight: 44,
|
|
1106
|
-
barHeight: 22
|
|
1107
|
-
};
|
|
1108
|
-
var headerHeight = 44;
|
|
1109
|
-
var sideWidth = 400;
|
|
1110
|
-
var sideMiddleWidth = 500;
|
|
1111
|
-
var sideMaxWidth = 600;
|
|
1112
|
-
var sideMinWidth = 400;
|
|
1113
|
-
var barBackground = '#348fe4';
|
|
1114
|
-
var rangeHeight = 17;
|
|
1115
|
-
var todayHeight = 24;
|
|
1116
|
-
var todayWidth = 35;
|
|
1117
|
-
var todayBorderRadius = 4;
|
|
1118
|
-
|
|
1119
|
-
function isNumber(value) {
|
|
1120
|
-
return typeof value === 'number';
|
|
1121
|
-
}
|
|
1122
|
-
function isString(value) {
|
|
1123
|
-
return typeof value === 'string';
|
|
1124
|
-
}
|
|
1125
|
-
function isUndefined(value) {
|
|
1126
|
-
return value === undefined;
|
|
1127
|
-
}
|
|
1128
|
-
function hexToRgb(color, opacity) {
|
|
1129
|
-
if (opacity === void 0) { opacity = 1; }
|
|
1130
|
-
if (/^#/g.test(color)) {
|
|
1131
|
-
return "rgba(" + parseInt(color.slice(1, 3), 16) + "," + parseInt(color.slice(3, 5), 16) + "," + parseInt(color.slice(5, 7), 16) + "," + opacity + ")";
|
|
1132
|
-
}
|
|
1133
|
-
else {
|
|
1134
|
-
return color;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
function uniqBy(array, key) {
|
|
1138
|
-
var valuesMap = {};
|
|
1139
|
-
var result = [];
|
|
1140
|
-
(array || []).forEach(function (value) {
|
|
1141
|
-
var _key = value[key];
|
|
1142
|
-
if (!valuesMap[_key]) {
|
|
1143
|
-
valuesMap[_key] = value;
|
|
1144
|
-
result.push(value);
|
|
1145
|
-
}
|
|
1146
|
-
});
|
|
1147
|
-
return result;
|
|
1148
|
-
}
|
|
1149
|
-
function flatten(array) {
|
|
1150
|
-
return array.reduce(function (pre, cur) {
|
|
1151
|
-
return pre.concat(Array.isArray(cur) ? flatten(cur) : cur);
|
|
1152
|
-
}, []);
|
|
1153
|
-
}
|
|
1154
|
-
function recursiveItems(items) {
|
|
1155
|
-
var result = [];
|
|
1156
|
-
(items || []).forEach(function (item) {
|
|
1157
|
-
result.push(item);
|
|
1158
|
-
if (item.expanded && item.children) {
|
|
1159
|
-
result.push.apply(result, __spreadArray([], __read(recursiveItems(item.children))));
|
|
1160
|
-
}
|
|
1161
|
-
});
|
|
1162
|
-
return result;
|
|
1163
|
-
}
|
|
1164
|
-
function getFlatItems(items) {
|
|
1165
|
-
var result = [];
|
|
1166
|
-
(items || []).forEach(function (item) {
|
|
1167
|
-
result.push(item);
|
|
1168
|
-
if (item.children) {
|
|
1169
|
-
result.push.apply(result, __spreadArray([], __read(getFlatItems(item.children))));
|
|
1170
|
-
}
|
|
1171
|
-
});
|
|
1172
|
-
return result;
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
var GanttUpper = /** @class */ (function () {
|
|
1176
|
-
function GanttUpper(elementRef, cdr, ngZone, config) {
|
|
1177
|
-
this.elementRef = elementRef;
|
|
1178
|
-
this.cdr = cdr;
|
|
1179
|
-
this.ngZone = ngZone;
|
|
1180
|
-
this.config = config;
|
|
1181
|
-
this.originItems = [];
|
|
1182
|
-
this.originGroups = [];
|
|
1183
|
-
this.viewType = exports.GanttViewType.month;
|
|
1184
|
-
this.showTodayLine = true;
|
|
1185
|
-
this.viewOptions = {};
|
|
1186
|
-
this.loadOnScroll = new i0.EventEmitter();
|
|
1187
|
-
this.dragStarted = new i0.EventEmitter();
|
|
1188
|
-
this.dragMoved = new i0.EventEmitter();
|
|
1189
|
-
this.dragEnded = new i0.EventEmitter();
|
|
1190
|
-
this.barClick = new i0.EventEmitter();
|
|
1191
|
-
this.linkDragEnded = new i0.EventEmitter();
|
|
1192
|
-
this.items = [];
|
|
1193
|
-
this.groups = [];
|
|
1194
|
-
this.viewChange = new i0.EventEmitter();
|
|
1195
|
-
this.expandChange = new i0.EventEmitter();
|
|
1196
|
-
this.firstChange = true;
|
|
1197
|
-
this.unsubscribe$ = new rxjs.Subject();
|
|
1198
|
-
this._selectable = false;
|
|
1199
|
-
this._multiple = false;
|
|
1200
|
-
this.ganttClass = true;
|
|
1201
|
-
}
|
|
1202
|
-
Object.defineProperty(GanttUpper.prototype, "linkOptions", {
|
|
1203
|
-
get: function () {
|
|
1204
|
-
return Object.assign({}, defaultConfig.linkOptions, this.config.linkOptions, this._linkOptions);
|
|
1205
|
-
},
|
|
1206
|
-
set: function (options) {
|
|
1207
|
-
this._linkOptions = options;
|
|
1208
|
-
},
|
|
1209
|
-
enumerable: false,
|
|
1210
|
-
configurable: true
|
|
1211
|
-
});
|
|
1212
|
-
Object.defineProperty(GanttUpper.prototype, "selectable", {
|
|
1213
|
-
get: function () {
|
|
1214
|
-
return this._selectable;
|
|
1215
|
-
},
|
|
1216
|
-
set: function (value) {
|
|
1217
|
-
var _a;
|
|
1218
|
-
this._selectable = coercion.coerceBooleanProperty(value);
|
|
1219
|
-
if (this._selectable) {
|
|
1220
|
-
this.selectionModel = this.initSelectionModel();
|
|
1221
|
-
}
|
|
1222
|
-
else {
|
|
1223
|
-
(_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.clear();
|
|
1224
|
-
}
|
|
1225
|
-
},
|
|
1226
|
-
enumerable: false,
|
|
1227
|
-
configurable: true
|
|
1228
|
-
});
|
|
1229
|
-
Object.defineProperty(GanttUpper.prototype, "multiple", {
|
|
1230
|
-
get: function () {
|
|
1231
|
-
return this._multiple;
|
|
1232
|
-
},
|
|
1233
|
-
set: function (value) {
|
|
1234
|
-
this._multiple = coercion.coerceBooleanProperty(value);
|
|
1235
|
-
if (this.selectable) {
|
|
1236
|
-
this.selectionModel = this.initSelectionModel();
|
|
1237
|
-
}
|
|
1238
|
-
},
|
|
1239
|
-
enumerable: false,
|
|
1240
|
-
configurable: true
|
|
1241
|
-
});
|
|
1242
|
-
Object.defineProperty(GanttUpper.prototype, "element", {
|
|
1243
|
-
get: function () {
|
|
1244
|
-
return this.elementRef.nativeElement;
|
|
1245
|
-
},
|
|
1246
|
-
enumerable: false,
|
|
1247
|
-
configurable: true
|
|
1248
|
-
});
|
|
1249
|
-
GanttUpper.prototype.createView = function () {
|
|
1250
|
-
var viewDate = this.getViewDate();
|
|
1251
|
-
this.view = createViewFactory(this.viewType, viewDate.start, viewDate.end, this.viewOptions);
|
|
1252
|
-
};
|
|
1253
|
-
GanttUpper.prototype.setupGroups = function () {
|
|
1254
|
-
var _this = this;
|
|
1255
|
-
var collapsedIds = this.groups.filter(function (group) { return group.expanded === false; }).map(function (group) { return group.id; });
|
|
1256
|
-
this.groupsMap = {};
|
|
1257
|
-
this.groups = [];
|
|
1258
|
-
this.originGroups.forEach(function (origin) {
|
|
1259
|
-
var group = new GanttGroupInternal(origin);
|
|
1260
|
-
group.expanded = !collapsedIds.includes(group.id);
|
|
1261
|
-
_this.groupsMap[group.id] = group;
|
|
1262
|
-
_this.groups.push(group);
|
|
1263
|
-
});
|
|
1264
|
-
};
|
|
1265
|
-
GanttUpper.prototype.setupItems = function () {
|
|
1266
|
-
var _this = this;
|
|
1267
|
-
this.originItems = uniqBy(this.originItems, 'id');
|
|
1268
|
-
this.items = [];
|
|
1269
|
-
if (this.groups.length > 0) {
|
|
1270
|
-
this.originItems.forEach(function (origin) {
|
|
1271
|
-
var group = _this.groupsMap[origin.group_id];
|
|
1272
|
-
if (group) {
|
|
1273
|
-
var item = new GanttItemInternal(origin, { viewType: _this.viewType });
|
|
1274
|
-
group.items.push(item);
|
|
1275
|
-
}
|
|
1276
|
-
});
|
|
1277
|
-
}
|
|
1278
|
-
else {
|
|
1279
|
-
this.originItems.forEach(function (origin) {
|
|
1280
|
-
var item = new GanttItemInternal(origin, { viewType: _this.viewType });
|
|
1281
|
-
_this.items.push(item);
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
};
|
|
1285
|
-
GanttUpper.prototype.setupExpandedState = function () {
|
|
1286
|
-
this.originItems = uniqBy(this.originItems, 'id');
|
|
1287
|
-
var items = [];
|
|
1288
|
-
var flatOriginItems = getFlatItems(this.originItems);
|
|
1289
|
-
if (this.items.length > 0) {
|
|
1290
|
-
items = recursiveItems(this.items);
|
|
1291
|
-
}
|
|
1292
|
-
else {
|
|
1293
|
-
items = flatten(this.groups.map(function (group) { return recursiveItems(group.items); }));
|
|
1294
|
-
}
|
|
1295
|
-
items.forEach(function (item) {
|
|
1296
|
-
if (item.origin.expanded) {
|
|
1297
|
-
var newItem = flatOriginItems.find(function (originItem) { return originItem.id === item.id; });
|
|
1298
|
-
if (newItem) {
|
|
1299
|
-
if (newItem.expanded === undefined) {
|
|
1300
|
-
newItem.expanded = true;
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
});
|
|
1305
|
-
};
|
|
1306
|
-
GanttUpper.prototype.getViewDate = function () {
|
|
1307
|
-
var _this = this;
|
|
1308
|
-
var start = this.start;
|
|
1309
|
-
var end = this.end;
|
|
1310
|
-
if (!this.start || !this.end) {
|
|
1311
|
-
this.originItems.forEach(function (item) {
|
|
1312
|
-
if (item.start && !_this.start) {
|
|
1313
|
-
start = start ? Math.min(start, item.start) : item.start;
|
|
1314
|
-
}
|
|
1315
|
-
if (item.end && !_this.end) {
|
|
1316
|
-
end = end ? Math.max(end, item.end) : item.end;
|
|
1317
|
-
}
|
|
1318
|
-
});
|
|
1319
|
-
}
|
|
1320
|
-
return {
|
|
1321
|
-
start: {
|
|
1322
|
-
date: new GanttDate(start),
|
|
1323
|
-
isCustom: this.start ? true : false
|
|
1324
|
-
},
|
|
1325
|
-
end: {
|
|
1326
|
-
date: new GanttDate(end),
|
|
1327
|
-
isCustom: this.end ? true : false
|
|
1328
|
-
}
|
|
1329
|
-
};
|
|
1330
|
-
};
|
|
1331
|
-
GanttUpper.prototype.computeRefs = function () {
|
|
1332
|
-
var _this = this;
|
|
1333
|
-
this.groups.forEach(function (group) {
|
|
1334
|
-
var groupItems = recursiveItems(group.items);
|
|
1335
|
-
_this.computeItemsRefs.apply(_this, __spreadArray([], __read(groupItems)));
|
|
1336
|
-
});
|
|
1337
|
-
var items = recursiveItems(this.items);
|
|
1338
|
-
this.computeItemsRefs.apply(this, __spreadArray([], __read(items)));
|
|
1339
|
-
};
|
|
1340
|
-
GanttUpper.prototype.expandGroups = function (expanded) {
|
|
1341
|
-
this.groups.forEach(function (group) {
|
|
1342
|
-
group.setExpand(expanded);
|
|
1343
|
-
});
|
|
1344
|
-
this.expandChange.next();
|
|
1345
|
-
this.cdr.detectChanges();
|
|
1346
|
-
};
|
|
1347
|
-
GanttUpper.prototype.initSelectionModel = function () {
|
|
1348
|
-
return new collections.SelectionModel(this.multiple, []);
|
|
1349
|
-
};
|
|
1350
|
-
GanttUpper.prototype.onInit = function () {
|
|
1351
|
-
var _this = this;
|
|
1352
|
-
this.styles = Object.assign({}, defaultStyles, this.styles);
|
|
1353
|
-
this.viewOptions.dateFormat = Object.assign({}, defaultConfig.dateFormat, this.config.dateFormat, this.viewOptions.dateFormat);
|
|
1354
|
-
this.createView();
|
|
1355
|
-
this.setupGroups();
|
|
1356
|
-
this.setupItems();
|
|
1357
|
-
this.computeRefs();
|
|
1358
|
-
this.initSelectionModel();
|
|
1359
|
-
this.firstChange = false;
|
|
1360
|
-
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
1361
|
-
_this.element.style.opacity = '1';
|
|
1362
|
-
_this.dragContainer.dragStarted.subscribe(function (event) {
|
|
1363
|
-
_this.dragStarted.emit(event);
|
|
1364
|
-
});
|
|
1365
|
-
_this.dragContainer.dragMoved.subscribe(function (event) {
|
|
1366
|
-
_this.dragMoved.emit(event);
|
|
1367
|
-
});
|
|
1368
|
-
_this.dragContainer.dragEnded.subscribe(function (event) {
|
|
1369
|
-
_this.dragEnded.emit(event);
|
|
1370
|
-
_this.computeRefs();
|
|
1371
|
-
_this.detectChanges();
|
|
1372
|
-
});
|
|
1373
|
-
});
|
|
1374
|
-
this.view.start$.pipe(operators.skip(1), operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
1375
|
-
_this.computeRefs();
|
|
1376
|
-
});
|
|
1377
|
-
};
|
|
1378
|
-
GanttUpper.prototype.onChanges = function (changes) {
|
|
1379
|
-
if (!this.firstChange) {
|
|
1380
|
-
if (changes.viewType && changes.viewType.currentValue) {
|
|
1381
|
-
this.createView();
|
|
1382
|
-
this.setupGroups();
|
|
1383
|
-
this.setupItems();
|
|
1384
|
-
this.computeRefs();
|
|
1385
|
-
this.viewChange.emit(this.view);
|
|
1386
|
-
}
|
|
1387
|
-
if (changes.originItems || changes.originGroups) {
|
|
1388
|
-
this.setupExpandedState();
|
|
1389
|
-
this.setupGroups();
|
|
1390
|
-
this.setupItems();
|
|
1391
|
-
this.computeRefs();
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
GanttUpper.prototype.onDestroy = function () {
|
|
1396
|
-
this.unsubscribe$.next();
|
|
1397
|
-
this.unsubscribe$.complete();
|
|
1398
|
-
};
|
|
1399
|
-
GanttUpper.prototype.computeItemsRefs = function () {
|
|
1400
|
-
var _this = this;
|
|
1401
|
-
var items = [];
|
|
1402
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1403
|
-
items[_i] = arguments[_i];
|
|
1404
|
-
}
|
|
1405
|
-
items.forEach(function (item) {
|
|
1406
|
-
item.updateRefs({
|
|
1407
|
-
width: item.start && item.end ? _this.view.getDateRangeWidth(item.start.startOfDay(), item.end.endOfDay()) : 0,
|
|
1408
|
-
x: item.start ? _this.view.getXPointByDate(item.start) : 0,
|
|
1409
|
-
y: (_this.styles.lineHeight - _this.styles.barHeight) / 2 - 1
|
|
1410
|
-
});
|
|
1411
|
-
});
|
|
1412
|
-
};
|
|
1413
|
-
GanttUpper.prototype.trackBy = function (index, item) {
|
|
1414
|
-
return item.id || index;
|
|
1415
|
-
};
|
|
1416
|
-
GanttUpper.prototype.detectChanges = function () {
|
|
1417
|
-
this.cdr.detectChanges();
|
|
1418
|
-
};
|
|
1419
|
-
GanttUpper.prototype.expandGroup = function (group) {
|
|
1420
|
-
group.setExpand(!group.expanded);
|
|
1421
|
-
this.expandChange.emit();
|
|
1422
|
-
this.cdr.detectChanges();
|
|
1423
|
-
};
|
|
1424
|
-
// public functions
|
|
1425
|
-
GanttUpper.prototype.expandAll = function () {
|
|
1426
|
-
this.expandGroups(true);
|
|
1427
|
-
};
|
|
1428
|
-
GanttUpper.prototype.collapseAll = function () {
|
|
1429
|
-
this.expandGroups(false);
|
|
1430
|
-
};
|
|
1431
|
-
GanttUpper.prototype.getGanttItem = function (id) {
|
|
1432
|
-
return this.getGanttItems([id])[0] || null;
|
|
1433
|
-
};
|
|
1434
|
-
GanttUpper.prototype.getGanttItems = function (ids) {
|
|
1435
|
-
var items = [];
|
|
1436
|
-
if (this.items.length > 0) {
|
|
1437
|
-
items = recursiveItems(this.items);
|
|
1438
|
-
}
|
|
1439
|
-
else {
|
|
1440
|
-
items = flatten(this.groups.map(function (group) { return recursiveItems(group.items); }));
|
|
1441
|
-
}
|
|
1442
|
-
return items.filter(function (item) { return ids.includes(item.id); });
|
|
1443
|
-
};
|
|
1444
|
-
GanttUpper.prototype.isSelected = function (id) {
|
|
1445
|
-
if (!this.selectable) {
|
|
1446
|
-
return false;
|
|
1447
|
-
}
|
|
1448
|
-
if (!this.selectionModel.hasValue()) {
|
|
1449
|
-
return false;
|
|
1450
|
-
}
|
|
1451
|
-
return this.selectionModel.isSelected(id);
|
|
1452
|
-
};
|
|
1453
|
-
return GanttUpper;
|
|
1454
|
-
}());
|
|
1455
|
-
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 });
|
|
1456
|
-
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 }], ngImport: i0__namespace });
|
|
1457
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttUpper, decorators: [{
|
|
1458
|
-
type: i0.Directive
|
|
1459
|
-
}], ctorParameters: function () {
|
|
1460
|
-
return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
|
|
1461
|
-
type: i0.Inject,
|
|
1462
|
-
args: [GANTT_GLOBAL_CONFIG]
|
|
1463
|
-
}] }];
|
|
1464
|
-
}, propDecorators: { originItems: [{
|
|
1465
|
-
type: i0.Input,
|
|
1466
|
-
args: ['items']
|
|
1467
|
-
}], originGroups: [{
|
|
1468
|
-
type: i0.Input,
|
|
1469
|
-
args: ['groups']
|
|
1470
|
-
}], viewType: [{
|
|
1471
|
-
type: i0.Input
|
|
1472
|
-
}], start: [{
|
|
1473
|
-
type: i0.Input
|
|
1474
|
-
}], end: [{
|
|
1475
|
-
type: i0.Input
|
|
1476
|
-
}], showTodayLine: [{
|
|
1477
|
-
type: i0.Input
|
|
1478
|
-
}], draggable: [{
|
|
1479
|
-
type: i0.Input
|
|
1480
|
-
}], styles: [{
|
|
1481
|
-
type: i0.Input
|
|
1482
|
-
}], viewOptions: [{
|
|
1483
|
-
type: i0.Input
|
|
1484
|
-
}], linkOptions: [{
|
|
1485
|
-
type: i0.Input
|
|
1486
|
-
}], disabledLoadOnScroll: [{
|
|
1487
|
-
type: i0.Input
|
|
1488
|
-
}], selectable: [{
|
|
1489
|
-
type: i0.Input
|
|
1490
|
-
}], multiple: [{
|
|
1491
|
-
type: i0.Input
|
|
1492
|
-
}], loadOnScroll: [{
|
|
1493
|
-
type: i0.Output
|
|
1494
|
-
}], dragStarted: [{
|
|
1495
|
-
type: i0.Output
|
|
1496
|
-
}], dragMoved: [{
|
|
1497
|
-
type: i0.Output
|
|
1498
|
-
}], dragEnded: [{
|
|
1499
|
-
type: i0.Output
|
|
1500
|
-
}], barClick: [{
|
|
1501
|
-
type: i0.Output
|
|
1502
|
-
}], barTemplate: [{
|
|
1503
|
-
type: i0.ContentChild,
|
|
1504
|
-
args: ['bar', { static: true }]
|
|
1505
|
-
}], rangeTemplate: [{
|
|
1506
|
-
type: i0.ContentChild,
|
|
1507
|
-
args: ['range', { static: true }]
|
|
1508
|
-
}], itemTemplate: [{
|
|
1509
|
-
type: i0.ContentChild,
|
|
1510
|
-
args: ['item', { static: true }]
|
|
1511
|
-
}], groupTemplate: [{
|
|
1512
|
-
type: i0.ContentChild,
|
|
1513
|
-
args: ['group', { static: true }]
|
|
1514
|
-
}], groupHeaderTemplate: [{
|
|
1515
|
-
type: i0.ContentChild,
|
|
1516
|
-
args: ['groupHeader', { static: true }]
|
|
1517
|
-
}], ganttClass: [{
|
|
1518
|
-
type: i0.HostBinding,
|
|
1519
|
-
args: ['class.gantt']
|
|
1520
|
-
}] } });
|
|
1521
|
-
var GANTT_UPPER_TOKEN = new i0.InjectionToken('GANTT_UPPER_TOKEN');
|
|
1522
|
-
|
|
1523
|
-
var NgxGanttTableColumnComponent = /** @class */ (function () {
|
|
1524
|
-
function NgxGanttTableColumnComponent(ganttUpper) {
|
|
1525
|
-
this.ganttUpper = ganttUpper;
|
|
1526
|
-
}
|
|
1527
|
-
Object.defineProperty(NgxGanttTableColumnComponent.prototype, "width", {
|
|
1528
|
-
set: function (width) {
|
|
1529
|
-
this.columnWidth = coercion.coerceCssPixelValue(width);
|
|
1530
|
-
},
|
|
1531
|
-
enumerable: false,
|
|
1532
|
-
configurable: true
|
|
1533
|
-
});
|
|
1534
|
-
NgxGanttTableColumnComponent.prototype.ngOnInit = function () { };
|
|
1535
|
-
return NgxGanttTableColumnComponent;
|
|
1536
|
-
}());
|
|
1537
|
-
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 });
|
|
1538
|
-
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 });
|
|
1539
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableColumnComponent, decorators: [{
|
|
1540
|
-
type: i0.Component,
|
|
1541
|
-
args: [{
|
|
1542
|
-
selector: 'ngx-gantt-column',
|
|
1543
|
-
template: ''
|
|
1544
|
-
}]
|
|
1545
|
-
}], ctorParameters: function () {
|
|
1546
|
-
return [{ type: GanttUpper, decorators: [{
|
|
1547
|
-
type: i0.Inject,
|
|
1548
|
-
args: [GANTT_UPPER_TOKEN]
|
|
1549
|
-
}] }];
|
|
1550
|
-
}, propDecorators: { width: [{
|
|
1551
|
-
type: i0.Input
|
|
1552
|
-
}], name: [{
|
|
1553
|
-
type: i0.Input
|
|
1554
|
-
}], templateRef: [{
|
|
1555
|
-
type: i0.ContentChild,
|
|
1556
|
-
args: ['cell', { static: true }]
|
|
1557
|
-
}], headerTemplateRef: [{
|
|
1558
|
-
type: i0.ContentChild,
|
|
1559
|
-
args: ['header', { static: true }]
|
|
1560
|
-
}] } });
|
|
1561
|
-
|
|
1562
|
-
var NgxGanttTableComponent = /** @class */ (function () {
|
|
1563
|
-
function NgxGanttTableComponent() {
|
|
1564
|
-
this.columnChanges = new i0.EventEmitter();
|
|
1565
|
-
}
|
|
1566
|
-
NgxGanttTableComponent.prototype.ngOnInit = function () { };
|
|
1567
|
-
return NgxGanttTableComponent;
|
|
1568
|
-
}());
|
|
1569
|
-
NgxGanttTableComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1570
|
-
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 });
|
|
1571
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttTableComponent, decorators: [{
|
|
1572
|
-
type: i0.Component,
|
|
1573
|
-
args: [{
|
|
1574
|
-
selector: 'ngx-gantt-table',
|
|
1575
|
-
template: ''
|
|
1576
|
-
}]
|
|
1577
|
-
}], ctorParameters: function () { return []; }, propDecorators: { columnChanges: [{
|
|
1578
|
-
type: i0.Output
|
|
1579
|
-
}], rowBeforeTemplate: [{
|
|
1580
|
-
type: i0.ContentChild,
|
|
1581
|
-
args: ['rowBeforeSlot', { static: true }]
|
|
1582
|
-
}], rowAfterTemplate: [{
|
|
1583
|
-
type: i0.ContentChild,
|
|
1584
|
-
args: ['rowAfterSlot', { static: true }]
|
|
1585
|
-
}] } });
|
|
1586
|
-
|
|
1587
|
-
var GANTT_ABSTRACT_TOKEN = new i0.InjectionToken('gantt-abstract-token');
|
|
1588
|
-
|
|
1589
|
-
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>";
|
|
1590
|
-
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>";
|
|
1591
|
-
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>";
|
|
1592
|
-
var minusSquare = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" fit=\"\" preserveAspectRatio=\"xMidYMid meet\" focusable=\"false\"><g id=\"jnaction/minus-square\" stroke-width=\"1\" fill-rule=\"evenodd\"><path d=\"M2 0h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1.2a.8.8 0 0 0-.8.8v12a.8.8 0 0 0 .8.8h12a.8.8 0 0 0 .8-.8V2a.8.8 0 0 0-.8-.8H2zm2.8 6.2h6.5v1.2H4.8V7.4z\"></path></g></svg>";
|
|
1593
|
-
var loadingIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 50 50\" style=\"enable-background:new 0 0 50 50\" xml:space=\"preserve\">\n<path fill=\"#aaa\" d=\"M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z\" transform=\"rotate(275.098 25 25)\">\n <animateTransform attributeType=\"xml\" attributeName=\"transform\" type=\"rotate\" from=\"0 25 25\" to=\"360 25 25\" dur=\"0.6s\" repeatCount=\"indefinite\"></animateTransform>\n</path>\n</svg>";
|
|
1594
|
-
var emptyIcon = "<svg\nwidth=\"148px\"\nheight=\"134px\"\nviewBox=\"0 0 148 134\"\nversion=\"1.1\"\nxmlns=\"http://www.w3.org/2000/svg\"\nxmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n<defs>\n <filter x=\"0.0%\" y=\"0.0%\" width=\"100.0%\" height=\"100.0%\" filterUnits=\"objectBoundingBox\" id=\"filter-1\">\n <feGaussianBlur stdDeviation=\"0\" in=\"SourceGraphic\"></feGaussianBlur>\n </filter>\n</defs>\n<g id=\"148x134\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g id=\"\u7F16\u7EC4-6\" transform=\"translate(1.000000, 1.000000)\">\n <ellipse\n id=\"\u692D\u5706\u5F62\"\n fill=\"#EDEEF2\"\n opacity=\"0.3\"\n filter=\"url(#filter-1)\"\n cx=\"73.0800017\"\n cy=\"115.920003\"\n rx=\"73.0800017\"\n ry=\"16.8000004\"\n ></ellipse>\n <g id=\"\u7F16\u7EC4-5\" transform=\"translate(15.120000, 0.000000)\">\n <polygon\n id=\"\u77E9\u5F62\"\n fill=\"#E2E4E9\"\n points=\"19.2789848 49.5600011 99.1200023 48.7200011 117.600003 75.9297673 117.600003 92.313049 0 92.313049 0 75.0356267\"\n ></polygon>\n <path\n d=\"M23.5200005,0 L94.0800002,0 C97.7913538,2.06413823e-16 100.8,3.00864655 100.8,6.72000015 L100.8,99.1200023 L100.8,99.1200023 L16.8000004,99.1200023 L16.8000004,6.72000015 C16.8000004,3.00864655 19.8086469,1.56994302e-15 23.5200005,0 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#F9FAFB\"\n ></path>\n <path\n d=\"M30.9200007,12.4400003 L86.6800019,12.4400003 C88.5356787,12.4400003 90.040002,13.9443236 90.040002,15.8000004 L90.040002,42.000001 C90.040002,43.8556778 88.5356787,45.360001 86.6800019,45.360001 L30.9200007,45.360001 C29.0643239,45.360001 27.5600006,43.8556778 27.5600006,42.000001 L27.5600006,15.8000004 C27.5600006,13.9443236 29.0643239,12.4400003 30.9200007,12.4400003 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#E8EAEE\"\n ></path>\n <text\n id=\"</null>\"\n font-family=\"PingFangSC-Medium, PingFang SC\"\n font-size=\"15.1200003\"\n font-weight=\"400\"\n fill=\"#BCBECD\"\n >\n <tspan x=\"33.6000008\" y=\"32.8000004\"></null></tspan>\n </text>\n <rect id=\"\u77E9\u5F62\" fill=\"#E8EAEE\" x=\"27.5600006\" y=\"52.0800012\" width=\"61.4800014\" height=\"5.04000011\" rx=\"2.52000006\"></rect>\n <rect\n id=\"\u77E9\u5F62\u5907\u4EFD\"\n fill=\"#E8EAEE\"\n x=\"27.5600006\"\n y=\"63.8400014\"\n width=\"61.4800014\"\n height=\"5.04000011\"\n rx=\"2.52000006\"\n ></rect>\n <path\n d=\"M0,75.6000017 L29.280235,75.6000017 C32.0637502,75.6000017 34.3202352,77.8564866 34.3202352,80.6400018 L34.3202352,86.2591426 C34.3202352,89.0426578 36.5767201,91.2991427 39.3602353,91.2991427 L78.4136737,91.2991427 C81.1971889,91.2991427 83.4536738,89.0426578 83.4536738,86.2591426 L83.4536738,80.6400018 C83.4536738,77.8564866 85.7101587,75.6000017 88.4936739,75.6000017 L117.600003,75.6000017 L117.600003,75.6000017 L117.600003,110.880003 C117.600003,115.519195 113.839194,119.280003 109.200002,119.280003 L8.40000019,119.280003 C3.76080819,119.280003 -6.53729019e-15,115.519195 0,110.880003 L0,75.6000017 L0,75.6000017 Z\"\n id=\"\u77E9\u5F62\"\n fill=\"#EDEFF2\"\n ></path>\n </g>\n </g>\n</g>\n</svg>";
|
|
1595
|
-
var icons = {
|
|
1596
|
-
'angle-right': angleRight,
|
|
1597
|
-
'angle-down': angleDown,
|
|
1598
|
-
'plus-square': plusSquare,
|
|
1599
|
-
'minus-square': minusSquare,
|
|
1600
|
-
loading: loadingIcon,
|
|
1601
|
-
empty: emptyIcon
|
|
1602
|
-
};
|
|
1603
|
-
|
|
1604
|
-
var GanttIconComponent = /** @class */ (function () {
|
|
1605
|
-
function GanttIconComponent(elementRef) {
|
|
1606
|
-
this.elementRef = elementRef;
|
|
1607
|
-
this.isIcon = true;
|
|
1608
|
-
}
|
|
1609
|
-
Object.defineProperty(GanttIconComponent.prototype, "iconName", {
|
|
1610
|
-
set: function (name) {
|
|
1611
|
-
this.setSvg(name);
|
|
1612
|
-
},
|
|
1613
|
-
enumerable: false,
|
|
1614
|
-
configurable: true
|
|
1615
|
-
});
|
|
1616
|
-
GanttIconComponent.prototype.ngOnInit = function () { };
|
|
1617
|
-
GanttIconComponent.prototype.ngAfterViewInit = function () { };
|
|
1618
|
-
GanttIconComponent.prototype.setSvg = function (name) {
|
|
1619
|
-
var iconSvg = icons[name];
|
|
1620
|
-
if (iconSvg) {
|
|
1621
|
-
this.elementRef.nativeElement.innerHTML = iconSvg;
|
|
1622
|
-
}
|
|
1623
|
-
else {
|
|
1624
|
-
this.elementRef.nativeElement.innerHTML = '';
|
|
1625
|
-
}
|
|
1626
|
-
};
|
|
1627
|
-
return GanttIconComponent;
|
|
1628
|
-
}());
|
|
1629
|
-
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 });
|
|
1630
|
-
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 });
|
|
1631
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttIconComponent, decorators: [{
|
|
1632
|
-
type: i0.Component,
|
|
1633
|
-
args: [{
|
|
1634
|
-
selector: 'gantt-icon',
|
|
1635
|
-
template: ''
|
|
1636
|
-
}]
|
|
1637
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { isIcon: [{
|
|
1638
|
-
type: i0.HostBinding,
|
|
1639
|
-
args: ['class.gantt-icon']
|
|
1640
|
-
}], iconName: [{
|
|
1641
|
-
type: i0.Input
|
|
1642
|
-
}] } });
|
|
1643
|
-
|
|
1644
|
-
var IsGanttRangeItemPipe = /** @class */ (function () {
|
|
1645
|
-
function IsGanttRangeItemPipe() {
|
|
1646
|
-
}
|
|
1647
|
-
IsGanttRangeItemPipe.prototype.transform = function (value) {
|
|
1648
|
-
return value === exports.GanttItemType.range;
|
|
1649
|
-
};
|
|
1650
|
-
return IsGanttRangeItemPipe;
|
|
1651
|
-
}());
|
|
1652
|
-
IsGanttRangeItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1653
|
-
IsGanttRangeItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, name: "isGanttRangeItem" });
|
|
1654
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttRangeItemPipe, decorators: [{
|
|
1655
|
-
type: i0.Pipe,
|
|
1656
|
-
args: [{
|
|
1657
|
-
name: 'isGanttRangeItem'
|
|
1658
|
-
}]
|
|
1659
|
-
}] });
|
|
1660
|
-
var IsGanttBarItemPipe = /** @class */ (function () {
|
|
1661
|
-
function IsGanttBarItemPipe() {
|
|
1662
|
-
}
|
|
1663
|
-
IsGanttBarItemPipe.prototype.transform = function (value) {
|
|
1664
|
-
return value === exports.GanttItemType.bar;
|
|
1665
|
-
};
|
|
1666
|
-
return IsGanttBarItemPipe;
|
|
1667
|
-
}());
|
|
1668
|
-
IsGanttBarItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1669
|
-
IsGanttBarItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, name: "isGanttBarItem" });
|
|
1670
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttBarItemPipe, decorators: [{
|
|
1671
|
-
type: i0.Pipe,
|
|
1672
|
-
args: [{
|
|
1673
|
-
name: 'isGanttBarItem'
|
|
1674
|
-
}]
|
|
1675
|
-
}] });
|
|
1676
|
-
var IsGanttCustomItemPipe = /** @class */ (function () {
|
|
1677
|
-
function IsGanttCustomItemPipe() {
|
|
1678
|
-
}
|
|
1679
|
-
IsGanttCustomItemPipe.prototype.transform = function (value) {
|
|
1680
|
-
return value === exports.GanttItemType.custom;
|
|
1681
|
-
};
|
|
1682
|
-
return IsGanttCustomItemPipe;
|
|
1683
|
-
}());
|
|
1684
|
-
IsGanttCustomItemPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
|
|
1685
|
-
IsGanttCustomItemPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, name: "isGanttCustomItem" });
|
|
1686
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: IsGanttCustomItemPipe, decorators: [{
|
|
1687
|
-
type: i0.Pipe,
|
|
1688
|
-
args: [{
|
|
1689
|
-
name: 'isGanttCustomItem'
|
|
1690
|
-
}]
|
|
1691
|
-
}] });
|
|
1692
|
-
|
|
1693
|
-
var defaultColumnWidth = 100;
|
|
1694
|
-
var minColumnWidth = 80;
|
|
1695
|
-
var GanttTableComponent = /** @class */ (function () {
|
|
1696
|
-
function GanttTableComponent(gantt, ganttUpper, elementRef) {
|
|
1697
|
-
this.gantt = gantt;
|
|
1698
|
-
this.ganttUpper = ganttUpper;
|
|
1699
|
-
this.elementRef = elementRef;
|
|
1700
|
-
this.itemClick = new i0.EventEmitter();
|
|
1701
|
-
this.ganttTableClass = true;
|
|
1702
|
-
this.ganttTableEmptyClass = false;
|
|
1703
|
-
}
|
|
1704
|
-
Object.defineProperty(GanttTableComponent.prototype, "columns", {
|
|
1705
|
-
set: function (columns) {
|
|
1706
|
-
columns.forEach(function (column) {
|
|
1707
|
-
if (!column.columnWidth) {
|
|
1708
|
-
column.columnWidth = coercion.coerceCssPixelValue(defaultColumnWidth);
|
|
1709
|
-
}
|
|
1710
|
-
});
|
|
1711
|
-
this.columnList = columns;
|
|
1712
|
-
},
|
|
1713
|
-
enumerable: false,
|
|
1714
|
-
configurable: true
|
|
1715
|
-
});
|
|
1716
|
-
GanttTableComponent.prototype.ngOnInit = function () { };
|
|
1717
|
-
GanttTableComponent.prototype.ngOnChanges = function (changes) {
|
|
1718
|
-
var _a, _b;
|
|
1719
|
-
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)) {
|
|
1720
|
-
this.ganttTableEmptyClass = true;
|
|
1721
|
-
}
|
|
1722
|
-
else {
|
|
1723
|
-
this.ganttTableEmptyClass = false;
|
|
1724
|
-
}
|
|
1725
|
-
};
|
|
1726
|
-
GanttTableComponent.prototype.dragFixed = function (config) {
|
|
1727
|
-
if (config.movedWidth < config.minWidth) {
|
|
1728
|
-
config.target.style.transform = "translate3d(" + (config.minWidth - config.originWidth) + "px, 0, 0)";
|
|
1729
|
-
}
|
|
1730
|
-
};
|
|
1731
|
-
GanttTableComponent.prototype.expandGroup = function (group) {
|
|
1732
|
-
this.gantt.expandGroup(group);
|
|
1733
|
-
};
|
|
1734
|
-
GanttTableComponent.prototype.expandChildren = function (event, item) {
|
|
1735
|
-
event.stopPropagation();
|
|
1736
|
-
this.gantt.expandChildren(item);
|
|
1737
|
-
};
|
|
1738
|
-
GanttTableComponent.prototype.dragStarted = function (event) {
|
|
1739
|
-
var target = event.source.element.nativeElement;
|
|
1740
|
-
this.dragStartLeft = target.getBoundingClientRect().left;
|
|
1741
|
-
};
|
|
1742
|
-
GanttTableComponent.prototype.dragMoved = function (event, column) {
|
|
1743
|
-
var target = event.source.element.nativeElement;
|
|
1744
|
-
var left = target.getBoundingClientRect().left;
|
|
1745
|
-
var originWidth;
|
|
1746
|
-
var movedWidth;
|
|
1747
|
-
var minWidth;
|
|
1748
|
-
if (column) {
|
|
1749
|
-
originWidth = parseInt(column.columnWidth, 10);
|
|
1750
|
-
movedWidth = originWidth + (left - this.dragStartLeft);
|
|
1751
|
-
minWidth = minColumnWidth;
|
|
1752
|
-
}
|
|
1753
|
-
else {
|
|
1754
|
-
originWidth = this.elementRef.nativeElement.getBoundingClientRect().width;
|
|
1755
|
-
movedWidth = originWidth + (left - this.dragStartLeft);
|
|
1756
|
-
minWidth = minColumnWidth * this.columnList.length;
|
|
1757
|
-
}
|
|
1758
|
-
this.dragFixed({
|
|
1759
|
-
target: target,
|
|
1760
|
-
originWidth: originWidth,
|
|
1761
|
-
movedWidth: movedWidth,
|
|
1762
|
-
minWidth: minWidth
|
|
1763
|
-
});
|
|
1764
|
-
this.showAuxiliaryLine(event);
|
|
1765
|
-
};
|
|
1766
|
-
GanttTableComponent.prototype.columnDragEnded = function (event, column) {
|
|
1767
|
-
var target = event.source.element.nativeElement;
|
|
1768
|
-
var left = target.getBoundingClientRect().left;
|
|
1769
|
-
var width = parseInt(column.columnWidth, 10) + (left - this.dragStartLeft);
|
|
1770
|
-
var columnWidth = Math.max(width || 0, minColumnWidth);
|
|
1771
|
-
column.columnWidth = coercion.coerceCssPixelValue(columnWidth);
|
|
1772
|
-
if (this.gantt.table) {
|
|
1773
|
-
this.gantt.table.columnChanges.emit({ columns: this.columnList });
|
|
1774
|
-
}
|
|
1775
|
-
this.hideAuxiliaryLine();
|
|
1776
|
-
event.source.reset();
|
|
1777
|
-
};
|
|
1778
|
-
GanttTableComponent.prototype.tableDragEnded = function (event) {
|
|
1779
|
-
var target = event.source.element.nativeElement;
|
|
1780
|
-
var left = target.getBoundingClientRect().left;
|
|
1781
|
-
var tableWidth = this.elementRef.nativeElement.getBoundingClientRect().width;
|
|
1782
|
-
var dragWidth = left - this.dragStartLeft;
|
|
1783
|
-
this.columnList.forEach(function (column) {
|
|
1784
|
-
var lastColumnWidth = parseInt(column.columnWidth, 10);
|
|
1785
|
-
var distributeWidth = parseInt(String(dragWidth * (lastColumnWidth / tableWidth)), 10);
|
|
1786
|
-
var columnWidth = Math.max(lastColumnWidth + distributeWidth || 0, minColumnWidth);
|
|
1787
|
-
column.columnWidth = coercion.coerceCssPixelValue(columnWidth);
|
|
1788
|
-
});
|
|
1789
|
-
if (this.gantt.table) {
|
|
1790
|
-
this.gantt.table.columnChanges.emit({ columns: this.columnList });
|
|
1791
|
-
}
|
|
1792
|
-
this.hideAuxiliaryLine();
|
|
1793
|
-
event.source.reset();
|
|
1794
|
-
};
|
|
1795
|
-
GanttTableComponent.prototype.showAuxiliaryLine = function (event) {
|
|
1796
|
-
var tableRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
1797
|
-
var targetRect = event.source.element.nativeElement.getBoundingClientRect();
|
|
1798
|
-
var distance = { x: targetRect.left - tableRect.left, y: targetRect.top - tableRect.top };
|
|
1799
|
-
this.draglineElementRef.nativeElement.style.left = distance.x + "px";
|
|
1800
|
-
this.draglineElementRef.nativeElement.style.display = 'block';
|
|
1801
|
-
};
|
|
1802
|
-
GanttTableComponent.prototype.hideAuxiliaryLine = function () {
|
|
1803
|
-
this.draglineElementRef.nativeElement.style.display = 'none';
|
|
1804
|
-
};
|
|
1805
|
-
GanttTableComponent.prototype.trackBy = function (index, item) {
|
|
1806
|
-
return item.id || index;
|
|
1807
|
-
};
|
|
1808
|
-
return GanttTableComponent;
|
|
1809
|
-
}());
|
|
1810
|
-
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 });
|
|
1811
|
-
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 } });
|
|
1812
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttTableComponent, decorators: [{
|
|
1813
|
-
type: i0.Component,
|
|
1814
|
-
args: [{
|
|
1815
|
-
selector: 'gantt-table',
|
|
1816
|
-
templateUrl: './gantt-table.component.html'
|
|
1817
|
-
}]
|
|
1818
|
-
}], ctorParameters: function () {
|
|
1819
|
-
return [{ type: undefined, decorators: [{
|
|
1820
|
-
type: i0.Inject,
|
|
1821
|
-
args: [GANTT_ABSTRACT_TOKEN]
|
|
1822
|
-
}] }, { type: GanttUpper, decorators: [{
|
|
1823
|
-
type: i0.Inject,
|
|
1824
|
-
args: [GANTT_UPPER_TOKEN]
|
|
1825
|
-
}] }, { type: i0__namespace.ElementRef }];
|
|
1826
|
-
}, propDecorators: { groups: [{
|
|
1827
|
-
type: i0.Input
|
|
1828
|
-
}], items: [{
|
|
1829
|
-
type: i0.Input
|
|
1830
|
-
}], columns: [{
|
|
1831
|
-
type: i0.Input
|
|
1832
|
-
}], groupTemplate: [{
|
|
1833
|
-
type: i0.Input
|
|
1834
|
-
}], emptyTemplate: [{
|
|
1835
|
-
type: i0.Input
|
|
1836
|
-
}], rowBeforeTemplate: [{
|
|
1837
|
-
type: i0.Input
|
|
1838
|
-
}], rowAfterTemplate: [{
|
|
1839
|
-
type: i0.Input
|
|
1840
|
-
}], itemClick: [{
|
|
1841
|
-
type: i0.Output
|
|
1842
|
-
}], draglineElementRef: [{
|
|
1843
|
-
type: i0.ViewChild,
|
|
1844
|
-
args: ['dragLine', { static: true }]
|
|
1845
|
-
}], ganttTableClass: [{
|
|
1846
|
-
type: i0.HostBinding,
|
|
1847
|
-
args: ['class.gantt-table']
|
|
1848
|
-
}], ganttTableEmptyClass: [{
|
|
1849
|
-
type: i0.HostBinding,
|
|
1850
|
-
args: ['class.gantt-table-empty']
|
|
1851
|
-
}] } });
|
|
1852
|
-
|
|
1853
|
-
var scrollThreshold = 50;
|
|
1854
|
-
var ScrollDirection;
|
|
1855
|
-
(function (ScrollDirection) {
|
|
1856
|
-
ScrollDirection[ScrollDirection["NONE"] = 0] = "NONE";
|
|
1857
|
-
ScrollDirection[ScrollDirection["LEFT"] = 1] = "LEFT";
|
|
1858
|
-
ScrollDirection[ScrollDirection["RIGHT"] = 2] = "RIGHT";
|
|
1859
|
-
})(ScrollDirection || (ScrollDirection = {}));
|
|
1860
|
-
var GanttDomService = /** @class */ (function () {
|
|
1861
|
-
function GanttDomService() {
|
|
1862
|
-
this.unsubscribe$ = new rxjs.Subject();
|
|
1863
|
-
}
|
|
1864
|
-
GanttDomService.prototype.monitorScrollChange = function () {
|
|
1865
|
-
var _this = this;
|
|
1866
|
-
rxjs.merge(rxjs.fromEvent(this.mainContainer, 'scroll'), rxjs.fromEvent(this.sideContainer, 'scroll'))
|
|
1867
|
-
.pipe(operators.takeUntil(this.unsubscribe$))
|
|
1868
|
-
.subscribe(function (event) {
|
|
1869
|
-
_this.syncScroll(event);
|
|
1870
|
-
});
|
|
1871
|
-
rxjs.fromEvent(this.mainContainer, 'scroll')
|
|
1872
|
-
.pipe(operators.startWith(), operators.takeUntil(this.unsubscribe$))
|
|
1873
|
-
.subscribe(function (event) {
|
|
1874
|
-
// if (this.mainContainer.scrollLeft > 0) {
|
|
1875
|
-
// this.side.classList.add('gantt-side-has-shadow');
|
|
1876
|
-
// } else {
|
|
1877
|
-
// this.side.classList.remove('gantt-side-has-shadow');
|
|
1878
|
-
// }
|
|
1879
|
-
});
|
|
1880
|
-
};
|
|
1881
|
-
GanttDomService.prototype.syncScroll = function (event) {
|
|
1882
|
-
var target = event.currentTarget;
|
|
1883
|
-
this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
|
|
1884
|
-
this.sideContainer.scrollTop = target.scrollTop;
|
|
1885
|
-
this.mainContainer.scrollTop = target.scrollTop;
|
|
1886
|
-
};
|
|
1887
|
-
GanttDomService.prototype.disableBrowserWheelEvent = function () {
|
|
1888
|
-
var container = this.mainContainer;
|
|
1889
|
-
rxjs.fromEvent(container, 'wheel')
|
|
1890
|
-
.pipe(operators.takeUntil(this.unsubscribe$))
|
|
1891
|
-
.subscribe(function (event) {
|
|
1892
|
-
var delta = event.deltaX;
|
|
1893
|
-
if (!delta) {
|
|
1894
|
-
return;
|
|
1895
|
-
}
|
|
1896
|
-
if ((container.scrollLeft + container.offsetWidth === container.scrollWidth && delta > 0) ||
|
|
1897
|
-
(container.scrollLeft === 0 && delta < 0)) {
|
|
1898
|
-
event.preventDefault();
|
|
1899
|
-
}
|
|
1900
|
-
});
|
|
1901
|
-
};
|
|
1902
|
-
GanttDomService.prototype.initialize = function (root) {
|
|
1903
|
-
this.root = root.nativeElement;
|
|
1904
|
-
this.side = this.root.getElementsByClassName('gantt-side')[0];
|
|
1905
|
-
this.container = this.root.getElementsByClassName('gantt-container')[0];
|
|
1906
|
-
this.sideContainer = this.root.getElementsByClassName('gantt-side-container')[0];
|
|
1907
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
1908
|
-
this.calendarOverlay = this.root.getElementsByClassName('gantt-calendar-overlay')[0];
|
|
1909
|
-
this.monitorScrollChange();
|
|
1910
|
-
this.disableBrowserWheelEvent();
|
|
1911
|
-
};
|
|
1912
|
-
GanttDomService.prototype.getViewerScroll = function () {
|
|
1913
|
-
var _this = this;
|
|
1914
|
-
return rxjs.fromEvent(this.mainContainer, 'scroll').pipe(operators.map(function () { return _this.mainContainer.scrollLeft; }), operators.pairwise(), operators.map(function (_a) {
|
|
1915
|
-
var _b = __read(_a, 2), previous = _b[0], current = _b[1];
|
|
1916
|
-
var event = {
|
|
1917
|
-
target: _this.mainContainer,
|
|
1918
|
-
direction: ScrollDirection.NONE
|
|
1919
|
-
};
|
|
1920
|
-
if (current - previous < 0) {
|
|
1921
|
-
if (_this.mainContainer.scrollLeft < scrollThreshold && _this.mainContainer.scrollLeft > 0) {
|
|
1922
|
-
event.direction = ScrollDirection.LEFT;
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1925
|
-
if (current - previous > 0) {
|
|
1926
|
-
if (_this.mainContainer.scrollWidth - _this.mainContainer.clientWidth - _this.mainContainer.scrollLeft < scrollThreshold) {
|
|
1927
|
-
event.direction = ScrollDirection.RIGHT;
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
return event;
|
|
1931
|
-
}));
|
|
1932
|
-
};
|
|
1933
|
-
GanttDomService.prototype.getResize = function () {
|
|
1934
|
-
return rxjs.fromEvent(window, 'resize').pipe(operators.auditTime(150));
|
|
1935
|
-
};
|
|
1936
|
-
GanttDomService.prototype.scrollMainContainer = function (left) {
|
|
1937
|
-
if (isNumber(left)) {
|
|
1938
|
-
var scrollLeft = left - this.mainContainer.clientWidth / 2;
|
|
1939
|
-
this.mainContainer.scrollLeft = scrollLeft > scrollThreshold ? scrollLeft : 0;
|
|
1940
|
-
this.calendarOverlay.scrollLeft = this.mainContainer.scrollLeft;
|
|
1941
|
-
}
|
|
1942
|
-
};
|
|
1943
|
-
GanttDomService.prototype.ngOnDestroy = function () {
|
|
1944
|
-
this.unsubscribe$.next();
|
|
1945
|
-
this.unsubscribe$.complete();
|
|
1946
|
-
};
|
|
1947
|
-
return GanttDomService;
|
|
1948
|
-
}());
|
|
1949
|
-
GanttDomService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1950
|
-
GanttDomService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService });
|
|
1951
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDomService, decorators: [{
|
|
1952
|
-
type: i0.Injectable
|
|
1953
|
-
}], ctorParameters: function () { return []; } });
|
|
1954
|
-
|
|
1955
|
-
function getDependencyType(path, dependencyTypes) {
|
|
1956
|
-
if (dependencyTypes.includes(exports.GanttLinkType.ss) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.start) {
|
|
1957
|
-
return exports.GanttLinkType.ss;
|
|
1958
|
-
}
|
|
1959
|
-
if (dependencyTypes.includes(exports.GanttLinkType.ff) && path.from.pos === InBarPosition.finish && path.to.pos === InBarPosition.finish) {
|
|
1960
|
-
return exports.GanttLinkType.ff;
|
|
1961
|
-
}
|
|
1962
|
-
if (dependencyTypes.includes(exports.GanttLinkType.sf) && path.from.pos === InBarPosition.start && path.to.pos === InBarPosition.finish) {
|
|
1963
|
-
return exports.GanttLinkType.sf;
|
|
1964
|
-
}
|
|
1965
|
-
return exports.GanttLinkType.fs;
|
|
1966
|
-
}
|
|
1967
|
-
var InBarPosition;
|
|
1968
|
-
(function (InBarPosition) {
|
|
1969
|
-
InBarPosition["start"] = "start";
|
|
1970
|
-
InBarPosition["finish"] = "finish";
|
|
1971
|
-
})(InBarPosition || (InBarPosition = {}));
|
|
1972
|
-
var GanttDragContainer = /** @class */ (function () {
|
|
1973
|
-
function GanttDragContainer(ganttUpper) {
|
|
1974
|
-
this.ganttUpper = ganttUpper;
|
|
1975
|
-
this.dragStarted = new i0.EventEmitter();
|
|
1976
|
-
this.dragMoved = new i0.EventEmitter();
|
|
1977
|
-
this.dragEnded = new i0.EventEmitter();
|
|
1978
|
-
this.linkDragStarted = new i0.EventEmitter();
|
|
1979
|
-
this.linkDragEntered = new i0.EventEmitter();
|
|
1980
|
-
this.linkDragEnded = new i0.EventEmitter();
|
|
1981
|
-
this.linkDragPath = { from: null, to: null };
|
|
1982
|
-
}
|
|
1983
|
-
GanttDragContainer.prototype.emitLinkDragStarted = function (from) {
|
|
1984
|
-
this.linkDraggingId = from.item.id;
|
|
1985
|
-
this.linkDragPath.from = from;
|
|
1986
|
-
this.linkDragStarted.emit({
|
|
1987
|
-
source: from.item.origin,
|
|
1988
|
-
target: null
|
|
1989
|
-
});
|
|
1990
|
-
};
|
|
1991
|
-
GanttDragContainer.prototype.emitLinkDragEntered = function (to) {
|
|
1992
|
-
this.linkDragPath.to = to;
|
|
1993
|
-
this.linkDragEntered.emit({
|
|
1994
|
-
source: this.linkDragPath.from.item.origin,
|
|
1995
|
-
target: to.item.origin
|
|
1996
|
-
});
|
|
1997
|
-
};
|
|
1998
|
-
GanttDragContainer.prototype.emitLinkDragLeaved = function () {
|
|
1999
|
-
this.linkDragPath.to = null;
|
|
2000
|
-
};
|
|
2001
|
-
GanttDragContainer.prototype.emitLinkDragEnded = function (to) {
|
|
2002
|
-
var _a;
|
|
2003
|
-
this.linkDragPath.to = to;
|
|
2004
|
-
var dependencyType = getDependencyType(this.linkDragPath, (_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.dependencyTypes);
|
|
2005
|
-
this.linkDragPath.from.item.addLink({
|
|
2006
|
-
link: this.linkDragPath.to.item.id,
|
|
2007
|
-
type: dependencyType
|
|
2008
|
-
});
|
|
2009
|
-
this.linkDragEnded.emit({
|
|
2010
|
-
source: this.linkDragPath.from.item.origin,
|
|
2011
|
-
target: this.linkDragPath.to.item.origin,
|
|
2012
|
-
type: dependencyType
|
|
2013
|
-
});
|
|
2014
|
-
this.linkDraggingId = null;
|
|
2015
|
-
this.linkDragPath = { from: null, to: null };
|
|
2016
|
-
};
|
|
2017
|
-
return GanttDragContainer;
|
|
2018
|
-
}());
|
|
2019
|
-
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 });
|
|
2020
|
-
GanttDragContainer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer });
|
|
2021
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragContainer, decorators: [{
|
|
2022
|
-
type: i0.Injectable
|
|
2023
|
-
}], ctorParameters: function () {
|
|
2024
|
-
return [{ type: GanttUpper, decorators: [{
|
|
2025
|
-
type: i0.Inject,
|
|
2026
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2027
|
-
}] }];
|
|
2028
|
-
} });
|
|
2029
|
-
|
|
2030
|
-
var GanttPrintService = /** @class */ (function () {
|
|
2031
|
-
function GanttPrintService() {
|
|
2032
|
-
}
|
|
2033
|
-
GanttPrintService.prototype.setInlineStyles = function (targetElem) {
|
|
2034
|
-
var e_1, _a;
|
|
2035
|
-
var svgElements = Array.from(targetElem.getElementsByTagName('svg'));
|
|
2036
|
-
try {
|
|
2037
|
-
for (var svgElements_1 = __values(svgElements), svgElements_1_1 = svgElements_1.next(); !svgElements_1_1.done; svgElements_1_1 = svgElements_1.next()) {
|
|
2038
|
-
var svgElement = svgElements_1_1.value;
|
|
2039
|
-
this.recursElementChildren(svgElement);
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2043
|
-
finally {
|
|
2044
|
-
try {
|
|
2045
|
-
if (svgElements_1_1 && !svgElements_1_1.done && (_a = svgElements_1.return)) _a.call(svgElements_1);
|
|
2046
|
-
}
|
|
2047
|
-
finally { if (e_1) throw e_1.error; }
|
|
2048
|
-
}
|
|
2049
|
-
};
|
|
2050
|
-
GanttPrintService.prototype.recursElementChildren = function (node) {
|
|
2051
|
-
var e_2, _a, e_3, _b;
|
|
2052
|
-
var transformProperties = [
|
|
2053
|
-
'fill',
|
|
2054
|
-
'color',
|
|
2055
|
-
'font-size',
|
|
2056
|
-
'stroke',
|
|
2057
|
-
'font',
|
|
2058
|
-
'text-anchor',
|
|
2059
|
-
'stroke-dasharray',
|
|
2060
|
-
'shape-rendering',
|
|
2061
|
-
'stroke-width'
|
|
2062
|
-
];
|
|
2063
|
-
if (!node.style) {
|
|
2064
|
-
return;
|
|
2065
|
-
}
|
|
2066
|
-
var styles = getComputedStyle(node);
|
|
2067
|
-
try {
|
|
2068
|
-
for (var transformProperties_1 = __values(transformProperties), transformProperties_1_1 = transformProperties_1.next(); !transformProperties_1_1.done; transformProperties_1_1 = transformProperties_1.next()) {
|
|
2069
|
-
var transformProperty = transformProperties_1_1.value;
|
|
2070
|
-
node.style[transformProperty] = styles[transformProperty];
|
|
2071
|
-
}
|
|
2072
|
-
}
|
|
2073
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
2074
|
-
finally {
|
|
2075
|
-
try {
|
|
2076
|
-
if (transformProperties_1_1 && !transformProperties_1_1.done && (_a = transformProperties_1.return)) _a.call(transformProperties_1);
|
|
2077
|
-
}
|
|
2078
|
-
finally { if (e_2) throw e_2.error; }
|
|
2079
|
-
}
|
|
2080
|
-
try {
|
|
2081
|
-
for (var _c = __values(Array.from(node.childNodes)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
2082
|
-
var child = _d.value;
|
|
2083
|
-
this.recursElementChildren(child);
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
2087
|
-
finally {
|
|
2088
|
-
try {
|
|
2089
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
2090
|
-
}
|
|
2091
|
-
finally { if (e_3) throw e_3.error; }
|
|
2092
|
-
}
|
|
2093
|
-
};
|
|
2094
|
-
GanttPrintService.prototype.register = function (root) {
|
|
2095
|
-
this.root = root.nativeElement;
|
|
2096
|
-
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
2097
|
-
};
|
|
2098
|
-
GanttPrintService.prototype.print = function (name, ignoreElementClass) {
|
|
2099
|
-
var _this = this;
|
|
2100
|
-
if (name === void 0) { name = 'download'; }
|
|
2101
|
-
var root = this.root;
|
|
2102
|
-
var mainContainer = this.mainContainer;
|
|
2103
|
-
// set print width
|
|
2104
|
-
var printWidth = root.offsetWidth;
|
|
2105
|
-
// set print height
|
|
2106
|
-
var printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
2107
|
-
html2canvas__default["default"](root, {
|
|
2108
|
-
logging: false,
|
|
2109
|
-
allowTaint: true,
|
|
2110
|
-
useCORS: true,
|
|
2111
|
-
width: printWidth,
|
|
2112
|
-
height: printHeight,
|
|
2113
|
-
ignoreElements: function (element) {
|
|
2114
|
-
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
2115
|
-
return true;
|
|
2116
|
-
}
|
|
2117
|
-
if (element.classList.contains('gantt-calendar-today-overlay')) {
|
|
2118
|
-
return true;
|
|
2119
|
-
}
|
|
2120
|
-
},
|
|
2121
|
-
onclone: function (cloneDocument) {
|
|
2122
|
-
var ganttClass = root.className;
|
|
2123
|
-
var cloneGanttDom = cloneDocument.querySelector("." + ganttClass.replace(/\s+/g, '.'));
|
|
2124
|
-
var cloneGanttContainerDom = cloneDocument.querySelector('.gantt-container');
|
|
2125
|
-
var cloneCalendarOverlay = cloneDocument.querySelector('.gantt-calendar-overlay-main');
|
|
2126
|
-
var cloneLinksOverlay = cloneDocument.querySelector('.gantt-links-overlay-main');
|
|
2127
|
-
// change targetDom width
|
|
2128
|
-
cloneGanttDom.style.width = printWidth + "px";
|
|
2129
|
-
cloneGanttDom.style.height = printHeight + "px";
|
|
2130
|
-
cloneGanttDom.style.overflow = "unset";
|
|
2131
|
-
cloneGanttContainerDom.style.backgroundColor = '#fff';
|
|
2132
|
-
cloneCalendarOverlay.setAttribute('height', "" + printHeight);
|
|
2133
|
-
cloneCalendarOverlay.setAttribute('style', "background: transparent");
|
|
2134
|
-
if (cloneLinksOverlay) {
|
|
2135
|
-
cloneLinksOverlay.setAttribute('height', "" + printHeight);
|
|
2136
|
-
cloneLinksOverlay.setAttribute('style', "height: " + printHeight + "px");
|
|
2137
|
-
}
|
|
2138
|
-
// setInlineStyles for svg
|
|
2139
|
-
_this.setInlineStyles(cloneGanttDom);
|
|
2140
|
-
}
|
|
2141
|
-
}).then(function (canvas) {
|
|
2142
|
-
var link = document.createElement('a');
|
|
2143
|
-
var dataUrl = canvas.toDataURL('image/png');
|
|
2144
|
-
link.download = name + ".png";
|
|
2145
|
-
link.href = dataUrl;
|
|
2146
|
-
link.click();
|
|
2147
|
-
});
|
|
2148
|
-
};
|
|
2149
|
-
return GanttPrintService;
|
|
2150
|
-
}());
|
|
2151
|
-
GanttPrintService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2152
|
-
GanttPrintService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService });
|
|
2153
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttPrintService, decorators: [{
|
|
2154
|
-
type: i0.Injectable
|
|
2155
|
-
}], ctorParameters: function () { return []; } });
|
|
2156
|
-
|
|
2157
|
-
var mainHeight = 5000;
|
|
2158
|
-
var GanttCalendarComponent = /** @class */ (function () {
|
|
2159
|
-
function GanttCalendarComponent(ganttUpper, ngZone, elementRef) {
|
|
2160
|
-
this.ganttUpper = ganttUpper;
|
|
2161
|
-
this.ngZone = ngZone;
|
|
2162
|
-
this.elementRef = elementRef;
|
|
2163
|
-
this.unsubscribe$ = new rxjs.Subject();
|
|
2164
|
-
this.headerHeight = headerHeight;
|
|
2165
|
-
this.mainHeight = mainHeight;
|
|
2166
|
-
this.todayHeight = todayHeight;
|
|
2167
|
-
this.todayWidth = todayWidth;
|
|
2168
|
-
this.todayBorderRadius = todayBorderRadius;
|
|
2169
|
-
this.viewTypes = exports.GanttViewType;
|
|
2170
|
-
this.className = true;
|
|
2171
|
-
}
|
|
2172
|
-
Object.defineProperty(GanttCalendarComponent.prototype, "view", {
|
|
2173
|
-
get: function () {
|
|
2174
|
-
return this.ganttUpper.view;
|
|
2175
|
-
},
|
|
2176
|
-
enumerable: false,
|
|
2177
|
-
configurable: true
|
|
2178
|
-
});
|
|
2179
|
-
GanttCalendarComponent.prototype.setTodayPoint = function () {
|
|
2180
|
-
var x = this.view.getTodayXPoint();
|
|
2181
|
-
var today = new GanttDate().getDate();
|
|
2182
|
-
var todayEle = this.elementRef.nativeElement.getElementsByClassName('gantt-calendar-today-overlay')[0];
|
|
2183
|
-
var rect = this.elementRef.nativeElement.getElementsByClassName('today-rect')[0];
|
|
2184
|
-
var line = this.elementRef.nativeElement.getElementsByClassName('today-line')[0];
|
|
2185
|
-
if (isNumber(x)) {
|
|
2186
|
-
if (rect) {
|
|
2187
|
-
rect.style.left = x - todayWidth / 2 + "px";
|
|
2188
|
-
rect.style.top = headerHeight - todayHeight + "px";
|
|
2189
|
-
rect.innerHTML = today.toString();
|
|
2190
|
-
}
|
|
2191
|
-
if (line) {
|
|
2192
|
-
line.style.left = x + "px";
|
|
2193
|
-
line.style.top = headerHeight + "px";
|
|
2194
|
-
line.style.bottom = -mainHeight + "px";
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
else {
|
|
2198
|
-
todayEle.style.display = 'none';
|
|
2199
|
-
}
|
|
2200
|
-
};
|
|
2201
|
-
GanttCalendarComponent.prototype.ngOnInit = function () {
|
|
2202
|
-
var _this = this;
|
|
2203
|
-
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
2204
|
-
rxjs.merge(_this.ganttUpper.viewChange, _this.ganttUpper.view.start$)
|
|
2205
|
-
.pipe(operators.takeUntil(_this.unsubscribe$))
|
|
2206
|
-
.subscribe(function () {
|
|
2207
|
-
_this.setTodayPoint();
|
|
2208
|
-
});
|
|
2209
|
-
});
|
|
2210
|
-
};
|
|
2211
|
-
GanttCalendarComponent.prototype.ngAfterViewInit = function () { };
|
|
2212
|
-
GanttCalendarComponent.prototype.ngOnChanges = function (changes) { };
|
|
2213
|
-
GanttCalendarComponent.prototype.trackBy = function (index, point) {
|
|
2214
|
-
return point.text || index;
|
|
2215
|
-
};
|
|
2216
|
-
GanttCalendarComponent.prototype.ngOnDestroy = function () {
|
|
2217
|
-
this.unsubscribe$.next();
|
|
2218
|
-
this.unsubscribe$.complete();
|
|
2219
|
-
};
|
|
2220
|
-
return GanttCalendarComponent;
|
|
2221
|
-
}());
|
|
2222
|
-
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 });
|
|
2223
|
-
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" } }, usesOnChanges: true, 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"] }] });
|
|
2224
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttCalendarComponent, decorators: [{
|
|
2225
|
-
type: i0.Component,
|
|
2226
|
-
args: [{
|
|
2227
|
-
selector: 'gantt-calendar-overlay',
|
|
2228
|
-
templateUrl: './calendar.component.html'
|
|
2229
|
-
}]
|
|
2230
|
-
}], ctorParameters: function () {
|
|
2231
|
-
return [{ type: GanttUpper, decorators: [{
|
|
2232
|
-
type: i0.Inject,
|
|
2233
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2234
|
-
}] }, { type: i0__namespace.NgZone }, { type: i0__namespace.ElementRef }];
|
|
2235
|
-
}, propDecorators: { className: [{
|
|
2236
|
-
type: i0.HostBinding,
|
|
2237
|
-
args: ['class.gantt-calendar-overlay']
|
|
2238
|
-
}] } });
|
|
2239
|
-
|
|
2240
|
-
var GanttDragBackdropComponent = /** @class */ (function () {
|
|
2241
|
-
function GanttDragBackdropComponent() {
|
|
2242
|
-
this.backdropClass = true;
|
|
2243
|
-
}
|
|
2244
|
-
GanttDragBackdropComponent.prototype.ngOnInit = function () { };
|
|
2245
|
-
return GanttDragBackdropComponent;
|
|
2246
|
-
}());
|
|
2247
|
-
GanttDragBackdropComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragBackdropComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2248
|
-
GanttDragBackdropComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", 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" });
|
|
2249
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttDragBackdropComponent, decorators: [{
|
|
2250
|
-
type: i0.Component,
|
|
2251
|
-
args: [{
|
|
2252
|
-
selector: 'gantt-drag-backdrop',
|
|
2253
|
-
templateUrl: "./drag-backdrop.component.html"
|
|
2254
|
-
}]
|
|
2255
|
-
}], ctorParameters: function () { return []; }, propDecorators: { backdropClass: [{
|
|
2256
|
-
type: i0.HostBinding,
|
|
2257
|
-
args: ['class.gantt-drag-backdrop']
|
|
2258
|
-
}] } });
|
|
2259
|
-
|
|
2260
|
-
var NgxGanttRootComponent = /** @class */ (function () {
|
|
2261
|
-
function NgxGanttRootComponent(elementRef, ngZone, dom, dragContainer, ganttUpper, printService) {
|
|
2262
|
-
this.elementRef = elementRef;
|
|
2263
|
-
this.ngZone = ngZone;
|
|
2264
|
-
this.dom = dom;
|
|
2265
|
-
this.dragContainer = dragContainer;
|
|
2266
|
-
this.ganttUpper = ganttUpper;
|
|
2267
|
-
this.printService = printService;
|
|
2268
|
-
this.ganttClass = true;
|
|
2269
|
-
this.unsubscribe$ = new rxjs.Subject();
|
|
2270
|
-
this.ganttUpper.dragContainer = dragContainer;
|
|
2271
|
-
}
|
|
2272
|
-
Object.defineProperty(NgxGanttRootComponent.prototype, "view", {
|
|
2273
|
-
get: function () {
|
|
2274
|
-
return this.ganttUpper.view;
|
|
2275
|
-
},
|
|
2276
|
-
enumerable: false,
|
|
2277
|
-
configurable: true
|
|
2278
|
-
});
|
|
2279
|
-
NgxGanttRootComponent.prototype.ngOnInit = function () {
|
|
2280
|
-
var _this = this;
|
|
2281
|
-
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
2282
|
-
_this.dom.initialize(_this.elementRef);
|
|
2283
|
-
if (_this.printService) {
|
|
2284
|
-
_this.printService.register(_this.elementRef);
|
|
2285
|
-
}
|
|
2286
|
-
_this.setupScrollClass();
|
|
2287
|
-
_this.setupResize();
|
|
2288
|
-
_this.setupViewScroll();
|
|
2289
|
-
// 优化初始化时Scroll滚动体验问题,通过透明度解决,默认透明度为0,滚动结束后恢复
|
|
2290
|
-
_this.elementRef.nativeElement.style.opacity = '1';
|
|
2291
|
-
_this.ganttUpper.viewChange.pipe(operators.startWith(null)).subscribe(function () {
|
|
2292
|
-
_this.scrollToToday();
|
|
2293
|
-
});
|
|
2294
|
-
});
|
|
2295
|
-
};
|
|
2296
|
-
NgxGanttRootComponent.prototype.setupViewScroll = function () {
|
|
2297
|
-
var _this = this;
|
|
2298
|
-
if (this.ganttUpper.disabledLoadOnScroll) {
|
|
2299
|
-
return;
|
|
2300
|
-
}
|
|
2301
|
-
this.dom
|
|
2302
|
-
.getViewerScroll()
|
|
2303
|
-
.pipe(operators.takeUntil(this.unsubscribe$))
|
|
2304
|
-
.subscribe(function (event) {
|
|
2305
|
-
if (event.direction === ScrollDirection.LEFT) {
|
|
2306
|
-
var dates_1 = _this.view.addStartDate();
|
|
2307
|
-
if (dates_1) {
|
|
2308
|
-
event.target.scrollLeft += _this.view.getDateRangeWidth(dates_1.start, dates_1.end);
|
|
2309
|
-
_this.ngZone.run(function () {
|
|
2310
|
-
_this.ganttUpper.loadOnScroll.emit({ start: dates_1.start.getUnixTime(), end: dates_1.end.getUnixTime() });
|
|
2311
|
-
});
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
if (event.direction === ScrollDirection.RIGHT) {
|
|
2315
|
-
var dates_2 = _this.view.addEndDate();
|
|
2316
|
-
if (dates_2) {
|
|
2317
|
-
_this.ngZone.run(function () {
|
|
2318
|
-
_this.ganttUpper.loadOnScroll.emit({ start: dates_2.start.getUnixTime(), end: dates_2.end.getUnixTime() });
|
|
2319
|
-
});
|
|
2320
|
-
}
|
|
2321
|
-
}
|
|
2322
|
-
});
|
|
2323
|
-
};
|
|
2324
|
-
NgxGanttRootComponent.prototype.setupResize = function () {
|
|
2325
|
-
var _this = this;
|
|
2326
|
-
this.dom
|
|
2327
|
-
.getResize()
|
|
2328
|
-
.pipe(operators.takeUntil(this.unsubscribe$))
|
|
2329
|
-
.subscribe(function () {
|
|
2330
|
-
_this.setupScrollClass();
|
|
2331
|
-
});
|
|
2332
|
-
};
|
|
2333
|
-
NgxGanttRootComponent.prototype.setupScrollClass = function () {
|
|
2334
|
-
var mainContainer = this.dom.mainContainer;
|
|
2335
|
-
var height = mainContainer.offsetHeight;
|
|
2336
|
-
var scrollHeight = mainContainer.scrollHeight;
|
|
2337
|
-
if (scrollHeight > height) {
|
|
2338
|
-
this.elementRef.nativeElement.className = 'gantt gantt-scroll';
|
|
2339
|
-
}
|
|
2340
|
-
else {
|
|
2341
|
-
this.elementRef.nativeElement.className = 'gantt';
|
|
2342
|
-
}
|
|
2343
|
-
};
|
|
2344
|
-
NgxGanttRootComponent.prototype.scrollToToday = function () {
|
|
2345
|
-
var x = this.view.getTodayXPoint();
|
|
2346
|
-
this.dom.scrollMainContainer(x);
|
|
2347
|
-
};
|
|
2348
|
-
return NgxGanttRootComponent;
|
|
2349
|
-
}());
|
|
2350
|
-
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 });
|
|
2351
|
-
NgxGanttRootComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: NgxGanttRootComponent, selector: "ngx-gantt-root", inputs: { sideWidth: "sideWidth" }, host: { properties: { "class.gantt": "this.ganttClass" } }, providers: [GanttDomService, GanttDragContainer], queries: [{ propertyName: "sideTemplate", first: true, predicate: ["sideTemplate"], descendants: true, static: true }, { propertyName: "mainTemplate", first: true, predicate: ["mainTemplate"], descendants: true, 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"] }] });
|
|
2352
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRootComponent, decorators: [{
|
|
2353
|
-
type: i0.Component,
|
|
2354
|
-
args: [{
|
|
2355
|
-
selector: 'ngx-gantt-root',
|
|
2356
|
-
templateUrl: './root.component.html',
|
|
2357
|
-
providers: [GanttDomService, GanttDragContainer]
|
|
2358
|
-
}]
|
|
2359
|
-
}], ctorParameters: function () {
|
|
2360
|
-
return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }, { type: GanttDomService }, { type: GanttDragContainer }, { type: GanttUpper, decorators: [{
|
|
2361
|
-
type: i0.Inject,
|
|
2362
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2363
|
-
}] }, { type: GanttPrintService, decorators: [{
|
|
2364
|
-
type: i0.Optional
|
|
2365
|
-
}] }];
|
|
2366
|
-
}, propDecorators: { sideWidth: [{
|
|
2367
|
-
type: i0.Input
|
|
2368
|
-
}], ganttClass: [{
|
|
2369
|
-
type: i0.HostBinding,
|
|
2370
|
-
args: ['class.gantt']
|
|
2371
|
-
}], sideTemplate: [{
|
|
2372
|
-
type: i0.ContentChild,
|
|
2373
|
-
args: ['sideTemplate', { static: true }]
|
|
2374
|
-
}], mainTemplate: [{
|
|
2375
|
-
type: i0.ContentChild,
|
|
2376
|
-
args: ['mainTemplate', { static: true }]
|
|
2377
|
-
}] } });
|
|
2378
|
-
|
|
2379
|
-
var GanttLinkLine = /** @class */ (function () {
|
|
2380
|
-
function GanttLinkLine() {
|
|
2381
|
-
}
|
|
2382
|
-
GanttLinkLine.prototype.generatePath = function (source, target, type) {
|
|
2383
|
-
if (source.before && source.after && target.before && target.after) {
|
|
2384
|
-
var path = '';
|
|
2385
|
-
switch (type) {
|
|
2386
|
-
case exports.GanttLinkType.ss:
|
|
2387
|
-
path = this.generateSSPath(source, target);
|
|
2388
|
-
break;
|
|
2389
|
-
case exports.GanttLinkType.ff:
|
|
2390
|
-
path = this.generateFFPath(source, target);
|
|
2391
|
-
break;
|
|
2392
|
-
case exports.GanttLinkType.sf:
|
|
2393
|
-
path = this.generateFSAndSFPath(source, target, type);
|
|
2394
|
-
break;
|
|
2395
|
-
default:
|
|
2396
|
-
path = this.generateFSAndSFPath(source, target);
|
|
2397
|
-
}
|
|
2398
|
-
return path;
|
|
2399
|
-
}
|
|
2400
|
-
};
|
|
2401
|
-
return GanttLinkLine;
|
|
2402
|
-
}());
|
|
2403
|
-
|
|
2404
|
-
var GanttLinkLineCurve = /** @class */ (function (_super) {
|
|
2405
|
-
__extends(GanttLinkLineCurve, _super);
|
|
2406
|
-
function GanttLinkLineCurve(ganttUpper) {
|
|
2407
|
-
var _this = _super.call(this) || this;
|
|
2408
|
-
_this.ganttUpper = ganttUpper;
|
|
2409
|
-
return _this;
|
|
2410
|
-
}
|
|
2411
|
-
GanttLinkLineCurve.prototype.generateSSPath = function (source, target) {
|
|
2412
|
-
var x1 = source.before.x;
|
|
2413
|
-
var y1 = source.before.y;
|
|
2414
|
-
var x4 = target.before.x;
|
|
2415
|
-
var y4 = target.before.y;
|
|
2416
|
-
var isMirror = y4 > y1 ? 0 : 1;
|
|
2417
|
-
var radius = Math.abs(y4 - y1) / 2;
|
|
2418
|
-
if (x4 > x1) {
|
|
2419
|
-
return "M " + x1 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2420
|
-
}
|
|
2421
|
-
else {
|
|
2422
|
-
return "M " + x1 + " " + y1 + "\n L " + x4 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x4 + " " + y4;
|
|
2423
|
-
}
|
|
2424
|
-
};
|
|
2425
|
-
GanttLinkLineCurve.prototype.generateFFPath = function (source, target) {
|
|
2426
|
-
var x1 = source.after.x;
|
|
2427
|
-
var y1 = source.after.y;
|
|
2428
|
-
var x4 = target.after.x;
|
|
2429
|
-
var y4 = target.after.y;
|
|
2430
|
-
var isMirror = y4 > y1 ? 1 : 0;
|
|
2431
|
-
var radius = Math.abs(y4 - y1) / 2;
|
|
2432
|
-
if (x4 > x1) {
|
|
2433
|
-
return "M " + x1 + " " + y1 + "\n L " + x4 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x4 + " " + y4;
|
|
2434
|
-
}
|
|
2435
|
-
else {
|
|
2436
|
-
return "M " + x1 + " " + y1 + "\n A " + radius + " " + radius + " 0 1 " + isMirror + " " + x1 + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2437
|
-
}
|
|
2438
|
-
};
|
|
2439
|
-
GanttLinkLineCurve.prototype.generateFSAndSFPath = function (source, target, type) {
|
|
2440
|
-
var _a;
|
|
2441
|
-
var x1 = source.after.x;
|
|
2442
|
-
var y1 = source.after.y;
|
|
2443
|
-
var x4 = target.before.x;
|
|
2444
|
-
var y4 = target.before.y;
|
|
2445
|
-
var bezierWeight = 0.5;
|
|
2446
|
-
if (type === exports.GanttLinkType.sf) {
|
|
2447
|
-
x1 = target.after.x;
|
|
2448
|
-
y1 = target.after.y;
|
|
2449
|
-
x4 = source.before.x;
|
|
2450
|
-
y4 = source.before.y;
|
|
2451
|
-
}
|
|
2452
|
-
var dx = Math.abs(x4 - x1) * bezierWeight;
|
|
2453
|
-
var x2 = x1 + dx;
|
|
2454
|
-
var x3 = x4 - dx;
|
|
2455
|
-
var centerX = (x1 + x4) / 2;
|
|
2456
|
-
var centerY = (y1 + y4) / 2;
|
|
2457
|
-
var controlX = this.ganttUpper.styles.lineHeight / 2;
|
|
2458
|
-
var controlY = this.ganttUpper.styles.lineHeight / 2;
|
|
2459
|
-
if (x1 >= x4) {
|
|
2460
|
-
if (Math.abs(y4 - y1) <= this.ganttUpper.styles.lineHeight) {
|
|
2461
|
-
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y4 > y1 ? y1 + controlX : y1 - controlX) + " " + x1 + " " + (y4 > y1 ? y1 + controlY : y1 - controlY) + "\n L " + x4 + " " + (y4 > y1 ? y4 - controlY : y4 + controlY) + "\n C " + (x4 - controlY) + " " + (y4 > y1 ? y4 - controlY : y4 + controlY) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
|
|
2462
|
-
}
|
|
2463
|
-
else {
|
|
2464
|
-
controlX = this.ganttUpper.styles.lineHeight;
|
|
2465
|
-
return "M " + x1 + " " + y1 + "\n C " + (x1 + controlX) + " " + y1 + " " + (x1 + controlX) + " " + (y4 > y1 ? y1 + controlX : y1 - controlX) + " " + centerX + " " + centerY + "\n C " + (x4 - controlX) + " " + (y4 > y1 ? y4 - controlX : y4 + controlX) + " " + (x4 - controlX) + " " + y4 + " " + x4 + " " + y4 + "\n ";
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
else if (((_a = this.ganttUpper.linkOptions) === null || _a === void 0 ? void 0 : _a.showArrow) && x4 - x1 < 200) {
|
|
2469
|
-
dx = Math.max(Math.abs(y4 - y1) * bezierWeight, 60);
|
|
2470
|
-
x2 = x1 + dx;
|
|
2471
|
-
x3 = x4 - dx;
|
|
2472
|
-
return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
|
|
2473
|
-
}
|
|
2474
|
-
return "M " + x1 + " " + y1 + " C " + x2 + " " + y1 + " " + x3 + " " + y4 + " " + x4 + " " + y4;
|
|
2475
|
-
};
|
|
2476
|
-
return GanttLinkLineCurve;
|
|
2477
|
-
}(GanttLinkLine));
|
|
2478
|
-
GanttLinkLineCurve = __decorate([
|
|
2479
|
-
__param(0, i0.Inject(GANTT_UPPER_TOKEN))
|
|
2480
|
-
], GanttLinkLineCurve);
|
|
2481
|
-
|
|
2482
|
-
var GanttLinkLineStraight = /** @class */ (function (_super) {
|
|
2483
|
-
__extends(GanttLinkLineStraight, _super);
|
|
2484
|
-
function GanttLinkLineStraight() {
|
|
2485
|
-
var _this = _super.call(this) || this;
|
|
2486
|
-
_this.pathControl = 20;
|
|
2487
|
-
return _this;
|
|
2488
|
-
}
|
|
2489
|
-
GanttLinkLineStraight.prototype.generateSSPath = function (source, target) {
|
|
2490
|
-
var x1 = source.before.x;
|
|
2491
|
-
var y1 = source.before.y;
|
|
2492
|
-
var x4 = target.before.x;
|
|
2493
|
-
var y4 = target.before.y;
|
|
2494
|
-
var control = this.pathControl;
|
|
2495
|
-
return "M " + x1 + " " + y1 + "\n L " + (x4 > x1 ? x1 - control : x4 - control) + " " + y1 + "\n L " + (x4 > x1 ? x1 - control : x4 - control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2496
|
-
};
|
|
2497
|
-
GanttLinkLineStraight.prototype.generateFFPath = function (source, target) {
|
|
2498
|
-
var x1 = source.after.x;
|
|
2499
|
-
var y1 = source.after.y;
|
|
2500
|
-
var x4 = target.after.x;
|
|
2501
|
-
var y4 = target.after.y;
|
|
2502
|
-
var control = this.pathControl;
|
|
2503
|
-
return "M " + x1 + " " + y1 + "\n L " + (x4 > x1 ? x4 + control : x1 + control) + " " + y1 + "\n L " + (x4 > x1 ? x4 + control : x1 + control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2504
|
-
};
|
|
2505
|
-
GanttLinkLineStraight.prototype.generateFSAndSFPath = function (source, target, type) {
|
|
2506
|
-
var x1 = source.after.x;
|
|
2507
|
-
var y1 = source.after.y;
|
|
2508
|
-
var x4 = target.before.x;
|
|
2509
|
-
var y4 = target.before.y;
|
|
2510
|
-
var control = this.pathControl;
|
|
2511
|
-
if (type === exports.GanttLinkType.sf) {
|
|
2512
|
-
x1 = target.after.x;
|
|
2513
|
-
y1 = target.after.y;
|
|
2514
|
-
x4 = source.before.x;
|
|
2515
|
-
y4 = source.before.y;
|
|
2516
|
-
}
|
|
2517
|
-
if (x4 - x1 >= 40) {
|
|
2518
|
-
return "M " + x1 + " " + y1 + "\n L " + (x1 + control) + " " + y1 + "\n L " + (x1 + control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2519
|
-
}
|
|
2520
|
-
else {
|
|
2521
|
-
return "M " + x1 + " " + y1 + "\n L " + (x1 + control) + " " + y1 + "\n L " + (x1 + control) + " " + (y4 > y1 ? y1 + control : y1 - control) + "\n L " + (x4 - control) + " " + (y4 > y1 ? y1 + control : y1 - control) + "\n L " + (x4 - control) + " " + y4 + "\n L " + x4 + " " + y4;
|
|
2522
|
-
}
|
|
2523
|
-
};
|
|
2524
|
-
return GanttLinkLineStraight;
|
|
2525
|
-
}(GanttLinkLine));
|
|
2526
|
-
|
|
2527
|
-
function createLineGenerator(type, ganttUpper) {
|
|
2528
|
-
switch (type) {
|
|
2529
|
-
case exports.GanttLinkLineType.curve:
|
|
2530
|
-
return new GanttLinkLineCurve(ganttUpper);
|
|
2531
|
-
case exports.GanttLinkLineType.straight:
|
|
2532
|
-
return new GanttLinkLineStraight();
|
|
2533
|
-
default:
|
|
2534
|
-
throw new Error('gantt link path type invalid');
|
|
2535
|
-
}
|
|
2536
|
-
}
|
|
2537
|
-
|
|
2538
|
-
var GanttLinksComponent = /** @class */ (function () {
|
|
2539
|
-
function GanttLinksComponent(ganttUpper, cdr, elementRef, ganttDragContainer) {
|
|
2540
|
-
this.ganttUpper = ganttUpper;
|
|
2541
|
-
this.cdr = cdr;
|
|
2542
|
-
this.elementRef = elementRef;
|
|
2543
|
-
this.ganttDragContainer = ganttDragContainer;
|
|
2544
|
-
this.groups = [];
|
|
2545
|
-
this.items = [];
|
|
2546
|
-
this.lineClick = new i0.EventEmitter();
|
|
2547
|
-
this.links = [];
|
|
2548
|
-
this.ganttLinkTypes = exports.GanttLinkType;
|
|
2549
|
-
this.showArrow = false;
|
|
2550
|
-
this.linkItems = [];
|
|
2551
|
-
this.firstChange = true;
|
|
2552
|
-
this.unsubscribe$ = new rxjs.Subject();
|
|
2553
|
-
this.ganttLinksOverlay = true;
|
|
2554
|
-
}
|
|
2555
|
-
GanttLinksComponent.prototype.ngOnInit = function () {
|
|
2556
|
-
var _this = this;
|
|
2557
|
-
this.linkLine = createLineGenerator(this.ganttUpper.linkOptions.lineType, this.ganttUpper);
|
|
2558
|
-
this.showArrow = this.ganttUpper.linkOptions.showArrow;
|
|
2559
|
-
this.buildLinks();
|
|
2560
|
-
this.firstChange = false;
|
|
2561
|
-
this.ganttDragContainer.dragStarted.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
2562
|
-
_this.elementRef.nativeElement.style.visibility = 'hidden';
|
|
2563
|
-
});
|
|
2564
|
-
rxjs.merge(this.ganttUpper.viewChange, this.ganttUpper.expandChange, this.ganttUpper.view.start$, this.ganttUpper.dragEnded, this.ganttUpper.linkDragEnded)
|
|
2565
|
-
.pipe(operators.takeUntil(this.unsubscribe$), operators.skip(1), operators.debounceTime(0))
|
|
2566
|
-
.subscribe(function () {
|
|
2567
|
-
_this.elementRef.nativeElement.style.visibility = 'visible';
|
|
2568
|
-
_this.buildLinks();
|
|
2569
|
-
_this.cdr.detectChanges();
|
|
2570
|
-
});
|
|
2571
|
-
};
|
|
2572
|
-
GanttLinksComponent.prototype.ngOnChanges = function () {
|
|
2573
|
-
if (!this.firstChange) {
|
|
2574
|
-
this.buildLinks();
|
|
2575
|
-
}
|
|
2576
|
-
};
|
|
2577
|
-
GanttLinksComponent.prototype.computeItemPosition = function () {
|
|
2578
|
-
var _this = this;
|
|
2579
|
-
var lineHeight = this.ganttUpper.styles.lineHeight;
|
|
2580
|
-
var barHeight = this.ganttUpper.styles.barHeight;
|
|
2581
|
-
this.linkItems = [];
|
|
2582
|
-
if (this.groups.length > 0) {
|
|
2583
|
-
var itemNum_1 = 0;
|
|
2584
|
-
var groupNum_1 = 0;
|
|
2585
|
-
this.groups.forEach(function (group) {
|
|
2586
|
-
groupNum_1++;
|
|
2587
|
-
if (group.expanded) {
|
|
2588
|
-
var items = recursiveItems(group.items);
|
|
2589
|
-
items.forEach(function (item, itemIndex) {
|
|
2590
|
-
var y = (groupNum_1 + itemNum_1 + itemIndex) * lineHeight + item.refs.y + barHeight / 2;
|
|
2591
|
-
_this.linkItems.push(Object.assign(Object.assign({}, item), { before: {
|
|
2592
|
-
x: item.refs.x,
|
|
2593
|
-
y: y
|
|
2594
|
-
}, after: {
|
|
2595
|
-
x: item.refs.x + item.refs.width,
|
|
2596
|
-
y: y
|
|
2597
|
-
} }));
|
|
2598
|
-
});
|
|
2599
|
-
itemNum_1 += items.length;
|
|
2600
|
-
}
|
|
2601
|
-
});
|
|
2602
|
-
}
|
|
2603
|
-
else {
|
|
2604
|
-
var items = recursiveItems(this.items);
|
|
2605
|
-
items.forEach(function (item, itemIndex) {
|
|
2606
|
-
var y = itemIndex * lineHeight + item.refs.y + barHeight / 2;
|
|
2607
|
-
_this.linkItems.push(Object.assign(Object.assign({}, item), { before: {
|
|
2608
|
-
x: item.refs.x,
|
|
2609
|
-
y: y
|
|
2610
|
-
}, after: {
|
|
2611
|
-
x: item.refs.x + item.refs.width,
|
|
2612
|
-
y: y
|
|
2613
|
-
} }));
|
|
2614
|
-
});
|
|
2615
|
-
}
|
|
2616
|
-
};
|
|
2617
|
-
GanttLinksComponent.prototype.buildLinks = function () {
|
|
2618
|
-
var _this = this;
|
|
2619
|
-
this.computeItemPosition();
|
|
2620
|
-
this.links = [];
|
|
2621
|
-
this.linkItems.forEach(function (source) {
|
|
2622
|
-
if (source.origin.start || source.origin.end) {
|
|
2623
|
-
source.links.forEach(function (link) {
|
|
2624
|
-
var target = _this.linkItems.find(function (item) { return item.id === link.link; });
|
|
2625
|
-
if (target && (target.origin.start || target.origin.end)) {
|
|
2626
|
-
var defaultColor = exports.LinkColors.default;
|
|
2627
|
-
var activeColor = exports.LinkColors.active;
|
|
2628
|
-
if (link.type === exports.GanttLinkType.fs && source.end.getTime() > target.start.getTime()) {
|
|
2629
|
-
defaultColor = exports.LinkColors.blocked;
|
|
2630
|
-
activeColor = exports.LinkColors.blocked;
|
|
2631
|
-
}
|
|
2632
|
-
if (link.color) {
|
|
2633
|
-
if (typeof link.color === 'string') {
|
|
2634
|
-
defaultColor = link.color;
|
|
2635
|
-
activeColor = link.color;
|
|
2636
|
-
}
|
|
2637
|
-
else {
|
|
2638
|
-
defaultColor = link.color.default;
|
|
2639
|
-
activeColor = link.color.active;
|
|
2640
|
-
}
|
|
2641
|
-
}
|
|
2642
|
-
_this.links.push({
|
|
2643
|
-
path: _this.linkLine.generatePath(source, target, link.type),
|
|
2644
|
-
source: source.origin,
|
|
2645
|
-
target: target.origin,
|
|
2646
|
-
type: link.type,
|
|
2647
|
-
color: defaultColor,
|
|
2648
|
-
defaultColor: defaultColor,
|
|
2649
|
-
activeColor: activeColor
|
|
2650
|
-
});
|
|
2651
|
-
}
|
|
2652
|
-
});
|
|
2653
|
-
}
|
|
2654
|
-
});
|
|
2655
|
-
};
|
|
2656
|
-
GanttLinksComponent.prototype.trackBy = function (index) {
|
|
2657
|
-
return index;
|
|
2658
|
-
};
|
|
2659
|
-
GanttLinksComponent.prototype.onLineClick = function (event, link) {
|
|
2660
|
-
this.lineClick.emit({
|
|
2661
|
-
event: event,
|
|
2662
|
-
source: link.source,
|
|
2663
|
-
target: link.target
|
|
2664
|
-
});
|
|
2665
|
-
};
|
|
2666
|
-
GanttLinksComponent.prototype.mouseEnterPath = function (link, index) {
|
|
2667
|
-
link.color = link.activeColor || link.defaultColor;
|
|
2668
|
-
if (index < this.links.length - 1) {
|
|
2669
|
-
this.links.splice(index, 1);
|
|
2670
|
-
this.links.push(link);
|
|
2671
|
-
}
|
|
2672
|
-
};
|
|
2673
|
-
GanttLinksComponent.prototype.mouseLeavePath = function (link) {
|
|
2674
|
-
link.color = link.defaultColor;
|
|
2675
|
-
};
|
|
2676
|
-
GanttLinksComponent.prototype.ngOnDestroy = function () {
|
|
2677
|
-
this.unsubscribe$.next();
|
|
2678
|
-
this.unsubscribe$.complete();
|
|
2679
|
-
};
|
|
2680
|
-
return GanttLinksComponent;
|
|
2681
|
-
}());
|
|
2682
|
-
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 });
|
|
2683
|
-
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"] }] });
|
|
2684
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttLinksComponent, decorators: [{
|
|
2685
|
-
type: i0.Component,
|
|
2686
|
-
args: [{
|
|
2687
|
-
selector: 'gantt-links-overlay',
|
|
2688
|
-
templateUrl: './links.component.html'
|
|
2689
|
-
}]
|
|
2690
|
-
}], ctorParameters: function () {
|
|
2691
|
-
return [{ type: GanttUpper, decorators: [{
|
|
2692
|
-
type: i0.Inject,
|
|
2693
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2694
|
-
}] }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ElementRef }, { type: GanttDragContainer }];
|
|
2695
|
-
}, propDecorators: { groups: [{
|
|
2696
|
-
type: i0.Input
|
|
2697
|
-
}], items: [{
|
|
2698
|
-
type: i0.Input
|
|
2699
|
-
}], lineClick: [{
|
|
2700
|
-
type: i0.Output
|
|
2701
|
-
}], ganttLinksOverlay: [{
|
|
2702
|
-
type: i0.HostBinding,
|
|
2703
|
-
args: ['class.gantt-links-overlay']
|
|
2704
|
-
}] } });
|
|
2705
|
-
|
|
2706
|
-
var GanttItemUpper = /** @class */ (function () {
|
|
2707
|
-
function GanttItemUpper(elementRef, ganttUpper) {
|
|
2708
|
-
this.elementRef = elementRef;
|
|
2709
|
-
this.ganttUpper = ganttUpper;
|
|
2710
|
-
this.firstChange = true;
|
|
2711
|
-
this.unsubscribe$ = new rxjs.Subject();
|
|
2712
|
-
}
|
|
2713
|
-
GanttItemUpper.prototype.onInit = function () {
|
|
2714
|
-
var _this = this;
|
|
2715
|
-
this.firstChange = false;
|
|
2716
|
-
this.item.refs$.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
2717
|
-
_this.setPositions();
|
|
2718
|
-
});
|
|
2719
|
-
};
|
|
2720
|
-
GanttItemUpper.prototype.onChanges = function () {
|
|
2721
|
-
if (!this.firstChange) {
|
|
2722
|
-
this.setPositions();
|
|
2723
|
-
}
|
|
2724
|
-
};
|
|
2725
|
-
GanttItemUpper.prototype.setPositions = function () {
|
|
2726
|
-
var itemElement = this.elementRef.nativeElement;
|
|
2727
|
-
itemElement.style.left = this.item.refs.x + 'px';
|
|
2728
|
-
itemElement.style.top = this.item.refs.y + 'px';
|
|
2729
|
-
itemElement.style.width = this.item.refs.width + 'px';
|
|
2730
|
-
if (this.item.type === exports.GanttItemType.bar) {
|
|
2731
|
-
itemElement.style.height = this.ganttUpper.styles.barHeight + 'px';
|
|
2732
|
-
}
|
|
2733
|
-
else if (this.item.type === exports.GanttItemType.range) {
|
|
2734
|
-
itemElement.style.height = rangeHeight + 'px';
|
|
2735
|
-
}
|
|
2736
|
-
else {
|
|
2737
|
-
}
|
|
2738
|
-
};
|
|
2739
|
-
GanttItemUpper.prototype.onDestroy = function () {
|
|
2740
|
-
this.unsubscribe$.next();
|
|
2741
|
-
this.unsubscribe$.complete();
|
|
2742
|
-
};
|
|
2743
|
-
return GanttItemUpper;
|
|
2744
|
-
}());
|
|
2745
|
-
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 });
|
|
2746
|
-
GanttItemUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.1.5", type: GanttItemUpper, inputs: { template: "template", item: "item" }, ngImport: i0__namespace });
|
|
2747
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttItemUpper, decorators: [{
|
|
2748
|
-
type: i0.Directive
|
|
2749
|
-
}], ctorParameters: function () {
|
|
2750
|
-
return [{ type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
|
|
2751
|
-
type: i0.Inject,
|
|
2752
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2753
|
-
}] }];
|
|
2754
|
-
}, propDecorators: { template: [{
|
|
2755
|
-
type: i0.Input
|
|
2756
|
-
}], item: [{
|
|
2757
|
-
type: i0.Input
|
|
2758
|
-
}] } });
|
|
2759
|
-
|
|
2760
|
-
var NgxGanttRangeComponent = /** @class */ (function (_super) {
|
|
2761
|
-
__extends(NgxGanttRangeComponent, _super);
|
|
2762
|
-
function NgxGanttRangeComponent(elementRef, ganttUpper) {
|
|
2763
|
-
var _this = _super.call(this, elementRef, ganttUpper) || this;
|
|
2764
|
-
_this.ganttRangeClass = true;
|
|
2765
|
-
return _this;
|
|
2766
|
-
}
|
|
2767
|
-
NgxGanttRangeComponent.prototype.ngOnInit = function () {
|
|
2768
|
-
_super.prototype.onInit.call(this);
|
|
2769
|
-
};
|
|
2770
|
-
NgxGanttRangeComponent.prototype.ngOnChanges = function () {
|
|
2771
|
-
_super.prototype.onChanges.call(this);
|
|
2772
|
-
};
|
|
2773
|
-
NgxGanttRangeComponent.prototype.ngOnDestroy = function () {
|
|
2774
|
-
_super.prototype.onDestroy.call(this);
|
|
2775
|
-
};
|
|
2776
|
-
return NgxGanttRangeComponent;
|
|
2777
|
-
}(GanttItemUpper));
|
|
2778
|
-
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 });
|
|
2779
|
-
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, usesOnChanges: 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"] }] });
|
|
2780
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttRangeComponent, decorators: [{
|
|
2781
|
-
type: i0.Component,
|
|
2782
|
-
args: [{
|
|
2783
|
-
selector: 'ngx-gantt-range,gantt-range',
|
|
2784
|
-
templateUrl: './range.component.html'
|
|
2785
|
-
}]
|
|
2786
|
-
}], ctorParameters: function () {
|
|
2787
|
-
return [{ type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
|
|
2788
|
-
type: i0.Inject,
|
|
2789
|
-
args: [GANTT_UPPER_TOKEN]
|
|
2790
|
-
}] }];
|
|
2791
|
-
}, propDecorators: { ganttRangeClass: [{
|
|
2792
|
-
type: i0.HostBinding,
|
|
2793
|
-
args: ['class.gantt-range']
|
|
2794
|
-
}] } });
|
|
2795
|
-
|
|
2796
|
-
var dragMinWidth = 10;
|
|
2797
|
-
var activeClass = 'gantt-bar-active';
|
|
2798
|
-
var dropActiveClass = 'gantt-bar-drop-active';
|
|
2799
|
-
var singleDropActiveClass = 'gantt-bar-single-drop-active';
|
|
2800
|
-
function createSvgElement(qualifiedName, className) {
|
|
2801
|
-
var element = document.createElementNS('http://www.w3.org/2000/svg', qualifiedName);
|
|
2802
|
-
element.classList.add(className);
|
|
2803
|
-
return element;
|
|
2804
|
-
}
|
|
2805
|
-
var GanttBarDrag = /** @class */ (function () {
|
|
2806
|
-
function GanttBarDrag(dragDrop, dom, dragContainer) {
|
|
2807
|
-
this.dragDrop = dragDrop;
|
|
2808
|
-
this.dom = dom;
|
|
2809
|
-
this.dragContainer = dragContainer;
|
|
2810
|
-
this.dragRefs = [];
|
|
2811
|
-
this.destroy$ = new rxjs.Subject();
|
|
2812
|
-
}
|
|
2813
|
-
Object.defineProperty(GanttBarDrag.prototype, "dragDisabled", {
|
|
2814
|
-
get: function () {
|
|
2815
|
-
return !this.item.draggable || !this.ganttUpper.draggable;
|
|
2816
|
-
},
|
|
2817
|
-
enumerable: false,
|
|
2818
|
-
configurable: true
|
|
2819
|
-
});
|
|
2820
|
-
Object.defineProperty(GanttBarDrag.prototype, "linkDragDisabled", {
|
|
2821
|
-
get: function () {
|
|
2822
|
-
return !this.item.linkable || !this.ganttUpper.linkable;
|
|
2823
|
-
},
|
|
2824
|
-
enumerable: false,
|
|
2825
|
-
configurable: true
|
|
2826
|
-
});
|
|
2827
|
-
GanttBarDrag.prototype.createMouseEvents = function () {
|
|
2828
|
-
var _this = this;
|
|
2829
|
-
var _a, _b, _c;
|
|
2830
|
-
var dropClass = ((_b = (_a = this.ganttUpper.config.linkOptions) === null || _a === void 0 ? void 0 : _a.dependencyTypes) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
|
2831
|
-
((_c = this.ganttUpper.config.linkOptions) === null || _c === void 0 ? void 0 : _c.dependencyTypes[0]) === exports.GanttLinkType.fs
|
|
2832
|
-
? singleDropActiveClass
|
|
2833
|
-
: dropActiveClass;
|
|
2834
|
-
rxjs.fromEvent(this.barElement, 'mouseenter')
|
|
2835
|
-
.pipe(operators.takeUntil(this.destroy$))
|
|
2836
|
-
.subscribe(function (event) {
|
|
2837
|
-
if (_this.dragContainer.linkDraggingId && _this.dragContainer.linkDraggingId !== _this.item.id) {
|
|
2838
|
-
if (_this.item.linkable) {
|
|
2839
|
-
_this.barElement.classList.add(dropClass);
|
|
2840
|
-
_this.dragContainer.emitLinkDragEntered({
|
|
2841
|
-
item: _this.item,
|
|
2842
|
-
element: _this.barElement
|
|
2843
|
-
});
|
|
2844
|
-
}
|
|
2845
|
-
}
|
|
2846
|
-
else {
|
|
2847
|
-
_this.barElement.classList.add(activeClass);
|
|
2848
|
-
}
|
|
2849
|
-
});
|
|
2850
|
-
rxjs.fromEvent(this.barElement, 'mouseleave')
|
|
2851
|
-
.pipe(operators.takeUntil(this.destroy$))
|
|
2852
|
-
.subscribe(function (event) {
|
|
2853
|
-
if (!_this.dragContainer.linkDraggingId) {
|
|
2854
|
-
_this.barElement.classList.remove(activeClass);
|
|
2855
|
-
}
|
|
2856
|
-
else {
|
|
2857
|
-
_this.dragContainer.emitLinkDragLeaved();
|
|
2858
|
-
}
|
|
2859
|
-
_this.barElement.classList.remove(dropClass);
|
|
2860
|
-
});
|
|
2861
|
-
};
|
|
2862
|
-
GanttBarDrag.prototype.createBarDrag = function () {
|
|
2863
|
-
var _this = this;
|
|
2864
|
-
var dragRef = this.dragDrop.createDrag(this.barElement);
|
|
2865
|
-
dragRef.lockAxis = 'x';
|
|
2866
|
-
dragRef.started.subscribe(function () {
|
|
2867
|
-
_this.setDraggingStyles();
|
|
2868
|
-
_this.dragContainer.dragStarted.emit({ item: _this.item.origin });
|
|
2869
|
-
});
|
|
2870
|
-
dragRef.moved.subscribe(function (event) {
|
|
2871
|
-
var currentX = _this.item.refs.x + event.distance.x;
|
|
2872
|
-
var currentDate = _this.ganttUpper.view.getDateByXPoint(currentX);
|
|
2873
|
-
var currentStartX = _this.ganttUpper.view.getXPointByDate(currentDate);
|
|
2874
|
-
var dayWidth = _this.ganttUpper.view.getDayOccupancyWidth(currentDate);
|
|
2875
|
-
var diffDays = dateFns.differenceInCalendarDays(_this.item.end.value, _this.item.start.value);
|
|
2876
|
-
var start = currentDate;
|
|
2877
|
-
var end = currentDate.addDays(diffDays);
|
|
2878
|
-
if (currentX > currentStartX + dayWidth / 2) {
|
|
2879
|
-
start = start.addDays(1);
|
|
2880
|
-
end = end.addDays(1);
|
|
2881
|
-
}
|
|
2882
|
-
_this.openDragBackdrop(_this.barElement, start, end);
|
|
2883
|
-
_this.item.updateDate(start, end);
|
|
2884
|
-
_this.dragContainer.dragMoved.emit({ item: _this.item.origin });
|
|
2885
|
-
});
|
|
2886
|
-
dragRef.ended.subscribe(function (event) {
|
|
2887
|
-
_this.clearDraggingStyles();
|
|
2888
|
-
_this.closeDragBackdrop();
|
|
2889
|
-
event.source.reset();
|
|
2890
|
-
_this.dragContainer.dragEnded.emit({ item: _this.item.origin });
|
|
2891
|
-
});
|
|
2892
|
-
this.barDragRef = dragRef;
|
|
2893
|
-
return dragRef;
|
|
2894
|
-
};
|
|
2895
|
-
GanttBarDrag.prototype.createBarHandleDrags = function () {
|
|
2896
|
-
var _this = this;
|
|
2897
|
-
var dragRefs = [];
|
|
2898
|
-
var handles = this.barElement.querySelectorAll('.drag-handles .handle');
|
|
2899
|
-
handles.forEach(function (handle, index) {
|
|
2900
|
-
var isBefore = index === 0;
|
|
2901
|
-
var dragRef = _this.dragDrop.createDrag(handle);
|
|
2902
|
-
dragRef.lockAxis = 'x';
|
|
2903
|
-
dragRef.withBoundaryElement(_this.dom.root);
|
|
2904
|
-
dragRef.started.subscribe(function () {
|
|
2905
|
-
_this.setDraggingStyles();
|
|
2906
|
-
_this.dragContainer.dragStarted.emit({ item: _this.item.origin });
|
|
2907
|
-
});
|
|
2908
|
-
dragRef.moved.subscribe(function (event) {
|
|
2909
|
-
if (isBefore) {
|
|
2910
|
-
var x = _this.item.refs.x + event.distance.x;
|
|
2911
|
-
var width = _this.item.refs.width + event.distance.x * -1;
|
|
2912
|
-
if (width > dragMinWidth) {
|
|
2913
|
-
_this.barElement.style.width = width + 'px';
|
|
2914
|
-
_this.barElement.style.left = x + 'px';
|
|
2915
|
-
_this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(x), _this.ganttUpper.view.getDateByXPoint(x + width));
|
|
2916
|
-
_this.item.updateDate(_this.ganttUpper.view.getDateByXPoint(x), _this.item.end);
|
|
2917
|
-
}
|
|
2918
|
-
}
|
|
2919
|
-
else {
|
|
2920
|
-
var width = _this.item.refs.width + event.distance.x;
|
|
2921
|
-
if (width > dragMinWidth) {
|
|
2922
|
-
_this.barElement.style.width = width + 'px';
|
|
2923
|
-
_this.openDragBackdrop(_this.barElement, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x), _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
|
|
2924
|
-
}
|
|
2925
|
-
_this.item.updateDate(_this.item.start, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + width));
|
|
2926
|
-
}
|
|
2927
|
-
_this.dragContainer.dragMoved.emit({ item: _this.item.origin });
|
|
2928
|
-
event.source.reset();
|
|
2929
|
-
});
|
|
2930
|
-
dragRef.ended.subscribe(function (event) {
|
|
2931
|
-
if (isBefore) {
|
|
2932
|
-
var width = _this.item.refs.width + event.distance.x * -1;
|
|
2933
|
-
if (width > dragMinWidth) {
|
|
2934
|
-
_this.item.updateDate(_this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + event.distance.x), _this.item.end);
|
|
2935
|
-
}
|
|
2936
|
-
else {
|
|
2937
|
-
_this.item.updateDate(_this.item.end.startOfDay(), _this.item.end);
|
|
2938
|
-
}
|
|
2939
|
-
}
|
|
2940
|
-
else {
|
|
2941
|
-
var width = _this.item.refs.width + event.distance.x;
|
|
2942
|
-
if (width > dragMinWidth) {
|
|
2943
|
-
_this.item.updateDate(_this.item.start, _this.ganttUpper.view.getDateByXPoint(_this.item.refs.x + _this.item.refs.width + event.distance.x));
|
|
2944
|
-
}
|
|
2945
|
-
else {
|
|
2946
|
-
_this.item.updateDate(_this.item.start, _this.item.start.endOfDay());
|
|
2947
|
-
}
|
|
2948
|
-
}
|
|
2949
|
-
_this.clearDraggingStyles();
|
|
2950
|
-
_this.closeDragBackdrop();
|
|
2951
|
-
_this.dragContainer.dragEnded.emit({ item: _this.item.origin });
|
|
2952
|
-
});
|
|
2953
|
-
dragRefs.push(dragRef);
|
|
2954
|
-
});
|
|
2955
|
-
return dragRefs;
|
|
2956
|
-
};
|
|
2957
|
-
GanttBarDrag.prototype.createLinkHandleDrags = function () {
|
|
2958
|
-
var _this = this;
|
|
2959
|
-
var dragRefs = [];
|
|
2960
|
-
var handles = this.barElement.querySelectorAll('.link-handles .handle');
|
|
2961
|
-
handles.forEach(function (handle, index) {
|
|
2962
|
-
var isBegin = index === 0;
|
|
2963
|
-
var dragRef = _this.dragDrop.createDrag(handle);
|
|
2964
|
-
dragRef.withBoundaryElement(_this.dom.root);
|
|
2965
|
-
dragRef.beforeStarted.subscribe(function () {
|
|
2966
|
-
handle.style.pointerEvents = 'none';
|
|
2967
|
-
if (_this.barDragRef) {
|
|
2968
|
-
_this.barDragRef.disabled = true;
|
|
2969
|
-
}
|
|
2970
|
-
_this.createLinkDraggingLine();
|
|
2971
|
-
_this.dragContainer.emitLinkDragStarted({
|
|
2972
|
-
element: _this.barElement,
|
|
2973
|
-
item: _this.item,
|
|
2974
|
-
pos: isBegin ? InBarPosition.start : InBarPosition.finish
|
|
2975
|
-
});
|
|
2976
|
-
});
|
|
2977
|
-
dragRef.moved.subscribe(function () {
|
|
2978
|
-
var positions = _this.calcLinkLinePositions(handle, isBegin);
|
|
2979
|
-
_this.linkDraggingLine.setAttribute('x1', positions.x1.toString());
|
|
2980
|
-
_this.linkDraggingLine.setAttribute('y1', positions.y1.toString());
|
|
2981
|
-
_this.linkDraggingLine.setAttribute('x2', positions.x2.toString());
|
|
2982
|
-
_this.linkDraggingLine.setAttribute('y2', positions.y2.toString());
|
|
2983
|
-
});
|
|
2984
|
-
dragRef.ended.subscribe(function (event) {
|
|
2985
|
-
handle.style.pointerEvents = '';
|
|
2986
|
-
if (_this.barDragRef) {
|
|
2987
|
-
_this.barDragRef.disabled = false;
|
|
2988
|
-
}
|
|
2989
|
-
// 计算line拖动的落点位于目标Bar的值,如果值大于Bar宽度的一半,说明是拖动到Begin位置,否则则为拖动到End位置
|
|
2990
|
-
if (_this.dragContainer.linkDragPath.to) {
|
|
2991
|
-
var placePointX = event.source.getRootElement().getBoundingClientRect().x -
|
|
2992
|
-
_this.dragContainer.linkDragPath.to.element.getBoundingClientRect().x;
|
|
2993
|
-
_this.dragContainer.emitLinkDragEnded(Object.assign(Object.assign({}, _this.dragContainer.linkDragPath.to), { pos: placePointX < _this.dragContainer.linkDragPath.to.item.refs.width / 2
|
|
2994
|
-
? InBarPosition.start
|
|
2995
|
-
: InBarPosition.finish }));
|
|
2996
|
-
}
|
|
2997
|
-
event.source.reset();
|
|
2998
|
-
_this.barElement.classList.remove(activeClass);
|
|
2999
|
-
_this.destroyLinkDraggingLine();
|
|
3000
|
-
});
|
|
3001
|
-
dragRefs.push(dragRef);
|
|
3002
|
-
});
|
|
3003
|
-
return dragRefs;
|
|
3004
|
-
};
|
|
3005
|
-
GanttBarDrag.prototype.openDragBackdrop = function (dragElement, start, end) {
|
|
3006
|
-
var dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
|
|
3007
|
-
var dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
|
|
3008
|
-
var rootRect = this.dom.root.getBoundingClientRect();
|
|
3009
|
-
var dragRect = dragElement.getBoundingClientRect();
|
|
3010
|
-
var left = dragRect.left - rootRect.left - this.dom.side.clientWidth;
|
|
3011
|
-
var width = dragRect.right - dragRect.left;
|
|
3012
|
-
dragMaskElement.style.left = left + 'px';
|
|
3013
|
-
dragMaskElement.style.width = width + 'px';
|
|
3014
|
-
dragMaskElement.querySelector('.start').innerHTML = start.format('MM-dd');
|
|
3015
|
-
dragMaskElement.querySelector('.end').innerHTML = end.format('MM-dd');
|
|
3016
|
-
dragMaskElement.style.display = 'block';
|
|
3017
|
-
dragBackdropElement.style.display = 'block';
|
|
3018
|
-
};
|
|
3019
|
-
GanttBarDrag.prototype.closeDragBackdrop = function () {
|
|
3020
|
-
var dragMaskElement = this.dom.root.querySelector('.gantt-drag-mask');
|
|
3021
|
-
var dragBackdropElement = this.dom.root.querySelector('.gantt-drag-backdrop');
|
|
3022
|
-
dragMaskElement.style.display = 'none';
|
|
3023
|
-
dragBackdropElement.style.display = 'none';
|
|
3024
|
-
};
|
|
3025
|
-
GanttBarDrag.prototype.setDraggingStyles = function () {
|
|
3026
|
-
this.barElement.style.pointerEvents = 'none';
|
|
3027
|
-
this.barElement.classList.add('gantt-bar-draggable-drag');
|
|
3028
|
-
};
|
|
3029
|
-
GanttBarDrag.prototype.clearDraggingStyles = function () {
|
|
3030
|
-
this.barElement.style.pointerEvents = '';
|
|
3031
|
-
this.barElement.classList.remove('gantt-bar-draggable-drag');
|
|
3032
|
-
};
|
|
3033
|
-
GanttBarDrag.prototype.calcLinkLinePositions = function (target, isBefore) {
|
|
3034
|
-
var rootRect = this.dom.root.getBoundingClientRect();
|
|
3035
|
-
var targetRect = target.getBoundingClientRect();
|
|
3036
|
-
var layerRect = target.parentElement.parentElement.getBoundingClientRect();
|
|
3037
|
-
return {
|
|
3038
|
-
x1: layerRect.left + (isBefore ? 0 : layerRect.width) - rootRect.left,
|
|
3039
|
-
y1: layerRect.top + layerRect.height / 2 - rootRect.top,
|
|
3040
|
-
x2: targetRect.left - rootRect.left + targetRect.width / 2,
|
|
3041
|
-
y2: targetRect.top - rootRect.top + targetRect.height / 2
|
|
3042
|
-
};
|
|
3043
|
-
};
|
|
3044
|
-
GanttBarDrag.prototype.createLinkDraggingLine = function () {
|
|
3045
|
-
if (!this.linkDraggingLine) {
|
|
3046
|
-
var svgElement = createSvgElement('svg', 'gantt-link-drag-container');
|
|
3047
|
-
var linElement = createSvgElement('line', 'link-dragging-line');
|
|
3048
|
-
linElement.style.pointerEvents = 'none';
|
|
3049
|
-
svgElement.appendChild(linElement);
|
|
3050
|
-
this.dom.root.appendChild(svgElement);
|
|
3051
|
-
this.linkDraggingLine = linElement;
|
|
3052
|
-
}
|
|
3053
|
-
};
|
|
3054
|
-
GanttBarDrag.prototype.destroyLinkDraggingLine = function () {
|
|
3055
|
-
if (this.linkDraggingLine) {
|
|
3056
|
-
this.linkDraggingLine.parentElement.remove();
|
|
3057
|
-
this.linkDraggingLine = null;
|
|
3058
|
-
}
|
|
3059
|
-
};
|
|
3060
|
-
GanttBarDrag.prototype.createDrags = function (elementRef, item, ganttUpper) {
|
|
3061
|
-
var _d, _e;
|
|
3062
|
-
this.item = item;
|
|
3063
|
-
this.barElement = elementRef.nativeElement;
|
|
3064
|
-
this.ganttUpper = ganttUpper;
|
|
3065
|
-
if (!item.draggable || (this.dragDisabled && this.linkDragDisabled)) {
|
|
3066
|
-
return;
|
|
3067
|
-
}
|
|
3068
|
-
else {
|
|
3069
|
-
this.createMouseEvents();
|
|
3070
|
-
if (!this.dragDisabled) {
|
|
3071
|
-
var dragRef = this.createBarDrag();
|
|
3072
|
-
var dragHandlesRefs = this.createBarHandleDrags();
|
|
3073
|
-
(_d = this.dragRefs).push.apply(_d, __spreadArray([dragRef], __read(dragHandlesRefs)));
|
|
3074
|
-
}
|
|
3075
|
-
if (!this.linkDragDisabled) {
|
|
3076
|
-
var linkDragRefs = this.createLinkHandleDrags();
|
|
3077
|
-
(_e = this.dragRefs).push.apply(_e, __spreadArray([], __read(linkDragRefs)));
|
|
3078
|
-
}
|
|
3079
|
-
}
|
|
3080
|
-
};
|
|
3081
|
-
GanttBarDrag.prototype.ngOnDestroy = function () {
|
|
3082
|
-
this.closeDragBackdrop();
|
|
3083
|
-
this.dragRefs.forEach(function (dragRef) { return dragRef.dispose(); });
|
|
3084
|
-
this.destroy$.next();
|
|
3085
|
-
this.destroy$.complete();
|
|
3086
|
-
};
|
|
3087
|
-
return GanttBarDrag;
|
|
3088
|
-
}());
|
|
3089
|
-
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 }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3090
|
-
GanttBarDrag.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag });
|
|
3091
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttBarDrag, decorators: [{
|
|
3092
|
-
type: i0.Injectable
|
|
3093
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.DragDrop }, { type: GanttDomService }, { type: GanttDragContainer }]; } });
|
|
3094
|
-
|
|
3095
|
-
function linearGradient(sideOrCorner, color, stop) {
|
|
3096
|
-
return "linear-gradient(" + sideOrCorner + "," + color + " 0%," + stop + " 40%)";
|
|
3097
|
-
}
|
|
3098
|
-
var NgxGanttBarComponent = /** @class */ (function (_super) {
|
|
3099
|
-
__extends(NgxGanttBarComponent, _super);
|
|
3100
|
-
function NgxGanttBarComponent(dragContainer, drag, elementRef, ganttUpper) {
|
|
3101
|
-
var _this = _super.call(this, elementRef, ganttUpper) || this;
|
|
3102
|
-
_this.dragContainer = dragContainer;
|
|
3103
|
-
_this.drag = drag;
|
|
3104
|
-
_this.ganttUpper = ganttUpper;
|
|
3105
|
-
_this.barClick = new i0.EventEmitter();
|
|
3106
|
-
_this.ganttItemClass = true;
|
|
3107
|
-
_this.color = 'red';
|
|
3108
|
-
return _this;
|
|
3109
|
-
}
|
|
3110
|
-
NgxGanttBarComponent.prototype.ngOnInit = function () {
|
|
3111
|
-
var _this = this;
|
|
3112
|
-
_super.prototype.onInit.call(this);
|
|
3113
|
-
this.dragContainer.dragEnded.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () {
|
|
3114
|
-
_this.setContentBackground();
|
|
3115
|
-
});
|
|
3116
|
-
};
|
|
3117
|
-
NgxGanttBarComponent.prototype.ngAfterViewInit = function () {
|
|
3118
|
-
this.drag.createDrags(this.elementRef, this.item, this.ganttUpper);
|
|
3119
|
-
this.setContentBackground();
|
|
3120
|
-
};
|
|
3121
|
-
NgxGanttBarComponent.prototype.ngOnChanges = function () {
|
|
3122
|
-
_super.prototype.onChanges.call(this);
|
|
3123
|
-
};
|
|
3124
|
-
NgxGanttBarComponent.prototype.onBarClick = function (event) {
|
|
3125
|
-
this.barClick.emit({ event: event, item: this.item.origin });
|
|
3126
|
-
};
|
|
3127
|
-
NgxGanttBarComponent.prototype.setContentBackground = function () {
|
|
3128
|
-
var contentElement = this.contentElementRef.nativeElement;
|
|
3129
|
-
var color = this.item.color || barBackground;
|
|
3130
|
-
var style = this.item.barStyle || {};
|
|
3131
|
-
if (this.item.origin.start && this.item.origin.end) {
|
|
3132
|
-
style.background = color;
|
|
3133
|
-
style.borderRadius = '';
|
|
3134
|
-
}
|
|
3135
|
-
if (this.item.origin.start && !this.item.origin.end) {
|
|
3136
|
-
style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3137
|
-
style.borderRadius = '4px 12.5px 12.5px 4px';
|
|
3138
|
-
}
|
|
3139
|
-
if (!this.item.origin.start && this.item.origin.end) {
|
|
3140
|
-
style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1));
|
|
3141
|
-
style.borderRadius = '12.5px 4px 4px 12.5px';
|
|
3142
|
-
}
|
|
3143
|
-
if (this.item.progress >= 0) {
|
|
3144
|
-
var contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress');
|
|
3145
|
-
style.background = hexToRgb(color, 0.3);
|
|
3146
|
-
style.borderRadius = '';
|
|
3147
|
-
contentProgressElement.style.background = color;
|
|
3148
|
-
}
|
|
3149
|
-
for (var key in style) {
|
|
3150
|
-
if (style.hasOwnProperty(key)) {
|
|
3151
|
-
contentElement.style[key] = style[key];
|
|
3152
|
-
}
|
|
3153
|
-
}
|
|
3154
|
-
};
|
|
3155
|
-
NgxGanttBarComponent.prototype.stopPropagation = function (event) {
|
|
3156
|
-
event.stopPropagation();
|
|
3157
|
-
};
|
|
3158
|
-
NgxGanttBarComponent.prototype.ngOnDestroy = function () {
|
|
3159
|
-
_super.prototype.onDestroy.call(this);
|
|
3160
|
-
};
|
|
3161
|
-
return NgxGanttBarComponent;
|
|
3162
|
-
}(GanttItemUpper));
|
|
3163
|
-
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 }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3164
|
-
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 }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"gantt-bar-layer\">\n <div *ngIf=\"item.draggable && ganttUpper.draggable\" class=\"drag-handles\">\n <ng-container>\n <span class=\"handle\" (mousedown)=\"stopPropagation($event)\"></span>\n <span class=\"handle\" (mousedown)=\"stopPropagation($event)\"></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"] }] });
|
|
3165
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttBarComponent, decorators: [{
|
|
3166
|
-
type: i0.Component,
|
|
3167
|
-
args: [{
|
|
3168
|
-
selector: 'ngx-gantt-bar,gantt-bar',
|
|
3169
|
-
templateUrl: './bar.component.html',
|
|
3170
|
-
providers: [GanttBarDrag]
|
|
3171
|
-
}]
|
|
3172
|
-
}], ctorParameters: function () {
|
|
3173
|
-
return [{ type: GanttDragContainer }, { type: GanttBarDrag }, { type: i0__namespace.ElementRef }, { type: GanttUpper, decorators: [{
|
|
3174
|
-
type: i0.Inject,
|
|
3175
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3176
|
-
}] }];
|
|
3177
|
-
}, propDecorators: { barClick: [{
|
|
3178
|
-
type: i0.Output
|
|
3179
|
-
}], contentElementRef: [{
|
|
3180
|
-
type: i0.ViewChild,
|
|
3181
|
-
args: ['content']
|
|
3182
|
-
}], ganttItemClass: [{
|
|
3183
|
-
type: i0.HostBinding,
|
|
3184
|
-
args: ['class.gantt-bar']
|
|
3185
|
-
}] } });
|
|
3186
|
-
|
|
3187
|
-
var GanttMainComponent = /** @class */ (function () {
|
|
3188
|
-
function GanttMainComponent(ganttUpper) {
|
|
3189
|
-
this.ganttUpper = ganttUpper;
|
|
3190
|
-
this.barClick = new i0.EventEmitter();
|
|
3191
|
-
this.lineClick = new i0.EventEmitter();
|
|
3192
|
-
this.ganttMainClass = true;
|
|
3193
|
-
}
|
|
3194
|
-
GanttMainComponent.prototype.ngOnInit = function () { };
|
|
3195
|
-
GanttMainComponent.prototype.trackBy = function (index, item) {
|
|
3196
|
-
return item.id || index;
|
|
3197
|
-
};
|
|
3198
|
-
return GanttMainComponent;
|
|
3199
|
-
}());
|
|
3200
|
-
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 });
|
|
3201
|
-
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 } });
|
|
3202
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: GanttMainComponent, decorators: [{
|
|
3203
|
-
type: i0.Component,
|
|
3204
|
-
args: [{
|
|
3205
|
-
selector: 'gantt-main',
|
|
3206
|
-
templateUrl: './gantt-main.component.html'
|
|
3207
|
-
}]
|
|
3208
|
-
}], ctorParameters: function () {
|
|
3209
|
-
return [{ type: GanttUpper, decorators: [{
|
|
3210
|
-
type: i0.Inject,
|
|
3211
|
-
args: [GANTT_UPPER_TOKEN]
|
|
3212
|
-
}] }];
|
|
3213
|
-
}, propDecorators: { groups: [{
|
|
3214
|
-
type: i0.Input
|
|
3215
|
-
}], items: [{
|
|
3216
|
-
type: i0.Input
|
|
3217
|
-
}], groupHeaderTemplate: [{
|
|
3218
|
-
type: i0.Input
|
|
3219
|
-
}], itemTemplate: [{
|
|
3220
|
-
type: i0.Input
|
|
3221
|
-
}], barTemplate: [{
|
|
3222
|
-
type: i0.Input
|
|
3223
|
-
}], rangeTemplate: [{
|
|
3224
|
-
type: i0.Input
|
|
3225
|
-
}], barClick: [{
|
|
3226
|
-
type: i0.Output
|
|
3227
|
-
}], lineClick: [{
|
|
3228
|
-
type: i0.Output
|
|
3229
|
-
}], ganttMainClass: [{
|
|
3230
|
-
type: i0.HostBinding,
|
|
3231
|
-
args: ['class.gantt-main-container']
|
|
3232
|
-
}] } });
|
|
3233
|
-
|
|
3234
|
-
var NgxGanttComponent = /** @class */ (function (_super) {
|
|
3235
|
-
__extends(NgxGanttComponent, _super);
|
|
3236
|
-
function NgxGanttComponent(elementRef, cdr, ngZone, config) {
|
|
3237
|
-
var _this = _super.call(this, elementRef, cdr, ngZone, config) || this;
|
|
3238
|
-
_this.maxLevel = 2;
|
|
3239
|
-
_this.linkDragStarted = new i0.EventEmitter();
|
|
3240
|
-
_this.linkDragEnded = new i0.EventEmitter();
|
|
3241
|
-
_this.lineClick = new i0.EventEmitter();
|
|
3242
|
-
_this.selectedChange = new i0.EventEmitter();
|
|
3243
|
-
_this.ngUnsubscribe$ = new rxjs.Subject();
|
|
3244
|
-
_this.sideTableWidth = sideWidth;
|
|
3245
|
-
return _this;
|
|
3246
|
-
}
|
|
3247
|
-
NgxGanttComponent.prototype.ngOnInit = function () {
|
|
3248
|
-
var _this = this;
|
|
3249
|
-
_super.prototype.onInit.call(this);
|
|
3250
|
-
this.ngZone.onStable.pipe(operators.take(1)).subscribe(function () {
|
|
3251
|
-
_this.dragContainer.linkDragStarted.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
|
|
3252
|
-
_this.linkDragStarted.emit(event);
|
|
3253
|
-
});
|
|
3254
|
-
_this.dragContainer.linkDragEnded.pipe(operators.takeUntil(_this.ngUnsubscribe$)).subscribe(function (event) {
|
|
3255
|
-
_this.linkDragEnded.emit(event);
|
|
3256
|
-
});
|
|
3257
|
-
});
|
|
3258
|
-
};
|
|
3259
|
-
NgxGanttComponent.prototype.ngAfterViewInit = function () {
|
|
3260
|
-
var _this = this;
|
|
3261
|
-
this.columns.changes.pipe(operators.startWith(true), operators.takeUntil(this.ngUnsubscribe$)).subscribe(function () {
|
|
3262
|
-
_this.columns.forEach(function (column) {
|
|
3263
|
-
if (!column.columnWidth) {
|
|
3264
|
-
column.columnWidth = coercion.coerceCssPixelValue(defaultColumnWidth);
|
|
3265
|
-
}
|
|
3266
|
-
});
|
|
3267
|
-
_this.cdr.detectChanges();
|
|
3268
|
-
});
|
|
3269
|
-
};
|
|
3270
|
-
NgxGanttComponent.prototype.ngOnChanges = function (changes) {
|
|
3271
|
-
_super.prototype.onChanges.call(this, changes);
|
|
3272
|
-
};
|
|
3273
|
-
NgxGanttComponent.prototype.expandChildren = function (item) {
|
|
3274
|
-
var _this = this;
|
|
3275
|
-
if (!item.expanded) {
|
|
3276
|
-
item.setExpand(true);
|
|
3277
|
-
if (this.async && this.childrenResolve && item.children.length === 0) {
|
|
3278
|
-
item.loading = true;
|
|
3279
|
-
this.childrenResolve(item.origin)
|
|
3280
|
-
.pipe(operators.take(1), operators.finalize(function () {
|
|
3281
|
-
item.loading = false;
|
|
3282
|
-
_this.expandChange.emit();
|
|
3283
|
-
_this.cdr.detectChanges();
|
|
3284
|
-
}))
|
|
3285
|
-
.subscribe(function (items) {
|
|
3286
|
-
item.addChildren(items);
|
|
3287
|
-
_this.computeItemsRefs.apply(_this, __spreadArray([], __read(item.children)));
|
|
3288
|
-
});
|
|
3289
|
-
}
|
|
3290
|
-
else {
|
|
3291
|
-
this.computeItemsRefs.apply(this, __spreadArray([], __read(item.children)));
|
|
3292
|
-
this.expandChange.emit();
|
|
3293
|
-
}
|
|
3294
|
-
}
|
|
3295
|
-
else {
|
|
3296
|
-
item.setExpand(false);
|
|
3297
|
-
this.expandChange.emit();
|
|
3298
|
-
}
|
|
3299
|
-
};
|
|
3300
|
-
NgxGanttComponent.prototype.selectItem = function (selectEvent) {
|
|
3301
|
-
var _a;
|
|
3302
|
-
if (!this.selectable) {
|
|
3303
|
-
return;
|
|
3304
|
-
}
|
|
3305
|
-
var event = selectEvent.event, selectedValue = selectEvent.selectedValue;
|
|
3306
|
-
this.selectionModel.toggle(selectedValue.id);
|
|
3307
|
-
var selectedIds = this.selectionModel.selected;
|
|
3308
|
-
if (this.multiple) {
|
|
3309
|
-
var _selectedValue = this.getGanttItems(selectedIds).map(function (item) { return item.origin; });
|
|
3310
|
-
this.selectedChange.emit({ event: event, selectedValue: _selectedValue });
|
|
3311
|
-
}
|
|
3312
|
-
else {
|
|
3313
|
-
var _selectedValue = (_a = this.getGanttItem(selectedIds[0])) === null || _a === void 0 ? void 0 : _a.origin;
|
|
3314
|
-
this.selectedChange.emit({ event: event, selectedValue: _selectedValue });
|
|
3315
|
-
}
|
|
3316
|
-
};
|
|
3317
|
-
NgxGanttComponent.prototype.ngOnDestroy = function () {
|
|
3318
|
-
_super.prototype.onDestroy.call(this);
|
|
3319
|
-
};
|
|
3320
|
-
return NgxGanttComponent;
|
|
3321
|
-
}(GanttUpper));
|
|
3322
|
-
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 });
|
|
3323
|
-
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: [
|
|
3324
|
-
{
|
|
3325
|
-
provide: GANTT_UPPER_TOKEN,
|
|
3326
|
-
useExisting: NgxGanttComponent
|
|
3327
|
-
},
|
|
3328
|
-
{
|
|
3329
|
-
provide: GANTT_ABSTRACT_TOKEN,
|
|
3330
|
-
useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
|
|
3331
|
-
}
|
|
3332
|
-
], 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, usesOnChanges: 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 });
|
|
3333
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttComponent, decorators: [{
|
|
3334
|
-
type: i0.Component,
|
|
3335
|
-
args: [{
|
|
3336
|
-
selector: 'ngx-gantt',
|
|
3337
|
-
templateUrl: './gantt.component.html',
|
|
3338
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3339
|
-
providers: [
|
|
3340
|
-
{
|
|
3341
|
-
provide: GANTT_UPPER_TOKEN,
|
|
3342
|
-
useExisting: NgxGanttComponent
|
|
3343
|
-
},
|
|
3344
|
-
{
|
|
3345
|
-
provide: GANTT_ABSTRACT_TOKEN,
|
|
3346
|
-
useExisting: i0.forwardRef(function () { return NgxGanttComponent; })
|
|
3347
|
-
}
|
|
3348
|
-
]
|
|
3349
|
-
}]
|
|
3350
|
-
}], ctorParameters: function () {
|
|
3351
|
-
return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
|
|
3352
|
-
type: i0.Inject,
|
|
3353
|
-
args: [GANTT_GLOBAL_CONFIG]
|
|
3354
|
-
}] }];
|
|
3355
|
-
}, propDecorators: { maxLevel: [{
|
|
3356
|
-
type: i0.Input
|
|
3357
|
-
}], async: [{
|
|
3358
|
-
type: i0.Input
|
|
3359
|
-
}], childrenResolve: [{
|
|
3360
|
-
type: i0.Input
|
|
3361
|
-
}], linkable: [{
|
|
3362
|
-
type: i0.Input
|
|
3363
|
-
}], linkDragStarted: [{
|
|
3364
|
-
type: i0.Output
|
|
3365
|
-
}], linkDragEnded: [{
|
|
3366
|
-
type: i0.Output
|
|
3367
|
-
}], lineClick: [{
|
|
3368
|
-
type: i0.Output
|
|
3369
|
-
}], selectedChange: [{
|
|
3370
|
-
type: i0.Output
|
|
3371
|
-
}], table: [{
|
|
3372
|
-
type: i0.ContentChild,
|
|
3373
|
-
args: [NgxGanttTableComponent]
|
|
3374
|
-
}], columns: [{
|
|
3375
|
-
type: i0.ContentChildren,
|
|
3376
|
-
args: [NgxGanttTableColumnComponent, { descendants: true }]
|
|
3377
|
-
}], tableEmptyTemplate: [{
|
|
3378
|
-
type: i0.ContentChild,
|
|
3379
|
-
args: ['tableEmpty', { static: true }]
|
|
3380
|
-
}] } });
|
|
3381
|
-
|
|
3382
|
-
var NgxGanttModule = /** @class */ (function () {
|
|
3383
|
-
function NgxGanttModule() {
|
|
3384
|
-
}
|
|
3385
|
-
return NgxGanttModule;
|
|
3386
|
-
}());
|
|
3387
|
-
NgxGanttModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
3388
|
-
NgxGanttModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, declarations: [NgxGanttComponent,
|
|
3389
|
-
NgxGanttTableComponent,
|
|
3390
|
-
NgxGanttTableColumnComponent,
|
|
3391
|
-
GanttTableComponent,
|
|
3392
|
-
GanttMainComponent,
|
|
3393
|
-
GanttCalendarComponent,
|
|
3394
|
-
GanttLinksComponent,
|
|
3395
|
-
NgxGanttBarComponent,
|
|
3396
|
-
GanttIconComponent,
|
|
3397
|
-
GanttDragBackdropComponent,
|
|
3398
|
-
NgxGanttRangeComponent,
|
|
3399
|
-
NgxGanttRootComponent,
|
|
3400
|
-
IsGanttRangeItemPipe,
|
|
3401
|
-
IsGanttBarItemPipe,
|
|
3402
|
-
IsGanttCustomItemPipe], imports: [i2.CommonModule, i1.DragDropModule], exports: [NgxGanttComponent,
|
|
3403
|
-
NgxGanttTableComponent,
|
|
3404
|
-
NgxGanttTableColumnComponent,
|
|
3405
|
-
NgxGanttRootComponent,
|
|
3406
|
-
NgxGanttBarComponent,
|
|
3407
|
-
NgxGanttRangeComponent] });
|
|
3408
|
-
NgxGanttModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, providers: [
|
|
3409
|
-
{
|
|
3410
|
-
provide: GANTT_GLOBAL_CONFIG,
|
|
3411
|
-
useValue: defaultConfig
|
|
3412
|
-
}
|
|
3413
|
-
], imports: [[i2.CommonModule, i1.DragDropModule]] });
|
|
3414
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: NgxGanttModule, decorators: [{
|
|
3415
|
-
type: i0.NgModule,
|
|
3416
|
-
args: [{
|
|
3417
|
-
imports: [i2.CommonModule, i1.DragDropModule],
|
|
3418
|
-
exports: [
|
|
3419
|
-
NgxGanttComponent,
|
|
3420
|
-
NgxGanttTableComponent,
|
|
3421
|
-
NgxGanttTableColumnComponent,
|
|
3422
|
-
NgxGanttRootComponent,
|
|
3423
|
-
NgxGanttBarComponent,
|
|
3424
|
-
NgxGanttRangeComponent
|
|
3425
|
-
],
|
|
3426
|
-
declarations: [
|
|
3427
|
-
NgxGanttComponent,
|
|
3428
|
-
NgxGanttTableComponent,
|
|
3429
|
-
NgxGanttTableColumnComponent,
|
|
3430
|
-
GanttTableComponent,
|
|
3431
|
-
GanttMainComponent,
|
|
3432
|
-
GanttCalendarComponent,
|
|
3433
|
-
GanttLinksComponent,
|
|
3434
|
-
NgxGanttBarComponent,
|
|
3435
|
-
GanttIconComponent,
|
|
3436
|
-
GanttDragBackdropComponent,
|
|
3437
|
-
NgxGanttRangeComponent,
|
|
3438
|
-
NgxGanttRootComponent,
|
|
3439
|
-
IsGanttRangeItemPipe,
|
|
3440
|
-
IsGanttBarItemPipe,
|
|
3441
|
-
IsGanttCustomItemPipe
|
|
3442
|
-
],
|
|
3443
|
-
providers: [
|
|
3444
|
-
{
|
|
3445
|
-
provide: GANTT_GLOBAL_CONFIG,
|
|
3446
|
-
useValue: defaultConfig
|
|
3447
|
-
}
|
|
3448
|
-
]
|
|
3449
|
-
}]
|
|
3450
|
-
}] });
|
|
3451
|
-
|
|
3452
|
-
/*
|
|
3453
|
-
* Public API Surface of gantt
|
|
3454
|
-
*/
|
|
3455
|
-
|
|
3456
|
-
/**
|
|
3457
|
-
* Generated bundle index. Do not edit.
|
|
3458
|
-
*/
|
|
3459
|
-
|
|
3460
|
-
Object.defineProperty(exports, 'addDays', {
|
|
3461
|
-
enumerable: true,
|
|
3462
|
-
get: function () { return dateFns.addDays; }
|
|
3463
|
-
});
|
|
3464
|
-
Object.defineProperty(exports, 'addHours', {
|
|
3465
|
-
enumerable: true,
|
|
3466
|
-
get: function () { return dateFns.addHours; }
|
|
3467
|
-
});
|
|
3468
|
-
Object.defineProperty(exports, 'addMinutes', {
|
|
3469
|
-
enumerable: true,
|
|
3470
|
-
get: function () { return dateFns.addMinutes; }
|
|
3471
|
-
});
|
|
3472
|
-
Object.defineProperty(exports, 'addMonths', {
|
|
3473
|
-
enumerable: true,
|
|
3474
|
-
get: function () { return dateFns.addMonths; }
|
|
3475
|
-
});
|
|
3476
|
-
Object.defineProperty(exports, 'addQuarters', {
|
|
3477
|
-
enumerable: true,
|
|
3478
|
-
get: function () { return dateFns.addQuarters; }
|
|
3479
|
-
});
|
|
3480
|
-
Object.defineProperty(exports, 'addSeconds', {
|
|
3481
|
-
enumerable: true,
|
|
3482
|
-
get: function () { return dateFns.addSeconds; }
|
|
3483
|
-
});
|
|
3484
|
-
Object.defineProperty(exports, 'addWeeks', {
|
|
3485
|
-
enumerable: true,
|
|
3486
|
-
get: function () { return dateFns.addWeeks; }
|
|
3487
|
-
});
|
|
3488
|
-
Object.defineProperty(exports, 'addYears', {
|
|
3489
|
-
enumerable: true,
|
|
3490
|
-
get: function () { return dateFns.addYears; }
|
|
3491
|
-
});
|
|
3492
|
-
Object.defineProperty(exports, 'differenceInCalendarDays', {
|
|
3493
|
-
enumerable: true,
|
|
3494
|
-
get: function () { return dateFns.differenceInCalendarDays; }
|
|
3495
|
-
});
|
|
3496
|
-
Object.defineProperty(exports, 'differenceInCalendarQuarters', {
|
|
3497
|
-
enumerable: true,
|
|
3498
|
-
get: function () { return dateFns.differenceInCalendarQuarters; }
|
|
3499
|
-
});
|
|
3500
|
-
Object.defineProperty(exports, 'differenceInDays', {
|
|
3501
|
-
enumerable: true,
|
|
3502
|
-
get: function () { return dateFns.differenceInDays; }
|
|
3503
|
-
});
|
|
3504
|
-
Object.defineProperty(exports, 'eachDayOfInterval', {
|
|
3505
|
-
enumerable: true,
|
|
3506
|
-
get: function () { return dateFns.eachDayOfInterval; }
|
|
3507
|
-
});
|
|
3508
|
-
Object.defineProperty(exports, 'eachMonthOfInterval', {
|
|
3509
|
-
enumerable: true,
|
|
3510
|
-
get: function () { return dateFns.eachMonthOfInterval; }
|
|
3511
|
-
});
|
|
3512
|
-
Object.defineProperty(exports, 'eachWeekOfInterval', {
|
|
3513
|
-
enumerable: true,
|
|
3514
|
-
get: function () { return dateFns.eachWeekOfInterval; }
|
|
3515
|
-
});
|
|
3516
|
-
Object.defineProperty(exports, 'endOfDay', {
|
|
3517
|
-
enumerable: true,
|
|
3518
|
-
get: function () { return dateFns.endOfDay; }
|
|
3519
|
-
});
|
|
3520
|
-
Object.defineProperty(exports, 'endOfMonth', {
|
|
3521
|
-
enumerable: true,
|
|
3522
|
-
get: function () { return dateFns.endOfMonth; }
|
|
3523
|
-
});
|
|
3524
|
-
Object.defineProperty(exports, 'endOfQuarter', {
|
|
3525
|
-
enumerable: true,
|
|
3526
|
-
get: function () { return dateFns.endOfQuarter; }
|
|
3527
|
-
});
|
|
3528
|
-
Object.defineProperty(exports, 'endOfWeek', {
|
|
3529
|
-
enumerable: true,
|
|
3530
|
-
get: function () { return dateFns.endOfWeek; }
|
|
3531
|
-
});
|
|
3532
|
-
Object.defineProperty(exports, 'endOfYear', {
|
|
3533
|
-
enumerable: true,
|
|
3534
|
-
get: function () { return dateFns.endOfYear; }
|
|
3535
|
-
});
|
|
3536
|
-
Object.defineProperty(exports, 'format', {
|
|
3537
|
-
enumerable: true,
|
|
3538
|
-
get: function () { return dateFns.format; }
|
|
3539
|
-
});
|
|
3540
|
-
Object.defineProperty(exports, 'fromUnixTime', {
|
|
3541
|
-
enumerable: true,
|
|
3542
|
-
get: function () { return dateFns.fromUnixTime; }
|
|
3543
|
-
});
|
|
3544
|
-
Object.defineProperty(exports, 'getDaysInMonth', {
|
|
3545
|
-
enumerable: true,
|
|
3546
|
-
get: function () { return dateFns.getDaysInMonth; }
|
|
3547
|
-
});
|
|
3548
|
-
Object.defineProperty(exports, 'getUnixTime', {
|
|
3549
|
-
enumerable: true,
|
|
3550
|
-
get: function () { return dateFns.getUnixTime; }
|
|
3551
|
-
});
|
|
3552
|
-
Object.defineProperty(exports, 'getWeek', {
|
|
3553
|
-
enumerable: true,
|
|
3554
|
-
get: function () { return dateFns.getWeek; }
|
|
3555
|
-
});
|
|
3556
|
-
Object.defineProperty(exports, 'isToday', {
|
|
3557
|
-
enumerable: true,
|
|
3558
|
-
get: function () { return dateFns.isToday; }
|
|
3559
|
-
});
|
|
3560
|
-
Object.defineProperty(exports, 'isWeekend', {
|
|
3561
|
-
enumerable: true,
|
|
3562
|
-
get: function () { return dateFns.isWeekend; }
|
|
3563
|
-
});
|
|
3564
|
-
Object.defineProperty(exports, 'setDate', {
|
|
3565
|
-
enumerable: true,
|
|
3566
|
-
get: function () { return dateFns.setDate; }
|
|
3567
|
-
});
|
|
3568
|
-
Object.defineProperty(exports, 'startOfDay', {
|
|
3569
|
-
enumerable: true,
|
|
3570
|
-
get: function () { return dateFns.startOfDay; }
|
|
3571
|
-
});
|
|
3572
|
-
Object.defineProperty(exports, 'startOfMonth', {
|
|
3573
|
-
enumerable: true,
|
|
3574
|
-
get: function () { return dateFns.startOfMonth; }
|
|
3575
|
-
});
|
|
3576
|
-
Object.defineProperty(exports, 'startOfQuarter', {
|
|
3577
|
-
enumerable: true,
|
|
3578
|
-
get: function () { return dateFns.startOfQuarter; }
|
|
3579
|
-
});
|
|
3580
|
-
Object.defineProperty(exports, 'startOfWeek', {
|
|
3581
|
-
enumerable: true,
|
|
3582
|
-
get: function () { return dateFns.startOfWeek; }
|
|
3583
|
-
});
|
|
3584
|
-
Object.defineProperty(exports, 'startOfYear', {
|
|
3585
|
-
enumerable: true,
|
|
3586
|
-
get: function () { return dateFns.startOfYear; }
|
|
3587
|
-
});
|
|
3588
|
-
exports.GANTT_GLOBAL_CONFIG = GANTT_GLOBAL_CONFIG;
|
|
3589
|
-
exports.GANTT_UPPER_TOKEN = GANTT_UPPER_TOKEN;
|
|
3590
|
-
exports.GanttBarClickEvent = GanttBarClickEvent;
|
|
3591
|
-
exports.GanttDate = GanttDate;
|
|
3592
|
-
exports.GanttDatePoint = GanttDatePoint;
|
|
3593
|
-
exports.GanttDragEvent = GanttDragEvent;
|
|
3594
|
-
exports.GanttGroupInternal = GanttGroupInternal;
|
|
3595
|
-
exports.GanttItemInternal = GanttItemInternal;
|
|
3596
|
-
exports.GanttItemUpper = GanttItemUpper;
|
|
3597
|
-
exports.GanttLineClickEvent = GanttLineClickEvent;
|
|
3598
|
-
exports.GanttLinkDragEvent = GanttLinkDragEvent;
|
|
3599
|
-
exports.GanttLoadOnScrollEvent = GanttLoadOnScrollEvent;
|
|
3600
|
-
exports.GanttPrintService = GanttPrintService;
|
|
3601
|
-
exports.GanttSelectedEvent = GanttSelectedEvent;
|
|
3602
|
-
exports.GanttTableEvent = GanttTableEvent;
|
|
3603
|
-
exports.GanttUpper = GanttUpper;
|
|
3604
|
-
exports.GanttView = GanttView;
|
|
3605
|
-
exports.IsGanttBarItemPipe = IsGanttBarItemPipe;
|
|
3606
|
-
exports.IsGanttCustomItemPipe = IsGanttCustomItemPipe;
|
|
3607
|
-
exports.IsGanttRangeItemPipe = IsGanttRangeItemPipe;
|
|
3608
|
-
exports.NgxGanttBarComponent = NgxGanttBarComponent;
|
|
3609
|
-
exports.NgxGanttComponent = NgxGanttComponent;
|
|
3610
|
-
exports.NgxGanttModule = NgxGanttModule;
|
|
3611
|
-
exports.NgxGanttRangeComponent = NgxGanttRangeComponent;
|
|
3612
|
-
exports.NgxGanttRootComponent = NgxGanttRootComponent;
|
|
3613
|
-
exports.NgxGanttTableColumnComponent = NgxGanttTableColumnComponent;
|
|
3614
|
-
exports.NgxGanttTableComponent = NgxGanttTableComponent;
|
|
3615
|
-
exports.defaultConfig = defaultConfig;
|
|
3616
|
-
exports.primaryDatePointTop = primaryDatePointTop;
|
|
3617
|
-
exports.secondaryDatePointTop = secondaryDatePointTop;
|
|
3618
|
-
|
|
3619
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3620
|
-
|
|
3621
|
-
}));
|
|
3622
|
-
//# sourceMappingURL=worktile-gantt.umd.js.map
|