@sme.up/ketchup 7.4.1 → 7.5.0-SNAPSHOT
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/dist/cjs/{f-button-5856cd74.js → f-button-a508a0a1.js} +1 -1
- package/dist/cjs/{f-cell-9d7a9e97.js → f-cell-52d724f5.js} +4 -4
- package/dist/cjs/{f-chip-675ed121.js → f-chip-cbb70aed.js} +2 -2
- package/dist/cjs/{f-image-48facc89.js → f-image-510563ed.js} +4 -4
- package/dist/cjs/{f-paginator-utils-0c1227f6.js → f-paginator-utils-ff531caa.js} +2 -2
- package/dist/cjs/{f-text-field-3d8e7417.js → f-text-field-d17e5aa0.js} +1 -1
- package/dist/cjs/ketchup.cjs.js +2 -2
- package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
- package/dist/cjs/kup-autocomplete_27.cjs.entry.js +18 -12
- package/dist/cjs/kup-box.cjs.entry.js +7 -7
- package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
- package/dist/cjs/kup-cell.cjs.entry.js +5 -5
- package/dist/cjs/kup-dash-list.cjs.entry.js +1 -1
- package/dist/cjs/kup-dash_2.cjs.entry.js +1 -1
- package/dist/cjs/kup-dashboard.cjs.entry.js +4 -7
- package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
- package/dist/cjs/kup-echart.cjs.entry.js +1 -1
- package/dist/cjs/kup-family-tree.cjs.entry.js +4 -4
- package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
- package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
- package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
- package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
- package/dist/cjs/{kup-manager-22bb9699.js → kup-manager-9e1680dd.js} +3 -0
- package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
- package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
- package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
- package/dist/cjs/kup-planner.cjs.entry.js +1043 -558
- package/dist/cjs/kup-probe.cjs.entry.js +1 -1
- package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
- package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/kup-card/kup-card.css +4 -8
- package/dist/collection/components/kup-dashboard/kup-dashboard.js +0 -3
- package/dist/collection/components/kup-data-table/kup-data-table.css +3 -6
- package/dist/collection/components/kup-data-table/kup-data-table.js +1 -4
- package/dist/collection/components/kup-family-tree/kup-family-tree.css +2 -2
- package/dist/collection/components/kup-image/kup-image.js +28 -0
- package/dist/collection/components/kup-list/kup-list.css +1 -1
- package/dist/collection/components/kup-planner/kup-planner-declarations.js +49 -16
- package/dist/collection/components/kup-planner/kup-planner-helper.js +54 -0
- package/dist/collection/components/kup-planner/kup-planner.css +21 -18
- package/dist/collection/components/kup-planner/kup-planner.js +483 -69
- package/dist/collection/components/kup-qlik/kup-qlik.css +4 -8
- package/dist/collection/components/kup-spinner/kup-spinner.css +2 -4
- package/dist/collection/f-components/f-image/f-image.js +3 -3
- package/dist/collection/managers/kup-data/kup-data-column-helper.js +1 -0
- package/dist/collection/managers/kup-theme/kup-theme-declarations.js +1 -0
- package/dist/collection/types/GenericTypes.js +1 -0
- package/dist/components/kup-autocomplete2.js +18 -9
- package/dist/components/kup-dashboard.js +0 -3
- package/dist/components/kup-family-tree.js +1 -1
- package/dist/components/kup-planner.js +1039 -547
- package/dist/components/kup-progress-bar.js +1 -1
- package/dist/components/kup-qlik.js +1 -1
- package/dist/components/kup-radio.js +1 -1
- package/dist/components/kup-rating.js +1 -1
- package/dist/components/kup-spinner.js +1 -1
- package/dist/components/kup-switch.js +1 -1
- package/dist/components/kup-tab-bar.js +1 -1
- package/dist/components/kup-text-field.js +1 -1
- package/dist/components/kup-time-picker.js +1 -1
- package/dist/components/kup-tree.js +1 -1
- package/dist/esm/{f-button-eedbdba1.js → f-button-b7f77b26.js} +1 -1
- package/dist/esm/{f-cell-90a418d2.js → f-cell-dc3beffe.js} +4 -4
- package/dist/esm/{f-chip-45e7b3f6.js → f-chip-0a678211.js} +2 -2
- package/dist/esm/{f-image-3026f0fe.js → f-image-f84dbd7c.js} +4 -4
- package/dist/esm/{f-paginator-utils-6369da7c.js → f-paginator-utils-52902bd6.js} +2 -2
- package/dist/esm/{f-text-field-3b70a6f0.js → f-text-field-7dd143be.js} +1 -1
- package/dist/esm/ketchup.js +2 -2
- package/dist/esm/kup-accordion.entry.js +2 -2
- package/dist/esm/kup-autocomplete_27.entry.js +18 -12
- package/dist/esm/kup-box.entry.js +7 -7
- package/dist/esm/kup-calendar.entry.js +4 -4
- package/dist/esm/kup-cell.entry.js +5 -5
- package/dist/esm/kup-dash-list.entry.js +1 -1
- package/dist/esm/kup-dash_2.entry.js +1 -1
- package/dist/esm/kup-dashboard.entry.js +4 -7
- package/dist/esm/kup-drawer.entry.js +1 -1
- package/dist/esm/kup-echart.entry.js +1 -1
- package/dist/esm/kup-family-tree.entry.js +4 -4
- package/dist/esm/kup-iframe.entry.js +1 -1
- package/dist/esm/kup-image-list.entry.js +6 -6
- package/dist/esm/kup-lazy.entry.js +1 -1
- package/dist/esm/kup-magic-box.entry.js +2 -2
- package/dist/esm/{kup-manager-cad802b1.js → kup-manager-a5ab58a0.js} +3 -0
- package/dist/esm/kup-nav-bar.entry.js +1 -1
- package/dist/esm/kup-numeric-picker.entry.js +2 -2
- package/dist/esm/kup-photo-frame.entry.js +1 -1
- package/dist/esm/kup-planner.entry.js +1031 -546
- package/dist/esm/kup-probe.entry.js +1 -1
- package/dist/esm/kup-qlik.entry.js +2 -2
- package/dist/esm/kup-snackbar.entry.js +3 -3
- package/dist/esm/loader.js +2 -2
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/{p-c1d8fd43.entry.js → p-00fc0f80.entry.js} +1 -1
- package/dist/ketchup/{p-b1da7902.entry.js → p-166257d0.entry.js} +1 -1
- package/dist/ketchup/{p-ae3e0d31.js → p-28efed63.js} +1 -1
- package/dist/ketchup/{p-fe34fa6e.entry.js → p-3ae1409f.entry.js} +1 -1
- package/dist/ketchup/p-4fd6c34c.js +30 -0
- package/dist/ketchup/{p-73becdb8.entry.js → p-6022c951.entry.js} +1 -1
- package/dist/ketchup/{p-4505a48d.js → p-69f3b9da.js} +1 -1
- package/dist/ketchup/p-7040cab7.entry.js +1 -0
- package/dist/ketchup/{p-a1adab40.js → p-7065b172.js} +1 -1
- package/dist/ketchup/p-71cb80ac.entry.js +9 -0
- package/dist/ketchup/{p-b0675bce.entry.js → p-78d1fc60.entry.js} +1 -1
- package/dist/ketchup/{p-a89f0884.entry.js → p-871cfe60.entry.js} +1 -1
- package/dist/ketchup/p-8d0e6825.entry.js +1 -0
- package/dist/ketchup/{p-9f1184cd.entry.js → p-98ff4101.entry.js} +6 -6
- package/dist/ketchup/{p-eea29062.entry.js → p-9ae47a0d.entry.js} +1 -1
- package/dist/ketchup/{p-1cd45a72.entry.js → p-a122b8d3.entry.js} +1 -1
- package/dist/ketchup/{p-23288eed.entry.js → p-a32cc181.entry.js} +1 -1
- package/dist/ketchup/{p-1ad48de4.entry.js → p-beb0907a.entry.js} +1 -1
- package/dist/ketchup/{p-32dc31ad.js → p-c5c6a2fb.js} +1 -1
- package/dist/ketchup/{p-138ac8b9.entry.js → p-c797ab39.entry.js} +1 -1
- package/dist/ketchup/p-d1e3573f.js +1 -0
- package/dist/ketchup/{p-d0f4457e.entry.js → p-d2670436.entry.js} +1 -1
- package/dist/ketchup/{p-97afbd71.entry.js → p-d315f7fa.entry.js} +1 -1
- package/dist/ketchup/{p-2d8b5bba.entry.js → p-d711e9ae.entry.js} +1 -1
- package/dist/ketchup/{p-7bd28eac.js → p-de34eb56.js} +1 -1
- package/dist/ketchup/{p-263b2c73.entry.js → p-e92d1972.entry.js} +1 -1
- package/dist/ketchup/{p-2217be0a.entry.js → p-efb80719.entry.js} +1 -1
- package/dist/ketchup/p-f158836b.entry.js +39 -0
- package/dist/ketchup/p-f69a6d89.entry.js +10 -0
- package/dist/types/components/kup-image/kup-image.d.ts +2 -0
- package/dist/types/components/kup-planner/kup-planner-declarations.d.ts +58 -17
- package/dist/types/components/kup-planner/kup-planner-helper.d.ts +6 -0
- package/dist/types/components/kup-planner/kup-planner.d.ts +120 -5
- package/dist/types/components.d.ts +235 -2
- package/dist/types/f-components/f-image/f-image-declarations.d.ts +1 -0
- package/dist/types/types/GenericTypes.d.ts +1 -0
- package/package.json +8 -6
- package/dist/ketchup/p-4e68f629.entry.js +0 -1
- package/dist/ketchup/p-a7ae0b4d.js +0 -1
- package/dist/ketchup/p-b63a5a44.js +0 -30
- package/dist/ketchup/p-bb6921bc.entry.js +0 -1
- package/dist/ketchup/p-cb6c8417.entry.js +0 -10
- package/dist/ketchup/p-fd948af0.entry.js +0 -9
- package/dist/ketchup/p-ff11d6d0.entry.js +0 -39
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1f177abc.js');
|
|
6
|
-
const kupManager = require('./kup-manager-
|
|
6
|
+
const kupManager$1 = require('./kup-manager-9e1680dd.js');
|
|
7
7
|
const GenericVariables = require('./GenericVariables-a9ed17ee.js');
|
|
8
|
+
const fTextField = require('./f-text-field-d17e5aa0.js');
|
|
9
|
+
const fTextFieldMdc = require('./f-text-field-mdc-85997738.js');
|
|
10
|
+
require('./tslib.es6-0ee02c67.js');
|
|
11
|
+
require('./component-72a5b626.js');
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* Props of the kup-gantt component.
|
|
@@ -13,26 +17,46 @@ const GenericVariables = require('./GenericVariables-a9ed17ee.js');
|
|
|
13
17
|
var KupPlannerProps;
|
|
14
18
|
(function (KupPlannerProps) {
|
|
15
19
|
KupPlannerProps["customStyle"] = "Custom style of the component.";
|
|
16
|
-
KupPlannerProps["
|
|
17
|
-
KupPlannerProps["
|
|
18
|
-
KupPlannerProps["
|
|
19
|
-
KupPlannerProps["
|
|
20
|
-
KupPlannerProps["
|
|
21
|
-
KupPlannerProps["
|
|
22
|
-
KupPlannerProps["
|
|
23
|
-
KupPlannerProps["
|
|
24
|
-
KupPlannerProps["
|
|
25
|
-
KupPlannerProps["
|
|
26
|
-
KupPlannerProps["
|
|
27
|
-
KupPlannerProps["
|
|
28
|
-
KupPlannerProps["
|
|
29
|
-
KupPlannerProps["
|
|
20
|
+
KupPlannerProps["data"] = "Dataset containg the tasks list";
|
|
21
|
+
KupPlannerProps["detailData"] = "Dataset containg the details list";
|
|
22
|
+
KupPlannerProps["detailColorCol"] = "Column containing the detail color, in hex format";
|
|
23
|
+
KupPlannerProps["detailColumns"] = "Columns containing informations displayed in the left box, near the gantt of details";
|
|
24
|
+
KupPlannerProps["detailDates"] = "Columns containing detail duration, from (firstDate) to (secondDate)";
|
|
25
|
+
KupPlannerProps["detailHeight"] = "Height for detail gantt";
|
|
26
|
+
KupPlannerProps["detailIdCol"] = "Column containing unique detail identifier";
|
|
27
|
+
KupPlannerProps["detailNameCol"] = "Column containing detail name displayed";
|
|
28
|
+
KupPlannerProps["detailPrevDates"] = "Columns containing forecast detail duration, from (firstDate) to (secondDate)";
|
|
29
|
+
KupPlannerProps["listCellWidth"] = "Total size of the cells inside to the left box, near the gantt";
|
|
30
|
+
KupPlannerProps["maxWidth"] = "Max width for component";
|
|
31
|
+
KupPlannerProps["phaseColorCol"] = "Column containing the phase color in hex format";
|
|
32
|
+
KupPlannerProps["phaseColumns"] = "Columns containing informations displayed in the left box ,near the gantt of phases";
|
|
33
|
+
KupPlannerProps["phaseColParDep"] = "Column containing the name of the parent phases";
|
|
34
|
+
KupPlannerProps["phaseDates"] = "Columns containing phase duration, from (firstDate) to (secondDate)";
|
|
35
|
+
KupPlannerProps["phaseIdCol"] = "Column containing unique phase identifier";
|
|
36
|
+
KupPlannerProps["phaseNameCol"] = "Column containing phase name displayed";
|
|
37
|
+
KupPlannerProps["phasePrevDates"] = "Columns containing forecast phase duration, from (firstDate) to (secondDate)";
|
|
38
|
+
KupPlannerProps["showSecondaryDates"] = "Enable/disable display of secondary dates";
|
|
39
|
+
KupPlannerProps["taskColumns"] = "Columns containing informations displayed in the left box, near the gantt";
|
|
40
|
+
KupPlannerProps["taskDates"] = "Columns containing task duration, from (firstDate) to (secondDate)";
|
|
41
|
+
KupPlannerProps["taskHeight"] = "Height for main gantt";
|
|
42
|
+
KupPlannerProps["taskIdCol"] = "Column containing unique task identifier";
|
|
43
|
+
KupPlannerProps["taskNameCol"] = "Column containing task name displayed";
|
|
44
|
+
KupPlannerProps["taskPrevDates"] = "Columns containing forecast task duration, from (firstDate) to (secondDate)";
|
|
45
|
+
KupPlannerProps["titleMess"] = "Message displayed on top";
|
|
30
46
|
})(KupPlannerProps || (KupPlannerProps = {}));
|
|
31
47
|
var KupPlannerTaskAction;
|
|
32
48
|
(function (KupPlannerTaskAction) {
|
|
33
|
-
KupPlannerTaskAction["
|
|
34
|
-
KupPlannerTaskAction["
|
|
49
|
+
KupPlannerTaskAction["onTaskOpening"] = "onTaskOpening";
|
|
50
|
+
KupPlannerTaskAction["onTaskClosing"] = "onTaskClosing";
|
|
51
|
+
KupPlannerTaskAction["onClick"] = "onClick";
|
|
52
|
+
KupPlannerTaskAction["onResize"] = "onResize";
|
|
35
53
|
})(KupPlannerTaskAction || (KupPlannerTaskAction = {}));
|
|
54
|
+
var KupPlannerGanttRowType;
|
|
55
|
+
(function (KupPlannerGanttRowType) {
|
|
56
|
+
KupPlannerGanttRowType["TASK"] = "task";
|
|
57
|
+
KupPlannerGanttRowType["PHASE"] = "phase";
|
|
58
|
+
KupPlannerGanttRowType["DETAIL"] = "detail";
|
|
59
|
+
})(KupPlannerGanttRowType || (KupPlannerGanttRowType = {}));
|
|
36
60
|
class KupPlannerLastOnChangeReceived {
|
|
37
61
|
constructor(event, threshold = 100) {
|
|
38
62
|
this.dateTime = new Date();
|
|
@@ -47,7 +71,20 @@ class KupPlannerLastOnChangeReceived {
|
|
|
47
71
|
resetDateTime() {
|
|
48
72
|
this.dateTime = new Date();
|
|
49
73
|
}
|
|
50
|
-
}
|
|
74
|
+
}
|
|
75
|
+
const defaultStylingOptions = {
|
|
76
|
+
listCellWidth: '300px',
|
|
77
|
+
rowHeight: 40,
|
|
78
|
+
barFill: 90,
|
|
79
|
+
projectProgressColor: '#CBCBCB',
|
|
80
|
+
projectProgressSelectedColor: '#CBCBCB',
|
|
81
|
+
projectBackgroundColor: '#CBCBCB',
|
|
82
|
+
projectBackgroundSelectedColor: '#CBCBCB',
|
|
83
|
+
barProgressColor: '#A2A415',
|
|
84
|
+
barProgressSelectedColor: '#A2A415',
|
|
85
|
+
barBackgroundColor: '#A2A415',
|
|
86
|
+
barBackgroundSelectedColor: '#A2A415',
|
|
87
|
+
};
|
|
51
88
|
|
|
52
89
|
/**
|
|
53
90
|
* @license React
|
|
@@ -114,17 +151,17 @@ var react_production_min = {
|
|
|
114
151
|
version: version$1
|
|
115
152
|
};
|
|
116
153
|
|
|
117
|
-
kupManager.createCommonjsModule(function (module, exports) {
|
|
154
|
+
kupManager$1.createCommonjsModule(function (module, exports) {
|
|
118
155
|
});
|
|
119
156
|
|
|
120
|
-
var react = kupManager.createCommonjsModule(function (module) {
|
|
157
|
+
var react = kupManager$1.createCommonjsModule(function (module) {
|
|
121
158
|
|
|
122
159
|
{
|
|
123
160
|
module.exports = react_production_min;
|
|
124
161
|
}
|
|
125
162
|
});
|
|
126
163
|
|
|
127
|
-
var scheduler_production_min = kupManager.createCommonjsModule(function (module, exports) {
|
|
164
|
+
var scheduler_production_min = kupManager$1.createCommonjsModule(function (module, exports) {
|
|
128
165
|
function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,w=e>>>1;d<w;){var m=2*(d+1)-1,C=a[m],n=m+1,x=a[n];if(0>g(C,c))n<e&&0>g(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(n<e&&0>g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}
|
|
129
166
|
function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()};}else {var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q};}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;
|
|
130
167
|
"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t);}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else {var b=h(t);null!==b&&K(H,b.startTime-a);}}
|
|
@@ -137,10 +174,10 @@ exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();"
|
|
|
137
174
|
exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c;}}};
|
|
138
175
|
});
|
|
139
176
|
|
|
140
|
-
kupManager.createCommonjsModule(function (module, exports) {
|
|
177
|
+
kupManager$1.createCommonjsModule(function (module, exports) {
|
|
141
178
|
});
|
|
142
179
|
|
|
143
|
-
var scheduler = kupManager.createCommonjsModule(function (module) {
|
|
180
|
+
var scheduler = kupManager$1.createCommonjsModule(function (module) {
|
|
144
181
|
|
|
145
182
|
{
|
|
146
183
|
module.exports = scheduler_production_min;
|
|
@@ -473,10 +510,10 @@ var reactDom_production_min = {
|
|
|
473
510
|
version: version
|
|
474
511
|
};
|
|
475
512
|
|
|
476
|
-
kupManager.createCommonjsModule(function (module, exports) {
|
|
513
|
+
kupManager$1.createCommonjsModule(function (module, exports) {
|
|
477
514
|
});
|
|
478
515
|
|
|
479
|
-
var reactDom = kupManager.createCommonjsModule(function (module) {
|
|
516
|
+
var reactDom = kupManager$1.createCommonjsModule(function (module) {
|
|
480
517
|
|
|
481
518
|
function checkDCE() {
|
|
482
519
|
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
@@ -504,7 +541,7 @@ function checkDCE() {
|
|
|
504
541
|
}
|
|
505
542
|
});
|
|
506
543
|
|
|
507
|
-
var client = kupManager.createCommonjsModule(function (module, exports) {
|
|
544
|
+
var client = kupManager$1.createCommonjsModule(function (module, exports) {
|
|
508
545
|
|
|
509
546
|
|
|
510
547
|
{
|
|
@@ -513,7 +550,7 @@ var client = kupManager.createCommonjsModule(function (module, exports) {
|
|
|
513
550
|
}
|
|
514
551
|
});
|
|
515
552
|
|
|
516
|
-
var luxon = kupManager.createCommonjsModule(function (module, exports) {
|
|
553
|
+
var luxon = kupManager$1.createCommonjsModule(function (module, exports) {
|
|
517
554
|
|
|
518
555
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
519
556
|
|
|
@@ -8350,18 +8387,6 @@ function _extends() {
|
|
|
8350
8387
|
};
|
|
8351
8388
|
return _extends.apply(this, arguments);
|
|
8352
8389
|
}
|
|
8353
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
8354
|
-
if (source == null) return {};
|
|
8355
|
-
var target = {};
|
|
8356
|
-
var sourceKeys = Object.keys(source);
|
|
8357
|
-
var key, i;
|
|
8358
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
8359
|
-
key = sourceKeys[i];
|
|
8360
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
8361
|
-
target[key] = source[key];
|
|
8362
|
-
}
|
|
8363
|
-
return target;
|
|
8364
|
-
}
|
|
8365
8390
|
function _unsupportedIterableToArray(o, minLen) {
|
|
8366
8391
|
if (!o) return;
|
|
8367
8392
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -8405,6 +8430,233 @@ var ViewMode;
|
|
|
8405
8430
|
ViewMode["Year"] = "Year";
|
|
8406
8431
|
})(ViewMode || (ViewMode = {}));
|
|
8407
8432
|
|
|
8433
|
+
var TimeUnit;
|
|
8434
|
+
(function (TimeUnit) {
|
|
8435
|
+
TimeUnit["DAY"] = "days";
|
|
8436
|
+
TimeUnit["WEEK"] = "weeks";
|
|
8437
|
+
TimeUnit["MONTH"] = "months";
|
|
8438
|
+
TimeUnit["YEAR"] = "YEAR";
|
|
8439
|
+
})(TimeUnit || (TimeUnit = {}));
|
|
8440
|
+
var parseToDayStart = function parseToDayStart(ymd) {
|
|
8441
|
+
return luxon.DateTime.fromISO(ymd).toJSDate();
|
|
8442
|
+
};
|
|
8443
|
+
var parseToDayEnd = function parseToDayEnd(endDate) {
|
|
8444
|
+
return luxon.DateTime.fromISO(endDate).plus({
|
|
8445
|
+
seconds: 86400 - 1
|
|
8446
|
+
}).toJSDate();
|
|
8447
|
+
};
|
|
8448
|
+
var formatToIsoDate = function formatToIsoDate(date) {
|
|
8449
|
+
var _DateTime$fromJSDate$;
|
|
8450
|
+
return (_DateTime$fromJSDate$ = luxon.DateTime.fromJSDate(date).toISODate()) != null ? _DateTime$fromJSDate$ : undefined;
|
|
8451
|
+
};
|
|
8452
|
+
var formatToLocaleSimple = function formatToLocaleSimple(date) {
|
|
8453
|
+
return luxon.DateTime.fromJSDate(date).toFormat("dd/MM/yyyy");
|
|
8454
|
+
};
|
|
8455
|
+
function validDates(startDate, endDate, _name) {
|
|
8456
|
+
var _start;
|
|
8457
|
+
var start = parseToDayStart(startDate);
|
|
8458
|
+
var end = parseToDayEnd(endDate);
|
|
8459
|
+
if (((_start = start) === null || _start === void 0 ? void 0 : _start.getTime()) > (end === null || end === void 0 ? void 0 : end.getTime())) {
|
|
8460
|
+
start = parseToDayStart(endDate);
|
|
8461
|
+
}
|
|
8462
|
+
return {
|
|
8463
|
+
start: start,
|
|
8464
|
+
end: end
|
|
8465
|
+
};
|
|
8466
|
+
}
|
|
8467
|
+
|
|
8468
|
+
var MAIN_GANTT_ID = "main";
|
|
8469
|
+
var SECONDARY_GANTT_ID = "secondary";
|
|
8470
|
+
var toViewMode = function toViewMode(timeUnit) {
|
|
8471
|
+
switch (timeUnit) {
|
|
8472
|
+
case TimeUnit.DAY:
|
|
8473
|
+
return ViewMode.Day;
|
|
8474
|
+
case TimeUnit.WEEK:
|
|
8475
|
+
return ViewMode.Week;
|
|
8476
|
+
case TimeUnit.MONTH:
|
|
8477
|
+
return ViewMode.Month;
|
|
8478
|
+
case TimeUnit.YEAR:
|
|
8479
|
+
return ViewMode.Year;
|
|
8480
|
+
}
|
|
8481
|
+
};
|
|
8482
|
+
var convertPhaseToTask = function convertPhaseToTask(item) {
|
|
8483
|
+
var mapPhase = function mapPhase(_ref) {
|
|
8484
|
+
var phaseStart = _ref.startDate,
|
|
8485
|
+
phaseEnd = _ref.endDate,
|
|
8486
|
+
secondaryStartDate = _ref.secondaryStartDate,
|
|
8487
|
+
secondaryEndDate = _ref.secondaryEndDate,
|
|
8488
|
+
phaseName = _ref.name,
|
|
8489
|
+
phaseId = _ref.id,
|
|
8490
|
+
color = _ref.color,
|
|
8491
|
+
selectedColor = _ref.selectedColor,
|
|
8492
|
+
dependencies = _ref.dependencies;
|
|
8493
|
+
var _validDates = validDates(phaseStart, phaseEnd),
|
|
8494
|
+
start = _validDates.start,
|
|
8495
|
+
end = _validDates.end;
|
|
8496
|
+
var _validDates2 = validDates(secondaryStartDate, secondaryEndDate),
|
|
8497
|
+
phaseStart2 = _validDates2.start,
|
|
8498
|
+
phaseEnd2 = _validDates2.end;
|
|
8499
|
+
return {
|
|
8500
|
+
start: start,
|
|
8501
|
+
end: end,
|
|
8502
|
+
secondaryStart: phaseStart2,
|
|
8503
|
+
secondaryEnd: phaseEnd2,
|
|
8504
|
+
name: phaseName,
|
|
8505
|
+
valuesToShow: item.valuesToShow,
|
|
8506
|
+
id: phaseId,
|
|
8507
|
+
type: "task",
|
|
8508
|
+
progress: 100,
|
|
8509
|
+
dependencies: dependencies,
|
|
8510
|
+
styles: color ? {
|
|
8511
|
+
backgroundColor: color,
|
|
8512
|
+
progressColor: color,
|
|
8513
|
+
backgroundSelectedColor: selectedColor,
|
|
8514
|
+
progressSelectedColor: selectedColor
|
|
8515
|
+
} : {}
|
|
8516
|
+
};
|
|
8517
|
+
};
|
|
8518
|
+
return mapPhase(item);
|
|
8519
|
+
};
|
|
8520
|
+
var convertDetailToTimeline = function convertDetailToTimeline(item, mainGanttStartDate, mainGanttEndDate) {
|
|
8521
|
+
var id = item.id,
|
|
8522
|
+
name = item.name,
|
|
8523
|
+
schedule = item.schedule;
|
|
8524
|
+
var getDatesForTask = function getDatesForTask(item) {
|
|
8525
|
+
var start = mainGanttStartDate != null ? mainGanttStartDate : "";
|
|
8526
|
+
var end = mainGanttEndDate != null ? mainGanttEndDate : "";
|
|
8527
|
+
for (var i = 0; i < item.schedule.length; i++) {
|
|
8528
|
+
var lstart = item.schedule[i].startDate;
|
|
8529
|
+
var lend = item.schedule[i].endDate;
|
|
8530
|
+
if (!start || lstart.localeCompare(start) < 0) {
|
|
8531
|
+
start = lstart;
|
|
8532
|
+
}
|
|
8533
|
+
if (!end || lend.localeCompare(end) > 0) {
|
|
8534
|
+
end = lend;
|
|
8535
|
+
}
|
|
8536
|
+
}
|
|
8537
|
+
return validDates(start, end);
|
|
8538
|
+
};
|
|
8539
|
+
var _getDatesForTask = getDatesForTask(item),
|
|
8540
|
+
start = _getDatesForTask.start,
|
|
8541
|
+
end = _getDatesForTask.end;
|
|
8542
|
+
var convertToFrame = function convertToFrame(x) {
|
|
8543
|
+
var startDate = x.startDate,
|
|
8544
|
+
endDate = x.endDate,
|
|
8545
|
+
color = x.color,
|
|
8546
|
+
selectedColor = x.selectedColor;
|
|
8547
|
+
var _validDates3 = validDates(startDate, endDate),
|
|
8548
|
+
start = _validDates3.start,
|
|
8549
|
+
end = _validDates3.end;
|
|
8550
|
+
return {
|
|
8551
|
+
start: start,
|
|
8552
|
+
end: end,
|
|
8553
|
+
backgroundColor: color != null ? color : "0xffffff",
|
|
8554
|
+
backgroundSelectedColor: selectedColor != null ? selectedColor : color
|
|
8555
|
+
};
|
|
8556
|
+
};
|
|
8557
|
+
var defaultColor = "#595959";
|
|
8558
|
+
return {
|
|
8559
|
+
id: id,
|
|
8560
|
+
type: "timeline",
|
|
8561
|
+
timeline: schedule.map(convertToFrame),
|
|
8562
|
+
name: name,
|
|
8563
|
+
valuesToShow: item.valuesToShow,
|
|
8564
|
+
start: start,
|
|
8565
|
+
end: end,
|
|
8566
|
+
progress: 100,
|
|
8567
|
+
styles: {
|
|
8568
|
+
backgroundColor: defaultColor,
|
|
8569
|
+
progressColor: defaultColor,
|
|
8570
|
+
backgroundSelectedColor: defaultColor,
|
|
8571
|
+
progressSelectedColor: defaultColor
|
|
8572
|
+
}
|
|
8573
|
+
};
|
|
8574
|
+
};
|
|
8575
|
+
var isDetail = function isDetail(row) {
|
|
8576
|
+
return row && row.schedule && row.schedule.length !== 0;
|
|
8577
|
+
};
|
|
8578
|
+
var convertProjectToTasks = function convertProjectToTasks(item, mainGanttStartDate, mainGanttEndDate) {
|
|
8579
|
+
if (!isDetail(item)) {
|
|
8580
|
+
var _row$phases;
|
|
8581
|
+
var row = item;
|
|
8582
|
+
var _validDates4 = validDates(row.startDate, row.endDate),
|
|
8583
|
+
start = _validDates4.start,
|
|
8584
|
+
end = _validDates4.end;
|
|
8585
|
+
var _validDates5 = validDates(row.secondaryStartDate, row.secondaryEndDate),
|
|
8586
|
+
start2 = _validDates5.start,
|
|
8587
|
+
end2 = _validDates5.end;
|
|
8588
|
+
var mainTask = {
|
|
8589
|
+
start: start,
|
|
8590
|
+
end: end,
|
|
8591
|
+
id: row.id,
|
|
8592
|
+
name: row.name,
|
|
8593
|
+
type: row.type,
|
|
8594
|
+
valuesToShow: row.valuesToShow,
|
|
8595
|
+
secondaryStart: start2,
|
|
8596
|
+
secondaryEnd: end2,
|
|
8597
|
+
progress: 100,
|
|
8598
|
+
isDisabled: false,
|
|
8599
|
+
hideChildren: false
|
|
8600
|
+
};
|
|
8601
|
+
var children1 = ((_row$phases = row.phases) != null ? _row$phases : []).map(convertPhaseToTask);
|
|
8602
|
+
return [mainTask].concat(children1);
|
|
8603
|
+
} else {
|
|
8604
|
+
var _row = item;
|
|
8605
|
+
return [_extends({}, convertDetailToTimeline(_row, mainGanttStartDate, mainGanttEndDate))];
|
|
8606
|
+
}
|
|
8607
|
+
};
|
|
8608
|
+
var mergeTaskIntoProjects = function mergeTaskIntoProjects(projects, _ref2) {
|
|
8609
|
+
var id = _ref2.id,
|
|
8610
|
+
start = _ref2.start,
|
|
8611
|
+
end = _ref2.end;
|
|
8612
|
+
return projects.map(function (project) {
|
|
8613
|
+
return project.id === id ? withNewDates(project, start, end) : project;
|
|
8614
|
+
});
|
|
8615
|
+
};
|
|
8616
|
+
var mergeTaskIntoPhases = function mergeTaskIntoPhases(phases, _ref3) {
|
|
8617
|
+
var id = _ref3.id,
|
|
8618
|
+
start = _ref3.start,
|
|
8619
|
+
end = _ref3.end;
|
|
8620
|
+
if (phases) {
|
|
8621
|
+
return phases.map(function (phase) {
|
|
8622
|
+
return phase.id === id ? withNewDates(phase, start, end) : phase;
|
|
8623
|
+
});
|
|
8624
|
+
}
|
|
8625
|
+
return undefined;
|
|
8626
|
+
};
|
|
8627
|
+
var withNewDates = function withNewDates(p, start, end) {
|
|
8628
|
+
var startDate = formatToIsoDate(start);
|
|
8629
|
+
var endDate = formatToIsoDate(end);
|
|
8630
|
+
var extra = {
|
|
8631
|
+
startDate: startDate,
|
|
8632
|
+
endDate: endDate
|
|
8633
|
+
};
|
|
8634
|
+
return _extends({}, p, extra);
|
|
8635
|
+
};
|
|
8636
|
+
var getProjectById = function getProjectById(id, items) {
|
|
8637
|
+
for (var i = 0; i < items.length; i++) {
|
|
8638
|
+
if (items[i].id === id) {
|
|
8639
|
+
return items[i];
|
|
8640
|
+
}
|
|
8641
|
+
}
|
|
8642
|
+
return undefined;
|
|
8643
|
+
};
|
|
8644
|
+
var getPhaseById = function getPhaseById(id, items) {
|
|
8645
|
+
for (var i = 0; i < items.length; i++) {
|
|
8646
|
+
if (isDetail(items[i])) {
|
|
8647
|
+
continue;
|
|
8648
|
+
}
|
|
8649
|
+
var item = items[i];
|
|
8650
|
+
if (!item.phases) {
|
|
8651
|
+
continue;
|
|
8652
|
+
}
|
|
8653
|
+
for (var j = 0; j < item.phases.length; j++) if (item.phases[j].id === id) {
|
|
8654
|
+
return item.phases[j];
|
|
8655
|
+
}
|
|
8656
|
+
}
|
|
8657
|
+
return undefined;
|
|
8658
|
+
};
|
|
8659
|
+
|
|
8408
8660
|
var intlDTCache = {};
|
|
8409
8661
|
var getCachedDateTimeFormat = function getCachedDateTimeFormat(locString, opts) {
|
|
8410
8662
|
if (opts === void 0) {
|
|
@@ -8419,80 +8671,157 @@ var getCachedDateTimeFormat = function getCachedDateTimeFormat(locString, opts)
|
|
|
8419
8671
|
return dtf;
|
|
8420
8672
|
};
|
|
8421
8673
|
var addToDate = function addToDate(date, quantity, scale) {
|
|
8422
|
-
var newDate = new Date(date.getFullYear() + (scale ===
|
|
8674
|
+
var newDate = new Date(date.getFullYear() + (scale === "year" ? quantity : 0), date.getMonth() + (scale === "month" ? quantity : 0), date.getDate() + (scale === "day" ? quantity : 0), date.getHours() + (scale === "hour" ? quantity : 0), date.getMinutes() + (scale === "minute" ? quantity : 0), date.getSeconds() + (scale === "second" ? quantity : 0), date.getMilliseconds() + (scale === "millisecond" ? quantity : 0));
|
|
8423
8675
|
return newDate;
|
|
8424
8676
|
};
|
|
8425
8677
|
var startOfDate = function startOfDate(date, scale) {
|
|
8426
|
-
var scores = [
|
|
8678
|
+
var scores = ["millisecond", "second", "minute", "hour", "day", "month", "year"];
|
|
8427
8679
|
var shouldReset = function shouldReset(_scale) {
|
|
8428
8680
|
var maxScore = scores.indexOf(scale);
|
|
8429
8681
|
return scores.indexOf(_scale) <= maxScore;
|
|
8430
8682
|
};
|
|
8431
|
-
var newDate = new Date(date.getFullYear(), shouldReset(
|
|
8683
|
+
var newDate = new Date(date.getFullYear(), shouldReset("year") ? 0 : date.getMonth(), shouldReset("month") ? 1 : date.getDate(), shouldReset("day") ? 0 : date.getHours(), shouldReset("hour") ? 0 : date.getMinutes(), shouldReset("minute") ? 0 : date.getSeconds(), shouldReset("second") ? 0 : date.getMilliseconds());
|
|
8432
8684
|
return newDate;
|
|
8433
8685
|
};
|
|
8434
|
-
var
|
|
8435
|
-
var
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8686
|
+
var ganttDateRangeFromTask = function ganttDateRangeFromTask(tasks, viewMode, preStepsCount, showSecondaryDates, mainGanttStartDate, mainGanttEndDate) {
|
|
8687
|
+
var dates = [];
|
|
8688
|
+
tasks.forEach(function (item) {
|
|
8689
|
+
dates.push({
|
|
8690
|
+
start: item.start,
|
|
8691
|
+
end: item.end,
|
|
8692
|
+
secondaryStart: item.secondaryStart,
|
|
8693
|
+
secondaryEnd: item.secondaryEnd
|
|
8694
|
+
});
|
|
8695
|
+
});
|
|
8696
|
+
if (mainGanttStartDate && mainGanttEndDate) {
|
|
8697
|
+
dates.push({
|
|
8698
|
+
start: mainGanttStartDate,
|
|
8699
|
+
end: mainGanttEndDate,
|
|
8700
|
+
secondaryStart: undefined,
|
|
8701
|
+
secondaryEnd: undefined
|
|
8702
|
+
});
|
|
8703
|
+
}
|
|
8704
|
+
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates);
|
|
8705
|
+
};
|
|
8706
|
+
var calculateDisplayedDateRange = function calculateDisplayedDateRange(mainGanttItems, timeUnit, mainGanttDoubleView, secondaryGanttItems, preStepsCount) {
|
|
8707
|
+
var dates = ganttDateRangeFromGanttTask(mainGanttItems, toViewMode(timeUnit), preStepsCount != null ? preStepsCount : 1, mainGanttDoubleView);
|
|
8708
|
+
if (secondaryGanttItems) {
|
|
8709
|
+
var dates2 = ganttDateRangeFromDetail(secondaryGanttItems, toViewMode(timeUnit), preStepsCount != null ? preStepsCount : 1, mainGanttDoubleView);
|
|
8710
|
+
if (dates2[0] < dates[0]) {
|
|
8711
|
+
dates[0] = dates2[0];
|
|
8712
|
+
}
|
|
8713
|
+
if (dates2[1] > dates[1]) {
|
|
8714
|
+
dates[1] = dates2[1];
|
|
8715
|
+
}
|
|
8716
|
+
}
|
|
8717
|
+
return {
|
|
8718
|
+
displayedStartDate: dates[0],
|
|
8719
|
+
displayedEndDate: dates[1]
|
|
8720
|
+
};
|
|
8721
|
+
};
|
|
8722
|
+
var ganttDateRangeFromGanttTask = function ganttDateRangeFromGanttTask(tasks, viewMode, preStepsCount, showSecondaryDates) {
|
|
8723
|
+
var dates = [];
|
|
8724
|
+
tasks.forEach(function (item) {
|
|
8725
|
+
var _item$phases;
|
|
8726
|
+
dates.push({
|
|
8727
|
+
start: parseToDayStart(item.startDate),
|
|
8728
|
+
end: parseToDayEnd(item.endDate),
|
|
8729
|
+
secondaryStart: parseToDayStart(item.secondaryStartDate),
|
|
8730
|
+
secondaryEnd: parseToDayEnd(item.secondaryEndDate)
|
|
8731
|
+
});
|
|
8732
|
+
(_item$phases = item.phases) === null || _item$phases === void 0 ? void 0 : _item$phases.forEach(function (phase) {
|
|
8733
|
+
dates.push({
|
|
8734
|
+
start: parseToDayStart(phase.startDate),
|
|
8735
|
+
end: parseToDayEnd(phase.endDate),
|
|
8736
|
+
secondaryStart: parseToDayStart(phase.secondaryStartDate),
|
|
8737
|
+
secondaryEnd: parseToDayEnd(phase.secondaryEndDate)
|
|
8738
|
+
});
|
|
8739
|
+
});
|
|
8740
|
+
});
|
|
8741
|
+
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
|
|
8742
|
+
};
|
|
8743
|
+
var ganttDateRangeFromDetail = function ganttDateRangeFromDetail(details, viewMode, preStepsCount, showSecondaryDates) {
|
|
8744
|
+
var dates = [];
|
|
8745
|
+
details.forEach(function (item) {
|
|
8746
|
+
var scheduleItems = item.schedule;
|
|
8747
|
+
if (scheduleItems) {
|
|
8748
|
+
scheduleItems.forEach(function (item) {
|
|
8749
|
+
dates.push({
|
|
8750
|
+
start: parseToDayStart(item.startDate),
|
|
8751
|
+
end: parseToDayEnd(item.endDate),
|
|
8752
|
+
secondaryStart: undefined,
|
|
8753
|
+
secondaryEnd: undefined
|
|
8754
|
+
});
|
|
8755
|
+
});
|
|
8441
8756
|
}
|
|
8442
|
-
|
|
8443
|
-
|
|
8757
|
+
});
|
|
8758
|
+
return ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, true);
|
|
8759
|
+
};
|
|
8760
|
+
var ganttDateRangeGeneric = function ganttDateRangeGeneric(dates, viewMode, preStepsCount, showSecondaryDates, realDates) {
|
|
8761
|
+
var newStartDate = dates.length > 0 ? dates[0].start : new Date();
|
|
8762
|
+
var newEndDate = dates.length > 0 ? dates[0].end : new Date();
|
|
8763
|
+
for (var _iterator = _createForOfIteratorHelperLoose(dates), _step; !(_step = _iterator()).done;) {
|
|
8764
|
+
var d = _step.value;
|
|
8765
|
+
if (d.start < newStartDate) {
|
|
8766
|
+
newStartDate = d.start;
|
|
8767
|
+
}
|
|
8768
|
+
if (d.end > newEndDate) {
|
|
8769
|
+
newEndDate = d.end;
|
|
8444
8770
|
}
|
|
8445
8771
|
if (showSecondaryDates) {
|
|
8446
|
-
if (
|
|
8447
|
-
newStartDate =
|
|
8772
|
+
if (d.secondaryStart && d.secondaryStart < newStartDate) {
|
|
8773
|
+
newStartDate = d.secondaryStart;
|
|
8448
8774
|
}
|
|
8449
|
-
if (
|
|
8450
|
-
newEndDate =
|
|
8775
|
+
if (d.secondaryEnd && d.secondaryEnd > newEndDate) {
|
|
8776
|
+
newEndDate = d.secondaryEnd;
|
|
8451
8777
|
}
|
|
8452
8778
|
}
|
|
8453
8779
|
}
|
|
8780
|
+
if (realDates) {
|
|
8781
|
+
return [newStartDate, newEndDate];
|
|
8782
|
+
}
|
|
8454
8783
|
switch (viewMode) {
|
|
8455
8784
|
case ViewMode.Year:
|
|
8456
|
-
newStartDate = addToDate(newStartDate, -1,
|
|
8457
|
-
newStartDate = startOfDate(newStartDate,
|
|
8458
|
-
newEndDate = addToDate(newEndDate, 1,
|
|
8459
|
-
newEndDate = startOfDate(newEndDate,
|
|
8785
|
+
newStartDate = addToDate(newStartDate, -1, "year");
|
|
8786
|
+
newStartDate = startOfDate(newStartDate, "year");
|
|
8787
|
+
newEndDate = addToDate(newEndDate, 1, "year");
|
|
8788
|
+
newEndDate = startOfDate(newEndDate, "year");
|
|
8460
8789
|
break;
|
|
8461
8790
|
case ViewMode.Month:
|
|
8462
|
-
newStartDate = addToDate(newStartDate, -1 * preStepsCount,
|
|
8463
|
-
newStartDate = startOfDate(newStartDate,
|
|
8464
|
-
newEndDate = addToDate(newEndDate, 1,
|
|
8465
|
-
newEndDate = startOfDate(newEndDate,
|
|
8791
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "month");
|
|
8792
|
+
newStartDate = startOfDate(newStartDate, "month");
|
|
8793
|
+
newEndDate = addToDate(newEndDate, 1, "year");
|
|
8794
|
+
newEndDate = startOfDate(newEndDate, "year");
|
|
8466
8795
|
break;
|
|
8467
8796
|
case ViewMode.Week:
|
|
8468
|
-
newStartDate = startOfDate(newStartDate,
|
|
8469
|
-
newStartDate = addToDate(getMonday(newStartDate), -7 * preStepsCount,
|
|
8470
|
-
newEndDate = startOfDate(newEndDate,
|
|
8471
|
-
newEndDate = addToDate(newEndDate, 1.5,
|
|
8797
|
+
newStartDate = startOfDate(newStartDate, "day");
|
|
8798
|
+
newStartDate = addToDate(getMonday(newStartDate), -7 * preStepsCount, "day");
|
|
8799
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
8800
|
+
newEndDate = addToDate(newEndDate, 1.5, "month");
|
|
8472
8801
|
break;
|
|
8473
8802
|
case ViewMode.Day:
|
|
8474
|
-
newStartDate = startOfDate(newStartDate,
|
|
8475
|
-
newStartDate = addToDate(newStartDate, -1 * preStepsCount,
|
|
8476
|
-
newEndDate = startOfDate(newEndDate,
|
|
8477
|
-
newEndDate = addToDate(newEndDate, 19,
|
|
8803
|
+
newStartDate = startOfDate(newStartDate, "day");
|
|
8804
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
|
|
8805
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
8806
|
+
newEndDate = addToDate(newEndDate, 19, "day");
|
|
8478
8807
|
break;
|
|
8479
8808
|
case ViewMode.QuarterDay:
|
|
8480
|
-
newStartDate = startOfDate(newStartDate,
|
|
8481
|
-
newStartDate = addToDate(newStartDate, -1 * preStepsCount,
|
|
8482
|
-
newEndDate = startOfDate(newEndDate,
|
|
8483
|
-
newEndDate = addToDate(newEndDate, 66,
|
|
8809
|
+
newStartDate = startOfDate(newStartDate, "day");
|
|
8810
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
|
|
8811
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
8812
|
+
newEndDate = addToDate(newEndDate, 66, "hour");
|
|
8484
8813
|
break;
|
|
8485
8814
|
case ViewMode.HalfDay:
|
|
8486
|
-
newStartDate = startOfDate(newStartDate,
|
|
8487
|
-
newStartDate = addToDate(newStartDate, -1 * preStepsCount,
|
|
8488
|
-
newEndDate = startOfDate(newEndDate,
|
|
8489
|
-
newEndDate = addToDate(newEndDate, 108,
|
|
8815
|
+
newStartDate = startOfDate(newStartDate, "day");
|
|
8816
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "day");
|
|
8817
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
8818
|
+
newEndDate = addToDate(newEndDate, 108, "hour");
|
|
8490
8819
|
break;
|
|
8491
8820
|
case ViewMode.Hour:
|
|
8492
|
-
newStartDate = startOfDate(newStartDate,
|
|
8493
|
-
newStartDate = addToDate(newStartDate, -1 * preStepsCount,
|
|
8494
|
-
newEndDate = startOfDate(newEndDate,
|
|
8495
|
-
newEndDate = addToDate(newEndDate, 1,
|
|
8821
|
+
newStartDate = startOfDate(newStartDate, "hour");
|
|
8822
|
+
newStartDate = addToDate(newStartDate, -1 * preStepsCount, "hour");
|
|
8823
|
+
newEndDate = startOfDate(newEndDate, "day");
|
|
8824
|
+
newEndDate = addToDate(newEndDate, 1, "day");
|
|
8496
8825
|
break;
|
|
8497
8826
|
}
|
|
8498
8827
|
return [newStartDate, newEndDate];
|
|
@@ -8503,25 +8832,25 @@ var seedDates = function seedDates(startDate, endDate, viewMode) {
|
|
|
8503
8832
|
while (currentDate < endDate) {
|
|
8504
8833
|
switch (viewMode) {
|
|
8505
8834
|
case ViewMode.Year:
|
|
8506
|
-
currentDate = addToDate(currentDate, 1,
|
|
8835
|
+
currentDate = addToDate(currentDate, 1, "year");
|
|
8507
8836
|
break;
|
|
8508
8837
|
case ViewMode.Month:
|
|
8509
|
-
currentDate = addToDate(currentDate, 1,
|
|
8838
|
+
currentDate = addToDate(currentDate, 1, "month");
|
|
8510
8839
|
break;
|
|
8511
8840
|
case ViewMode.Week:
|
|
8512
|
-
currentDate = addToDate(currentDate, 7,
|
|
8841
|
+
currentDate = addToDate(currentDate, 7, "day");
|
|
8513
8842
|
break;
|
|
8514
8843
|
case ViewMode.Day:
|
|
8515
|
-
currentDate = addToDate(currentDate, 1,
|
|
8844
|
+
currentDate = addToDate(currentDate, 1, "day");
|
|
8516
8845
|
break;
|
|
8517
8846
|
case ViewMode.HalfDay:
|
|
8518
|
-
currentDate = addToDate(currentDate, 12,
|
|
8847
|
+
currentDate = addToDate(currentDate, 12, "hour");
|
|
8519
8848
|
break;
|
|
8520
8849
|
case ViewMode.QuarterDay:
|
|
8521
|
-
currentDate = addToDate(currentDate, 6,
|
|
8850
|
+
currentDate = addToDate(currentDate, 6, "hour");
|
|
8522
8851
|
break;
|
|
8523
8852
|
case ViewMode.Hour:
|
|
8524
|
-
currentDate = addToDate(currentDate, 1,
|
|
8853
|
+
currentDate = addToDate(currentDate, 1, "hour");
|
|
8525
8854
|
break;
|
|
8526
8855
|
}
|
|
8527
8856
|
dates.push(currentDate);
|
|
@@ -8530,7 +8859,7 @@ var seedDates = function seedDates(startDate, endDate, viewMode) {
|
|
|
8530
8859
|
};
|
|
8531
8860
|
var getLocaleMonth = function getLocaleMonth(date, locale) {
|
|
8532
8861
|
var bottomValue = getCachedDateTimeFormat(locale, {
|
|
8533
|
-
month:
|
|
8862
|
+
month: "long"
|
|
8534
8863
|
}).format(date);
|
|
8535
8864
|
bottomValue = bottomValue.replace(bottomValue[0], bottomValue[0].toLocaleUpperCase());
|
|
8536
8865
|
return bottomValue;
|
|
@@ -8580,15 +8909,15 @@ var defaultDateTimeFormatters = {
|
|
|
8580
8909
|
return "W" + getWeekNumberISO8601(date);
|
|
8581
8910
|
},
|
|
8582
8911
|
day: function day(date, locale) {
|
|
8583
|
-
return getLocalDayOfWeek(date, locale,
|
|
8912
|
+
return getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate().toString();
|
|
8584
8913
|
},
|
|
8585
8914
|
hour: function hour(date, locale) {
|
|
8586
8915
|
return "" + getCachedDateTimeFormat(locale, {
|
|
8587
|
-
hour:
|
|
8916
|
+
hour: "numeric"
|
|
8588
8917
|
}).format(date);
|
|
8589
8918
|
},
|
|
8590
8919
|
dayAndMonth: function dayAndMonth(date, locale) {
|
|
8591
|
-
return getLocalDayOfWeek(date, locale,
|
|
8920
|
+
return getLocalDayOfWeek(date, locale, "short") + ", " + date.getDate() + " " + getLocaleMonth(date, locale);
|
|
8592
8921
|
}
|
|
8593
8922
|
};
|
|
8594
8923
|
|
|
@@ -8864,7 +9193,8 @@ var TaskList = function TaskList(_ref) {
|
|
|
8864
9193
|
taskListRef = _ref.taskListRef,
|
|
8865
9194
|
horizontalContainerClass = _ref.horizontalContainerClass,
|
|
8866
9195
|
TaskListHeader = _ref.TaskListHeader,
|
|
8867
|
-
TaskListTable = _ref.TaskListTable
|
|
9196
|
+
TaskListTable = _ref.TaskListTable,
|
|
9197
|
+
filter = _ref.filter;
|
|
8868
9198
|
var horizontalContainerRef = react.useRef(null);
|
|
8869
9199
|
react.useEffect(function () {
|
|
8870
9200
|
if (horizontalContainerRef.current) {
|
|
@@ -8889,6 +9219,10 @@ var TaskList = function TaskList(_ref) {
|
|
|
8889
9219
|
setSelectedTask: setSelectedTask,
|
|
8890
9220
|
onExpanderClick: onExpanderClick
|
|
8891
9221
|
};
|
|
9222
|
+
react.useEffect(function () {
|
|
9223
|
+
var _taskListRef$current;
|
|
9224
|
+
(_taskListRef$current = taskListRef.current) === null || _taskListRef$current === void 0 ? void 0 : _taskListRef$current.prepend(filter);
|
|
9225
|
+
}, [taskListRef, filter]);
|
|
8892
9226
|
return react.createElement("div", {
|
|
8893
9227
|
ref: taskListRef,
|
|
8894
9228
|
className: classes.tasks
|
|
@@ -8908,9 +9242,7 @@ var GridBody = function GridBody(_ref) {
|
|
|
8908
9242
|
dates = _ref.dates,
|
|
8909
9243
|
rowHeight = _ref.rowHeight,
|
|
8910
9244
|
svgWidth = _ref.svgWidth,
|
|
8911
|
-
columnWidth = _ref.columnWidth
|
|
8912
|
-
todayColor = _ref.todayColor,
|
|
8913
|
-
rtl = _ref.rtl;
|
|
9245
|
+
columnWidth = _ref.columnWidth;
|
|
8914
9246
|
var y = 0;
|
|
8915
9247
|
var gridRows = [];
|
|
8916
9248
|
var rowLines = [react.createElement("line", {
|
|
@@ -8924,7 +9256,7 @@ var GridBody = function GridBody(_ref) {
|
|
|
8924
9256
|
for (var _iterator = _createForOfIteratorHelperLoose(tasks), _step; !(_step = _iterator()).done;) {
|
|
8925
9257
|
var task = _step.value;
|
|
8926
9258
|
gridRows.push(react.createElement("rect", {
|
|
8927
|
-
key:
|
|
9259
|
+
key: "Row" + task.id,
|
|
8928
9260
|
x: "0",
|
|
8929
9261
|
y: y,
|
|
8930
9262
|
width: svgWidth,
|
|
@@ -8932,7 +9264,7 @@ var GridBody = function GridBody(_ref) {
|
|
|
8932
9264
|
className: styles$4.gridRow
|
|
8933
9265
|
}));
|
|
8934
9266
|
rowLines.push(react.createElement("line", {
|
|
8935
|
-
key:
|
|
9267
|
+
key: "RowLine" + task.id,
|
|
8936
9268
|
x: "0",
|
|
8937
9269
|
y1: y + rowHeight,
|
|
8938
9270
|
x2: svgWidth,
|
|
@@ -8944,7 +9276,6 @@ var GridBody = function GridBody(_ref) {
|
|
|
8944
9276
|
var now = new Date();
|
|
8945
9277
|
var tickX = 0;
|
|
8946
9278
|
var ticks = [];
|
|
8947
|
-
var today = react.createElement("rect", null);
|
|
8948
9279
|
for (var i = 0; i < dates.length; i++) {
|
|
8949
9280
|
var date = dates[i];
|
|
8950
9281
|
ticks.push(react.createElement("line", {
|
|
@@ -8955,24 +9286,7 @@ var GridBody = function GridBody(_ref) {
|
|
|
8955
9286
|
y2: y,
|
|
8956
9287
|
className: styles$4.gridTick
|
|
8957
9288
|
}));
|
|
8958
|
-
if (i + 1 !== dates.length && date.getTime() < now.getTime() && dates[i + 1].getTime() >= now.getTime() || i !== 0 && i + 1 === dates.length && date.getTime() < now.getTime() && addToDate(date, date.getTime() - dates[i - 1].getTime(),
|
|
8959
|
-
today = react.createElement("rect", {
|
|
8960
|
-
x: tickX + columnWidth / 2 - 1,
|
|
8961
|
-
y: 0,
|
|
8962
|
-
width: 2,
|
|
8963
|
-
height: y,
|
|
8964
|
-
fill: todayColor
|
|
8965
|
-
});
|
|
8966
|
-
}
|
|
8967
|
-
if (rtl && i + 1 !== dates.length && date.getTime() >= now.getTime() && dates[i + 1].getTime() < now.getTime()) {
|
|
8968
|
-
today = react.createElement("rect", {
|
|
8969
|
-
x: tickX + columnWidth / 2,
|
|
8970
|
-
y: 0,
|
|
8971
|
-
width: 2,
|
|
8972
|
-
height: y,
|
|
8973
|
-
fill: todayColor
|
|
8974
|
-
});
|
|
8975
|
-
}
|
|
9289
|
+
if (i + 1 !== dates.length && date.getTime() < now.getTime() && dates[i + 1].getTime() >= now.getTime() || i !== 0 && i + 1 === dates.length && date.getTime() < now.getTime() && addToDate(date, date.getTime() - dates[i - 1].getTime(), "millisecond").getTime() >= now.getTime()) ;
|
|
8976
9290
|
tickX += columnWidth;
|
|
8977
9291
|
}
|
|
8978
9292
|
return react.createElement("g", {
|
|
@@ -8983,9 +9297,7 @@ var GridBody = function GridBody(_ref) {
|
|
|
8983
9297
|
className: "rowLines"
|
|
8984
9298
|
}, rowLines), react.createElement("g", {
|
|
8985
9299
|
className: "ticks"
|
|
8986
|
-
}, ticks)
|
|
8987
|
-
className: "today"
|
|
8988
|
-
}, today));
|
|
9300
|
+
}, ticks));
|
|
8989
9301
|
};
|
|
8990
9302
|
|
|
8991
9303
|
var Grid = function Grid(props) {
|
|
@@ -9055,7 +9367,8 @@ var Calendar = function Calendar(_ref) {
|
|
|
9055
9367
|
fontSize = _ref.fontSize,
|
|
9056
9368
|
dateTimeFormatters = _ref.dateTimeFormatters,
|
|
9057
9369
|
_ref$singleLineHeader = _ref.singleLineHeader,
|
|
9058
|
-
singleLineHeader = _ref$singleLineHeader === void 0 ? false : _ref$singleLineHeader
|
|
9370
|
+
singleLineHeader = _ref$singleLineHeader === void 0 ? false : _ref$singleLineHeader,
|
|
9371
|
+
currentDateIndicator = _ref.currentDateIndicator;
|
|
9059
9372
|
var simplifiedHeader = singleLineHeader && dateSetup.viewMode !== ViewMode.Year;
|
|
9060
9373
|
var TopCal = simplifiedHeader ? SinglePartOfCalendar : TopPartOfCalendar;
|
|
9061
9374
|
var formatYear = (_dateTimeFormatters$y = dateTimeFormatters === null || dateTimeFormatters === void 0 ? void 0 : dateTimeFormatters.year) != null ? _dateTimeFormatters$y : defaultDateTimeFormatters.year;
|
|
@@ -9141,7 +9454,7 @@ var Calendar = function Calendar(_ref) {
|
|
|
9141
9454
|
var dates = dateSetup.dates;
|
|
9142
9455
|
for (var i = dates.length - 1; i >= 0; i--) {
|
|
9143
9456
|
var date = dates[i];
|
|
9144
|
-
var topValue =
|
|
9457
|
+
var topValue = "";
|
|
9145
9458
|
if (i === 0 || date.getMonth() !== dates[i - 1].getMonth()) {
|
|
9146
9459
|
topValue = formatMonthAndYear(date, locale);
|
|
9147
9460
|
}
|
|
@@ -9276,7 +9589,12 @@ var Calendar = function Calendar(_ref) {
|
|
|
9276
9589
|
width: columnWidth * dateSetup.dates.length,
|
|
9277
9590
|
height: headerHeight,
|
|
9278
9591
|
className: styles$5.calendarHeader
|
|
9279
|
-
}), simplifiedHeader ? null : bottomValues, " ", topValues
|
|
9592
|
+
}), simplifiedHeader ? null : bottomValues, " ", topValues, currentDateIndicator && react.createElement("circle", {
|
|
9593
|
+
fill: currentDateIndicator.color,
|
|
9594
|
+
cx: currentDateIndicator.x + 2.5,
|
|
9595
|
+
cy: headerHeight - 8,
|
|
9596
|
+
r: "8"
|
|
9597
|
+
}));
|
|
9280
9598
|
};
|
|
9281
9599
|
|
|
9282
9600
|
// A type of promise-like that resolves synchronously and supports only one observer
|
|
@@ -9515,6 +9833,9 @@ var taskXCoordinate = function taskXCoordinate(xDate, dates, columnWidth) {
|
|
|
9515
9833
|
var index = dates.findIndex(function (d) {
|
|
9516
9834
|
return d.getTime() >= xDate.getTime();
|
|
9517
9835
|
}) - 1;
|
|
9836
|
+
if (index < 0) {
|
|
9837
|
+
return 0;
|
|
9838
|
+
}
|
|
9518
9839
|
var remainderMillis = xDate.getTime() - dates[index].getTime();
|
|
9519
9840
|
var percentOfInterval = remainderMillis / (dates[index + 1].getTime() - dates[index].getTime());
|
|
9520
9841
|
var x = index * columnWidth + percentOfInterval * columnWidth;
|
|
@@ -9672,6 +9993,15 @@ var handleTaskBySVGMouseEventForBar = function handleTaskBySVGMouseEventForBar(s
|
|
|
9672
9993
|
changedTask: changedTask
|
|
9673
9994
|
};
|
|
9674
9995
|
};
|
|
9996
|
+
function calculateCurrentDateCalculator(dates, columnWidth) {
|
|
9997
|
+
return taskXCoordinate(new Date(), dates, columnWidth);
|
|
9998
|
+
}
|
|
9999
|
+
function calculateProjection(start, end, dates, columnWidth) {
|
|
10000
|
+
return {
|
|
10001
|
+
x0: taskXCoordinate(start, dates, columnWidth),
|
|
10002
|
+
xf: taskXCoordinate(end, dates, columnWidth)
|
|
10003
|
+
};
|
|
10004
|
+
}
|
|
9675
10005
|
|
|
9676
10006
|
function isKeyboardEvent(event) {
|
|
9677
10007
|
return event.key !== undefined;
|
|
@@ -9934,11 +10264,15 @@ var style = {"barLabel":"_3zRJQ","barLabelOutside":"_3KcaM"};
|
|
|
9934
10264
|
|
|
9935
10265
|
var Timeline = function Timeline(_ref) {
|
|
9936
10266
|
var task = _ref.task,
|
|
9937
|
-
isSelected = _ref.isSelected
|
|
10267
|
+
isSelected = _ref.isSelected,
|
|
10268
|
+
onEventStart = _ref.onEventStart;
|
|
9938
10269
|
var styles = task.styles;
|
|
9939
10270
|
var col = isSelected ? styles.backgroundSelectedColor : styles.backgroundColor;
|
|
9940
10271
|
return react.createElement("g", {
|
|
9941
|
-
tabIndex: 0
|
|
10272
|
+
tabIndex: 0,
|
|
10273
|
+
onMouseDown: function onMouseDown(e) {
|
|
10274
|
+
return onEventStart("move", task, e);
|
|
10275
|
+
}
|
|
9942
10276
|
}, react.createElement("rect", {
|
|
9943
10277
|
fill: col,
|
|
9944
10278
|
x: "0",
|
|
@@ -9949,6 +10283,9 @@ var Timeline = function Timeline(_ref) {
|
|
|
9949
10283
|
ry: 0
|
|
9950
10284
|
}), task.barChildren.map(function (bar) {
|
|
9951
10285
|
return react.createElement("rect", {
|
|
10286
|
+
style: {
|
|
10287
|
+
cursor: "pointer"
|
|
10288
|
+
},
|
|
9952
10289
|
key: bar.id,
|
|
9953
10290
|
fill: bar.styles.backgroundColor,
|
|
9954
10291
|
x: bar.x1,
|
|
@@ -9994,7 +10331,7 @@ var TaskItem = function TaskItem(props) {
|
|
|
9994
10331
|
setTaskItem(react.createElement(Bar, Object.assign({}, props)));
|
|
9995
10332
|
break;
|
|
9996
10333
|
}
|
|
9997
|
-
}, [task
|
|
10334
|
+
}, [task, isSelected]);
|
|
9998
10335
|
react.useEffect(function () {
|
|
9999
10336
|
if (textRef.current) {
|
|
10000
10337
|
setIsTextInside(textRef.current.getBBox().width < task.x2 - task.x1);
|
|
@@ -10062,6 +10399,12 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
|
|
|
10062
10399
|
fontFamily = _ref.fontFamily,
|
|
10063
10400
|
fontSize = _ref.fontSize,
|
|
10064
10401
|
rtl = _ref.rtl,
|
|
10402
|
+
_ref$hideLabel = _ref.hideLabel,
|
|
10403
|
+
hideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
10404
|
+
_ref$showSecondaryDat = _ref.showSecondaryDates,
|
|
10405
|
+
showSecondaryDates = _ref$showSecondaryDat === void 0 ? false : _ref$showSecondaryDat,
|
|
10406
|
+
currentDateIndicator = _ref.currentDateIndicator,
|
|
10407
|
+
projection = _ref.projection,
|
|
10065
10408
|
setGanttEvent = _ref.setGanttEvent,
|
|
10066
10409
|
setFailedTask = _ref.setFailedTask,
|
|
10067
10410
|
setSelectedTask = _ref.setSelectedTask,
|
|
@@ -10069,11 +10412,7 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
|
|
|
10069
10412
|
onProgressChange = _ref.onProgressChange,
|
|
10070
10413
|
onDoubleClick = _ref.onDoubleClick,
|
|
10071
10414
|
onClick = _ref.onClick,
|
|
10072
|
-
onDelete = _ref.onDelete
|
|
10073
|
-
_ref$hideLabel = _ref.hideLabel,
|
|
10074
|
-
hideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
10075
|
-
_ref$showSecondaryDat = _ref.showSecondaryDates,
|
|
10076
|
-
showSecondaryDates = _ref$showSecondaryDat === void 0 ? false : _ref$showSecondaryDat;
|
|
10415
|
+
onDelete = _ref.onDelete;
|
|
10077
10416
|
var point = svg === null || svg === void 0 ? void 0 : (_svg$current = svg.current) === null || _svg$current === void 0 ? void 0 : _svg$current.createSVGPoint();
|
|
10078
10417
|
var _useState = react.useState(0),
|
|
10079
10418
|
xStep = _useState[0],
|
|
@@ -10261,7 +10600,20 @@ var TaskGanttContent = function TaskGanttContent(_ref) {
|
|
|
10261
10600
|
};
|
|
10262
10601
|
return react.createElement("g", {
|
|
10263
10602
|
className: "content"
|
|
10264
|
-
}, react.createElement("
|
|
10603
|
+
}, currentDateIndicator && react.createElement("rect", {
|
|
10604
|
+
fill: currentDateIndicator.color,
|
|
10605
|
+
x: currentDateIndicator.x + 1.5,
|
|
10606
|
+
y: "0",
|
|
10607
|
+
width: "2",
|
|
10608
|
+
height: "100%"
|
|
10609
|
+
}), projection && react.createElement("rect", {
|
|
10610
|
+
fill: projection.color,
|
|
10611
|
+
x: projection.x0,
|
|
10612
|
+
y: "0",
|
|
10613
|
+
width: projection.xf - projection.x0,
|
|
10614
|
+
height: "100%",
|
|
10615
|
+
fillOpacity: "35%"
|
|
10616
|
+
}), react.createElement("g", {
|
|
10265
10617
|
className: "arrows",
|
|
10266
10618
|
fill: arrowColor,
|
|
10267
10619
|
stroke: arrowColor
|
|
@@ -10308,6 +10660,7 @@ var TaskGantt = function TaskGantt(_ref) {
|
|
|
10308
10660
|
calendarProps = _ref.calendarProps,
|
|
10309
10661
|
barProps = _ref.barProps,
|
|
10310
10662
|
ganttHeight = _ref.ganttHeight,
|
|
10663
|
+
taskGanttRef = _ref.taskGanttRef,
|
|
10311
10664
|
scrollY = _ref.scrollY,
|
|
10312
10665
|
scrollX = _ref.scrollX;
|
|
10313
10666
|
var ganttSVGRef = react.useRef(null);
|
|
@@ -10327,7 +10680,8 @@ var TaskGantt = function TaskGantt(_ref) {
|
|
|
10327
10680
|
}
|
|
10328
10681
|
}, [scrollX]);
|
|
10329
10682
|
return react.createElement("div", {
|
|
10330
|
-
className: styles$7.ganttContainer
|
|
10683
|
+
className: styles$7.ganttContainer,
|
|
10684
|
+
ref: taskGanttRef
|
|
10331
10685
|
}, react.createElement("div", {
|
|
10332
10686
|
className: styles$7.ganttVerticalContainer,
|
|
10333
10687
|
ref: verticalGanttContainerRef,
|
|
@@ -10358,9 +10712,10 @@ var TaskGantt = function TaskGantt(_ref) {
|
|
|
10358
10712
|
var styles$8 = {"scrollWrapper":"_2k9Ys","scroll":"_19jgW"};
|
|
10359
10713
|
|
|
10360
10714
|
var HorizontalScroll = function HorizontalScroll(_ref) {
|
|
10715
|
+
var _taskGanttRef$current;
|
|
10361
10716
|
var scroll = _ref.scroll,
|
|
10362
10717
|
svgWidth = _ref.svgWidth,
|
|
10363
|
-
|
|
10718
|
+
taskGanttRef = _ref.taskGanttRef,
|
|
10364
10719
|
rtl = _ref.rtl,
|
|
10365
10720
|
onScroll = _ref.onScroll;
|
|
10366
10721
|
var scrollRef = react.useRef(null);
|
|
@@ -10369,11 +10724,12 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
|
|
|
10369
10724
|
scrollRef.current.scrollLeft = scroll;
|
|
10370
10725
|
}
|
|
10371
10726
|
}, [scroll]);
|
|
10727
|
+
var rect = (_taskGanttRef$current = taskGanttRef.current) === null || _taskGanttRef$current === void 0 ? void 0 : _taskGanttRef$current.getBoundingClientRect();
|
|
10372
10728
|
return react.createElement("div", {
|
|
10373
10729
|
dir: "ltr",
|
|
10374
|
-
style: {
|
|
10375
|
-
margin: rtl ? "0px " +
|
|
10376
|
-
},
|
|
10730
|
+
style: rect ? {
|
|
10731
|
+
margin: rtl ? "0px " + rect.x + "px 0px 0px" : "0px 0px 0px " + rect.x + "px"
|
|
10732
|
+
} : undefined,
|
|
10377
10733
|
className: styles$8.scrollWrapper,
|
|
10378
10734
|
onScroll: onScroll,
|
|
10379
10735
|
ref: scrollRef
|
|
@@ -10386,15 +10742,17 @@ var HorizontalScroll = function HorizontalScroll(_ref) {
|
|
|
10386
10742
|
};
|
|
10387
10743
|
|
|
10388
10744
|
var Gantt = function Gantt(_ref) {
|
|
10389
|
-
var
|
|
10745
|
+
var id = _ref.id,
|
|
10746
|
+
tasks = _ref.tasks,
|
|
10390
10747
|
_ref$headerHeight = _ref.headerHeight,
|
|
10391
|
-
headerHeight = _ref$headerHeight === void 0 ?
|
|
10748
|
+
headerHeight = _ref$headerHeight === void 0 ? 114 : _ref$headerHeight,
|
|
10392
10749
|
_ref$columnWidth = _ref.columnWidth,
|
|
10393
10750
|
columnWidth = _ref$columnWidth === void 0 ? 60 : _ref$columnWidth,
|
|
10394
10751
|
_ref$listCellWidth = _ref.listCellWidth,
|
|
10395
|
-
listCellWidth = _ref$listCellWidth === void 0 ? "
|
|
10752
|
+
listCellWidth = _ref$listCellWidth === void 0 ? "297px" : _ref$listCellWidth,
|
|
10396
10753
|
_ref$rowHeight = _ref.rowHeight,
|
|
10397
10754
|
rowHeight = _ref$rowHeight === void 0 ? 50 : _ref$rowHeight,
|
|
10755
|
+
filter = _ref.filter,
|
|
10398
10756
|
_ref$ganttHeight = _ref.ganttHeight,
|
|
10399
10757
|
ganttHeight = _ref$ganttHeight === void 0 ? 0 : _ref$ganttHeight,
|
|
10400
10758
|
_ref$viewMode = _ref.viewMode,
|
|
@@ -10442,7 +10800,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
10442
10800
|
_ref$arrowIndent = _ref.arrowIndent,
|
|
10443
10801
|
arrowIndent = _ref$arrowIndent === void 0 ? 20 : _ref$arrowIndent,
|
|
10444
10802
|
_ref$todayColor = _ref.todayColor,
|
|
10445
|
-
todayColor = _ref$todayColor === void 0 ? "
|
|
10803
|
+
todayColor = _ref$todayColor === void 0 ? "#ff0000" : _ref$todayColor,
|
|
10446
10804
|
viewDate = _ref.viewDate,
|
|
10447
10805
|
_ref$TooltipContent = _ref.TooltipContent,
|
|
10448
10806
|
TooltipContent = _ref$TooltipContent === void 0 ? StandardTooltipContent : _ref$TooltipContent,
|
|
@@ -10450,13 +10808,6 @@ var Gantt = function Gantt(_ref) {
|
|
|
10450
10808
|
TaskListHeader = _ref$TaskListHeader === void 0 ? TaskListHeaderDefault : _ref$TaskListHeader,
|
|
10451
10809
|
_ref$TaskListTable = _ref.TaskListTable,
|
|
10452
10810
|
TaskListTable = _ref$TaskListTable === void 0 ? TaskListTableDefault : _ref$TaskListTable,
|
|
10453
|
-
onDateChange = _ref.onDateChange,
|
|
10454
|
-
onProgressChange = _ref.onProgressChange,
|
|
10455
|
-
onDoubleClick = _ref.onDoubleClick,
|
|
10456
|
-
onClick = _ref.onClick,
|
|
10457
|
-
onDelete = _ref.onDelete,
|
|
10458
|
-
onSelect = _ref.onSelect,
|
|
10459
|
-
onExpanderClick = _ref.onExpanderClick,
|
|
10460
10811
|
dateTimeFormatters = _ref.dateTimeFormatters,
|
|
10461
10812
|
_ref$singleLineHeader = _ref.singleLineHeader,
|
|
10462
10813
|
singleLineHeader = _ref$singleLineHeader === void 0 ? false : _ref$singleLineHeader,
|
|
@@ -10465,13 +10816,24 @@ var Gantt = function Gantt(_ref) {
|
|
|
10465
10816
|
_ref$showSecondaryDat = _ref.showSecondaryDates,
|
|
10466
10817
|
showSecondaryDates = _ref$showSecondaryDat === void 0 ? false : _ref$showSecondaryDat,
|
|
10467
10818
|
_ref$hideDependencies = _ref.hideDependencies,
|
|
10468
|
-
hideDependencies = _ref$hideDependencies === void 0 ? false : _ref$hideDependencies
|
|
10819
|
+
hideDependencies = _ref$hideDependencies === void 0 ? false : _ref$hideDependencies,
|
|
10820
|
+
projection = _ref.projection,
|
|
10821
|
+
displayedStartDate = _ref.displayedStartDate,
|
|
10822
|
+
displayedEndDate = _ref.displayedEndDate,
|
|
10823
|
+
onDateChange = _ref.onDateChange,
|
|
10824
|
+
onProgressChange = _ref.onProgressChange,
|
|
10825
|
+
onDoubleClick = _ref.onDoubleClick,
|
|
10826
|
+
onClick = _ref.onClick,
|
|
10827
|
+
onDelete = _ref.onDelete,
|
|
10828
|
+
onSelect = _ref.onSelect,
|
|
10829
|
+
onExpanderClick = _ref.onExpanderClick;
|
|
10469
10830
|
var wrapperRef = react.useRef(null);
|
|
10831
|
+
var taskGanttRef = react.useRef(null);
|
|
10470
10832
|
var taskListRef = react.useRef(null);
|
|
10471
10833
|
var _useState = react.useState(function () {
|
|
10472
|
-
var
|
|
10473
|
-
startDate =
|
|
10474
|
-
endDate =
|
|
10834
|
+
var _ganttDateRangeFromTa = ganttDateRangeFromTask(tasks, viewMode, preStepsCount, showSecondaryDates, displayedStartDate, displayedEndDate),
|
|
10835
|
+
startDate = _ganttDateRangeFromTa[0],
|
|
10836
|
+
endDate = _ganttDateRangeFromTa[1];
|
|
10475
10837
|
return {
|
|
10476
10838
|
viewMode: viewMode,
|
|
10477
10839
|
dates: seedDates(startDate, endDate, viewMode)
|
|
@@ -10525,6 +10887,19 @@ var Gantt = function Gantt(_ref) {
|
|
|
10525
10887
|
var _useState12 = react.useState(false),
|
|
10526
10888
|
ignoreScrollEvent = _useState12[0],
|
|
10527
10889
|
setIgnoreScrollEvent = _useState12[1];
|
|
10890
|
+
var _useState13 = react.useState(),
|
|
10891
|
+
currentDateIndicatorContent = _useState13[0],
|
|
10892
|
+
setCurrentDateIndicatorContent = _useState13[1];
|
|
10893
|
+
var _useState14 = react.useState(),
|
|
10894
|
+
projectionContent = _useState14[0],
|
|
10895
|
+
setProjectionContent = _useState14[1];
|
|
10896
|
+
react.useEffect(function () {
|
|
10897
|
+
window.addEventListener("gantt-sync-scroll-event", function (e) {
|
|
10898
|
+
if (e.detail.id !== id) {
|
|
10899
|
+
setScrollX(e.detail.scrollX);
|
|
10900
|
+
}
|
|
10901
|
+
});
|
|
10902
|
+
}, [id]);
|
|
10528
10903
|
react.useEffect(function () {
|
|
10529
10904
|
var filteredTasks;
|
|
10530
10905
|
if (onExpanderClick) {
|
|
@@ -10533,9 +10908,9 @@ var Gantt = function Gantt(_ref) {
|
|
|
10533
10908
|
filteredTasks = tasks;
|
|
10534
10909
|
}
|
|
10535
10910
|
filteredTasks = filteredTasks.sort(sortTasks);
|
|
10536
|
-
var
|
|
10537
|
-
startDate =
|
|
10538
|
-
endDate =
|
|
10911
|
+
var _ganttDateRangeFromTa2 = ganttDateRangeFromTask(filteredTasks, viewMode, preStepsCount, showSecondaryDates, displayedStartDate, displayedEndDate),
|
|
10912
|
+
startDate = _ganttDateRangeFromTa2[0],
|
|
10913
|
+
endDate = _ganttDateRangeFromTa2[1];
|
|
10539
10914
|
var newDates = seedDates(startDate, endDate, viewMode);
|
|
10540
10915
|
if (rtl) {
|
|
10541
10916
|
newDates = newDates.reverse();
|
|
@@ -10548,7 +10923,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
10548
10923
|
viewMode: viewMode
|
|
10549
10924
|
});
|
|
10550
10925
|
setBarTasks(convertToBarTasks(filteredTasks, newDates, columnWidth, rowHeight, taskHeight, projectHeight, timelineHeight, barCornerRadius, handleWidth, rtl, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, showSecondaryDates));
|
|
10551
|
-
}, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick]);
|
|
10926
|
+
}, [tasks, viewMode, preStepsCount, rowHeight, barCornerRadius, columnWidth, taskHeight, handleWidth, barProgressColor, barProgressSelectedColor, barBackgroundColor, barBackgroundSelectedColor, projectProgressColor, projectProgressSelectedColor, projectBackgroundColor, projectBackgroundSelectedColor, rtl, scrollX, onExpanderClick, showSecondaryDates, projectHeight, timelineHeight, displayedStartDate, displayedEndDate]);
|
|
10552
10927
|
react.useEffect(function () {
|
|
10553
10928
|
if (viewMode === dateSetup.viewMode && (viewDate && !currentViewDate || viewDate && (currentViewDate === null || currentViewDate === void 0 ? void 0 : currentViewDate.valueOf()) !== viewDate.valueOf())) {
|
|
10554
10929
|
var dates = dateSetup.dates;
|
|
@@ -10660,11 +11035,20 @@ var Gantt = function Gantt(_ref) {
|
|
|
10660
11035
|
if (scrollX !== event.currentTarget.scrollLeft && !ignoreScrollEvent) {
|
|
10661
11036
|
setScrollX(event.currentTarget.scrollLeft);
|
|
10662
11037
|
setIgnoreScrollEvent(true);
|
|
11038
|
+
window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
|
|
11039
|
+
detail: {
|
|
11040
|
+
componentId: id,
|
|
11041
|
+
scrollX: event.currentTarget.scrollLeft
|
|
11042
|
+
}
|
|
11043
|
+
}));
|
|
10663
11044
|
} else {
|
|
10664
11045
|
setIgnoreScrollEvent(false);
|
|
10665
11046
|
}
|
|
10666
11047
|
};
|
|
10667
11048
|
var handleKeyDown = function handleKeyDown(event) {
|
|
11049
|
+
if (event.target.tagName === "INPUT") {
|
|
11050
|
+
return;
|
|
11051
|
+
}
|
|
10668
11052
|
event.preventDefault();
|
|
10669
11053
|
var newScrollY = scrollY;
|
|
10670
11054
|
var newScrollX = scrollX;
|
|
@@ -10696,6 +11080,12 @@ var Gantt = function Gantt(_ref) {
|
|
|
10696
11080
|
newScrollX = svgWidth;
|
|
10697
11081
|
}
|
|
10698
11082
|
setScrollX(newScrollX);
|
|
11083
|
+
window.dispatchEvent(new CustomEvent("gantt-sync-scroll-event", {
|
|
11084
|
+
detail: {
|
|
11085
|
+
componentId: id,
|
|
11086
|
+
scrollX: newScrollX
|
|
11087
|
+
}
|
|
11088
|
+
}));
|
|
10699
11089
|
} else {
|
|
10700
11090
|
if (newScrollY < 0) {
|
|
10701
11091
|
newScrollY = 0;
|
|
@@ -10706,6 +11096,29 @@ var Gantt = function Gantt(_ref) {
|
|
|
10706
11096
|
}
|
|
10707
11097
|
setIgnoreScrollEvent(true);
|
|
10708
11098
|
};
|
|
11099
|
+
react.useEffect(function () {
|
|
11100
|
+
var x = calculateCurrentDateCalculator(dateSetup.dates, columnWidth);
|
|
11101
|
+
if (x !== 0) {
|
|
11102
|
+
setCurrentDateIndicatorContent({
|
|
11103
|
+
color: todayColor,
|
|
11104
|
+
x: x
|
|
11105
|
+
});
|
|
11106
|
+
}
|
|
11107
|
+
}, [columnWidth, dateSetup.dates, todayColor]);
|
|
11108
|
+
react.useEffect(function () {
|
|
11109
|
+
if (projection) {
|
|
11110
|
+
var _calculateProjection = calculateProjection(projection.start, projection.end, dateSetup.dates, columnWidth),
|
|
11111
|
+
x0 = _calculateProjection.x0,
|
|
11112
|
+
xf = _calculateProjection.xf;
|
|
11113
|
+
setProjectionContent({
|
|
11114
|
+
x0: x0,
|
|
11115
|
+
xf: xf,
|
|
11116
|
+
color: projection.color
|
|
11117
|
+
});
|
|
11118
|
+
} else {
|
|
11119
|
+
setProjectionContent(undefined);
|
|
11120
|
+
}
|
|
11121
|
+
}, [columnWidth, dateSetup.dates, projection]);
|
|
10709
11122
|
var handleSelectedTask = function handleSelectedTask(taskId) {
|
|
10710
11123
|
var newSelectedTask = barTasks.find(function (t) {
|
|
10711
11124
|
return t.id === taskId;
|
|
@@ -10749,7 +11162,8 @@ var Gantt = function Gantt(_ref) {
|
|
|
10749
11162
|
fontSize: fontSize,
|
|
10750
11163
|
rtl: rtl,
|
|
10751
11164
|
dateTimeFormatters: dateTimeFormatters,
|
|
10752
|
-
singleLineHeader: singleLineHeader
|
|
11165
|
+
singleLineHeader: singleLineHeader,
|
|
11166
|
+
currentDateIndicator: currentDateIndicatorContent
|
|
10753
11167
|
};
|
|
10754
11168
|
var barProps = {
|
|
10755
11169
|
tasks: barTasks,
|
|
@@ -10766,6 +11180,11 @@ var Gantt = function Gantt(_ref) {
|
|
|
10766
11180
|
arrowIndent: arrowIndent,
|
|
10767
11181
|
svgWidth: svgWidth,
|
|
10768
11182
|
rtl: rtl,
|
|
11183
|
+
hideLabel: hideLabel,
|
|
11184
|
+
showSecondaryDates: showSecondaryDates,
|
|
11185
|
+
ganttHeight: ganttHeight,
|
|
11186
|
+
currentDateIndicator: currentDateIndicatorContent,
|
|
11187
|
+
projection: projectionContent,
|
|
10769
11188
|
setGanttEvent: setGanttEvent,
|
|
10770
11189
|
setFailedTask: setFailedTask,
|
|
10771
11190
|
setSelectedTask: handleSelectedTask,
|
|
@@ -10773,9 +11192,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
10773
11192
|
onProgressChange: onProgressChange,
|
|
10774
11193
|
onDoubleClick: onDoubleClick,
|
|
10775
11194
|
onClick: onClick,
|
|
10776
|
-
onDelete: onDelete
|
|
10777
|
-
hideLabel: hideLabel,
|
|
10778
|
-
showSecondaryDates: showSecondaryDates
|
|
11195
|
+
onDelete: onDelete
|
|
10779
11196
|
};
|
|
10780
11197
|
var tableProps = {
|
|
10781
11198
|
rowHeight: rowHeight,
|
|
@@ -10787,6 +11204,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
10787
11204
|
headerHeight: headerHeight,
|
|
10788
11205
|
scrollY: scrollY,
|
|
10789
11206
|
ganttHeight: ganttHeight,
|
|
11207
|
+
filter: filter,
|
|
10790
11208
|
horizontalContainerClass: styles$7.horizontalContainer,
|
|
10791
11209
|
selectedTask: selectedTask,
|
|
10792
11210
|
taskListRef: taskListRef,
|
|
@@ -10805,6 +11223,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
10805
11223
|
calendarProps: calendarProps,
|
|
10806
11224
|
barProps: barProps,
|
|
10807
11225
|
ganttHeight: ganttHeight,
|
|
11226
|
+
taskGanttRef: taskGanttRef,
|
|
10808
11227
|
scrollY: scrollY,
|
|
10809
11228
|
scrollX: scrollX
|
|
10810
11229
|
}), ganttEvent.changedTask && react.createElement(Tooltip, {
|
|
@@ -10831,6 +11250,7 @@ var Gantt = function Gantt(_ref) {
|
|
|
10831
11250
|
rtl: rtl
|
|
10832
11251
|
})), react.createElement(HorizontalScroll, {
|
|
10833
11252
|
svgWidth: svgWidth,
|
|
11253
|
+
taskGanttRef: taskGanttRef,
|
|
10834
11254
|
taskListWidth: taskListWidth,
|
|
10835
11255
|
scroll: scrollX,
|
|
10836
11256
|
rtl: rtl,
|
|
@@ -10838,195 +11258,6 @@ var Gantt = function Gantt(_ref) {
|
|
|
10838
11258
|
}));
|
|
10839
11259
|
};
|
|
10840
11260
|
|
|
10841
|
-
var TimeUnit;
|
|
10842
|
-
(function (TimeUnit) {
|
|
10843
|
-
TimeUnit["DAY"] = "days";
|
|
10844
|
-
TimeUnit["WEEK"] = "weeks";
|
|
10845
|
-
TimeUnit["MONTH"] = "months";
|
|
10846
|
-
TimeUnit["YEAR"] = "YEAR";
|
|
10847
|
-
})(TimeUnit || (TimeUnit = {}));
|
|
10848
|
-
|
|
10849
|
-
var parseToDayStart = function parseToDayStart(ymd) {
|
|
10850
|
-
return luxon.DateTime.fromISO(ymd).toJSDate();
|
|
10851
|
-
};
|
|
10852
|
-
var parseToDayEnd = function parseToDayEnd(endDate) {
|
|
10853
|
-
return luxon.DateTime.fromISO(endDate).plus({
|
|
10854
|
-
seconds: 86400 - 1
|
|
10855
|
-
}).toJSDate();
|
|
10856
|
-
};
|
|
10857
|
-
var formatToIsoDate = function formatToIsoDate(date) {
|
|
10858
|
-
return luxon.DateTime.fromJSDate(date).toISODate();
|
|
10859
|
-
};
|
|
10860
|
-
var formatToLocaleSimple = function formatToLocaleSimple(date) {
|
|
10861
|
-
return luxon.DateTime.fromJSDate(date).toFormat("dd/MM/yyyy");
|
|
10862
|
-
};
|
|
10863
|
-
function validDates(startDate, endDate, name) {
|
|
10864
|
-
var _start;
|
|
10865
|
-
var start = parseToDayStart(startDate);
|
|
10866
|
-
var end = parseToDayEnd(endDate);
|
|
10867
|
-
if (((_start = start) === null || _start === void 0 ? void 0 : _start.getTime()) > (end === null || end === void 0 ? void 0 : end.getTime())) {
|
|
10868
|
-
start = parseToDayStart(endDate);
|
|
10869
|
-
console.log("time-converters.ts validDates() Error date", {
|
|
10870
|
-
name: name,
|
|
10871
|
-
start: startDate,
|
|
10872
|
-
end: endDate
|
|
10873
|
-
});
|
|
10874
|
-
}
|
|
10875
|
-
return {
|
|
10876
|
-
start: start,
|
|
10877
|
-
end: end
|
|
10878
|
-
};
|
|
10879
|
-
}
|
|
10880
|
-
|
|
10881
|
-
var toViewMode = function toViewMode(timeUnit) {
|
|
10882
|
-
switch (timeUnit) {
|
|
10883
|
-
case TimeUnit.DAY:
|
|
10884
|
-
return ViewMode.Day;
|
|
10885
|
-
case TimeUnit.WEEK:
|
|
10886
|
-
return ViewMode.Week;
|
|
10887
|
-
case TimeUnit.MONTH:
|
|
10888
|
-
return ViewMode.Month;
|
|
10889
|
-
case TimeUnit.YEAR:
|
|
10890
|
-
return ViewMode.Year;
|
|
10891
|
-
}
|
|
10892
|
-
};
|
|
10893
|
-
var convertPhaseToTask = function convertPhaseToTask(item) {
|
|
10894
|
-
var mapPhase = function mapPhase(_ref) {
|
|
10895
|
-
var phaseStart = _ref.startDate,
|
|
10896
|
-
phaseEnd = _ref.endDate,
|
|
10897
|
-
secondaryStartDate = _ref.secondaryStartDate,
|
|
10898
|
-
secondaryEndDate = _ref.secondaryEndDate,
|
|
10899
|
-
phaseName = _ref.name,
|
|
10900
|
-
phaseId = _ref.id,
|
|
10901
|
-
color = _ref.color,
|
|
10902
|
-
selectedColor = _ref.selectedColor,
|
|
10903
|
-
dependencies = _ref.dependencies;
|
|
10904
|
-
var _validDates = validDates(phaseStart, phaseEnd, phaseName),
|
|
10905
|
-
start = _validDates.start,
|
|
10906
|
-
end = _validDates.end;
|
|
10907
|
-
var _validDates2 = validDates(secondaryStartDate, secondaryEndDate, phaseName),
|
|
10908
|
-
phaseStart2 = _validDates2.start,
|
|
10909
|
-
phaseEnd2 = _validDates2.end;
|
|
10910
|
-
return {
|
|
10911
|
-
start: start,
|
|
10912
|
-
end: end,
|
|
10913
|
-
secondaryStart: phaseStart2,
|
|
10914
|
-
secondaryEnd: phaseEnd2,
|
|
10915
|
-
name: phaseName,
|
|
10916
|
-
valuesToShow: item.valuesToShow,
|
|
10917
|
-
id: phaseId,
|
|
10918
|
-
type: "task",
|
|
10919
|
-
progress: 100,
|
|
10920
|
-
dependencies: dependencies,
|
|
10921
|
-
styles: color ? {
|
|
10922
|
-
backgroundColor: color,
|
|
10923
|
-
progressColor: color,
|
|
10924
|
-
backgroundSelectedColor: selectedColor,
|
|
10925
|
-
progressSelectedColor: selectedColor
|
|
10926
|
-
} : {}
|
|
10927
|
-
};
|
|
10928
|
-
};
|
|
10929
|
-
return mapPhase(item);
|
|
10930
|
-
};
|
|
10931
|
-
var convertDetailToTimeline = function convertDetailToTimeline(item) {
|
|
10932
|
-
var id = item.id,
|
|
10933
|
-
name = item.name,
|
|
10934
|
-
schedule = item.schedule;
|
|
10935
|
-
var convertToFrame = function convertToFrame(x) {
|
|
10936
|
-
var startDate = x.startDate,
|
|
10937
|
-
endDate = x.endDate,
|
|
10938
|
-
color = x.color,
|
|
10939
|
-
selectedColor = x.selectedColor;
|
|
10940
|
-
var _validDates3 = validDates(startDate, endDate, "time frame"),
|
|
10941
|
-
start = _validDates3.start,
|
|
10942
|
-
end = _validDates3.end;
|
|
10943
|
-
return {
|
|
10944
|
-
start: start,
|
|
10945
|
-
end: end,
|
|
10946
|
-
backgroundColor: color != null ? color : "0xffffff",
|
|
10947
|
-
backgroundSelectedColor: selectedColor != null ? selectedColor : color
|
|
10948
|
-
};
|
|
10949
|
-
};
|
|
10950
|
-
var defaultColor = "#595959";
|
|
10951
|
-
return {
|
|
10952
|
-
id: id,
|
|
10953
|
-
type: "timeline",
|
|
10954
|
-
timeline: schedule.map(convertToFrame),
|
|
10955
|
-
name: name,
|
|
10956
|
-
valuesToShow: item.valuesToShow,
|
|
10957
|
-
start: new Date(),
|
|
10958
|
-
end: new Date(),
|
|
10959
|
-
progress: 100,
|
|
10960
|
-
styles: {
|
|
10961
|
-
backgroundColor: defaultColor,
|
|
10962
|
-
progressColor: defaultColor,
|
|
10963
|
-
backgroundSelectedColor: defaultColor,
|
|
10964
|
-
progressSelectedColor: defaultColor
|
|
10965
|
-
}
|
|
10966
|
-
};
|
|
10967
|
-
};
|
|
10968
|
-
var convertProjectToTasks = function convertProjectToTasks(_ref2) {
|
|
10969
|
-
var id = _ref2.id,
|
|
10970
|
-
name = _ref2.name,
|
|
10971
|
-
valuesToShow = _ref2.valuesToShow,
|
|
10972
|
-
startDate = _ref2.startDate,
|
|
10973
|
-
endDate = _ref2.endDate,
|
|
10974
|
-
phases = _ref2.phases,
|
|
10975
|
-
details = _ref2.details,
|
|
10976
|
-
secondaryStartDate = _ref2.secondaryStartDate,
|
|
10977
|
-
secondaryEndDate = _ref2.secondaryEndDate;
|
|
10978
|
-
var _validDates4 = validDates(startDate, endDate, name),
|
|
10979
|
-
start = _validDates4.start,
|
|
10980
|
-
end = _validDates4.end;
|
|
10981
|
-
var _validDates5 = validDates(secondaryStartDate, secondaryEndDate, name),
|
|
10982
|
-
start2 = _validDates5.start,
|
|
10983
|
-
end2 = _validDates5.end;
|
|
10984
|
-
var mainTask = {
|
|
10985
|
-
start: start,
|
|
10986
|
-
end: end,
|
|
10987
|
-
id: id,
|
|
10988
|
-
name: name,
|
|
10989
|
-
valuesToShow: valuesToShow,
|
|
10990
|
-
secondaryStart: start2,
|
|
10991
|
-
secondaryEnd: end2,
|
|
10992
|
-
type: "project",
|
|
10993
|
-
progress: 100,
|
|
10994
|
-
isDisabled: false,
|
|
10995
|
-
hideChildren: false
|
|
10996
|
-
};
|
|
10997
|
-
var children1 = (phases != null ? phases : []).map(convertPhaseToTask);
|
|
10998
|
-
var children2 = (details != null ? details : []).map(convertDetailToTimeline);
|
|
10999
|
-
return [mainTask].concat(children1, children2);
|
|
11000
|
-
};
|
|
11001
|
-
var mergeTaskIntoProjects = function mergeTaskIntoProjects(projects, _ref3) {
|
|
11002
|
-
var id = _ref3.id,
|
|
11003
|
-
start = _ref3.start,
|
|
11004
|
-
end = _ref3.end;
|
|
11005
|
-
return projects.map(function (project) {
|
|
11006
|
-
return project.id === id ? withNewDates(project, start, end) : project;
|
|
11007
|
-
});
|
|
11008
|
-
};
|
|
11009
|
-
var mergeTaskIntoPhases = function mergeTaskIntoPhases(phases, _ref4) {
|
|
11010
|
-
var id = _ref4.id,
|
|
11011
|
-
start = _ref4.start,
|
|
11012
|
-
end = _ref4.end;
|
|
11013
|
-
if (phases) {
|
|
11014
|
-
return phases.map(function (phase) {
|
|
11015
|
-
return phase.id === id ? withNewDates(phase, start, end) : phase;
|
|
11016
|
-
});
|
|
11017
|
-
}
|
|
11018
|
-
return undefined;
|
|
11019
|
-
};
|
|
11020
|
-
var withNewDates = function withNewDates(p, start, end) {
|
|
11021
|
-
var startDate = formatToIsoDate(start);
|
|
11022
|
-
var endDate = formatToIsoDate(end);
|
|
11023
|
-
var extra = {
|
|
11024
|
-
startDate: startDate,
|
|
11025
|
-
endDate: endDate
|
|
11026
|
-
};
|
|
11027
|
-
return _extends({}, p, extra);
|
|
11028
|
-
};
|
|
11029
|
-
|
|
11030
11261
|
var cachedFormats = {};
|
|
11031
11262
|
var getOrBuildCachedFormat = function getOrBuildCachedFormat(locale, options) {
|
|
11032
11263
|
var _cachedFormats$key;
|
|
@@ -11039,8 +11270,8 @@ var format = function format(date, locale, options) {
|
|
|
11039
11270
|
var format1 = getOrBuildCachedFormat(locale, options).format(date);
|
|
11040
11271
|
return format1;
|
|
11041
11272
|
} catch (e) {
|
|
11042
|
-
console.
|
|
11043
|
-
console.
|
|
11273
|
+
console.error("time-formatters.ts format", date, locale, options);
|
|
11274
|
+
console.error(e);
|
|
11044
11275
|
}
|
|
11045
11276
|
};
|
|
11046
11277
|
var dayFormatter = function dayFormatter(date, locale) {
|
|
@@ -11063,120 +11294,22 @@ var ganttDateTimeFormatters = {
|
|
|
11063
11294
|
month: monthFormatter
|
|
11064
11295
|
};
|
|
11065
11296
|
|
|
11066
|
-
var
|
|
11067
|
-
var locale = "it-IT";
|
|
11068
|
-
var GanttByTask = function GanttByTask(_ref) {
|
|
11069
|
-
var _stylingOptions$preSt, _DateTime$now$minus;
|
|
11070
|
-
var _ref$projects = _ref.projects,
|
|
11071
|
-
projects = _ref$projects === void 0 ? [] : _ref$projects,
|
|
11072
|
-
_ref$timeUnit = _ref.timeUnit,
|
|
11073
|
-
timeUnit = _ref$timeUnit === void 0 ? TimeUnit.DAY : _ref$timeUnit,
|
|
11074
|
-
TooltipContent = _ref.TooltipContent,
|
|
11075
|
-
TaskListHeader = _ref.TaskListHeader,
|
|
11076
|
-
TaskListTable = _ref.TaskListTable,
|
|
11077
|
-
onDateChange = _ref.onDateChange,
|
|
11078
|
-
onClick = _ref.onClick,
|
|
11079
|
-
_ref$stylingOptions = _ref.stylingOptions,
|
|
11080
|
-
stylingOptions = _ref$stylingOptions === void 0 ? {} : _ref$stylingOptions,
|
|
11081
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
11082
|
-
var _useState = react.useState(projects),
|
|
11083
|
-
currentProjects = _useState[0],
|
|
11084
|
-
setCurrentProjects = _useState[1];
|
|
11085
|
-
react.useEffect(function () {
|
|
11086
|
-
if (projects) setCurrentProjects(projects);
|
|
11087
|
-
}, [projects]);
|
|
11088
|
-
var _useState2 = react.useState(1),
|
|
11089
|
-
key = _useState2[0],
|
|
11090
|
-
setKey = _useState2[1];
|
|
11091
|
-
var tasks = react.useMemo(function () {
|
|
11092
|
-
setKey(function (k) {
|
|
11093
|
-
return k + 1;
|
|
11094
|
-
});
|
|
11095
|
-
return currentProjects.flatMap(convertProjectToTasks);
|
|
11096
|
-
}, [currentProjects]);
|
|
11097
|
-
var getProjectById = function getProjectById(id) {
|
|
11098
|
-
return currentProjects.find(function (p) {
|
|
11099
|
-
return p.id === id;
|
|
11100
|
-
});
|
|
11101
|
-
};
|
|
11102
|
-
var handleClick = function handleClick(task) {
|
|
11103
|
-
var id = task === null || task === void 0 ? void 0 : task.id;
|
|
11104
|
-
console.log("gantt-by-task.tsx onClick", id);
|
|
11105
|
-
var project = getProjectById(id);
|
|
11106
|
-
if (project) onClick === null || onClick === void 0 ? void 0 : onClick(project);
|
|
11107
|
-
var phase = currentProjects.flatMap(function (p) {
|
|
11108
|
-
return p.phases;
|
|
11109
|
-
}).find(function (ph) {
|
|
11110
|
-
return (ph === null || ph === void 0 ? void 0 : ph.id) === id;
|
|
11111
|
-
});
|
|
11112
|
-
if (phase) onClick === null || onClick === void 0 ? void 0 : onClick(phase);
|
|
11113
|
-
};
|
|
11114
|
-
var handleDateChange = function handleDateChange(task) {
|
|
11115
|
-
var id = task === null || task === void 0 ? void 0 : task.id;
|
|
11116
|
-
console.log("gantt-by-task.tsx onDateChange", id);
|
|
11117
|
-
var project = getProjectById(id);
|
|
11118
|
-
if (project) {
|
|
11119
|
-
var result = mergeTaskIntoProjects(currentProjects, task);
|
|
11120
|
-
setCurrentProjects(result);
|
|
11121
|
-
var _project = result.find(function (p) {
|
|
11122
|
-
return p.id === id;
|
|
11123
|
-
});
|
|
11124
|
-
if (_project) onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(_project);
|
|
11125
|
-
return;
|
|
11126
|
-
}
|
|
11127
|
-
var parentOfClickedPhase = currentProjects.find(function (p) {
|
|
11128
|
-
var _p$phases;
|
|
11129
|
-
return (_p$phases = p.phases) === null || _p$phases === void 0 ? void 0 : _p$phases.some(function (ph) {
|
|
11130
|
-
return (ph === null || ph === void 0 ? void 0 : ph.id) === id;
|
|
11131
|
-
});
|
|
11132
|
-
});
|
|
11133
|
-
if (parentOfClickedPhase) {
|
|
11134
|
-
var phases = mergeTaskIntoPhases(parentOfClickedPhase.phases, task);
|
|
11135
|
-
var updatedProjects = currentProjects.map(function (p) {
|
|
11136
|
-
return p.id === parentOfClickedPhase.id ? _extends({}, p, {
|
|
11137
|
-
phases: phases
|
|
11138
|
-
}) : p;
|
|
11139
|
-
});
|
|
11140
|
-
setCurrentProjects(updatedProjects);
|
|
11141
|
-
var phase = updatedProjects.flatMap(function (p) {
|
|
11142
|
-
return p.phases;
|
|
11143
|
-
}).find(function (ph) {
|
|
11144
|
-
return (ph === null || ph === void 0 ? void 0 : ph.id) === id;
|
|
11145
|
-
});
|
|
11146
|
-
if (phase) onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(phase);
|
|
11147
|
-
}
|
|
11148
|
-
};
|
|
11149
|
-
var viewDate = luxon.DateTime.now().minus((_DateTime$now$minus = {}, _DateTime$now$minus[timeUnit] = (_stylingOptions$preSt = stylingOptions === null || stylingOptions === void 0 ? void 0 : stylingOptions.preStepsCount) != null ? _stylingOptions$preSt : 2, _DateTime$now$minus)).toJSDate();
|
|
11150
|
-
console.log("gantt-by-task.tsx TASKS", tasks);
|
|
11151
|
-
var returnElement = (tasks === null || tasks === void 0 ? void 0 : tasks.length) > 0 && react.createElement(Gantt, Object.assign({
|
|
11152
|
-
key: key,
|
|
11153
|
-
tasks: tasks,
|
|
11154
|
-
locale: locale,
|
|
11155
|
-
viewMode: toViewMode(timeUnit),
|
|
11156
|
-
viewDate: viewDate,
|
|
11157
|
-
onClick: handleClick,
|
|
11158
|
-
onDateChange: handleDateChange,
|
|
11159
|
-
TooltipContent: TooltipContent,
|
|
11160
|
-
TaskListHeader: TaskListHeader,
|
|
11161
|
-
TaskListTable: TaskListTable,
|
|
11162
|
-
dateTimeFormatters: ganttDateTimeFormatters
|
|
11163
|
-
}, stylingOptions, props));
|
|
11164
|
-
if (returnElement) {
|
|
11165
|
-
return returnElement;
|
|
11166
|
-
} else {
|
|
11167
|
-
return react.createElement("div", null);
|
|
11168
|
-
}
|
|
11169
|
-
};
|
|
11170
|
-
|
|
11171
|
-
var classes$1 = {"wrapper":"_37E9D","title":"_WrYI6","toggler":"_c53zr","switch":"_2eBO5","input":"_hiyro","slider":"_2HI58","label":"_2gSdA"};
|
|
11297
|
+
var classes$1 = {"wrapper":"_37E9D","title":"_WrYI6","toggler":"_c53zr","switch":"_2eBO5","input":"_hiyro","slider":"_2HI58","label":"_2gSdA","filter":"_2cfRI"};
|
|
11172
11298
|
|
|
11173
11299
|
var CustomTaskListHeaderHOC = function CustomTaskListHeaderHOC(label, doubleView, setDoubleView) {
|
|
11174
|
-
var CustomTaskListHeader = function CustomTaskListHeader() {
|
|
11300
|
+
var CustomTaskListHeader = function CustomTaskListHeader(_ref) {
|
|
11301
|
+
var fontFamily = _ref.fontFamily,
|
|
11302
|
+
fontSize = _ref.fontSize;
|
|
11175
11303
|
return react.createElement("div", {
|
|
11304
|
+
style: {
|
|
11305
|
+
fontFamily: fontFamily,
|
|
11306
|
+
fontSize: fontSize,
|
|
11307
|
+
height: "50px"
|
|
11308
|
+
},
|
|
11176
11309
|
className: classes$1.wrapper
|
|
11177
11310
|
}, react.createElement("div", {
|
|
11178
11311
|
className: classes$1.title
|
|
11179
|
-
}, react.createElement("span", null, label)), react.createElement("div", {
|
|
11312
|
+
}, react.createElement("span", null, label)), setDoubleView && react.createElement("div", {
|
|
11180
11313
|
className: classes$1.toggler
|
|
11181
11314
|
}, react.createElement("label", {
|
|
11182
11315
|
htmlFor: "ch2",
|
|
@@ -11193,12 +11326,12 @@ var CustomTaskListHeaderHOC = function CustomTaskListHeaderHOC(label, doubleView
|
|
|
11193
11326
|
className: classes$1.slider
|
|
11194
11327
|
})), react.createElement("span", {
|
|
11195
11328
|
className: classes$1.label
|
|
11196
|
-
}, "
|
|
11329
|
+
}, "Previsioni")));
|
|
11197
11330
|
};
|
|
11198
11331
|
return CustomTaskListHeader;
|
|
11199
11332
|
};
|
|
11200
11333
|
|
|
11201
|
-
var styles$9 = {"container":"_lEI6r","project":"_RU6Aa","main":"_30j6y","subrow":"_T0HQN","timeline":"_yp2DW"
|
|
11334
|
+
var styles$9 = {"container":"_lEI6r","project":"_RU6Aa","main":"_30j6y","subrow":"_T0HQN","timeline":"_yp2DW"};
|
|
11202
11335
|
|
|
11203
11336
|
var ProjectRow = function ProjectRow(_ref) {
|
|
11204
11337
|
var _ref$task = _ref.task,
|
|
@@ -11224,7 +11357,7 @@ var ProjectRow = function ProjectRow(_ref) {
|
|
|
11224
11357
|
"--grid-project-columns": str
|
|
11225
11358
|
};
|
|
11226
11359
|
return react.createElement("div", {
|
|
11227
|
-
key: id,
|
|
11360
|
+
key: "task_" + id,
|
|
11228
11361
|
className: styles$9.project,
|
|
11229
11362
|
style: customStyle,
|
|
11230
11363
|
onClick: function onClick() {
|
|
@@ -11235,7 +11368,7 @@ var ProjectRow = function ProjectRow(_ref) {
|
|
|
11235
11368
|
return react.createElement("span", {
|
|
11236
11369
|
className: index === 0 ? styles$9.main : undefined,
|
|
11237
11370
|
title: v.length > 10 ? v : undefined,
|
|
11238
|
-
key: id + "_valuesToShow_" + index
|
|
11371
|
+
key: "task_" + id + "_valuesToShow_" + index
|
|
11239
11372
|
}, v === "#START#" ? formatToLocaleSimple(start) : v === "#END#" ? formatToLocaleSimple(end) : v);
|
|
11240
11373
|
}));
|
|
11241
11374
|
};
|
|
@@ -11264,7 +11397,7 @@ var SubRow = function SubRow(_ref2) {
|
|
|
11264
11397
|
"--grid-fasi-columns": str
|
|
11265
11398
|
};
|
|
11266
11399
|
return react.createElement("div", {
|
|
11267
|
-
key: id,
|
|
11400
|
+
key: "phase_" + id,
|
|
11268
11401
|
className: styles$9.subrow,
|
|
11269
11402
|
style: customStyle,
|
|
11270
11403
|
onClick: function onClick() {
|
|
@@ -11272,7 +11405,7 @@ var SubRow = function SubRow(_ref2) {
|
|
|
11272
11405
|
onclickTaskList(id);
|
|
11273
11406
|
}
|
|
11274
11407
|
}, react.createElement("span", {
|
|
11275
|
-
key: id + "_valuesToShow_color",
|
|
11408
|
+
key: "phase_" + id + "_valuesToShow_color",
|
|
11276
11409
|
style: {
|
|
11277
11410
|
height: 16,
|
|
11278
11411
|
width: 16,
|
|
@@ -11282,41 +11415,42 @@ var SubRow = function SubRow(_ref2) {
|
|
|
11282
11415
|
return react.createElement("span", {
|
|
11283
11416
|
className: index === 0 ? styles$9.main : undefined,
|
|
11284
11417
|
title: v.length > 10 ? v : undefined,
|
|
11285
|
-
key: id + "_valuesToShow_" + index
|
|
11418
|
+
key: "phase_" + id + "_valuesToShow_" + index
|
|
11286
11419
|
}, v === "#START#" ? formatToLocaleSimple(start) : v === "#END#" ? formatToLocaleSimple(end) : v);
|
|
11287
11420
|
}));
|
|
11288
11421
|
};
|
|
11289
11422
|
var TimelineSubRow = function TimelineSubRow(_ref3) {
|
|
11290
11423
|
var _ref3$task = _ref3.task,
|
|
11291
11424
|
id = _ref3$task.id,
|
|
11292
|
-
|
|
11425
|
+
valuesToShow = _ref3$task.valuesToShow,
|
|
11293
11426
|
rowHeight = _ref3.rowHeight,
|
|
11294
11427
|
rowWidth = _ref3.rowWidth,
|
|
11295
11428
|
fontFamily = _ref3.fontFamily,
|
|
11296
11429
|
fontSize = _ref3.fontSize;
|
|
11430
|
+
var str = "";
|
|
11431
|
+
for (var i = 0; i < valuesToShow.length; i++) {
|
|
11432
|
+
str += "1fr ";
|
|
11433
|
+
}
|
|
11434
|
+
var customStyle = {
|
|
11435
|
+
height: rowHeight,
|
|
11436
|
+
width: rowWidth,
|
|
11437
|
+
fontFamily: fontFamily,
|
|
11438
|
+
fontSize: fontSize,
|
|
11439
|
+
"--grid-fasi-columns": str
|
|
11440
|
+
};
|
|
11297
11441
|
return react.createElement("div", {
|
|
11298
|
-
key: id,
|
|
11299
|
-
className: styles$9.timelineWrapper,
|
|
11300
|
-
style: {
|
|
11301
|
-
height: rowHeight,
|
|
11302
|
-
width: rowWidth,
|
|
11303
|
-
fontFamily: fontFamily,
|
|
11304
|
-
fontSize: fontSize
|
|
11305
|
-
}
|
|
11306
|
-
}, react.createElement("div", {
|
|
11442
|
+
key: "detail_" + id,
|
|
11307
11443
|
className: styles$9.timeline,
|
|
11308
|
-
style:
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
}
|
|
11316
|
-
key: id + "_valuesToShow_2"
|
|
11317
|
-
}, "A")));
|
|
11444
|
+
style: customStyle
|
|
11445
|
+
}, valuesToShow === null || valuesToShow === void 0 ? void 0 : valuesToShow.map(function (v, index) {
|
|
11446
|
+
return react.createElement("span", {
|
|
11447
|
+
className: index === 0 ? styles$9.main : undefined,
|
|
11448
|
+
title: v.length > 10 ? v : undefined,
|
|
11449
|
+
key: "detail_" + id + "_valuesToShow_" + index
|
|
11450
|
+
}, v);
|
|
11451
|
+
}));
|
|
11318
11452
|
};
|
|
11319
|
-
var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList) {
|
|
11453
|
+
var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList, id) {
|
|
11320
11454
|
var CustomTaskListTable = function CustomTaskListTable(_ref4) {
|
|
11321
11455
|
var rowHeight = _ref4.rowHeight,
|
|
11322
11456
|
rowWidth = _ref4.rowWidth,
|
|
@@ -11325,9 +11459,12 @@ var CustomTaskListTableHOC = function CustomTaskListTableHOC(onclickTaskList) {
|
|
|
11325
11459
|
tasks = _ref4.tasks,
|
|
11326
11460
|
setSelectedTask = _ref4.setSelectedTask;
|
|
11327
11461
|
return react.createElement("div", {
|
|
11328
|
-
className: styles$9.container
|
|
11462
|
+
className: styles$9.container,
|
|
11463
|
+
key: "tasks_container_" + id
|
|
11329
11464
|
}, tasks.map(function (task) {
|
|
11330
|
-
return react.createElement(react.Fragment,
|
|
11465
|
+
return react.createElement(react.Fragment, {
|
|
11466
|
+
key: task.id
|
|
11467
|
+
}, task.type === "project" && react.createElement(ProjectRow, {
|
|
11331
11468
|
key: task.id + "_" + task.type,
|
|
11332
11469
|
task: task,
|
|
11333
11470
|
rowHeight: rowHeight,
|
|
@@ -11412,49 +11549,258 @@ var Switcher = function Switcher(_ref) {
|
|
|
11412
11549
|
};
|
|
11413
11550
|
|
|
11414
11551
|
var Planner = function Planner(props) {
|
|
11415
|
-
var _props$
|
|
11552
|
+
var _props$secondaryGantt, _props$mainGantt$show, _props$mainGantt$task, _props$mainGantt$task2, _props$mainGantt$tool, _props$secondaryGantt3, _props$secondaryGantt4, _props$secondaryGantt5, _props$secondaryGantt6;
|
|
11416
11553
|
var _useState = react.useState(TimeUnit.MONTH),
|
|
11417
11554
|
timeUnit = _useState[0],
|
|
11418
11555
|
setTimeUnit = _useState[1];
|
|
11419
|
-
var _useState2 = react.useState(
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
var
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11556
|
+
var _useState2 = react.useState(props.mainGantt.items),
|
|
11557
|
+
currentTasks = _useState2[0],
|
|
11558
|
+
setCurrentTasks = _useState2[1];
|
|
11559
|
+
var _useState3 = react.useState((_props$secondaryGantt = props.secondaryGantt) === null || _props$secondaryGantt === void 0 ? void 0 : _props$secondaryGantt.items),
|
|
11560
|
+
currentDetails = _useState3[0],
|
|
11561
|
+
setCurrentDetails = _useState3[1];
|
|
11562
|
+
var _useState4 = react.useState((_props$mainGantt$show = props.mainGantt.showSecondaryDates) != null ? _props$mainGantt$show : false),
|
|
11563
|
+
mainGanttDoubleView = _useState4[0],
|
|
11564
|
+
setMainGanttDoubleView = _useState4[1];
|
|
11565
|
+
var _useState5 = react.useState(calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount)),
|
|
11566
|
+
displayedDates = _useState5[0],
|
|
11567
|
+
setDisplayedDates = _useState5[1];
|
|
11568
|
+
var _useState6 = react.useState(),
|
|
11569
|
+
viewDate = _useState6[0],
|
|
11570
|
+
setViewDate = _useState6[1];
|
|
11571
|
+
var _useState7 = react.useState(),
|
|
11572
|
+
projection = _useState7[0],
|
|
11573
|
+
setProjection = _useState7[1];
|
|
11574
|
+
var locale = "it-IT";
|
|
11575
|
+
var handleClick = function handleClick(row, onClick) {
|
|
11576
|
+
if (!row) {
|
|
11577
|
+
return;
|
|
11578
|
+
}
|
|
11579
|
+
if (row.type === "task" && props.secondaryGantt) {
|
|
11580
|
+
var _phase$color;
|
|
11581
|
+
var phase = row;
|
|
11582
|
+
setProjection({
|
|
11583
|
+
start: new Date(phase.startDate),
|
|
11584
|
+
end: new Date(phase.endDate),
|
|
11585
|
+
color: (_phase$color = phase.color) != null ? _phase$color : "#ED7D31"
|
|
11586
|
+
});
|
|
11587
|
+
} else {
|
|
11588
|
+
setProjection(undefined);
|
|
11589
|
+
}
|
|
11590
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(row);
|
|
11427
11591
|
};
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11592
|
+
var handleDateChange = function handleDateChange(task, currentProjects, onDateChange) {
|
|
11593
|
+
var id = task === null || task === void 0 ? void 0 : task.id;
|
|
11594
|
+
if (!id) {
|
|
11595
|
+
return;
|
|
11596
|
+
}
|
|
11597
|
+
var row = getProjectById(id, currentProjects);
|
|
11598
|
+
if (!row) {
|
|
11599
|
+
row = getPhaseById(id, currentProjects);
|
|
11600
|
+
}
|
|
11601
|
+
if (!row) {
|
|
11602
|
+
return;
|
|
11603
|
+
}
|
|
11604
|
+
if (row.type === "timeline") {
|
|
11605
|
+
console.log("planner.tsx onDateChange for timeline not managed yet", id, row.type);
|
|
11606
|
+
return;
|
|
11607
|
+
}
|
|
11608
|
+
if (row.type === "project") {
|
|
11609
|
+
var result = mergeTaskIntoProjects(currentProjects, task);
|
|
11610
|
+
row = getProjectById(row.id, result);
|
|
11611
|
+
setViewDate(task.start);
|
|
11612
|
+
setCurrentTasks(result);
|
|
11613
|
+
} else if (row.type === "task") {
|
|
11614
|
+
var parentOfClickedPhase = currentProjects.find(function (p) {
|
|
11615
|
+
var _p$phases;
|
|
11616
|
+
return (_p$phases = p.phases) === null || _p$phases === void 0 ? void 0 : _p$phases.some(function (ph) {
|
|
11617
|
+
return (ph === null || ph === void 0 ? void 0 : ph.id) === id;
|
|
11618
|
+
});
|
|
11619
|
+
});
|
|
11620
|
+
if (parentOfClickedPhase) {
|
|
11621
|
+
var phases = mergeTaskIntoPhases(parentOfClickedPhase.phases, task);
|
|
11622
|
+
var updatedProjects = currentProjects.map(function (p) {
|
|
11623
|
+
return p.id === parentOfClickedPhase.id ? _extends({}, p, {
|
|
11624
|
+
phases: phases
|
|
11625
|
+
}) : p;
|
|
11626
|
+
});
|
|
11627
|
+
row = getPhaseById(row.id, updatedProjects);
|
|
11628
|
+
if (props.secondaryGantt && row) {
|
|
11629
|
+
var _row$color;
|
|
11630
|
+
setProjection({
|
|
11631
|
+
start: new Date(row.startDate),
|
|
11632
|
+
end: new Date(row.endDate),
|
|
11633
|
+
color: (_row$color = row.color) != null ? _row$color : "#ED7D31"
|
|
11634
|
+
});
|
|
11635
|
+
}
|
|
11636
|
+
setViewDate(task.start);
|
|
11637
|
+
setCurrentTasks(updatedProjects);
|
|
11638
|
+
}
|
|
11639
|
+
}
|
|
11640
|
+
onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(row);
|
|
11641
|
+
};
|
|
11642
|
+
react.useEffect(function () {
|
|
11643
|
+
var _props$secondaryGantt2;
|
|
11644
|
+
setCurrentTasks(props.mainGantt.items);
|
|
11645
|
+
setCurrentDetails((_props$secondaryGantt2 = props.secondaryGantt) === null || _props$secondaryGantt2 === void 0 ? void 0 : _props$secondaryGantt2.items);
|
|
11646
|
+
setProjection(undefined);
|
|
11647
|
+
}, [props]);
|
|
11648
|
+
react.useEffect(function () {
|
|
11649
|
+
var dates = calculateDisplayedDateRange(currentTasks, timeUnit, mainGanttDoubleView, currentDetails, props.preStepsCount);
|
|
11650
|
+
setDisplayedDates(dates);
|
|
11651
|
+
if (!viewDate) {
|
|
11652
|
+
setViewDate(dates.displayedStartDate);
|
|
11653
|
+
}
|
|
11654
|
+
}, [currentTasks, currentDetails]);
|
|
11655
|
+
var tasks = [];
|
|
11656
|
+
for (var i = 0; i < currentTasks.length; i++) {
|
|
11657
|
+
tasks.push.apply(tasks, convertProjectToTasks(currentTasks[i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
|
|
11658
|
+
}
|
|
11659
|
+
var details = [];
|
|
11660
|
+
if (currentDetails) {
|
|
11661
|
+
for (var _i = 0; _i < currentDetails.length; _i++) {
|
|
11662
|
+
details.push.apply(details, convertProjectToTasks(currentDetails[_i], formatToIsoDate(displayedDates.displayedStartDate), formatToIsoDate(displayedDates.displayedEndDate)));
|
|
11432
11663
|
}
|
|
11433
|
-
}
|
|
11664
|
+
}
|
|
11665
|
+
console.log("PLANNER render");
|
|
11666
|
+
return react.createElement("div", null, react.createElement(Switcher, {
|
|
11434
11667
|
onTimeUnitChange: function onTimeUnitChange(timeUnit) {
|
|
11435
11668
|
return setTimeUnit(timeUnit);
|
|
11436
11669
|
}
|
|
11437
|
-
}), react.createElement(
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11670
|
+
}), react.createElement("div", {
|
|
11671
|
+
style: {
|
|
11672
|
+
display: "flex",
|
|
11673
|
+
flexDirection: "column"
|
|
11674
|
+
}
|
|
11675
|
+
}, react.createElement(Gantt, Object.assign({
|
|
11676
|
+
id: MAIN_GANTT_ID,
|
|
11677
|
+
key: MAIN_GANTT_ID,
|
|
11678
|
+
filter: props.mainGantt.filter,
|
|
11679
|
+
hideLabel: props.mainGantt.hideLabel,
|
|
11680
|
+
showSecondaryDates: mainGanttDoubleView,
|
|
11681
|
+
hideDependencies: props.mainGantt.hideDependencies,
|
|
11682
|
+
ganttHeight: props.mainGantt.ganttHeight,
|
|
11683
|
+
displayedStartDate: displayedDates.displayedStartDate,
|
|
11684
|
+
displayedEndDate: displayedDates.displayedEndDate,
|
|
11685
|
+
viewDate: viewDate,
|
|
11686
|
+
tasks: tasks,
|
|
11687
|
+
viewMode: toViewMode(timeUnit)
|
|
11688
|
+
}, props.mainGantt.stylingOptions, {
|
|
11689
|
+
TaskListHeader: (_props$mainGantt$task = props.mainGantt.taskListHeaderProject) != null ? _props$mainGantt$task : CustomTaskListHeaderHOC(props.mainGantt.title, mainGanttDoubleView != null ? mainGanttDoubleView : false, setMainGanttDoubleView),
|
|
11690
|
+
TaskListTable: (_props$mainGantt$task2 = props.mainGantt.taskListTableProject) != null ? _props$mainGantt$task2 : CustomTaskListTableHOC(function (id) {
|
|
11691
|
+
var row = getProjectById(id, currentTasks);
|
|
11692
|
+
if (!row) {
|
|
11693
|
+
row = getPhaseById(id, currentTasks);
|
|
11694
|
+
}
|
|
11695
|
+
if (row) {
|
|
11696
|
+
handleClick(row, props.mainGantt.onClick);
|
|
11697
|
+
}
|
|
11698
|
+
}, MAIN_GANTT_ID),
|
|
11699
|
+
TooltipContent: (_props$mainGantt$tool = props.mainGantt.tooltipContent) != null ? _props$mainGantt$tool : CustomTooltipHOC(),
|
|
11700
|
+
onClick: function onClick(e) {
|
|
11701
|
+
var row = getProjectById(e.id, currentTasks);
|
|
11702
|
+
if (!row) {
|
|
11703
|
+
row = getPhaseById(e.id, currentTasks);
|
|
11704
|
+
}
|
|
11705
|
+
if (row) {
|
|
11706
|
+
handleClick(row, props.mainGantt.onClick);
|
|
11707
|
+
}
|
|
11444
11708
|
},
|
|
11445
|
-
onDateChange: function onDateChange(
|
|
11446
|
-
|
|
11447
|
-
return (_props$onDateChange = props.onDateChange) === null || _props$onDateChange === void 0 ? void 0 : _props$onDateChange.call(props, row);
|
|
11709
|
+
onDateChange: function onDateChange(e) {
|
|
11710
|
+
return handleDateChange(e, currentTasks, props.mainGantt.onDateChange);
|
|
11448
11711
|
},
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11712
|
+
locale: locale,
|
|
11713
|
+
dateTimeFormatters: ganttDateTimeFormatters
|
|
11714
|
+
})), props.secondaryGantt && react.createElement(Gantt, Object.assign({
|
|
11715
|
+
id: SECONDARY_GANTT_ID,
|
|
11716
|
+
key: SECONDARY_GANTT_ID,
|
|
11717
|
+
hideLabel: props.secondaryGantt.hideLabel,
|
|
11718
|
+
filter: props.secondaryGantt.filter,
|
|
11719
|
+
showSecondaryDates: mainGanttDoubleView,
|
|
11720
|
+
hideDependencies: props.secondaryGantt.hideDependencies,
|
|
11721
|
+
ganttHeight: props.secondaryGantt.ganttHeight,
|
|
11722
|
+
displayedStartDate: displayedDates.displayedStartDate,
|
|
11723
|
+
displayedEndDate: displayedDates.displayedEndDate,
|
|
11724
|
+
viewDate: viewDate,
|
|
11725
|
+
tasks: details,
|
|
11726
|
+
viewMode: toViewMode(timeUnit)
|
|
11727
|
+
}, props.mainGantt.stylingOptions, {
|
|
11728
|
+
TaskListHeader: (_props$secondaryGantt3 = props.secondaryGantt.taskListHeaderProject) != null ? _props$secondaryGantt3 : CustomTaskListHeaderHOC(props.secondaryGantt.title),
|
|
11729
|
+
TaskListTable: (_props$secondaryGantt4 = (_props$secondaryGantt5 = props.secondaryGantt) === null || _props$secondaryGantt5 === void 0 ? void 0 : _props$secondaryGantt5.taskListTableProject) != null ? _props$secondaryGantt4 : CustomTaskListTableHOC(function (id) {
|
|
11730
|
+
console.log("planner.tsx secondaryGantt Clicked on " + id);
|
|
11731
|
+
}, SECONDARY_GANTT_ID),
|
|
11732
|
+
TooltipContent: (_props$secondaryGantt6 = props.secondaryGantt.tooltipContent) != null ? _props$secondaryGantt6 : CustomTooltipHOC(),
|
|
11733
|
+
projection: projection,
|
|
11734
|
+
onClick: function onClick(e) {
|
|
11735
|
+
if (props.secondaryGantt) {
|
|
11736
|
+
var row = getProjectById(e.id, currentDetails);
|
|
11737
|
+
if (row) {
|
|
11738
|
+
handleClick(row, props.secondaryGantt.onClick);
|
|
11739
|
+
}
|
|
11740
|
+
}
|
|
11741
|
+
},
|
|
11742
|
+
onDateChange: function onDateChange(e) {
|
|
11743
|
+
var _props$secondaryGantt7;
|
|
11744
|
+
return handleDateChange(e, currentDetails, (_props$secondaryGantt7 = props.secondaryGantt) === null || _props$secondaryGantt7 === void 0 ? void 0 : _props$secondaryGantt7.onDateChange);
|
|
11745
|
+
},
|
|
11746
|
+
locale: locale,
|
|
11747
|
+
dateTimeFormatters: ganttDateTimeFormatters
|
|
11748
|
+
}))));
|
|
11455
11749
|
};
|
|
11456
11750
|
|
|
11457
|
-
const
|
|
11751
|
+
const kupManager = kupManager$1.kupManagerInstance();
|
|
11752
|
+
function sanitizeAllDates(startDateCell, endDateCell, secStartDateCell, secEndDateCell) {
|
|
11753
|
+
const sanitizedDateValues = sanitizeDates(startDateCell, endDateCell);
|
|
11754
|
+
let sanitizedSecDateValues = [];
|
|
11755
|
+
if (secStartDateCell && secEndDateCell) {
|
|
11756
|
+
if (isAtLeastOneDateValid(secStartDateCell, secEndDateCell)) {
|
|
11757
|
+
sanitizedSecDateValues = sanitizeDates(secStartDateCell, secEndDateCell);
|
|
11758
|
+
}
|
|
11759
|
+
else {
|
|
11760
|
+
sanitizedSecDateValues = [...sanitizedDateValues];
|
|
11761
|
+
}
|
|
11762
|
+
}
|
|
11763
|
+
return {
|
|
11764
|
+
dateValues: sanitizedDateValues,
|
|
11765
|
+
secDateValues: sanitizedSecDateValues,
|
|
11766
|
+
};
|
|
11767
|
+
}
|
|
11768
|
+
function sanitizeDates(startDateCell, endDateCell) {
|
|
11769
|
+
let returnValues = [startDateCell.value, endDateCell.value];
|
|
11770
|
+
if (isDateValid(startDateCell) && isDateValid(endDateCell)) {
|
|
11771
|
+
return returnValues;
|
|
11772
|
+
}
|
|
11773
|
+
else if (isDateValid(startDateCell)) {
|
|
11774
|
+
return [startDateCell.value, startDateCell.value];
|
|
11775
|
+
}
|
|
11776
|
+
else if (isDateValid(endDateCell)) {
|
|
11777
|
+
return [endDateCell.value, endDateCell.value];
|
|
11778
|
+
}
|
|
11779
|
+
else {
|
|
11780
|
+
return returnValues;
|
|
11781
|
+
}
|
|
11782
|
+
}
|
|
11783
|
+
function isDateValid(dateCell) {
|
|
11784
|
+
return (kupManager.objects.isDate(dateCell.obj) &&
|
|
11785
|
+
kupManager.dates.isValid(dateCell.value, kupManager$1.KupDatesFormats.ISO_DATE));
|
|
11786
|
+
}
|
|
11787
|
+
function isAtLeastOneDateValid(startDateCell, endDateCell) {
|
|
11788
|
+
return isDateValid(startDateCell) || isDateValid(endDateCell);
|
|
11789
|
+
}
|
|
11790
|
+
function getValuesToShow(row, idCol, nameCol, dataColumns, columns, customToValuesFunction) {
|
|
11791
|
+
let toValuesFunction = () => columns.map((col) => {
|
|
11792
|
+
return kupManager$1.getCellValueForDisplay(dataColumns.find((kCol) => kCol.name == col), row.cells[col]);
|
|
11793
|
+
});
|
|
11794
|
+
if (customToValuesFunction) {
|
|
11795
|
+
toValuesFunction = customToValuesFunction;
|
|
11796
|
+
}
|
|
11797
|
+
const valuesToShow = (columns === null || columns === void 0 ? void 0 : columns.length) >= 2
|
|
11798
|
+
? toValuesFunction()
|
|
11799
|
+
: [row.cells[idCol].value, row.cells[nameCol].value];
|
|
11800
|
+
return valuesToShow;
|
|
11801
|
+
}
|
|
11802
|
+
|
|
11803
|
+
const kupPlannerCss = "._3_ygE{display:table;border-bottom:#e6e4e4 1px solid;border-top:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._1nBOt{display:table-row;list-style:none}._2eZzQ{border-right:1px solid rgb(196, 196, 196);opacity:1;margin-left:-2px}._WuQ0f{display:table-cell;vertical-align:-webkit-baseline-middle;vertical-align:middle}._3ZbQT{display:table;border-bottom:#e6e4e4 1px solid;border-left:#e6e4e4 1px solid}._34SS0{display:table-row;text-overflow:ellipsis}._34SS0:nth-of-type(even){}._3lLk3{display:table-cell;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._nI1Xw{display:flex}._2QjE6{color:rgb(86 86 86);font-size:0.6rem;padding:0.15rem 0.2rem 0 0.2rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}._2TfEi{font-size:0.6rem;padding-left:1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3T42e{background:#fff;padding:12px;box-shadow:0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)}._29NTg{font-size:12px;margin-bottom:6px;color:#666}._25P-K{position:absolute;display:flex;flex-shrink:0;pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}._3gVAq{visibility:hidden;position:absolute;display:flex;pointer-events:none}._1eT-t{overflow:hidden auto;width:1rem;flex-shrink:0;scrollbar-width:thin}._1eT-t::-webkit-scrollbar{width:1.1rem;height:1.1rem}._1eT-t::-webkit-scrollbar-corner{background:transparent}._1eT-t::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._1eT-t::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._EvhC1{border-radius:8px;background:#efefef;margin:12px;padding:12px}._2dZTy{fill:#fff}._2dZTy:nth-child(even){}._3rUKi{stroke:transparent}._RuwuK{stroke:#e6e4e4}._9w8d5{text-anchor:middle;fill:#333;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._1rLuZ{stroke:#e6e4e4}._2q1Kt{text-anchor:middle;fill:#555;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._35nLX{fill:#ffffff;stroke:#e0e0e0;stroke-width:1.4}._KxSXS{cursor:pointer;outline:none}._KxSXS:hover ._3w_5u{visibility:visible;opacity:1}._3w_5u{fill:#ddd;cursor:ew-resize;opacity:0;visibility:hidden}._31ERP{-webkit-user-select:none;-moz-user-select:none;user-select:none;stroke-width:0}._3zRJQ{fill:#fff;text-anchor:middle;font-weight:lighter;dominant-baseline:central;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._3KcaM{fill:#555;text-anchor:start;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._11iN9{background:#efefef;border-radius:8px;margin:12px;overflow:hidden;padding:12px}._CZjuD{overflow:hidden;font-size:0;margin:0;padding:0}._2B2zv{margin:0;padding:0;overflow:hidden}._3eULf{display:flex;padding:0;margin:0;list-style:none;outline:none;position:relative}._2k9Ys{overflow:auto;max-width:100%;scrollbar-width:thin;height:1.2rem}._2k9Ys::-webkit-scrollbar{width:1.1rem;height:1.1rem}._2k9Ys::-webkit-scrollbar-corner{background:transparent}._2k9Ys::-webkit-scrollbar-thumb{border:6px solid transparent;background:rgba(0, 0, 0, 0.2);background:var(--palette-black-alpha-20, rgba(0, 0, 0, 0.2));border-radius:10px;background-clip:padding-box}._2k9Ys::-webkit-scrollbar-thumb:hover{border:4px solid transparent;background:rgba(0, 0, 0, 0.3);background:var(--palette-black-alpha-30, rgba(0, 0, 0, 0.3));background-clip:padding-box}._19jgW{height:1px}._37E9D{display:flex;justify-content:space-around;max-width:330px;place-items:\"center\";text-align:center;align-items:center}._WrYI6{font-weight:bold;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._c53zr{max-width:-moz-max-content;max-width:max-content;padding:0 4px;text-align:right}._2eBO5{position:relative;display:inline-block;width:30px;height:17px}._hiyro{opacity:0;width:0;height:0}._hiyro:checked+._2HI58{background-color:#003b77}._hiyro:checked+._2HI58:before{transform:translateX(13px)}._hiyro:focus+._2HI58{box-shadow:0 0 1px #003b77}._2HI58{-webkit-transition:0.4s;cursor:pointer;background-color:#ccc;bottom:0;border-radius:17px;left:0;position:absolute;right:0;top:0;transition:0.4s}._2HI58:before{-webkit-transition:0.1s;background-color:white;border-radius:50%;bottom:2px;content:\"\";height:13px;left:2px;position:absolute;transition:0.1s;width:13px}._2gSdA{font-size:12px;padding:6px}._2cfRI{font-size:12px}._lEI6r{padding:0 10px;margin-right:10px}._RU6Aa{background:var(--kup-background-color, #ffffff);border:1px solid var(--kup-border-color, #acacac);border-radius:4px;box-sizing:border-box;color:var(--kup-text-color, #595959);cursor:pointer;display:grid;font-weight:400;grid-template-columns:var(--grid-project-columns, 1fr 1fr 1fr);place-items:center}._RU6Aa>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._RU6Aa ._30j6y{font-weight:700;width:100%;text-align:center}._T0HQN{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#acacac;border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-sizing:border-box;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#ffffff;color:#595959;font-weight:400}._T0HQN>*{font-size:12px;line-height:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%}._T0HQN:has(+._T0HQN),._RU6Aa:has(+._T0HQN){border-bottom-left-radius:0;border-bottom-right-radius:0}._yp2DW{cursor:pointer;display:grid;border-width:1px;border-style:solid;border-color:#cbcbcb;border-radius:4px;grid-template-columns:var(--grid-fasi-columns, 1fr 1fr 1fr);place-items:center;background:#fff;color:#595959;font-weight:400;box-sizing:border-box}._yp2DW>*{font-size:14px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}._yp2DW ._30j6y{font-weight:700;width:100%;text-align:center}._3P0WE{display:grid;grid-auto-flow:column;grid-gap:8px;margin-left:12px;width:-moz-max-content;width:max-content}._1oXbe{background:transparent;border-color:var(--kup-primary-color, #003b77);border-radius:4px;border-width:1px;box-shadow:0 3px 1px -2px rgba(var(--kup-text-color-rgb, 51 51 51), 0.2), 0 2px 2px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.14), 0 1px 5px 0 rgba(var(--kup-text-color-rgb, 51 51 51), 0.12);box-sizing:border-box;color:var(--kup-primary-color, #003b77);cursor:pointer;font-size:11px;height:32px;min-width:64px}._1R9mh{font-family:var(--kup-font-family, inherit);font-size:11px;letter-spacing:0.0892857143em;text-decoration:none;text-transform:uppercase;padding:0 6px}:host{display:block}.filter{margin:12px 10px 12px 0;padding:0 10px}";
|
|
11458
11804
|
|
|
11459
11805
|
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
11460
11806
|
if (kind === "a" && !f)
|
|
@@ -11472,7 +11818,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
|
|
|
11472
11818
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11473
11819
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11474
11820
|
};
|
|
11475
|
-
var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_rootPlanner, _KupPlanner_lastOnChangeReceived, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_emitOnChangeEventsReceived;
|
|
11821
|
+
var _KupPlanner_instances, _KupPlanner_kupManager, _KupPlanner_rootPlanner, _KupPlanner_lastOnChangeReceived, _KupPlanner_renderReactPlannerElement, _KupPlanner_toTasks, _KupPlanner_toDetails, _KupPlanner_getTask, _KupPlanner_removePhases, _KupPlanner_handleOnClickOnTask, _KupPlanner_handleOnClickOnPhase, _KupPlanner_handleOnClickOnDetail, _KupPlanner_emitOnChangeEventsReceived, _KupPlanner_onFilter;
|
|
11476
11822
|
const KupPlanner = class {
|
|
11477
11823
|
constructor(hostRef) {
|
|
11478
11824
|
index.registerInstance(this, hostRef);
|
|
@@ -11483,13 +11829,22 @@ const KupPlanner = class {
|
|
|
11483
11829
|
/*-------------------------------------------------*/
|
|
11484
11830
|
/* I n t e r n a l V a r i a b l e s */
|
|
11485
11831
|
/*-------------------------------------------------*/
|
|
11486
|
-
_KupPlanner_kupManager.set(this, kupManager.kupManagerInstance());
|
|
11832
|
+
_KupPlanner_kupManager.set(this, kupManager$1.kupManagerInstance());
|
|
11487
11833
|
_KupPlanner_rootPlanner.set(this, void 0);
|
|
11488
11834
|
_KupPlanner_lastOnChangeReceived.set(this, void 0);
|
|
11489
11835
|
this.plannerProps = undefined;
|
|
11490
11836
|
this.customStyle = '';
|
|
11491
11837
|
this.data = undefined;
|
|
11492
|
-
this.
|
|
11838
|
+
this.detailData = undefined;
|
|
11839
|
+
this.detailColorCol = undefined;
|
|
11840
|
+
this.detailColumns = undefined;
|
|
11841
|
+
this.detailDates = undefined;
|
|
11842
|
+
this.detailHeight = undefined;
|
|
11843
|
+
this.detailIdCol = undefined;
|
|
11844
|
+
this.detailNameCol = undefined;
|
|
11845
|
+
this.detailPrevDates = undefined;
|
|
11846
|
+
this.listCellWidth = '300px';
|
|
11847
|
+
this.maxWidth = '90vw';
|
|
11493
11848
|
this.phaseColorCol = undefined;
|
|
11494
11849
|
this.phaseColumns = undefined;
|
|
11495
11850
|
this.phaseColParDep = undefined;
|
|
@@ -11497,8 +11852,10 @@ const KupPlanner = class {
|
|
|
11497
11852
|
this.phaseIdCol = undefined;
|
|
11498
11853
|
this.phaseNameCol = undefined;
|
|
11499
11854
|
this.phasePrevDates = undefined;
|
|
11855
|
+
this.showSecondaryDates = false;
|
|
11500
11856
|
this.taskColumns = undefined;
|
|
11501
11857
|
this.taskDates = undefined;
|
|
11858
|
+
this.taskHeight = undefined;
|
|
11502
11859
|
this.taskIdCol = undefined;
|
|
11503
11860
|
this.taskNameCol = undefined;
|
|
11504
11861
|
this.taskPrevDates = undefined;
|
|
@@ -11512,11 +11869,12 @@ const KupPlanner = class {
|
|
|
11512
11869
|
taskAction: taskAction,
|
|
11513
11870
|
});
|
|
11514
11871
|
}
|
|
11515
|
-
onKupDateChange(event) {
|
|
11872
|
+
onKupDateChange(event, taskAction) {
|
|
11516
11873
|
this.kupDateChange.emit({
|
|
11517
11874
|
comp: this,
|
|
11518
11875
|
id: this.rootElement.id,
|
|
11519
11876
|
value: event,
|
|
11877
|
+
taskAction: taskAction,
|
|
11520
11878
|
});
|
|
11521
11879
|
}
|
|
11522
11880
|
/*-------------------------------------------------*/
|
|
@@ -11528,7 +11886,7 @@ const KupPlanner = class {
|
|
|
11528
11886
|
* @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
|
|
11529
11887
|
*/
|
|
11530
11888
|
async getProps(descriptions) {
|
|
11531
|
-
return kupManager.getProps(this, KupPlannerProps, descriptions);
|
|
11889
|
+
return kupManager$1.getProps(this, KupPlannerProps, descriptions);
|
|
11532
11890
|
}
|
|
11533
11891
|
/**
|
|
11534
11892
|
* This method is used to trigger a new render of the component.
|
|
@@ -11541,7 +11899,7 @@ const KupPlanner = class {
|
|
|
11541
11899
|
* @param {GenericObject} props - Object containing props that will be set to the component.
|
|
11542
11900
|
*/
|
|
11543
11901
|
async setProps(props) {
|
|
11544
|
-
kupManager.setProps(this, KupPlannerProps, props);
|
|
11902
|
+
kupManager$1.setProps(this, KupPlannerProps, props);
|
|
11545
11903
|
}
|
|
11546
11904
|
/**
|
|
11547
11905
|
* Add a list of phases to the project
|
|
@@ -11552,21 +11910,29 @@ const KupPlanner = class {
|
|
|
11552
11910
|
var _a;
|
|
11553
11911
|
const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
|
|
11554
11912
|
if (task) {
|
|
11555
|
-
task.phases = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.map((row) => {
|
|
11913
|
+
task.phases = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]])).map((row) => {
|
|
11914
|
+
const datesSanitized = sanitizeAllDates(row.cells[this.phaseDates[0]], row.cells[this.phaseDates[1]], row.cells[this.phasePrevDates[0]], row.cells[this.phasePrevDates[1]]);
|
|
11915
|
+
const valuesToShow = getValuesToShow(row, this.phaseIdCol, this.phaseNameCol, data.columns, this.phaseColumns, () => this.phaseColumns.map((col) => col == this.phaseDates[0]
|
|
11916
|
+
? '#START#'
|
|
11917
|
+
: col == this.phaseDates[1]
|
|
11918
|
+
? '#END#'
|
|
11919
|
+
: kupManager$1.getCellValueForDisplay(data.columns.find((kCol) => kCol.name == col), row.cells[col])));
|
|
11556
11920
|
let phase = {
|
|
11557
11921
|
taskRow: task.taskRow,
|
|
11558
11922
|
phaseRow: row,
|
|
11559
|
-
id: row.cells[this.phaseIdCol].value,
|
|
11923
|
+
id: task.id + '_' + row.cells[this.phaseIdCol].value,
|
|
11560
11924
|
phaseRowId: row.id,
|
|
11561
11925
|
taskRowId: task.taskRowId,
|
|
11562
11926
|
name: row.cells[this.phaseNameCol].value,
|
|
11563
|
-
startDate:
|
|
11564
|
-
endDate:
|
|
11565
|
-
secondaryStartDate:
|
|
11566
|
-
secondaryEndDate:
|
|
11567
|
-
type: '
|
|
11927
|
+
startDate: datesSanitized.dateValues[0],
|
|
11928
|
+
endDate: datesSanitized.dateValues[1],
|
|
11929
|
+
secondaryStartDate: datesSanitized.secDateValues[0],
|
|
11930
|
+
secondaryEndDate: datesSanitized.secDateValues[1],
|
|
11931
|
+
type: 'task',
|
|
11568
11932
|
color: row.cells[this.phaseColorCol].value,
|
|
11569
|
-
|
|
11933
|
+
selectedColor: row.cells[this.phaseColorCol].value,
|
|
11934
|
+
valuesToShow: valuesToShow,
|
|
11935
|
+
rowType: KupPlannerGanttRowType.PHASE,
|
|
11570
11936
|
};
|
|
11571
11937
|
return phase;
|
|
11572
11938
|
});
|
|
@@ -11574,27 +11940,34 @@ const KupPlanner = class {
|
|
|
11574
11940
|
this.plannerProps = Object.assign({}, this.plannerProps);
|
|
11575
11941
|
}
|
|
11576
11942
|
handleOnClick(nativeEvent) {
|
|
11577
|
-
console.log('handleOnClick', nativeEvent);
|
|
11578
|
-
switch (nativeEvent.
|
|
11579
|
-
case
|
|
11943
|
+
console.log('kup-planner.handleOnClick', nativeEvent);
|
|
11944
|
+
switch (nativeEvent.rowType) {
|
|
11945
|
+
case KupPlannerGanttRowType.TASK:
|
|
11580
11946
|
const taskAction = nativeEvent.phases
|
|
11581
|
-
? KupPlannerTaskAction.
|
|
11582
|
-
: KupPlannerTaskAction.
|
|
11947
|
+
? KupPlannerTaskAction.onTaskClosing
|
|
11948
|
+
: KupPlannerTaskAction.onTaskOpening;
|
|
11583
11949
|
if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnTask).call(this, nativeEvent)) {
|
|
11584
11950
|
this.onKupClick(nativeEvent, taskAction);
|
|
11585
11951
|
}
|
|
11586
11952
|
break;
|
|
11587
|
-
case
|
|
11953
|
+
case KupPlannerGanttRowType.PHASE:
|
|
11588
11954
|
if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnPhase).call(this)) {
|
|
11589
|
-
this.onKupClick(nativeEvent);
|
|
11955
|
+
this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
|
|
11956
|
+
}
|
|
11957
|
+
break;
|
|
11958
|
+
case KupPlannerGanttRowType.DETAIL:
|
|
11959
|
+
if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_handleOnClickOnDetail).call(this)) {
|
|
11960
|
+
this.onKupClick(nativeEvent, KupPlannerTaskAction.onClick);
|
|
11590
11961
|
}
|
|
11591
11962
|
break;
|
|
11592
11963
|
}
|
|
11593
11964
|
}
|
|
11594
11965
|
handleOnDateChange(nativeEvent) {
|
|
11595
11966
|
if (__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_emitOnChangeEventsReceived).call(this, nativeEvent)) {
|
|
11596
|
-
|
|
11597
|
-
|
|
11967
|
+
if (nativeEvent.rowType != KupPlannerGanttRowType.DETAIL) {
|
|
11968
|
+
console.log('kup-planner.handleOnDateChange', nativeEvent);
|
|
11969
|
+
this.onKupDateChange(nativeEvent, KupPlannerTaskAction.onResize);
|
|
11970
|
+
}
|
|
11598
11971
|
}
|
|
11599
11972
|
}
|
|
11600
11973
|
componentWillLoad() {
|
|
@@ -11602,11 +11975,40 @@ const KupPlanner = class {
|
|
|
11602
11975
|
__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.register(this);
|
|
11603
11976
|
}
|
|
11604
11977
|
componentDidLoad() {
|
|
11978
|
+
let details = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, this.detailData);
|
|
11979
|
+
if (details && details.length == 0) {
|
|
11980
|
+
details = undefined;
|
|
11981
|
+
}
|
|
11982
|
+
const mainFilter = this.rootElement.shadowRoot.querySelector('#main-filter');
|
|
11983
|
+
fTextFieldMdc.FTextFieldMDC(mainFilter);
|
|
11984
|
+
const secondaryFilter = this.rootElement.shadowRoot.querySelector('#secondary-filter');
|
|
11985
|
+
if (details) {
|
|
11986
|
+
fTextFieldMdc.FTextFieldMDC(secondaryFilter);
|
|
11987
|
+
}
|
|
11605
11988
|
this.plannerProps = {
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
|
|
11989
|
+
mainGantt: {
|
|
11990
|
+
title: this.titleMess,
|
|
11991
|
+
items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, this.data),
|
|
11992
|
+
stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
|
|
11993
|
+
filter: mainFilter,
|
|
11994
|
+
hideLabel: true,
|
|
11995
|
+
ganttHeight: this.taskHeight,
|
|
11996
|
+
showSecondaryDates: this.showSecondaryDates,
|
|
11997
|
+
onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
|
|
11998
|
+
onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
|
|
11999
|
+
},
|
|
12000
|
+
secondaryGantt: details
|
|
12001
|
+
? {
|
|
12002
|
+
title: '',
|
|
12003
|
+
items: details,
|
|
12004
|
+
stylingOptions: Object.assign(Object.assign({}, defaultStylingOptions), { listCellWidth: this.listCellWidth }),
|
|
12005
|
+
filter: secondaryFilter,
|
|
12006
|
+
hideLabel: true,
|
|
12007
|
+
ganttHeight: this.detailHeight,
|
|
12008
|
+
onClick: (nativeEvent) => this.handleOnClick(nativeEvent),
|
|
12009
|
+
onDateChange: (nativeEvent) => this.handleOnDateChange(nativeEvent),
|
|
12010
|
+
}
|
|
12011
|
+
: undefined,
|
|
11610
12012
|
};
|
|
11611
12013
|
__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_renderReactPlannerElement).call(this);
|
|
11612
12014
|
this.kupReady.emit({
|
|
@@ -11623,7 +12025,17 @@ const KupPlanner = class {
|
|
|
11623
12025
|
__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").debug.logRender(this, true);
|
|
11624
12026
|
}
|
|
11625
12027
|
render() {
|
|
11626
|
-
|
|
12028
|
+
var _a;
|
|
12029
|
+
//console.log('kup-planner.tsx render');
|
|
12030
|
+
return (index.h(index.Host, null, index.h("style", null, __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId, style: { maxWidth: this.maxWidth } }), index.h(fTextField.FTextField, { icon: kupManager$1.KupThemeIconValues.SEARCH, id: "main-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(kupManager$1.KupLanguageSearch.SEARCH), onKeyDown: (e) => {
|
|
12031
|
+
if (e.key === 'Enter') {
|
|
12032
|
+
__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e);
|
|
12033
|
+
}
|
|
12034
|
+
}, wrapperClass: "filter" }), ((_a = this.detailData) === null || _a === void 0 ? void 0 : _a.rows) && this.detailData.rows.length > 0 ? (index.h(fTextField.FTextField, { icon: kupManager$1.KupThemeIconValues.SEARCH, id: "secondary-filter", label: __classPrivateFieldGet(this, _KupPlanner_kupManager, "f").language.translate(kupManager$1.KupLanguageSearch.SEARCH), onKeyDown: (e) => {
|
|
12035
|
+
if (e.key === 'Enter') {
|
|
12036
|
+
__classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_onFilter).call(this, e, true);
|
|
12037
|
+
}
|
|
12038
|
+
}, wrapperClass: "filter" })) : null));
|
|
11627
12039
|
}
|
|
11628
12040
|
disconnectedCallback() {
|
|
11629
12041
|
__classPrivateFieldGet(this, _KupPlanner_kupManager, "f").theme.unregister(this);
|
|
@@ -11640,28 +12052,71 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
|
|
|
11640
12052
|
}
|
|
11641
12053
|
}, _KupPlanner_toTasks = function _KupPlanner_toTasks(data) {
|
|
11642
12054
|
var _a;
|
|
11643
|
-
let tasks = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.map((row) => {
|
|
12055
|
+
let tasks = (_a = data.rows) === null || _a === void 0 ? void 0 : _a.filter((row) => isAtLeastOneDateValid(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]])).map((row) => {
|
|
12056
|
+
const datesSanitized = sanitizeAllDates(row.cells[this.taskDates[0]], row.cells[this.taskDates[1]], row.cells[this.taskPrevDates[0]], row.cells[this.taskPrevDates[1]]);
|
|
12057
|
+
const valuesToShow = getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
|
|
11644
12058
|
let task = {
|
|
11645
12059
|
taskRow: row,
|
|
11646
12060
|
taskRowId: row.id,
|
|
11647
12061
|
id: row.cells[this.taskIdCol].value,
|
|
11648
12062
|
name: row.cells[this.taskNameCol].value,
|
|
11649
|
-
startDate:
|
|
11650
|
-
endDate:
|
|
11651
|
-
secondaryStartDate:
|
|
11652
|
-
secondaryEndDate:
|
|
11653
|
-
type: '
|
|
11654
|
-
valuesToShow:
|
|
12063
|
+
startDate: datesSanitized.dateValues[0],
|
|
12064
|
+
endDate: datesSanitized.dateValues[1],
|
|
12065
|
+
secondaryStartDate: datesSanitized.secDateValues[0],
|
|
12066
|
+
secondaryEndDate: datesSanitized.secDateValues[1],
|
|
12067
|
+
type: 'project',
|
|
12068
|
+
valuesToShow: valuesToShow,
|
|
12069
|
+
rowType: KupPlannerGanttRowType.TASK,
|
|
11655
12070
|
};
|
|
11656
12071
|
return task;
|
|
11657
12072
|
});
|
|
11658
12073
|
return tasks;
|
|
12074
|
+
}, _KupPlanner_toDetails = function _KupPlanner_toDetails(data) {
|
|
12075
|
+
let details = [];
|
|
12076
|
+
if (!data || !data.rows) {
|
|
12077
|
+
return details;
|
|
12078
|
+
}
|
|
12079
|
+
data.rows
|
|
12080
|
+
.filter((row) => isAtLeastOneDateValid(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]))
|
|
12081
|
+
.forEach((row) => {
|
|
12082
|
+
var _a, _b;
|
|
12083
|
+
const detailId = row.cells[this.detailIdCol].value;
|
|
12084
|
+
const detailNameId = row.cells[this.detailNameCol].value;
|
|
12085
|
+
const datesSanitized = sanitizeAllDates(row.cells[this.detailDates[0]], row.cells[this.detailDates[1]]);
|
|
12086
|
+
const valuesToShow = getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns);
|
|
12087
|
+
let detail = details.find((det) => det.id == detailId);
|
|
12088
|
+
if (!detail) {
|
|
12089
|
+
detail = {
|
|
12090
|
+
id: detailId,
|
|
12091
|
+
name: detailNameId,
|
|
12092
|
+
type: 'timeline',
|
|
12093
|
+
valuesToShow: valuesToShow,
|
|
12094
|
+
rowType: KupPlannerGanttRowType.DETAIL,
|
|
12095
|
+
schedule: [],
|
|
12096
|
+
};
|
|
12097
|
+
details.push(detail);
|
|
12098
|
+
}
|
|
12099
|
+
detail.schedule.push({
|
|
12100
|
+
startDate: datesSanitized.dateValues[0],
|
|
12101
|
+
endDate: datesSanitized.dateValues[1],
|
|
12102
|
+
color: this.detailColorCol
|
|
12103
|
+
? (_a = row.cells[this.detailColorCol].value) !== null && _a !== void 0 ? _a : '#D9D9D8'
|
|
12104
|
+
: '#D9D9D8',
|
|
12105
|
+
selectedColor: this.detailColorCol
|
|
12106
|
+
? (_b = row.cells[this.detailColorCol].value) !== null && _b !== void 0 ? _b : '#D9D9D8'
|
|
12107
|
+
: '#D9D9D8',
|
|
12108
|
+
});
|
|
12109
|
+
});
|
|
12110
|
+
return details;
|
|
11659
12111
|
}, _KupPlanner_getTask = function _KupPlanner_getTask(taskId) {
|
|
11660
|
-
return this.plannerProps.items.find((task) => task.id == taskId);
|
|
12112
|
+
return this.plannerProps.mainGantt.items.find((task) => task.id == taskId);
|
|
11661
12113
|
}, _KupPlanner_removePhases = function _KupPlanner_removePhases(taskId) {
|
|
11662
12114
|
const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, taskId);
|
|
11663
12115
|
if (task)
|
|
11664
12116
|
task.phases = undefined;
|
|
12117
|
+
// this.plannerProps.mainGantt = JSON.parse(
|
|
12118
|
+
// JSON.stringify(this.plannerProps.mainGantt)
|
|
12119
|
+
// );
|
|
11665
12120
|
this.plannerProps = Object.assign({}, this.plannerProps);
|
|
11666
12121
|
}, _KupPlanner_handleOnClickOnTask = function _KupPlanner_handleOnClickOnTask(nativeEvent) {
|
|
11667
12122
|
const task = __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_getTask).call(this, nativeEvent.id);
|
|
@@ -11671,6 +12126,8 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
|
|
|
11671
12126
|
return true;
|
|
11672
12127
|
}, _KupPlanner_handleOnClickOnPhase = function _KupPlanner_handleOnClickOnPhase() {
|
|
11673
12128
|
return true;
|
|
12129
|
+
}, _KupPlanner_handleOnClickOnDetail = function _KupPlanner_handleOnClickOnDetail() {
|
|
12130
|
+
return true;
|
|
11674
12131
|
}, _KupPlanner_emitOnChangeEventsReceived = function _KupPlanner_emitOnChangeEventsReceived(nativeEvent) {
|
|
11675
12132
|
let emitEvent = false;
|
|
11676
12133
|
if (!__classPrivateFieldGet(this, _KupPlanner_lastOnChangeReceived, "f")) {
|
|
@@ -11682,6 +12139,34 @@ _KupPlanner_kupManager = new WeakMap(), _KupPlanner_rootPlanner = new WeakMap(),
|
|
|
11682
12139
|
emitEvent = true;
|
|
11683
12140
|
}
|
|
11684
12141
|
return emitEvent;
|
|
12142
|
+
}, _KupPlanner_onFilter = function _KupPlanner_onFilter(e, isDetail) {
|
|
12143
|
+
const tempData = {
|
|
12144
|
+
columns: this.data.columns,
|
|
12145
|
+
rows: [],
|
|
12146
|
+
};
|
|
12147
|
+
const value = e.target.value;
|
|
12148
|
+
const data = isDetail ? this.detailData : this.data;
|
|
12149
|
+
for (let index = 0; index < data.rows.length; index++) {
|
|
12150
|
+
const row = data.rows[index];
|
|
12151
|
+
const valuesToShow = isDetail
|
|
12152
|
+
? getValuesToShow(row, this.detailIdCol, this.detailNameCol, data.columns, this.detailColumns)
|
|
12153
|
+
: getValuesToShow(row, this.taskIdCol, this.taskNameCol, data.columns, this.taskColumns);
|
|
12154
|
+
for (let index = 0; index < valuesToShow.length; index++) {
|
|
12155
|
+
const valueToShow = valuesToShow[index];
|
|
12156
|
+
if (valueToShow.toLowerCase().indexOf(value.toLowerCase()) > -1) {
|
|
12157
|
+
tempData.rows.push(row);
|
|
12158
|
+
break;
|
|
12159
|
+
}
|
|
12160
|
+
}
|
|
12161
|
+
}
|
|
12162
|
+
const newGantt = isDetail
|
|
12163
|
+
? {
|
|
12164
|
+
secondaryGantt: Object.assign(Object.assign({}, this.plannerProps.secondaryGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toDetails).call(this, tempData) }),
|
|
12165
|
+
}
|
|
12166
|
+
: {
|
|
12167
|
+
mainGantt: Object.assign(Object.assign({}, this.plannerProps.mainGantt), { items: __classPrivateFieldGet(this, _KupPlanner_instances, "m", _KupPlanner_toTasks).call(this, tempData) }),
|
|
12168
|
+
};
|
|
12169
|
+
this.plannerProps = Object.assign(Object.assign({}, this.plannerProps), newGantt);
|
|
11685
12170
|
};
|
|
11686
12171
|
KupPlanner.style = kupPlannerCss;
|
|
11687
12172
|
|