@progress/kendo-react-scheduler 9.0.0-develop.2 → 9.0.0-develop.21
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/README.md +28 -28
- package/Scheduler.mjs +42 -65
- package/components/BaseView.mjs +1 -10
- package/components/CurrentTimeMarket.mjs +31 -46
- package/components/DateHeaderCell.mjs +2 -8
- package/components/SchedulerForm.js +1 -1
- package/components/SchedulerForm.mjs +46 -24
- package/components/SchedulerOccurrenceDialog.mjs +5 -7
- package/components/SchedulerRemoveDialog.mjs +42 -31
- package/components/ShowMoreItemsButton.mjs +30 -32
- package/components/TimeHeaderCell.mjs +2 -8
- package/components/footer/SchedulerFooter.js +1 -1
- package/components/footer/SchedulerFooter.mjs +20 -21
- package/components/footer/bussiness-hours/BussinessHours.mjs +15 -16
- package/components/header/SchedulerHeader.mjs +18 -19
- package/components/header/navigation/NavigationDatePicker.mjs +12 -43
- package/components/header/navigation/SchedulerNavigation.mjs +15 -16
- package/components/header/view-selector/SchedulerViewSelector.mjs +15 -16
- package/components/header/view-selector/ViewSelectorItem.mjs +3 -6
- package/components/header/view-selector/ViewSelectorList.mjs +4 -7
- package/context/SchedulerContext.mjs +10 -2
- package/context/SchedulerEditItemContext.mjs +20 -4
- package/context/SchedulerEditSlotContext.mjs +4 -6
- package/context/SchedulerEditTaskContext.mjs +3 -1
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/editors/FilterableComboBox.mjs +4 -10
- package/editors/SchedulerFormEditor.mjs +218 -297
- package/editors/ZonedDateTime.mjs +14 -27
- package/hooks/use-items-focus.mjs +2 -12
- package/hooks/use-items-selection.mjs +2 -12
- package/hooks/use-slots-focus.mjs +9 -1
- package/hooks/useCellSync.js +1 -1
- package/hooks/useCellSync.mjs +8 -9
- package/hooks/useRowSync.js +1 -1
- package/hooks/useRowSync.mjs +7 -5
- package/hooks/useSchedulerItem.js +1 -1
- package/hooks/useSchedulerItem.mjs +21 -16
- package/hooks/useSchedulerSlot.mjs +8 -10
- package/hooks/useSlotExpand.mjs +14 -21
- package/index.d.mts +88 -43
- package/index.d.ts +88 -43
- package/items/SchedulerEditItem.mjs +576 -471
- package/items/SchedulerItem.mjs +294 -304
- package/items/SchedulerItemContent.mjs +6 -10
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +115 -111
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +112 -108
- package/items/hooks/use-show-occurrence-dialog.mjs +5 -1
- package/package-metadata.mjs +1 -1
- package/package.json +11 -11
- package/recurrence/RecurrenceEditor.js +1 -1
- package/recurrence/RecurrenceEditor.mjs +73 -92
- package/recurrence/RecurrenceFrequencyEditor.mjs +10 -18
- package/recurrence/RecurrenceRepeatOnWeekEditor.js +1 -1
- package/recurrence/RecurrenceRepeatOnWeekEditor.mjs +7 -4
- package/recurrence/common.js +1 -1
- package/recurrence/common.mjs +45 -34
- package/services/itemsService.mjs +8 -9
- package/services/occurrenceService.mjs +1 -3
- package/slots/SchedulerEditSlot.mjs +111 -133
- package/slots/SchedulerSlot.mjs +148 -154
- package/slots/SchedulerViewSlot.mjs +7 -5
- package/tasks/SchedulerEditTask.mjs +108 -129
- package/tasks/SchedulerTask.mjs +39 -47
- package/tasks/SchedulerViewTask.mjs +8 -6
- package/utils/index.js +1 -1
- package/utils/index.mjs +99 -96
- package/views/agenda/AgendaView.mjs +50 -66
- package/views/common/HorizontalResourceIterator.mjs +33 -3
- package/views/common/VerticalResourceIterator.mjs +8 -1
- package/views/common/utils.js +1 -1
- package/views/common/utils.mjs +35 -34
- package/views/day/DayViewRowContent.mjs +3 -6
- package/views/day/MultiDayView.js +1 -1
- package/views/day/MultiDayView.mjs +156 -187
- package/views/month/MonthView.mjs +18 -28
- package/views/time/MultiDayTimelineView.js +1 -1
- package/views/time/MultiDayTimelineView.mjs +41 -90
- package/views/time/TimelineViewAllEventsRowContent.mjs +8 -1
- package/views/week/WeekView.mjs +1 -8
- package/views/week/WorkWeekView.mjs +1 -8
package/items/SchedulerItem.mjs
CHANGED
|
@@ -14,314 +14,304 @@ import { deleteTitle as W, messages as ze } from "../messages/index.mjs";
|
|
|
14
14
|
import { formatEventTime as he } from "../utils/index.mjs";
|
|
15
15
|
import { useSchedulerItem as Ce } from "../hooks/useSchedulerItem.mjs";
|
|
16
16
|
import { useEditable as Ee } from "../hooks/useEditable.mjs";
|
|
17
|
-
const Re = t.forwardRef(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
()
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
const Re = t.forwardRef(
|
|
18
|
+
(e, $) => {
|
|
19
|
+
const {
|
|
20
|
+
// Focus
|
|
21
|
+
onFocus: d,
|
|
22
|
+
onBlur: m,
|
|
23
|
+
// Mouse
|
|
24
|
+
onMouseDown: k,
|
|
25
|
+
onClick: g,
|
|
26
|
+
onMouseUp: f,
|
|
27
|
+
onMouseOut: v,
|
|
28
|
+
onMouseOver: b,
|
|
29
|
+
onMouseEnter: z,
|
|
30
|
+
onMouseLeave: h,
|
|
31
|
+
onDoubleClick: C,
|
|
32
|
+
onRemoveClick: E,
|
|
33
|
+
// Keyboard
|
|
34
|
+
onKeyUp: R,
|
|
35
|
+
onKeyDown: D,
|
|
36
|
+
onKeyPress: M,
|
|
37
|
+
// Drag
|
|
38
|
+
onPress: y,
|
|
39
|
+
onDrag: N,
|
|
40
|
+
onRelease: x,
|
|
41
|
+
// Resize
|
|
42
|
+
onResizePress: H,
|
|
43
|
+
onResizeEndDrag: I,
|
|
44
|
+
onResizeRelease: P,
|
|
45
|
+
onResizeStartDrag: F
|
|
46
|
+
} = e, { item: a, element: S } = Ce(e, $), K = de(S), w = t.useRef(null), L = t.useRef(null), O = t.useRef(null), U = t.useRef(null), l = Ee(e.editable), c = ke(), A = ge().toLanguageString(W, ze[W]), s = e.group.resources.find(
|
|
47
|
+
(n) => !!(n.colorField && n[n.colorField] !== "" && n[n.colorField] !== void 0)
|
|
48
|
+
), r = s && s.colorField && s[s.colorField], j = e.tabIndex !== void 0 ? e.tabIndex === null ? void 0 : e.tabIndex : e.selected ? 0 : -1, G = t.useMemo(
|
|
49
|
+
() => me(
|
|
50
|
+
{
|
|
51
|
+
"k-event": !e.resizeHint,
|
|
52
|
+
"k-selected": e.selected && l.select,
|
|
53
|
+
"k-event-drag-hint": e.dragHint,
|
|
54
|
+
"k-scheduler-marquee": e.resizeHint,
|
|
55
|
+
"k-marquee": e.resizeHint,
|
|
56
|
+
"k-first": e.resizeHint && !e.tail,
|
|
57
|
+
"k-last": e.resizeHint && !e.head
|
|
58
|
+
},
|
|
59
|
+
e.className
|
|
60
|
+
),
|
|
61
|
+
[e.resizeHint, e.selected, e.dragHint, e.tail, e.head, e.className, l.select]
|
|
62
|
+
), J = t.useMemo(
|
|
63
|
+
() => `${he(c, e.zonedStart, e.zonedEnd, e.isAllDay)}, ${e.title}`,
|
|
64
|
+
[c, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
|
|
65
|
+
), Q = t.useMemo(
|
|
66
|
+
() => ({
|
|
67
|
+
cursor: "pointer",
|
|
68
|
+
userSelect: "none",
|
|
69
|
+
borderColor: e.resizeHint ? void 0 : r,
|
|
70
|
+
backgroundColor: e.resizeHint ? void 0 : r,
|
|
71
|
+
touchAction: "none",
|
|
72
|
+
...e.style
|
|
73
|
+
}),
|
|
74
|
+
[r, e.style, e.resizeHint]
|
|
75
|
+
), V = t.useCallback(
|
|
76
|
+
(n) => {
|
|
77
|
+
d && d.call(void 0, {
|
|
78
|
+
syntheticEvent: n,
|
|
79
|
+
target: a.current
|
|
80
|
+
});
|
|
55
81
|
},
|
|
56
|
-
|
|
57
|
-
),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
e.head,
|
|
64
|
-
e.className,
|
|
65
|
-
l.select
|
|
66
|
-
]
|
|
67
|
-
), J = t.useMemo(
|
|
68
|
-
() => `${he(c, e.zonedStart, e.zonedEnd, e.isAllDay)}, ${e.title}`,
|
|
69
|
-
[c, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
|
|
70
|
-
), Q = t.useMemo(
|
|
71
|
-
() => ({
|
|
72
|
-
cursor: "pointer",
|
|
73
|
-
userSelect: "none",
|
|
74
|
-
borderColor: e.resizeHint ? void 0 : r,
|
|
75
|
-
backgroundColor: e.resizeHint ? void 0 : r,
|
|
76
|
-
touchAction: "none",
|
|
77
|
-
...e.style
|
|
78
|
-
}),
|
|
79
|
-
[r, e.style, e.resizeHint]
|
|
80
|
-
), V = t.useCallback(
|
|
81
|
-
(n) => {
|
|
82
|
-
d && d.call(void 0, {
|
|
83
|
-
syntheticEvent: n,
|
|
84
|
-
target: a.current
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
[d, a]
|
|
88
|
-
), X = t.useCallback(
|
|
89
|
-
(n) => {
|
|
90
|
-
m && m.call(void 0, {
|
|
91
|
-
syntheticEvent: n,
|
|
92
|
-
target: a.current
|
|
93
|
-
});
|
|
94
|
-
},
|
|
95
|
-
[m, a]
|
|
96
|
-
), Y = t.useCallback(
|
|
97
|
-
(n) => {
|
|
98
|
-
k && k.call(void 0, {
|
|
99
|
-
syntheticEvent: n,
|
|
100
|
-
target: a.current
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
[k, a]
|
|
104
|
-
), Z = t.useCallback(
|
|
105
|
-
(n) => {
|
|
106
|
-
g && g.call(void 0, {
|
|
107
|
-
syntheticEvent: n,
|
|
108
|
-
target: a.current
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
[g, a]
|
|
112
|
-
), _ = t.useCallback(
|
|
113
|
-
(n) => {
|
|
114
|
-
f && f.call(void 0, {
|
|
115
|
-
syntheticEvent: n,
|
|
116
|
-
target: a.current
|
|
117
|
-
});
|
|
118
|
-
},
|
|
119
|
-
[f, a]
|
|
120
|
-
), p = t.useCallback(
|
|
121
|
-
(n) => {
|
|
122
|
-
b && b.call(void 0, {
|
|
123
|
-
syntheticEvent: n,
|
|
124
|
-
target: a.current
|
|
125
|
-
});
|
|
126
|
-
},
|
|
127
|
-
[b, a]
|
|
128
|
-
), ee = t.useCallback(
|
|
129
|
-
(n) => {
|
|
130
|
-
v && v.call(void 0, {
|
|
131
|
-
syntheticEvent: n,
|
|
132
|
-
target: a.current
|
|
133
|
-
});
|
|
134
|
-
},
|
|
135
|
-
[v, a]
|
|
136
|
-
), te = t.useCallback(
|
|
137
|
-
(n) => {
|
|
138
|
-
z && z.call(void 0, {
|
|
139
|
-
syntheticEvent: n,
|
|
140
|
-
target: a.current
|
|
141
|
-
});
|
|
142
|
-
},
|
|
143
|
-
[z, a]
|
|
144
|
-
), ne = t.useCallback(
|
|
145
|
-
(n) => {
|
|
146
|
-
h && h.call(void 0, {
|
|
147
|
-
syntheticEvent: n,
|
|
148
|
-
target: a.current
|
|
149
|
-
});
|
|
150
|
-
},
|
|
151
|
-
[h, a]
|
|
152
|
-
), ae = t.useCallback(
|
|
153
|
-
(n) => {
|
|
154
|
-
C && C.call(void 0, {
|
|
155
|
-
syntheticEvent: n,
|
|
156
|
-
target: a.current
|
|
157
|
-
});
|
|
158
|
-
},
|
|
159
|
-
[C, a]
|
|
160
|
-
), le = t.useCallback(
|
|
161
|
-
(n) => {
|
|
162
|
-
E && E.call(void 0, {
|
|
163
|
-
syntheticEvent: n,
|
|
164
|
-
target: a.current
|
|
165
|
-
});
|
|
166
|
-
},
|
|
167
|
-
[E, a]
|
|
168
|
-
), re = t.useCallback(
|
|
169
|
-
(n) => {
|
|
170
|
-
D && D.call(void 0, {
|
|
171
|
-
syntheticEvent: n,
|
|
172
|
-
target: a.current
|
|
173
|
-
});
|
|
174
|
-
},
|
|
175
|
-
[D, a]
|
|
176
|
-
), oe = t.useCallback(
|
|
177
|
-
(n) => {
|
|
178
|
-
M && M.call(void 0, {
|
|
179
|
-
syntheticEvent: n,
|
|
180
|
-
target: a.current
|
|
181
|
-
});
|
|
182
|
-
},
|
|
183
|
-
[M, a]
|
|
184
|
-
), ce = t.useCallback(
|
|
185
|
-
(n) => {
|
|
186
|
-
R && R.call(void 0, {
|
|
187
|
-
syntheticEvent: n,
|
|
188
|
-
target: a.current
|
|
189
|
-
});
|
|
190
|
-
},
|
|
191
|
-
[R, a]
|
|
192
|
-
), se = t.useCallback(
|
|
193
|
-
(n) => {
|
|
194
|
-
y && y.call(void 0, {
|
|
195
|
-
dragEvent: n,
|
|
196
|
-
target: a.current
|
|
197
|
-
});
|
|
198
|
-
},
|
|
199
|
-
[y, a]
|
|
200
|
-
), ie = t.useCallback(
|
|
201
|
-
(n) => {
|
|
202
|
-
N && N.call(void 0, {
|
|
203
|
-
dragEvent: n,
|
|
204
|
-
target: a.current
|
|
205
|
-
});
|
|
206
|
-
},
|
|
207
|
-
[N, a]
|
|
208
|
-
), ue = t.useCallback(
|
|
209
|
-
(n) => {
|
|
210
|
-
x && x.call(void 0, {
|
|
211
|
-
dragEvent: n,
|
|
212
|
-
target: a.current
|
|
213
|
-
});
|
|
214
|
-
},
|
|
215
|
-
[x, a]
|
|
216
|
-
), i = t.useCallback(
|
|
217
|
-
(n) => {
|
|
218
|
-
H && H.call(void 0, {
|
|
219
|
-
dragEvent: n,
|
|
220
|
-
target: a.current
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
[H, a]
|
|
224
|
-
), q = t.useCallback(
|
|
225
|
-
(n) => {
|
|
226
|
-
F && F.call(void 0, {
|
|
227
|
-
dragEvent: n,
|
|
228
|
-
target: a.current
|
|
229
|
-
});
|
|
230
|
-
},
|
|
231
|
-
[F, a]
|
|
232
|
-
), B = t.useCallback(
|
|
233
|
-
(n) => {
|
|
234
|
-
I && I.call(void 0, {
|
|
235
|
-
dragEvent: n,
|
|
236
|
-
target: a.current
|
|
237
|
-
});
|
|
238
|
-
},
|
|
239
|
-
[I, a]
|
|
240
|
-
), u = t.useCallback(
|
|
241
|
-
(n) => {
|
|
242
|
-
P && P.call(void 0, {
|
|
243
|
-
dragEvent: n,
|
|
244
|
-
target: a.current
|
|
245
|
-
});
|
|
246
|
-
},
|
|
247
|
-
[P, a]
|
|
248
|
-
);
|
|
249
|
-
return o(S, {
|
|
250
|
-
onPress: se,
|
|
251
|
-
onDrag: ie,
|
|
252
|
-
onRelease: ue
|
|
253
|
-
}), o(w, {
|
|
254
|
-
onPress: i,
|
|
255
|
-
onDrag: B,
|
|
256
|
-
onRelease: u
|
|
257
|
-
}), o(L, {
|
|
258
|
-
onPress: i,
|
|
259
|
-
onDrag: q,
|
|
260
|
-
onRelease: u
|
|
261
|
-
}), o(O, {
|
|
262
|
-
onPress: i,
|
|
263
|
-
onDrag: q,
|
|
264
|
-
onRelease: u
|
|
265
|
-
}), o(U, {
|
|
266
|
-
onPress: i,
|
|
267
|
-
onDrag: B,
|
|
268
|
-
onRelease: u
|
|
269
|
-
}), /* @__PURE__ */ t.createElement(
|
|
270
|
-
"div",
|
|
271
|
-
{
|
|
272
|
-
ref: S,
|
|
273
|
-
id: e.id,
|
|
274
|
-
style: Q,
|
|
275
|
-
tabIndex: j,
|
|
276
|
-
className: G,
|
|
277
|
-
role: "button",
|
|
278
|
-
"aria-label": J,
|
|
279
|
-
onFocus: V,
|
|
280
|
-
onBlur: X,
|
|
281
|
-
onMouseUp: _,
|
|
282
|
-
onMouseDown: Y,
|
|
283
|
-
onClick: Z,
|
|
284
|
-
onMouseOver: p,
|
|
285
|
-
onMouseOut: ee,
|
|
286
|
-
onMouseEnter: te,
|
|
287
|
-
onMouseLeave: ne,
|
|
288
|
-
onDoubleClick: ae,
|
|
289
|
-
onKeyDown: re,
|
|
290
|
-
onKeyPress: oe,
|
|
291
|
-
onKeyUp: ce,
|
|
292
|
-
"data-group-index": e.group.index,
|
|
293
|
-
"data-range-index": e.range.index
|
|
294
|
-
},
|
|
295
|
-
e.children,
|
|
296
|
-
!e.resizeHint && /* @__PURE__ */ t.createElement("span", { className: "k-event-actions" }, l.remove && /* @__PURE__ */ t.createElement(
|
|
297
|
-
"a",
|
|
298
|
-
{
|
|
299
|
-
tabIndex: -1,
|
|
300
|
-
"aria-hidden": "true",
|
|
301
|
-
className: "k-link k-event-delete",
|
|
302
|
-
title: A,
|
|
303
|
-
"aria-label": A,
|
|
304
|
-
onClick: le
|
|
82
|
+
[d, a]
|
|
83
|
+
), X = t.useCallback(
|
|
84
|
+
(n) => {
|
|
85
|
+
m && m.call(void 0, {
|
|
86
|
+
syntheticEvent: n,
|
|
87
|
+
target: a.current
|
|
88
|
+
});
|
|
305
89
|
},
|
|
306
|
-
|
|
307
|
-
),
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
90
|
+
[m, a]
|
|
91
|
+
), Y = t.useCallback(
|
|
92
|
+
(n) => {
|
|
93
|
+
k && k.call(void 0, {
|
|
94
|
+
syntheticEvent: n,
|
|
95
|
+
target: a.current
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
[k, a]
|
|
99
|
+
), Z = t.useCallback(
|
|
100
|
+
(n) => {
|
|
101
|
+
g && g.call(void 0, {
|
|
102
|
+
syntheticEvent: n,
|
|
103
|
+
target: a.current
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
[g, a]
|
|
107
|
+
), _ = t.useCallback(
|
|
108
|
+
(n) => {
|
|
109
|
+
f && f.call(void 0, {
|
|
110
|
+
syntheticEvent: n,
|
|
111
|
+
target: a.current
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
[f, a]
|
|
115
|
+
), p = t.useCallback(
|
|
116
|
+
(n) => {
|
|
117
|
+
b && b.call(void 0, {
|
|
118
|
+
syntheticEvent: n,
|
|
119
|
+
target: a.current
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
[b, a]
|
|
123
|
+
), ee = t.useCallback(
|
|
124
|
+
(n) => {
|
|
125
|
+
v && v.call(void 0, {
|
|
126
|
+
syntheticEvent: n,
|
|
127
|
+
target: a.current
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
[v, a]
|
|
131
|
+
), te = t.useCallback(
|
|
132
|
+
(n) => {
|
|
133
|
+
z && z.call(void 0, {
|
|
134
|
+
syntheticEvent: n,
|
|
135
|
+
target: a.current
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
[z, a]
|
|
139
|
+
), ne = t.useCallback(
|
|
140
|
+
(n) => {
|
|
141
|
+
h && h.call(void 0, {
|
|
142
|
+
syntheticEvent: n,
|
|
143
|
+
target: a.current
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
[h, a]
|
|
147
|
+
), ae = t.useCallback(
|
|
148
|
+
(n) => {
|
|
149
|
+
C && C.call(void 0, {
|
|
150
|
+
syntheticEvent: n,
|
|
151
|
+
target: a.current
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
[C, a]
|
|
155
|
+
), le = t.useCallback(
|
|
156
|
+
(n) => {
|
|
157
|
+
E && E.call(void 0, {
|
|
158
|
+
syntheticEvent: n,
|
|
159
|
+
target: a.current
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
[E, a]
|
|
163
|
+
), re = t.useCallback(
|
|
164
|
+
(n) => {
|
|
165
|
+
D && D.call(void 0, {
|
|
166
|
+
syntheticEvent: n,
|
|
167
|
+
target: a.current
|
|
168
|
+
});
|
|
169
|
+
},
|
|
170
|
+
[D, a]
|
|
171
|
+
), oe = t.useCallback(
|
|
172
|
+
(n) => {
|
|
173
|
+
M && M.call(void 0, {
|
|
174
|
+
syntheticEvent: n,
|
|
175
|
+
target: a.current
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
[M, a]
|
|
179
|
+
), ce = t.useCallback(
|
|
180
|
+
(n) => {
|
|
181
|
+
R && R.call(void 0, {
|
|
182
|
+
syntheticEvent: n,
|
|
183
|
+
target: a.current
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
[R, a]
|
|
187
|
+
), se = t.useCallback(
|
|
188
|
+
(n) => {
|
|
189
|
+
y && y.call(void 0, {
|
|
190
|
+
dragEvent: n,
|
|
191
|
+
target: a.current
|
|
192
|
+
});
|
|
193
|
+
},
|
|
194
|
+
[y, a]
|
|
195
|
+
), ie = t.useCallback(
|
|
196
|
+
(n) => {
|
|
197
|
+
N && N.call(void 0, {
|
|
198
|
+
dragEvent: n,
|
|
199
|
+
target: a.current
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
[N, a]
|
|
203
|
+
), ue = t.useCallback(
|
|
204
|
+
(n) => {
|
|
205
|
+
x && x.call(void 0, {
|
|
206
|
+
dragEvent: n,
|
|
207
|
+
target: a.current
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
[x, a]
|
|
211
|
+
), i = t.useCallback(
|
|
212
|
+
(n) => {
|
|
213
|
+
H && H.call(void 0, {
|
|
214
|
+
dragEvent: n,
|
|
215
|
+
target: a.current
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
[H, a]
|
|
219
|
+
), q = t.useCallback(
|
|
220
|
+
(n) => {
|
|
221
|
+
F && F.call(void 0, {
|
|
222
|
+
dragEvent: n,
|
|
223
|
+
target: a.current
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
[F, a]
|
|
227
|
+
), B = t.useCallback(
|
|
228
|
+
(n) => {
|
|
229
|
+
I && I.call(void 0, {
|
|
230
|
+
dragEvent: n,
|
|
231
|
+
target: a.current
|
|
232
|
+
});
|
|
233
|
+
},
|
|
234
|
+
[I, a]
|
|
235
|
+
), u = t.useCallback(
|
|
236
|
+
(n) => {
|
|
237
|
+
P && P.call(void 0, {
|
|
238
|
+
dragEvent: n,
|
|
239
|
+
target: a.current
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
[P, a]
|
|
243
|
+
);
|
|
244
|
+
return o(S, {
|
|
245
|
+
onPress: se,
|
|
246
|
+
onDrag: ie,
|
|
247
|
+
onRelease: ue
|
|
248
|
+
}), o(w, {
|
|
249
|
+
onPress: i,
|
|
250
|
+
onDrag: B,
|
|
251
|
+
onRelease: u
|
|
252
|
+
}), o(L, {
|
|
253
|
+
onPress: i,
|
|
254
|
+
onDrag: q,
|
|
255
|
+
onRelease: u
|
|
256
|
+
}), o(O, {
|
|
257
|
+
onPress: i,
|
|
258
|
+
onDrag: q,
|
|
259
|
+
onRelease: u
|
|
260
|
+
}), o(U, {
|
|
261
|
+
onPress: i,
|
|
262
|
+
onDrag: B,
|
|
263
|
+
onRelease: u
|
|
264
|
+
}), /* @__PURE__ */ t.createElement(
|
|
317
265
|
"div",
|
|
318
266
|
{
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
267
|
+
ref: S,
|
|
268
|
+
id: e.id,
|
|
269
|
+
style: Q,
|
|
270
|
+
tabIndex: j,
|
|
271
|
+
className: G,
|
|
272
|
+
role: "button",
|
|
273
|
+
"aria-label": J,
|
|
274
|
+
onFocus: V,
|
|
275
|
+
onBlur: X,
|
|
276
|
+
onMouseUp: _,
|
|
277
|
+
onMouseDown: Y,
|
|
278
|
+
onClick: Z,
|
|
279
|
+
onMouseOver: p,
|
|
280
|
+
onMouseOut: ee,
|
|
281
|
+
onMouseEnter: te,
|
|
282
|
+
onMouseLeave: ne,
|
|
283
|
+
onDoubleClick: ae,
|
|
284
|
+
onKeyDown: re,
|
|
285
|
+
onKeyPress: oe,
|
|
286
|
+
onKeyUp: ce,
|
|
287
|
+
"data-group-index": e.group.index,
|
|
288
|
+
"data-range-index": e.range.index
|
|
289
|
+
},
|
|
290
|
+
e.children,
|
|
291
|
+
!e.resizeHint && /* @__PURE__ */ t.createElement("span", { className: "k-event-actions" }, l.remove && /* @__PURE__ */ t.createElement(
|
|
292
|
+
"a",
|
|
293
|
+
{
|
|
294
|
+
tabIndex: -1,
|
|
295
|
+
"aria-hidden": "true",
|
|
296
|
+
className: "k-link k-event-delete",
|
|
297
|
+
title: A,
|
|
298
|
+
"aria-label": A,
|
|
299
|
+
onClick: le
|
|
300
|
+
},
|
|
301
|
+
/* @__PURE__ */ t.createElement(T, { name: "x", icon: fe })
|
|
302
|
+
), e.head && /* @__PURE__ */ t.createElement(
|
|
303
|
+
T,
|
|
304
|
+
{
|
|
305
|
+
name: K === "rtl" ? "caret-alt-left" : "caret-alt-right",
|
|
306
|
+
icon: K === "rtl" ? ve : be
|
|
307
|
+
}
|
|
308
|
+
)),
|
|
309
|
+
l.resize && e.vertical && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-n", ref: O }), /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-s", ref: U })),
|
|
310
|
+
l.resize && !e.vertical && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-w", ref: L }), /* @__PURE__ */ t.createElement("span", { className: "k-resize-handle k-resize-e", ref: w })),
|
|
311
|
+
e.resizeHint && /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { className: "k-marquee-color", style: { borderColor: r, backgroundColor: r } }), /* @__PURE__ */ t.createElement("div", { className: "k-marquee-text" }, !e.tail && /* @__PURE__ */ t.createElement("div", { className: "k-label-top" }, c.formatDate(e.zonedStart, e.format)), !e.head && /* @__PURE__ */ t.createElement("div", { className: "k-label-bottom" }, c.formatDate(e.zonedEnd, e.format))))
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
);
|
|
325
315
|
Re.displayName = "KendoReactSchedulerItem";
|
|
326
316
|
export {
|
|
327
317
|
Re as SchedulerItem
|
|
@@ -8,16 +8,12 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
10
|
import { classNames as s } from "@progress/kendo-react-common";
|
|
11
|
-
const r = t.forwardRef(
|
|
12
|
-
|
|
13
|
-
() => s(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[e.className]
|
|
18
|
-
);
|
|
19
|
-
return /* @__PURE__ */ t.createElement("div", { ref: a, ...e, className: m });
|
|
20
|
-
});
|
|
11
|
+
const r = t.forwardRef(
|
|
12
|
+
(e, a) => {
|
|
13
|
+
const m = t.useMemo(() => s("k-event-template", e.className), [e.className]);
|
|
14
|
+
return /* @__PURE__ */ t.createElement("div", { ref: a, ...e, className: m });
|
|
15
|
+
}
|
|
16
|
+
);
|
|
21
17
|
export {
|
|
22
18
|
r as SchedulerItemContent
|
|
23
19
|
};
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("react"),oe=require("./SchedulerItem.js"),f=require("../utils/index.js"),g=require("../views/common/utils.js"),h=require("../constants/index.js"),ae=require("@progress/kendo-react-intl"),K=require("./SchedulerItemContent.js"),y=require("@progress/kendo-react-common"),D=require("@progress/kendo-svg-icons"),J=require("../context/SchedulerViewContext.js"),ue=require("../context/SchedulerContext.js"),de=require("../hooks/useRowSync.js");function me(e){const S=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const w=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(S,d,w.get?w:{enumerable:!0,get:()=>e[d]})}}return S.default=e,Object.freeze(S)}const r=me(se),fe=1,Q=r.forwardRef((e,S)=>{const{item:d,_ref:w,itemRef:X,...Y}=e,H=r.useRef(),c=r.useRef(null),q=r.useRef(null),k=r.useRef(null);r.useImperativeHandle(q,()=>({props:e,element:c.current&&c.current.element})),r.useImperativeHandle(S,()=>q.current),r.useImperativeHandle(w,()=>c.current),r.useImperativeHandle(X,()=>c.current);const Z=d||U.item,x=ae.useInternationalization(),[p]=J.useSchedulerViewItemsContext(),[C]=J.useSchedulerViewSlotsContext(),v=ue.useSchedulerElementContext(),[ee,T]=r.useState(!0),[te,ne]=r.useState(!1),M=r.useRef(0),V=y.useDir(v),W=r.useMemo(()=>e.isAllDay?x.toString(e.zonedStart,"t"):x.format("{0:t} - {1:t}",e.zonedStart,e.zonedEnd),[x,e.isAllDay,e.zonedEnd,e.zonedStart]),B=r.useMemo(()=>`(${W}): ${e.title}`,[W,e.title]),N=(n,t)=>{let i=1;return n.forEach(o=>{const u=t.filter(R=>b(o.current.props,R.props));u.length>i&&(i=u.length)}),i},re=(n,t)=>n.map(o=>t.filter(u=>b(o.current.props,u.props))),b=(n,t)=>f.intersects(n.start,n.end,t.start,t.end)&&n.group.index===t.group.index&&n.range.index===t.range.index&&(e.ignoreIsAllDay||n.isAllDay===t.isAllDay),P=()=>{const n=(C||[]).filter(o=>o.current&&b(o.current.props,e));if(n.length===0){T(!1);return}const t=f.first(n);if(!t.current||!c.current)return;const i=g.getRect(t.current.element);g.setRect(c.current.element,i)},z=()=>{const n=(C||[]).filter(s=>s.current&&b(s.current.props,e)),t=c.current&&c.current.element;if(!t||!n.length)return;const i=f.first(n),o=f.last(n);if(!i.current||!c.current||!o.current)return;const u=[],R=[],O=[],F=g.getRect(i.current.element),$=(e.vertical?F.height:F.width)/(i.current.props.end.getTime()-i.current.props.start.getTime()),E=(e.start.getTime()-i.current.props.start.getTime())*$,L=(Math.min(e.end.getTime(),o.current.props.end.getTime())-Math.max(e.start.getTime(),i.current.props.start.getTime()))*$;(p||[]).forEach(s=>{s.current&&(s.current.props.dragHint?R.push(s.current):s.current.props.resizeHint?O.push(s.current):u.push(s.current))});const I=e.dragHint||e.resizeHint?f.calculateOrder(c.current,e.dragHint?R:O,n,e.ignoreIsAllDay):e.order||0;let m=e.dragHint||e.resizeHint?N(n,e.dragHint?R:O):N(n,u);const ce=re(n,u);let _=0;const l=g.getRect(t);if(ce.forEach(s=>{let A=0;s.forEach(a=>{f.intersects(a.props.start,a.props.end,e.start,e.end)&&!(e.dragHint||e.resizeHint)&&a._maxSiblingsPerSlot&&a._maxSiblingsPerSlot>m&&a.element!==t&&(m=a._maxSiblingsPerSlot);const G=g.getRect(a.element);a.props.order!==null&&a.props.order<I&&(A=G.top+G.height-l.top-h.BORDER_WIDTH*I+fe)}),A>_&&(_=A)}),n.length===0){T(!1);return}const le=20;l.width=e.vertical?l.width/m-h.BORDER_WIDTH-le/m:L+h.BORDER_WIDTH,l.height=e.vertical?L-h.BORDER_WIDTH:(e.resizeHint||e.dragHint)&&m<=1?l.height:e.style&&e.style.height?e.style.height:25,l.left=e.vertical?l.left+I*l.width+h.BORDER_WIDTH*I:l.left+(E<0?0:E),l.top=e.vertical?l.top+(E<0?0:E):l.top+_+h.BORDER_WIDTH*I,M.current=m,g.setRect(t,l),ne(!0),T(!0)},j=r.useCallback(n=>{const t=n&&n[0],i=k.current;H.current!==void 0&&window.cancelAnimationFrame(H.current),i&&t&&(i.width!==t.contentRect.width||i.height!==t.contentRect.height)&&(H.current=window.requestAnimationFrame(()=>{P(),z()})),k.current={width:t.contentRect.width,height:t.contentRect.height}},[P,z]);r.useEffect(P),r.useEffect(z);const ie=c.current&&c.current.element?c.current.element.closest(".k-scheduler-layout"):null;return de.useRowSync({element:ie,selector:".k-resource-row",horizontalAttribute:"data-depth-index",verticalAttribute:"data-resource-index",applyTo:".k-resource-cell",syncHeight:e.isLast}),r.useEffect(()=>{if(!v.current)return;const n=window.ResizeObserver,t=n&&new n(j);return t&&t.observe(v.current),()=>{t&&t.disconnect()}},[j,v]),r.createElement(Z,{...Y,_ref:c,_maxSiblingsPerSlot:M,itemRef:c,style:{visibility:te?void 0:"hidden",display:ee?void 0:"none",...e.style}},!e.resizeHint&&r.createElement("span",{className:"k-event-actions"},e.tail&&r.createElement(y.IconWrap,{name:V==="rtl"?"caret-alt-right":"caret-alt-left",icon:V==="rtl"?D.caretAltRightIcon:D.caretAltLeftIcon}),e.isRecurring&&!e.isException&&r.createElement(y.IconWrap,{name:"reload",icon:D.arrowRotateCwIcon}),!e.isRecurring&&e.isException&&r.createElement(y.IconWrap,{name:"non-recurrence",icon:D.nonRecurrenceIcon})),!e.resizeHint&&r.createElement("div",{title:B},!e.isAllDay&&r.createElement(K.SchedulerItemContent,{className:"k-event-template k-event-time "},B),r.createElement(K.SchedulerItemContent,{className:"k-event-template"},e.title)))}),U={item:oe.SchedulerItem};Q.displayName="KendoReactSchedulerProportionalViewItem";exports.SchedulerProportionalViewItem=Q;exports.schedulerProportionalViewItemDefaultProps=U;
|