@progress/kendo-react-gantt 9.4.0-develop.1 → 9.4.0-develop.11
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/Gantt.js +1 -1
- package/Gantt.mjs +0 -1
- package/cells/FilterCells/GanttBooleanFilter.js +1 -1
- package/cells/FilterCells/GanttBooleanFilter.mjs +0 -1
- package/cells/FilterCells/GanttDateFilter.js +1 -1
- package/cells/FilterCells/GanttDateFilter.mjs +3 -4
- package/cells/FilterCells/GanttNumericFilter.js +1 -1
- package/cells/FilterCells/GanttNumericFilter.mjs +5 -6
- package/cells/FilterCells/GanttTextFilter.js +1 -1
- package/cells/FilterCells/GanttTextFilter.mjs +3 -4
- package/cells/FilterCells/utils.js +1 -1
- package/cells/FilterCells/utils.mjs +3 -4
- package/components/BaseView.js +1 -1
- package/components/BaseView.mjs +0 -1
- package/components/GanttDependency.js +1 -1
- package/components/GanttDependency.mjs +9 -10
- package/components/GanttTask.js +1 -1
- package/components/GanttTask.mjs +0 -1
- package/components/GanttTreelist.js +1 -1
- package/components/GanttTreelist.mjs +0 -1
- package/components/toolbar/AddButton.js +1 -1
- package/components/toolbar/AddButton.mjs +7 -8
- package/components/toolbar/Toolbar.js +1 -1
- package/components/toolbar/Toolbar.mjs +0 -1
- package/components/toolbar/view-selector/ViewSelector.js +1 -1
- package/components/toolbar/view-selector/ViewSelector.mjs +6 -7
- package/components/toolbar/view-selector/ViewSelectorItem.js +1 -1
- package/components/toolbar/view-selector/ViewSelectorItem.mjs +4 -5
- package/components/toolbar/view-selector/ViewSelectorList.js +1 -1
- package/components/toolbar/view-selector/ViewSelectorList.mjs +3 -4
- package/constants/index.js +1 -1
- package/constants/index.mjs +4 -5
- package/context/GanttContext.js +1 -1
- package/context/GanttContext.mjs +0 -1
- package/context/GanttViewContext.js +1 -1
- package/context/GanttViewContext.mjs +0 -1
- package/dist/cdn/js/kendo-react-gantt.js +8 -1
- package/editors/FormDateTimePicker.js +1 -1
- package/editors/FormDateTimePicker.mjs +6 -7
- package/editors/FormDropDownList.js +1 -1
- package/editors/FormDropDownList.mjs +4 -5
- package/editors/FormInput.js +1 -1
- package/editors/FormInput.mjs +3 -4
- package/editors/FormNumericTextBox.js +1 -1
- package/editors/FormNumericTextBox.mjs +6 -7
- package/editors/GanttEditor.js +1 -1
- package/editors/GanttEditor.mjs +0 -1
- package/editors/GanttEditorPredecessors.js +1 -1
- package/editors/GanttEditorPredecessors.mjs +0 -1
- package/editors/GanttEditorSuccessors.js +1 -1
- package/editors/GanttEditorSuccessors.mjs +10 -11
- package/editors/GanttForm.js +1 -1
- package/editors/GanttForm.mjs +7 -8
- package/editors/GanttRemoveDialog.js +1 -1
- package/editors/GanttRemoveDialog.mjs +5 -6
- package/hooks/useControlledState.js +1 -1
- package/hooks/useControlledState.mjs +4 -5
- package/hooks/useDictionaryStore.js +1 -1
- package/hooks/useDictionaryStore.mjs +2 -3
- package/hooks/useGanttTask.js +1 -1
- package/hooks/useGanttTask.mjs +9 -10
- package/index.js +2 -1
- package/index.mjs +15 -15
- package/interfaces/DependencyType.js +1 -1
- package/interfaces/DependencyType.mjs +0 -1
- package/messages/index.js +1 -1
- package/messages/index.mjs +0 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -3
- package/package.json +13 -13
- package/rows/GanttRow.js +1 -1
- package/rows/GanttRow.mjs +3 -4
- package/utils/data-operations.js +1 -1
- package/utils/data-operations.mjs +36 -37
- package/utils/index.js +1 -1
- package/utils/index.mjs +30 -31
- package/views/GanttDayView.js +1 -1
- package/views/GanttDayView.mjs +0 -1
- package/views/GanttMonthView.js +1 -1
- package/views/GanttMonthView.mjs +6 -7
- package/views/GanttWeekView.js +1 -1
- package/views/GanttWeekView.mjs +0 -1
- package/views/GanttYearView.js +1 -1
- package/views/GanttYearView.mjs +7 -8
package/index.mjs
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
import { Gantt as r } from "./Gantt.mjs";
|
|
10
10
|
import { GanttDayView as a } from "./views/GanttDayView.mjs";
|
|
11
11
|
import { GanttWeekView as T } from "./views/GanttWeekView.mjs";
|
|
12
|
-
import { GanttMonthView as
|
|
12
|
+
import { GanttMonthView as n } from "./views/GanttMonthView.mjs";
|
|
13
13
|
import { GanttYearView as f } from "./views/GanttYearView.mjs";
|
|
14
|
-
import { GanttTextFilter as
|
|
15
|
-
import { GanttNumericFilter as
|
|
14
|
+
import { GanttTextFilter as d } from "./cells/FilterCells/GanttTextFilter.mjs";
|
|
15
|
+
import { GanttNumericFilter as E } from "./cells/FilterCells/GanttNumericFilter.mjs";
|
|
16
16
|
import { GanttBooleanFilter as D } from "./cells/FilterCells/GanttBooleanFilter.mjs";
|
|
17
17
|
import { GanttDateFilter as _ } from "./cells/FilterCells/GanttDateFilter.mjs";
|
|
18
|
-
import { createDataTree as
|
|
19
|
-
import { addDependency as
|
|
18
|
+
import { createDataTree as c, extendDataItem as w, filterBy as F, mapTree as I, orderBy as R } from "./utils/index.mjs";
|
|
19
|
+
import { addDependency as A, addTask as B, removeTask as V, updateTask as k } from "./utils/data-operations.mjs";
|
|
20
20
|
import { GanttForm as g } from "./editors/GanttForm.mjs";
|
|
21
|
-
import { GanttRemoveDialog as
|
|
21
|
+
import { GanttRemoveDialog as O } from "./editors/GanttRemoveDialog.mjs";
|
|
22
22
|
import { GanttRow as v } from "./rows/GanttRow.mjs";
|
|
23
23
|
import { getSelectedState as M, getSelectedStateFromKeyDown as U, setSelectedState as W } from "@progress/kendo-react-data-tools";
|
|
24
24
|
import { GANTT_COL_INDEX_ATTRIBUTE as h, GANTT_PREVENT_SELECTION_ELEMENT as K, GANTT_ROW_INDEX_ATTRIBUTE as P } from "./constants/index.mjs";
|
|
@@ -31,23 +31,23 @@ export {
|
|
|
31
31
|
_ as GanttDateFilter,
|
|
32
32
|
a as GanttDayView,
|
|
33
33
|
g as GanttForm,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
n as GanttMonthView,
|
|
35
|
+
E as GanttNumericFilter,
|
|
36
|
+
O as GanttRemoveDialog,
|
|
37
37
|
v as GanttRow,
|
|
38
|
-
|
|
38
|
+
d as GanttTextFilter,
|
|
39
39
|
T as GanttWeekView,
|
|
40
40
|
f as GanttYearView,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
A as addDependency,
|
|
42
|
+
B as addTask,
|
|
43
|
+
c as createDataTree,
|
|
44
44
|
w as extendDataItem,
|
|
45
45
|
F as filterBy,
|
|
46
46
|
M as getSelectedState,
|
|
47
47
|
U as getSelectedStateFromKeyDown,
|
|
48
48
|
I as mapTree,
|
|
49
49
|
R as orderBy,
|
|
50
|
-
|
|
50
|
+
V as removeTask,
|
|
51
51
|
W as setSelectedState,
|
|
52
|
-
|
|
52
|
+
k as updateTask
|
|
53
53
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var F=(S=>(S[S.FF=0]="FF",S[S.FS=1]="FS",S[S.SF=2]="SF",S[S.SS=3]="SS",S))(F||{});exports.DependencyType=F;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
var S = /* @__PURE__ */ ((F) => (F[F.FF = 0] = "FF", F[F.FS = 1] = "FS", F[F.SF = 2] = "SF", F[F.SS = 3] = "SS", F))(S || {});
|
|
10
9
|
export {
|
|
11
10
|
S as DependencyType
|
package/messages/index.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="gantt.weekViewTitle",e="gantt.dayViewTitle",r="gantt.monthViewTitle",a="gantt.yearViewTitle",o="gantt.filterClearButton",n="gantt.filterEqOperator",i="gantt.filterNotEqOperator",l="gantt.filterIsNullOperator",d="gantt.filterIsNotNullOperator",s="gantt.filterIsEmptyOperator",c="gantt.filterIsNotEmptyOperator",p="gantt.filterStartsWithOperator",f="gantt.filterContainsOperator",T="gantt.filterNotContainsOperator",g="gantt.filterEndsWithOperator",O="gantt.filterGteOperator",u="gantt.filterGtOperator",y="gantt.filterLteOperator",S="gantt.filterLtOperator",E="gantt.filterIsTrue",m="gantt.filterIsFalse",k="gantt.filterBooleanAll",I="gantt.filterAfterOrEqualOperator",D="gantt.filterAfterOperator",A="gantt.filterBeforeOperator",b="gantt.filterBeforeOrEqualOperator",C="gantt.noRecords",w="gantt.editSave",h="gantt.editCancel",V="gantt.editAdd",N="gantt.editRemove",q="gantt.editTabGeneral",F="gantt.editTabPredecessors",P="gantt.editTabSuccessors",v="gantt.editorTitle",B="gantt.editorTaskTitle",R="gantt.editorTaskStart",L="gantt.editorTaskEnd",G="gantt.editorTaskPlannedStart",W="gantt.editorTaskPlannedEnd",M="gantt.editorTaskActualStart",j="gantt.editorTaskActualEnd",Y="gantt.editorTaskComplete",x="gantt.editorTaskParent",z="gantt.editorValidationRequired",H="gantt.editorValidationStart",J="gantt.editorValidationEnd",K="gantt.editorValidationPercentCompleteRange",Q="gantt.editorDependencyTypesFF",U="gantt.editorDependencyTypesSF",X="gantt.editorDependencyTypesFS",Z="gantt.editorDependencyTypesSS",_="gantt.addTask",$="gantt.addChild",tt="gantt.addAbove",et="gantt.addBelow",rt="gantt.viewSelector",at="gantt.editorDelete",ot="gantt.deleteConfirmation",nt="gantt.deleteDialogTitle",it="gantt.editorDependencyNameLabel",lt="gantt.editorDependencyTypeLabel",dt={[t]:"Week",[e]:"Day",[r]:"Month",[a]:"Year",[o]:"Clear",[n]:"Is equal to",[i]:"Is not equal to",[l]:"Is null",[d]:"Is not null",[s]:"Is empty",[c]:"Is not empty",[p]:"Starts with",[f]:"Contains",[T]:"Does not contain",[g]:"Ends with",[O]:"Is greater than or equal to",[u]:"Is greater than",[y]:"Is less than or equal to",[S]:"Is less than",[E]:"Is true",[m]:"Is false",[k]:"(All)",[I]:"Is after or equal to",[D]:"Is after",[A]:"Is before",[b]:"Is before or equal to",[C]:"No records available",[w]:"Save",[h]:"Cancel",[V]:"Add",[N]:"Remove",[q]:"General",[F]:"Predecessors",[P]:"Successors",[v]:"Edit task",[B]:"Title",[R]:"Start",[L]:"End",[G]:"Planned Start Date",[W]:"Planned End Date",[M]:"Actual Start Date",[j]:"Actual End Date",[Y]:"Complete",[x]:"Parent",[z]:"Field is required.",[H]:"Start time must be be before End time.",[J]:"End time must be after Start time.",[K]:"Value should be between 0 and 100.",[Q]:"Finish-Finish",[X]:"Finish-Start",[U]:"Start-Finish",[Z]:"Start-Start",[_]:"Add Task",[$]:"Add Child",[tt]:"Add Above",[et]:"Add Below",[rt]:"View Selector",[at]:"Delete",[ot]:"Are you sure you want to delete this event?",[nt]:"Delete Event",[it]:"Name",[lt]:"Type"};exports.addAbove=tt;exports.addBelow=et;exports.addChild=$;exports.addTask=_;exports.dayViewTitle=e;exports.deleteConfirmation=ot;exports.deleteDialogTitle=nt;exports.editorAdd=V;exports.editorCancel=h;exports.editorDelete=at;exports.editorDependencyNameLabel=it;exports.editorDependencyTypeLabel=lt;exports.editorDependencyTypesFF=Q;exports.editorDependencyTypesFS=X;exports.editorDependencyTypesSF=U;exports.editorDependencyTypesSS=Z;exports.editorRemove=N;exports.editorSave=w;exports.editorTabGeneral=q;exports.editorTabPredecessors=F;exports.editorTabSuccessors=P;exports.editorTaskActualEnd=j;exports.editorTaskActualStart=M;exports.editorTaskComplete=Y;exports.editorTaskEnd=L;exports.editorTaskParent=x;exports.editorTaskPlannedEnd=W;exports.editorTaskPlannedStart=G;exports.editorTaskStart=R;exports.editorTaskTitle=B;exports.editorTitle=v;exports.editorValidationEnd=J;exports.editorValidationPercentCompleteRange=K;exports.editorValidationRequired=z;exports.editorValidationStart=H;exports.filterAfterOperator=D;exports.filterAfterOrEqualOperator=I;exports.filterBeforeOperator=A;exports.filterBeforeOrEqualOperator=b;exports.filterBooleanAll=k;exports.filterClearButton=o;exports.filterContainsOperator=f;exports.filterEndsWithOperator=g;exports.filterEqOperator=n;exports.filterGtOperator=u;exports.filterGteOperator=O;exports.filterIsEmptyOperator=s;exports.filterIsFalse=m;exports.filterIsNotEmptyOperator=c;exports.filterIsNotNullOperator=d;exports.filterIsNullOperator=l;exports.filterIsTrue=E;exports.filterLtOperator=S;exports.filterLteOperator=y;exports.filterNotContainsOperator=T;exports.filterNotEqOperator=i;exports.filterStartsWithOperator=p;exports.messages=dt;exports.monthViewTitle=r;exports.noRecords=C;exports.viewSelector=rt;exports.weekViewTitle=t;exports.yearViewTitle=a;
|
package/messages/index.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const t = "gantt.weekViewTitle", e = "gantt.dayViewTitle", a = "gantt.monthViewTitle", r = "gantt.yearViewTitle", n = "gantt.filterClearButton", o = "gantt.filterEqOperator", i = "gantt.filterNotEqOperator", s = "gantt.filterIsNullOperator", l = "gantt.filterIsNotNullOperator", d = "gantt.filterIsEmptyOperator", c = "gantt.filterIsNotEmptyOperator", p = "gantt.filterStartsWithOperator", g = "gantt.filterContainsOperator", f = "gantt.filterNotContainsOperator", T = "gantt.filterEndsWithOperator", u = "gantt.filterGteOperator", O = "gantt.filterGtOperator", S = "gantt.filterLteOperator", y = "gantt.filterLtOperator", E = "gantt.filterIsTrue", m = "gantt.filterIsFalse", I = "gantt.filterBooleanAll", k = "gantt.filterAfterOrEqualOperator", A = "gantt.filterAfterOperator", D = "gantt.filterBeforeOperator", b = "gantt.filterBeforeOrEqualOperator", h = "gantt.noRecords", C = "gantt.editSave", w = "gantt.editCancel", V = "gantt.editAdd", q = "gantt.editRemove", N = "gantt.editTabGeneral", F = "gantt.editTabPredecessors", v = "gantt.editTabSuccessors", P = "gantt.editorTitle", B = "gantt.editorTaskTitle", R = "gantt.editorTaskStart", L = "gantt.editorTaskEnd", G = "gantt.editorTaskPlannedStart", W = "gantt.editorTaskPlannedEnd", x = "gantt.editorTaskActualStart", M = "gantt.editorTaskActualEnd", Y = "gantt.editorTaskComplete", j = "gantt.editorTaskParent", z = "gantt.editorValidationRequired", H = "gantt.editorValidationStart", J = "gantt.editorValidationEnd", K = "gantt.editorValidationPercentCompleteRange", Q = "gantt.editorDependencyTypesFF", U = "gantt.editorDependencyTypesSF", X = "gantt.editorDependencyTypesFS", Z = "gantt.editorDependencyTypesSS", _ = "gantt.addTask", $ = "gantt.addChild", tt = "gantt.addAbove", et = "gantt.addBelow", at = "gantt.viewSelector", rt = "gantt.editorDelete", nt = "gantt.deleteConfirmation", ot = "gantt.deleteDialogTitle", it = "gantt.editorDependencyNameLabel", st = "gantt.editorDependencyTypeLabel", lt = {
|
|
10
9
|
[t]: "Week",
|
|
11
10
|
[e]: "Day",
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-gantt",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1738311852,version:"9.4.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const e = {
|
|
10
9
|
name: "@progress/kendo-react-gantt",
|
|
11
10
|
productName: "KendoReact",
|
|
12
11
|
productCode: "KENDOUIREACT",
|
|
13
12
|
productCodes: ["KENDOUIREACT"],
|
|
14
|
-
publishDate:
|
|
15
|
-
version: "9.4.0-develop.
|
|
13
|
+
publishDate: 1738311852,
|
|
14
|
+
version: "9.4.0-develop.11",
|
|
16
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
17
16
|
};
|
|
18
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-gantt",
|
|
3
|
-
"version": "9.4.0-develop.
|
|
3
|
+
"version": "9.4.0-develop.11",
|
|
4
4
|
"description": "React Gantt enables the display of self-referencing tabular data with many features. KendoReact Gantt package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"@progress/kendo-date-math": "^1.4.1",
|
|
30
30
|
"@progress/kendo-drawing": "^1.21.2",
|
|
31
31
|
"@progress/kendo-licensing": "^1.3.4",
|
|
32
|
-
"@progress/kendo-react-buttons": "9.4.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "9.4.0-develop.
|
|
34
|
-
"@progress/kendo-react-data-tools": "9.4.0-develop.
|
|
35
|
-
"@progress/kendo-react-dateinputs": "9.4.0-develop.
|
|
36
|
-
"@progress/kendo-react-dialogs": "9.4.0-develop.
|
|
37
|
-
"@progress/kendo-react-dropdowns": "9.4.0-develop.
|
|
38
|
-
"@progress/kendo-react-form": "9.4.0-develop.
|
|
39
|
-
"@progress/kendo-react-inputs": "9.4.0-develop.
|
|
40
|
-
"@progress/kendo-react-intl": "9.4.0-develop.
|
|
41
|
-
"@progress/kendo-react-labels": "9.4.0-develop.
|
|
42
|
-
"@progress/kendo-react-treelist": "9.4.0-develop.
|
|
32
|
+
"@progress/kendo-react-buttons": "9.4.0-develop.11",
|
|
33
|
+
"@progress/kendo-react-common": "9.4.0-develop.11",
|
|
34
|
+
"@progress/kendo-react-data-tools": "9.4.0-develop.11",
|
|
35
|
+
"@progress/kendo-react-dateinputs": "9.4.0-develop.11",
|
|
36
|
+
"@progress/kendo-react-dialogs": "9.4.0-develop.11",
|
|
37
|
+
"@progress/kendo-react-dropdowns": "9.4.0-develop.11",
|
|
38
|
+
"@progress/kendo-react-form": "9.4.0-develop.11",
|
|
39
|
+
"@progress/kendo-react-inputs": "9.4.0-develop.11",
|
|
40
|
+
"@progress/kendo-react-intl": "9.4.0-develop.11",
|
|
41
|
+
"@progress/kendo-react-labels": "9.4.0-develop.11",
|
|
42
|
+
"@progress/kendo-react-treelist": "9.4.0-develop.11",
|
|
43
43
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
44
44
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
45
45
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"package": {
|
|
69
69
|
"productName": "KendoReact",
|
|
70
70
|
"productCode": "KENDOUIREACT",
|
|
71
|
-
"publishDate":
|
|
71
|
+
"publishDate": 1738311852,
|
|
72
72
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
73
73
|
}
|
|
74
74
|
},
|
package/rows/GanttRow.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@progress/kendo-react-treelist"),t=e.TreeListRow;exports.GanttRow=t;
|
package/rows/GanttRow.mjs
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const e = t;
|
|
8
|
+
import { TreeListRow as o } from "@progress/kendo-react-treelist";
|
|
9
|
+
const r = o;
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
r as GanttRow
|
|
13
12
|
};
|
package/utils/data-operations.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@progress/kendo-react-common"),D=require("./index.js"),N=l=>{const{dependencyData:t,dependencyModelFields:n,defaultDataItem:p,fromId:c,toId:r,type:o}=l,s=t.map(m=>({...m})),h=d.setter(n.fromId),e=d.setter(n.toId),a=d.setter(n.type),g=p?{...p}:{};return h(g,c),e(g,r),a(g,o),s.push(g),s},z=l=>{const{defaultDataItem:t,selectedDataItem:n,direction:p,taskModelFields:c,dataTree:r,slotStart:o,slotEnd:s}=l,h=D.mapTree(r,c.children,I=>({...I})),e=d.setter(c.start),a=d.setter(c.end),g=d.getter(c.start),m=d.getter(c.end),k=d.setter(c.parentId||""),i=t?{...t}:{},u=g(i)&&m(i);if(!n||p==="none")u||(e(i,o),a(i,s)),c.parentId&&k(i,null),h.unshift(i);else{const I=[{task:{[c.children]:h},childrenIndex:0}],x=d.getter(c.id),v=d.getter(c.children),O=d.setter(c.children),R=x(n);for(;I.length>0;){const f=I[I.length-1],w=f.task,y=x(w),T=v(w);if(y&&y===R)break;T&&T.length&&T.length>f.childrenIndex?(I.push({task:T[f.childrenIndex],childrenIndex:0}),f.childrenIndex++):I.pop()}if(I.length>1){const f=I[I.length-1].task,w=I[I.length-2].childrenIndex,T=I[I.length-2].task,P=v(T);switch(p){case"child":{let C=v(f);C||(C=[],O(f,C)),u||(e(i,new Date(g(f).getTime())),a(i,new Date(m(f).getTime()))),C.push(i),k(i,x(f)),S(I.splice(1,I.length-1).map(j=>j.task),c);break}case"above":{g(T)&&m(T)&&!u?(e(i,new Date(g(f).getTime())),a(i,new Date(m(f).getTime()))):(e(i,o),a(i,s)),P.splice(w-1,0,i),k(i,x(T)),S(I.splice(1,I.length-2).map(C=>C.task),c);break}case"below":{g(T)&&m(T)&&!u?(e(i,new Date(g(f).getTime())),a(i,new Date(m(f).getTime()))):(e(i,o),a(i,s)),P.splice(w,0,i),k(i,x(T)),S(I.splice(1,I.length-2).map(C=>C.task),c);break}}}}return h},A=l=>{const{updatedDataItem:t,taskModelFields:n,dataTree:p}=l,c=d.getter(n.id),r=d.getter(n.children),o=c(t);let s;const h=D.mapTree(p,n.children,a=>c(a)===o?(s=a,{...t}):{...a});let e=[{task:{[n.children]:h},childrenIndex:0}];for(;e.length>0;){const a=e[e.length-1],g=a.task,m=c(g),k=r(g);if(m&&m===o)break;k&&k.length&&k.length>a.childrenIndex?(e.push({task:k[a.childrenIndex],childrenIndex:0}),a.childrenIndex++):e.pop()}if(e.length>1){e=e.splice(1,e.length-2);const a=d.getter(n.start),g=d.getter(n.end),m=d.getter(n.percentComplete),k=d.getter(n.parentId||"");if(a(s).getTime()!==a(t).getTime()){b(e.map(u=>u.task),n);const i=a(t).getTime()-a(s).getTime();J(r(t),n,i)}if(g(s).getTime()!==g(t).getTime()&&E(e.map(i=>i.task),n),m(s)!==m(t)&&q(e.map(i=>i.task),n),n.parentId&&k(s)!==k(t)){let i;return e.length?G(e.map(u=>u.task),n,s):i=h.filter(u=>c(u)!==c(t)),H(i||h,n,t)}}return h},B=l=>{const{removedDataItem:t,taskModelFields:n,dataTree:p}=l,c=D.mapTree(p,n.children,e=>({...e}));let r=[{task:{[n.children]:c},childrenIndex:0}];const o=d.getter(n.id),s=d.getter(n.children),h=o(t);for(;r.length>0;){const e=r[r.length-1],a=e.task,g=o(a),m=s(a);if(g&&g===h)break;m&&m.length&&m.length>e.childrenIndex?(r.push({task:m[e.childrenIndex],childrenIndex:0}),e.childrenIndex++):r.pop()}if(r.length>1){const e=r[r.length-2],a=e.task;s(a).splice(e.childrenIndex-1,1),r=r.splice(1,r.length-2),S(r.map(m=>m.task),n)}return c},S=(l,t)=>{b(l,t),E(l,t),q(l,t)},G=(l,t,n)=>{const p=d.getter(t.children),c=d.setter(t.children);for(let r=l.length-1;r>=0;r--){const o=l[r],s=p(o);if(n.parentId===o.id){const h=s.filter(e=>e.parentId===o.id);c(o,h)}}},H=(l,t,n)=>{const p=d.getter(t.children),c=d.setter(t.children);return n.parentId===null?[...l,n]:(l=D.mapTree(l,t.children,r=>{if(r.id===n.parentId){const o=p(r)||[];c(r,[...o,n])}return{...r}}),l)},b=(l,t)=>{if(!l.length)return;const n=d.getter(t.children),p=d.getter(t.start),c=d.setter(t.start);for(let r=l.length-1;r>=0;r--){const o=l[r],s=n(o);if(s&&s.length){const h=s.reduce((e,a)=>Math.min(e,p(a).getTime()),p(s[0]).getTime());c(o,new Date(h))}}},E=(l,t)=>{if(!l.length)return;const n=d.getter(t.children),p=d.getter(t.end),c=d.setter(t.end);for(let r=l.length-1;r>=0;r--){const o=l[r],s=n(o);if(s&&s.length){const h=s.reduce((e,a)=>Math.max(e,p(a).getTime()),p(s[0]).getTime());c(o,new Date(h))}}},q=(l,t)=>{if(!l.length)return;const n=d.getter(t.children),p=d.getter(t.percentComplete),c=d.setter(t.percentComplete),r=({avg:o,n:s},h)=>({avg:((p(h)||0)+s*o)/(s+1),n:s+1});for(let o=l.length-1;o>=0;o--){const s=l[o],h=n(s);if(h&&h.length){const e=h.reduce(r,{avg:0,n:0}).avg;c(s,e)}}},J=(l,t,n)=>{if(!l)return;const p=d.getter(t.children),c=d.getter(t.start),r=d.setter(t.start),o=d.getter(t.end),s=d.setter(t.end),h=l.map(e=>({task:e,childrenIndex:0}));for(;h.length>0;){const e=h[h.length-1],a=e.task,g=p(a);g&&g.length&&g.length>e.childrenIndex?(h.push({task:g[e.childrenIndex],childrenIndex:0}),e.childrenIndex++):(h.pop(),r(a,new Date(c(a).getTime()+n)),s(a,new Date(o(a).getTime()+n)))}};exports.addDependency=N;exports.addTask=z;exports.removeTask=B;exports.updateTask=A;
|
|
@@ -5,20 +5,19 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { setter as k, getter as p } from "@progress/kendo-react-common";
|
|
10
9
|
import { mapTree as v } from "./index.mjs";
|
|
11
10
|
const J = (l) => {
|
|
12
|
-
const { dependencyData: t, dependencyModelFields: n, defaultDataItem: g, fromId: s, toId: r, type: d } = l, c = t.map((m) => ({ ...m })),
|
|
13
|
-
return
|
|
11
|
+
const { dependencyData: t, dependencyModelFields: n, defaultDataItem: g, fromId: s, toId: r, type: d } = l, c = t.map((m) => ({ ...m })), i = k(n.fromId), e = k(n.toId), a = k(n.type), h = g ? { ...g } : {};
|
|
12
|
+
return i(h, s), e(h, r), a(h, d), c.push(h), c;
|
|
14
13
|
}, K = (l) => {
|
|
15
|
-
const { defaultDataItem: t, selectedDataItem: n, direction: g, taskModelFields: s, dataTree: r, slotStart: d, slotEnd: c } = l,
|
|
14
|
+
const { defaultDataItem: t, selectedDataItem: n, direction: g, taskModelFields: s, dataTree: r, slotStart: d, slotEnd: c } = l, i = v(r, s.children, (I) => ({ ...I })), e = k(s.start), a = k(s.end), h = p(s.start), m = p(s.end), T = k(s.parentId || ""), o = t ? { ...t } : {}, C = h(o) && m(o);
|
|
16
15
|
if (!n || g === "none")
|
|
17
|
-
C || (e(
|
|
16
|
+
C || (e(o, d), a(o, c)), s.parentId && T(o, null), i.unshift(o);
|
|
18
17
|
else {
|
|
19
18
|
const I = [
|
|
20
19
|
{
|
|
21
|
-
task: { [s.children]:
|
|
20
|
+
task: { [s.children]: i },
|
|
22
21
|
childrenIndex: 0
|
|
23
22
|
}
|
|
24
23
|
], w = p(s.id), y = p(s.children), R = k(s.children), j = w(n);
|
|
@@ -36,21 +35,21 @@ const J = (l) => {
|
|
|
36
35
|
switch (g) {
|
|
37
36
|
case "child": {
|
|
38
37
|
let x = y(f);
|
|
39
|
-
x || (x = [], R(f, x)), C || (e(
|
|
38
|
+
x || (x = [], R(f, x)), C || (e(o, new Date(h(f).getTime())), a(o, new Date(m(f).getTime()))), x.push(o), T(o, w(f)), D(
|
|
40
39
|
I.splice(1, I.length - 1).map((q) => q.task),
|
|
41
40
|
s
|
|
42
41
|
);
|
|
43
42
|
break;
|
|
44
43
|
}
|
|
45
44
|
case "above": {
|
|
46
|
-
h(u) && m(u) && !C ? (e(
|
|
45
|
+
h(u) && m(u) && !C ? (e(o, new Date(h(f).getTime())), a(o, new Date(m(f).getTime()))) : (e(o, d), a(o, c)), E.splice(S - 1, 0, o), T(o, w(u)), D(
|
|
47
46
|
I.splice(1, I.length - 2).map((x) => x.task),
|
|
48
47
|
s
|
|
49
48
|
);
|
|
50
49
|
break;
|
|
51
50
|
}
|
|
52
51
|
case "below": {
|
|
53
|
-
h(u) && m(u) && !C ? (e(
|
|
52
|
+
h(u) && m(u) && !C ? (e(o, new Date(h(f).getTime())), a(o, new Date(m(f).getTime()))) : (e(o, d), a(o, c)), E.splice(S, 0, o), T(o, w(u)), D(
|
|
54
53
|
I.splice(1, I.length - 2).map((x) => x.task),
|
|
55
54
|
s
|
|
56
55
|
);
|
|
@@ -59,14 +58,14 @@ const J = (l) => {
|
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
|
-
return
|
|
61
|
+
return i;
|
|
63
62
|
}, L = (l) => {
|
|
64
63
|
const { updatedDataItem: t, taskModelFields: n, dataTree: g } = l, s = p(n.id), r = p(n.children), d = s(t);
|
|
65
64
|
let c;
|
|
66
|
-
const
|
|
65
|
+
const i = v(g, n.children, (a) => s(a) === d ? (c = a, { ...t }) : { ...a });
|
|
67
66
|
let e = [
|
|
68
67
|
{
|
|
69
|
-
task: { [n.children]:
|
|
68
|
+
task: { [n.children]: i },
|
|
70
69
|
childrenIndex: 0
|
|
71
70
|
}
|
|
72
71
|
];
|
|
@@ -87,25 +86,25 @@ const J = (l) => {
|
|
|
87
86
|
e.map((C) => C.task),
|
|
88
87
|
n
|
|
89
88
|
);
|
|
90
|
-
const
|
|
91
|
-
B(r(t), n,
|
|
89
|
+
const o = a(t).getTime() - a(c).getTime();
|
|
90
|
+
B(r(t), n, o);
|
|
92
91
|
}
|
|
93
92
|
if (h(c).getTime() !== h(t).getTime() && N(
|
|
94
|
-
e.map((
|
|
93
|
+
e.map((o) => o.task),
|
|
95
94
|
n
|
|
96
95
|
), m(c) !== m(t) && O(
|
|
97
|
-
e.map((
|
|
96
|
+
e.map((o) => o.task),
|
|
98
97
|
n
|
|
99
98
|
), n.parentId && T(c) !== T(t)) {
|
|
100
|
-
let
|
|
99
|
+
let o;
|
|
101
100
|
return e.length ? z(
|
|
102
101
|
e.map((C) => C.task),
|
|
103
102
|
n,
|
|
104
103
|
c
|
|
105
|
-
) :
|
|
104
|
+
) : o = i.filter((C) => s(C) !== s(t)), A(o || i, n, t);
|
|
106
105
|
}
|
|
107
106
|
}
|
|
108
|
-
return
|
|
107
|
+
return i;
|
|
109
108
|
}, Q = (l) => {
|
|
110
109
|
const { removedDataItem: t, taskModelFields: n, dataTree: g } = l, s = v(g, n.children, (e) => ({ ...e }));
|
|
111
110
|
let r = [
|
|
@@ -114,10 +113,10 @@ const J = (l) => {
|
|
|
114
113
|
childrenIndex: 0
|
|
115
114
|
}
|
|
116
115
|
];
|
|
117
|
-
const d = p(n.id), c = p(n.children),
|
|
116
|
+
const d = p(n.id), c = p(n.children), i = d(t);
|
|
118
117
|
for (; r.length > 0; ) {
|
|
119
118
|
const e = r[r.length - 1], a = e.task, h = d(a), m = c(a);
|
|
120
|
-
if (h && h ===
|
|
119
|
+
if (h && h === i)
|
|
121
120
|
break;
|
|
122
121
|
m && m.length && m.length > e.childrenIndex ? (r.push({
|
|
123
122
|
task: m[e.childrenIndex],
|
|
@@ -139,8 +138,8 @@ const J = (l) => {
|
|
|
139
138
|
for (let r = l.length - 1; r >= 0; r--) {
|
|
140
139
|
const d = l[r], c = g(d);
|
|
141
140
|
if (n.parentId === d.id) {
|
|
142
|
-
const
|
|
143
|
-
s(d,
|
|
141
|
+
const i = c.filter((e) => e.parentId === d.id);
|
|
142
|
+
s(d, i);
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
}, A = (l, t, n) => {
|
|
@@ -159,11 +158,11 @@ const J = (l) => {
|
|
|
159
158
|
for (let r = l.length - 1; r >= 0; r--) {
|
|
160
159
|
const d = l[r], c = n(d);
|
|
161
160
|
if (c && c.length) {
|
|
162
|
-
const
|
|
161
|
+
const i = c.reduce(
|
|
163
162
|
(e, a) => Math.min(e, g(a).getTime()),
|
|
164
163
|
g(c[0]).getTime()
|
|
165
164
|
);
|
|
166
|
-
s(d, new Date(
|
|
165
|
+
s(d, new Date(i));
|
|
167
166
|
}
|
|
168
167
|
}
|
|
169
168
|
}, N = (l, t) => {
|
|
@@ -173,37 +172,37 @@ const J = (l) => {
|
|
|
173
172
|
for (let r = l.length - 1; r >= 0; r--) {
|
|
174
173
|
const d = l[r], c = n(d);
|
|
175
174
|
if (c && c.length) {
|
|
176
|
-
const
|
|
175
|
+
const i = c.reduce(
|
|
177
176
|
(e, a) => Math.max(e, g(a).getTime()),
|
|
178
177
|
g(c[0]).getTime()
|
|
179
178
|
);
|
|
180
|
-
s(d, new Date(
|
|
179
|
+
s(d, new Date(i));
|
|
181
180
|
}
|
|
182
181
|
}
|
|
183
182
|
}, O = (l, t) => {
|
|
184
183
|
if (!l.length)
|
|
185
184
|
return;
|
|
186
|
-
const n = p(t.children), g = p(t.percentComplete), s = k(t.percentComplete), r = ({ avg: d, n: c },
|
|
187
|
-
avg: ((g(
|
|
185
|
+
const n = p(t.children), g = p(t.percentComplete), s = k(t.percentComplete), r = ({ avg: d, n: c }, i) => ({
|
|
186
|
+
avg: ((g(i) || 0) + c * d) / (c + 1),
|
|
188
187
|
n: c + 1
|
|
189
188
|
});
|
|
190
189
|
for (let d = l.length - 1; d >= 0; d--) {
|
|
191
|
-
const c = l[d],
|
|
192
|
-
if (
|
|
193
|
-
const e =
|
|
190
|
+
const c = l[d], i = n(c);
|
|
191
|
+
if (i && i.length) {
|
|
192
|
+
const e = i.reduce(r, { avg: 0, n: 0 }).avg;
|
|
194
193
|
s(c, e);
|
|
195
194
|
}
|
|
196
195
|
}
|
|
197
196
|
}, B = (l, t, n) => {
|
|
198
197
|
if (!l)
|
|
199
198
|
return;
|
|
200
|
-
const g = p(t.children), s = p(t.start), r = k(t.start), d = p(t.end), c = k(t.end),
|
|
201
|
-
for (;
|
|
202
|
-
const e =
|
|
203
|
-
h && h.length && h.length > e.childrenIndex ? (
|
|
199
|
+
const g = p(t.children), s = p(t.start), r = k(t.start), d = p(t.end), c = k(t.end), i = l.map((e) => ({ task: e, childrenIndex: 0 }));
|
|
200
|
+
for (; i.length > 0; ) {
|
|
201
|
+
const e = i[i.length - 1], a = e.task, h = g(a);
|
|
202
|
+
h && h.length && h.length > e.childrenIndex ? (i.push({
|
|
204
203
|
task: h[e.childrenIndex],
|
|
205
204
|
childrenIndex: 0
|
|
206
|
-
}), e.childrenIndex++) : (
|
|
205
|
+
}), e.childrenIndex++) : (i.pop(), r(a, new Date(s(a).getTime() + n)), c(a, new Date(d(a).getTime() + n)));
|
|
207
206
|
}
|
|
208
207
|
};
|
|
209
208
|
export {
|
package/utils/index.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),c=require("@progress/kendo-date-math"),k=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-data-tools"),L=require("@progress/kendo-react-treelist"),u=require("../constants/index.js");function C(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const T=C(O),I=f.orderBy,Y=f.filterBy,F=k.mapTree,H=k.extendDataItem,Z=L.createDataTree,P=e=>({fields:{...u.DEFAULT_TASK_MODEL_FIELDS,...e}}),U=e=>({fields:{...u.DEFAULT_DEPENDENCY_MODEL_FIELDS,...e}}),B=e=>c.getDate(e),_=(e,t)=>c.getDate(c.addDays(e,t||1)),q=(e,t,n,o)=>n<t&&e<=o;function M(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const D=4,S=10,j=(e,t,n,o)=>{const r=[];let s=0,a=0;const d=S,l=Math.floor(n/2),E=e.top<t.top,i=()=>r.push({left:a,top:s});if(o===0||o===3){const g=o===3?"start":"end";s=e.top,a=e[g],i(),a=Math[g==="start"?"min":"max"](e[g],t[g]),a=g==="start"?a-d:a+d,i(),s=t.top,i(),a=g==="start"?t[g]-D:t[g]+D,i(),h(s,a,r,g!=="start")}else{const g=o===2?"start":"end",m=o===2?"end":"start",p=o===2?e[g]-S*2>=t[m]:e[g]+S*2<=t[m];s=e.top,a=e[g],i(),a=g==="start"?a-d:a+d,i(),p||(s=E?s+l:s-l,i(),a=g==="start"?t[m]+d:t[m]-d,i()),s=t.top,i(),a=m==="start"?t[m]-D:t[m]+D,i(),h(s,a,r,m!=="start")}return r},h=(e,t,n,o)=>o?w(e,t,n):z(e,t,n),w=(e,t,n)=>{n.push({top:e-D/2,left:t}),n.push({top:e,left:t-D+1}),n.push({top:e+D/2,left:t}),n.push({top:e,left:t})},z=(e,t,n)=>{n.push({top:e+D/2,left:t}),n.push({top:e,left:t+D-1}),n.push({top:e-D/2,left:t}),n.push({top:e,left:t})},v=e=>{if(e.workWeekStart===void 0||e.workWeekEnd===void 0)return[];const t=[];let n=e.workWeekStart;for(t.push(n);e.workWeekEnd!==n;)n>6?n-=7:n++,t.push(n);return t},A=(e,t)=>{const n=e.getDay();return t.indexOf(n)>-1},y=(e,{step:t,timezone:n})=>{const o=[],r=c.ZonedDate.fromLocalDate(e.start,n),s=c.ZonedDate.fromLocalDate(e.end,n);let a=r.clone();for(;a.getTime()<s.getTime();){const d=a.clone(),l=d.clone().addTime(t),E=new Date(d.getTime()),g={end:new Date(l.getTime()),start:E,zonedStart:d,zonedEnd:l};o.push(g),a=a.addTime(t)}return o},W=(e,{timezone:t},n)=>{const o=[],r=c.ZonedDate.fromLocalDate(e.start,t),s=c.ZonedDate.fromLocalDate(e.end,t);for(let a=r.clone();a.getTime()<s.getTime();){const d=a.clone(),l=_(c.firstDayInWeek(c.getDate(d),n.firstDay()),u.DAYS_IN_WEEK_COUNT),E=c.ZonedDate.fromUTCDate(M(l),t),i=E.getTime()>s.getTime()?s.clone():E;a=i.clone();const g=new Date(d.getTime()),p={end:new Date(i.getTime()),start:g,zonedStart:d,zonedEnd:i};o.push(p)}return o},b=(e,{timezone:t})=>{const n=[],o=c.ZonedDate.fromLocalDate(e.start,t),r=c.ZonedDate.fromLocalDate(e.end,t);for(let s=o.clone();s.getTime()<r.getTime();){const a=s.clone(),d=c.ZonedDate.fromLocalDate(c.addMonths(new Date(a.getTime()),1),t);s=d.clone();const l=new Date(a.getTime()),i={end:new Date(d.getTime()),start:l,zonedStart:a,zonedEnd:d};n.push(i)}return n},R=(e,{timezone:t})=>{const n=[],o=c.ZonedDate.fromLocalDate(e.start,t),r=c.ZonedDate.fromLocalDate(e.end,t);for(let s=o.clone();s.getTime()<r.getTime();){const a=s.clone(),d=c.ZonedDate.fromLocalDate(c.addMonths(new Date(a.getTime()),12),t);s=d.clone();const l=new Date(a.getTime()),i={end:new Date(d.getTime()),start:l,zonedStart:a,zonedEnd:d};n.push(i)}return n},K=(e,t,n)=>{const o=n.parseDate(t.workDayStart).getHours(),r=n.parseDate(t.workDayEnd).getHours();return y(e,{step:c.MS_PER_MINUTE*t.slotDuration,timezone:t.timezone}).map(a=>{const d=a.zonedStart.getHours();return{range:a,isWork:d>=o&&d<r,span:1,text:n.formatDate(a.zonedStart,u.HOUR_DATE_FORMAT),type:"time"}})},$=(e,t,n)=>y(e,{step:c.MS_PER_DAY,timezone:t.timezone}).map(r=>({range:r,isWork:A(r.start,t.workDays),span:1,text:n.formatDate(r.zonedStart,u.DAY_DATE_FORMAT),type:"day"})),G=(e,t,n)=>W(e,{timezone:t.timezone},n).map(r=>{const s=Math.round((r.zonedEnd.getTime()-r.zonedStart.getTime())/c.MS_PER_DAY);return{range:r,isWork:!1,span:s,text:`${n.formatDate(r.zonedStart,u.DAY_DATE_FORMAT)} - ${n.formatDate(r.zonedEnd,u.DAY_DATE_FORMAT)}`,type:"week"}}),J=(e,t,n)=>b(e,{timezone:t.timezone}).map(r=>{const s=Math.round((r.zonedEnd.getTime()-r.zonedStart.getTime())/c.MS_PER_DAY);return{range:r,isWork:!1,span:s,text:n.formatDate(r.zonedStart,u.MONTH_DATE_FORMAT),type:"month"}}),Q=(e,t,n)=>R(e,{timezone:t.timezone}).map(r=>{const s=Math.round((r.zonedEnd.getTime()-r.zonedStart.getTime())/c.MS_PER_DAY);return{range:r,isWork:!1,span:s,text:n.formatDate(r.zonedStart,u.YEAR_DATE_FORMAT),type:"year"}}),V=(e,t,n)=>{const o=n;return T.createElement("table",{className:"k-table k-table-md",ref:t,"aria-hidden":!0},T.createElement("tbody",{className:"k-table-tbody"},e.map((r,s)=>T.createElement("tr",{className:"k-table-row",key:s},r.map((a,d)=>T.createElement("td",{key:a.range.start.getTime(),colSpan:a.span,className:k.classNames("k-table-th",{"k-header":!0,"k-nonwork-hour":!a.isWork})},o?T.createElement(o,{rowIndex:s,index:d,range:a.range,text:a.text,isWork:a.isWork,type:a.type}):a.text))))))},X=(e,t)=>{const n=e[e.length-1];return T.createElement("table",{className:"k-table k-table-md k-gantt-columns",ref:t,"aria-hidden":!0},T.createElement("tbody",{className:"k-table-tbody"},T.createElement("tr",{className:"k-table-row"},n.map(o=>T.createElement("td",{key:o.range.start.getTime(),colSpan:o.span,className:k.classNames("k-table-td",{"k-nonwork-hour":!o.isWork})})))))},ee=(e,t)=>{const n=e[e.length-1];let o=0,r=0;return n.forEach(s=>{const a=s.span;r+=a,a>o&&(o=a)}),Math.round(r*t/o)},x=(e,t)=>!!k.getter(t)(e),N=(e,t)=>!!k.getter(t)(e),te=(e,t)=>n=>x(n,e)&&N(n,t)?[...k.getter(t)(n)]:[];exports.ARROW_SIZE=D;exports.MIN_LINE_WIDTH=S;exports.addArrow=h;exports.addArrowEast=z;exports.addArrowWest=w;exports.createDataTree=Z;exports.dependencyCoordinates=j;exports.expandedChildren=te;exports.extendDataItem=H;exports.filterBy=Y;exports.getDaySlots=$;exports.getDependencyModelFields=U;exports.getEndDate=_;exports.getHourSlots=K;exports.getMonthSlots=J;exports.getStartDate=B;exports.getTaskModelFields=P;exports.getTimelineContent=X;exports.getTimelineHeader=V;exports.getTimelineWidth=ee;exports.getWeekSlots=G;exports.getWorkDays=v;exports.getYearSlots=Q;exports.hasChildren=N;exports.isExpanded=x;exports.isInRange=q;exports.isWorkDay=A;exports.mapTree=F;exports.orderBy=I;exports.toMonthRanges=b;exports.toRanges=y;exports.toUTCDateTime=M;exports.toWeekRanges=W;exports.toYearRanges=R;
|
package/utils/index.mjs
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as T from "react";
|
|
10
9
|
import { MS_PER_DAY as E, getDate as S, addDays as W, ZonedDate as g, firstDayInWeek as _, addMonths as y, MS_PER_MINUTE as x } from "@progress/kendo-date-math";
|
|
11
10
|
import { mapTree as A, extendDataItem as L, getter as f, classNames as z } from "@progress/kendo-react-common";
|
|
12
11
|
import { orderBy as N, filterBy as b } from "@progress/kendo-react-data-tools";
|
|
13
12
|
import { createDataTree as C } from "@progress/kendo-react-treelist";
|
|
14
13
|
import { DEFAULT_TASK_MODEL_FIELDS as I, DEFAULT_DEPENDENCY_MODEL_FIELDS as H, HOUR_DATE_FORMAT as O, DAY_DATE_FORMAT as h, MONTH_DATE_FORMAT as F, YEAR_DATE_FORMAT as B, DAYS_IN_WEEK_COUNT as U } from "../constants/index.mjs";
|
|
15
|
-
const te = N, ne = b, ae = A, re = L, oe = C, se = (e) => ({ fields: { ...I, ...e } }),
|
|
14
|
+
const te = N, ne = b, ae = A, re = L, oe = C, se = (e) => ({ fields: { ...I, ...e } }), de = (e) => ({ fields: { ...H, ...e } }), ce = (e) => S(e), Y = (e, t) => S(W(e, t || 1)), me = (e, t, n, o) => n < t && e <= o;
|
|
16
15
|
function $(e) {
|
|
17
16
|
return new Date(
|
|
18
17
|
Date.UTC(
|
|
@@ -29,13 +28,13 @@ function $(e) {
|
|
|
29
28
|
const l = 4, p = 10, ie = (e, t, n, o) => {
|
|
30
29
|
const r = [];
|
|
31
30
|
let s = 0, a = 0;
|
|
32
|
-
const
|
|
31
|
+
const d = p, i = Math.floor(n / 2), u = e.top < t.top, c = () => r.push({ left: a, top: s });
|
|
33
32
|
if (o === 0 || o === 3) {
|
|
34
33
|
const m = o === 3 ? "start" : "end";
|
|
35
|
-
s = e.top, a = e[m],
|
|
34
|
+
s = e.top, a = e[m], c(), a = Math[m === "start" ? "min" : "max"](e[m], t[m]), a = m === "start" ? a - d : a + d, c(), s = t.top, c(), a = m === "start" ? t[m] - l : t[m] + l, c(), w(s, a, r, m !== "start");
|
|
36
35
|
} else {
|
|
37
36
|
const m = o === 2 ? "start" : "end", D = o === 2 ? "end" : "start", k = o === 2 ? e[m] - p * 2 >= t[D] : e[m] + p * 2 <= t[D];
|
|
38
|
-
s = e.top, a = e[m],
|
|
37
|
+
s = e.top, a = e[m], c(), a = m === "start" ? a - d : a + d, c(), k || (s = u ? s + i : s - i, c(), a = m === "start" ? t[D] + d : t[D] - d, c()), s = t.top, c(), a = D === "start" ? t[D] - l : t[D] + l, c(), w(s, a, r, D !== "start");
|
|
39
38
|
}
|
|
40
39
|
return r;
|
|
41
40
|
}, w = (e, t, n, o) => o ? R(e, t, n) : P(e, t, n), R = (e, t, n) => {
|
|
@@ -81,10 +80,10 @@ const l = 4, p = 10, ie = (e, t, n, o) => {
|
|
|
81
80
|
const o = [], r = g.fromLocalDate(e.start, n), s = g.fromLocalDate(e.end, n);
|
|
82
81
|
let a = r.clone();
|
|
83
82
|
for (; a.getTime() < s.getTime(); ) {
|
|
84
|
-
const
|
|
83
|
+
const d = a.clone(), i = d.clone().addTime(t), u = new Date(d.getTime()), m = {
|
|
85
84
|
end: new Date(i.getTime()),
|
|
86
85
|
start: u,
|
|
87
|
-
zonedStart:
|
|
86
|
+
zonedStart: d,
|
|
88
87
|
zonedEnd: i
|
|
89
88
|
};
|
|
90
89
|
o.push(m), a = a.addTime(t);
|
|
@@ -93,13 +92,13 @@ const l = 4, p = 10, ie = (e, t, n, o) => {
|
|
|
93
92
|
}, Z = (e, { timezone: t }, n) => {
|
|
94
93
|
const o = [], r = g.fromLocalDate(e.start, t), s = g.fromLocalDate(e.end, t);
|
|
95
94
|
for (let a = r.clone(); a.getTime() < s.getTime(); ) {
|
|
96
|
-
const
|
|
97
|
-
a =
|
|
98
|
-
const m = new Date(
|
|
99
|
-
end: new Date(
|
|
95
|
+
const d = a.clone(), i = Y(_(S(d), n.firstDay()), U), u = g.fromUTCDate($(i), t), c = u.getTime() > s.getTime() ? s.clone() : u;
|
|
96
|
+
a = c.clone();
|
|
97
|
+
const m = new Date(d.getTime()), k = {
|
|
98
|
+
end: new Date(c.getTime()),
|
|
100
99
|
start: m,
|
|
101
|
-
zonedStart:
|
|
102
|
-
zonedEnd:
|
|
100
|
+
zonedStart: d,
|
|
101
|
+
zonedEnd: c
|
|
103
102
|
};
|
|
104
103
|
o.push(k);
|
|
105
104
|
}
|
|
@@ -107,38 +106,38 @@ const l = 4, p = 10, ie = (e, t, n, o) => {
|
|
|
107
106
|
}, v = (e, { timezone: t }) => {
|
|
108
107
|
const n = [], o = g.fromLocalDate(e.start, t), r = g.fromLocalDate(e.end, t);
|
|
109
108
|
for (let s = o.clone(); s.getTime() < r.getTime(); ) {
|
|
110
|
-
const a = s.clone(),
|
|
111
|
-
s =
|
|
112
|
-
const i = new Date(a.getTime()),
|
|
113
|
-
end: new Date(
|
|
109
|
+
const a = s.clone(), d = g.fromLocalDate(y(new Date(a.getTime()), 1), t);
|
|
110
|
+
s = d.clone();
|
|
111
|
+
const i = new Date(a.getTime()), c = {
|
|
112
|
+
end: new Date(d.getTime()),
|
|
114
113
|
start: i,
|
|
115
114
|
zonedStart: a,
|
|
116
|
-
zonedEnd:
|
|
115
|
+
zonedEnd: d
|
|
117
116
|
};
|
|
118
|
-
n.push(
|
|
117
|
+
n.push(c);
|
|
119
118
|
}
|
|
120
119
|
return n;
|
|
121
120
|
}, j = (e, { timezone: t }) => {
|
|
122
121
|
const n = [], o = g.fromLocalDate(e.start, t), r = g.fromLocalDate(e.end, t);
|
|
123
122
|
for (let s = o.clone(); s.getTime() < r.getTime(); ) {
|
|
124
|
-
const a = s.clone(),
|
|
125
|
-
s =
|
|
126
|
-
const i = new Date(a.getTime()),
|
|
127
|
-
end: new Date(
|
|
123
|
+
const a = s.clone(), d = g.fromLocalDate(y(new Date(a.getTime()), 12), t);
|
|
124
|
+
s = d.clone();
|
|
125
|
+
const i = new Date(a.getTime()), c = {
|
|
126
|
+
end: new Date(d.getTime()),
|
|
128
127
|
start: i,
|
|
129
128
|
zonedStart: a,
|
|
130
|
-
zonedEnd:
|
|
129
|
+
zonedEnd: d
|
|
131
130
|
};
|
|
132
|
-
n.push(
|
|
131
|
+
n.push(c);
|
|
133
132
|
}
|
|
134
133
|
return n;
|
|
135
134
|
}, le = (e, t, n) => {
|
|
136
135
|
const o = n.parseDate(t.workDayStart).getHours(), r = n.parseDate(t.workDayEnd).getHours();
|
|
137
136
|
return M(e, { step: x * t.slotDuration, timezone: t.timezone }).map((a) => {
|
|
138
|
-
const
|
|
137
|
+
const d = a.zonedStart.getHours();
|
|
139
138
|
return {
|
|
140
139
|
range: a,
|
|
141
|
-
isWork:
|
|
140
|
+
isWork: d >= o && d < r,
|
|
142
141
|
span: 1,
|
|
143
142
|
text: n.formatDate(a.zonedStart, O),
|
|
144
143
|
type: "time"
|
|
@@ -182,7 +181,7 @@ const l = 4, p = 10, ie = (e, t, n, o) => {
|
|
|
182
181
|
};
|
|
183
182
|
}), ke = (e, t, n) => {
|
|
184
183
|
const o = n;
|
|
185
|
-
return /* @__PURE__ */ T.createElement("table", { className: "k-table k-table-md", ref: t, "aria-hidden": !0 }, /* @__PURE__ */ T.createElement("tbody", { className: "k-table-tbody" }, e.map((r, s) => /* @__PURE__ */ T.createElement("tr", { className: "k-table-row", key: s }, r.map((a,
|
|
184
|
+
return /* @__PURE__ */ T.createElement("table", { className: "k-table k-table-md", ref: t, "aria-hidden": !0 }, /* @__PURE__ */ T.createElement("tbody", { className: "k-table-tbody" }, e.map((r, s) => /* @__PURE__ */ T.createElement("tr", { className: "k-table-row", key: s }, r.map((a, d) => /* @__PURE__ */ T.createElement(
|
|
186
185
|
"td",
|
|
187
186
|
{
|
|
188
187
|
key: a.range.start.getTime(),
|
|
@@ -196,7 +195,7 @@ const l = 4, p = 10, ie = (e, t, n, o) => {
|
|
|
196
195
|
o,
|
|
197
196
|
{
|
|
198
197
|
rowIndex: s,
|
|
199
|
-
index:
|
|
198
|
+
index: d,
|
|
200
199
|
range: a.range,
|
|
201
200
|
text: a.text,
|
|
202
201
|
isWork: a.isWork,
|
|
@@ -236,11 +235,11 @@ export {
|
|
|
236
235
|
re as extendDataItem,
|
|
237
236
|
ne as filterBy,
|
|
238
237
|
De as getDaySlots,
|
|
239
|
-
|
|
238
|
+
de as getDependencyModelFields,
|
|
240
239
|
Y as getEndDate,
|
|
241
240
|
le as getHourSlots,
|
|
242
241
|
ue as getMonthSlots,
|
|
243
|
-
|
|
242
|
+
ce as getStartDate,
|
|
244
243
|
se as getTaskModelFields,
|
|
245
244
|
pe as getTimelineContent,
|
|
246
245
|
ke as getTimelineHeader,
|