@progress/kendo-react-gantt 7.2.4-develop.2 → 7.2.4-develop.4

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.
Files changed (151) hide show
  1. package/Gantt.js +8 -0
  2. package/Gantt.mjs +411 -0
  3. package/cells/FilterCells/GanttBooleanFilter.js +8 -0
  4. package/cells/FilterCells/GanttBooleanFilter.mjs +27 -0
  5. package/cells/FilterCells/GanttDateFilter.js +8 -0
  6. package/cells/FilterCells/GanttDateFilter.mjs +27 -0
  7. package/cells/FilterCells/GanttNumericFilter.js +8 -0
  8. package/cells/FilterCells/GanttNumericFilter.mjs +27 -0
  9. package/cells/FilterCells/GanttTextFilter.js +8 -0
  10. package/cells/FilterCells/GanttTextFilter.mjs +27 -0
  11. package/cells/FilterCells/utils.js +8 -0
  12. package/cells/FilterCells/utils.mjs +59 -0
  13. package/components/BaseView.js +8 -0
  14. package/components/BaseView.mjs +239 -0
  15. package/components/GanttDependency.js +8 -0
  16. package/components/GanttDependency.mjs +58 -0
  17. package/components/GanttTask.js +8 -0
  18. package/components/GanttTask.mjs +169 -0
  19. package/components/GanttTreelist.js +8 -0
  20. package/components/GanttTreelist.mjs +571 -0
  21. package/components/toolbar/AddButton.js +8 -0
  22. package/components/toolbar/AddButton.mjs +56 -0
  23. package/components/toolbar/Toolbar.js +8 -0
  24. package/components/toolbar/Toolbar.mjs +34 -0
  25. package/components/toolbar/view-selector/ViewSelector.js +8 -0
  26. package/components/toolbar/view-selector/ViewSelector.mjs +32 -0
  27. package/components/toolbar/view-selector/ViewSelectorItem.js +8 -0
  28. package/components/toolbar/view-selector/ViewSelectorItem.mjs +39 -0
  29. package/components/toolbar/view-selector/ViewSelectorList.js +8 -0
  30. package/components/toolbar/view-selector/ViewSelectorList.mjs +36 -0
  31. package/constants/index.js +8 -0
  32. package/constants/index.mjs +52 -0
  33. package/context/GanttContext.js +8 -0
  34. package/context/GanttContext.mjs +103 -0
  35. package/context/GanttViewContext.js +8 -0
  36. package/context/GanttViewContext.mjs +38 -0
  37. package/dist/cdn/js/kendo-react-gantt.js +8 -5
  38. package/editors/FormDateTimePicker.js +8 -0
  39. package/editors/FormDateTimePicker.mjs +29 -0
  40. package/editors/FormDropDownList.js +8 -0
  41. package/editors/FormDropDownList.mjs +62 -0
  42. package/editors/FormInput.js +8 -0
  43. package/editors/FormInput.mjs +29 -0
  44. package/editors/FormNumericTextBox.js +8 -0
  45. package/editors/FormNumericTextBox.mjs +30 -0
  46. package/editors/GanttEditor.js +8 -0
  47. package/editors/GanttEditor.mjs +260 -0
  48. package/editors/GanttEditorPredecessors.js +8 -0
  49. package/editors/GanttEditorPredecessors.mjs +121 -0
  50. package/editors/GanttEditorSuccessors.js +8 -0
  51. package/editors/GanttEditorSuccessors.mjs +121 -0
  52. package/editors/GanttForm.js +8 -0
  53. package/editors/GanttForm.mjs +113 -0
  54. package/editors/GanttRemoveDialog.js +8 -0
  55. package/editors/GanttRemoveDialog.mjs +49 -0
  56. package/hooks/useControlledState.js +8 -0
  57. package/hooks/useControlledState.mjs +21 -0
  58. package/hooks/useDictionaryStore.js +8 -0
  59. package/hooks/useDictionaryStore.mjs +30 -0
  60. package/hooks/useGanttTask.js +8 -0
  61. package/hooks/useGanttTask.mjs +35 -0
  62. package/index.d.mts +1394 -5
  63. package/index.d.ts +1394 -32
  64. package/index.js +8 -5
  65. package/index.mjs +50 -3087
  66. package/interfaces/DependencyType.js +8 -0
  67. package/interfaces/DependencyType.mjs +12 -0
  68. package/messages/index.js +8 -0
  69. package/messages/index.mjs +137 -0
  70. package/package-metadata.js +8 -0
  71. package/package-metadata.mjs +19 -0
  72. package/package.json +12 -12
  73. package/rows/GanttRow.js +8 -0
  74. package/rows/GanttRow.mjs +13 -0
  75. package/utils/data-operations.js +8 -0
  76. package/utils/data-operations.mjs +183 -0
  77. package/utils/index.js +8 -0
  78. package/utils/index.mjs +263 -0
  79. package/views/GanttDayView.js +8 -0
  80. package/views/GanttDayView.mjs +94 -0
  81. package/views/GanttMonthView.js +8 -0
  82. package/views/GanttMonthView.mjs +82 -0
  83. package/views/GanttWeekView.js +8 -0
  84. package/views/GanttWeekView.mjs +81 -0
  85. package/views/GanttYearView.js +8 -0
  86. package/views/GanttYearView.mjs +73 -0
  87. package/Gantt.d.ts +0 -29
  88. package/cells/FilterCells/GanttBooleanFilter.d.ts +0 -14
  89. package/cells/FilterCells/GanttDateFilter.d.ts +0 -14
  90. package/cells/FilterCells/GanttNumericFilter.d.ts +0 -14
  91. package/cells/FilterCells/GanttTextFilter.d.ts +0 -14
  92. package/cells/FilterCells/utils.d.ts +0 -42
  93. package/components/BaseView.d.ts +0 -24
  94. package/components/GanttDependency.d.ts +0 -13
  95. package/components/GanttTask.d.ts +0 -16
  96. package/components/GanttTreelist.d.ts +0 -143
  97. package/components/toolbar/AddButton.d.ts +0 -16
  98. package/components/toolbar/Toolbar.d.ts +0 -25
  99. package/components/toolbar/view-selector/ViewSelector.d.ts +0 -28
  100. package/components/toolbar/view-selector/ViewSelectorItem.d.ts +0 -15
  101. package/components/toolbar/view-selector/ViewSelectorList.d.ts +0 -7
  102. package/constants/index.d.ts +0 -57
  103. package/context/GanttContext.d.ts +0 -125
  104. package/context/GanttViewContext.d.ts +0 -44
  105. package/editors/FormDateTimePicker.d.ts +0 -9
  106. package/editors/FormDropDownList.d.ts +0 -9
  107. package/editors/FormInput.d.ts +0 -9
  108. package/editors/FormNumericTextBox.d.ts +0 -9
  109. package/editors/GanttEditor.d.ts +0 -21
  110. package/editors/GanttEditorPredecessors.d.ts +0 -25
  111. package/editors/GanttEditorSuccessors.d.ts +0 -25
  112. package/editors/GanttForm.d.ts +0 -70
  113. package/editors/GanttRemoveDialog.d.ts +0 -48
  114. package/hooks/useControlledState.d.ts +0 -8
  115. package/hooks/useDictionaryStore.d.ts +0 -22
  116. package/hooks/useGanttTask.d.ts +0 -8
  117. package/interfaces/AddDirection.d.ts +0 -10
  118. package/interfaces/DataItem.d.ts +0 -10
  119. package/interfaces/DateRange.d.ts +0 -12
  120. package/interfaces/DependencyModelFields.d.ts +0 -29
  121. package/interfaces/DependencyType.d.ts +0 -19
  122. package/interfaces/GanttBaseProps.d.ts +0 -66
  123. package/interfaces/GanttCellProps.d.ts +0 -45
  124. package/interfaces/GanttColumnProps.d.ts +0 -40
  125. package/interfaces/GanttDependency.d.ts +0 -30
  126. package/interfaces/GanttDependencyModelFields.d.ts +0 -29
  127. package/interfaces/GanttFilterCellProps.d.ts +0 -10
  128. package/interfaces/GanttFilterOperator.d.ts +0 -10
  129. package/interfaces/GanttHeaderCellProps.d.ts +0 -10
  130. package/interfaces/GanttNoRecordsProps.d.ts +0 -13
  131. package/interfaces/GanttProps.d.ts +0 -151
  132. package/interfaces/GanttRowProps.d.ts +0 -95
  133. package/interfaces/GanttSelectableSettings.d.ts +0 -22
  134. package/interfaces/GanttSlotType.d.ts +0 -8
  135. package/interfaces/GanttSortSettings.d.ts +0 -17
  136. package/interfaces/GanttTaskModelFields.d.ts +0 -64
  137. package/interfaces/GanttView.d.ts +0 -80
  138. package/interfaces/GanttViewTimelineHeaderCellProps.d.ts +0 -23
  139. package/interfaces/Rectangle.d.ts +0 -10
  140. package/interfaces/Slot.d.ts +0 -16
  141. package/interfaces/TaskModelFields.d.ts +0 -20
  142. package/interfaces/events.d.ts +0 -298
  143. package/messages/index.d.ts +0 -194
  144. package/package-metadata.d.ts +0 -9
  145. package/rows/GanttRow.d.ts +0 -8
  146. package/utils/data-operations.d.ts +0 -47
  147. package/utils/index.d.ts +0 -182
  148. package/views/GanttDayView.d.ts +0 -21
  149. package/views/GanttMonthView.d.ts +0 -17
  150. package/views/GanttWeekView.d.ts +0 -17
  151. package/views/GanttYearView.d.ts +0 -17
