@progress/kendo-react-gantt 9.0.0-develop.2 → 9.0.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Gantt.mjs +88 -130
- package/README.md +24 -23
- package/cells/FilterCells/utils.mjs +4 -1
- package/components/BaseView.mjs +82 -72
- package/components/GanttTask.mjs +24 -11
- package/components/toolbar/AddButton.mjs +40 -38
- package/components/toolbar/Toolbar.mjs +1 -4
- package/components/toolbar/view-selector/ViewSelector.mjs +1 -4
- package/components/toolbar/view-selector/ViewSelectorItem.mjs +3 -6
- package/context/GanttContext.mjs +3 -1
- package/editors/FormDropDownList.mjs +11 -19
- package/editors/GanttEditor.js +1 -1
- package/editors/GanttEditor.mjs +56 -68
- package/editors/GanttEditorPredecessors.mjs +2 -13
- package/editors/GanttEditorSuccessors.mjs +3 -17
- package/editors/GanttForm.mjs +29 -16
- package/hooks/useDictionaryStore.mjs +10 -13
- package/hooks/useGanttTask.mjs +13 -15
- package/package-metadata.mjs +1 -1
- package/package.json +12 -12
- package/utils/data-operations.mjs +50 -19
- package/utils/index.mjs +22 -23
- package/views/GanttDayView.mjs +36 -28
- package/views/GanttMonthView.mjs +10 -20
- package/views/GanttWeekView.mjs +13 -19
- package/views/GanttYearView.mjs +11 -28
package/Gantt.mjs
CHANGED
|
@@ -49,7 +49,13 @@ const z = a.forwardRef((e, A) => {
|
|
|
49
49
|
selectable: Z
|
|
50
50
|
} = e, s = /* @__PURE__ */ new Map();
|
|
51
51
|
s.set(ze, Ae), s.set(Ne, Ge), s.set(v, He), s.set(Pe, Ke);
|
|
52
|
-
const $ = Ve(), { fields: o } = a.useMemo(
|
|
52
|
+
const $ = Ve(), { fields: o } = a.useMemo(
|
|
53
|
+
() => Ee(e.taskModelFields),
|
|
54
|
+
[e.taskModelFields]
|
|
55
|
+
), { fields: p } = a.useMemo(
|
|
56
|
+
() => xe(e.dependencyModelFields),
|
|
57
|
+
[e.dependencyModelFields]
|
|
58
|
+
), E = a.useCallback(
|
|
53
59
|
Fe(o.isExpanded, o.children),
|
|
54
60
|
[o.isExpanded, o.children]
|
|
55
61
|
), R = a.useRef(null), r = a.useRef(null), i = a.useRef(null), m = a.useRef(null), C = a.useRef(null), ee = a.useCallback(
|
|
@@ -58,15 +64,11 @@ const z = a.forwardRef((e, A) => {
|
|
|
58
64
|
(!r.current || d < r.current) && (r.current = d), (!i.current || u > i.current) && (i.current = u), D && (m.current = t);
|
|
59
65
|
},
|
|
60
66
|
[o.start, o.end]
|
|
61
|
-
), g = a.useMemo(
|
|
62
|
-
() => (r.current = null, i.current = null, m.current = null, We(M, E, ee)),
|
|
63
|
-
[M, E]
|
|
64
|
-
);
|
|
67
|
+
), g = a.useMemo(() => (r.current = null, i.current = null, m.current = null, We(M, E, ee)), [M, E]);
|
|
65
68
|
(!r.current || !i.current) && (r.current = new Date(I), i.current = new Date(I));
|
|
66
|
-
const f = a.Children.toArray(e.children || []).map(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
] = je(
|
|
69
|
+
const f = a.Children.toArray(e.children || []).map(
|
|
70
|
+
(t) => a.isValidElement(t) ? a.cloneElement(t, { ...s.get(t.type), ...t.props }) : t
|
|
71
|
+
), ne = a.cloneElement(/* @__PURE__ */ a.createElement(v, null), s.get(v)), x = f.length ? f[0] : ne, [F, te] = je(
|
|
70
72
|
e.defaultView || x.props.name,
|
|
71
73
|
e.view,
|
|
72
74
|
e.onViewChange
|
|
@@ -76,170 +78,140 @@ const z = a.forwardRef((e, A) => {
|
|
|
76
78
|
tasksEnd: i.current,
|
|
77
79
|
timezone: S
|
|
78
80
|
}) : c.props.dateRange, b = a.useRef(null), [le, oe] = a.useState(0);
|
|
79
|
-
Oe(
|
|
80
|
-
()
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
);
|
|
85
|
-
const re = a.useCallback(
|
|
86
|
-
(t) => {
|
|
87
|
-
R.current && R.current.scrollIntoView(t);
|
|
88
|
-
},
|
|
89
|
-
[]
|
|
90
|
-
), V = a.useRef(null), l = a.useRef(null);
|
|
81
|
+
Oe(() => {
|
|
82
|
+
b.current && oe(b.current.element.offsetHeight);
|
|
83
|
+
}, []);
|
|
84
|
+
const re = a.useCallback((t) => {
|
|
85
|
+
R.current && R.current.scrollIntoView(t);
|
|
86
|
+
}, []), V = a.useRef(null), l = a.useRef(null);
|
|
91
87
|
a.useImperativeHandle(l, () => ({ props: e, element: V.current, scrollIntoView: re })), a.useImperativeHandle(A, () => l.current);
|
|
92
88
|
const ie = a.useCallback(
|
|
93
89
|
(t) => {
|
|
94
|
-
e.onDataStateChange && e.onDataStateChange.call(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
);
|
|
90
|
+
e.onDataStateChange && e.onDataStateChange.call(void 0, {
|
|
91
|
+
...t,
|
|
92
|
+
target: l.current
|
|
93
|
+
});
|
|
98
94
|
},
|
|
99
95
|
[e.onDataStateChange]
|
|
100
96
|
), ce = a.useCallback(
|
|
101
97
|
(t) => {
|
|
102
|
-
e.onSortChange && e.onSortChange.call(
|
|
103
|
-
void 0,
|
|
104
|
-
{ ...t, target: l.current }
|
|
105
|
-
);
|
|
98
|
+
e.onSortChange && e.onSortChange.call(void 0, { ...t, target: l.current });
|
|
106
99
|
},
|
|
107
100
|
[e.onSortChange]
|
|
108
101
|
), se = a.useCallback(
|
|
109
102
|
(t) => {
|
|
110
|
-
e.onKeyDown && e.onKeyDown.call(
|
|
111
|
-
void 0,
|
|
112
|
-
{ ...t, target: l.current }
|
|
113
|
-
);
|
|
103
|
+
e.onKeyDown && e.onKeyDown.call(void 0, { ...t, target: l.current });
|
|
114
104
|
},
|
|
115
105
|
[e.onKeyDown]
|
|
116
106
|
), de = a.useCallback(
|
|
117
107
|
(t) => {
|
|
118
|
-
e.onSelectionChange && e.onSelectionChange.call(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
);
|
|
108
|
+
e.onSelectionChange && e.onSelectionChange.call(void 0, {
|
|
109
|
+
...t,
|
|
110
|
+
target: l.current
|
|
111
|
+
});
|
|
122
112
|
},
|
|
123
113
|
[e.onSelectionChange]
|
|
124
114
|
), ue = a.useCallback(
|
|
125
115
|
(t) => {
|
|
126
|
-
e.onHeaderSelectionChange && e.onHeaderSelectionChange.call(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
);
|
|
116
|
+
e.onHeaderSelectionChange && e.onHeaderSelectionChange.call(void 0, {
|
|
117
|
+
...t,
|
|
118
|
+
target: l.current
|
|
119
|
+
});
|
|
130
120
|
},
|
|
131
121
|
[e.onHeaderSelectionChange]
|
|
132
122
|
), Ce = a.useCallback(
|
|
133
123
|
(t) => {
|
|
134
|
-
e.onFilterChange && e.onFilterChange.call(
|
|
135
|
-
void 0,
|
|
136
|
-
{ ...t, target: l.current }
|
|
137
|
-
);
|
|
124
|
+
e.onFilterChange && e.onFilterChange.call(void 0, { ...t, target: l.current });
|
|
138
125
|
},
|
|
139
126
|
[e.onFilterChange]
|
|
140
127
|
), me = a.useCallback(
|
|
141
128
|
(t) => {
|
|
142
|
-
e.onColumnMenuFilterChange && e.onColumnMenuFilterChange.call(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
);
|
|
129
|
+
e.onColumnMenuFilterChange && e.onColumnMenuFilterChange.call(void 0, {
|
|
130
|
+
...t,
|
|
131
|
+
target: l.current
|
|
132
|
+
});
|
|
146
133
|
},
|
|
147
134
|
[e.onColumnMenuFilterChange]
|
|
148
135
|
), ge = a.useCallback(
|
|
149
136
|
(t) => {
|
|
150
|
-
e.onExpandChange && e.onExpandChange.call(
|
|
151
|
-
void 0,
|
|
152
|
-
{ ...t, target: l.current }
|
|
153
|
-
);
|
|
137
|
+
e.onExpandChange && e.onExpandChange.call(void 0, { ...t, target: l.current });
|
|
154
138
|
},
|
|
155
139
|
[e.onExpandChange]
|
|
156
140
|
), fe = a.useCallback(
|
|
157
141
|
(t) => {
|
|
158
|
-
e.onAddClick && e.onAddClick.call(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
slotEnd: C.current && new Date(C.current.end.getTime())
|
|
166
|
-
}
|
|
167
|
-
);
|
|
142
|
+
e.onAddClick && e.onAddClick.call(void 0, {
|
|
143
|
+
...t,
|
|
144
|
+
target: l.current,
|
|
145
|
+
selectedDataItem: m.current,
|
|
146
|
+
slotStart: C.current && new Date(C.current.start.getTime()),
|
|
147
|
+
slotEnd: C.current && new Date(C.current.end.getTime())
|
|
148
|
+
});
|
|
168
149
|
},
|
|
169
150
|
[e.onAddClick]
|
|
170
151
|
), ke = a.useCallback(
|
|
171
152
|
(t) => {
|
|
172
|
-
e.onColumnResize && e.onColumnResize.call(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
target: l.current
|
|
177
|
-
}
|
|
178
|
-
);
|
|
153
|
+
e.onColumnResize && e.onColumnResize.call(void 0, {
|
|
154
|
+
...t,
|
|
155
|
+
target: l.current
|
|
156
|
+
});
|
|
179
157
|
},
|
|
180
158
|
[e.onColumnResize]
|
|
181
159
|
), he = a.useCallback(
|
|
182
160
|
(t) => {
|
|
183
|
-
e.onColumnReorder && e.onColumnReorder.call(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
);
|
|
161
|
+
e.onColumnReorder && e.onColumnReorder.call(void 0, {
|
|
162
|
+
...t,
|
|
163
|
+
target: l.current
|
|
164
|
+
});
|
|
187
165
|
},
|
|
188
166
|
[e.onColumnReorder]
|
|
189
167
|
), we = a.useCallback(
|
|
190
168
|
(t) => {
|
|
191
|
-
e.onRowClick && e.onRowClick.call(
|
|
192
|
-
void 0,
|
|
193
|
-
{ ...t, target: l.current }
|
|
194
|
-
);
|
|
169
|
+
e.onRowClick && e.onRowClick.call(void 0, { ...t, target: l.current });
|
|
195
170
|
},
|
|
196
171
|
[e.onRowClick]
|
|
197
172
|
), Re = a.useCallback(
|
|
198
173
|
(t) => {
|
|
199
|
-
e.onRowDoubleClick && e.onRowDoubleClick.call(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
);
|
|
174
|
+
e.onRowDoubleClick && e.onRowDoubleClick.call(void 0, {
|
|
175
|
+
...t,
|
|
176
|
+
target: l.current
|
|
177
|
+
});
|
|
203
178
|
},
|
|
204
179
|
[e.onRowClick]
|
|
205
180
|
), be = a.useCallback(
|
|
206
181
|
(t) => {
|
|
207
|
-
e.onRowContextMenu && e.onRowContextMenu.call(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
);
|
|
182
|
+
e.onRowContextMenu && e.onRowContextMenu.call(void 0, {
|
|
183
|
+
...t,
|
|
184
|
+
target: l.current
|
|
185
|
+
});
|
|
211
186
|
},
|
|
212
187
|
[e.onRowClick]
|
|
213
188
|
), De = a.useCallback(
|
|
214
189
|
(t) => {
|
|
215
|
-
e.onTaskClick && e.onTaskClick.call(
|
|
216
|
-
void 0,
|
|
217
|
-
{ ...t, target: l.current }
|
|
218
|
-
);
|
|
190
|
+
e.onTaskClick && e.onTaskClick.call(void 0, { ...t, target: l.current });
|
|
219
191
|
},
|
|
220
192
|
[e.onTaskClick]
|
|
221
193
|
), ye = a.useCallback(
|
|
222
194
|
(t) => {
|
|
223
|
-
e.onTaskDoubleClick && e.onTaskDoubleClick.call(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
);
|
|
195
|
+
e.onTaskDoubleClick && e.onTaskDoubleClick.call(void 0, {
|
|
196
|
+
...t,
|
|
197
|
+
target: l.current
|
|
198
|
+
});
|
|
227
199
|
},
|
|
228
200
|
[e.onTaskDoubleClick]
|
|
229
201
|
), ve = a.useCallback(
|
|
230
202
|
(t) => {
|
|
231
|
-
e.onTaskContextMenu && e.onTaskContextMenu.call(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
);
|
|
203
|
+
e.onTaskContextMenu && e.onTaskContextMenu.call(void 0, {
|
|
204
|
+
...t,
|
|
205
|
+
target: l.current
|
|
206
|
+
});
|
|
235
207
|
},
|
|
236
208
|
[e.onTaskContextMenu]
|
|
237
209
|
), Me = a.useCallback(
|
|
238
210
|
(t) => {
|
|
239
|
-
e.onTaskRemoveClick && e.onTaskRemoveClick.call(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
);
|
|
211
|
+
e.onTaskRemoveClick && e.onTaskRemoveClick.call(void 0, {
|
|
212
|
+
...t,
|
|
213
|
+
target: l.current
|
|
214
|
+
});
|
|
243
215
|
},
|
|
244
216
|
[e.onTaskRemoveClick]
|
|
245
217
|
), Se = a.useCallback(
|
|
@@ -252,15 +224,12 @@ const z = a.forwardRef((e, A) => {
|
|
|
252
224
|
if (String(k) === t.fromId && (d = k), String(k) === t.toId && (u = k), d && u)
|
|
253
225
|
break;
|
|
254
226
|
}
|
|
255
|
-
e.onDependencyCreate.call(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
type: t.type
|
|
262
|
-
}
|
|
263
|
-
);
|
|
227
|
+
e.onDependencyCreate.call(void 0, {
|
|
228
|
+
fromId: d,
|
|
229
|
+
toId: u,
|
|
230
|
+
target: l.current,
|
|
231
|
+
type: t.type
|
|
232
|
+
});
|
|
264
233
|
}
|
|
265
234
|
},
|
|
266
235
|
[e.onDependencyCreate, o, g]
|
|
@@ -315,26 +284,15 @@ const z = a.forwardRef((e, A) => {
|
|
|
315
284
|
onTaskRemoveClick: e.onTaskRemoveClick && Me
|
|
316
285
|
}
|
|
317
286
|
},
|
|
318
|
-
/* @__PURE__ */ a.createElement(
|
|
319
|
-
|
|
287
|
+
/* @__PURE__ */ a.createElement("div", { ref: V, role: "application", style: K, className: Ue("k-gantt", W) }, /* @__PURE__ */ a.createElement(Je, { ref: b }, T && T.addTaskButton ? /* @__PURE__ */ a.createElement(Xe, { selectedTask: m.current, onClick: fe }) : null, /* @__PURE__ */ a.createElement(Qe, null), /* @__PURE__ */ a.createElement(qe, null, /* @__PURE__ */ a.createElement(_e, null))), c && /* @__PURE__ */ a.createElement(
|
|
288
|
+
c.type,
|
|
320
289
|
{
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
c && /* @__PURE__ */ a.createElement(
|
|
328
|
-
c.type,
|
|
329
|
-
{
|
|
330
|
-
key: c.props.name,
|
|
331
|
-
ref: R,
|
|
332
|
-
...c.props,
|
|
333
|
-
firstSlotRangeRef: C
|
|
334
|
-
}
|
|
335
|
-
),
|
|
336
|
-
N && /* @__PURE__ */ a.createElement(Ye, null)
|
|
337
|
-
)
|
|
290
|
+
key: c.props.name,
|
|
291
|
+
ref: R,
|
|
292
|
+
...c.props,
|
|
293
|
+
firstSlotRangeRef: C
|
|
294
|
+
}
|
|
295
|
+
), N && /* @__PURE__ */ a.createElement(Ye, null))
|
|
338
296
|
);
|
|
339
297
|
}), w = {
|
|
340
298
|
taskData: [],
|
package/README.md
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
# KendoReact Gantt Component for React
|
|
6
6
|
|
|
7
7
|
> **Important**
|
|
8
|
-
>
|
|
9
|
-
>
|
|
10
|
-
>
|
|
11
|
-
>
|
|
8
|
+
>
|
|
9
|
+
> - This package is а part of [KendoReact](https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)—a commercial UI library.
|
|
10
|
+
> - You will need to install a license key when adding the package to your project. For more information, please refer to the [KendoReact My License page](https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt).
|
|
11
|
+
> - To receive a license key, you need to either [purchase a license](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt) or register for a [free trial](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt). Doing so indicates that you [accept the KendoReact License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt).
|
|
12
|
+
> - The 30-day free trial gives you access to all the KendoReact components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the KendoReact dev team!
|
|
12
13
|
>
|
|
13
14
|
> [Start using KendoReact](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt) and speed up your development process!
|
|
14
15
|
|
|
@@ -18,35 +19,35 @@ The [React Gantt](https://www.telerik.com/kendo-react-ui/gantt-chart), part of K
|
|
|
18
19
|
|
|
19
20
|
Among the features which the KendoReact Gantt component delivers are:
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
- [Filtering](https://www.telerik.com/kendo-react-ui/components/gantt/filtering/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)—The KendoReact Gantt enables you to display only those Gantt records which meet specified criteria.
|
|
23
|
+
- [Sorting](https://www.telerik.com/kendo-react-ui/components/gantt/sorting/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)—The KendoReact Gantt enables you to sort single and multiple data-bound columns.
|
|
24
|
+
- [Transformation of flat data](https://www.telerik.com/kendo-react-ui/components/gantt/flat-data/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)—Provides a built-in function to convert flat data to a tree that can be visualized by the component.
|
|
25
|
+
- [Globalization](https://www.telerik.com/kendo-react-ui/components/gantt/globalization/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)—By using the available globalization options in KendoReact, you can translate the Gantt messages by adapting them to specific culture locales.
|
|
26
|
+
- [Theme support](https://www.telerik.com/kendo-react-ui/components/styling/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)—The KendoReact Gantt, as well as all 100+ components in the KendoReact suite, are styled in three polished themes (Bootstrap, Material, and Default) and can be further customized to match your specific design guidelines.
|
|
26
27
|
|
|
27
28
|
## Support Options
|
|
28
29
|
|
|
29
30
|
For any issues you might encounter while working with the KendoReact Gantt, use any of the available support channels:
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
- Industry-leading technical support—KendoReact paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use [the dedicated KendoReact support system](https://www.telerik.com/account/support-tickets?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt).
|
|
33
|
+
- Product forums—The [KendoReact forums](https://www.telerik.com/forums/kendo-ui-react?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt) are part of the free support you can get from the community and from the KendoReact team.
|
|
34
|
+
- Feedback portal—The [KendoReact feedback portal](https://feedback.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt) is where you can request and vote for new features to be added.
|
|
34
35
|
|
|
35
36
|
## Resources
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
- [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)
|
|
39
|
+
- [Get Started with the KendoReact Gantt](https://www.telerik.com/kendo-react-ui/components/gantt/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)
|
|
40
|
+
- [API Reference of the KendoReact Gantt](https://www.telerik.com/kendo-react-ui/components/gantt/api/GanttProps/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)
|
|
41
|
+
- [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)
|
|
42
|
+
- [Blogs](https://www.telerik.com/blogs/tag/kendoreact?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)
|
|
43
|
+
- [Demos, documentation, and component reference](https://www.telerik.com/kendo-react-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)
|
|
44
|
+
- [KendoReact pricing and licensing](https://www.telerik.com/kendo-react-ui/pricing?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)
|
|
45
|
+
- [Changelog](https://www.telerik.com/kendo-react-ui/components/changelogs/ui-for-react/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-gantt)
|
|
45
46
|
|
|
46
47
|
High-level component overview pages
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
- [React Gantt Chart Component](https://www.telerik.com/kendo-react-ui/gantt-chart)
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
_Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved._
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
_Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries._
|
|
@@ -43,7 +43,10 @@ const A = [
|
|
|
43
43
|
];
|
|
44
44
|
function G(l, n) {
|
|
45
45
|
return {
|
|
46
|
-
clearButtonTitle: l.toLanguageString(
|
|
46
|
+
clearButtonTitle: l.toLanguageString(
|
|
47
|
+
p,
|
|
48
|
+
i[p]
|
|
49
|
+
),
|
|
47
50
|
operators: n.map((t) => ({
|
|
48
51
|
text: l.toLanguageString(t.text, i[t.text]),
|
|
49
52
|
operator: t.operator
|
package/components/BaseView.mjs
CHANGED
|
@@ -46,44 +46,38 @@ const et = e.forwardRef((X, Y) => {
|
|
|
46
46
|
onKeyDown: le,
|
|
47
47
|
onSelectionChange: ce,
|
|
48
48
|
onHeaderSelectionChange: ae
|
|
49
|
-
} = Ne(), ie = Xe(), ue = Ye(), i = Pe(), fe = We(), y = _e(), de = ze(), x = e.useRef(null), I = e.useRef(null), u = e.useRef(null), p = e.useRef(null), L = e.useRef(0), F = e.useRef(N()), me = e.useRef(N()), c = e.useRef(null), G = e.useRef(null), pe = e.useCallback(
|
|
50
|
-
(t)
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
[]
|
|
54
|
-
);
|
|
49
|
+
} = Ne(), ie = Xe(), ue = Ye(), i = Pe(), fe = We(), y = _e(), de = ze(), x = e.useRef(null), I = e.useRef(null), u = e.useRef(null), p = e.useRef(null), L = e.useRef(0), F = e.useRef(N()), me = e.useRef(N()), c = e.useRef(null), G = e.useRef(null), pe = e.useCallback((t) => {
|
|
50
|
+
u.current && u.current.scrollIntoView(t);
|
|
51
|
+
}, []);
|
|
55
52
|
e.useImperativeHandle(G, () => ({ scrollIntoView: pe })), e.useImperativeHandle(Y, () => G.current);
|
|
56
|
-
const C = e.useRef(0), g = e.useRef(0), R = e.useRef(0), h = e.useRef(0), f = e.useRef(null), T = e.useRef(null), [d, w] = e.useState(null), Ce = Ke(E, x, W), ge = Be(E, I), D = Ue(E, P), { extendedColumns: Re, columnsWidth: he, columnsMap: De } = e.useMemo(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
[k, D]
|
|
86
|
-
), [Ee, be] = Oe(), H = e.useCallback(
|
|
53
|
+
const C = e.useRef(0), g = e.useRef(0), R = e.useRef(0), h = e.useRef(0), f = e.useRef(null), T = e.useRef(null), [d, w] = e.useState(null), Ce = Ke(E, x, W), ge = Be(E, I), D = Ue(E, P), { extendedColumns: Re, columnsWidth: he, columnsMap: De } = e.useMemo(() => {
|
|
54
|
+
const t = je(
|
|
55
|
+
[
|
|
56
|
+
...k,
|
|
57
|
+
{
|
|
58
|
+
title: "",
|
|
59
|
+
sortable: !1,
|
|
60
|
+
resizable: !1,
|
|
61
|
+
reorderable: !1,
|
|
62
|
+
width: D,
|
|
63
|
+
headerCell: () => Ce,
|
|
64
|
+
cell: ve,
|
|
65
|
+
orderIndex: Number.MAX_SAFE_INTEGER,
|
|
66
|
+
navigatable: !1
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
{ prevId: 0, idPrefix: F.current }
|
|
70
|
+
);
|
|
71
|
+
let r = 0;
|
|
72
|
+
return t.forEach((n, o, l) => {
|
|
73
|
+
const s = o + 1 === l.length, a = n.children.length === 0;
|
|
74
|
+
s ? n.isAccessible = !1 : (n.locked = !0, a && (n.width = n.width || Je)), a && (r += parseFloat(String(n.width)));
|
|
75
|
+
}), {
|
|
76
|
+
extendedColumns: t,
|
|
77
|
+
columnsWidth: r,
|
|
78
|
+
columnsMap: qe(t)
|
|
79
|
+
};
|
|
80
|
+
}, [k, D]), [Ee, be] = Oe(), H = e.useCallback(
|
|
87
81
|
() => x.current && x.current.parentElement,
|
|
88
82
|
[]
|
|
89
83
|
), M = () => {
|
|
@@ -125,39 +119,33 @@ const et = e.forwardRef((X, Y) => {
|
|
|
125
119
|
});
|
|
126
120
|
},
|
|
127
121
|
[b]
|
|
128
|
-
), we = e.useCallback(
|
|
129
|
-
(t)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
endX: s,
|
|
156
|
-
endY: a
|
|
157
|
-
});
|
|
158
|
-
},
|
|
159
|
-
[]
|
|
160
|
-
), ke = e.useCallback(
|
|
122
|
+
), we = e.useCallback((t) => {
|
|
123
|
+
const n = (c.current && c.current.ownerDocument ? c.current.ownerDocument : document).elementFromPoint(t.clientX, t.clientY), o = c.current;
|
|
124
|
+
if (!n || !n.parentElement || !o)
|
|
125
|
+
return;
|
|
126
|
+
const l = o.parentElement, s = o.firstElementChild;
|
|
127
|
+
if (!l || !s)
|
|
128
|
+
return;
|
|
129
|
+
const a = n.getAttribute(S);
|
|
130
|
+
if (a) {
|
|
131
|
+
const Ie = o.offsetTop, Le = o.offsetLeft, Fe = l.offsetTop, Ge = l.offsetLeft, Me = s.scrollTop, Se = s.scrollLeft;
|
|
132
|
+
R.current = Le + Ge, h.current = Ie + Fe, C.current = t.clientX - R.current + Se, g.current = t.clientY - h.current + Me, f.current = n.parentElement.getAttribute(A), T.current = a;
|
|
133
|
+
}
|
|
134
|
+
}, []), He = e.useCallback((t) => {
|
|
135
|
+
const r = c.current;
|
|
136
|
+
if (!r)
|
|
137
|
+
return;
|
|
138
|
+
const n = r.firstElementChild;
|
|
139
|
+
if (!n)
|
|
140
|
+
return;
|
|
141
|
+
const o = n.scrollTop, l = n.scrollLeft, s = t.clientX - R.current + l, a = t.clientY - h.current + o;
|
|
142
|
+
Math.abs(C.current - s) < 10 && Math.abs(g.current - a) < 10 || w({
|
|
143
|
+
startX: C.current,
|
|
144
|
+
startY: g.current,
|
|
145
|
+
endX: s,
|
|
146
|
+
endY: a
|
|
147
|
+
});
|
|
148
|
+
}, []), ke = e.useCallback(
|
|
161
149
|
(t) => {
|
|
162
150
|
const n = (c.current && c.current.ownerDocument ? c.current.ownerDocument : document).elementFromPoint(t.clientX, t.clientY);
|
|
163
151
|
if (!n || !n.parentElement)
|
|
@@ -216,7 +204,10 @@ const et = e.forwardRef((X, Y) => {
|
|
|
216
204
|
onKeyDown: le,
|
|
217
205
|
onSelectionChange: ce,
|
|
218
206
|
onHeaderSelectionChange: ae,
|
|
219
|
-
tableProps: {
|
|
207
|
+
tableProps: {
|
|
208
|
+
style: { width: he },
|
|
209
|
+
className: "k-table k-table-md k-table-layout-fixed"
|
|
210
|
+
},
|
|
220
211
|
noRecords: _,
|
|
221
212
|
rowHeight: ie,
|
|
222
213
|
resizable: z,
|
|
@@ -228,7 +219,26 @@ const et = e.forwardRef((X, Y) => {
|
|
|
228
219
|
columnMenu: B,
|
|
229
220
|
row: j,
|
|
230
221
|
selectable: q,
|
|
231
|
-
afterContent: /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
222
|
+
afterContent: /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
223
|
+
"svg",
|
|
224
|
+
{
|
|
225
|
+
className: "k-gantt-dependencies-svg",
|
|
226
|
+
ref: p,
|
|
227
|
+
style: { left: 0, top: 0 }
|
|
228
|
+
},
|
|
229
|
+
de.map((t) => /* @__PURE__ */ e.createElement(
|
|
230
|
+
$e,
|
|
231
|
+
{
|
|
232
|
+
key: Ze(fe.id)(t),
|
|
233
|
+
dependency: t
|
|
234
|
+
}
|
|
235
|
+
))
|
|
236
|
+
), /* @__PURE__ */ e.createElement("svg", { className: "k-gantt-dependencies-svg", style: { left: 0, top: 0, zIndex: 3 } }, d && /* @__PURE__ */ e.createElement(
|
|
237
|
+
"polyline",
|
|
238
|
+
{
|
|
239
|
+
points: `${d.startX},${d.startY} ${d.endX},${d.endY}`
|
|
240
|
+
}
|
|
241
|
+
)), y && y.length ? ge : null)
|
|
232
242
|
}
|
|
233
243
|
))
|
|
234
244
|
);
|