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