@@ -0,0 +1,263 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as u from "react";
10
+ import { mapTree as _, extendDataItem as x, getter as h, classNames as y } from "@progress/kendo-react-common";
11
+ import { MS_PER_MINUTE as A, MS_PER_DAY as E, getDate as S, addDays as L, ZonedDate as g, firstDayInWeek as N, addMonths as z } from "@progress/kendo-date-math";
12
+ import { orderBy as b, filterBy as C } from "@progress/kendo-react-data-tools";
13
+ import { createDataTree as I } from "@progress/kendo-react-treelist";
14
+ import { DEFAULT_TASK_MODEL_FIELDS as H, DEFAULT_DEPENDENCY_MODEL_FIELDS as O, HOUR_DATE_FORMAT as F, DAY_DATE_FORMAT as p, MONTH_DATE_FORMAT as B, YEAR_DATE_FORMAT as U, DAYS_IN_WEEK_COUNT as Y } from "../constants/index.mjs";
15
+ const ne = b, ae = C, re = _, oe = x, se = I, de = (e) => ({ fields: { ...H, ...e } }), ce = (e) => ({ fields: { ...O, ...e } }), me = (e) => S(e), $ = (e, t) => S(L(e, t || 1)), ie = (e, t, n, o) => n < t && e <= o;
16
+ function R(e) {
17
+ return new Date(Date.UTC(
18
+ e.getFullYear(),
19
+ e.getMonth(),
20
+ e.getDate(),
21
+ e.getHours(),
22
+ e.getMinutes(),
23
+ e.getSeconds(),
24
+ e.getMilliseconds()
25
+ ));
26
+ }
27
+ const D = 4, k = 10, ge = (e, t, n, o) => {
28
+ const r = [];
29
+ let s = 0, a = 0;
30
+ const d = k, m = Math.floor(n / 2), T = e.top < t.top, i = () => r.push({ left: a, top: s });
31
+ if (o === 0 || o === 3) {
32
+ const c = o === 3 ? "start" : "end";
33
+ s = e.top, a = e[c], i(), a = Math[c === "start" ? "min" : "max"](e[c], t[c]), a = c === "start" ? a - d : a + d, i(), s = t.top, i(), a = c === "start" ? t[c] - D : t[c] + D, i(), w(s, a, r, c !== "start");
34
+ } else {
35
+ const c = o === 2 ? "start" : "end", l = o === 2 ? "end" : "start", f = o === 2 ? e[c] - k * 2 >= t[l] : e[c] + k * 2 <= t[l];
36
+ s = e.top, a = e[c], i(), a = c === "start" ? a - d : a + d, i(), f || (s = T ? s + m : s - m, i(), a = c === "start" ? t[l] + d : t[l] - d, i()), s = t.top, i(), a = l === "start" ? t[l] - D : t[l] + D, i(), w(s, a, r, l !== "start");
37
+ }
38
+ return r;
39
+ }, w = (e, t, n, o) => o ? P(e, t, n) : K(e, t, n), P = (e, t, n) => {
40
+ n.push({
41
+ top: e - D / 2,
42
+ left: t
43
+ }), n.push({
44
+ top: e,
45
+ left: t - D + 1
46
+ }), n.push({
47
+ top: e + D / 2,
48
+ left: t
49
+ }), n.push({
50
+ top: e,
51
+ left: t
52
+ });
53
+ }, K = (e, t, n) => {
54
+ n.push({
55
+ top: e + D / 2,
56
+ left: t
57
+ }), n.push({
58
+ top: e,
59
+ left: t + D - 1
60
+ }), n.push({
61
+ top: e - D / 2,
62
+ left: t
63
+ }), n.push({
64
+ top: e,
65
+ left: t
66
+ });
67
+ }, le = (e) => {
68
+ if (e.workWeekStart === void 0 || e.workWeekEnd === void 0)
69
+ return [];
70
+ const t = [];
71
+ let n = e.workWeekStart;
72
+ for (t.push(n); e.workWeekEnd !== n; )
73
+ n > 6 ? n -= 7 : n++, t.push(n);
74
+ return t;
75
+ }, Z = (e, t) => {
76
+ const n = e.getDay();
77
+ return t.indexOf(n) > -1;
78
+ }, M = (e, { step: t, timezone: n }) => {
79
+ const o = [], r = g.fromLocalDate(e.start, n), s = g.fromLocalDate(e.end, n);
80
+ let a = r.clone();
81
+ for (; a.getTime() < s.getTime(); ) {
82
+ const d = a.clone(), m = d.clone().addTime(t), T = new Date(d.getTime()), c = {
83
+ end: new Date(m.getTime()),
84
+ start: T,
85
+ zonedStart: d,
86
+ zonedEnd: m
87
+ };
88
+ o.push(c), a = a.addTime(t);
89
+ }
90
+ return o;
91
+ }, v = (e, { timezone: t }, n) => {
92
+ const o = [], r = g.fromLocalDate(e.start, t), s = g.fromLocalDate(e.end, t);
93
+ for (let a = r.clone(), d = 0; a.getTime() < s.getTime(); d++) {
94
+ const m = a.clone(), T = $(N(S(m), n.firstDay()), Y), i = g.fromUTCDate(R(T), t), c = i.getTime() > s.getTime() ? s.clone() : i;
95
+ a = c.clone();
96
+ const l = new Date(m.getTime()), W = {
97
+ end: new Date(c.getTime()),
98
+ start: l,
99
+ zonedStart: m,
100
+ zonedEnd: c
101
+ };
102
+ o.push(W);
103
+ }
104
+ return o;
105
+ }, j = (e, { timezone: t }) => {
106
+ const n = [], o = g.fromLocalDate(e.start, t), r = g.fromLocalDate(e.end, t);
107
+ for (let s = o.clone(), a = 0; s.getTime() < r.getTime(); a++) {
108
+ const d = s.clone(), m = g.fromLocalDate(z(new Date(d.getTime()), 1), t);
109
+ s = m.clone();
110
+ const T = new Date(d.getTime()), c = {
111
+ end: new Date(m.getTime()),
112
+ start: T,
113
+ zonedStart: d,
114
+ zonedEnd: m
115
+ };
116
+ n.push(c);
117
+ }
118
+ return n;
119
+ }, q = (e, { timezone: t }) => {
120
+ const n = [], o = g.fromLocalDate(e.start, t), r = g.fromLocalDate(e.end, t);
121
+ for (let s = o.clone(), a = 0; s.getTime() < r.getTime(); a++) {
122
+ const d = s.clone(), m = g.fromLocalDate(z(new Date(d.getTime()), 12), t);
123
+ s = m.clone();
124
+ const T = new Date(d.getTime()), c = {
125
+ end: new Date(m.getTime()),
126
+ start: T,
127
+ zonedStart: d,
128
+ zonedEnd: m
129
+ };
130
+ n.push(c);
131
+ }
132
+ return n;
133
+ }, De = (e, t, n) => {
134
+ const o = n.parseDate(t.workDayStart).getHours(), r = n.parseDate(t.workDayEnd).getHours();
135
+ return M(e, { step: A * t.slotDuration, timezone: t.timezone }).map((a) => {
136
+ const d = a.zonedStart.getHours();
137
+ return {
138
+ range: a,
139
+ isWork: d >= o && d < r,
140
+ span: 1,
141
+ text: n.formatDate(a.zonedStart, F),
142
+ type: "time"
143
+ };
144
+ });
145
+ }, Te = (e, t, n) => M(e, { step: E, timezone: t.timezone }).map((r) => ({
146
+ range: r,
147
+ isWork: Z(r.start, t.workDays),
148
+ span: 1,
149
+ text: n.formatDate(r.zonedStart, p),
150
+ type: "day"
151
+ })), ue = (e, t, n) => v(e, { timezone: t.timezone }, n).map((r) => {
152
+ const s = Math.round((r.zonedEnd.getTime() - r.zonedStart.getTime()) / E);
153
+ return {
154
+ range: r,
155
+ isWork: !1,
156
+ span: s,
157
+ text: `${n.formatDate(r.zonedStart, p)} - ${n.formatDate(r.zonedEnd, p)}`,
158
+ type: "week"
159
+ };
160
+ }), Ee = (e, t, n) => j(e, { timezone: t.timezone }).map((r) => {
161
+ const s = Math.round((r.zonedEnd.getTime() - r.zonedStart.getTime()) / E);
162
+ return {
163
+ range: r,
164
+ isWork: !1,
165
+ span: s,
166
+ text: n.formatDate(r.zonedStart, B),
167
+ type: "month"
168
+ };
169
+ }), ke = (e, t, n) => q(e, { timezone: t.timezone }).map((r) => {
170
+ const s = Math.round((r.zonedEnd.getTime() - r.zonedStart.getTime()) / E);
171
+ return {
172
+ range: r,
173
+ isWork: !1,
174
+ span: s,
175
+ text: n.formatDate(r.zonedStart, U),
176
+ type: "year"
177
+ };
178
+ }), pe = (e, t, n) => {
179
+ const o = n;
180
+ return /* @__PURE__ */ u.createElement("table", { className: "k-table k-table-md", ref: t, "aria-hidden": !0 }, /* @__PURE__ */ u.createElement("tbody", { className: "k-table-tbody" }, e.map((r, s) => /* @__PURE__ */ u.createElement("tr", { className: "k-table-row", key: s }, r.map((a, d) => /* @__PURE__ */ u.createElement(
181
+ "td",
182
+ {
183
+ key: a.range.start.getTime(),
184
+ colSpan: a.span,
185
+ className: y(
186
+ "k-table-th",
187
+ {
188
+ "k-header": !0,
189
+ "k-nonwork-hour": !a.isWork
190
+ }
191
+ )
192
+ },
193
+ o ? /* @__PURE__ */ u.createElement(
194
+ o,
195
+ {
196
+ rowIndex: s,
197
+ index: d,
198
+ range: a.range,
199
+ text: a.text,
200
+ isWork: a.isWork,
201
+ type: a.type
202
+ }
203
+ ) : a.text
204
+ ))))));
205
+ }, he = (e, t) => {
206
+ const n = e[e.length - 1];
207
+ return /* @__PURE__ */ u.createElement("table", { className: "k-table k-table-md k-gantt-columns", ref: t, "aria-hidden": !0 }, /* @__PURE__ */ u.createElement("tbody", { className: "k-table-tbody" }, /* @__PURE__ */ u.createElement("tr", { className: "k-table-row" }, n.map((o) => /* @__PURE__ */ u.createElement(
208
+ "td",
209
+ {
210
+ key: o.range.start.getTime(),
211
+ colSpan: o.span,
212
+ className: y(
213
+ "k-table-td",
214
+ {
215
+ "k-nonwork-hour": !o.isWork
216
+ }
217
+ )
218
+ }
219
+ )))));
220
+ }, Se = (e, t) => {
221
+ const n = e[e.length - 1];
222
+ let o = 0, r = 0;
223
+ return n.forEach((s) => {
224
+ const a = s.span;
225
+ r += a, a > o && (o = a);
226
+ }), Math.round(r * t / o);
227
+ }, G = (e, t) => !!h(t)(e), J = (e, t) => !!h(t)(e), fe = (e, t) => (n) => G(n, e) && J(n, t) ? [...h(t)(n)] : [];
228
+ export {
229
+ D as ARROW_SIZE,
230
+ k as MIN_LINE_WIDTH,
231
+ w as addArrow,
232
+ K as addArrowEast,
233
+ P as addArrowWest,
234
+ se as createDataTree,
235
+ ge as dependencyCoordinates,
236
+ fe as expandedChildren,
237
+ oe as extendDataItem,
238
+ ae as filterBy,
239
+ Te as getDaySlots,
240
+ ce as getDependencyModelFields,
241
+ $ as getEndDate,
242
+ De as getHourSlots,
243
+ Ee as getMonthSlots,
244
+ me as getStartDate,
245
+ de as getTaskModelFields,
246
+ he as getTimelineContent,
247
+ pe as getTimelineHeader,
248
+ Se as getTimelineWidth,
249
+ ue as getWeekSlots,
250
+ le as getWorkDays,
251
+ ke as getYearSlots,
252
+ J as hasChildren,
253
+ G as isExpanded,
254
+ ie as isInRange,
255
+ Z as isWorkDay,
256
+ re as mapTree,
257
+ ne as orderBy,
258
+ j as toMonthRanges,
259
+ M as toRanges,
260
+ R as toUTCDateTime,
261
+ v as toWeekRanges,
262
+ q as toYearRanges
263
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),t=require("prop-types"),k=require("@progress/kendo-date-math"),P=require("../components/BaseView.js"),s=require("../utils/index.js"),h=require("../context/GanttContext.js"),S=require("../messages/index.js"),I=require("@progress/kendo-react-intl"),j=require("../constants/index.js");function x(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const o=x(O),w=o.forwardRef((e,r)=>{const{slotWidth:n=a.slotWidth,slotDuration:i=a.slotDuration,firstSlotRangeRef:D,timelineHeaderCell:f}=e,{timezone:l}=h.useGanttPropsContext(),c=I.useInternationalization(),u=o.useRef(null),g=o.useRef(null),C=o.useCallback(m=>{g.current&&g.current.scrollIntoView(m)},[]);o.useImperativeHandle(u,()=>({scrollIntoView:C})),o.useImperativeHandle(r,()=>u.current);const y=h.useGanttDateRangeContext(),T=e.workWeekStart||a.workWeekStart,p=e.workWeekEnd||a.workWeekEnd,E=e.workDayStart||a.workDayStart,W=e.workDayEnd||a.workDayEnd,q=o.useMemo(()=>{const m=s.getWorkDays({workWeekStart:T,workWeekEnd:p}),d=[],b=s.getDaySlots(y,{workDays:m,timezone:l},c);return b.forEach(R=>{const V=s.getHourSlots(R.range,{workDayStart:E,workDayEnd:W,timezone:l,slotDuration:i},c);R.span=V.length,d.push.apply(d,V)}),D&&d[0]&&(D.current=d[0].range),[b,d]},[l,y.start.getTime(),y.end.getTime(),c,T,p,E,W]);return o.createElement(P.BaseView,{ref:g,slotWidth:n,slotLevels:q,timelineHeaderCell:f})}),G=({tasksStart:e,tasksEnd:r,timezone:n})=>{const i=k.ZonedDate.fromLocalDate(e,n),D=k.ZonedDate.fromLocalDate(r,n),f=s.getStartDate(i),l=s.getEndDate(D),c=k.ZonedDate.fromUTCDate(s.toUTCDateTime(f),n),u=k.ZonedDate.fromUTCDate(s.toUTCDateTime(l),n);return{start:new Date(c.getTime()),end:new Date(u.getTime()),zonedStart:c,zonedEnd:u}},a={name:"day",dateRange:G,title:e=>e.toLanguageString(S.dayViewTitle,S.messages[S.dayViewTitle]),slotWidth:j.DEFAULT_COLUMN_WIDTH,slotDuration:60,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};w.defaultProps=a;w.propTypes={name:t.string,dateRange:t.oneOfType([t.func,t.object]),title:t.oneOfType([t.string,t.func]),slotWidth:t.number,slotDuration:t.number,workWeekStart:t.number,workWeekEnd:t.number,workDayStart:t.string,workDayEnd:t.string};w.displayName="KendoReactGanttDayView";exports.GanttDayView=w;exports.defaultProps=a;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as o from "react";
10
+ import t from "prop-types";
11
+ import { ZonedDate as d } from "@progress/kendo-date-math";
12
+ import { BaseView as I } from "../components/BaseView.mjs";
13
+ import { getWorkDays as L, getDaySlots as H, getHourSlots as U, getStartDate as G, getEndDate as P, toUTCDateTime as h } from "../utils/index.mjs";
14
+ import { useGanttPropsContext as v, useGanttDateRangeContext as x } from "../context/GanttContext.mjs";
15
+ import { dayViewTitle as V, messages as z } from "../messages/index.mjs";
16
+ import { useInternationalization as O } from "@progress/kendo-react-intl";
17
+ import { DEFAULT_COLUMN_WIDTH as M } from "../constants/index.mjs";
18
+ const g = o.forwardRef((e, m) => {
19
+ const { slotWidth: n = r.slotWidth, slotDuration: u = r.slotDuration, firstSlotRangeRef: c, timelineHeaderCell: k } = e, { timezone: s } = v(), a = O(), i = o.useRef(null), D = o.useRef(null), C = o.useCallback(
20
+ (f) => {
21
+ D.current && D.current.scrollIntoView(f);
22
+ },
23
+ []
24
+ );
25
+ o.useImperativeHandle(i, () => ({ scrollIntoView: C })), o.useImperativeHandle(m, () => i.current);
26
+ const w = x(), y = e.workWeekStart || r.workWeekStart, p = e.workWeekEnd || r.workWeekEnd, S = e.workDayStart || r.workDayStart, T = e.workDayEnd || r.workDayEnd, b = o.useMemo(
27
+ () => {
28
+ const f = L({
29
+ workWeekStart: y,
30
+ workWeekEnd: p
31
+ }), l = [], E = H(w, { workDays: f, timezone: s }, a);
32
+ return E.forEach((W) => {
33
+ const R = U(
34
+ W.range,
35
+ {
36
+ workDayStart: S,
37
+ workDayEnd: T,
38
+ timezone: s,
39
+ slotDuration: u
40
+ },
41
+ a
42
+ );
43
+ W.span = R.length, l.push.apply(l, R);
44
+ }), c && l[0] && (c.current = l[0].range), [E, l];
45
+ },
46
+ [s, w.start.getTime(), w.end.getTime(), a, y, p, S, T]
47
+ );
48
+ return /* @__PURE__ */ o.createElement(
49
+ I,
50
+ {
51
+ ref: D,
52
+ slotWidth: n,
53
+ slotLevels: b,
54
+ timelineHeaderCell: k
55
+ }
56
+ );
57
+ }), N = ({ tasksStart: e, tasksEnd: m, timezone: n }) => {
58
+ const u = d.fromLocalDate(e, n), c = d.fromLocalDate(m, n), k = G(u), s = P(c), a = d.fromUTCDate(h(k), n), i = d.fromUTCDate(h(s), n);
59
+ return {
60
+ // Sat May 31 2014 07:00:00 GMT+0300 (Eastern European Summer Time)
61
+ start: new Date(a.getTime()),
62
+ end: new Date(i.getTime()),
63
+ // Sat May 31 2014 00:00:00 GMT-0400 (EDT)
64
+ zonedStart: a,
65
+ zonedEnd: i
66
+ };
67
+ }, r = {
68
+ name: "day",
69
+ dateRange: N,
70
+ title: (e) => e.toLanguageString(V, z[V]),
71
+ slotWidth: M,
72
+ slotDuration: 60,
73
+ workWeekStart: 1,
74
+ workWeekEnd: 5,
75
+ workDayStart: "08:00",
76
+ workDayEnd: "17:00"
77
+ };
78
+ g.defaultProps = r;
79
+ g.propTypes = {
80
+ name: t.string,
81
+ dateRange: t.oneOfType([t.func, t.object]),
82
+ title: t.oneOfType([t.string, t.func]),
83
+ slotWidth: t.number,
84
+ slotDuration: t.number,
85
+ workWeekStart: t.number,
86
+ workWeekEnd: t.number,
87
+ workDayStart: t.string,
88
+ workDayEnd: t.string
89
+ };
90
+ g.displayName = "KendoReactGanttDayView";
91
+ export {
92
+ g as GanttDayView,
93
+ r as defaultProps
94
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),e=require("prop-types"),o=require("@progress/kendo-date-math"),V=require("../components/BaseView.js"),f=require("../utils/index.js"),k=require("../context/GanttContext.js"),M=require("../constants/index.js"),w=require("../messages/index.js"),O=require("@progress/kendo-react-intl");function C(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const r=C(R),g=r.forwardRef((t,a)=>{const{slotWidth:n=p.slotWidth,firstSlotRangeRef:s,timelineHeaderCell:m}=t,{timezone:l}=k.useGanttPropsContext(),u=O.useInternationalization(),d=r.useRef(null),c=r.useRef(null),y=r.useCallback(i=>{c.current&&c.current.scrollIntoView(i)},[]);r.useImperativeHandle(d,()=>({scrollIntoView:y})),r.useImperativeHandle(a,()=>d.current);const D=k.useGanttDateRangeContext(),h=r.useMemo(()=>{const i=[],T=f.getMonthSlots(D,{timezone:l},u);return T.forEach(S=>{const b=f.getWeekSlots(S.range,{timezone:l},u);i.push.apply(i,b)}),s&&i[0]&&(s.current=i[0].range),[T,i]},[l,D.start.getTime(),D.end.getTime(),u]);return r.createElement(V.BaseView,{ref:c,slotWidth:n,slotLevels:h,timelineHeaderCell:m})}),W=({tasksStart:t,tasksEnd:a,timezone:n})=>{const s=o.ZonedDate.fromLocalDate(t,n),m=o.ZonedDate.fromLocalDate(a,n),l=o.firstDayOfMonth(o.getDate(s)),u=o.addDays(o.lastDayOfMonth(o.getDate(m)),1),d=o.ZonedDate.fromUTCDate(f.toUTCDateTime(l),n),c=o.ZonedDate.fromUTCDate(f.toUTCDateTime(u),n);return{start:new Date(d.getTime()),end:new Date(c.getTime()),zonedStart:d,zonedEnd:c}},p={name:"month",dateRange:W,title:t=>t.toLanguageString(w.monthViewTitle,w.messages[w.monthViewTitle]),slotWidth:M.DEFAULT_COLUMN_WIDTH,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};g.defaultProps=p;g.propTypes={name:e.string,dateRange:e.oneOfType([e.func,e.object]),title:e.oneOfType([e.string,e.func]),slotWidth:e.number,workWeekStart:e.number,workWeekEnd:e.number,workDayStart:e.string,workDayEnd:e.string};g.displayName="GanttMonthView";exports.GanttMonthView=g;exports.defaultProps=p;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as e from "react";
10
+ import t from "prop-types";
11
+ import { ZonedDate as c, firstDayOfMonth as W, getDate as w, addDays as E, lastDayOfMonth as V } from "@progress/kendo-date-math";
12
+ import { BaseView as C } from "../components/BaseView.mjs";
13
+ import { getMonthSlots as M, getWeekSlots as b, toUTCDateTime as D } from "../utils/index.mjs";
14
+ import { useGanttPropsContext as I, useGanttDateRangeContext as L } from "../context/GanttContext.mjs";
15
+ import { DEFAULT_COLUMN_WIDTH as O } from "../constants/index.mjs";
16
+ import { monthViewTitle as k, messages as U } from "../messages/index.mjs";
17
+ import { useInternationalization as G } from "@progress/kendo-react-intl";
18
+ const p = e.forwardRef((a, f) => {
19
+ const { slotWidth: n = T.slotWidth, firstSlotRangeRef: l, timelineHeaderCell: d } = a, { timezone: s } = I(), i = G(), m = e.useRef(null), r = e.useRef(null), h = e.useCallback(
20
+ (o) => {
21
+ r.current && r.current.scrollIntoView(o);
22
+ },
23
+ []
24
+ );
25
+ e.useImperativeHandle(m, () => ({ scrollIntoView: h })), e.useImperativeHandle(f, () => m.current);
26
+ const u = L(), y = e.useMemo(
27
+ () => {
28
+ const o = [], g = M(u, { timezone: s }, i);
29
+ return g.forEach((R) => {
30
+ const S = b(
31
+ R.range,
32
+ { timezone: s },
33
+ i
34
+ );
35
+ o.push.apply(o, S);
36
+ }), l && o[0] && (l.current = o[0].range), [g, o];
37
+ },
38
+ [s, u.start.getTime(), u.end.getTime(), i]
39
+ );
40
+ return /* @__PURE__ */ e.createElement(
41
+ C,
42
+ {
43
+ ref: r,
44
+ slotWidth: n,
45
+ slotLevels: y,
46
+ timelineHeaderCell: d
47
+ }
48
+ );
49
+ }), H = ({ tasksStart: a, tasksEnd: f, timezone: n }) => {
50
+ const l = c.fromLocalDate(a, n), d = c.fromLocalDate(f, n), s = W(w(l)), i = E(V(w(d)), 1), m = c.fromUTCDate(D(s), n), r = c.fromUTCDate(D(i), n);
51
+ return {
52
+ start: new Date(m.getTime()),
53
+ end: new Date(r.getTime()),
54
+ zonedStart: m,
55
+ zonedEnd: r
56
+ };
57
+ }, T = {
58
+ name: "month",
59
+ dateRange: H,
60
+ title: (a) => a.toLanguageString(k, U[k]),
61
+ slotWidth: O,
62
+ workWeekStart: 1,
63
+ workWeekEnd: 5,
64
+ workDayStart: "08:00",
65
+ workDayEnd: "17:00"
66
+ };
67
+ p.defaultProps = T;
68
+ p.propTypes = {
69
+ name: t.string,
70
+ dateRange: t.oneOfType([t.func, t.object]),
71
+ title: t.oneOfType([t.string, t.func]),
72
+ slotWidth: t.number,
73
+ workWeekStart: t.number,
74
+ workWeekEnd: t.number,
75
+ workDayStart: t.string,
76
+ workDayEnd: t.string
77
+ };
78
+ p.displayName = "GanttMonthView";
79
+ export {
80
+ p as GanttMonthView,
81
+ T as defaultProps
82
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("react"),t=require("prop-types"),a=require("@progress/kendo-date-math"),O=require("../components/BaseView.js"),i=require("../utils/index.js"),E=require("../context/GanttContext.js"),R=require("../constants/index.js"),T=require("../messages/index.js"),q=require("@progress/kendo-react-intl");function P(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(s,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return s.default=e,Object.freeze(s)}const o=P(I),D=o.forwardRef((e,s)=>{const{slotWidth:r=k.slotWidth,firstSlotRangeRef:n,timelineHeaderCell:g}=e,{timezone:l}=E.useGanttPropsContext(),u=q.useInternationalization(),f=o.useRef(null),c=o.useRef(null),w=o.useCallback(y=>{c.current&&c.current.scrollIntoView(y)},[]);o.useImperativeHandle(f,()=>({scrollIntoView:w})),o.useImperativeHandle(s,()=>f.current);const m=E.useGanttDateRangeContext(),W=e.workWeekStart||k.workWeekStart,S=e.workWeekEnd||k.workWeekEnd,b=o.useMemo(()=>{const y=i.getWorkDays({workWeekStart:W,workWeekEnd:S}),d=[],p=i.getWeekSlots(m,{timezone:l},u);return p.forEach(V=>{const C=i.getDaySlots(V.range,{workDays:y,timezone:l},u);d.push.apply(d,C)}),n&&d[0]&&(n.current=d[0].range),[p,d]},[l,m.start.getTime(),m.end.getTime(),u,W,S]);return o.createElement(O.BaseView,{ref:c,slotWidth:r,slotLevels:b,timelineHeaderCell:g})}),_=({intl:e,tasksStart:s,tasksEnd:r,timezone:n})=>{const g=a.ZonedDate.fromLocalDate(s,n),l=a.ZonedDate.fromLocalDate(r,n),u=i.getStartDate(a.firstDayInWeek(a.getDate(g),e.firstDay())),f=i.getEndDate(a.firstDayInWeek(a.getDate(l),e.firstDay()),R.DAYS_IN_WEEK_COUNT),c=a.ZonedDate.fromUTCDate(i.toUTCDateTime(u),n),w=a.ZonedDate.fromUTCDate(i.toUTCDateTime(f),n);return{start:new Date(c.getTime()),end:new Date(w.getTime()),zonedStart:c,zonedEnd:w}},k={name:"week",dateRange:_,title:e=>e.toLanguageString(T.weekViewTitle,T.messages[T.weekViewTitle]),slotWidth:R.DEFAULT_COLUMN_WIDTH,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};D.defaultProps=k;D.propTypes={name:t.string,dateRange:t.oneOfType([t.func,t.object]),title:t.oneOfType([t.string,t.func]),slotWidth:t.number,workWeekStart:t.number,workWeekEnd:t.number,workDayStart:t.string,workDayEnd:t.string};D.displayName="KendoReactGanttWeekView";exports.GanttWeekView=D;exports.defaultProps=k;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as o from "react";
10
+ import e from "prop-types";
11
+ import { ZonedDate as k, firstDayInWeek as T, getDate as S } from "@progress/kendo-date-math";
12
+ import { BaseView as b } from "../components/BaseView.mjs";
13
+ import { getWorkDays as h, getWeekSlots as L, getDaySlots as U, getStartDate as _, getEndDate as G, toUTCDateTime as E } from "../utils/index.mjs";
14
+ import { useGanttPropsContext as H, useGanttDateRangeContext as N } from "../context/GanttContext.mjs";
15
+ import { DEFAULT_COLUMN_WIDTH as O, DAYS_IN_WEEK_COUNT as P } from "../constants/index.mjs";
16
+ import { weekViewTitle as R, messages as v } from "../messages/index.mjs";
17
+ import { useInternationalization as x } from "@progress/kendo-react-intl";
18
+ const g = o.forwardRef((t, f) => {
19
+ const { slotWidth: d = m.slotWidth, firstSlotRangeRef: r, timelineHeaderCell: w } = t, { timezone: a } = H(), s = x(), c = o.useRef(null), n = o.useRef(null), l = o.useCallback(
20
+ (D) => {
21
+ n.current && n.current.scrollIntoView(D);
22
+ },
23
+ []
24
+ );
25
+ o.useImperativeHandle(c, () => ({ scrollIntoView: l })), o.useImperativeHandle(f, () => c.current);
26
+ const u = N(), p = t.workWeekStart || m.workWeekStart, W = t.workWeekEnd || m.workWeekEnd, C = o.useMemo(
27
+ () => {
28
+ const D = h({
29
+ workWeekStart: p,
30
+ workWeekEnd: W
31
+ }), i = [], y = L(u, { timezone: a }, s);
32
+ return y.forEach((V) => {
33
+ const I = U(V.range, { workDays: D, timezone: a }, s);
34
+ i.push.apply(i, I);
35
+ }), r && i[0] && (r.current = i[0].range), [y, i];
36
+ },
37
+ [a, u.start.getTime(), u.end.getTime(), s, p, W]
38
+ );
39
+ return /* @__PURE__ */ o.createElement(
40
+ b,
41
+ {
42
+ ref: n,
43
+ slotWidth: d,
44
+ slotLevels: C,
45
+ timelineHeaderCell: w
46
+ }
47
+ );
48
+ }), z = ({ intl: t, tasksStart: f, tasksEnd: d, timezone: r }) => {
49
+ const w = k.fromLocalDate(f, r), a = k.fromLocalDate(d, r), s = _(T(S(w), t.firstDay())), c = G(T(S(a), t.firstDay()), P), n = k.fromUTCDate(E(s), r), l = k.fromUTCDate(E(c), r);
50
+ return {
51
+ start: new Date(n.getTime()),
52
+ end: new Date(l.getTime()),
53
+ zonedStart: n,
54
+ zonedEnd: l
55
+ };
56
+ }, m = {
57
+ name: "week",
58
+ dateRange: z,
59
+ title: (t) => t.toLanguageString(R, v[R]),
60
+ slotWidth: O,
61
+ workWeekStart: 1,
62
+ workWeekEnd: 5,
63
+ workDayStart: "08:00",
64
+ workDayEnd: "17:00"
65
+ };
66
+ g.defaultProps = m;
67
+ g.propTypes = {
68
+ name: e.string,
69
+ dateRange: e.oneOfType([e.func, e.object]),
70
+ title: e.oneOfType([e.string, e.func]),
71
+ slotWidth: e.number,
72
+ workWeekStart: e.number,
73
+ workWeekEnd: e.number,
74
+ workDayStart: e.string,
75
+ workDayEnd: e.string
76
+ };
77
+ g.displayName = "KendoReactGanttWeekView";
78
+ export {
79
+ g as GanttWeekView,
80
+ m as defaultProps
81
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),a=require("prop-types"),n=require("@progress/kendo-date-math"),S=require("../components/BaseView.js"),g=require("../utils/index.js"),h=require("../context/GanttContext.js"),V=require("../constants/index.js"),T=require("../messages/index.js"),C=require("@progress/kendo-react-intl");function q(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=q(M),m=o.forwardRef((e,r)=>{const{slotWidth:t=y.slotWidth,firstSlotRangeRef:s,timelineHeaderCell:p}=e,{timezone:i}=h.useGanttPropsContext(),c=C.useInternationalization(),l=o.useRef(null),u=o.useRef(null),w=o.useCallback(f=>{u.current&&u.current.scrollIntoView(f)},[]);o.useImperativeHandle(l,()=>({scrollIntoView:w})),o.useImperativeHandle(r,()=>l.current);const D=h.useGanttDateRangeContext(),R=o.useMemo(()=>{const f=g.getYearSlots(D,{timezone:i},c),d=[];return f.forEach(O=>{const b=g.getMonthSlots(O.range,{timezone:i},c);d.push.apply(d,b)}),s&&d[0]&&(s.current=d[0].range),[f,d]},[i,D.start.getTime(),D.end.getTime(),c]);return o.createElement(S.BaseView,{slotWidth:t,slotLevels:R,timelineHeaderCell:p})}),P=({tasksStart:e,tasksEnd:r,timezone:t})=>{const s=n.ZonedDate.fromLocalDate(e,t),p=n.ZonedDate.fromLocalDate(r,t),i=n.firstDayOfMonth(n.firstMonthOfYear(n.getDate(s))),c=n.addDays(n.lastDayOfMonth(n.lastMonthOfYear(n.getDate(p))),1),l=n.ZonedDate.fromUTCDate(g.toUTCDateTime(i),t),u=n.ZonedDate.fromUTCDate(g.toUTCDateTime(c),t);return{start:new Date(l.getTime()),end:new Date(u.getTime()),zonedStart:l,zonedEnd:u}},y={name:"year",dateRange:P,title:e=>e.toLanguageString(T.yearViewTitle,T.messages[T.yearViewTitle]),slotWidth:V.DEFAULT_COLUMN_WIDTH};m.defaultProps=y;m.propTypes={name:a.string,dateRange:a.oneOfType([a.func,a.object]),title:a.oneOfType([a.string,a.func]),slotWidth:a.number};m.displayName="GanttYearView";exports.GanttYearView=m;exports.defaultProps=y;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ import * as t from "react";
10
+ import e from "prop-types";
11
+ import { ZonedDate as c, firstDayOfMonth as C, firstMonthOfYear as S, getDate as T, addDays as O, lastDayOfMonth as I, lastMonthOfYear as L } from "@progress/kendo-date-math";
12
+ import { BaseView as E } from "../components/BaseView.mjs";
13
+ import { getYearSlots as U, getMonthSlots as W, toUTCDateTime as D } from "../utils/index.mjs";
14
+ import { useGanttPropsContext as Y, useGanttDateRangeContext as b } from "../context/GanttContext.mjs";
15
+ import { DEFAULT_COLUMN_WIDTH as G } from "../constants/index.mjs";
16
+ import { yearViewTitle as h, messages as H } from "../messages/index.mjs";
17
+ import { useInternationalization as P } from "@progress/kendo-react-intl";
18
+ const g = t.forwardRef((n, p) => {
19
+ const { slotWidth: o = y.slotWidth, firstSlotRangeRef: f, timelineHeaderCell: u } = n, { timezone: a } = Y(), r = P(), s = t.useRef(null), i = t.useRef(null), w = t.useCallback(
20
+ (m) => {
21
+ i.current && i.current.scrollIntoView(m);
22
+ },
23
+ []
24
+ );
25
+ t.useImperativeHandle(s, () => ({ scrollIntoView: w })), t.useImperativeHandle(p, () => s.current);
26
+ const d = b(), R = t.useMemo(
27
+ () => {
28
+ const m = U(d, { timezone: a }, r), l = [];
29
+ return m.forEach((M) => {
30
+ const V = W(
31
+ M.range,
32
+ { timezone: a },
33
+ r
34
+ );
35
+ l.push.apply(l, V);
36
+ }), f && l[0] && (f.current = l[0].range), [m, l];
37
+ },
38
+ [a, d.start.getTime(), d.end.getTime(), r]
39
+ );
40
+ return /* @__PURE__ */ t.createElement(
41
+ E,
42
+ {
43
+ slotWidth: o,
44
+ slotLevels: R,
45
+ timelineHeaderCell: u
46
+ }
47
+ );
48
+ }), k = ({ tasksStart: n, tasksEnd: p, timezone: o }) => {
49
+ const f = c.fromLocalDate(n, o), u = c.fromLocalDate(p, o), a = C(S(T(f))), r = O(I(L(T(u))), 1), s = c.fromUTCDate(D(a), o), i = c.fromUTCDate(D(r), o);
50
+ return {
51
+ start: new Date(s.getTime()),
52
+ end: new Date(i.getTime()),
53
+ zonedStart: s,
54
+ zonedEnd: i
55
+ };
56
+ }, y = {
57
+ name: "year",
58
+ dateRange: k,
59
+ title: (n) => n.toLanguageString(h, H[h]),
60
+ slotWidth: G
61
+ };
62
+ g.defaultProps = y;
63
+ g.propTypes = {
64
+ name: e.string,
65
+ dateRange: e.oneOfType([e.func, e.object]),
66
+ title: e.oneOfType([e.string, e.func]),
67
+ slotWidth: e.number
68
+ };
69
+ g.displayName = "GanttYearView";
70
+ export {
71
+ g as GanttYearView,
72
+ y as defaultProps
73
+ };
package/Gantt.d.ts DELETED
@@ -1,29 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the package root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as React from 'react';
6
- import { GanttProps } from './interfaces/GanttProps';
7
- /**
8
- * Represents the Object which is passed to the [`ref`](https://reactjs.org/docs/refs-and-the-dom.html) callback of the Gantt component.
9
- */
10
- export interface GanttHandle {
11
- /**
12
- * The current element or `null` if there is no one.
13
- */
14
- element: HTMLDivElement | null;
15
- /**
16
- * Method to allow the scroll to be set to a specific row index.
17
- */
18
- scrollIntoView: (options: {
19
- rowIndex?: number;
20
- }) => void;
21
- /**
22
- * The props of the Gantt.
23
- */
24
- props: GanttProps;
25
- }
26
- /**
27
- * Represents the Gantt component.
28
- */
29
- export declare const Gantt: React.ForwardRefExoticComponent<GanttProps & React.RefAttributes<GanttHandle | null>>;